Commit 92679e23 authored by DailyShana's avatar DailyShana

fix (25/45)

parent f8ae0d5c
......@@ -34,7 +34,6 @@ function c17787975.initial_effect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c17787975.descon)
e4:SetOperation(c17787975.desop)
c:RegisterEffect(e4)
......@@ -59,14 +58,14 @@ function c17787975.tgop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c17787975.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
return Duel.GetCurrentPhase()==PHASE_BATTLE_STEP
end
function c17787975.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
local at=Duel.GetAttacker()
if chk==0 then return tc and at and Duel.GetAttackTarget()==tc
and at:GetAttack()>tc:GetAttack() end
if chk==0 then return tc and Duel.GetAttackTarget()==tc
and at and at:IsControler(1-tp) and at:GetAttack()>tc:GetAttack() end
local dam=math.abs(at:GetAttack()-tc:GetAttack())
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
......
......@@ -29,7 +29,7 @@ function c20747792.initial_effect(c)
c:RegisterEffect(e3)
end
function c20747792.thfilter(c)
return c:IsSetCard(0x20a2) and c:IsAbleToHand()
return c:IsSetCard(0x20a2) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c20747792.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c20747792.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -11,14 +11,13 @@ function c20960340.initial_effect(c)
c:RegisterEffect(e1)
end
function c20960340.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():IsControler(1-tp) and Duel.GetAttackTarget()==nil
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
and Duel.GetAttacker():IsAttackAbove(Duel.GetLP(tp))
end
function c20960340.target(e,tp,eg,ep,ev,re,r,rp,chk)
local at=Duel.GetAttacker()
local atk=Duel.GetLP(tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsPlayerCanSpecialSummonMonster(tp,20960340,0,0x21,atk,0,4,RACE_WARRIOR,ATTRIBUTE_LIGHT)
and at:IsOnField() and at:GetAttack()>=atk end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,20960340,0,0x21,atk,0,4,RACE_WARRIOR,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c20960340.activate(e,tp,eg,ep,ev,re,r,rp)
......@@ -30,18 +29,23 @@ function c20960340.activate(e,tp,eg,ep,ev,re,r,rp)
c:AddMonsterAttribute(0,0,0,0,0)
Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
c:TrapMonsterComplete(TYPE_EFFECT)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(20960340,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLED)
e1:SetLabel(atk)
e1:SetCondition(c20960340.damcon)
e1:SetTarget(c20960340.damtg)
e1:SetOperation(c20960340.damop)
e1:SetReset(RESET_EVENT+0x17e0000)
c:RegisterEffect(e1,true)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20960340,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLED)
e2:SetCondition(c20960340.damcon)
e2:SetTarget(c20960340.damtg)
e2:SetOperation(c20960340.damop)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
local at=Duel.GetAttacker()
if at and at:IsAttackable() and at:IsFaceup() and not at:IsImmuneToEffect(e) and not at:IsStatus(STATUS_ATTACK_CANCELED) then
......@@ -54,12 +58,12 @@ function c20960340.damcon(e,tp,eg,ep,ev,re,r,rp)
end
function c20960340.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=e:GetLabel()
local dam=e:GetHandler():GetAttack()
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c20960340.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Damage(p,e:GetHandler():GetAttack(),REASON_EFFECT)
end
......@@ -15,7 +15,7 @@ function c22804410.initial_effect(c)
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22804410,1))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
......@@ -29,7 +29,6 @@ function c22804410.initial_effect(c)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROYED)
e4:SetCondition(c22804410.descon)
e4:SetTarget(c22804410.destg)
......@@ -37,9 +36,8 @@ function c22804410.initial_effect(c)
c:RegisterEffect(e4)
end
function c22804410.spfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsSetCard(0xdd) and c:GetPreviousControler()==tp and c:GetReasonPlayer()~=tp
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
return c:IsSetCard(0xdd) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp)
end
function c22804410.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c22804410.spfilter,1,nil,tp)
......@@ -65,15 +63,16 @@ function c22804410.spop(e,tp,eg,ep,ev,re,r,rp)
end
function c22804410.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc:IsRace(RACE_DRAGON) end
if chk==0 then return Duel.IsExistingTarget(Card.IsRace,tp,LOCATION_GRAVE,0,1,nil,RACE_DRAGON) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,Card.IsRace,tp,LOCATION_GRAVE,0,1,1,nil,RACE_DRAGON)
end
function c22804410.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc or not tc:IsRelateToEffect(e) then return end
local atk=tc:GetAttack()
if tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and c:IsFaceup() then
if atk>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......@@ -83,10 +82,11 @@ function c22804410.atkop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c22804410.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c22804410.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
......
......@@ -20,7 +20,7 @@ function c29311166.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(e:GetHandler(),REASON_COST)
end
function c29311166.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c29311166.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
......
......@@ -32,7 +32,6 @@ function c54175023.initial_effect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e5:SetRange(LOCATION_SZONE)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCondition(c54175023.descon)
e5:SetOperation(c54175023.desop)
c:RegisterEffect(e5)
......
......@@ -17,10 +17,8 @@ function c54297661.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c54297661.filter(c,tp)
local atk=c:GetAttack()
local def=c:GetDefence()
return c:IsFaceup()
and Duel.IsPlayerCanSpecialSummonMonster(tp,54297661,0,0x21,atk,def,4,RACE_SPELLCASTER,ATTRIBUTE_DARK)
and Duel.IsPlayerCanSpecialSummonMonster(tp,54297661,0,0x21,c:GetAttack(),c:GetDefence(),4,RACE_SPELLCASTER,ATTRIBUTE_DARK)
end
function c54297661.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c54297661.filter,tp,0,LOCATION_MZONE,1,nil,tp)
......@@ -39,29 +37,38 @@ function c54297661.activate(e,tp,eg,ep,ev,re,r,rp)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,54297661,0,0x21,atk,def,4,RACE_SPELLCASTER,ATTRIBUTE_DARK) then return end
c:AddMonsterAttribute(0,0,0,0,0)
if Duel.SpecialSummonStep(c,0,tp,tp,true,false,POS_FACEUP_ATTACK) then
--damage
c:TrapMonsterComplete(TYPE_EFFECT)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(54297661,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetLabel(atk)
e1:SetTarget(c54297661.damtg)
e1:SetOperation(c54297661.damop)
e1:SetReset(RESET_EVENT+0x17e0000)
c:RegisterEffect(e1,true)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENCE)
e2:SetValue(def)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(54297661,0))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetTarget(c54297661.damtg)
e3:SetOperation(c54297661.damop)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3,true)
end
c:TrapMonsterComplete(TYPE_EFFECT)
Duel.SpecialSummonComplete()
end
function c54297661.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=e:GetLabel()
local dam=e:GetHandler():GetAttack()
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c54297661.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Damage(p,e:GetHandler():GetAttack(),REASON_EFFECT)
end
......@@ -19,8 +19,8 @@ function c55410871.initial_effect(c)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c55410871.indval)
c:RegisterEffect(e3)
......@@ -40,7 +40,8 @@ function c55410871.indval(e,re,tp)
return tp~=e:GetHandlerPlayer()
end
function c55410871.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetBattleTarget()~=nil and e:GetHandler():GetBattleTarget():IsDefencePos()
local c=e:GetHandler()
return ep~=tp and c==Duel.GetAttacker() and Duel.GetAttackTarget() and Duel.GetAttackTarget():IsDefencePos()
end
function c55410871.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
......
......@@ -51,10 +51,10 @@ function c56132807.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c56132807.thfilter(c)
return c:IsSetCard(0x20a2) and c:IsAbleToHand()
return c:IsSetCard(0x20a2) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c56132807.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c56132807.thfilter(chkc) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c56132807.thfilter,tp,LOCATION_GRAVE,0,1,c) end
local g=Duel.GetMatchingGroup(c56132807.thfilter,tp,LOCATION_GRAVE,0,c):Filter(Card.IsCanBeEffectTarget,nil,e)
......
......@@ -31,7 +31,7 @@ end
function c56532353.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(c:GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
and Duel.GetAttacker()==c and c:IsChainAttackable(0,false)
and Duel.GetAttacker()==c and c:IsChainAttackable(0)
and not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,c)
end
function c56532353.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -41,8 +41,6 @@ function c56532353.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST)
end
function c56532353.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToBattle() then return end
Duel.ChainAttack()
end
function c56532353.filter(c,tp)
......
......@@ -8,7 +8,6 @@ function c68299524.initial_effect(c)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c68299524.cost)
e1:SetTarget(c68299524.target)
e1:SetOperation(c68299524.operation)
c:RegisterEffect(e1)
--Destroy
......@@ -27,7 +26,6 @@ function c68299524.initial_effect(c)
e3:SetDescription(aux.Stringid(68299524,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(c68299524.atkcon)
e3:SetOperation(c68299524.atkop)
......@@ -37,22 +35,20 @@ function c68299524.filter(c)
return c:IsFaceup() and c:IsAttackAbove(100)
end
function c68299524.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,100) end
if chk==0 then return Duel.CheckLPCost(tp,100)
and Duel.IsExistingMatchingCard(c68299524.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(c68299524.filter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
local tg=g:GetMaxGroup(Card.GetAttack)
local maxc=math.min(Duel.GetLP(tp),tg:GetFirst():GetAttack())
maxc=math.floor(maxc/100)*100
local tg,atk=g:GetMaxGroup(Card.GetAttack)
local maxc=math.min(Duel.GetLP(tp),atk)
local ct=math.floor(maxc/100)
local t={}
for i=1,maxc/100 do
for i=1,ct do
t[i]=i*100
end
local cost=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,cost)
e:SetLabel(cost)
end
function c68299524.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c68299524.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
end
function c68299524.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c68299524.filter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
local tc=g:GetFirst()
......@@ -61,7 +57,6 @@ function c68299524.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(-val)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
......@@ -71,11 +66,12 @@ end
function c68299524.desfilter(c,atk)
return c:IsFaceup() and c:IsDestructable() and c:IsAttackBelow(atk)
end
function c68299524.destg(e,tp,eg,ep,ev,re,r,rp,chk)
function c68299524.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c68299524.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetAttack()) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c68299524.desfilter(chkc,c:GetAttack()) end
if chk==0 then return Duel.IsExistingTarget(c68299524.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,c:GetAttack()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c68299524.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c,c:GetAttack())
local g=Duel.SelectTarget(tp,c68299524.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,c:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c68299524.desop(e,tp,eg,ep,ev,re,r,rp)
......@@ -89,7 +85,6 @@ function c68299524.atkcon(e,tp,eg,ep,ev,re,r,rp)
end
function c68299524.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -101,5 +96,4 @@ function c68299524.atkop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end
......@@ -23,7 +23,6 @@ function c80560728.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c80560728.atcon)
e3:SetCost(c80560728.atcost)
e3:SetOperation(c80560728.atop)
......@@ -33,7 +32,6 @@ function c80560728.initial_effect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c80560728.descon)
e4:SetOperation(c80560728.desop)
c:RegisterEffect(e4)
......@@ -62,7 +60,7 @@ function c80560728.atcon(e,tp,eg,ep,ev,re,r,rp)
local tc=c:GetFirstCardTarget()
local at=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return at==tc and d and (d:IsRelateToBattle() or not d:IsReason(REASON_BATTLE))
return at==tc and d and d:IsRelateToBattle()
end
function c80560728.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
......@@ -80,40 +78,15 @@ function c80560728.atop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToBattle() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_MUST_ATTACK)
e1:SetCondition(c80560728.ancon)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(c80560728.ancon)
e2:SetTarget(c80560728.antarget)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
local e2=e1:Clone()
e2:SetCode(EFFECT_FIRST_ATTACK)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_BATTLE_START)
e3:SetOperation(c80560728.anop)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e3)
Duel.ChainAttack()
end
end
function c80560728.ancon(e)
return e:GetHandler():GetFlagEffect(80560728)==0
end
function c80560728.antarget(e,c)
return c~=e:GetHandler()
end
function c80560728.anop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(80560728,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE,0,1)
end
function c80560728.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc)
......
......@@ -40,14 +40,14 @@ function c81782376.drcon(e,tp,eg,ep,ev,re,r,rp)
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c81782376.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,81782376)
if chk==0 then return true end
local ct=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,81782376)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(g)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,g)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function c81782376.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,81782376)
Duel.Draw(p,g,REASON_EFFECT)
local ct=Duel.GetMatchingGroupCount(Card.IsCode,p,LOCATION_GRAVE,0,nil,81782376)
Duel.Draw(p,ct,REASON_EFFECT)
end
......@@ -44,7 +44,7 @@ function c82627406.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c82627406.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c82627406.ctfilter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0x20a2)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x20a2)
end
function c82627406.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetMatchingGroup(c82627406.atkfilter,tp,LOCATION_MZONE,0,nil)
......
......@@ -12,9 +12,10 @@ function c93927067.initial_effect(c)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(93927067,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c93927067.atkcon)
e2:SetCondition(aux.bdocon)
e2:SetOperation(c93927067.atkop)
c:RegisterEffect(e2)
--atkdown
......@@ -31,9 +32,6 @@ function c93927067.spcon(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c93927067.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsFaceup() and e:GetHandler():IsRelateToBattle()
end
function c93927067.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
......@@ -47,13 +45,11 @@ function c93927067.atkop(e,tp,eg,ep,ev,re,r,rp)
end
function c93927067.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if c==tc then tc=Duel.GetAttackTarget() end
if not tc:IsRelateToBattle() then return end
local tc=c:GetBattleTarget()
if not tc:IsRelateToBattle() or tc:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(-500)
tc:RegisterEffect(e1)
......
......@@ -11,7 +11,7 @@ function c94561645.initial_effect(c)
c:RegisterEffect(e1)
end
function c94561645.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst():IsControler(1-tp) and Duel.GetAttackTarget()==nil
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function c94561645.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......
......@@ -12,9 +12,10 @@ end
function c95697223.filter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsStatus(STATUS_SPSUMMON_TURN)
end
function c95697223.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c95697223.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c95697223.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c95697223.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsStatus,tp,0,LOCATION_MZONE,1,nil,STATUS_SPSUMMON_TURN) end
and Duel.GetMatchingGroupCount(Card.IsStatus,tp,0,LOCATION_MZONE,nil,STATUS_SPSUMMON_TURN)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c95697223.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
......@@ -22,10 +23,9 @@ function c95697223.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local ct=Duel.GetMatchingGroupCount(Card.IsStatus,tp,0,LOCATION_MZONE,nil,STATUS_SPSUMMON_TURN)
if ct>0 and tc:IsRelateToEffect(e) and tc:IsFaceup() then
if ct>0 and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(ct)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
......
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