Commit b869f295 authored by Chrono-Genex's avatar Chrono-Genex Committed by GitHub

add EFFECT_COUNT_CODE_CHAIN (#2007)

parent dac0c4d3
......@@ -16,6 +16,7 @@ function c1154611.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c1154611.spcon)
e2:SetTarget(c1154611.sptg)
e2:SetOperation(c1154611.spop)
......@@ -39,9 +40,8 @@ function c1154611.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c1154611.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(1154611)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,1154611,0xd4,TYPES_NORMAL_TRAP_MONSTER,1200,0,2,RACE_AQUA,ATTRIBUTE_WATER) end
c:RegisterFlagEffect(1154611,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c1154611.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -10,6 +10,7 @@ function c18326736.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCost(c18326736.spcost)
e1:SetTarget(c18326736.sptg)
e1:SetOperation(c18326736.spop)
......@@ -37,9 +38,8 @@ function c18326736.initial_effect(c)
end
function c18326736.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,3,REASON_COST) and c:GetFlagEffect(18326736)==0 end
if chk==0 then return c:CheckRemoveOverlayCard(tp,3,REASON_COST) end
c:RemoveOverlayCard(tp,3,3,REASON_COST)
c:RegisterFlagEffect(18326736,RESET_CHAIN,0,1)
end
function c18326736.filter(c,e,tp,rk,mc)
return c:IsRank(rk) and not c:IsSetCard(0x48) and e:GetHandler():IsCanBeXyzMaterial(c)
......
......@@ -10,6 +10,7 @@ function c19891310.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_BATTLE_PHASE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(c19891310.condition)
e1:SetCost(c19891310.cost)
e1:SetOperation(c19891310.operation)
......@@ -34,9 +35,8 @@ function c19891310.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c19891310.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(19891310)==0 end
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
c:RegisterFlagEffect(19891310,RESET_CHAIN,0,1)
end
function c19891310.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -12,6 +12,7 @@ function c22201234.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c22201234.qcon)
e2:SetCost(c22201234.qcost)
e2:SetTarget(c22201234.qtg)
......@@ -23,8 +24,7 @@ function c22201234.qcon(e,tp,eg,ep,ev,re,r,rp)
return d:IsFaceup() and d:IsSetCard(0x38) and d:IsControler(tp)
end
function c22201234.qcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(22201234)==0 and Duel.IsPlayerCanDiscardDeckAsCost(tp,2) end
e:GetHandler():RegisterFlagEffect(22201234,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,2) end
Duel.DiscardDeck(tp,2,REASON_COST)
end
function c22201234.qtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -6,6 +6,7 @@ function c22227683.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(c22227683.condition)
e1:SetTarget(c22227683.target)
e1:SetOperation(c22227683.operation)
......@@ -27,9 +28,7 @@ function c22227683.tgfilter(c)
return c:IsSetCard(0xab) and c:IsType(TYPE_MONSTER) and not c:IsCode(22227683) and c:IsAbleToGrave()
end
function c22227683.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(22227683)==0
and Duel.IsExistingMatchingCard(c22227683.tgfilter,tp,LOCATION_DECK,0,1,nil) end
e:GetHandler():RegisterFlagEffect(22227683,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(c22227683.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c22227683.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -11,6 +11,7 @@ function c23649496.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCost(c23649496.cost)
e1:SetTarget(c23649496.target)
e1:SetOperation(c23649496.operation)
......@@ -29,9 +30,8 @@ end
aux.xyz_number[23649496]=18
function c23649496.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(23649496)==0 end
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
c:RegisterFlagEffect(23649496,RESET_CHAIN,0,1)
end
function c23649496.cfilter(c)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c23649496.filter,0,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetCode())
......
......@@ -18,6 +18,7 @@ function c2376209.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c2376209.spcon)
e2:SetTarget(c2376209.sptg)
e2:SetOperation(c2376209.spop)
......@@ -48,9 +49,8 @@ function c2376209.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c2376209.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(2376209)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,2376209,0xd4,TYPES_NORMAL_TRAP_MONSTER,1200,0,2,RACE_AQUA,ATTRIBUTE_WATER) end
c:RegisterFlagEffect(2376209,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c2376209.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -14,6 +14,7 @@ function c24903843.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c24903843.spcon)
e2:SetTarget(c24903843.sptg)
e2:SetOperation(c24903843.spop)
......@@ -38,9 +39,8 @@ function c24903843.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c24903843.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(24903843)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,24903843,0xd4,TYPES_NORMAL_TRAP_MONSTER,1200,0,2,RACE_AQUA,ATTRIBUTE_WATER) end
c:RegisterFlagEffect(24903843,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c24903843.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -8,6 +8,7 @@ function c29587993.initial_effect(c)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(c29587993.discon)
e1:SetTarget(c29587993.distg)
e1:SetOperation(c29587993.disop)
......@@ -15,7 +16,7 @@ function c29587993.initial_effect(c)
end
function c29587993.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not c:IsStatus(STATUS_BATTLE_DESTROYED) and not c:IsStatus(STATUS_CHAINING) and Duel.IsChainNegatable(ev)
return not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c29587993.filter(c)
return c:IsFaceup() and c:IsSetCard(0x37) and c:IsAbleToHand()
......
......@@ -16,6 +16,7 @@ function c3105404.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCost(c3105404.thcost)
e2:SetTarget(c3105404.thtg)
e2:SetOperation(c3105404.thop)
......@@ -44,9 +45,7 @@ function c3105404.cfilter(c)
return c:IsSetCard(0x1047) and c:IsAbleToGraveAsCost()
end
function c3105404.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(3105404)==0
and Duel.IsExistingMatchingCard(c3105404.cfilter,tp,LOCATION_HAND,0,1,nil) end
e:GetHandler():RegisterFlagEffect(3105404,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(c3105404.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c3105404.cfilter,1,1,REASON_COST,nil)
end
function c3105404.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -25,6 +25,7 @@ function c32138660.initial_effect(c)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c32138660.atkcon)
e3:SetTarget(c32138660.atktg)
e3:SetOperation(c32138660.atkop)
......@@ -71,9 +72,7 @@ function c32138660.atkcon(e,tp,eg,ep,ev,re,r,rp)
end
function c32138660.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.nzatk(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.nzatk,tp,0,LOCATION_MZONE,1,nil)
and e:GetHandler():GetFlagEffect(32138660)==0 end
e:GetHandler():RegisterFlagEffect(32138660,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingTarget(aux.nzatk,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.nzatk,tp,0,LOCATION_MZONE,1,1,nil)
end
......
......@@ -8,6 +8,7 @@ function c33776734.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,33776734+EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(c33776734.spcon)
e1:SetTarget(c33776734.sptg)
e1:SetOperation(c33776734.spop)
......@@ -62,10 +63,9 @@ function c33776734.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>=2
end
function c33776734.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,33776734)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,33776734,RESET_CHAIN,0,0)
end
function c33776734.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -10,6 +10,7 @@ function c3428069.initial_effect(c)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetTarget(c3428069.eqtg)
e2:SetOperation(c3428069.eqop)
c:RegisterEffect(e2)
......@@ -31,10 +32,8 @@ function c3428069.filter(c,e,tp)
end
function c3428069.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c3428069.filter(chkc,e,tp) end
if chk==0 then return e:GetHandler():GetFlagEffect(3428069)==0
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and eg:IsExists(c3428069.filter,1,nil,e,tp) end
e:GetHandler():RegisterFlagEffect(3428069,RESET_CHAIN,0,1)
local g=eg:Filter(c3428069.filter,nil,e,tp)
local tc=nil
if g:GetCount()>1 then
......
......@@ -15,6 +15,7 @@ function c35035481.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c35035481.spcon)
e2:SetTarget(c35035481.sptg)
e2:SetOperation(c35035481.spop)
......@@ -41,9 +42,8 @@ function c35035481.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c35035481.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(35035481)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,35035481,0xd4,TYPES_NORMAL_TRAP_MONSTER,1200,0,2,RACE_AQUA,ATTRIBUTE_WATER) end
c:RegisterFlagEffect(35035481,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c35035481.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -9,6 +9,7 @@ function c35199656.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCost(c35199656.cost)
e1:SetTarget(c35199656.target)
e1:SetOperation(c35199656.operation)
......@@ -52,8 +53,7 @@ function c35199656.initial_effect(c)
end
function c35199656.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() and c:GetFlagEffect(35199656)==0 end
c:RegisterFlagEffect(35199656,RESET_CHAIN,0,1)
if chk==0 then return not c:IsPublic() end
end
function c35199656.filter(c)
return c:IsSetCard(0xfb) and c:IsFaceup() and c:IsAbleToHand() and not c:IsCode(35199656)
......
......@@ -25,6 +25,7 @@ function c38105306.initial_effect(c)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetHintTiming(0,TIMING_MAIN_END+TIMING_BATTLE_END)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c38105306.hdcon)
e3:SetTarget(c38105306.hdtg)
e3:SetOperation(c38105306.hdop)
......@@ -49,9 +50,8 @@ function c38105306.hdcon(e,tp,eg,ep,ev,re,r,rp)
end
function c38105306.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGrave() and c:GetFlagEffect(38105306)==0 end
if chk==0 then return c:IsAbleToGrave() end
e:SetLabel(c:GetCounter(0x62))
c:RegisterFlagEffect(38105306,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c38105306.hdop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -16,6 +16,7 @@ function c38761908.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c38761908.spcon)
e2:SetTarget(c38761908.sptg)
e2:SetOperation(c38761908.spop)
......@@ -47,9 +48,8 @@ function c38761908.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c38761908.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(38761908)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,38761908,0xd4,TYPES_NORMAL_TRAP_MONSTER,1200,0,2,RACE_AQUA,ATTRIBUTE_WATER) end
c:RegisterFlagEffect(38761908,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c38761908.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -7,8 +7,8 @@ function c39185163.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(c39185163.disrmcon)
e1:SetCost(c39185163.disrmcost)
e1:SetTarget(c39185163.disrmtg)
e1:SetOperation(c39185163.disrmop)
c:RegisterEffect(e1)
......@@ -25,11 +25,6 @@ function c39185163.initial_effect(c)
e2:SetOperation(c39185163.spop)
c:RegisterEffect(e2)
end
function c39185163.disrmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(39185163)==0 end
c:RegisterFlagEffect(39185163,RESET_CHAIN,0,1)
end
function c39185163.disrmcon(e,tp,eg,ep,ev,re,r,rp)
local race,code1,code2=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_RACE,CHAININFO_TRIGGERING_CODE,CHAININFO_TRIGGERING_CODE2)
return re:IsActiveType(TYPE_MONSTER) and race&RACE_ZOMBIE>0 and code1~=39185163 and code2~=39185163
......
......@@ -12,8 +12,8 @@ function c39537362.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c39537362.condition)
e2:SetCost(c39537362.cost)
e2:SetTarget(c39537362.target)
e2:SetOperation(c39537362.activate)
c:RegisterEffect(e2)
......@@ -21,11 +21,6 @@ end
function c39537362.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c39537362.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(39537362)==0 end
c:RegisterFlagEffect(39537362,RESET_CHAIN,0,1)
end
function c39537362.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
Duel.SetTargetCard(Duel.GetAttacker())
......
......@@ -12,6 +12,7 @@ function c41867019.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,41867019+EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c41867019.effcon)
e2:SetTarget(c41867019.efftg)
e2:SetOperation(c41867019.effop)
......@@ -39,9 +40,8 @@ function c41867019.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local b2=Duel.IsExistingMatchingCard(c41867019.setfilter,tp,LOCATION_DECK,0,1,nil) and bit.band(flag,0x2)==0
local b3=Duel.IsExistingMatchingCard(c41867019.tgfilter,tp,0,LOCATION_MZONE,1,nil) and bit.band(flag,0x4)==0
local b4=bit.band(flag,0x8)==0
return Duel.GetFlagEffect(tp,41867020)==0 and (b1 or b2 or b3 or b4)
return b1 or b2 or b3 or b4
end
Duel.RegisterFlagEffect(tp,41867020,RESET_CHAIN,0,1)
end
function c41867019.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -18,6 +18,7 @@ function c4280258.initial_effect(c)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c4280258.condition)
e2:SetTarget(c4280258.target)
e2:SetOperation(c4280258.operation)
......@@ -41,8 +42,7 @@ function c4280258.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c4280258.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackAbove(800) and c:GetFlagEffect(4280258)==0 end
c:RegisterFlagEffect(4280258,RESET_CHAIN,0,1)
if chk==0 then return c:IsAttackAbove(800) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c4280258.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -8,6 +8,7 @@ function c4388680.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(c4388680.atkcon)
e1:SetCost(c4388680.atkcost)
e1:SetOperation(c4388680.atkop)
......@@ -33,9 +34,7 @@ function c4388680.atkcfilter(c)
end
function c4388680.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(4388680)==0
and Duel.IsExistingMatchingCard(c4388680.atkcfilter,tp,LOCATION_GRAVE,0,1,nil) end
c:RegisterFlagEffect(4388680,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(c4388680.atkcfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c4388680.atkcfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
......
......@@ -21,6 +21,7 @@ function c44311445.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_TO_DECK)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c44311445.spcon)
e2:SetCost(c44311445.spcost)
e2:SetTarget(c44311445.sptg)
......@@ -55,9 +56,8 @@ function c44311445.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c44311445.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(44311445)==0 end
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
c:RegisterFlagEffect(44311445,RESET_CHAIN,0,1)
end
function c44311445.spfilter(c,e,tp)
return c:IsSetCard(0x71) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
......
......@@ -6,8 +6,8 @@ function c46502744.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(c46502744.spcon)
e1:SetCost(c46502744.spcost)
e1:SetTarget(c46502744.sptg)
e1:SetOperation(c46502744.spop)
c:RegisterEffect(e1)
......@@ -35,10 +35,6 @@ end
function c46502744.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and re:IsHasCategory(CATEGORY_SPECIAL_SUMMON)
end
function c46502744.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(46502744)==0 end
e:GetHandler():RegisterFlagEffect(46502744,RESET_CHAIN,0,1)
end
function c46502744.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
......
......@@ -24,6 +24,7 @@ function c46593546.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c46593546.ovlcon)
e2:SetTarget(c46593546.ovltg)
e2:SetOperation(c46593546.ovlop)
......@@ -79,11 +80,10 @@ end
function c46593546.ovltg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local rc=re:GetHandler()
if chk==0 then return c:GetFlagEffect(46593546)==0 and c:IsType(TYPE_XYZ)
if chk==0 then return c:IsType(TYPE_XYZ)
and (c:CheckRemoveOverlayCard(tp,2,REASON_EFFECT)
or Duel.IsExistingMatchingCard(c46593546.ovltgfilter,tp,LOCATION_ONFIELD,0,1,nil))
and rc:IsRelateToEffect(re) and rc:IsCanBeXyzMaterial(c) end
c:RegisterFlagEffect(46593546,RESET_CHAIN,0,1)
end
function c46593546.ovlop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -11,6 +11,7 @@ function c46772449.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_SPSUMMON,TIMING_BATTLE_START)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(c46772449.condition)
e1:SetCost(c46772449.cost)
e1:SetTarget(c46772449.target)
......@@ -30,9 +31,8 @@ function c46772449.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c46772449.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:GetFlagEffect(46772449)==0 end
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
c:RegisterFlagEffect(46772449,RESET_CHAIN,0,1)
end
function c46772449.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
......
......@@ -27,8 +27,8 @@ function c47946130.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c47946130.negcon)
e3:SetCost(c47946130.ChainUniqueCost) -- 8/19 eratta: chain unique
e3:SetTarget(c47946130.negtg)
e3:SetOperation(c47946130.negop)
c:RegisterEffect(e3)
......@@ -65,11 +65,6 @@ function c47946130.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c47946130.ChainUniqueCost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(47946130)==0 end
c:RegisterFlagEffect(47946130,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
end
function c47946130.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or c:GetAttack()<500 or not c:IsRelateToEffect(e)
......
......@@ -6,6 +6,7 @@ function c4807253.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(aux.damcon1)
e1:SetTarget(c4807253.sptg)
e1:SetOperation(c4807253.spop)
......@@ -26,9 +27,7 @@ end
function c4807253.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:GetFlagEffect(4807253)==0 end
c:RegisterFlagEffect(4807253,RESET_CHAIN,0,1)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c4807253.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -19,8 +19,8 @@ function s.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CUSTOM+id)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.mtcon)
e2:SetTarget(s.mttg)
e2:SetOperation(s.mtop)
c:RegisterEffect(e2)
aux.RegisterMergedDelayedEvent(c,id,EVENT_REMOVE)
......@@ -60,11 +60,6 @@ function s.mtcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsExists(s.remfilter,1,nil)
end
function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(id)==0 end
c:RegisterFlagEffect(id,RESET_CHAIN,0,1)
end
function s.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToChain() and c:IsType(TYPE_XYZ)) then return end
......
......@@ -22,6 +22,7 @@ function c50091196.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c50091196.sccon)
e2:SetTarget(c50091196.sctarg)
e2:SetOperation(c50091196.scop)
......@@ -46,9 +47,7 @@ function c50091196.sccon(e,tp,eg,ep,ev,re,r,rp)
end
function c50091196.sctarg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(50091196)==0
and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c) end
c:RegisterFlagEffect(50091196,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c50091196.scop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -24,6 +24,7 @@ function c53315891.initial_effect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e4:SetCondition(c53315891.atkcon)
e4:SetTarget(c53315891.atktg)
e4:SetOperation(c53315891.atkop)
......@@ -50,9 +51,8 @@ function c53315891.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,c)
if g:GetCount()==0 then return false end
local g1,atk=g:GetMaxGroup(Card.GetAttack)
return not c:IsAttack(atk) and c:GetFlagEffect(53315891)==0
return not c:IsAttack(atk)
end
c:RegisterFlagEffect(53315891,RESET_CHAIN,0,1)
end
function c53315891.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -59,12 +59,10 @@ function c54241725.cfilter(c)
return c:IsSetCard(0xbe) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost()
end
function c54241725.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c54241725.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler())
and e:GetHandler():GetFlagEffect(54241725)==0 end
if chk==0 then return Duel.IsExistingMatchingCard(c54241725.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c54241725.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:GetHandler():RegisterFlagEffect(54241725,RESET_CHAIN,0,1)
end
function c54241725.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -28,6 +28,7 @@ function c54366836.initial_effect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c54366836.damcon2)
e3:SetCost(c54366836.damcost2)
e3:SetOperation(c54366836.damop2)
......@@ -53,9 +54,8 @@ function c54366836.damcon2(e,tp,eg,ep,ev,re,r,rp)
end
function c54366836.damcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(54366836)==0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
c:RegisterFlagEffect(54366836,RESET_CHAIN,0,1)
end
function c54366836.damop2(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -13,6 +13,7 @@ function c575512.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c575512.sccon)
e2:SetTarget(c575512.sctg)
e2:SetOperation(c575512.scop)
......@@ -38,9 +39,8 @@ end
function c575512.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0xc1)
return e:GetHandler():GetFlagEffect(575512)==0 and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg)
return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg)
end
e:GetHandler():RegisterFlagEffect(575512,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c575512.scop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -10,6 +10,7 @@ function c5821478.initial_effect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCondition(c5821478.descon)
e1:SetTarget(c5821478.destg)
e1:SetOperation(c5821478.desop)
......@@ -43,8 +44,7 @@ function c5821478.desfilter(c)
return c:GetSequence()<5
end
function c5821478.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(5821478)==0 end
e:GetHandler():RegisterFlagEffect(5821478,RESET_CHAIN,0,1)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c5821478.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
......
......@@ -36,6 +36,7 @@ function c59242457.initial_effect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e4:SetCondition(c59242457.spcon)
e4:SetTarget(c59242457.sptg)
e4:SetOperation(c59242457.spop)
......@@ -71,8 +72,7 @@ end
function c59242457.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=c:GetOverlayGroup()
if chk==0 then return c:GetFlagEffect(59242457)==0 and g:IsExists(c59242457.toexfilter,1,nil,tp) end
c:RegisterFlagEffect(59242457,RESET_CHAIN,0,1)
if chk==0 then return g:IsExists(c59242457.toexfilter,1,nil,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c59242457.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -13,6 +13,7 @@ function c60018643.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,60018643+EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c60018643.thcon)
e2:SetTarget(c60018643.thtg)
e2:SetOperation(c60018643.thop)
......@@ -32,9 +33,7 @@ function c60018643.thfilter(c,att)
end
function c60018643.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c60018643.tgfilter(chkc,tp,eg) end
if chk==0 then return Duel.IsExistingTarget(c60018643.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp,eg)
and Duel.GetFlagEffect(tp,60018643)==0 end
Duel.RegisterFlagEffect(tp,60018643,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingTarget(c60018643.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp,eg) end
if eg:GetCount()==1 then
Duel.SetTargetCard(eg)
else
......
......@@ -17,6 +17,7 @@ function c61420130.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c61420130.spcon)
e2:SetTarget(c61420130.sptg)
e2:SetOperation(c61420130.spop)
......@@ -50,9 +51,8 @@ function c61420130.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c61420130.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(61420130)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,61420130,0xd4,TYPES_NORMAL_TRAP_MONSTER,1200,0,2,RACE_AQUA,ATTRIBUTE_WATER) end
c:RegisterFlagEffect(61420130,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c61420130.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -23,6 +23,7 @@ function c63410069.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c63410069.sscon)
e2:SetTarget(c63410069.sstg)
e2:SetOperation(c63410069.ssop)
......@@ -51,8 +52,7 @@ function c63410069.sscon(e,tp,eg,ep,ev,re,r,rp)
end
function c63410069.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(63410069)==0 and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c) end
c:RegisterFlagEffect(63410069,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c63410069.ssop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -17,6 +17,7 @@ function c64414267.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c64414267.spcon1)
e2:SetCost(c64414267.spcost)
e2:SetTarget(c64414267.sptg)
......@@ -42,11 +43,9 @@ end
function c64414267.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST)
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and c:GetFlagEffect(64414267)==0 end
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
c:RegisterFlagEffect(64414267,RESET_CHAIN,0,1)
end
function c64414267.spfilter(c,e,tp,mc)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(0x9c) and mc:IsCanBeXyzMaterial(c)
......
......@@ -15,6 +15,7 @@ function c64765016.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c64765016.spcon)
e2:SetTarget(c64765016.sptg)
e2:SetOperation(c64765016.spop)
......@@ -39,9 +40,8 @@ function c64765016.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c64765016.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(64765016)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,64765016,0xd4,TYPES_NORMAL_TRAP_MONSTER,1200,0,2,RACE_AQUA,ATTRIBUTE_WATER) end
c:RegisterFlagEffect(64765016,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c64765016.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -23,6 +23,7 @@ function c68431965.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c68431965.sccon)
e2:SetTarget(c68431965.sctarg)
e2:SetOperation(c68431965.scop)
......@@ -73,9 +74,7 @@ function c68431965.sccon(e,tp,eg,ep,ev,re,r,rp)
end
function c68431965.sctarg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(68431965)==0
and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c) end
c:RegisterFlagEffect(68431965,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c68431965.scop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -15,6 +15,7 @@ function c69452756.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e2:SetCountLimit(1,69452756+EFFECT_COUNT_CODE_CHAIN)
e2:SetCost(c69452756.cost)
e2:SetTarget(c69452756.target)
e2:SetOperation(c69452756.operation)
......@@ -24,9 +25,8 @@ function c69452756.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c69452756.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) and Duel.GetFlagEffect(tp,69452756)==0 end
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
Duel.RegisterFlagEffect(tp,69452756,RESET_CHAIN,0,1)
end
function c69452756.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c69452756.filter(chkc) end
......
......@@ -18,6 +18,7 @@ function c72971064.initial_effect(c)
e2:SetCode(EVENT_CUSTOM+72971064)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c72971064.thcon)
e2:SetCost(c72971064.thcost)
e2:SetTarget(c72971064.thtg)
......@@ -52,9 +53,7 @@ end
function c72971064.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=eg:Filter(c72971064.thfilter,nil,tp)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and aux.IsInGroup(chkc,g) end
if chk==0 then return e:GetHandler():GetFlagEffect(72971064)==0
and Duel.IsExistingTarget(aux.IsInGroup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,g) end
e:GetHandler():RegisterFlagEffect(72971064,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingTarget(aux.IsInGroup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,g) end
local sg
if g:GetCount()==1 then
sg=g:Clone()
......
......@@ -22,6 +22,7 @@ function c76524506.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c76524506.sccon)
e2:SetTarget(c76524506.sctg)
e2:SetOperation(c76524506.scop)
......@@ -68,9 +69,7 @@ function c76524506.sccon(e,tp,eg,ep,ev,re,r,rp)
end
function c76524506.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(76524506)==0
and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c) end
c:RegisterFlagEffect(76524506,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c76524506.scop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -53,7 +53,7 @@ function c77432167.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100,0)
local c=e:GetHandler()
local lp=Duel.GetLP(tp)
if chk==0 then return Duel.CheckLPCost(tp,lp-100,true) and c:GetFlagEffect(77432168)==0 end
if chk==0 then return Duel.CheckLPCost(tp,lp-100,true) and c:GetFlagEffect(77432167)==0 end
e:SetLabel(100,lp-100)
Duel.PayLPCost(tp,lp-100,true)
c:RegisterFlagEffect(77432167,RESET_CHAIN,0,1)
......@@ -102,7 +102,7 @@ function c77432167.reccost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectReleaseGroup(tp,c77432167.recfilter,1,1,nil)
e:SetLabel(100,g:GetFirst():GetAttack())
Duel.Release(g,REASON_COST)
c:RegisterFlagEffect(77432168,RESET_CHAIN,0,1)
c:RegisterFlagEffect(77432167,RESET_CHAIN,0,1)
end
function c77432167.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
local label,rec=e:GetLabel()
......
......@@ -11,6 +11,7 @@ function c79205581.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c79205581.condition)
e2:SetTarget(c79205581.cost)
e2:SetOperation(c79205581.operation)
......@@ -21,9 +22,7 @@ function c79205581.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c79205581.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(79205581)==0
and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD,0,1,c) end
c:RegisterFlagEffect(79205581,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST)
......
......@@ -12,8 +12,8 @@ function c79371769.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c79371769.discon)
e2:SetCost(c79371769.discost)
e2:SetTarget(c79371769.distg)
e2:SetOperation(c79371769.disop)
c:RegisterEffect(e2)
......@@ -36,11 +36,6 @@ end
function c79371769.discon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function c79371769.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(79371769)==0 end
c:RegisterFlagEffect(79371769,RESET_CHAIN,0,1)
end
function c79371769.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
Duel.SetTargetPlayer(tp)
......
......@@ -50,6 +50,7 @@ function c82103466.initial_effect(c)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e6:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e6:SetCondition(c82103466.atkcon)
e6:SetTarget(c82103466.atktg)
e6:SetOperation(c82103466.atkop)
......@@ -100,9 +101,8 @@ function c82103466.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,c)
if g:GetCount()==0 then return false end
local g1,atk=g:GetMaxGroup(Card.GetBaseAttack)
return not c:IsAttack(atk) and c:GetFlagEffect(82103466)==0
return not c:IsAttack(atk)
end
c:RegisterFlagEffect(82103466,RESET_CHAIN,0,1)
end
function c82103466.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -13,6 +13,7 @@ function c92773018.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c92773018.condition)
e2:SetCost(c92773018.cost)
e2:SetTarget(c92773018.target)
......@@ -35,9 +36,7 @@ end
function c92773018.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
if chkc then return chkc==tg end
if chk==0 then return e:GetHandler():GetFlagEffect(92773018)==0
and tg:IsOnField() and tg:IsCanBeEffectTarget(e) end
e:GetHandler():RegisterFlagEffect(92773018,RESET_CHAIN,0,1)
if chk==0 then return tg:IsOnField() and tg:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
end
......
......@@ -32,6 +32,7 @@ function c96570609.initial_effect(c)
e4:SetRange(LOCATION_HAND)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e4:SetCondition(c96570609.sumcon)
e4:SetCost(c96570609.sumcost)
e4:SetTarget(c96570609.sumtg)
......@@ -117,12 +118,10 @@ function c96570609.cfilter(c)
end
function c96570609.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c96570609.cfilter,tp,LOCATION_GRAVE,0,1,nil)
and c:GetFlagEffect(96570609)==0 end
if chk==0 then return Duel.IsExistingMatchingCard(c96570609.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c96570609.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
c:RegisterFlagEffect(96570609,RESET_CHAIN,0,1)
end
function c96570609.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -16,6 +16,7 @@ function c98414735.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(c98414735.spcon)
e2:SetTarget(c98414735.sptg)
e2:SetOperation(c98414735.spop)
......@@ -42,9 +43,8 @@ function c98414735.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c98414735.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(98414735)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,98414735,0xd4,TYPES_NORMAL_TRAP_MONSTER,1200,0,2,RACE_AQUA,ATTRIBUTE_WATER) end
c:RegisterFlagEffect(98414735,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c98414735.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -33,6 +33,7 @@ function c98558751.initial_effect(c)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c98558751.sccon)
e3:SetTarget(c98558751.sctg)
e3:SetOperation(c98558751.scop)
......@@ -75,9 +76,7 @@ function c98558751.sccon(e,tp,eg,ep,ev,re,r,rp)
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c98558751.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(98558751)==0
and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
e:GetHandler():RegisterFlagEffect(98558751,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c98558751.scop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -32,6 +32,7 @@ function c99937842.initial_effect(c)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c99937842.sccon)
e3:SetTarget(c99937842.sctg)
e3:SetOperation(c99937842.scop)
......@@ -74,9 +75,7 @@ function c99937842.sccon(e,tp,eg,ep,ev,re,r,rp)
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c99937842.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(99937842)==0
and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
e:GetHandler():RegisterFlagEffect(99937842,RESET_CHAIN,0,1)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c99937842.scop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -833,6 +833,7 @@ GLOBALFLAG_TUNE_MAGICIAN =0x400 --超量素材检查标记(调弦之魔术
--count_code
EFFECT_COUNT_CODE_OATH =0x10000000 --发动次数限制(誓约次数, 发动被无效不计数)
EFFECT_COUNT_CODE_DUEL =0x20000000 --决斗中使用次数
EFFECT_COUNT_CODE_CHAIN =0x40000000 --同一连锁中使用次数
EFFECT_COUNT_CODE_SINGLE =0x1 --同一张卡的多个效果公共使用次数
--特殊选项
DUEL_TEST_MODE =0x01 --测试模式(目前暫無)
......
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