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

Add files via upload

parent 092a51a3
......@@ -586,7 +586,6 @@ function VgD.CardTriggerOperation(chkop,f)
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DAMAGE,0,1,1,nil):GetFirst()
if tc then
Duel.SendtoGrave(tc,REASON_TRIGGER)
Duel.Recover(tp,1,REASON_RULE)
end
end
elseif c:IsRace(TRRIGGER_ADVANCE) then
......@@ -603,7 +602,6 @@ function VgD.CardTriggerOperation(chkop,f)
Duel.Exile(c,REASON_TRIGGER)
else
Duel.Sendto(c,tp,LOCATION_DAMAGE,POS_FACEUP_ATTACK,REASON_EFFECT)
Duel.Damage(tp,1,REASON_TRIGGER)
end
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
local bc=rc:GetBattleTarget()
......@@ -723,7 +721,11 @@ function VgD.EventRideStart(e,tp,eg,ep,ev,re,r,rp)
end
function VgD.RuleWin(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()>0 then return end
for WinReason=0x1, 0xff, 1 do
for WinReason=0x1, 0x2, 1 do
if WinReason==0x1 then
local lp=Duel.GetLP(tp)-Duel.GetFieldGroupCount(tp,LOCATION_ORDER,0)
Duel.SetLP(tp,lp)
end
if WinReason==0x2 then
local g1=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local g2=Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)
......@@ -1045,4 +1047,17 @@ function VgD.TriggerCountUpOperation(num)
c:ResetFlagEffect(AttackTriggerFlag)
c:RegisterFlagEffect(AttackTriggerFlag,RESET_EVENT+RESETS_STANDARD,0,1,label)
end
end
function VgD.GlobalCheckEffect(c,m,typ,code,con,op)
if not typ then typ=EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS end
local cm=_G["c"..m]
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(typ)
ge1:SetCode(code)
if VgF.GetValueType(con)=="function" then ge1:SetCondition(con) end
ge1:SetOperation(op)
Duel.RegisterEffect(ge1,0)
end
end
\ No newline at end of file
......@@ -35,6 +35,7 @@ function VgF.DefineArguments()
if not code then code=nil end
if not loc then loc=nil end
if not typ then typ=nil end
if not typ2 then typ2=nil end
if not count then count=nil end
if not property then property=nil end
if not reset then reset=nil end
......@@ -379,31 +380,53 @@ end
---@param g Card|Group 要被上升攻击力的卡
---@param val integer 要上升的攻击力(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function VgF.AtkUp(c,g,val,reset)
function VgF.AtkUp(c,g,val,reset,resetcount,resettype,resetcode)
if not c then return end
if not reset then reset=RESET_PHASE+PHASE_END end
if not resetcount then resetcount=1 end
if not resettype then resettype=EFFECT_TYPE_FIELD end
if not val or val==0 then return end
if VgF.GetValueType(g)=="Group" and g:GetCount()>0 then
local e={}
for tc in VgF.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount)
tc:RegisterEffect(e1)
table.insert(e,e1)
if resetcode then
local e2=Effect.CreateEffect(c)
e2:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(resetcode)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e2)
end
end
return e,#e
elseif VgF.GetValueType(g)=="Card" then
local tc=VgF.ReturnCard(g)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount)
tc:RegisterEffect(e1)
return e1,1
if resetcode>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(resetcode)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e2)
end
end
end
---以c的名义,使g(中的每一张卡)的盾值上升val,并在reset时重置。
......@@ -411,31 +434,53 @@ end
---@param g Card|Group 要被上升盾值的卡
---@param val integer 要上升的盾值(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function VgF.DefUp(c,g,val,reset)
function VgF.DefUp(c,g,val,reset,resetcount,resettype,resetcode)
if not c then return end
if not reset then reset=RESET_PHASE+PHASE_END end
if not resetcount then resetcount=1 end
if not resettype then resettype=EFFECT_TYPE_FIELD end
if not val or val==0 then return end
if VgF.GetValueType(g)=="Group" and g:GetCount()>0 then
local e={}
for tc in VgF.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount)
tc:RegisterEffect(e1)
table.insert(e,e1)
if resetcode>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(resetcode)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e2)
end
end
return e,#e
elseif VgF.GetValueType(g)=="Card" then
local tc=VgF.ReturnCard(g)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount)
tc:RegisterEffect(e1)
return e1,1
if resetcode>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(resetcode)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e2)
end
end
end
---以c的名义,使g(中的每一张卡)的☆上升val,并在reset时重置。
......@@ -443,13 +488,13 @@ end
---@param g Card|Group 要被上升☆的卡
---@param val integer 要上升的☆(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function VgF.StarUp(c,g,val,reset)
function VgF.StarUp(c,g,val,reset,resetcount,resettype,resetcode)
if not c or not g then return end
if not reset then reset=RESET_PHASE+PHASE_END end
if not resetcount then resetcount=1 end
if not resettype then resettype=EFFECT_TYPE_FIELD end
if not val or val==0 then return end
if VgF.GetValueType(g)=="Group" and g:GetCount()>0 then
local el={}
local er={}
for tc in VgF.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -457,15 +502,30 @@ function VgF.StarUp(c,g,val,reset)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE)
tc:RegisterEffect(e2)
table.insert(el,e1)
table.insert(er,er)
if resetcode>0 then
local e3=Effect.CreateEffect(c)
e3:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(resetcode)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetOperation(function (te)
e2:Reset()
te:Reset()
end)
tc:RegisterEffect(e4)
end
end
return el,er,#el,#er
elseif VgF.GetValueType(g)=="Card" then
local tc=VgF.ReturnCard(g)
local e1=Effect.CreateEffect(c)
......@@ -474,12 +534,29 @@ function VgF.StarUp(c,g,val,reset)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+reset,resetcount)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE)
tc:RegisterEffect(e2)
return e1,e2,1,1
if resetcode>0 then
local e3=Effect.CreateEffect(c)
e3:SetType(resettype+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(resetcode)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetOperation(function (te)
e1:Reset()
te:Reset()
end)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetOperation(function (te)
e2:Reset()
te:Reset()
end)
tc:RegisterEffect(e4)
end
end
end
---判断c是否可以以规则的手段到G区域。
......@@ -495,104 +572,123 @@ end
---@return function 效果的Cost函数
function VgF.DisCardCost(num)
return function (e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsDiscardable,tp,LOCATION_HAND,0,nil)
cm.cos_val={nil,num,num}
end
if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,num,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,num,num,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
return VgF.DisCardCostOp(num,e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function VgF.DisCardCostOp(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsDiscardable,tp,LOCATION_HAND,0,nil)
cm.cos_val={nil,num,num}
end
if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,num,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,num,num,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
return Duel.GetOperatedGroup():GetCount()
end
---用于效果的Cost。它返回一个执行“【费用】[能量爆发num]”的函数。
---@param num integer 能量爆发的数量
---@return function 效果的Cost函数
function VgF.EnergyCost(num)
return function (e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_EMBLEM,0,nil,10800730)
cm.cos_val={nil,num,num}
end
if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_EMBLEM,0,num,nil,10800730)
end
local sg=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_EMBLEM,0,nil,10800730)
local g=VgF.GetCardsFromGroup(sg,num)
Duel.Sendto(g,tp,0,POS_FACEUP,REASON_COST)
return VgF.EnergyCostOp(num,e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function VgF.EnergyCostOp(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_EMBLEM,0,nil,10800730)
cm.cos_val={nil,num,num}
end
if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_EMBLEM,0,num,nil,10800730)
end
local sg=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_EMBLEM,0,nil,10800730)
local g=VgF.GetCardsFromGroup(sg,num)
Duel.Sendto(g,tp,0,POS_FACEUP,REASON_COST)
return Duel.GetOperatedGroup():GetCount()
end
---用于效果的Cost。它返回一个执行“【费用】[灵魂爆发num]”的函数。
---@param num integer 灵魂爆发的数量
---@return function 效果的Cost函数
function VgF.OverlayCost(num)
return function (e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayGroup():FilterCount(Card.IsAbleToGraveAsCost,nil)
cm.cos_val={nil,num,num}
end
if chk==0 then
return Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayGroup():FilterCount(Card.IsAbleToGraveAsCost,nil)>=num
function VgF.EnergyCost(num)
return function (e,tp,eg,ep,ev,re,r,rp,chk)
return VgF.OverlayCostOp(num,e,tp,eg,ep,ev,re,r,rp,chk)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
local g=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():FilterSelect(tp,Card.IsAbleToGraveAsCost,num,num,nil)
Duel.SendtoGrave(g,REASON_COST)
end
end
function VgF.OverlayCostOp(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayGroup():FilterCount(Card.IsAbleToGraveAsCost,nil)
cm.cos_val={nil,num,num}
end
if chk==0 then
return Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayGroup():FilterCount(Card.IsAbleToGraveAsCost,nil)>=num
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
local g=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():FilterSelect(tp,Card.IsAbleToGraveAsCost,num,num,nil)
Duel.SendtoGrave(g,REASON_COST)
return Duel.GetOperatedGroup():GetCount()
end
---用于效果的Cost或Operation。它返回一个执行“【费用】[灵魂填充num]”的函数。
---@param num integer 灵魂填充的数量
---@return function 效果的Cost或Operation函数
function VgF.OverlayFill(num)
return function (e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetFieldGroupCount(tp,LOCATION_DECK)
cm.cos_val={nil,num,num}
end
if chk==0 then
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=num
end
VgF.OverlayFillOP(num,e,tp,eg,ep,ev,re,r,rp)
return VgF.OverlayFillOP(num,e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function VgF.OverlayFillOP(num,e,tp,eg,ep,ev,re,r,rp)
function VgF.OverlayFillOP(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetFieldGroupCount(tp,LOCATION_DECK)
cm.cos_val={nil,num,num}
end
if chk==0 then
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=num
end
local rc=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst()
local g=Duel.GetDecktopGroup(tp,num)
Duel.DisableShuffleCheck()
Duel.Overlay(rc,g)
return Duel.GetOperatedGroup():GetCount()
end
---用于效果的Cost。它返回一个执行“【费用】[计数爆发num]”的函数。
---@param num integer 计数爆发的数量
---@return function 效果的Cost函数
function VgF.DamageCost(num)
return function (e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_DAMAGE,0,nil)
cm.cos_val={nil,num,num}
end
if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_DAMAGE,0,num,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DAMAGE)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_DAMAGE,0,num,num,nil)
Duel.ChangePosition(g,POS_FACEDOWN_ATTACK)
return VgF.DamageCostOP(num,e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function VgF.DamageCostOP(num,e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local m=c:GetOriginalCode()
local cm=_G["c"..m]
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
cm.cos_g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_DAMAGE,0,nil)
cm.cos_val={nil,num,num}
end
if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_DAMAGE,0,num,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DAMAGE)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_DAMAGE,0,num,num,nil)
Duel.ChangePosition(g,POS_FACEDOWN_ATTACK)
return Duel.GetOperatedGroup():GetCount()
end
---用于效果的Operation。执行“从loc中选取1张满足f的卡,返回手牌。”。
---@param loc integer 要选取的区域。不填则返回nil,而不是效果的Operation函数。
......
......@@ -3,11 +3,11 @@ local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
vgd.OverDress(c,10101009)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,cm.operation2,nil,cm.condition2)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,cm.operation,nil,cm.condition)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
VgF.AtkUp(c,c,10000,nil)
VgF.AtkUp(c,c,10000,nil,nil,EFFECT_TYPE_SINGLE,EVENT_BATTLED)
if Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayGroup():FilterCount(Card.IsAbleToGraveAsCost,nil)>=2 and Duel.SelectEffectYesNo(tp,vgf.stringid(VgID,10)) then
local cg=Duel.GetMatchingGroup(VgF.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():FilterSelect(tp,Card.IsAbleToGraveAsCost,2,2,nil)
if Duel.SendtoGrave(cg,REASON_COST)==2 then
......@@ -20,7 +20,7 @@ function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return vgf.RMonsterCondition(e) and c:GetFlagEffectLabel(ConditionFlag)==201 and vgf.VMonsterFilter(Duel.GetAttackTarget())
end
\ No newline at end of file
......@@ -36,10 +36,10 @@ function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.filter,1,nil) and eg:Count()==1
return eg:IsExists(cm.filter,1,nil,e) and eg:Count()==1
end
function cm.filter(c)
return c:IsSummonType(SUMMON_VALUE_CALL)
function cm.filter(c,e)
return c:IsSummonType(SUMMON_VALUE_CALL) and c:GetControler()~=e:GetHandler():GetControler()
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local zone=vgf.GetAvailableLocation(tp)
......@@ -47,11 +47,15 @@ function cm.op1(e,tp,eg,ep,ev,re,r,rp)
if ct>e:GetLabel() then ct=e:GetLabel() end
Duel.Hint(HINT_MESSAGE,tp,HINTMSG_CALL)
local g=Duel.SelectMatchingCard(tp,cm.filter1,tp,0,LOCATION_ORDER,ct,ct,nil,e,tp)
if #g>0 then
Duel.HintSelection(g)
vgf.Call(g,0,tp)
Duel.HintSelection(g)
for tc in vgf.Next(g) do
if tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) then
vgf.Call(tc,0,tp)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
end
function cm.filter1(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK,tp) or c:IsType(TYPE_SPELL)
return c:GetFlagEffect(ImprisonFlag)>0
end
\ No newline at end of file
......@@ -6,15 +6,7 @@ function cm.initial_effect(c)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_BATTLED,cm.operation,nil,cm.condition)
--【永】【R】:这个回合中曾有你的等级3以上的先导者登场过的话,这个单位的力量+5000。
vgd.EffectTypeContinuousChangeAttack(c,EFFECT_TYPE_SINGLE,5000,cm.con)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetCondition(cm.checkcon)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
VgD.GlobalCheckEffect(c,m,EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS,EVENT_SPSUMMON_SUCCESS,cm.checkcon,cm.checkop)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>0
......
......@@ -3,15 +3,7 @@ function cm.initial_effect(c)
vgf.VgCard(c)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,cm.operation,vgf.OverlayCost(1),cm.condition)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_BATTLED,cm.operation1,nil,cm.condition1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetCondition(cm.checkcon)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
vgd.GlobalCheckEffect(c,m,EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS,EVENT_SPSUMMON_SUCCESS,cm.checkcon,cm.checkop)
end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_SELFRIDE)
......
local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
vgd.EffectTypeIgnition(c,m,LOCATION_MZONE,cm.op,cm.cost,vgf.VMonsterCondition)
vgd.EffectTypeIgnition(c,m,LOCATION_MZONE,cm.op1,vgf.OverlayCost(5),cm.con,nil,nil,nil,2)
vgd.GlobalCheckEffect(c,m,EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS,EVENT_TO_GRAVE,cm.checkcon,cm.checkop)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_MZONE,0,2,2,nil)
Duel.ChangePosition(g,POS_FACEUP_DEFENCE)
end
function cm.filter(c)
return c:IsCanChangePosition() and c:IsPosition(POS_FACEUP_ATTACK) and vgf.RMonsterFilter(c)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LEAVEONFIELD)
local g=Duel.SelectTarget(tp,vgf.VMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_EFFECT) end
vgf.AtkUp(c,c,10000)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>0
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local ct=6-Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
if ct<=0 then return end
local g=Duel.GetDecktopGroup(tp,ct)
Duel.ConfirmCards(g)
local ct1=vgf.GetAvailableLocation(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CALL)
local sg=g:FilterSelect(tp,Card.IsCanBeSpecialSummoned,0,ct1,nil)
if sg:GetCount()>0 then
vgf.Call(sg,0,tp)
for tc in vgf.Next(sg) do g:RemoveCard(tc) end
end
if g:GetCount()>0 then
local tc=vgf.GetVMonster(tp)
Duel.Overlay(tc,g)
end
end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(1-tp)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
\ No newline at end of file
local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,EVENT_ATTACK_ANNOUNCE,cm.op,vgf.DamageCost(1),vgf.VMonsterCondition)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetOverlayCount()
if ct>=5 then Duel.Draw(tp,1,REASON_EFFECT) end
if ct>=10 then
vgf.AtkUp(c,c,10000,nil,nil,EFFECT_TYPE_SINGLE,EVENT_BATTLED)
vgf.StarUp(c,c,1,nil,nil,EFFECT_TYPE_SINGLE,EVENT_BATTLED)
end
if ct>=15 then
local g1=Duel.GetMatchingGroup(vgf.RMonsterFilter,tp,LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(vgf.RMonsterFilter,tp,0,LOCATION_MZONE,nil)
local tc1=vgf.GetVMonster(tp)
local tc2=vgf.GetVMonster(1-tp)
for tc in vgf.Next(g1) do
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.Overlay(tc1,og)
end
end
for tc in vgf.Next(g2) do
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.Overlay(tc2,og)
end
end
Duel.Overlay(tc1,g1)
Duel.Overlay(tc2,g2)
if vgf.GetAvailableLocation(tp)>0 then
local g=tc1:GetOverlayGroup():FilterSelect(tp,Card.IsCanBeSpecialSummoned,tp,0,2,nil,e,0,tp,false,false,POS_FACEUP_ATTACK)
vgf.Call(g,0,tp)
end
end
end
\ No newline at end of file
local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
vgd.GlobalCheckEffect(c,m,EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS,EVENT_CHANGE_POS,cm.checkcon,cm.checkop)
vgd.EffectTypeContinuousChangeAttack(c,EFFECT_TYPE_SINGLE,5000,cm.con)
vgd.EffectTypeContinuousChangeAttack(c,EFFECT_TYPE_SINGLE,1,cm.con1,nil,nil,EFFECT_UPDATE_LSCALE)
vgd.EffectTypeContinuousChangeAttack(c,EFFECT_TYPE_SINGLE,1,cm.con1,nil,nil,EFFECT_UPDATE_RSCALE)
vgd.EffectTypeTriggerWhenHitting(c,m,LOCATION_MZONE,EFFECT_TYPE_SINGLE,cm.op,vgf.DamageCost(1))
end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffectLabel(tp,ConditionFlag)==10102001
end
function cm.con1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>0 and cm.con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LEAVEONFIELD)
local g=Duel.SelectTarget(tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
if g then
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT)
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