Commit 2ed99531 authored by mercury233's avatar mercury233

fix

parent a59349cb
Pipeline #23285 passed with stages
in 1 minute and 14 seconds
......@@ -8,7 +8,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
......@@ -23,22 +23,22 @@ function s.initial_effect(c)
e2:SetOperation(s.repop)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsSetCard(0x81) and c:IsFaceup()
function s.filter(c,e)
return c:IsSetCard(0x81) and c:IsFaceup() and c:IsCanBeEffectTarget(e)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_MZONE,0,nil)
local ec=Duel.GetMatchingGroupCount(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
local mc=math.min(g,ec)
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,e) end
local ct1=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_MZONE,0,nil,e)
local ct2=Duel.GetMatchingGroupCount(Card.IsCanBeEffectTarget,tp,0,LOCATION_ONFIELD,nil,e)
local mc=math.min(ct1,ct2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,mc,nil)
local g1=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,mc,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,mc,nil)
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,#g1,#g1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,#g1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
......
......@@ -77,7 +77,8 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and e:GetHandler():GetType()==TYPE_TRAP+TYPE_CONTINUOUS
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,id,0x2a5,TYPE_MONSTER+TYPE_EFFECT+TYPE_TUNER,1600,1600,4,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0x2a5,TYPE_MONSTER+TYPE_EFFECT+TYPE_TUNER,1600,1600,4,RACE_SPELLCASTER,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -73,7 +73,8 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and e:GetHandler():GetType()==TYPE_TRAP+TYPE_CONTINUOUS
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,id,0x2a5,TYPE_MONSTER+TYPE_EFFECT,1000,2000,4,RACE_PYRO,ATTRIBUTE_DARK) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0x2a5,TYPE_MONSTER+TYPE_EFFECT,1000,2000,4,RACE_PYRO,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -80,7 +80,8 @@ function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and e:GetHandler():GetType()==TYPE_TRAP+TYPE_CONTINUOUS
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,id,0x2a5,TYPE_MONSTER+TYPE_EFFECT,1000,2000,4,RACE_PYRO,ATTRIBUTE_DARK) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id,0x2a5,TYPE_MONSTER+TYPE_EFFECT,1000,2000,4,RACE_PYRO,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -51,7 +51,7 @@ function s.confilter(c)
end
function s.con(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_MZONE,0,1,nil)
return Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)~=0
......
......@@ -38,14 +38,13 @@ function s.initial_effect(c)
--copy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id+o)
e4:SetCondition(s.cpcon)
e4:SetCost(s.cpcost)
e4:SetTarget(s.cptg)
e4:SetOperation(s.cpop)
c:RegisterEffect(e4)
--snip 1: from "Raidraptor - Wild Vulture"
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
......@@ -60,16 +59,20 @@ function s.initial_effect(c)
ge2:SetLabel(id)
Duel.RegisterEffect(ge2,0)
end
--end snip 1
end
function s.cfilter(c)
return c:GetOriginalRace()&RACE_FIEND>0 and c:GetOriginalType()&TYPE_MONSTER>0
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_PZONE,0,1,e:GetHandler()) and r==REASON_EFFECT
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_PZONE,0,1,e:GetHandler())
and ep==tp
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x170,1)
local c=e:GetHandler()
c:AddCounter(0x170,1)
if c:GetCounter(0x170)==3 then
Duel.RaiseEvent(c,EVENT_CUSTOM+100421035,e,0,tp,tp,0)
end
end
function s.lscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
......@@ -117,31 +120,25 @@ function s.pfilter(c)
return c:IsSetCard(0x2a3) and (typ==TYPE_SPELL or typ==TYPE_TRAP) and c:IsAbleToRemoveAsCost()
and c:CheckActivateEffect(false,true,false)
end
function s.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_GRAVE,0,1,nil) end
function s.cptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked()
and Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,s.pfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
local te=tc:CheckActivateEffect(false,true,true)
s[Duel.GetCurrentChain()]=te
local te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,true,true)
e:SetLabelObject(te)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
tc:RegisterFlagEffect(id,RESET_CHAIN,0,1)
end
function s.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local te=s[Duel.GetCurrentChain()]
if chkc then
local tg=te:GetTarget()
return tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then return e:IsCostChecked() end
if not te then return end
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function s.cpop(e,tp,eg,ep,ev,re,r,rp)
local te=s[Duel.GetCurrentChain()]
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
if op then op(e,tp,eg,ep,ev,re,r,rp,1) end
end
......@@ -34,14 +34,13 @@ function s.initial_effect(c)
--copy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id+o)
e4:SetCondition(s.cpcon)
e4:SetCost(s.cpcost)
e4:SetTarget(s.cptg)
e4:SetOperation(s.cpop)
c:RegisterEffect(e4)
--snip 1: from "Raidraptor - Wild Vulture"
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
......@@ -56,16 +55,20 @@ function s.initial_effect(c)
ge2:SetLabel(id)
Duel.RegisterEffect(ge2,0)
end
--end snip 1
end
function s.cfilter(c)
return c:GetOriginalRace()&RACE_FAIRY>0 and c:GetOriginalType()&TYPE_MONSTER>0
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_PZONE,0,1,e:GetHandler()) and r==REASON_EFFECT
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_PZONE,0,1,e:GetHandler())
and r==REASON_EFFECT and ep==tp
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x170,1)
local c=e:GetHandler()
c:AddCounter(0x170,1)
if c:GetCounter(0x170)==3 then
Duel.RaiseEvent(c,EVENT_CUSTOM+100421035,e,0,tp,tp,0)
end
end
function s.adval(e,c)
return Duel.GetCounter(e:GetHandlerPlayer(),1,0,0x170)*-100
......@@ -101,31 +104,25 @@ function s.pfilter(c)
return c:IsSetCard(0x2a3) and (typ==TYPE_SPELL or typ==TYPE_TRAP) and c:IsAbleToRemoveAsCost()
and c:CheckActivateEffect(false,true,false)
end
function s.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_GRAVE,0,1,nil) end
function s.cptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked()
and Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,s.pfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
local te=tc:CheckActivateEffect(false,true,true)
s[Duel.GetCurrentChain()]=te
local te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(false,true,true)
e:SetLabelObject(te)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
tc:RegisterFlagEffect(id,RESET_CHAIN,0,1)
end
function s.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local te=s[Duel.GetCurrentChain()]
if chkc then
local tg=te:GetTarget()
return tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then return e:IsCostChecked() end
if not te then return end
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function s.cpop(e,tp,eg,ep,ev,re,r,rp)
local te=s[Duel.GetCurrentChain()]
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
if op then op(e,tp,eg,ep,ev,re,r,rp,2) end
end
......@@ -13,22 +13,17 @@ function s.initial_effect(c)
c:RegisterEffect(e1)
--control
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADD_COUNTER+0x170)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(s.concon)
e2:SetCode(EVENT_CUSTOM+id)
e2:SetCountLimit(1,id+o)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCondition(s.concon)
e2:SetTarget(s.contg)
e2:SetOperation(s.conop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_CONTROL)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetCountLimit(1,id+o)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetTarget(s.contg)
e3:SetOperation(s.conop)
c:RegisterEffect(e3)
end
function s.filter(c)
return c:IsSetCard(0x2a3) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
......@@ -42,19 +37,13 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,sg)
end
end
function s.cfilter(c)
return c:GetCounter(0x170)==3
end
function s.concon(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_PZONE,0,1,nil) then
Duel.RaiseSingleEvent(e:GetHandler(),EVENT_CUSTOM+id,e,0,0,tp,0)
end
return ep==tp
end
function s.contg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp)
and chkc:IsControlerCanBeChanged() end
if chk==0 then return e:GetHandler():IsRelateToEffect(e)
and Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
......
......@@ -15,13 +15,11 @@ end
function s.filter(c)
return c:IsSetCard(0x2a3) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() and not c:IsCode(id)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,0x2a3) and tp or 1-tp
local c=e:GetOwner()
local b1=c:GetFlagEffect(100421031)>0
local b2=c:GetFlagEffect(100421032)>0
if not (b1 or b2) then b1,b2=true,true end
local op=aux.SelectFromOptions(p,{b1,aux.Stringid(id,1)},{b2,aux.Stringid(id,2)})
function s.activate(e,tp,eg,ep,ev,re,r,rp,op)
if op==nil then
local p=Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,0x2a3) and tp or 1-tp
op=aux.SelectFromOptions(p,{true,aux.Stringid(id,1)},{true,aux.Stringid(id,2)})
end
if op==1 then
if Duel.Recover(tp,500,REASON_EFFECT)<1 then return end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_HAND,0,nil)
......
......@@ -15,13 +15,11 @@ end
function s.filter(c)
return c:IsSetCard(0x2a3) and c:IsAbleToGrave() and not c:IsCode(id)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,0x2a3) and tp or 1-tp
local c=e:GetOwner()
local b1=c:GetFlagEffect(100421031)>0
local b2=c:GetFlagEffect(100421032)>0
if not (b1 or b2) then b1,b2=true,true end
local op=aux.SelectFromOptions(p,{b1,aux.Stringid(id,1)},{b2,aux.Stringid(id,2)})
function s.activate(e,tp,eg,ep,ev,re,r,rp,op)
if op==nil then
local p=Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,0x2a3) and tp or 1-tp
op=aux.SelectFromOptions(p,{true,aux.Stringid(id,1)},{true,aux.Stringid(id,2)})
end
if op==1 then
if Duel.Recover(tp,500,REASON_EFFECT)<1 or not Duel.SelectYesNo(tp,aux.Stringid(id,3)) then return end
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_DECK,0,nil,0x2a3)
......
......@@ -19,12 +19,11 @@ end
function s.hfilter(c)
return c:IsLevel(4) and c:IsAbleToHand()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,0x2a3) and tp or 1-tp
local c=e:GetOwner()
local b1,b2=c:GetFlagEffect(100421031)>0,c:GetFlagEffect(100421032)>0
if not (b1 or b2) then b1,b2=true,true end
local op=aux.SelectFromOptions(p,{b1,aux.Stringid(id,1)},{b2,aux.Stringid(id,2)})
function s.activate(e,tp,eg,ep,ev,re,r,rp,op)
if op==nil then
local p=Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,0x2a3) and tp or 1-tp
op=aux.SelectFromOptions(p,{true,aux.Stringid(id,1)},{true,aux.Stringid(id,2)})
end
if op==1 then
if Duel.Recover(tp,500,REASON_EFFECT)<1 then return end
local g=Duel.SelectMatchingCard(1-tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
......
......@@ -23,15 +23,14 @@ end
function s.afilter(c)
return c:IsFaceup() and c:IsSetCard(0x2a3) and c:IsType(TYPE_LINK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local chk=Duel.IsExistingMatchingCard(s.afilter,tp,LOCATION_MZONE,0,1,nil)
local c=e:GetOwner()
local b1,b2=c:GetFlagEffect(100421031)>0,c:GetFlagEffect(100421032)>0
if not (b1 or b2) then b1,b2=true,true end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)},
{b1 and b2 or chk,aux.Stringid(id,3)})
function s.activate(e,tp,eg,ep,ev,re,r,rp,op)
if op==nil then
local chk=Duel.IsExistingMatchingCard(s.afilter,tp,LOCATION_MZONE,0,1,nil)
op=aux.SelectFromOptions(tp,
{true,aux.Stringid(id,1)},
{true,aux.Stringid(id,2)},
{chk,aux.Stringid(id,3)})
end
if op&1>0 and Duel.Recover(tp,500,REASON_EFFECT)>0 then
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e),TYPE_SPELL+TYPE_TRAP)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
......
......@@ -23,16 +23,15 @@ end
function s.afilter(c)
return c:IsFaceup() and c:IsSetCard(0x2a3) and c:IsType(TYPE_LINK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local chk=Duel.IsExistingMatchingCard(s.afilter,tp,LOCATION_MZONE,0,1,nil)
local c=e:GetOwner()
local b1,b2=c:GetFlagEffect(100421031)>0,c:GetFlagEffect(100421032)>0
c=e:GetHandler()
if not (b1 or b2) then b1,b2=true,true end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,1)},
{b2,aux.Stringid(id,2)},
{b1 and b2 or chk,aux.Stringid(id,3)})
function s.activate(e,tp,eg,ep,ev,re,r,rp,op)
local c=e:GetHandler()
if op==nil then
local chk=Duel.IsExistingMatchingCard(s.afilter,tp,LOCATION_MZONE,0,1,nil)
op=aux.SelectFromOptions(tp,
{true,aux.Stringid(id,1)},
{true,aux.Stringid(id,2)},
{chk,aux.Stringid(id,3)})
end
if op&1>0 and Duel.Recover(tp,500,REASON_EFFECT)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
......
......@@ -13,9 +13,9 @@ function c101202013.initial_effect(c)
--Leave Field
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101202013,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetCategory(CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101202113)
......@@ -54,6 +54,7 @@ function c101202013.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
elseif not g:FilterCount(Card.IsAbleToDeck,nil,e)==g:GetCount() then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0)
end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,2,0,0)
end
function c101202013.desop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
......
......@@ -16,7 +16,7 @@ function c101202069.initial_effect(c)
c:RegisterEffect(e1)
end
function c101202069.rfilter(c,tp)
return c:GetBaseAttack()==2500 and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_PENDULUM) and c:IsFaceup()
return c:GetBaseAttack()==2500 and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_PENDULUM)
end
function c101202069.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c101202069.rfilter,1,nil,tp) end
......
--ネオス・ワイズマン
function c5126490.initial_effect(c)
aux.AddCodeList(c,89943723,78371393)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c5126490.spcon)
e2:SetTarget(c5126490.sptg)
e2:SetOperation(c5126490.spop)
c:RegisterEffect(e2)
--damage&recover
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(5126490,0))
e3:SetCategory(CATEGORY_DAMAGE+CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetCondition(aux.dsercon)
e3:SetTarget(c5126490.damtg)
e3:SetOperation(c5126490.damop)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetValue(1)
c:RegisterEffect(e4)
end
function c5126490.spfilter(c,tp)
return c:IsFaceup() and c:IsAbleToGraveAsCost()
end
function c5126490.fselect(g,tp)
return aux.mzctcheck(g,tp) and aux.gfcheck(g,Card.IsCode,89943723,78371393)
end
function c5126490.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c5126490.spfilter,tp,LOCATION_MZONE,0,nil)
return g:CheckSubGroup(c5126490.fselect,2,2,tp)
end
function c5126490.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c5126490.spfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,c5126490.fselect,true,2,2,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c5126490.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_COST)
g:DeleteGroup()
end
function c5126490.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if chk==0 then return c:IsStatus(STATUS_OPPO_BATTLE) and bc~=nil end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,bc:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,bc:GetDefense())
end
function c5126490.damop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
local atk=bc:GetAttack()
local def=bc:GetDefense()
if atk<0 then atk=0 end
if def<0 then def=0 end
Duel.Damage(1-tp,atk,REASON_EFFECT,true)
Duel.Recover(tp,def,REASON_EFFECT,true)
Duel.RDComplete()
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment