Commit 20693313 authored by jwyxym's avatar jwyxym Committed by GitHub

Add files via upload

parent 19fa379a
...@@ -27,7 +27,7 @@ function VgD.RideUpFilter1(c,e,lv,code,rc) ...@@ -27,7 +27,7 @@ function VgD.RideUpFilter1(c,e,lv,code,rc)
if rc:IsAttribute(SKILL_SELF_RIDE) and c:IsCode(code) then if rc:IsAttribute(SKILL_SELF_RIDE) and c:IsCode(code) then
return false return false
end end
return ((c:IsLevel(lv,lv+1) and c:IsLocation(LOCATION_HAND)) or (c:IsLevel(lv+1) and c:IsLocation(LOCATION_RIDE) and Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,0,1))) and c:IsType(TYPE_MONSTER) return ((c:IsLevel(lv,lv+1) and c:IsLocation(LOCATION_HAND)) or (c:IsLevel(lv+1) and c:IsLocation(LOCATION_RIDE) and Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND,0,1,nil))) and c:IsType(TYPE_MONSTER)
end end
function VgD.DisCardRideUpFilter(c,e,lv,code,rc) function VgD.DisCardRideUpFilter(c,e,lv,code,rc)
local tp=c:GetControler() local tp=c:GetControler()
...@@ -482,10 +482,6 @@ function VgD.SendToGOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -482,10 +482,6 @@ function VgD.SendToGOperation(e,tp,eg,ep,ev,re,r,rp)
tc=VgF.ReturnCard(tc) tc=VgF.ReturnCard(tc)
g:AddCard(tc) g:AddCard(tc)
end end
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then
g:Merge(mg)
end
VgF.Sendto(LOCATION_GZONE,g,tp,POS_FACEUP,REASON_EFFECT) VgF.Sendto(LOCATION_GZONE,g,tp,POS_FACEUP,REASON_EFFECT)
end end
function VgD.GToGraveOperation(e,tp,eg,ep,ev,re,r,rp) function VgD.GToGraveOperation(e,tp,eg,ep,ev,re,r,rp)
...@@ -498,9 +494,8 @@ end ...@@ -498,9 +494,8 @@ end
function VgD.MonsterAttackCondition(e,tp,eg,ep,ev,re,r,rp) function VgD.MonsterAttackCondition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not VgF.VMonsterFilter(c) then return false end if not VgF.VMonsterFilter(c) then return false end
local bc=c:GetBattleTarget()
local a=c:GetFlagEffectLabel(AttackTriggerFlag) and c:GetFlagEffectLabel(AttackTriggerFlag)>0 local a=c:GetFlagEffectLabel(AttackTriggerFlag) and c:GetFlagEffectLabel(AttackTriggerFlag)>0
return bc and Duel.GetAttackTarget()==bc and a return a and Duel.GetAttacker()==c
end end
function VgD.MonsterAttackCost(e,tp,eg,ep,ev,re,r,rp,chk) function VgD.MonsterAttackCost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -836,14 +836,18 @@ function VgF.SelectMatchingCard(hintmsg,e,select_tp,f,tp,loc_self,loc_op,int_min ...@@ -836,14 +836,18 @@ function VgF.SelectMatchingCard(hintmsg,e,select_tp,f,tp,loc_self,loc_op,int_min
if g2:GetCount()>0 then g:Merge(g2) end if g2:GetCount()>0 then g:Merge(g2) end
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,select_tp,hintmsg) Duel.Hint(HINT_SELECTMSG,select_tp,hintmsg)
g=g:FilterSelect(select_tp,f,int_min,int_max,except_g,...) if VgF.GetValueType(f)=="function" then
g=g:FilterSelect(select_tp,f,int_min,int_max,except_g,...)
else
g=g:Select(select_tp,int_min,int_max,except_g)
end
end end
if a then Duel.ShuffleDeck(select_tp) end if a then Duel.ShuffleDeck(select_tp) end
return g return g
end end
function VgF.Sendto(loc,sg,...) function VgF.Sendto(loc,sg,...)
local function AddOverlayGroup(g) local function AddOverlayGroup(g)
for tc in VgF.Next(sg) do for tc in VgF.Next(g) do
if tc:GetOverlayCount()>0 then if tc:GetOverlayCount()>0 then
local mg=tc:GetOverlayGroup() local mg=tc:GetOverlayGroup()
g:Merge(mg) g:Merge(mg)
...@@ -855,6 +859,7 @@ function VgF.Sendto(loc,sg,...) ...@@ -855,6 +859,7 @@ function VgF.Sendto(loc,sg,...)
g=Group.Clone(sg) g=Group.Clone(sg)
elseif VgF.GetValueType(sg)=="Card" then elseif VgF.GetValueType(sg)=="Card" then
g=Group.FromCards(sg) g=Group.FromCards(sg)
else return 0
end end
if loc==LOCATION_GRAVE then if loc==LOCATION_GRAVE then
AddOverlayGroup(g) AddOverlayGroup(g)
...@@ -870,23 +875,25 @@ function VgF.Sendto(loc,sg,...) ...@@ -870,23 +875,25 @@ function VgF.Sendto(loc,sg,...)
AddOverlayGroup(g) AddOverlayGroup(g)
return Duel.Exile(g,...) return Duel.Exile(g,...)
elseif loc==LOCATION_OVERLAY then elseif loc==LOCATION_OVERLAY then
local tc=VgF.ReturnCard(sg) AddOverlayGroup(g)
local list={...} local list={...}
local c=list[1] local c=list[1]
Duel.Overlay(c,tc) Duel.Overlay(c,g)
elseif loc==LOCATION_TRIGGER then elseif loc==LOCATION_TRIGGER then
local tc=VgF.ReturnCard(sg) AddOverlayGroup(g)
Duel.MoveToField(tc,...) local list={...}
else local move_tp=list[1]
local loclist={LOCATION_GZONE,LOCATION_ORDER,LOCATION_DAMAGE,LOCATION_SPARE,LOCATION_EMBLEM} local target_tp=list[2]
for i,v in ipairs{loclist} do table.remove(list,1)
if loc==v then table.remove(list,1)
AddOverlayGroup(g) for tc in VgF.Next(g) do
local list={...} Duel.MoveToField(tc,move_tp,target_tp,loc,...)
local tp=list[1]
table.remove(list,1)
return Duel.Sendto(g,tp,loc,...)
end
end end
elseif (loc|0xf800>0) then
AddOverlayGroup(g)
local list={...}
local tp=list[1]
table.remove(list,1)
return Duel.Sendto(g,tp,loc,...)
end end
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