Commit 6622dadb authored by xiaoye's avatar xiaoye

fix

parent 148fc60a
......@@ -431,7 +431,7 @@ end
function VgD.TriggerCard(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetDecktopGroup(tp,1)
Duel.DisableShuffleCheck()
VgF.Sendto(LOCATION_TRIGGER,tg:GetFirst(),tp,tp,POS_FACEUP,true)
VgF.Sendto(LOCATION_TRIGGER,tg:GetFirst())
end
function VgD.MonsterPosDefenseOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -707,10 +707,10 @@ function VgD.CardTriggerOperation(chkop,f)
end)
end
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 ()
VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,1)
end)
return VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,1)
end)
end
while #ops>0 do
local i=Duel.SelectOption(tp,table.unpack(ops))+1
......@@ -738,8 +738,7 @@ function VgD.CardTriggerOperation(chkop,f)
end
function VgD.OperationWhenCardTrigger(e,tp,eg,ep,ev,re,r,rp,c,chk)
local effect_when_trigger
tabel.copy(effect_when_trigger,c.effect_when_trigger)
local effect_when_trigger=c.effect_when_trigger
local cost,con,tg=true,true,true
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
......@@ -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[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 chk==0 then return true else return false end
if chk==0 then return true end
local activate_chk=true
if VgF.GetValueType(effect_when_trigger[2])=="function" then activate_chk=Duel.SelectYesNo(tp,VgF.Stringid(VgID,15)) end
if activate_chk then
......@@ -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)
end
end
return false
end
--vg规则
......
VgF={}
vgf=VgF
bit={}
---@class Card
---@class Group
......@@ -121,7 +122,6 @@ function VgF.GetCardsFromGroup(g,val)
return sg
end
end
bit={}
function bit.ReturnCount(n)
if n==0 then
return 0
......@@ -129,6 +129,14 @@ function bit.ReturnCount(n)
return 1+bit.ReturnCount(n&(n-1))
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进行按位与运算的结果。
---@param a integer 操作数1
---@param b integer 操作数2
......@@ -1127,14 +1135,15 @@ function VgF.Sendto(loc,sg,...)
elseif loc==LOCATION_TRIGGER then
local ct=0
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
return ct
elseif loc==LOCATION_MZONE then
return VgF.Call(g,table.unpack(ext_params))
elseif bit.band(loc,0xf800)>0 or loc==0 then
AddOverlayGroup(g,loc)
Duel.Sendto(g,table.unpack(ext_params))
Duel.Sendto(g,loc,...)
local return_group=Duel.GetOperatedGroup()
return return_group:GetCount()
end
......@@ -1217,14 +1226,6 @@ function VgF.ShiftLocationFromString(str)
return loc
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)
return true
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