Commit cfe3e23f authored by nekrozar's avatar nekrozar Committed by DailyShana

fix Black Luster Soldier - Envoy of the Beginning and so on (#669)

parent c78b0b7d
......@@ -45,7 +45,7 @@ function c10032958.reg(c,opt)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10032958,2))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLED)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c10032958.atcon)
e1:SetOperation(c10032958.atop)
e1:SetReset(RESET_EVENT+0x1ff0000)
......@@ -66,9 +66,7 @@ function c10032958.reg(c,opt)
end
end
function c10032958.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():IsChainAttackable()
end
function c10032958.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
......
......@@ -12,7 +12,7 @@ function c17313545.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17313545,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c17313545.atcon)
e2:SetOperation(c17313545.atop)
c:RegisterEffect(e2)
......@@ -22,9 +22,8 @@ function c17313545.distg(e,c)
end
function c17313545.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
and bc:IsAttribute(ATTRIBUTE_LIGHT)
return aux.bdcon(e,tp,eg,ep,ev,re,r,rp) and c:IsChainAttackable()
and c:GetBattleTarget():IsAttribute(ATTRIBUTE_LIGHT)
end
function c17313545.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
......
......@@ -11,7 +11,7 @@ function c23118924.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23118924,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c23118924.atcon)
e2:SetOperation(c23118924.atop)
c:RegisterEffect(e2)
......@@ -40,10 +40,8 @@ function c23118924.disop(e,tp,eg,ep,ev,re,r,rp)
bc:RegisterEffect(e2)
end
function c23118924.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
and not c:IsDisabled() and Duel.IsExistingMatchingCard(c23118924.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WIND)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():IsChainAttackable()
and Duel.IsExistingMatchingCard(c23118924.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WIND)
end
function c23118924.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
......
......@@ -13,7 +13,7 @@ function c30314994.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(30314994,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c30314994.atcon)
e2:SetOperation(c30314994.atop)
c:RegisterEffect(e2)
......@@ -27,8 +27,8 @@ end
function c30314994.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
and not c:IsDisabled() and Duel.IsExistingMatchingCard(c30314994.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WIND)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():IsChainAttackable()
and Duel.IsExistingMatchingCard(c30314994.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WIND)
end
function c30314994.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
......
......@@ -16,7 +16,7 @@ function c35638627.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(35638627,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLED)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetCondition(c35638627.atcon)
e3:SetOperation(c35638627.atop)
c:RegisterEffect(e3)
......@@ -39,9 +39,7 @@ function c35638627.disop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c35638627.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():IsChainAttackable()
end
function c35638627.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
......
......@@ -5,15 +5,13 @@ function c46427957.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(46427957,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLED)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c46427957.atcon)
e1:SetOperation(c46427957.atop)
c:RegisterEffect(e1)
end
function c46427957.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():IsChainAttackable()
end
function c46427957.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
......
......@@ -18,7 +18,7 @@ function c49202331.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(49202331,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCountLimit(1)
e2:SetCondition(c49202331.atcon)
e2:SetCost(c49202331.atcost)
......@@ -46,9 +46,8 @@ function c49202331.damop(e,tp,eg,ep,ev,re,r,rp)
end
function c49202331.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
and e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,3814632)
return aux.bdcon(e,tp,eg,ep,ev,re,r,rp) and c:IsChainAttackable()
and c:GetOverlayGroup():IsExists(Card.IsCode,1,nil,3814632)
end
function c49202331.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
......
......@@ -4,16 +4,15 @@ function c62315111.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(62315111,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLED)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c62315111.atcon)
e1:SetOperation(c62315111.atop)
c:RegisterEffect(e1)
end
function c62315111.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable()
and bc:GetCounter(0x100e)>0
return aux.bdcon(e,tp,eg,ep,ev,re,r,rp) and c:IsChainAttackable()
and c:GetBattleTarget():GetCounter(0x100e)>0
end
function c62315111.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
......
......@@ -12,7 +12,7 @@ function c65260293.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(65260293,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c65260293.atcon)
e2:SetOperation(c65260293.atop)
c:RegisterEffect(e2)
......@@ -24,10 +24,8 @@ function c65260293.ctlcon(e)
return Duel.IsExistingMatchingCard(c65260293.filter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WATER)
end
function c65260293.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
and not c:IsDisabled() and Duel.IsExistingMatchingCard(c65260293.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WIND)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():IsChainAttackable()
and Duel.IsExistingMatchingCard(c65260293.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,ATTRIBUTE_WIND)
end
function c65260293.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
......
......@@ -27,7 +27,7 @@ function c72989439.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(72989439,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLED)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetCondition(c72989439.atcon)
e3:SetOperation(c72989439.atop)
c:RegisterEffect(e3)
......@@ -76,9 +76,8 @@ function c72989439.rmop(e,tp,eg,ep,ev,re,r,rp)
end
function c72989439.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:GetFlagEffect(72989439)==0
and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
return Duel.GetAttacker()==c and aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and c:GetFlagEffect(72989439)==0
and c:IsChainAttackable()
end
function c72989439.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
......
......@@ -14,7 +14,7 @@ function c80367387.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(80367387,3))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c80367387.atcon)
e2:SetOperation(c80367387.atop)
c:RegisterEffect(e2)
......@@ -60,9 +60,7 @@ function c80367387.mtop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c80367387.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():IsChainAttackable()
end
function c80367387.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
......
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