Commit c7999b67 authored by salix5's avatar salix5

Defence->Defense

parent dcf68785
......@@ -40,7 +40,7 @@ function c10035717.adop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local atk=tc:GetAttack()
local def=tc:GetDefence()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -10,7 +10,7 @@ function c10389794.initial_effect(c)
c:RegisterEffect(e1)
end
function c10389794.filter(c)
return c:IsFaceup() and c:IsDestructable() and (c:GetBaseAttack()==0 or c:GetBaseDefence()==0)
return c:IsFaceup() and c:IsDestructable() and (c:GetBaseAttack()==0 or c:GetBaseDefense()==0)
end
function c10389794.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -52,5 +52,5 @@ function c10591919.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c10591919.cond(e)
return e:GetHandler():IsDefencePos()
return e:GetHandler():IsDefensePos()
end
......@@ -43,7 +43,7 @@ function c11264180.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENCE_FINAL)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(tc:GetDefence()/2)
e2:SetValue(tc:GetDefense()/2)
tc:RegisterEffect(e2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,c11264180.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
......
......@@ -30,7 +30,7 @@ function c11390349.val(e,c)
return Duel.GetMatchingGroupCount(c11390349.vfilter,e:GetOwnerPlayer(),LOCATION_MZONE,0,nil)*-300
end
function c11390349.filter(c)
return c:IsFaceup() and c:GetDefence()==0 and c:IsControlerCanBeChanged()
return c:IsFaceup() and c:GetDefense()==0 and c:IsControlerCanBeChanged()
end
function c11390349.ctltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c11390349.filter(chkc) end
......@@ -41,7 +41,7 @@ function c11390349.ctltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c11390349.ctlop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetDefence()==0 then
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetDefense()==0 then
Duel.GetControl(tc,tp,PHASE_END,1)
end
end
......@@ -21,14 +21,14 @@ function c12014404.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c12014404.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsDefencePos() then
if e:GetHandler():IsDefensePos() then
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
end
function c12014404.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsDefencePos() then
if c:IsDefensePos() then
Duel.Damage(1-tp,800,REASON_EFFECT)
elseif c:IsPosition(POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(c)
......
......@@ -29,7 +29,7 @@ function c13166204.activate(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(re:GetHandler(),REASON_EFFECT)~=0 then
Duel.BreakEffect()
local a=re:GetHandler():GetAttack()
local b=re:GetHandler():GetDefence()
local b=re:GetHandler():GetDefense()
if b>a then a=b end
if a<0 then a=0 end
if a>0 then Duel.Damage(1-tp,a,REASON_EFFECT) end
......
......@@ -14,7 +14,7 @@ function c13215230.initial_effect(c)
end
function c13215230.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(c:GetPreviousPosition(),POS_ATTACK)~=0 and c:IsFaceup() and c:IsDefencePos()
return bit.band(c:GetPreviousPosition(),POS_ATTACK)~=0 and c:IsFaceup() and c:IsDefensePos()
end
function c13215230.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDestructable() end
......
......@@ -37,7 +37,7 @@ function c13611090.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENCE_FINAL)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e2:SetValue(tc:GetDefence()*2)
e2:SetValue(tc:GetDefense()*2)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
......
......@@ -44,7 +44,7 @@ function c13647631.spop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local atk=c:GetBaseAttack()
local def=c:GetBaseDefence()
local def=c:GetBaseDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
......
......@@ -58,7 +58,7 @@ function c14258627.atkval(e,c)
return c:GetAttack()/2
end
function c14258627.defval(e,c)
return c:GetDefence()/2
return c:GetDefense()/2
end
function c14258627.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
......
......@@ -76,7 +76,7 @@ function c14291024.atkval(e,c)
return c:GetFirstCardTarget():GetAttack()
end
function c14291024.defval(e,c)
return c:GetFirstCardTarget():GetDefence()
return c:GetFirstCardTarget():GetDefense()
end
function c14291024.sdcon(e)
return e:GetHandler():GetFirstCardTarget()==nil and e:GetHandler():GetFlagEffect(14291024)~=0
......
......@@ -13,15 +13,15 @@ function c14344682.initial_effect(c)
c:RegisterEffect(e1)
end
function c14344682.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDefencePos() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDefencePos,tp,0,LOCATION_MZONE,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDefensePos() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDefensePos,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEFENCE)
local g=Duel.SelectTarget(tp,Card.IsDefencePos,tp,0,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsDefensePos,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c14344682.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsDefencePos() then
if tc:IsRelateToEffect(e) and tc:IsDefensePos() then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
end
end
......@@ -66,7 +66,7 @@ function c14466224.eqop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()
local def=tc:GetTextDefence()
local def=tc:GetTextDefense()
if atk<0 then atk=0 end
if def<0 then def=0 end
if not Duel.Equip(tp,tc,c,false) then return end
......
......@@ -48,7 +48,7 @@ function c14469229.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsRelateToBattle() and tc:IsFaceup() then
local atk=tc:GetBaseAttack()
local def=tc:GetBaseDefence()
local def=tc:GetBaseDefense()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -28,7 +28,7 @@ function c14731897.activate(e,tp,eg,ep,ev,re,r,rp)
local def=0
local sc=g:GetFirst()
while sc do
local cdef=sc:GetBaseDefence()
local cdef=sc:GetBaseDefense()
if cdef<0 then cdef=0 end
def=def+cdef
sc=g:GetNext()
......
......@@ -16,14 +16,14 @@ end
function c15083728.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=eg:GetFirst()
if chkc then return chkc==tc end
if chk==0 then return ep~=tp and tc:IsFaceup() and tc:GetDefence()<=500 and tc:IsOnField()
if chk==0 then return ep~=tp and tc:IsFaceup() and tc:GetDefense()<=500 and tc:IsOnField()
and tc:IsCanBeEffectTarget(e) and tc:IsDestructable() end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end
function c15083728.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:GetDefence()<=500 then
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:GetDefense()<=500 then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -49,7 +49,7 @@ function c15471265.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENCE_FINAL)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e2:SetValue(rc:GetTextDefence())
e2:SetValue(rc:GetTextDefense())
tc:RegisterEffect(e2)
end
end
......@@ -71,7 +71,7 @@ function c15521027.opa(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleDeck(tp)
end
function c15521027.cond(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsDefencePos()
return e:GetHandler():IsDefensePos()
end
function c15521027.tgd(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
......
......@@ -12,7 +12,7 @@ function c15629801.initial_effect(c)
end
function c15629801.filter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO)
and Duel.IsPlayerCanSpecialSummonMonster(tp,15629802,0,0x4011,c:GetAttack(),c:GetDefence(),c:GetLevel(),c:GetRace(),c:GetAttribute())
and Duel.IsPlayerCanSpecialSummonMonster(tp,15629802,0,0x4011,c:GetAttack(),c:GetDefense(),c:GetLevel(),c:GetRace(),c:GetAttribute())
end
function c15629801.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c15629801.filter(chkc,e,tp) end
......@@ -27,7 +27,7 @@ function c15629801.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,15629802,0,0x4011,tc:GetAttack(),tc:GetDefence(),tc:GetLevel(),tc:GetRace(),tc:GetAttribute()) then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,15629802,0,0x4011,tc:GetAttack(),tc:GetDefense(),tc:GetLevel(),tc:GetRace(),tc:GetAttribute()) then return end
local token=Duel.CreateToken(tp,15629802)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -38,7 +38,7 @@ function c15629801.activate(e,tp,eg,ep,ev,re,r,rp)
token:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENCE)
e2:SetValue(tc:GetDefence())
e2:SetValue(tc:GetDefense())
token:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_LEVEL)
......
......@@ -12,15 +12,15 @@ function c15658249.initial_effect(c)
c:RegisterEffect(e1)
end
function c15658249.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDefencePos() end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDefensePos() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,Card.IsDefencePos,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsDefensePos,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c15658249.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsDefencePos() and tc:IsRelateToEffect(e) then
if tc and tc:IsDefensePos() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,0,0,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
......@@ -11,7 +11,7 @@ function c1571945.initial_effect(c)
c:RegisterEffect(e1)
end
function c1571945.filter(c)
return c:IsDefencePos() and c:IsDestructable()
return c:IsDefensePos() and c:IsDestructable()
end
function c1571945.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c1571945.filter(chkc) end
......@@ -22,7 +22,7 @@ function c1571945.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c1571945.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsDefencePos() and tc:IsRelateToEffect(e) then
if tc and tc:IsDefensePos() and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -13,7 +13,7 @@ function c16222645.initial_effect(c)
end
function c16222645.descon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
return e:GetHandler()==Duel.GetAttacker() and d and d:IsFacedown() and d:IsDefencePos()
return e:GetHandler()==Duel.GetAttacker() and d and d:IsFacedown() and d:IsDefensePos()
end
function c16222645.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -36,7 +36,7 @@ function c16278116.initial_effect(c)
c:RegisterEffect(e4)
end
function c16278116.filter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAttackBelow(2500) and c:IsDefenceBelow(2500)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAttackBelow(2500) and c:IsDefenseBelow(2500)
end
function c16278116.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c16278116.filter(chkc) end
......
......@@ -24,7 +24,7 @@ function c1662004.synlimit(e,c)
return not c:IsRace(RACE_BEASTWARRIOR)
end
function c1662004.spfilter(c,e,tp)
return c:IsDefenceBelow(200) and c:IsAttribute(ATTRIBUTE_FIRE) and c:GetLevel()==3 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsDefenseBelow(200) and c:IsAttribute(ATTRIBUTE_FIRE) and c:GetLevel()==3 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1662004.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c1662004.spfilter(chkc,e,tp) end
......
......@@ -12,7 +12,7 @@ function c16674846.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetBattleDamage(tp)>0
end
function c16674846.filter(c)
return c:IsDefenceBelow(1500) and c:IsType(TYPE_TUNER) and c:IsRace(RACE_WARRIOR)
return c:IsDefenseBelow(1500) and c:IsType(TYPE_TUNER) and c:IsRace(RACE_WARRIOR)
and c:IsAbleToHand()
end
function c16674846.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -50,7 +50,7 @@ function c18013090.cacon(e,tp,eg,ep,ev,re,r,rp)
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
end
function c18013090.filter(c)
return c:IsFaceup() and c:IsDefencePos() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
return c:IsFaceup() and c:IsDefensePos() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c18013090.catg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c18013090.filter(chkc) end
......
......@@ -36,7 +36,7 @@ function c18605135.actcon(e,tp,eg,ep,ev,re,r,rp)
end
function c18605135.abdcon(e)
local at=Duel.GetAttackTarget()
return c18605135.check() and (at==nil or at:IsAttackPos() or Duel.GetAttacker():GetAttack()>at:GetDefence())
return c18605135.check() and (at==nil or at:IsAttackPos() or Duel.GetAttacker():GetAttack()>at:GetDefense())
end
function c18605135.sdcon(e)
return not c18605135.check()
......
......@@ -30,7 +30,7 @@ function c19139516.initial_effect(c)
c:RegisterEffect(e3)
end
function c19139516.regop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDefencePos() and e:GetHandler():IsFaceup() then
if e:GetHandler():IsDefensePos() and e:GetHandler():IsFaceup() then
e:GetHandler():RegisterFlagEffect(19139516,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE,0,1)
end
end
......
......@@ -42,7 +42,7 @@ function c19254117.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENCE_FINAL)
e1:SetValue(tc:GetDefence()*2)
e1:SetValue(tc:GetDefense()*2)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
--def to 0
......
......@@ -60,7 +60,7 @@ function c19508728.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=ec:GetBattleTarget()
if ec and tc and ec:IsFaceup() and tc:IsFaceup() then
local atk=tc:GetAttack()
local def=tc:GetDefence()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -12,7 +12,7 @@ function c19612721.initial_effect(c)
end
function c19612721.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local t=Duel.GetAttackTarget()
if chk==0 then return Duel.GetAttacker()==e:GetHandler() and t~=nil and t:IsDefencePos() and t:IsDefenceAbove(2000) end
if chk==0 then return Duel.GetAttacker()==e:GetHandler() and t~=nil and t:IsDefensePos() and t:IsDefenseAbove(2000) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,t,1,0,0)
end
function c19612721.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -19,7 +19,7 @@ function c19733961.filter(c)
end
function c19733961.atkval(e,c)
local g=Duel.GetMatchingGroup(c19733961.filter,c:GetControler(),LOCATION_MZONE,0,nil)
if g:IsExists(Card.IsDefencePos,1,nil) then return 0 end
if g:IsExists(Card.IsDefensePos,1,nil) then return 0 end
return 500
end
function c19733961.defval(e,c)
......
......@@ -47,7 +47,7 @@ function c2009101.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENCE_FINAL)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(tc:GetDefence()/2)
e2:SetValue(tc:GetDefense()/2)
tc:RegisterEffect(e2)
end
end
......@@ -14,7 +14,7 @@ function c20522190.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c20522190.filter(c)
return c:IsDefencePos() and c:IsAbleToRemove()
return c:IsDefensePos() and c:IsAbleToRemove()
end
function c20522190.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20522190.filter,tp,0,LOCATION_MZONE,1,nil) end
......
......@@ -44,7 +44,7 @@ function c20920083.con(e)
return Duel.IsExistingMatchingCard(c20920083.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,2,nil)
end
function c20920083.tg(e,c)
return c:IsDefencePos()
return c:IsDefensePos()
end
function c20920083.indval(e,re,rp)
return rp~=e:GetHandlerPlayer()
......
......@@ -31,11 +31,11 @@ end
function c21454943.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return Duel.CheckLPCost(tp,100) and e:GetHandler():GetFlagEffect(21454943)==0
and (bc:IsAttackAbove(100) or bc:IsDefenceAbove(100)) end
and (bc:IsAttackAbove(100) or bc:IsDefenseAbove(100)) end
local lp=Duel.GetLP(tp)-1
local alp=100
local maxpay=bc:GetAttack()
local def=bc:GetDefence()
local def=bc:GetDefense()
if maxpay<def then maxpay=def end
if maxpay<lp then lp=maxpay end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(21454943,1))
......
......@@ -36,7 +36,7 @@ function c22160245.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local dam=bc:GetAttack()
if bc:GetAttack() < bc:GetDefence() then dam=bc:GetDefence() end
if bc:GetAttack() < bc:GetDefense() then dam=bc:GetDefense() end
if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
......
......@@ -59,7 +59,7 @@ function c22382087.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_SUMMON)
end
function c22382087.filter(c)
return c:GetAttack()==800 and c:GetDefence()==1000 and not c:IsCode(22382087) and c:IsAbleToHand()
return c:GetAttack()==800 and c:GetDefense()==1000 and not c:IsCode(22382087) and c:IsAbleToHand()
end
function c22382087.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22382087.filter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -68,7 +68,7 @@ function c2250266.atlimit(e,c)
return c~=e:GetHandler()
end
function c2250266.cond(e)
return not e:GetHandler():IsDisabled() and e:GetHandler():IsDefencePos()
return not e:GetHandler():IsDisabled() and e:GetHandler():IsDefensePos()
end
function c2250266.filter(c)
return c:IsFaceup() and c:IsAttackPos()
......
......@@ -14,7 +14,7 @@ function c22765132.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function c22765132.filter(c,def)
return c:IsSetCard(0x9f) and c:IsDefenceBelow(def) and c:IsAbleToHand()
return c:IsSetCard(0x9f) and c:IsDefenseBelow(def) and c:IsAbleToHand()
end
function c22765132.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local at=Duel.GetAttacker()
......@@ -32,7 +32,7 @@ function c22765132.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.SelectMatchingCard(tp,c22765132.filter,tp,LOCATION_DECK,0,1,1,nil,val)
local sc=g1:GetFirst()
if sc then
val=val-sc:GetDefence()
val=val-sc:GetDefense()
if Duel.IsExistingMatchingCard(c22765132.filter,tp,LOCATION_DECK,0,1,sc,val)
and Duel.SelectYesNo(tp,aux.Stringid(22765132,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -132,7 +132,7 @@ function c23064604.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,c23064604.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c23064604.thfilter(c)
return c:IsAttackAbove(2400) and c:GetDefence()==1000 and c:IsAbleToHand()
return c:IsAttackAbove(2400) and c:GetDefense()==1000 and c:IsAbleToHand()
end
function c23064604.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c23064604.thfilter(chkc) end
......
......@@ -21,7 +21,7 @@ function c23093604.initial_effect(c)
c:RegisterEffect(e2)
end
function c23093604.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup() and e:GetHandler():IsDefencePos() and Duel.GetTurnPlayer()~=tp
return e:GetHandler():IsFaceup() and e:GetHandler():IsDefensePos() and Duel.GetTurnPlayer()~=tp
end
function c23093604.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -12,7 +12,7 @@ function c23297235.initial_effect(c)
c:RegisterEffect(e1)
end
function c23297235.filter(c,e,tp)
return c:IsDefenceBelow(200) and c:IsAttribute(ATTRIBUTE_FIRE) and c:GetCode()~=23297235
return c:IsDefenseBelow(200) and c:IsAttribute(ATTRIBUTE_FIRE) and c:GetCode()~=23297235
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23297235.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -18,7 +18,7 @@ function c23535429.condition(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end
local d=Duel.GetAttackTarget()
return d and d:IsControler(tp) and d:IsDefencePos()
return d and d:IsControler(tp) and d:IsDefensePos()
end
function c23535429.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
......
......@@ -67,7 +67,7 @@ function c23756165.eqop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()
local def=tc:GetTextDefence()
local def=tc:GetTextDefense()
if atk<0 then atk=0 end
if def<0 then def=0 end
if not Duel.Equip(tp,tc,c,false) then return end
......
......@@ -39,7 +39,7 @@ function c2377034.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetReason(),0x41)==0x41
end
function c2377034.filter(c)
local def=c:GetDefence()
local def=c:GetDefense()
return def>=0 and def<=200 and c:IsAttribute(ATTRIBUTE_FIRE) and c:GetCode()~=2377034 and c:IsAbleToHand()
end
function c2377034.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -22,7 +22,7 @@ function c2396042.adop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENCE_FINAL)
e1:SetValue(c:GetDefence()/2)
e1:SetValue(c:GetDefense()/2)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e1)
local e2=e1:Clone()
......
......@@ -13,7 +13,7 @@ function c24062258.initial_effect(c)
c:RegisterEffect(e1)
end
function c24062258.filter(c,e,tp)
return c:GetCode()~=24062258 and c:GetLevel()==4 and c:IsAttribute(ATTRIBUTE_DARK) and (c:GetAttack()==0 or c:GetDefence()==0)
return c:GetCode()~=24062258 and c:GetLevel()==4 and c:IsAttribute(ATTRIBUTE_DARK) and (c:GetAttack()==0 or c:GetDefense()==0)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c24062258.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -15,7 +15,7 @@ function c24218047.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c24218047.filter(c,e,tp)
return c:IsDefenceBelow(1500) and c:IsRace(RACE_WYRM)
return c:IsDefenseBelow(1500) and c:IsRace(RACE_WYRM)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c24218047.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -29,7 +29,7 @@ function c24920410.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=tc:GetAttack()*2
local def=tc:GetDefence()*2
local def=tc:GetDefense()*2
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -19,7 +19,7 @@ function c25132288.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
e:SetLabelObject(tc)
return tc and c:GetAttack()>=500 and c:GetDefence()>=500 and tc:IsFaceup() and (tc:GetAttack()>0 or tc:GetDefence()>0)
return tc and c:GetAttack()>=500 and c:GetDefense()>=500 and tc:IsFaceup() and (tc:GetAttack()>0 or tc:GetDefense()>0)
end
function c25132288.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -29,7 +29,7 @@ function c25132288.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup()
and c:GetAttack()>=500 and c:GetDefence()>=500 then
and c:GetAttack()>=500 and c:GetDefense()>=500 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
......
......@@ -57,7 +57,7 @@ function c25704359.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c25704359.cfilter,1,nil,tp)
end
function c25704359.spfilter(c,e,tp,att)
return c:IsRace(RACE_SPELLCASTER) and c:GetDefence()==1500 and c:IsAttribute(att)
return c:IsRace(RACE_SPELLCASTER) and c:GetDefense()==1500 and c:IsAttribute(att)
and (c:IsCanBeSpecialSummoned(e,0,tp,false,false) or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN))
end
function c25704359.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -61,7 +61,7 @@ function c25935625.spfilter1(c,e,tp)
and Duel.IsExistingMatchingCard(c25935625.spfilter2,tp,LOCATION_DECK,0,1,c,e,tp)
end
function c25935625.spfilter2(c,e,tp)
return c:IsSetCard(0x9e) and c:GetDefence()==0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0x9e) and c:GetDefense()==0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c25935625.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
......
......@@ -55,7 +55,7 @@ function c26211048.eqop(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetValue(atk)
tc:RegisterEffect(e2)
local def=tc:GetTextDefence()/2
local def=tc:GetTextDefense()/2
if def<0 then def=0 end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
......
......@@ -36,7 +36,7 @@ function c26376390.operation(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENCE_FINAL)
e2:SetValue(tc:GetBaseDefence())
e2:SetValue(tc:GetBaseDefense())
e2:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e2)
end
......
......@@ -64,17 +64,17 @@ function c26556950.descost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c26556950.desfilter(c,def)
return c:IsFaceup() and c:IsDefenceBelow(def) and c:IsDestructable()
return c:IsFaceup() and c:IsDefenseBelow(def) and c:IsDestructable()
end
function c26556950.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c26556950.desfilter,tp,0,LOCATION_MZONE,1,nil,c:GetDefence()) end
local g=Duel.GetMatchingGroup(c26556950.desfilter,tp,0,LOCATION_MZONE,nil,c:GetDefence())
if chk==0 then return Duel.IsExistingMatchingCard(c26556950.desfilter,tp,0,LOCATION_MZONE,1,nil,c:GetDefense()) end
local g=Duel.GetMatchingGroup(c26556950.desfilter,tp,0,LOCATION_MZONE,nil,c:GetDefense())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c26556950.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(c26556950.desfilter,tp,0,LOCATION_MZONE,nil,c:GetDefence())
local g=Duel.GetMatchingGroup(c26556950.desfilter,tp,0,LOCATION_MZONE,nil,c:GetDefense())
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -68,7 +68,7 @@ function c27551.desop2(e,tp,eg,ep,ev,re,r,rp)
end
function c27551.descon3(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc) and tc:IsDefencePos()
return tc and eg:IsContains(tc) and tc:IsDefensePos()
end
function c27551.desop3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -25,7 +25,7 @@ function c27782503.cfilter(c)
end
function c27782503.descon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
return e:GetHandler()==Duel.GetAttacker() and d and d:IsFacedown() and d:IsDefencePos()
return e:GetHandler()==Duel.GetAttacker() and d and d:IsFacedown() and d:IsDefensePos()
and Duel.IsExistingMatchingCard(c27782503.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c27782503.destg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -26,7 +26,7 @@ function c27827272.filter(c,tp)
and Duel.IsExistingMatchingCard(c27827272.filter2,tp,0,LOCATION_MZONE,1,nil,c:GetAttack())
end
function c27827272.filter2(c,atk)
return c:IsFaceup() and c:IsDefenceBelow(atk) and c:IsDestructable()
return c:IsFaceup() and c:IsDefenseBelow(atk) and c:IsDestructable()
end
function c27827272.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c27827272.filter(chkc,tp) end
......
......@@ -31,7 +31,7 @@ function c27971137.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsReason(REASON_DESTROY)
end
function c27971137.filter(c,e,tp)
return c:GetLevel()==1 and (c:GetAttack()==0 and c:GetDefence()==0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:GetLevel()==1 and (c:GetAttack()==0 and c:GetDefense()==0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c27971137.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -31,7 +31,7 @@ function c28016193.initial_effect(c)
end
function c28016193.damcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return ep~=tp and tc:IsSetCard(0xe1) and tc:GetBattleTarget()~=nil and tc:GetBattleTarget():IsDefencePos()
return ep~=tp and tc:IsSetCard(0xe1) and tc:GetBattleTarget()~=nil and tc:GetBattleTarget():IsDefensePos()
end
function c28016193.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
......
......@@ -34,7 +34,7 @@ function c28066831.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c28066831.filter(c,e,tp)
return c:IsDefenceBelow(1500) and c:IsRace(RACE_PSYCHO) and c:IsAttribute(ATTRIBUTE_WIND)
return c:IsDefenseBelow(1500) and c:IsRace(RACE_PSYCHO) and c:IsAttribute(ATTRIBUTE_WIND)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c28066831.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -15,7 +15,7 @@ function c28120197.initial_effect(c)
c:RegisterEffect(e2)
end
function c28120197.dcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():IsDefencePos() and eg:GetFirst():IsRace(RACE_ROCK)
return eg:GetFirst():IsDefensePos() and eg:GetFirst():IsRace(RACE_ROCK)
end
function c28120197.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
......
......@@ -53,5 +53,5 @@ function c28124263.opa(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
function c28124263.cond(e)
return e:GetHandler():IsDefencePos()
return e:GetHandler():IsDefensePos()
end
......@@ -21,15 +21,15 @@ function c28150174.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c28150174.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDefencePos() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDefencePos,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDefensePos() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDefensePos,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEFENCE)
local g=Duel.SelectTarget(tp,Card.IsDefencePos,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsDefensePos,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c28150174.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsDefencePos() and tc:IsRelateToEffect(e) then
if tc:IsDefensePos() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
if tc:IsPosition(POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -16,7 +16,7 @@ function c28332833.thcon(e,tp,eg,ep,ev,re,r,rp)
and e:GetHandler():IsReason(REASON_BATTLE)
end
function c28332833.filter(c)
return c:GetDefence()==200 and c:IsAbleToHand()
return c:GetDefense()==200 and c:IsAbleToHand()
end
function c28332833.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28332833.filter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -20,7 +20,7 @@ function c29590905.activate(e,tp,eg,ep,ev,re,r,rp)
local g2=Duel.GetMatchingGroup(Card.IsPosition,tp,LOCATION_MZONE,0,nil,POS_FACEUP_DEFENCE)
if g1:GetCount()==0 or g2:GetCount()==0 then return end
local ga=g1:GetMinGroup(Card.GetAttack)
local gd=g2:GetMinGroup(Card.GetDefence)
local gd=g2:GetMinGroup(Card.GetDefense)
if ga:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(29590905,0))
ga=ga:Select(tp,1,1,nil)
......
......@@ -35,7 +35,7 @@ function c29947751.vala(e,c)
else return true end
end
function c29947751.cond(e)
return e:GetHandler():IsDefencePos()
return e:GetHandler():IsDefensePos()
end
function c29947751.atlimit(e,c)
return c~=e:GetHandler()
......
......@@ -16,7 +16,7 @@ function c30646525.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_RITUAL
end
function c30646525.filter(c,atk)
return c:IsFaceup() and c:GetDefence()<=atk and c:IsDestructable()
return c:IsFaceup() and c:GetDefense()<=atk and c:IsDestructable()
end
function c30646525.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -27,7 +27,7 @@ function c31077447.activate(e,tp,eg,ep,ev,re,r,rp)
local sc=g:GetFirst()
if sc and Duel.SendtoGrave(sc,REASON_EFFECT)~=0 and sc:IsLocation(LOCATION_GRAVE) then
Duel.BreakEffect()
local val=math.max(0,sc:GetAttack(),sc:GetDefence())
local val=math.max(0,sc:GetAttack(),sc:GetDefense())
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......
......@@ -31,11 +31,11 @@ function c31472884.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c31472884.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsDiscardable() and c:GetAttack()>=0 and c:GetDefence()>=0
return c:IsType(TYPE_MONSTER) and c:IsDiscardable() and c:GetAttack()>=0 and c:GetDefense()>=0
and Duel.IsExistingTarget(c31472884.tgfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,c)
end
function c31472884.tgfilter(c,dc)
return c:IsFaceup() and (c:GetAttack()~=dc:GetAttack() or c:GetDefence()~=dc:GetDefence())
return c:IsFaceup() and (c:GetAttack()~=dc:GetAttack() or c:GetDefense()~=dc:GetDefense())
end
function c31472884.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
......@@ -66,7 +66,7 @@ end
function c31472884.activate(e,tp,eg,ep,ev,re,r,rp)
local cc=e:GetLabelObject()
local atk=cc:GetAttack()
local def=cc:GetDefence()
local def=cc:GetDefense()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -25,7 +25,7 @@ end
function c31632536.caop1(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if e:GetHandler()==a and d and d:IsDefencePos() then e:SetLabel(1)
if e:GetHandler()==a and d and d:IsDefensePos() then e:SetLabel(1)
else e:SetLabel(0) end
end
function c31632536.caop2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -23,7 +23,7 @@ function c3204467.defval(e,c)
end
function c3204467.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsDefencePos() and c==Duel.GetAttackTarget() then
if c:IsDefensePos() and c==Duel.GetAttackTarget() then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(3204467,0))
e1:SetCategory(CATEGORY_DESTROY)
......
......@@ -20,7 +20,7 @@ end
function c32065885.ctlop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()==0 then return end
local sg=g:GetMaxGroup(Card.GetDefence)
local sg=g:GetMaxGroup(Card.GetDefense)
if sg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
sg=sg:Select(tp,1,1,nil)
......
......@@ -29,7 +29,7 @@ function c32298781.activate(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_DEFENCE)
e2:SetValue(tc:GetBaseDefence()+2000)
e2:SetValue(tc:GetBaseDefense()+2000)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=g:GetNext()
......
......@@ -47,7 +47,7 @@ function c32465539.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c32465539.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsDefencePos() then return end
if not c:IsRelateToEffect(e) or c:IsDefensePos() then return end
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
......
......@@ -88,7 +88,7 @@ function c32491822.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(p,d,REASON_EFFECT)
end
function c32491822.atcon(e)
return e:GetHandler():IsDefencePos()
return e:GetHandler():IsDefensePos()
end
function c32491822.atlimit(e,c)
return c~=e:GetHandler()
......
......@@ -19,7 +19,7 @@ function c32548609.initial_effect(c)
end
function c32548609.descon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
return e:GetHandler()==Duel.GetAttacker() and d and d:IsFacedown() and d:IsDefencePos()
return e:GetHandler()==Duel.GetAttacker() and d and d:IsFacedown() and d:IsDefensePos()
end
function c32548609.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetAttackTarget():IsDestructable() end
......
......@@ -39,7 +39,7 @@ function c33236860.descost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e1,tp)
end
function c33236860.filter(c,atk)
return c:IsFaceup() and c:GetDefence()<atk and c:IsDestructable()
return c:IsFaceup() and c:GetDefense()<atk and c:IsDestructable()
end
function c33236860.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -50,7 +50,7 @@ function c33236860.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c33236860.desfilter(c,e,atk)
return c:IsFaceup() and c:IsRelateToEffect(e) and c:GetDefence()<atk
return c:IsFaceup() and c:IsRelateToEffect(e) and c:GetDefense()<atk
end
function c33236860.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -39,7 +39,7 @@ function c33460840.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if not Duel.Equip(tp,tc,c,true) then return end
local atk=tc:GetTextAttack()/2
local def=tc:GetTextDefence()/2
local def=tc:GetTextDefense()/2
if atk<0 then atk=0 end
if def<0 then def=0 end
--Add Equip limit
......
......@@ -12,7 +12,7 @@ function c33609262.initial_effect(c)
c:RegisterEffect(e1)
end
function c33609262.cfilter(c)
return (c:GetAttack()==2400 or c:GetAttack()==2800) and c:GetDefence()==1000 and not c:IsPublic()
return (c:GetAttack()==2400 or c:GetAttack()==2800) and c:GetDefense()==1000 and not c:IsPublic()
end
function c33609262.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33609262.cfilter,tp,LOCATION_HAND,0,1,nil) end
......
......@@ -26,7 +26,7 @@ function c33875961.initial_effect(c)
c:RegisterEffect(e2)
end
function c33875961.addccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and e:GetHandler():IsDefencePos()
return Duel.GetTurnPlayer()==tp and e:GetHandler():IsDefensePos()
end
function c33875961.addct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -12,8 +12,8 @@ function c33977496.initial_effect(c)
c:RegisterEffect(e1)
end
function c33977496.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()==e:GetHandler() and e:GetHandler():IsDefencePos()
and Duel.GetAttacker():GetAttack()<e:GetHandler():GetDefence()
return Duel.GetAttackTarget()==e:GetHandler() and e:GetHandler():IsDefensePos()
and Duel.GetAttacker():GetAttack()<e:GetHandler():GetDefense()
end
function c33977496.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -33,7 +33,7 @@ function c34566435.operation(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENCE_FINAL)
e2:SetValue(tc:GetBaseDefence())
e2:SetValue(tc:GetBaseDefense())
c:RegisterEffect(e2)
end
end
......@@ -55,7 +55,7 @@ end
function c35330871.atkop(e,tp,eg,ep,ev,re,r,rp)
local cc=e:GetLabelObject()
local atk=cc:GetAttack()
local def=cc:GetDefence()
local def=cc:GetDefense()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -17,7 +17,7 @@ function c35686187.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c35686187.cfilter,1,nil,1-tp)
end
function c35686187.filter(c)
return c:IsDefencePos() and c:IsDestructable()
return c:IsDefensePos() and c:IsDestructable()
end
function c35686187.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c35686187.filter,tp,0,LOCATION_MZONE,1,nil) end
......
......@@ -64,7 +64,7 @@ function c35800511.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
e:SetLabelObject(tc)
return tc and tc:IsSetCard(0x9a) and tc:IsDefencePos() and tc:IsRelateToBattle() and Duel.GetAttackTarget()~=nil
return tc and tc:IsSetCard(0x9a) and tc:IsDefensePos() and tc:IsRelateToBattle() and Duel.GetAttackTarget()~=nil
end
function c35800511.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
......@@ -73,7 +73,7 @@ end
function c35800511.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsControler(tp) then
local def=tc:GetBaseDefence()
local def=tc:GetBaseDefense()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENCE_FINAL)
......
......@@ -20,7 +20,7 @@ function c36407615.atop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
while tc do
local atk=tc:GetAttack()
local def=tc:GetDefence()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -29,7 +29,7 @@ function c3642509.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=tg:GetFirst()
while tc do
local atk=tc:GetAttack()
local def=tc:GetDefence()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -18,7 +18,7 @@ function c3648368.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c3648368.filter(c)
return c:IsFacedown() and c:IsDefencePos()
return c:IsFacedown() and c:IsDefensePos()
end
function c3648368.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c3648368.filter(chkc) end
......
......@@ -71,7 +71,7 @@ function c36956512.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=tg:GetFirst()
while tc do
local atk=tc:GetAttack()
local def=tc:GetDefence()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -14,7 +14,7 @@ function c37083210.condition(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local at=Duel.GetAttackTarget()
return Duel.GetCurrentPhase()==PHASE_DAMAGE and not Duel.IsDamageCalculated()
and a:IsControler(1-tp) and at and at:IsPosition(POS_FACEUP_DEFENCE) and a:GetAttack()<at:GetDefence()
and a:IsControler(1-tp) and at and at:IsPosition(POS_FACEUP_DEFENCE) and a:GetAttack()<at:GetDefense()
end
function c37083210.activate(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
......
......@@ -34,7 +34,7 @@ function c37169670.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local d=Duel.GetAttackTarget()
if d==c then d=Duel.GetAttacker() end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,d:GetDefence())
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,d:GetDefense())
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,d:GetAttack())
end
function c37169670.damop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -16,7 +16,7 @@ function c38562933.descon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d==c then d=Duel.GetAttacker() end
e:SetLabelObject(d)
return d and d:IsFaceup() and d:GetDefence()<=c:GetAttack()
return d and d:IsFaceup() and d:GetDefense()<=c:GetAttack()
end
function c38562933.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -25,7 +25,7 @@ end
function c38562933.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d=e:GetLabelObject()
if c:IsFaceup() and c:IsRelateToEffect(e) and d:IsRelateToBattle() and d:GetDefence()<=c:GetAttack() then
if c:IsFaceup() and c:IsRelateToEffect(e) and d:IsRelateToBattle() and d:GetDefense()<=c:GetAttack() then
Duel.Destroy(d,REASON_EFFECT)
end
end
......@@ -36,7 +36,7 @@ function c3912064.initial_effect(c)
c:RegisterEffect(e4)
end
function c3912064.posfilter(c)
return c:IsDefencePos() or c:IsFacedown()
return c:IsDefensePos() or c:IsFacedown()
end
function c3912064.poscon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
......
......@@ -15,5 +15,5 @@ function c39168895.initial_effect(c)
c:RegisterEffect(e3)
end
function c39168895.descon(e)
return e:GetHandler():IsDefencePos()
return e:GetHandler():IsDefensePos()
end
......@@ -36,7 +36,7 @@ function c39343610.atkop(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENCE_FINAL)
e2:SetValue(c:GetBaseDefence()*2)
e2:SetValue(c:GetBaseDefense()*2)
e2:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e2)
end
......
......@@ -13,7 +13,7 @@ function c39357122.initial_effect(c)
c:RegisterEffect(e1)
end
function c39357122.filter(c,atk)
return c:IsFaceup() and c:GetDefence()<atk and c:IsDestructable()
return c:IsFaceup() and c:GetDefense()<atk and c:IsDestructable()
end
function c39357122.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local atk=e:GetHandler():GetAttack()
......
......@@ -29,7 +29,7 @@ end
function c39648965.piercecon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d and a:IsControler(tp) and a~=e:GetHandler() and d:IsDefencePos() and a:IsSetCard(0x13)
return d and a:IsControler(tp) and a~=e:GetHandler() and d:IsDefensePos() and a:IsSetCard(0x13)
end
function c39648965.piercetg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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