Commit b28434b1 authored by VanillaSalt's avatar VanillaSalt

fix

parent e486cb90
......@@ -10,6 +10,7 @@ function c10000030.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCost(c10000030.cost)
e1:SetTarget(c10000030.target1)
e1:SetOperation(c10000030.operation1)
......@@ -21,16 +22,15 @@ function c10000030.initial_effect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCost(c10000030.cost)
e2:SetTarget(c10000030.target2)
e2:SetOperation(c10000030.operation2)
c:RegisterEffect(e2)
end
function c10000030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(10000030)==0
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end
e:GetHandler():RegisterFlagEffect(10000030,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......
......@@ -7,8 +7,8 @@ function c10275411.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,10275411+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c10275411.condition)
e1:SetCost(c10275411.cost)
e1:SetTarget(c10275411.target)
e1:SetOperation(c10275411.activate)
c:RegisterEffect(e1)
......@@ -19,10 +19,6 @@ end
function c10275411.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c10275411.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c10275411.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,10275411)==0 end
Duel.RegisterFlagEffect(tp,10275411,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c10275411.filter(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......@@ -35,7 +31,6 @@ function c10275411.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c10275411.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g1=Duel.GetOverlayGroup(tp,0,1)
......
......@@ -14,8 +14,8 @@ function c10560119.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,10560119)
e2:SetCondition(c10560119.spcon)
e2:SetCost(c10560119.spcost)
e2:SetTarget(c10560119.sptg)
e2:SetOperation(c10560119.spop)
c:RegisterEffect(e2)
......@@ -30,10 +30,6 @@ function c10560119.spcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
return g:GetCount()>0 and not g:IsExists(c10560119.cfilter,1,nil)
end
function c10560119.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,10560119)==0 end
Duel.RegisterFlagEffect(tp,10560119,RESET_PHASE+PHASE_END,0,1)
end
function c10560119.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
......
......@@ -8,6 +8,7 @@ function c10860121.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,10860121)
e1:SetCondition(c10860121.condition)
e1:SetCost(c10860121.cost)
e1:SetTarget(c10860121.target)
......@@ -22,9 +23,8 @@ function c10860121.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c10860121.cfilter,1,nil,tp)
end
function c10860121.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,10860121)==0 and e:GetHandler():IsAbleToGraveAsCost() end
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
Duel.RegisterFlagEffect(tp,10860121,RESET_PHASE+PHASE_END,0,1)
end
function c10860121.filter(c,e,tp)
return c:IsSetCard(0x88) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -10,16 +10,15 @@ function c1249315.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,1249315)
e2:SetCost(c1249315.thcost)
e2:SetTarget(c1249315.thtg)
e2:SetOperation(c1249315.thop)
c:RegisterEffect(e2)
end
function c1249315.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,1249315)==0
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.RegisterFlagEffect(tp,1249315,RESET_PHASE+PHASE_END,0,1)
end
function c1249315.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
......
......@@ -5,8 +5,8 @@ function c13166648.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCountLimit(1,13166648+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c13166648.condition)
e1:SetCost(c13166648.cost)
e1:SetTarget(c13166648.target)
e1:SetOperation(c13166648.activate)
c:RegisterEffect(e1)
......@@ -15,10 +15,6 @@ function c13166648.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsType(TYPE_XYZ) and tc:IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function c13166648.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,13166648)==0 end
Duel.RegisterFlagEffect(tp,13166648,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c13166648.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_XYZ)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -16,8 +16,8 @@ function c13391185.initial_effect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,13391185)
e2:SetCondition(c13391185.thcon)
e2:SetCost(c13391185.thcost)
e2:SetTarget(c13391185.thtg)
e2:SetOperation(c13391185.thop)
c:RegisterEffect(e2)
......@@ -33,10 +33,6 @@ end
function c13391185.thcon(e,tp,eg,ep,ev,re,r,rp)
return c13391185.eqcon2(e)
end
function c13391185.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,13391185)==0 end
Duel.RegisterFlagEffect(tp,13391185,RESET_PHASE+PHASE_END,0,1)
end
function c13391185.thfilter(c)
return c:IsSetCard(0x107a) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
......
......@@ -4,14 +4,10 @@ function c1372887.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c1372887.cost)
e1:SetCountLimit(1,1372887+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c1372887.activate)
c:RegisterEffect(e1)
end
function c1372887.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,1372887)==0 end
Duel.RegisterFlagEffect(tp,1372887,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c1372887.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
......
......@@ -21,6 +21,7 @@ function c13959634.initial_effect(c)
e3:SetCategory(CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,13959634)
e3:SetTarget(c13959634.hdtg)
e3:SetOperation(c13959634.hdop)
c:RegisterEffect(e3)
......@@ -37,9 +38,8 @@ function c13959634.spcon(e,c)
Duel.GetMatchingGroupCount(Card.IsAttribute,c:GetControler(),LOCATION_GRAVE,0,nil,ATTRIBUTE_WATER)==5
end
function c13959634.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,13959634)==0 end
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,2)
Duel.RegisterFlagEffect(tp,13959634,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c13959634.hdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(tp,2)
......
......@@ -12,9 +12,8 @@ function c1409474.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1409474,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetCountLimit(1,1409474)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c1409474.cost)
e2:SetTarget(c1409474.target)
e2:SetOperation(c1409474.operation)
c:RegisterEffect(e2)
......@@ -22,10 +21,6 @@ end
function c1409474.tgvalue(e,re,rp)
return rp~=e:GetHandlerPlayer()
end
function c1409474.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,1409474)==0 end
Duel.RegisterFlagEffect(tp,1409474,RESET_PHASE+PHASE_END,0,1)
end
function c1409474.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
......
......@@ -6,6 +6,7 @@ function c14198496.initial_effect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,14198496)
e1:SetCost(c14198496.cost)
e1:SetTarget(c14198496.target)
e1:SetOperation(c14198496.operation)
......@@ -16,9 +17,8 @@ function c14198496.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(e:GetHandler(),REASON_COST)
end
function c14198496.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,14198496)==0 and Duel.IsPlayerCanDraw(tp,1) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.RegisterFlagEffect(tp,14198496,RESET_PHASE+PHASE_END,0,1)
end
function c14198496.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.Draw(tp,1,REASON_EFFECT)
......
......@@ -6,6 +6,7 @@ function c14882493.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,14882493)
e1:SetCost(c14882493.thcost)
e1:SetTarget(c14882493.thtg)
e1:SetOperation(c14882493.thop)
......@@ -17,17 +18,16 @@ function c14882493.initial_effect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,14882494)
e2:SetCost(c14882493.atkcost)
e2:SetTarget(c14882493.atktg)
e2:SetOperation(c14882493.atkop)
c:RegisterEffect(e2)
end
function c14882493.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,14882493)==0
and Duel.CheckReleaseGroup(tp,Card.IsAttribute,1,e:GetHandler(),ATTRIBUTE_DARK) end
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsAttribute,1,e:GetHandler(),ATTRIBUTE_DARK) end
local g=Duel.SelectReleaseGroup(tp,Card.IsAttribute,1,1,e:GetHandler(),ATTRIBUTE_DARK)
Duel.Release(g,REASON_COST)
Duel.RegisterFlagEffect(tp,14882493,RESET_PHASE+PHASE_END,0,1)
end
function c14882493.filter(c)
return c:GetLevel()==4 and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand()
......@@ -52,12 +52,10 @@ function c14882493.cfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToRemoveAsCost()
end
function c14882493.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,14882494)==0
and Duel.IsExistingMatchingCard(c14882493.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c14882493.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c14882493.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,14882494,RESET_PHASE+PHASE_END,0,1)
end
function c14882493.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
......
......@@ -9,9 +9,8 @@ function c15767889.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCountLimit(1,15767889)
e1:SetCondition(c15767889.thcon)
e1:SetCost(c15767889.thcost)
e1:SetTarget(c15767889.thtg)
e1:SetOperation(c15767889.thop)
c:RegisterEffect(e1)
......@@ -19,10 +18,6 @@ end
function c15767889.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsDualState() and Duel.GetTurnPlayer()==tp
end
function c15767889.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,15767889)==0 end
Duel.RegisterFlagEffect(tp,15767889,RESET_PHASE+PHASE_END,0,1)
end
function c15767889.filter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToHand()
end
......
......@@ -21,8 +21,8 @@ function c16279989.initial_effect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCountLimit(1,16279989)
e3:SetCondition(c16279989.thcon)
e3:SetCost(c16279989.thcost)
e3:SetTarget(c16279989.thtg)
e3:SetOperation(c16279989.thop)
c:RegisterEffect(e3)
......@@ -48,10 +48,6 @@ end
function c16279989.thcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c16279989.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,16279989)==0 end
Duel.RegisterFlagEffect(tp,16279989,RESET_PHASE+PHASE_END,0,1)
end
function c16279989.filter(c)
return c:IsSetCard(0x8d) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
......
......@@ -14,7 +14,7 @@ function c1662004.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCost(c1662004.spcost)
e2:SetCountLimit(1,1662004)
e2:SetTarget(c1662004.sptg)
e2:SetOperation(c1662004.spop)
c:RegisterEffect(e2)
......@@ -23,10 +23,6 @@ function c1662004.synlimit(e,c)
if not c then return false end
return not c:IsRace(RACE_BEASTWARRIOR)
end
function c1662004.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,1662004)==0 end
Duel.RegisterFlagEffect(tp,1662004,RESET_PHASE+PHASE_END,0,1)
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)
end
......
......@@ -26,7 +26,7 @@ function c16898077.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCondition(c16898077.damcon)
e3:SetTarget(c16898077.damtg)
e3:SetOperation(c16898077.damop)
......@@ -40,7 +40,7 @@ function c16898077.initial_effect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_MSET)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e5:SetCondition(c16898077.damcon2)
e5:SetTarget(c16898077.damtg2)
e5:SetOperation(c16898077.damop2)
......@@ -54,7 +54,7 @@ function c16898077.initial_effect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e7:SetCode(EVENT_CHANGE_POS)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1)
e7:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e7:SetCondition(c16898077.damcon3)
e7:SetTarget(c16898077.damtg3)
e7:SetOperation(c16898077.damop3)
......@@ -86,9 +86,8 @@ function c16898077.dfilter(c,e,sp)
return c:GetSummonPlayer()==sp and c:IsDestructable() and (not e or c:IsRelateToEffect(e))
end
function c16898077.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(16898077)==0 and eg:IsExists(c16898077.dfilter,1,nil,nil,1-tp) end
if chk==0 then return eg:IsExists(c16898077.dfilter,1,nil,nil,1-tp) end
local g=eg:Filter(c16898077.dfilter,nil,nil,1-tp)
e:GetHandler():RegisterFlagEffect(16898077,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
......@@ -103,8 +102,7 @@ function c16898077.damcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and rp~=tp
end
function c16898077.damtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(16898077)==0 end
e:GetHandler():RegisterFlagEffect(16898077,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
if chk==0 then return true end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
......@@ -122,15 +120,14 @@ function c16898077.sfilter(c,e)
return c:IsFacedown() and c:IsDestructable() and (not e or c:IsRelateToEffect(e))
end
function c16898077.damtg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(16898077)==0 and eg:IsExists(c16898077.sfilter,1,nil,nil,1-tp) end
local g=eg:Filter(c16898077.sfilter,nil,nil,1-tp)
e:GetHandler():RegisterFlagEffect(16898077,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
if chk==0 then return eg:IsExists(c16898077.sfilter,1,nil) end
local g=eg:Filter(c16898077.sfilter,nil)
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function c16898077.damop3(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c16898077.sfilter,nil,e,1-tp)
local g=eg:Filter(c16898077.sfilter,nil,e)
if e:GetHandler():IsRelateToEffect(e) and g:GetCount()~=0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,800,REASON_EFFECT)
end
......
......@@ -7,6 +7,7 @@ function c17243896.initial_effect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCondition(c17243896.condition)
e1:SetTarget(c17243896.target)
e1:SetOperation(c17243896.operation)
......@@ -18,15 +19,13 @@ end
function c17243896.filter(c,e,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:GetSummonPlayer()==1-tp and (not e or c:IsRelateToEffect(e))
end
function c17243896.condition(e,tp,eg,ep,ev,re,r,rp,chk)
function c17243896.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPosition(POS_FACEUP_DEFENCE)
end
function c17243896.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(17243896)==0
and eg:IsExists(c17243896.filter,1,nil,nil,tp) end
if chk==0 then return eg:IsExists(c17243896.filter,1,nil,nil,tp) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_POSITION,eg,eg:GetCount(),0,0)
e:GetHandler():RegisterFlagEffect(17243896,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c17243896.operation(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c17243896.filter,nil,e,tp)
......
......@@ -43,6 +43,7 @@ function c17760003.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetDescription(aux.Stringid(17760003,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCost(c17760003.cost)
e1:SetTarget(c17760003.target1)
e1:SetOperation(c17760003.operation1)
......@@ -56,6 +57,7 @@ function c17760003.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCost(c17760003.cost)
e1:SetTarget(c17760003.target2)
e1:SetOperation(c17760003.operation2)
......@@ -69,6 +71,7 @@ function c17760003.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCost(c17760003.cost)
e1:SetTarget(c17760003.target3)
e1:SetOperation(c17760003.operation3)
......@@ -77,10 +80,8 @@ function c17760003.regop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c17760003.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(17760003)==0
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
e:GetHandler():RegisterFlagEffect(17760003,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c17760003.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
......
......@@ -12,16 +12,17 @@ function c1834753.initial_effect(c)
e2:SetDescription(aux.Stringid(1834753,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c1834753.spcost)
e2:SetTarget(c1834753.sptg)
e2:SetOperation(c1834753.spop)
c:RegisterEffect(e2)
end
function c1834753.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(1834753)==0 and Duel.CheckLPCost(tp,2000) end
if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
e:GetHandler():RegisterFlagEffect(1834753,RESET_EVENT+0x1fe0000,0,0)
end
function c1834753.filter(c,e,tp)
return c:GetLevel()==3 and c:IsRace(RACE_PSYCHO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -5,15 +5,15 @@ function c1845204.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,1845204+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c1845204.cost)
e1:SetTarget(c1845204.target)
e1:SetOperation(c1845204.activate)
c:RegisterEffect(e1)
end
function c1845204.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,1845204)==0 and Duel.CheckLPCost(tp,1000) end
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
Duel.RegisterFlagEffect(tp,1845204,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c1845204.filter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:GetLevel()<=5
......
......@@ -6,21 +6,20 @@ function c18698739.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,18698739)
e1:SetCost(c18698739.cost)
e1:SetTarget(c18698739.target)
e1:SetOperation(c18698739.operation)
c:RegisterEffect(e1)
end
function c18698739.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFlagEffect(tp,18698739)==0 and c:IsAbleToGraveAsCost() end
Duel.SendtoGrave(c,REASON_COST)
Duel.RegisterFlagEffect(tp,18698739,RESET_PHASE+PHASE_END,0,1)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c18698739.filter(c)
return c:GetCode()==44682448 and c:IsAbleToHand()
end
function c18698739.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c18698739.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c18698739.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -5,14 +5,14 @@ function c18988391.initial_effect(c)
e1:SetDescription(aux.Stringid(18988391,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,18988391)
e1:SetCost(c18988391.cost)
e1:SetOperation(c18988391.operation)
c:RegisterEffect(e1)
end
function c18988391.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,18988391)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,18988391,RESET_PHASE+PHASE_END,0,1)
end
function c18988391.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -6,15 +6,15 @@ function c19310321.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,19310321)
e1:SetCost(c19310321.cost)
e1:SetTarget(c19310321.target)
e1:SetOperation(c19310321.activate)
c:RegisterEffect(e1)
end
function c19310321.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,19310321)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,19310321,RESET_PHASE+PHASE_END,0,1)
end
function c19310321.filter1(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()==0
......
......@@ -4,7 +4,7 @@ function c19337371.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c19337371.cost)
e1:SetCountLimit(1,19337371+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c19337371.target)
e1:SetOperation(c19337371.activate)
c:RegisterEffect(e1)
......@@ -16,10 +16,6 @@ function c19337371.initial_effect(c)
e2:SetOperation(c19337371.regop)
c:RegisterEffect(e2)
end
function c19337371.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,19337371)==0 end
Duel.RegisterFlagEffect(tp,19337371,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c19337371.filter(c)
return c:IsCode(90219263) and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
......@@ -46,7 +42,7 @@ function c19337371.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_GRAVE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCountLimit(1,19337371+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c19337371.thtg)
e1:SetOperation(c19337371.thop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
......@@ -56,8 +52,7 @@ function c19337371.thfilter(c)
return c:IsSetCard(0x64) and c:IsAbleToHand()
end
function c19337371.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,19337371)==0 end
Duel.RegisterFlagEffect(tp,19337371,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c19337371.thop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -6,6 +6,7 @@ function c1969506.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,1969506+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c1969506.spcon)
e1:SetCost(c1969506.spcost)
e1:SetTarget(c1969506.sptg)
......@@ -16,8 +17,7 @@ function c1969506.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=Duel.GetLP(1-tp)-2000
end
function c1969506.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,1969506)==0 and Duel.GetCurrentPhase()~=PHASE_MAIN2 end
Duel.RegisterFlagEffect(tp,1969506,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
if chk==0 then return Duel.GetCurrentPhase()~=PHASE_MAIN2 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
......
......@@ -7,7 +7,7 @@ function c19748583.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCost(c19748583.eqcost)
e1:SetCountLimit(1,19748583)
e1:SetTarget(c19748583.eqtg)
e1:SetOperation(c19748583.eqop)
c:RegisterEffect(e1)
......@@ -36,10 +36,6 @@ function c19748583.initial_effect(c)
e4:SetOperation(c19748583.desop)
c:RegisterEffect(e4)
end
function c19748583.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,19748583)==0 end
Duel.RegisterFlagEffect(tp,19748583,RESET_PHASE+PHASE_END,0,1)
end
function c19748583.filter(c)
return c:IsFaceup() and c:IsSetCard(0x107a)
end
......
......@@ -6,6 +6,7 @@ function c20032555.initial_effect(c)
e1:SetDescription(aux.Stringid(20032555,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,20032555)
e1:SetTarget(c20032555.efftg)
e1:SetOperation(c20032555.effop)
c:RegisterEffect(e1)
......@@ -14,7 +15,7 @@ function c20032555.cfilter(c)
return c:IsSetCard(0x83) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function c20032555.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,20032555)==0 and Duel.IsExistingMatchingCard(c20032555.cfilter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c20032555.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c20032555.cfilter,1,1,REASON_COST+REASON_DISCARD)
local opt=0
if e:GetHandler():GetLevel()==8 then
......@@ -26,7 +27,6 @@ function c20032555.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if opt==0 then
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
Duel.RegisterFlagEffect(tp,20032555,RESET_PHASE+PHASE_END,0,1)
end
function c20032555.effop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then
......
......@@ -6,6 +6,7 @@ function c20349913.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,20349913+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c20349913.condition)
e1:SetCost(c20349913.cost)
e1:SetTarget(c20349913.target)
......@@ -19,10 +20,8 @@ function c20349913.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c20349913.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c20349913.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,20349913)==0
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,nil)
Duel.RegisterFlagEffect(tp,20349913,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c20349913.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
......
......@@ -6,6 +6,7 @@ function c20822520.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,20822520+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c20822520.condition)
e1:SetCost(c20822520.cost)
e1:SetTarget(c20822520.target)
......@@ -32,9 +33,8 @@ function c20822520.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c20822520.cfilter,tp,LOCATION_GRAVE,0,5,nil)
end
function c20822520.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,20822520)==0 and Duel.GetFlagEffect(tp,20822521)==0 end
if chk==0 then return Duel.GetFlagEffect(tp,20822521)==0 end
--oath effects
Duel.RegisterFlagEffect(tp,20822520,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
......
......@@ -27,7 +27,7 @@ function c21113684.initial_effect(c)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCondition(c21113684.con)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e4:SetCost(c21113684.cost)
e4:SetTarget(c21113684.destg)
e4:SetOperation(c21113684.desop)
......@@ -39,7 +39,7 @@ function c21113684.initial_effect(c)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetCondition(c21113684.con)
e5:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e5:SetCost(c21113684.cost)
e5:SetTarget(c21113684.drtg)
e5:SetOperation(c21113684.drop)
......@@ -76,9 +76,6 @@ function c21113684.addc(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x3001,2)
end
end
function c21113684.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(21113684)==0
end
function c21113684.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3001,1,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
......@@ -90,10 +87,8 @@ function c21113684.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
e:GetHandler():RegisterFlagEffect(21113684,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c21113684.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
......
......@@ -33,6 +33,8 @@ function c2134346.retreg(e,tp,eg,ep,ev,re,r,rp)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_REPEAT)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetCondition(c2134346.retcon)
e1:SetTarget(c2134346.rettg)
......@@ -44,14 +46,13 @@ function c2134346.retreg(e,tp,eg,ep,ev,re,r,rp)
end
function c2134346.retcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(2134346)>0 or c:IsHasEffect(EFFECT_SPIRIT_DONOT_RETURN) then return false end
if c:IsHasEffect(EFFECT_SPIRIT_DONOT_RETURN) then return false end
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return not c:IsHasEffect(EFFECT_SPIRIT_MAYNOT_RETURN)
else return c:IsHasEffect(EFFECT_SPIRIT_MAYNOT_RETURN) end
end
function c2134346.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(2134346)==0 end
e:GetHandler():RegisterFlagEffect(2134346,RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END,EFFECT_FLAG_OATH,1)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c2134346.retop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -5,6 +5,7 @@ function c21715135.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,21715135+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c21715135.condition)
e1:SetCost(c21715135.cost)
e1:SetTarget(c21715135.target)
......@@ -46,7 +47,6 @@ function c21715135.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetLabelObject(e)
e1:SetTarget(c21715135.splimit)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,21715135,RESET_PHASE+PHASE_END,0,1)
end
function c21715135.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return sumtype~=SUMMON_TYPE_XYZ and e:GetLabelObject()~=se
......
......@@ -16,6 +16,7 @@ function c22446869.initial_effect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,22446869)
e2:SetCondition(c22446869.thcon)
e2:SetTarget(c22446869.thtg)
e2:SetOperation(c22446869.thop)
......@@ -47,8 +48,7 @@ function c22446869.thfilter(c)
return c:IsSetCard(0x74) and c:IsLevelBelow(4) and c:IsAbleToHand()
end
function c22446869.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,22446869)==0 end
Duel.RegisterFlagEffect(tp,22446869,RESET_PHASE+PHASE_END,0,1)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c22446869.thop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -5,8 +5,8 @@ function c22900598.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,22900598+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c22900598.condition)
e1:SetCost(c22900598.cost)
e1:SetTarget(c22900598.target)
e1:SetOperation(c22900598.activate)
c:RegisterEffect(e1)
......@@ -16,10 +16,6 @@ function c22900598.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
return g:GetCount()>0 and g:FilterCount(Card.IsRace,nil,RACE_ZOMBIE)==g:GetCount()
end
function c22900598.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,22900598)==0 end
Duel.RegisterFlagEffect(tp,22900598,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c22900598.filter(c,tp)
return c:IsCode(62188962) and c:GetActivateEffect():IsActivatable(tp)
end
......
......@@ -5,8 +5,8 @@ function c22993208.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,22993208+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c22993208.condition)
e1:SetCost(c22993208.cost)
e1:SetTarget(c22993208.target)
e1:SetOperation(c22993208.activate)
c:RegisterEffect(e1)
......@@ -15,10 +15,6 @@ function c22993208.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c22993208.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,22993208)==0 end
Duel.RegisterFlagEffect(tp,22993208,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c22993208.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -7,13 +7,13 @@ function c23434538.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE+0x1c0)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,23434538)
e1:SetCost(c23434538.cost)
e1:SetOperation(c23434538.operation)
c:RegisterEffect(e1)
end
function c23434538.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23434538)==0 and e:GetHandler():IsAbleToGraveAsCost() end
Duel.RegisterFlagEffect(tp,23434538,RESET_PHASE+PHASE_END,0,1)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c23434538.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -6,15 +6,15 @@ function c23536866.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,23536866)
e1:SetCost(c23536866.cost)
e1:SetTarget(c23536866.target)
e1:SetOperation(c23536866.operation)
c:RegisterEffect(e1)
end
function c23536866.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23536866)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,23536866,RESET_PHASE+PHASE_END,0,1)
end
function c23536866.filter(c,e,tp)
return c:GetLevel()==5 and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsCode(23536866)
......
......@@ -6,7 +6,7 @@ function c23893227.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(c23893227.cost)
e1:SetCountLimit(1,23893227)
e1:SetTarget(c23893227.target)
e1:SetOperation(c23893227.operation)
c:RegisterEffect(e1)
......@@ -16,6 +16,7 @@ function c23893227.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,23893227)
e2:SetCondition(c23893227.spcon)
e2:SetCost(c23893227.spcost)
e2:SetTarget(c23893227.sptg)
......@@ -30,10 +31,6 @@ function c23893227.initial_effect(c)
e3:SetValue(70095154)
c:RegisterEffect(e3)
end
function c23893227.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23893227)==0 end
Duel.RegisterFlagEffect(tp,23893227,RESET_PHASE+PHASE_END,0,1)
end
function c23893227.filter(c)
return (c:IsSetCard(0x93) or c:IsSetCard(0x94)) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
......@@ -53,9 +50,8 @@ function c23893227.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c23893227.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23893227)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,23893227,RESET_PHASE+PHASE_END,0,1)
end
function c23893227.spfilter(c,e,tp)
return c:IsSetCard(0x1093) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -7,15 +7,11 @@ function c24062258.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c24062258.spcost)
e1:SetCountLimit(1,24062258)
e1:SetTarget(c24062258.sptg)
e1:SetOperation(c24062258.spop)
c:RegisterEffect(e1)
end
function c24062258.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,24062258)==0 end
Duel.RegisterFlagEffect(tp,24062258,RESET_PHASE+PHASE_END,0,1)
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)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -16,7 +16,7 @@ function c2407234.initial_effect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c2407234.cost)
e2:SetCountLimit(1,2407234)
e2:SetTarget(c2407234.target)
e2:SetOperation(c2407234.operation)
c:RegisterEffect(e2)
......@@ -43,10 +43,6 @@ function c2407234.negop(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext()
end
end
function c2407234.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,2407234)==0 end
Duel.RegisterFlagEffect(tp,2407234,RESET_PHASE+PHASE_END,0,1)
end
function c2407234.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c2407234.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c2407234.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
......
......@@ -6,22 +6,22 @@ function c24449083.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24449083,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c24449083.condition)
e1:SetTarget(c24449083.target)
e1:SetOperation(c24449083.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(24449083,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,24449083)
e2:SetCondition(c24449083.condition)
e2:SetTarget(c24449083.target)
e2:SetOperation(c24449083.operation)
c:RegisterEffect(e2)
end
function c24449083.cfilter(c)
return c:IsFaceup() and c:GetLevel()==1 and c:IsRace(RACE_FAIRY)
end
function c24449083.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c24449083.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetFlagEffect(tp,24449083)==0
end
function c24449083.filter(c,e,sp)
return c:IsRace(RACE_FAIRY) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
......@@ -30,7 +30,6 @@ function c24449083.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c24449083.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.RegisterFlagEffect(tp,24449083,RESET_PHASE+PHASE_END,0,1)
end
function c24449083.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
......
......@@ -6,7 +6,7 @@ function c24861088.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCost(c24861088.cost)
e1:SetCountLimit(1,24861088)
e1:SetTarget(c24861088.target)
e1:SetOperation(c24861088.operation)
c:RegisterEffect(e1)
......@@ -16,6 +16,7 @@ function c24861088.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,24861088)
e2:SetCondition(c24861088.spcon)
e2:SetCost(c24861088.spcost)
e2:SetTarget(c24861088.sptg)
......@@ -35,10 +36,6 @@ function c24861088.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(rp,24861089,RESET_PHASE+PHASE_END,0,1)
end
end
function c24861088.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,24861088)==0 end
Duel.RegisterFlagEffect(tp,24861088,RESET_PHASE+PHASE_END,0,1)
end
function c24861088.filter(c)
return c:IsSetCard(0x70) and not c:IsCode(24861088) and c:IsAbleToHand()
end
......@@ -62,8 +59,7 @@ function c24861088.spcon(e,tp,eg,ep,ev,re,r,rp)
and not Duel.IsExistingMatchingCard(c24861088.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c24861088.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,24861088)==0 and Duel.GetFlagEffect(tp,24861089)==0 end
Duel.RegisterFlagEffect(tp,24861088,RESET_PHASE+PHASE_END,0,1)
if chk==0 then return Duel.GetFlagEffect(tp,24861089)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......
......@@ -46,16 +46,12 @@ function c24919805.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(c24919805.thcost)
e1:SetCountLimit(1,24919805)
e1:SetTarget(c24919805.thtg)
e1:SetOperation(c24919805.thop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c24919805.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,24919805)==0 end
Duel.RegisterFlagEffect(tp,24919805,RESET_PHASE+PHASE_END,0,1)
end
function c24919805.filter(c)
return c:GetLevel()==10 and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH) and c:IsAbleToHand()
end
......
......@@ -7,13 +7,14 @@ function c24920410.initial_effect(c)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,24920410+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c24920410.condition)
e1:SetTarget(c24920410.target)
e1:SetOperation(c24920410.activate)
c:RegisterEffect(e1)
end
function c24920410.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,24920410)==0 and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c24920410.filter(c)
return c:IsFaceup() and c:IsSetCard(0x58)
......@@ -22,8 +23,7 @@ function c24920410.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c24920410.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c24920410.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c24920410.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.RegisterFlagEffect(tp,24920410,RESET_PHASE+PHASE_END,0,1)
Duel.SelectTarget(tp,c24920410.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c24920410.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -6,13 +6,14 @@ function c25067275.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,25067275+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c25067275.cost)
e1:SetTarget(c25067275.target)
e1:SetOperation(c25067275.operation)
c:RegisterEffect(e1)
end
function c25067275.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,25067275)==0 end
if chk==0 then return true end
--oath effects
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -21,7 +22,6 @@ function c25067275.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,25067275,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c25067275.tcfilter(tc,ec)
return tc:IsFaceup() and ec:CheckEquipTarget(tc)
......
......@@ -6,15 +6,11 @@ function c25123082.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c25123082.cost)
e1:SetCountLimit(1,25123082+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c25123082.target)
e1:SetOperation(c25123082.activate)
c:RegisterEffect(e1)
end
function c25123082.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,25123082)==0 end
Duel.RegisterFlagEffect(tp,25123082,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c25123082.filter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end
......
......@@ -4,7 +4,7 @@ function c26285788.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c26285788.cost)
e1:SetCountLimit(1,26285788+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c26285788.activate)
c:RegisterEffect(e1)
if c26285788.global_effect==nil then
......@@ -26,10 +26,6 @@ function c26285788.addcount(e,tp,eg,ep,ev,re,r,rp)
c=eg:GetNext()
end
end
function c26285788.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,26285788)==0 end
Duel.RegisterFlagEffect(tp,26285788,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c26285788.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......
......@@ -12,9 +12,9 @@ function c26563200.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,26563200)
e1:SetCondition(c26563200.atkcon)
e1:SetCost(c26563200.atkcost)
e1:SetTarget(c26563200.atktg)
e1:SetOperation(c26563200.atkop)
c:RegisterEffect(e1)
end
......@@ -28,10 +28,6 @@ function c26563200.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c26563200.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,26563200)==0 end
Duel.RegisterFlagEffect(tp,26563200,RESET_PHASE+PHASE_END,0,1)
end
function c26563200.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsFaceup() then
......
......@@ -11,8 +11,7 @@ end
function c26722601.sumop(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
local c=e:GetHandler()
if ec~=e:GetHandler() and ec:IsSetCard(0x100a) and ec:GetSummonType()==SUMMON_TYPE_ADVANCE
and Duel.GetFlagEffect(tp,26722601)==0 then
if ec~=e:GetHandler() and ec:IsSetCard(0x100a) and ec:GetSummonType()==SUMMON_TYPE_ADVANCE then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
......
......@@ -7,6 +7,7 @@ function c26732909.initial_effect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,26732909)
e1:SetCondition(c26732909.thcon)
e1:SetCost(c26732909.thcost)
e1:SetTarget(c26732909.thtg)
......@@ -51,9 +52,8 @@ function c26732909.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c26732909.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c26732909[tp]>0 and Duel.GetFlagEffect(tp,26732909)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
if chk==0 then return c26732909[tp]>0 and e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,26732909,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c26732909.filter1(c)
return c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and c:IsRace(RACE_SPELLCASTER) and c:IsAbleToHand()
......
......@@ -6,6 +6,7 @@ function c27415516.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,27415516)
e1:SetCost(c27415516.spcost)
e1:SetTarget(c27415516.sptg)
e1:SetOperation(c27415516.spop)
......@@ -16,13 +17,12 @@ function c27415516.costfilter(c)
end
function c27415516.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFlagEffect(tp,27415516)==0 and c:IsDiscardable()
if chk==0 then return c:IsDiscardable()
and Duel.IsExistingMatchingCard(c27415516.costfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c27415516.costfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,27415516,RESET_PHASE+PHASE_END,0,1)
end
function c27415516.spfilter(c,e,tp)
return c:IsCode(26400609) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -6,7 +6,7 @@ function c27632240.initial_effect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,27632240)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCode(EVENT_TO_HAND)
e1:SetCondition(c27632240.tgcon1)
e1:SetTarget(c27632240.tgtg)
......
......@@ -14,11 +14,10 @@ function c28201945.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,28201945)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c28201945.spcon)
e2:SetCost(c28201945.spcost)
e2:SetTarget(c28201945.sptg)
e2:SetOperation(c28201945.spop)
c:RegisterEffect(e2)
......@@ -31,10 +30,6 @@ function c28201945.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler()
return rp==tp and c:GetType()==TYPE_TRAP and (c:IsSetCard(0x4c) or c:IsSetCard(0x89))
end
function c28201945.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,28201945)==0 end
Duel.RegisterFlagEffect(tp,28201945,RESET_PHASE+PHASE_END,0,1)
end
function c28201945.filter(c,e,tp,ft)
return c:IsSetCard(0x108a) and c:GetCode()~=28201945 and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
......
......@@ -6,6 +6,7 @@ function c282886.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCountLimit(1,282886)
e1:SetCondition(c282886.spcon)
e1:SetCost(c282886.spcost)
e1:SetTarget(c282886.sptg)
......@@ -22,10 +23,8 @@ function c282886.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable() and c:IsAbleToGraveAsCost()
end
function c282886.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,282886)==0
and Duel.IsExistingMatchingCard(c282886.cfilter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c282886.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c282886.cfilter,1,1,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,282886,RESET_PHASE+PHASE_END,0,1)
end
function c282886.filter(c,e,tp)
return c:IsSetCard(0x74) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -22,11 +22,10 @@ function c28388296.initial_effect(c)
e4:SetDescription(aux.Stringid(28388296,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,28388296)
e4:SetCondition(c28388296.condition)
e4:SetCost(c28388296.cost)
e4:SetTarget(c28388296.target)
e4:SetOperation(c28388296.operation)
c:RegisterEffect(e4)
......@@ -38,10 +37,6 @@ end
function c28388296.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c28388296.cfilter,1,nil,tp)
end
function c28388296.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,28388296)==0 end
Duel.RegisterFlagEffect(tp,28388296,RESET_PHASE+PHASE_END,0,1)
end
function c28388296.spfilter(c,e,tp)
return c:IsSetCard(0x24) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -7,15 +7,11 @@ function c28577986.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c28577986.cost)
e1:SetCountLimit(1,28577986)
e1:SetTarget(c28577986.target)
e1:SetOperation(c28577986.operation)
c:RegisterEffect(e1)
end
function c28577986.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,28577986)==0 end
Duel.RegisterFlagEffect(tp,28577986,RESET_PHASE+PHASE_END,0,1)
end
function c28577986.cfilter(c,e,tp)
local lv=c:GetLevel()
return lv>0 and c:IsFaceup() and c:IsSetCard(0x74)
......@@ -39,7 +35,6 @@ function c28577986.operation(e,tp,eg,ep,ev,re,r,rp)
if not tc:IsRelateToEffect(e) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local c=e:GetHandler()
local slv=tc:GetLevel()
local sg=Duel.GetMatchingGroup(c28577986.spfilter,tp,LOCATION_DECK,0,nil,slv,e,tp)
if sg:GetCount()==0 then return end
......
......@@ -7,15 +7,11 @@ function c28637168.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c28637168.spcost)
e1:SetCountLimit(1,28637168)
e1:SetTarget(c28637168.sptg)
e1:SetOperation(c28637168.spop)
c:RegisterEffect(e1)
end
function c28637168.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,28637168)==0 end
Duel.RegisterFlagEffect(tp,28637168,RESET_PHASE+PHASE_END,0,1)
end
function c28637168.spfilter(c,e,tp)
return c:GetLevel()==3 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -9,6 +9,7 @@ function c2978414.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCondition(c2978414.condition)
e1:SetCost(c2978414.cost)
e1:SetTarget(c2978414.sptg)
......@@ -21,6 +22,7 @@ function c2978414.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCondition(c2978414.condition)
e2:SetCost(c2978414.cost)
e2:SetTarget(c2978414.cttg)
......@@ -31,6 +33,7 @@ function c2978414.initial_effect(c)
e3:SetDescription(aux.Stringid(2978414,2))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCondition(c2978414.condition)
e3:SetCost(c2978414.cost)
e3:SetOperation(c2978414.efop)
......@@ -41,10 +44,9 @@ function c2978414.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<=1
end
function c2978414.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(2978414)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
e:GetHandler():RegisterFlagEffect(2978414,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c2978414.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -6,7 +6,7 @@ function c30587695.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetCountLimit(1,30587695)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c30587695.spcost)
e1:SetTarget(c30587695.sptg)
......@@ -27,12 +27,11 @@ function c30587695.filter(c,e,tp)
end
function c30587695.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c30587695.filter(chkc,e,tp) end
if chk==0 then return Duel.GetFlagEffect(tp,30587695)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c30587695.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c30587695.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.RegisterFlagEffect(tp,30587695,RESET_PHASE+PHASE_END,0,1)
end
function c30587695.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
......
......@@ -18,8 +18,8 @@ function c31480215.initial_effect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCountLimit(1,31480215)
e3:SetCondition(c31480215.spcon)
e3:SetCost(c31480215.spcost)
e3:SetTarget(c31480215.sptg)
e3:SetOperation(c31480215.spop)
c:RegisterEffect(e3)
......@@ -28,7 +28,7 @@ function c31480215.initial_effect(c)
e4:SetDescription(aux.Stringid(31480215,1))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCountLimit(1,31480215)
e4:SetCost(c31480215.lvcost)
e4:SetOperation(c31480215.lvop)
c:RegisterEffect(e4)
......@@ -40,10 +40,6 @@ function c31480215.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
and e:GetHandler():GetReasonCard():IsRace(RACE_MACHINE)
end
function c31480215.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,31480215)==0 end
Duel.RegisterFlagEffect(tp,31480215,RESET_PHASE+PHASE_END,0,1)
end
function c31480215.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
......@@ -68,10 +64,9 @@ function c31480215.splimit(e,c,tp,sumtp,sumpos)
return not c:IsAttribute(ATTRIBUTE_WIND)
end
function c31480215.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,31480215)==0 and Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,e:GetHandler(),0x101b) end
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,e:GetHandler(),0x101b) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,e:GetHandler(),0x101b)
Duel.Release(g,REASON_COST)
Duel.RegisterFlagEffect(tp,31480215,RESET_PHASE+PHASE_END,0,1)
end
function c31480215.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -6,8 +6,8 @@ function c33551032.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCountLimit(1,33551032)
e1:SetCondition(c33551032.spcon)
e1:SetCost(c33551032.spcost)
e1:SetTarget(c33551032.sptg)
e1:SetOperation(c33551032.spop)
c:RegisterEffect(e1)
......@@ -16,10 +16,6 @@ function c33551032.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetAttacker()==c and c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE)
end
function c33551032.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,33551032)==0 end
Duel.RegisterFlagEffect(tp,33551032,RESET_PHASE+PHASE_END,0,1)
end
function c33551032.spfilter(c,e,tp)
return c:IsSetCard(0x87) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -5,8 +5,8 @@ function c33611061.initial_effect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,33611061+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c33611061.condition)
e1:SetCost(c33611061.cost)
e1:SetTarget(c33611061.target)
e1:SetOperation(c33611061.activate)
c:RegisterEffect(e1)
......@@ -17,10 +17,6 @@ end
function c33611061.filter(c)
return c:IsSetCard(0x88) and c:IsRace(RACE_BEASTWARRIOR) and c:IsAbleToDeck()
end
function c33611061.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,33611061)==0 end
Duel.RegisterFlagEffect(tp,33611061,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c33611061.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33611061.filter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(c33611061.filter,tp,LOCATION_GRAVE,0,nil)
......
......@@ -9,6 +9,7 @@ function c34086406.initial_effect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCost(c34086406.cost)
e1:SetTarget(c34086406.target1)
e1:SetOperation(c34086406.operation1)
......@@ -18,15 +19,14 @@ function c34086406.initial_effect(c)
e2:SetDescription(aux.Stringid(34086406,2))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCost(c34086406.cost)
e2:SetTarget(c34086406.target2)
e2:SetOperation(c34086406.operation2)
c:RegisterEffect(e2)
end
function c34086406.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(34086406)==0
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RegisterFlagEffect(34086406,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
......
......@@ -16,6 +16,7 @@ function c34680482.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,34680482)
e2:SetCost(c34680482.spcost)
e2:SetTarget(c34680482.sptg)
e2:SetOperation(c34680482.spop)
......@@ -35,9 +36,8 @@ function c34680482.retop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c34680482.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,34680482)==0 and e:GetHandler():IsReleasable() end
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
Duel.RegisterFlagEffect(tp,34680482,RESET_PHASE+PHASE_END,0,1)
end
function c34680482.filter(c,e,tp)
return c:IsSetCard(0x71) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -5,6 +5,7 @@ function c34838437.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,34838437+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c34838437.condition)
e1:SetCost(c34838437.cost)
e1:SetTarget(c34838437.target)
......@@ -15,7 +16,7 @@ function c34838437.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c34838437.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,34838437)==0 and not Duel.CheckNormalSummonActivity(tp) end
if chk==0 then return not Duel.CheckNormalSummonActivity(tp) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
......@@ -26,7 +27,6 @@ function c34838437.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,34838437,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c34838437.spfilter(c,e,tp)
return c:IsLevelBelow(4) and (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -14,6 +14,7 @@ function c35112613.initial_effect(c)
e2:SetDescription(aux.Stringid(35112613,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,35112613)
e2:SetCost(c35112613.thcost)
e2:SetTarget(c35112613.thtg)
e2:SetOperation(c35112613.thop)
......@@ -38,11 +39,10 @@ function c35112613.cfilter(c)
return c:IsSetCard(0x55) and c:IsType(TYPE_MONSTER) and c:GetCode()~=35112613 and c:IsAbleToGraveAsCost()
end
function c35112613.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,35112613)==0 and Duel.IsExistingMatchingCard(c35112613.cfilter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c35112613.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c35112613.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
Duel.RegisterFlagEffect(tp,35112613,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c35112613.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
......
......@@ -6,17 +6,12 @@ function c3534077.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCountLimit(1,3534077)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c3534077.spcost)
e1:SetTarget(c3534077.sptg)
e1:SetOperation(c3534077.spop)
c:RegisterEffect(e1)
end
function c3534077.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,3534077)==0 end
Duel.RegisterFlagEffect(tp,3534077,RESET_PHASE+PHASE_END,0,1)
end
function c3534077.filter(c,e,tp)
return c:IsRace(RACE_BEASTWARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE) and c:GetLevel()==4 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -6,15 +6,11 @@ function c35537251.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c35537251.spcost)
e1:SetCountLimit(1,35537251)
e1:SetTarget(c35537251.sptg)
e1:SetOperation(c35537251.spop)
c:RegisterEffect(e1)
end
function c35537251.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,35537251)==0 end
Duel.RegisterFlagEffect(tp,35537251,RESET_PHASE+PHASE_END,0,1)
end
function c35537251.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Group.CreateGroup()
......
......@@ -13,6 +13,7 @@ function c35631584.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c35631584.con)
e2:SetTarget(c35631584.tg)
e2:SetOperation(c35631584.op)
......@@ -22,14 +23,13 @@ function c35631584.gfilter(c,tp)
return c:IsSetCard(0x53) and c:IsType(TYPE_XYZ) and c:IsControler(tp)
end
function c35631584.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(35631584)==0 and eg:IsExists(c35631584.gfilter,1,nil,tp)
return eg:IsExists(c35631584.gfilter,1,nil,tp)
end
function c35631584.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
e:GetHandler():RegisterFlagEffect(35631584,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c35631584.op(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -6,6 +6,7 @@ function c36376145.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,36376145+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c36376145.condition)
e1:SetCost(c36376145.cost)
e1:SetTarget(c36376145.target)
......@@ -16,9 +17,8 @@ function c36376145.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=4000 and Duel.GetAttackTarget()~=nil
end
function c36376145.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,36376145)==0 end
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
Duel.RegisterFlagEffect(tp,36376145,RESET_PHASE+PHASE_END,0,1)
end
function c36376145.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
......
......@@ -6,6 +6,7 @@ function c36834155.initial_effect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(2,36834155)
e1:SetCost(c36834155.cost)
e1:SetOperation(c36834155.operation)
c:RegisterEffect(e1)
......@@ -14,11 +15,10 @@ function c36834155.cfilter(c)
return c:IsSetCard(0x55) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c36834155.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,36834155)<2 and Duel.IsExistingMatchingCard(c36834155.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c36834155.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c36834155.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,36834155,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c36834155.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -6,15 +6,15 @@ function c36916401.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,36916401+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c36916401.cost)
e1:SetTarget(c36916401.target)
e1:SetOperation(c36916401.operation)
c:RegisterEffect(e1)
end
function c36916401.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,36916401)==0 and Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
Duel.RegisterFlagEffect(tp,36916401,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c36916401.filter(c,e,tp)
return c:IsSetCard(0x84) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -28,7 +28,7 @@ function c37781520.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCountLimit(1,37781520)
e3:SetCost(c37781520.hdcost)
e3:SetTarget(c37781520.hdtg)
e3:SetOperation(c37781520.hdop)
......@@ -77,10 +77,9 @@ function c37781520.costfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsSetCard(0x74)
end
function c37781520.hdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,37781520)==0 and Duel.CheckReleaseGroup(tp,c37781520.costfilter,1,e:GetHandler()) end
if chk==0 then return Duel.CheckReleaseGroup(tp,c37781520.costfilter,1,e:GetHandler()) end
local sg=Duel.SelectReleaseGroup(tp,c37781520.costfilter,1,1,e:GetHandler())
Duel.Release(sg,REASON_COST)
Duel.RegisterFlagEffect(tp,37781520,RESET_PHASE+PHASE_END,0,1)
end
function c37781520.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)~=0 end
......
......@@ -21,6 +21,7 @@ function c37803172.initial_effect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,37803172)
e3:SetCost(c37803172.spcost)
e3:SetTarget(c37803172.sptg)
e3:SetOperation(c37803172.spop)
......@@ -36,11 +37,10 @@ function c37803172.cfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToGraveAsCost()
end
function c37803172.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,37803172)==0 and e:GetHandler():IsReleasable()
if chk==0 then return e:GetHandler():IsReleasable()
and Duel.IsExistingMatchingCard(c37803172.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c37803172.cfilter,1,1,REASON_COST)
Duel.Release(e:GetHandler(),REASON_COST)
Duel.RegisterFlagEffect(tp,37803172,RESET_PHASE+PHASE_END,0,1)
end
function c37803172.filter(c,e,tp)
return c:IsSetCard(0x107d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -10,13 +10,14 @@ function c3814632.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,3814632)
e1:SetCost(c3814632.cost)
e1:SetTarget(c3814632.target)
e1:SetOperation(c3814632.operation)
c:RegisterEffect(e1)
end
function c3814632.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,3814632)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
and e:GetHandler():GetAttackAnnouncedCount()==0 end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -25,7 +26,6 @@ function c3814632.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e:GetHandler():RegisterEffect(e1)
Duel.RegisterFlagEffect(tp,3814632,RESET_PHASE+PHASE_END,0,1)
end
function c3814632.filter(c)
return c:IsDestructable()
......
......@@ -10,6 +10,7 @@ function c38250531.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,38250531)
e1:SetCost(c38250531.spcost)
e1:SetTarget(c38250531.sptg)
e1:SetOperation(c38250531.spop)
......@@ -33,9 +34,8 @@ function c38250531.initial_effect(c)
c:RegisterEffect(e3)
end
function c38250531.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,38250531)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.RegisterFlagEffect(tp,38250531,RESET_PHASE+PHASE_END,0,1)
end
function c38250531.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -10,6 +10,7 @@ function c38273745.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCondition(c38273745.con1)
e1:SetCost(c38273745.cost)
e1:SetTarget(c38273745.tg1)
......@@ -21,6 +22,7 @@ function c38273745.initial_effect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCondition(c38273745.con2)
e2:SetCost(c38273745.cost)
e2:SetTarget(c38273745.tg2)
......@@ -33,6 +35,7 @@ function c38273745.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCondition(c38273745.con3)
e3:SetCost(c38273745.cost)
e3:SetTarget(c38273745.tg3)
......@@ -45,14 +48,13 @@ function c38273745.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c38273745.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(38273745)==0 and e:GetHandler():GetFlagEffect(38273746)==0
return e:GetHandler():GetFlagEffect(38273746)==0
end
function c38273745.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
e:GetHandler():RegisterFlagEffect(38273745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(38273746,RESET_EVENT+0x1fe0000,EFFECT_FLAG_COPY_INHERIT,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
......@@ -63,12 +65,11 @@ function c38273745.op1(e,tp,eg,ep,ev,re,r,rp)
end
end
function c38273745.con2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(38273745)==0 and e:GetHandler():GetFlagEffect(38273747)==0
return e:GetHandler():GetFlagEffect(38273747)==0
end
function c38273745.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)~=0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_HAND)
e:GetHandler():RegisterFlagEffect(38273745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(38273747,RESET_EVENT+0x1fe0000,EFFECT_FLAG_COPY_INHERIT,1)
end
function c38273745.op2(e,tp,eg,ep,ev,re,r,rp)
......@@ -78,14 +79,13 @@ function c38273745.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
function c38273745.con3(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(38273745)==0 and e:GetHandler():GetFlagEffect(38273748)==0
return e:GetHandler():GetFlagEffect(38273748)==0
end
function c38273745.tg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
e:GetHandler():RegisterFlagEffect(38273745,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(38273748,RESET_EVENT+0x1fe0000,EFFECT_FLAG_COPY_INHERIT,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
......
......@@ -15,7 +15,7 @@ function c387282.initial_effect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c387282.lvcost)
e2:SetCountLimit(1,387282)
e2:SetTarget(c387282.lvtg)
e2:SetOperation(c387282.lvop)
c:RegisterEffect(e2)
......@@ -35,10 +35,6 @@ function c387282.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function c387282.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,387282)==0 end
Duel.RegisterFlagEffect(tp,387282,RESET_PHASE+PHASE_END,0,1)
end
function c387282.filter(c)
return c:IsFaceup() and c:GetLevel()>0 and c:IsSetCard(0x54)
end
......
......@@ -6,6 +6,7 @@ function c38973775.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,38973775)
e1:SetCost(c38973775.cost)
e1:SetTarget(c38973775.target)
e1:SetOperation(c38973775.operation)
......@@ -19,10 +20,8 @@ function c38973775.filter(c)
return c:IsLevelBelow(4) and c:IsSetCard(0x55) and c:IsAbleToHand()
end
function c38973775.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,38973775)==0
and Duel.IsExistingMatchingCard(c38973775.filter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c38973775.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.RegisterFlagEffect(tp,38973775,RESET_PHASE+PHASE_END,0,1)
end
function c38973775.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -5,8 +5,9 @@ function c39188539.initial_effect(c)
e1:SetDescription(aux.Stringid(39188539,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCondition(c39188539.seqcon)
e1:SetTarget(c39188539.seqtg)
e1:SetCost(c39188539.cost)
e1:SetOperation(c39188539.seqop)
c:RegisterEffect(e1)
--
......@@ -16,6 +17,8 @@ function c39188539.initial_effect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCost(c39188539.cost)
e2:SetTarget(c39188539.thtg)
e2:SetOperation(c39188539.thop)
c:RegisterEffect(e2)
......@@ -25,10 +28,9 @@ function c39188539.seqcon(e,tp,eg,ep,ev,re,r,rp)
return (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1))
end
function c39188539.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(39188539)==0 end
function c39188539.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RegisterFlagEffect(39188539,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c39188539.seqop(e,tp,eg,ep,ev,re,r,rp)
local seq=e:GetHandler():GetSequence()
......@@ -53,12 +55,10 @@ function c39188539.filter(c,seq)
end
function c39188539.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c39188539.filter(chkc,4-e:GetHandler():GetSequence()) end
if chk==0 then return e:GetHandler():GetFlagEffect(39188539)==0
and Duel.IsExistingTarget(c39188539.filter,tp,0,LOCATION_ONFIELD,1,nil,4-e:GetHandler():GetSequence()) end
if chk==0 then return Duel.IsExistingTarget(c39188539.filter,tp,0,LOCATION_ONFIELD,1,nil,4-e:GetHandler():GetSequence()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c39188539.filter,tp,0,LOCATION_ONFIELD,1,1,nil,4-e:GetHandler():GetSequence())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
e:GetHandler():RegisterFlagEffect(39188539,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c39188539.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......
......@@ -5,6 +5,7 @@ function c39699564.initial_effect(c)
e1:SetDescription(aux.Stringid(39699564,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,39699564)
e1:SetCondition(c39699564.setcon)
e1:SetCost(c39699564.setcost)
e1:SetTarget(c39699564.settg)
......@@ -24,10 +25,9 @@ function c39699564.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(39699564)>0
end
function c39699564.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,39699564)==0 and Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x79) end
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x79) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x79)
Duel.Release(g,REASON_COST)
Duel.RegisterFlagEffect(tp,39699564,RESET_PHASE+PHASE_END,0,1)
end
function c39699564.filter(c)
return c:IsSetCard(0x7c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
......
......@@ -6,6 +6,7 @@ function c40230018.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,40230018+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c40230018.condition)
e1:SetCost(c40230018.cost)
e1:SetTarget(c40230018.target)
......@@ -43,8 +44,7 @@ function c40230018.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c40230018.cfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function c40230018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,40230018)==0 and c40230018[tp] end
Duel.RegisterFlagEffect(tp,40230018,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
if chk==0 then return c40230018[tp] end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
......
......@@ -6,6 +6,7 @@ function c40371092.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,40371092)
e1:SetCost(c40371092.thcost)
e1:SetTarget(c40371092.thtg)
e1:SetOperation(c40371092.thop)
......@@ -17,17 +18,16 @@ function c40371092.initial_effect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,40371093)
e2:SetCost(c40371092.atkcost)
e2:SetTarget(c40371092.atktg)
e2:SetOperation(c40371092.atkop)
c:RegisterEffect(e2)
end
function c40371092.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,40371092)==0
and Duel.CheckReleaseGroup(tp,Card.IsAttribute,1,e:GetHandler(),ATTRIBUTE_LIGHT) end
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsAttribute,1,e:GetHandler(),ATTRIBUTE_LIGHT) end
local g=Duel.SelectReleaseGroup(tp,Card.IsAttribute,1,1,e:GetHandler(),ATTRIBUTE_LIGHT)
Duel.Release(g,REASON_COST)
Duel.RegisterFlagEffect(tp,40371092,RESET_PHASE+PHASE_END,0,1)
end
function c40371092.filter(c)
return c:GetLevel()==4 and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
......@@ -52,12 +52,10 @@ function c40371092.cfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost()
end
function c40371092.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,40371093)==0
and Duel.IsExistingMatchingCard(c40371092.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c40371092.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c40371092.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,40371093,RESET_PHASE+PHASE_END,0,1)
end
function c40371092.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
......
......@@ -9,15 +9,15 @@ function c40424929.initial_effect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,40424929)
e1:SetCost(c40424929.damcost)
e1:SetTarget(c40424929.damtg)
e1:SetOperation(c40424929.damop)
c:RegisterEffect(e1)
end
function c40424929.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,40424929)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.RegisterFlagEffect(tp,40424929,RESET_PHASE+PHASE_END,0,1)
end
function c40424929.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
......
......@@ -7,6 +7,7 @@ function c41006930.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,41006930)
e1:SetCost(c41006930.rmcost)
e1:SetTarget(c41006930.rmtg)
e1:SetOperation(c41006930.rmop)
......@@ -22,9 +23,8 @@ function c41006930.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c41006930.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,41006930)==0 and e:GetHandler():IsAbleToRemove() end
if chk==0 then return e:GetHandler():IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
Duel.RegisterFlagEffect(tp,41006930,RESET_PHASE+PHASE_END,0,1)
end
function c41006930.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -6,6 +6,7 @@ function c41329458.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,41329458)
e1:SetCost(c41329458.spcost)
e1:SetTarget(c41329458.sptg)
e1:SetOperation(c41329458.spop)
......@@ -38,10 +39,9 @@ function c41329458.indcon(e)
return Duel.IsExistingMatchingCard(Card.IsType,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,TYPE_TOKEN)
end
function c41329458.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,41329458)==0 and Duel.CheckReleaseGroup(tp,Card.IsSetCard,2,nil,0x101b) end
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,2,nil,0x101b) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,2,2,nil,0x101b)
Duel.Release(g,REASON_COST)
Duel.RegisterFlagEffect(tp,41329458,RESET_PHASE+PHASE_END,0,1)
end
function c41329458.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
......
......@@ -5,15 +5,11 @@ function c41620959.initial_effect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c41620959.cost)
e1:SetCountLimit(1,41620959+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c41620959.target)
e1:SetOperation(c41620959.activate)
c:RegisterEffect(e1)
end
function c41620959.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,41620959)==0 end
Duel.RegisterFlagEffect(tp,41620959,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c41620959.tgfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGrave()
end
......
......@@ -6,6 +6,7 @@ function c4168871.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,4168871+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c4168871.cost)
e1:SetTarget(c4168871.target)
e1:SetOperation(c4168871.activate)
......@@ -15,7 +16,7 @@ function c4168871.filter(c)
return c:IsSetCard(0x33) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c4168871.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.CheckSpecialSummonActivity(tp) and Duel.GetFlagEffect(tp,4168871)==0
if chk==0 then return not Duel.CheckSpecialSummonActivity(tp)
and Duel.IsExistingMatchingCard(c4168871.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c4168871.filter,tp,LOCATION_HAND,0,1,1,nil)
......@@ -27,7 +28,6 @@ function c4168871.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,4168871,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c4168871.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
......
......@@ -62,7 +62,6 @@ function c4179255.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c4179255.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsPosition(POS_FACEUP_ATTACK) and c4179255.check() then
Duel.Destroy(tc,REASON_EFFECT)
......
--
--暗黒の瘴気
function c41930553.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......
......@@ -23,8 +23,8 @@ function c42216237.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_REMOVED)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCountLimit(1,42216237)
e3:SetCondition(c42216237.spcon)
e3:SetCost(c42216237.spcost)
e3:SetTarget(c42216237.sptg)
e3:SetOperation(c42216237.spop)
e3:SetLabelObject(e2)
......@@ -41,10 +41,6 @@ function c42216237.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and c:GetFlagEffect(42216237)>0
end
function c42216237.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,42216237)==0 end
Duel.RegisterFlagEffect(tp,42216237,RESET_PHASE+PHASE_END,0,1)
end
function c42216237.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
......@@ -54,6 +50,6 @@ end
function c42216237.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -6,10 +6,9 @@ function c43694481.initial_effect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_NO_TURN_RESET)
e1:SetCountLimit(1)
e1:SetCountLimit(1,43694481)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c43694481.damcon)
e1:SetCost(c43694481.damcost)
e1:SetTarget(c43694481.damtg)
e1:SetOperation(c43694481.damop)
c:RegisterEffect(e1)
......@@ -17,10 +16,6 @@ end
function c43694481.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetAttack()>e:GetHandler():GetBaseAttack()
end
function c43694481.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,43694481)==0 end
Duel.RegisterFlagEffect(tp,43694481,RESET_PHASE+PHASE_END,0,1)
end
function c43694481.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
......
......@@ -6,15 +6,11 @@ function c43841694.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c43841694.cost)
e1:SetCountLimit(1,43841694+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c43841694.target)
e1:SetOperation(c43841694.activate)
c:RegisterEffect(e1)
end
function c43841694.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,43841694)==0 end
Duel.RegisterFlagEffect(tp,43841694,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c43841694.filter(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -6,6 +6,8 @@ function c45282603.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetCountLimit(1)
e1:SetTarget(c45282603.sptg)
e1:SetOperation(c45282603.spop)
c:RegisterEffect(e1)
......@@ -14,10 +16,9 @@ function c45282603.filter(c,lv,e,tp)
return c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c45282603.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():GetFlagEffect(45282603)==0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c45282603.filter,tp,LOCATION_HAND,0,1,nil,e:GetHandler():GetLevel(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
e:GetHandler():RegisterFlagEffect(45282603,RESET_EVENT+0x1fe0000,0,1)
end
function c45282603.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
......
......@@ -9,6 +9,7 @@ function c4549095.initial_effect(c)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,4549095)
e1:SetCondition(c4549095.condition)
e1:SetCost(c4549095.cost)
e1:SetOperation(c4549095.operation)
......@@ -23,9 +24,8 @@ function c4549095.condition(e,tp,eg,ep,ev,re,r,rp)
or (d and d:GetControler()==tp and d:IsSetCard(0x84) and d:IsRelateToBattle())
end
function c4549095.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,4549095)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,4549095,RESET_PHASE+PHASE_END,0,1)
end
function c4549095.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local a=Duel.GetAttacker()
......
......@@ -7,15 +7,15 @@ function c45705025.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,45705025)
e1:SetCost(c45705025.cost)
e1:SetTarget(c45705025.target)
e1:SetOperation(c45705025.operation)
c:RegisterEffect(e1)
end
function c45705025.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,45705025)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,45705025,RESET_PHASE+PHASE_END,0,1)
end
function c45705025.filter(c,e,tp)
return c:IsRace(RACE_PSYCHO) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -6,6 +6,7 @@ function c45725480.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,45725480+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c45725480.cost)
e1:SetTarget(c45725480.target)
e1:SetOperation(c45725480.activate)
......@@ -15,12 +16,10 @@ function c45725480.filter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:GetLevel()==7 and c:IsAbleToRemoveAsCost()
end
function c45725480.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,45725480)==0
and Duel.IsExistingMatchingCard(c45725480.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c45725480.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c45725480.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,45725480,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c45725480.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
......
......@@ -20,6 +20,7 @@ function c45742626.initial_effect(c)
e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,45742626)
e3:SetCost(c45742626.cost)
e3:SetTarget(c45742626.target)
e3:SetOperation(c45742626.operation)
......@@ -29,9 +30,8 @@ function c45742626.value(e,c)
return Duel.GetMatchingGroupCount(Card.IsAttribute,0,LOCATION_GRAVE,LOCATION_GRAVE,nil,ATTRIBUTE_DARK)*200
end
function c45742626.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,45742626)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.RegisterFlagEffect(tp,45742626,RESET_PHASE+PHASE_END,0,1)
end
function c45742626.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) and Duel.IsPlayerCanDiscardDeck(1-tp,5) end
......
......@@ -24,7 +24,7 @@ function c45803070.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCost(c45803070.setcost)
e3:SetCountLimit(1,45803070)
e3:SetTarget(c45803070.settg)
e3:SetOperation(c45803070.setop)
c:RegisterEffect(e3)
......@@ -50,10 +50,6 @@ function c45803070.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
end
function c45803070.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,45803070)==0 end
Duel.RegisterFlagEffect(tp,45803070,RESET_PHASE+PHASE_END,0,1)
end
function c45803070.setfilter(c)
return c:GetType()==TYPE_TRAP and (c:IsSetCard(0x4c) or c:IsSetCard(0x89)) and c:IsSSetable()
end
......
......@@ -16,6 +16,7 @@ function c46008667.initial_effect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,46008667)
e2:SetCondition(c46008667.spcon)
e2:SetCost(c46008667.spcost)
e2:SetTarget(c46008667.sptg)
......@@ -62,9 +63,8 @@ function c46008667.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetTurnID()~=Duel.GetTurnCount()
end
function c46008667.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,46008667)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,46008667,RESET_PHASE+PHASE_END,0,1)
end
function c46008667.filter1(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x107a)
......
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