Commit 7de1cfac authored by xiaoye's avatar xiaoye

追加c:IsRelateToEffect(e)

对于攻击力等数值上升追加c:IsRelateToEffect(e)判断
parent 404dd713
......@@ -385,32 +385,36 @@ end
---@param val integer 要上升的攻击力(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function VgF.AtkUp(c,g,val,reset,resetcount)
if not c then return end
if not c or not g then return end
if not resetcount then resetcount=1 end
if not reset then reset=RESET_PHASE+PHASE_END 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
if tc:IsLocation(LOCATION_MZONE) then
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,resetcount)
tc:RegisterEffect(e1)
table.insert(e,e1)
end
end
return e
elseif VgF.GetValueType(g)=="Card" then
local tc=g
if tc:IsLocation(LOCATION_MZONE) 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)
table.insert(e,e1)
return e1
end
return 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,resetcount)
tc:RegisterEffect(e1)
return e1
end
end
---以c的名义,使g(中的每一张卡)的盾值上升val,并在reset时重置。
......@@ -419,31 +423,35 @@ end
---@param val integer 要上升的盾值(可以为负)
---@param reset integer|nil 指示重置的时点,默认为“回合结束时”。无论如何,都会在离场时重置。
function VgF.DefUp(c,g,val,reset,resetcount)
if not c then return end
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 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
if tc:IsLocation(LOCATION_MZONE) then
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,resetcount)
tc:RegisterEffect(e1)
table.insert(e,e1)
end
end
return e
elseif VgF.GetValueType(g)=="Card" then
local tc=g
if tc:IsLocation(LOCATION_MZONE) then
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,resetcount)
tc:RegisterEffect(e1)
table.insert(e,e1)
return e1
end
return 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,resetcount)
tc:RegisterEffect(e1)
return e1
end
end
---以c的名义,使g(中的每一张卡)的☆上升val,并在reset时重置。
......
......@@ -7,8 +7,10 @@ function cm.initial_effect(c)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=vgf.AtkUp(c,c,5000,nil)
vgf.EffectReset(c,e1,EVENT_BATTLED)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=vgf.AtkUp(c,c,5000,nil)
vgf.EffectReset(c,e1,EVENT_BATTLED)
end
if vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayCount()>=2 and Duel.SelectEffectYesNo(tp,vgf.stringid(VgID,10)) then
local cg=vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil):GetFirst():GetOverlayGroup():Select(tp,2,2,nil)
if vgf.Sendto(LOCATION_DROP,cg,REASON_COST)==2 then
......
......@@ -15,6 +15,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if VgF.GetValueType(ct)=="number" and ct==10102001 and vgf.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_DAMAGE,0,1,nil) and Duel.SelectEffectYesNo(tp,vgf.stringid(VgID,10)) then
local g=vgf.SelectMatchingCard(HINTMSG_DAMAGE,e,tp,Card.IsFaceup,tp,LOCATION_DAMAGE,0,1,1,nil)
Duel.ChangePosition(g,POS_FACEDOWN_ATTACK)
vgf.AtkUp(c,c,15000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,15000)
end
end
end
\ No newline at end of file
......@@ -7,6 +7,8 @@ function cm.initial_effect(c)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=vgf.AtkUp(c,c,5000,nil)
vgf.EffectReset(c,e1,EVENT_BATTLED)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=vgf.AtkUp(c,c,5000,nil)
vgf.EffectReset(c,e1,EVENT_BATTLED)
end
end
......@@ -8,5 +8,7 @@ function cm.initial_effect(c)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,5000,nil)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,5000,nil)
end
end
......@@ -21,8 +21,10 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=vgf.AtkUp(c,c,10000,nil)
vgf.EffectReset(c,e1,EVENT_BATTLED)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=vgf.AtkUp(c,c,10000)
vgf.EffectReset(c,e1,EVENT_BATTLED)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -6,15 +6,17 @@ function cm.initial_effect(c)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,5000,nil)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_ADD_ATTRIBUTE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(SKILL_SUPPORT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,5000,nil)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_ADD_ATTRIBUTE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(SKILL_SUPPORT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return vgf.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_DAMAGE,0,1,nil) and vgf.GetMatchingGroup(vgf.VMonsterFilter,tp,LOCATION_MZONE,0,nil,nil):GetFirst():GetOverlayCount()>=1 end
......
......@@ -17,7 +17,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e2=vgf.AtkUp(c,c,5000)
vgf.EffectReset(c,e2,EVENT_BATTLED)
local e1=Effect.CreateEffect(c)
......
......@@ -7,7 +7,7 @@ function cm.initial_effect(c)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e2=vgf.AtkUp(c,c,10000)
vgf.EffectReset(c,e2,EVENT_BATTLED)
local e1=Effect.CreateEffect(c)
......
......@@ -14,5 +14,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then
vgf.Sendto(LOCATION_OVERLAY,g,vgf.GetVMonster(tp))
end
vgf.AtkUp(c,c,2000,nil)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,2000,nil)
end
end
......@@ -15,8 +15,10 @@ function cm.condition1(e,tp,eg,ep,ev,re,r,rp)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=vgf.AtkUp(c,c,5000,nil)
vgf.EffectReset(c,e1,EVENT_BATTLED)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=vgf.AtkUp(c,c,5000,nil)
vgf.EffectReset(c,e1,EVENT_BATTLED)
end
end
function cm.cfilter(c,mc)
return vgf.GetColumnGroup(c):IsContains(mc) and c:IsControler(mc:GetControler()) and c:GetFlagEffect(FLAG_SUPPORT)>0
......
......@@ -19,8 +19,10 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,15000)
if Duel.GetFlagEffect(tp,m)>0 then vgf.StarUp(c,c,1) end
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,15000)
if Duel.GetFlagEffect(tp,m)>0 then vgf.StarUp(c,c,1) end
end
end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_SELFRIDE)
......
......@@ -5,7 +5,9 @@ function cm.initial_effect(c)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,10000,nil)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,10000,nil)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -12,5 +12,7 @@ function cm.filter(c,tp)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,10000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,10000)
end
end
\ No newline at end of file
......@@ -23,5 +23,7 @@ function cm.filter(c,e,tp)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,2000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,2000)
end
end
\ No newline at end of file
......@@ -5,7 +5,9 @@ function cm.initial_effect(c)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,10000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,10000)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -5,7 +5,9 @@ function cm.initial_effect(c)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,10000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,10000)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -17,7 +17,9 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.VMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT) end
vgf.AtkUp(c,c,10000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,10000)
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>0
......
......@@ -8,8 +8,10 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
local ct=c:GetOverlayCount()
if ct>=5 then Duel.Draw(tp,1,REASON_EFFECT) end
if ct>=10 then
local t={vgf.AtkUp(c,c,10000),vgf.StarUp(c,c,1)}
vgf.EffectReset(c,t,EVENT_BATTLED)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local t={vgf.AtkUp(c,c,10000),vgf.StarUp(c,c,1)}
vgf.EffectReset(c,t,EVENT_BATTLED)
end
end
if ct>=15 then
local g1=vgf.GetMatchingGroup(vgf.RMonsterFilter,tp,LOCATION_MZONE,0,nil)
......
......@@ -18,8 +18,10 @@ end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.OverlayFill(1)(e,tp,eg,ep,ev,re,r,rp,chk)
local e1=vgf.AtkUp(c,c,5000)
vgf.EffectReset(c,e1,EVENT_BATTLED)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=vgf.AtkUp(c,c,5000)
vgf.EffectReset(c,e1,EVENT_BATTLED)
end
end
function cm.condition (e,tp,eg,ep,ev,re,r,rp)
return vgf.GetMatchingGroupCount(vgf.RMonsterFilter,tp,0,LOCATION_MZONE,nil)<=2
......
......@@ -24,7 +24,9 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.DisableShuffleCheck()
if Duel.SelectOption(tp,1195,1196)==1 then
Duel.MoveSequence(g:GetFirst(),1)
vgf.AtkUp(c,c,2000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,2000)
end
end
end
end
\ No newline at end of file
......@@ -8,6 +8,8 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=vgf.AtkUp(c,c,5000)
vgf.EffectReset(c,e1,EVENT_BATTLED)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=vgf.AtkUp(c,c,5000)
vgf.EffectReset(c,e1,EVENT_BATTLED)
end
end
\ No newline at end of file
......@@ -11,5 +11,7 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,2000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,2000)
end
end
......@@ -10,8 +10,10 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=vgf.AtkUp(c,c,5000,nil)
vgf.EffectReset(c,e1,EVENT_BATTLED)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=vgf.AtkUp(c,c,5000,nil)
vgf.EffectReset(c,e1,EVENT_BATTLED)
end
if vgf.IsSequence(c,2) then
vgf.DamageFill(1)(e,tp,eg,ep,ev,re,r,rp)
end
......
......@@ -3,12 +3,14 @@ local cm,m,o=GetID()
function cm.initial_effect(c)
vgf.VgCard(c)
-- 【自】【R】:你的后防者被返回手牌时,这个回合中,这个单位的力量+5000。
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_FIELD,EVENT_TO_HAND,VgF.AtkUp(c,c,5000),nil,cm.con)
vgd.EffectTypeTrigger(c,m,LOCATION_MZONE,EFFECT_TYPE_FIELD,EVENT_TO_HAND, cm.op,nil,cm.con)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c = e:GetHandler()
VgF.AtkUp(c,c,5000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,5000,nil)
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -9,7 +9,9 @@ function cm.initial_effect(c)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
VgF.AtkUp(c,c,5000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
VgF.AtkUp(c,c,5000)
end
end
function cm.filter(c)
return c:IsCode(0xc040) and c:IsAbleToHand()
......
......@@ -11,7 +11,9 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,2000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,2000)
end
end
function cm.filter(c,tp,mc)
local g=VgF.GetColumnGroup(mc)
......
......@@ -12,5 +12,7 @@ function cm.con(e,tp,eg,ep,ev,re,r,rp)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.AtkUp(c,c,2000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,2000)
end
end
\ No newline at end of file
......@@ -11,7 +11,9 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.SearchCard(LOCATION_HAND,LOCATION_DECK,cm.filter)(e,tp,eg,ep,ev,re,r,rp)
vgf.AtkUp(c,c,10000,nil)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,10000,nil)
end
end
--返回效果一寻找卡密
function cm.filter(c)
......@@ -27,6 +29,8 @@ function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=vgf.SelectMatchingCard(HINTMSG_LEAVEONFIELD,e,tp,vgf.RMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
vgf.Sendto(LOCATION_DROP,g,REASON_EFFECT)
vgf.AtkUp(c,c,5000)
vgf.StarUp(c,c,1)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,5000)
vgf.StarUp(c,c,1)
end
end
\ No newline at end of file
......@@ -7,7 +7,9 @@ end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.SearchCard(LOCATION_HAND,LOCATION_DECK,cm.filter,1,0)(e,tp,eg,ep,ev,re,r,rp)
vgf.AtkUp(c,c,10000)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,10000)
end
end
function cm.filter(c)
return c:IsCode(m)
......
......@@ -11,7 +11,9 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.SearchCard(LOCATION_HAND,LOCATION_DECK,cm.filter)(e,tp,eg,ep,ev,re,r,rp)
vgf.AtkUp(c,c,10000,nil)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,10000,nil)
end
end
--返回效果一寻找目标
function cm.filter(c)
......
......@@ -11,7 +11,9 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
vgf.SearchCard(LOCATION_HAND,LOCATION_DECK,cm.filter)(e,tp,eg,ep,ev,re,r,rp)
vgf.AtkUp(c,c,10000,nil)
if c:IsRelateToEffect(e) and c:IsFaceup() then
vgf.AtkUp(c,c,10000,nil)
end
end
--返回找的卡密
function cm.filter(c)
......
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