Commit 6622dadb authored by xiaoye's avatar xiaoye

fix

parent 148fc60a
...@@ -431,7 +431,7 @@ end ...@@ -431,7 +431,7 @@ end
function VgD.TriggerCard(e,tp,eg,ep,ev,re,r,rp) function VgD.TriggerCard(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetDecktopGroup(tp,1) local tg=Duel.GetDecktopGroup(tp,1)
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
VgF.Sendto(LOCATION_TRIGGER,tg:GetFirst(),tp,tp,POS_FACEUP,true) VgF.Sendto(LOCATION_TRIGGER,tg:GetFirst())
end end
function VgD.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp) function VgD.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -707,10 +707,10 @@ function VgD.CardTriggerOperation(chkop,f) ...@@ -707,10 +707,10 @@ function VgD.CardTriggerOperation(chkop,f)
end) end)
end end
if VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,0) then if VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,0) then
table.insert(ops,VgF.Stringid(VgID+5,5)) table.insert(ops,VgF.Stringid(VgID+5,6))
table.insert(sel,function () table.insert(sel,function ()
VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,1) return VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,1)
end) end)
end end
while #ops>0 do while #ops>0 do
local i=Duel.SelectOption(tp,table.unpack(ops))+1 local i=Duel.SelectOption(tp,table.unpack(ops))+1
...@@ -738,8 +738,7 @@ function VgD.CardTriggerOperation(chkop,f) ...@@ -738,8 +738,7 @@ function VgD.CardTriggerOperation(chkop,f)
end end
function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk) function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk)
local effect_when_trigger local effect_when_trigger=c.effect_when_trigger
tabel.copy(effect_when_trigger,c.effect_when_trigger)
local cost,con,tg=true,true,true local cost,con,tg=true,true,true
if #effect_when_trigger==0 then return end if #effect_when_trigger==0 then return end
if (VgF.GetValueType(effect_when_trigger[5])=="boolean" and not effect_when_trigger[5]) or (VgF.GetValueType(effect_when_trigger[5])~="boolean" and Duel.GetTurnPlayer()~=c:GetControler()) then return false end if (VgF.GetValueType(effect_when_trigger[5])=="boolean" and not effect_when_trigger[5]) or (VgF.GetValueType(effect_when_trigger[5])~="boolean" and Duel.GetTurnPlayer()~=c:GetControler()) then return false end
...@@ -747,7 +746,7 @@ function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk) ...@@ -747,7 +746,7 @@ function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk)
if VgF.GetValueType(effect_when_trigger[3])=="function" then con=effect_when_trigger[3](e,tp,eg,ep,ev,re,r,rp) end if VgF.GetValueType(effect_when_trigger[3])=="function" then con=effect_when_trigger[3](e,tp,eg,ep,ev,re,r,rp) end
if VgF.GetValueType(effect_when_trigger[4])=="function" then tg=effect_when_trigger[4](e,tp,eg,ep,ev,re,r,rp,0) end if VgF.GetValueType(effect_when_trigger[4])=="function" then tg=effect_when_trigger[4](e,tp,eg,ep,ev,re,r,rp,0) end
if VgF.GetValueType(effect_when_trigger[1])=="function" and cost and con and tg then if VgF.GetValueType(effect_when_trigger[1])=="function" and cost and con and tg then
if chk==0 then return true else return false end if chk==0 then return true end
local activate_chk=true local activate_chk=true
if VgF.GetValueType(effect_when_trigger[2])=="function" then activate_chk=Duel.SelectYesNo(tp,VgF.Stringid(VgID,15)) end if VgF.GetValueType(effect_when_trigger[2])=="function" then activate_chk=Duel.SelectYesNo(tp,VgF.Stringid(VgID,15)) end
if activate_chk then if activate_chk then
...@@ -759,6 +758,7 @@ function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk) ...@@ -759,6 +758,7 @@ function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk)
effect_when_trigger[1](e,tp,eg,ep,ev,re,r,rp) effect_when_trigger[1](e,tp,eg,ep,ev,re,r,rp)
end end
end end
return false
end end
--vg规则 --vg规则
......
VgF={} VgF={}
vgf=VgF vgf=VgF
bit={}
---@class Card ---@class Card
---@class Group ---@class Group
...@@ -121,7 +122,6 @@ function VgF.GetCardsFromGroup(g,val) ...@@ -121,7 +122,6 @@ function VgF.GetCardsFromGroup(g,val)
return sg return sg
end end
end end
bit={}
function bit.ReturnCount(n) function bit.ReturnCount(n)
if n==0 then if n==0 then
return 0 return 0
...@@ -129,6 +129,14 @@ function bit.ReturnCount(n) ...@@ -129,6 +129,14 @@ function bit.ReturnCount(n)
return 1+bit.ReturnCount(n&(n-1)) return 1+bit.ReturnCount(n&(n-1))
end end
function table.copy(copy,original)
copy={}
if VgF.GetValueType(original)~="table" then return end
for i = 1, #original do
table.insert(copy, original[i])
end
end
---返回对a和b进行按位与运算的结果。 ---返回对a和b进行按位与运算的结果。
---@param a integer 操作数1 ---@param a integer 操作数1
---@param b integer 操作数2 ---@param b integer 操作数2
...@@ -1127,14 +1135,15 @@ function VgF.Sendto(loc,sg,...) ...@@ -1127,14 +1135,15 @@ function VgF.Sendto(loc,sg,...)
elseif loc==LOCATION_TRIGGER then elseif loc==LOCATION_TRIGGER then
local ct=0 local ct=0
for tc in VgF.Next(g) do for tc in VgF.Next(g) do
if Duel.MoveToField(tc,table.unpack(ext_params)) then ct=ct+1 end local tp=tc:GetControler()
if Duel.MoveToField(tc,tp,tp,loc,POS_FACEUP,true) then ct=ct+1 end
end end
return ct return ct
elseif loc==LOCATION_MZONE then elseif loc==LOCATION_MZONE then
return VgF.Call(g,table.unpack(ext_params)) return VgF.Call(g,table.unpack(ext_params))
elseif bit.band(loc,0xf800)>0 or loc==0 then elseif bit.band(loc,0xf800)>0 or loc==0 then
AddOverlayGroup(g,loc) AddOverlayGroup(g,loc)
Duel.Sendto(g,table.unpack(ext_params)) Duel.Sendto(g,loc,...)
local return_group=Duel.GetOperatedGroup() local return_group=Duel.GetOperatedGroup()
return return_group:GetCount() return return_group:GetCount()
end end
...@@ -1217,14 +1226,6 @@ function VgF.ShiftLocationFromString(str) ...@@ -1217,14 +1226,6 @@ function VgF.ShiftLocationFromString(str)
return loc return loc
end end
function table.copy(copy,original)
copy={}
if VgF.GetValueType(original)~="table" then return end
for i = 1, #original do
table.insert(copy, original[i])
end
end
function VgF.PlayerEffect(e,tp,eg,ep,ev,re,r,rp) function VgF.PlayerEffect(e,tp,eg,ep,ev,re,r,rp)
return true return true
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment