Commit ba1ad280 authored by VanillaSalt's avatar VanillaSalt

new

parent 04665049
--CNo.69 紋章死神カオス・オブ・アームズ
function c11522979.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,5),4)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11522979,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c11522979.descon)
e1:SetTarget(c11522979.destg)
e1:SetOperation(c11522979.desop)
c:RegisterEffect(e1)
--effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11522979,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c11522979.condition)
e2:SetCost(c11522979.cost)
e2:SetTarget(c11522979.target)
e2:SetOperation(c11522979.operation)
c:RegisterEffect(e2)
end
function c11522979.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c11522979.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c11522979.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function c11522979.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,2407234)
end
function c11522979.cost(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 c11522979.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c11522979.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c11522979.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c11522979.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c11522979.filter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c11522979.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local code=tc:GetOriginalCode()
local atk=tc:GetBaseAttack()
if atk<0 then atk=0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(atk)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
c:CopyEffect(code,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,1)
end
end
......@@ -37,7 +37,7 @@ end
function c12744567.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
--和魂
function c24701235.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--summon,flip
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetOperation(c24701235.retreg)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP)
c:RegisterEffect(e3)
--extra summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetOperation(c24701235.sumop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_FLIP)
c:RegisterEffect(e5)
--draw
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(24701235,1))
e6:SetCategory(CATEGORY_DRAW)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetCondition(c24701235.condition)
e6:SetTarget(c24701235.target)
e6:SetOperation(c24701235.operation)
c:RegisterEffect(e6)
end
function c24701235.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(aux.Stringid(24701235,0))
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+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(c24701235.retcon)
e1:SetTarget(c24701235.rettg)
e1:SetOperation(c24701235.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
c:RegisterEffect(e2)
end
function c24701235.retcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(24701235)>0 or 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 c24701235.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c24701235.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function c24701235.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,24701235)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_SPIRIT))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,24701235,RESET_PHASE+PHASE_END,0,1)
end
function c24701235.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPIRIT)
end
function c24701235.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
and Duel.IsExistingMatchingCard(c24701235.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c24701235.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c24701235.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--墓守の審神者
function c25524823.initial_effect(c)
--summon with 3 tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(25524823,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c25524823.ttcon)
e1:SetOperation(c25524823.ttop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
--summon with 1 tribute
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(25524823,1))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetCondition(c25524823.otcon)
e2:SetOperation(c25524823.otop)
e2:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e2)
--summon success
local e3=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(25524823,6))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCondition(c25524823.condition)
e3:SetTarget(c25524823.target)
e3:SetOperation(c25524823.operation)
c:RegisterEffect(e3)
--tribute check
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_MATERIAL_CHECK)
e4:SetValue(c25524823.valcheck)
c:RegisterEffect(e4)
e3:SetLabelObject(e4)
e4:SetLabelObject(e3)
end
function c25524823.ttcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-3 and Duel.GetTributeCount(c)>=3
end
function c25524823.ttop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectTribute(tp,c,3,3)
c:SetMaterial(g)
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
end
function c25524823.otcon(e,c)
if c==nil then return true end
local g=Duel.GetTributeGroup(c)
return c:GetLevel()>6 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and g:IsExists(Card.IsSetCard,1,nil,0x2e)
end
function c25524823.otop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetTributeGroup(c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:FilterSelect(tp,Card.IsSetCard,1,1,nil,0x2e)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c25524823.valcheck(e,c)
local g=c:GetMaterial()
local ct=g:FilterCount(Card.IsSetCard,nil,0x2e)
local lv=0
local tc=g:GetFirst()
while tc do
lv=lv+tc:GetLevel()
tc=g:GetNext()
end
e:SetLabel(lv)
e:GetLabelObject():SetLabel(ct)
end
function c25524823.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_ADVANCE
end
function c25524823.filter(c)
return c:IsFacedown() and c:IsDestructable()
end
function c25524823.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetLabel()
local b1=e:GetLabelObject():GetLabel()>0
local b2=Duel.IsExistingMatchingCard(c25524823.filter,tp,0,LOCATION_MZONE,1,nil)
local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
if chk==0 then return ct>0 and (b1 or b2 or b3) end
local sel=0
local off=0
repeat
local ops={}
local opval={}
off=1
if b1 then
ops[off]=aux.Stringid(25524823,2)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(25524823,3)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(25524823,4)
opval[off-1]=3
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
if opval[op]==1 then
sel=sel+1
b1=false
elseif opval[op]==2 then
sel=sel+2
b2=false
else
sel=sel+4
b3=false
end
ct=ct-1
until ct==0 or off<3 or not Duel.SelectYesNo(tp,aux.Stringid(25524823,5))
e:SetLabel(sel)
if bit.band(sel,2)~=0 then
local g=Duel.GetMatchingGroup(c25524823.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
end
function c25524823.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=e:GetLabel()
if bit.band(sel,1)~=0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local lv=e:GetLabelObject():GetLabel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(lv*100)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
if bit.band(sel,2)~=0 then
local g=Duel.GetMatchingGroup(c25524823.filter,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
if bit.band(sel,4)~=0 then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(-2000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
end
--森羅の仙樹 レギア
function c25824484.initial_effect(c)
--deck check
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(25824484,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c25824484.target)
e1:SetOperation(c25824484.operation)
c:RegisterEffect(e1)
--sort decktop
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(25824484,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c25824484.sdcon)
e2:SetOperation(c25824484.sdop)
c:RegisterEffect(e2)
if not c25824484.global_check then
c25824484.global_check=true
c25824484[0]=Group.CreateGroup()
c25824484[0]:KeepAlive()
c25824484[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c25824484.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c25824484.checkop(e,tp,eg,ep,ev,re,r,rp)
c25824484[0]:Clear()
c25824484[0]:Merge(eg)
c25824484[1]=re
end
function c25824484.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c25824484.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if tc:IsRace(RACE_PLANT) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(tc,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.MoveSequence(tc,1)
end
end
function c25824484.sdcon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c25824484[0]:IsContains(e:GetHandler()) and c25824484[1]==re
end
function c25824484.sdop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end
local ac=1
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25824484,2))
if ct==2 then ac=Duel.AnnounceNumber(tp,1,2)
else ac=Duel.AnnounceNumber(tp,1,2,3) end
end
Duel.SortDecktop(tp,tp,ac)
end
--フォトン・チャージマン
function c2618045.initial_effect(c)
--atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(2618045,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c2618045.cost)
e1:SetOperation(c2618045.operation)
c:RegisterEffect(e1)
end
function c2618045.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1,true)
end
function c2618045.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(c:GetBaseAttack()*2)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_STANDBY,2)
c:RegisterEffect(e1)
end
end
--虹クリボー
function c2830693.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(2830693,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c2830693.eqcost)
e1:SetTarget(c2830693.eqtg)
e1:SetOperation(c2830693.eqop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(2830693,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c2830693.spcon)
e2:SetCost(c2830693.spcost)
e2:SetTarget(c2830693.sptg)
e2:SetOperation(c2830693.spop)
c:RegisterEffect(e2)
end
function c2830693.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,2830693)==0 end
Duel.RegisterFlagEffect(tp,2830693,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c2830693.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local at=Duel.GetAttacker()
if chkc then return chkc==at end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and at:IsControler(1-tp) and at:IsRelateToBattle() and at:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(at)
end
function c2830693.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=c:GetBattleTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToBattle() then
Duel.Equip(tp,c,tc,true)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c2830693.eqlimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end
end
function c2830693.eqlimit(e,c)
return e:GetOwner()==c
end
function c2830693.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
function c2830693.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,2830694)==0 end
Duel.RegisterFlagEffect(tp,2830694,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c2830693.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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c2830693.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
--光子竜降臨
function c34834619.initial_effect(c)
aux.AddRitualProcEqual(c,aux.FilterBoolFunction(Card.IsCode,85346853))
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34834619,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(c34834619.spcost)
e1:SetTarget(c34834619.sptg)
e1:SetOperation(c34834619.spop)
c:RegisterEffect(e1)
end
function c34834619.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c34834619.mtfilter(c,e)
return c:GetLevel()>0 and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c34834619.spfilter(c,e,tp,m)
return c:IsCode(85346853) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,true,false)
and m:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
end
function c34834619.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local mg=Duel.GetMatchingGroup(c34834619.mtfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
return Duel.IsExistingMatchingCard(c34834619.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c34834619.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local mg=Duel.GetMatchingGroup(c34834619.mtfilter,tp,LOCATION_GRAVE,0,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c34834619.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg)
local tc=g:GetFirst()
if tc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
--森羅の水先 リーフ
function c36046926.initial_effect(c)
--deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(36046926,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c36046926.target)
e1:SetOperation(c36046926.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(36046926,2))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c36046926.descon)
e2:SetTarget(c36046926.destg)
e2:SetOperation(c36046926.desop)
c:RegisterEffect(e2)
if not c36046926.global_check then
c36046926.global_check=true
c36046926[0]=Group.CreateGroup()
c36046926[0]:KeepAlive()
c36046926[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c36046926.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c36046926.checkop(e,tp,eg,ep,ev,re,r,rp)
c36046926[0]:Clear()
c36046926[0]:Merge(eg)
c36046926[1]=re
end
function c36046926.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c36046926.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end
local ac=1
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(36046926,1))
ac=Duel.AnnounceNumber(tp,1,2)
end
Duel.ConfirmDecktop(tp,ac)
local g=Duel.GetDecktopGroup(tp,ac)
local sg=g:Filter(Card.IsRace,nil,RACE_PLANT)
if sg:GetCount()>0 then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(sg,REASON_EFFECT)
end
ac=ac-sg:GetCount()
if ac>0 then
Duel.SortDecktop(tp,tp,ac)
for i=1,ac do
local mg=Duel.GetDecktopGroup(tp,1)
Duel.MoveSequence(mg:GetFirst(),1)
end
end
end
function c36046926.descon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c36046926[0]:IsContains(e:GetHandler()) and c36046926[1]==re
end
function c36046926.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c36046926.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--ゴーストリック・ロールシフト
function c37055344.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(37055344,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c37055344.condition)
e2:SetTarget(c37055344.target)
e2:SetOperation(c37055344.operation)
c:RegisterEffect(e2)
end
function c37055344.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_BATTLE
end
function c37055344.filter1(c)
return c:IsFaceup() and c:IsSetCard(0x8d) and c:IsCanTurnSet()
end
function c37055344.filter2(c)
return c:IsPosition(POS_FACEDOWN_DEFENCE)
end
function c37055344.filter3(c)
return c:IsPosition(POS_FACEDOWN_DEFENCE)
end
function c37055344.filter4(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c37055344.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==0 then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c37055344.filter1(chkc)
else return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c37055344.filter3(chkc) end
end
local b1=Duel.IsExistingTarget(c37055344.filter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c37055344.filter2,tp,0,LOCATION_MZONE,1,nil)
local b2=Duel.IsExistingTarget(c37055344.filter3,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(37055344,1),aux.Stringid(37055344,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(37055344,1))
else
op=Duel.SelectOption(tp,aux.Stringid(37055344,2))+1
end
e:SetLabel(op)
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c37055344.filter1,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWNDEFENCE)
local g=Duel.SelectTarget(tp,c37055344.filter3,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
end
function c37055344.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if e:GetLabel()==0 then
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENCE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWNDEFENCE)
local g=Duel.SelectMatchingCard(tp,c37055344.filter2,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEUP_ATTACK)
end
else
if not tc:IsRelateToEffect(e) or tc:IsPosition(POS_FACEUP_ATTACK) then return end
if Duel.ChangePosition(tc,POS_FACEUP_ATTACK)==0 or not tc:IsSetCard(0x8d) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c37055344.filter4,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENCE)
end
end
end
--オーバーレイ・スナイパー
function c39229392.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--to defence
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(39229392,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(c39229392.potg)
e2:SetOperation(c39229392.poop)
c:RegisterEffect(e2)
--atkdown
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(39229392,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(c39229392.atkcon)
e3:SetCost(c39229392.atkcost)
e3:SetTarget(c39229392.atktg)
e3:SetOperation(c39229392.atkop)
c:RegisterEffect(e3)
end
function c39229392.potg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAttackPos() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c39229392.poop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPosition(POS_FACEUP_ATTACK) and c:IsRelateToEffect(e) then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end
end
function c39229392.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0
end
function c39229392.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c39229392.filter,tp,LOCATION_MZONE,0,1,nil)
end
function c39229392.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c39229392.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c39229392.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(Duel.GetOverlayCount(tp,1,0)*-500)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
--ZW-阿修羅副腕
function c40941889.initial_effect(c)
c:SetUniqueOnField(1,0,40941889)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(40941889,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetCondition(c40941889.eqcon)
e1:SetTarget(c40941889.eqtg)
e1:SetOperation(c40941889.eqop)
c:RegisterEffect(e1)
--attack all
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_ATTACK_ALL)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c40941889.eqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():CheckUniqueOnField(tp)
end
function c40941889.filter(c)
return c:IsFaceup() and c:IsSetCard(0x7f)
end
function c40941889.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c40941889.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c40941889.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c40941889.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c40941889.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
Duel.Equip(tp,c,tc,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c40941889.eqlimit)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
end
function c40941889.eqlimit(e,c)
return c:IsSetCard(0x7f)
end
--RUM-アストラル・フォース
function c45950291.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c45950291.target)
e1:SetOperation(c45950291.activate)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(45950291,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c45950291.thcon)
e2:SetCost(c45950291.thcost)
e2:SetTarget(c45950291.thtg)
e2:SetOperation(c45950291.thop)
c:RegisterEffect(e2)
end
function c45950291.cfilter(c,rk)
return c:IsFaceup() and c:GetRank()>rk
end
function c45950291.filter1(c,e,tp)
local rk=c:GetRank()
return rk>0 and c:IsFaceup()
and not Duel.IsExistingMatchingCard(c45950291.cfilter,tp,LOCATION_MZONE,0,1,nil,rk)
and Duel.IsExistingMatchingCard(c45950291.filter2,tp,LOCATION_EXTRA,0,1,nil,rk+2,c:GetRace(),c:GetAttribute(),e,tp)
end
function c45950291.filter2(c,rk,rc,att,e,tp)
return c:GetRank()==rk and c:IsRace(rc) and c:IsAttribute(att)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c45950291.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c45950291.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c45950291.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c45950291.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c45950291.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c45950291.filter2,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetRank()+2,tc:GetRace(),tc:GetAttribute(),e,tp)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
function c45950291.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.GetDrawCount(tp)>0
end
function c45950291.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.CheckSpecialSummonActivity(tp) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c45950291.splimit)
Duel.RegisterEffect(e1,tp)
end
function c45950291.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not se:GetHandler():IsCode(45950291)
end
function c45950291.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
_replace_count=0
_replace_max=dt
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW)
e1:SetValue(0)
Duel.RegisterEffect(e1,tp)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c45950291.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
_replace_count=_replace_count+1
if _replace_count<=_replace_max and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
--ゴーストリック・デュラハン
function c46895036.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,1),2)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(c46895036.atkval)
c:RegisterEffect(e1)
--atk down
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(46895036,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c46895036.condition)
e2:SetCost(c46895036.cost)
e2:SetTarget(c46895036.target)
e2:SetOperation(c46895036.operation)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetDescription(aux.Stringid(46895036,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c46895036.thcon)
e3:SetTarget(c46895036.thtg)
e3:SetOperation(c46895036.thop)
c:RegisterEffect(e3)
end
function c46895036.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8d)
end
function c46895036.atkval(e,c)
return Duel.GetMatchingGroupCount(c46895036.atkfilter,c:GetControler(),LOCATION_ONFIELD,0,nil)*200
end
function c46895036.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c46895036.cost(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 c46895036.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFaceup() and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c46895036.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(tc:GetAttack()/2)
tc:RegisterEffect(e1)
end
end
function c46895036.thcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c46895036.filter(c)
return c:IsSetCard(0x8d) and c:IsAbleToHand()
end
function c46895036.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c46895036.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c46895036.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c46895036.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c46895036.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--CNo.92 偽骸虚龍 Heart-eartH Chaos Dragon
function c47017574.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,10),4)
c:EnableReviveLimit()
--battle
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--recover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47017574,0))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCondition(c47017574.reccon)
e2:SetTarget(c47017574.rectg)
e2:SetOperation(c47017574.recop)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(47017574,1))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c47017574.discon)
e3:SetCost(c47017574.discost)
e3:SetTarget(c47017574.distg)
e3:SetOperation(c47017574.disop)
c:RegisterEffect(e3)
end
function c47017574.reccon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst():IsControler(tp)
end
function c47017574.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ev)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
end
function c47017574.recop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function c47017574.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,97403510)
end
function c47017574.discost(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 c47017574.filter(c)
return c:IsFaceup() and (c:IsLocation(LOCATION_SZONE) or c:IsType(TYPE_EFFECT))
end
function c47017574.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c47017574.filter,tp,0,LOCATION_ONFIELD,1,nil) end
end
function c47017574.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c47017574.filter,tp,0,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
......@@ -40,7 +40,7 @@ end
function c48739166.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
......
--暗黒ブラキ
function c50896944.initial_effect(c)
--pos
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50896944,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c50896944.postg)
e1:SetOperation(c50896944.posop)
c:RegisterEffect(e1)
end
function c50896944.filter(c)
return not c:IsPosition(POS_FACEUP_DEFENCE)
end
function c50896944.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c50896944.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c50896944.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
Duel.SelectTarget(tp,c50896944.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c50896944.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsPosition(POS_FACEUP_DEFENCE) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENCE)
end
end
--幻妖種ミトラ
function c51912531.initial_effect(c)
--synchro limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(c51912531.synlimit)
c:RegisterEffect(e1)
--level down
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(51912531,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(c51912531.cost)
e2:SetTarget(c51912531.target)
e2:SetOperation(c51912531.operation)
c:RegisterEffect(e2)
end
function c51912531.synlimit(e,c)
if not c then return false end
return not c:IsAttribute(ATTRIBUTE_EARTH)
end
function c51912531.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,51912531)<2 end
Duel.RegisterFlagEffect(tp,51912531,RESET_PHASE+PHASE_END,0,1)
end
function c51912531.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_EARTH) and c:GetLevel()>1
end
function c51912531.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c51912531.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c51912531.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c51912531.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c51912531.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(-1)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
......@@ -6,7 +6,7 @@ function c58139128.initial_effect(c)
e1:SetCode(EFFECT_UPDATE_DEFENCE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c58139128.atkval)
e1:SetValue(c58139128.defval)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
......@@ -39,7 +39,7 @@ end
function c58139128.filter(c)
return c:IsSetCard(0x2e) and c:IsType(TYPE_MONSTER)
end
function c58139128.atkval(e,c)
function c58139128.defval(e,c)
return Duel.GetMatchingGroupCount(c58139128.filter,c:GetControler(),LOCATION_GRAVE,0,nil)*200
end
function c58139128.disop(e,tp,eg,ep,ev,re,r,rp)
......
--昇華する紋章
function c59048135.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(59048135,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(c59048135.thcost)
e2:SetTarget(c59048135.thtg)
e2:SetOperation(c59048135.thop)
c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c59048135.etarget)
e3:SetValue(c59048135.evalue)
c:RegisterEffect(e3)
if not c59048135.global_check then
c59048135.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c59048135.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c59048135.checkop(e,tp,eg,ep,ev,re,r,rp)
local p1=nil
local p2=nil
local tc=eg:GetFirst()
while tc do
if not (tc:IsRace(RACE_PSYCHO) and tc:IsType(TYPE_XYZ)) and not tc:IsSetCard(0x76) then
if tc:GetSummonPlayer()==0 then p1=true else p2=true end
end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,64319467,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,64319467,RESET_PHASE+PHASE_END,0,1) end
end
function c59048135.etarget(e,c)
return c:IsRace(RACE_PSYCHO) and c:IsType(TYPE_XYZ)
end
function c59048135.evalue(e,re,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c59048135.cfilter(c)
return c:IsSetCard(0x76) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function c59048135.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,59048135)==0
and Duel.IsExistingMatchingCard(c59048135.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c59048135.cfilter,1,1,REASON_COST+REASON_DISCARD,nil)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c59048135.splimit)
Duel.RegisterEffect(e1,tp)
end
function c59048135.splimit(e,c)
return not (c:IsRace(RACE_PSYCHO) and c:IsType(TYPE_XYZ)) and not c:IsSetCard(0x76)
end
function c59048135.filter(c)
return c:IsSetCard(0x92) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsCode(59048135) and c:IsAbleToHand()
end
function c59048135.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c59048135.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c59048135.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c59048135.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--森羅の花卉士 ナルサス
function c62434031.initial_effect(c)
--deck check
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(62434031,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c62434031.target)
e1:SetOperation(c62434031.operation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(62434031,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCondition(c62434031.tdcon)
e2:SetTarget(c62434031.tdtg)
e2:SetOperation(c62434031.tdop)
c:RegisterEffect(e2)
if not c62434031.global_check then
c62434031.global_check=true
c62434031[0]=Group.CreateGroup()
c62434031[0]:KeepAlive()
c62434031[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c62434031.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c62434031.checkop(e,tp,eg,ep,ev,re,r,rp)
c62434031[0]:Clear()
c62434031[0]:Merge(eg)
c62434031[1]=re
end
function c62434031.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c62434031.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if tc:IsRace(RACE_PLANT) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT)
else
Duel.MoveSequence(tc,1)
end
end
function c62434031.tdcon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c62434031[0]:IsContains(e:GetHandler()) and c62434031[1]==re
end
function c62434031.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x90) end
end
function c62434031.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(62434031,2))
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,0x90)
local tc=g:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
end
end
--スキル・プリズナー
function c63227401.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetTarget(c63227401.target)
e1:SetOperation(c63227401.activate)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(63227401,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c63227401.condition)
e2:SetCost(c63227401.cost)
e2:SetTarget(c63227401.target)
e2:SetOperation(c63227401.activate)
c:RegisterEffect(e2)
end
function c63227401.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil)
end
function c63227401.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
tc:RegisterFlagEffect(63227401,RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c63227401.discon)
e1:SetOperation(c63227401.disop)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(tc)
Duel.RegisterEffect(e1,tp)
end
end
function c63227401.discon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(63227401)==0 or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g:IsContains(tc) and re:IsActiveType(TYPE_MONSTER)
end
function c63227401.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c63227401.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetTurnID()~=Duel.GetTurnCount()
end
function c63227401.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
--森羅の実張り ピース
function c63257623.initial_effect(c)
--deck check
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(63257623,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c63257623.target)
e1:SetOperation(c63257623.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(63257623,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_CHAIN_UNIQUE)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c63257623.spcon)
e3:SetCost(c63257623.spcost)
e3:SetTarget(c63257623.sptg)
e3:SetOperation(c63257623.spop)
c:RegisterEffect(e3)
if not c63257623.global_check then
c63257623.global_check=true
c63257623[0]=Group.CreateGroup()
c63257623[0]:KeepAlive()
c63257623[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c63257623.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c63257623.checkop(e,tp,eg,ep,ev,re,r,rp)
c63257623[0]:Clear()
c63257623[0]:Merge(eg)
c63257623[1]=re
end
function c63257623.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c63257623.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if tc:IsRace(RACE_PLANT) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT)
else
Duel.MoveSequence(tc,1)
end
end
function c63257623.spcon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c63257623[0]:IsContains(e:GetHandler()) and c63257623[1]==re
end
function c63257623.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,63257623)==0 end
Duel.RegisterFlagEffect(tp,63257623,RESET_PHASE+PHASE_END,0,1)
end
function c63257623.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_PLANT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c63257623.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c63257623.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c63257623.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c63257623.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c63257623.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--実力伯仲
function c65384188.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c65384188.target)
e1:SetOperation(c65384188.activate)
c:RegisterEffect(e1)
end
function c65384188.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_EFFECT)
end
function c65384188.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c65384188.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(c65384188.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUPATTACK)
Duel.SelectTarget(tp,c65384188.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUPATTACK)
Duel.SelectTarget(tp,c65384188.filter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c65384188.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc1,tc2=Duel.GetFirstTarget()
if tc1:IsRelateToEffect(e) and tc2:IsRelateToEffect(e) then
c65384188.reg(c,tc1,tc2)
c65384188.reg(c,tc2,tc1)
end
end
function c65384188.reg(c,tc1,tc2)
tc1:RegisterFlagEffect(65384188,RESET_EVENT+0x1fe0000,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHANGE_POS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(c65384188.posop)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc1:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetCondition(c65384188.effcon)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetLabelObject(tc2)
tc1:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
tc1:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_ATTACK)
tc1:RegisterEffect(e4)
local e5=e2:Clone()
e5:SetCode(EFFECT_IMMUNE_EFFECT)
tc1:RegisterEffect(e5)
end
function c65384188.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(65384188)~=0 and not c:IsPosition(POS_FACEUP_ATTACK) then
c:ResetFlagEffect(65384188)
end
end
function c65384188.effcon(e)
return e:GetHandler():GetFlagEffect(65384188)~=0 and e:GetLabelObject():ResetFlagEffect(65384188)~=0
end
--オノマト連携
function c6595475.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c6595475.cost)
e1:SetTarget(c6595475.target)
e1:SetOperation(c6595475.activate)
c:RegisterEffect(e1)
end
function c6595475.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,6595475)==0
and Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
Duel.RegisterFlagEffect(tp,6595475,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c6595475.filter(c)
return c:IsType(TYPE_MONSTER) and (c:IsSetCard(0x54) or c:IsSetCard(0x59) or c:IsSetCard(0x82) or c:IsSetCard(0x8f)) and c:IsAbleToHand()
end
function c6595475.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c6595475.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c6595475.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c6595475.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=g:Select(tp,1,1,nil)
local t={0x54,0x59,0x82,0x8f}
for i=1,4 do
if g1:GetFirst():IsSetCard(t[i]) then g:Remove(Card.IsSetCard,nil,t[i]) end
end
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(6595475,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=g:Select(tp,1,1,nil)
g1:Merge(g2)
end
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
--森羅の霊峰
function c70222318.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCost(c70222318.cost)
e2:SetTarget(c70222318.target)
e2:SetOperation(c70222318.operation)
c:RegisterEffect(e2)
--deck check
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(70222318,3))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetCondition(c70222318.tgcon)
e3:SetTarget(c70222318.tgtg)
e3:SetOperation(c70222318.tgop)
c:RegisterEffect(e3)
end
function c70222318.cfilter(c)
return c:IsRace(RACE_PLANT) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost()
end
function c70222318.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,70222318)==0
and Duel.IsExistingMatchingCard(c70222318.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c70222318.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
Duel.RegisterFlagEffect(tp,70222318,RESET_PHASE+PHASE_END,0,1)
end
function c70222318.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x90) end
end
function c70222318.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(70222318,0))
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,0x90)
local tc=g:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
end
end
function c70222318.tgcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c70222318.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c70222318.tgop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
if tc:IsRace(RACE_PLANT) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT)
else
local opt=Duel.SelectOption(tp,aux.Stringid(70222318,1),aux.Stringid(70222318,2))
if opt==1 then
Duel.MoveSequence(tc,opt)
end
end
end
--RDM-ヌメロン・フォール
function c71345905.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c71345905.target)
e1:SetOperation(c71345905.activate)
c:RegisterEffect(e1)
end
function c71345905.filter1(c,e,tp)
local rk=c:GetRank()
return rk>1 and c:IsFaceup() and c:IsSetCard(0x7f)
and Duel.IsExistingMatchingCard(c71345905.filter2,tp,LOCATION_EXTRA,0,1,nil,rk,e,tp)
end
function c71345905.filter2(c,rk,e,tp)
return c:IsRankBelow(rk-1) and c:IsSetCard(0x7f)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c71345905.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c71345905.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c71345905.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c71345905.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c71345905.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71345905.filter2,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetRank(),e,tp)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
--disable
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetOperation(c71345905.disop)
e1:SetReset(RESET_EVENT+0x1fe0000)
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_BE_BATTLE_TARGET)
sc:RegisterEffect(e2)
end
end
function c71345905.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
bc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
bc:RegisterEffect(e2)
end
end
--武神帝-ツクヨミ
function c73289035.initial_effect(c)
c:SetUniqueOnField(1,0,73289035)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT),4),2)
c:EnableReviveLimit()
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(73289035,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c73289035.cost)
e1:SetTarget(c73289035.target)
e1:SetOperation(c73289035.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetOperation(c73289035.checkop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCondition(c73289035.spcon)
e3:SetTarget(c73289035.sptg)
e3:SetOperation(c73289035.spop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c73289035.cost(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 c73289035.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,LOCATION_HAND)
end
function c73289035.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.Draw(tp,2,REASON_EFFECT)
end
function c73289035.checkop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetOverlayCount()
e:SetLabel(ct)
end
function c73289035.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and bit.band(r,REASON_EFFECT)~=0
and e:GetHandler():IsPreviousPosition(POS_FACEUP) and not e:GetHandler():IsLocation(LOCATION_DECK)
end
function c73289035.spfilter(c,e,tp)
return c:GetLevel()==4 and c:IsSetCard(0x88) and c:IsRace(RACE_BEASTWARRIOR) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c73289035.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c73289035.spfilter(chkc,e,tp) end
local ct=e:GetLabelObject():GetLabel()
if chk==0 then return ct>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c73289035.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ct>ft then ct=ft end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c73289035.spfilter,tp,LOCATION_GRAVE,0,1,ct,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c73289035.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<g:GetCount() then return end
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--ゴーストリック・ミュージアム
function c7617062.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c7617062.ftarget)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c7617062.cfilter)
c:RegisterEffect(e3)
--pos
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetOperation(c7617062.operation)
c:RegisterEffect(e4)
end
function c7617062.ftarget(e,c)
return not c:IsSetCard(0x8d)
end
function c7617062.cfilter(e,c)
return c:IsFacedown()
end
function c7617062.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
if tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsCanTurnSet() then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(7617062,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetRange(LOCATION_SZONE)
e1:SetTarget(c7617062.postg)
e1:SetOperation(c7617062.posop)
e1:SetLabelObject(tc)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e1)
end
end
function c7617062.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():IsRelateToBattle() end
end
function c7617062.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsRelateToBattle() and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENCE)
end
end
--エクシーズ・シフト
function c8339504.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetLabel(0)
e1:SetCost(c8339504.cost)
e1:SetTarget(c8339504.target)
e1:SetOperation(c8339504.activate)
c:RegisterEffect(e1)
end
function c8339504.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return Duel.GetFlagEffect(tp,8339504)==0 end
Duel.RegisterFlagEffect(tp,8339504,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c8339504.cfilter(c,e,tp)
local rk=c:GetRank()
return rk>0 and c:IsFaceup()
and Duel.IsExistingMatchingCard(c8339504.spfilter,tp,LOCATION_EXTRA,0,1,nil,rk,c:GetRace(),c:GetAttribute(),c:GetCode(),e,tp)
end
function c8339504.spfilter(c,rk,rc,att,code,e,tp)
return c:GetRank()==rk and c:IsRace(rc) and c:IsAttribute(att) and not c:IsCode(code)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c8339504.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.CheckReleaseGroup(tp,c8339504.cfilter,1,nil,e,tp)
end
e:SetLabel(0)
local g=Duel.SelectReleaseGroup(tp,c8339504.cfilter,1,1,nil,e,tp)
Duel.Release(g,REASON_COST)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c8339504.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c8339504.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetRank(),tc:GetRace(),tc:GetAttribute(),tc:GetCode(),e,tp)
local sc=g:GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
if c:IsRelateToEffect(e) then
c:CancelToGrave()
Duel.Overlay(sc,Group.FromCards(c))
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(c8339504.tgop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
end
end
function c8339504.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
--No.39 希望皇ホープ・ルーツ
function c84124261.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,1),2)
c:EnableReviveLimit()
--disable attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84124261,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCost(c84124261.atkcost)
e1:SetTarget(c84124261.atktg)
e1:SetOperation(c84124261.atkop)
c:RegisterEffect(e1)
end
function c84124261.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 c84124261.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetCard(Duel.GetAttacker())
end
function c84124261.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if Duel.NegateAttack() and tc:IsType(TYPE_XYZ) and tc:IsFaceup()
and c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc:GetRank()*500)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
--光子竜の聖騎士
function c85346853.initial_effect(c)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(85346853,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c85346853.spcost)
e1:SetTarget(c85346853.sptg)
e1:SetOperation(c85346853.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(85346853,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c85346853.drcon)
e2:SetTarget(c85346853.drtg)
e2:SetOperation(c85346853.drop)
c:RegisterEffect(e2)
end
function c85346853.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c85346853.spfilter(c,e,tp)
return c:IsCode(93717133) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c85346853.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c85346853.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c85346853.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c85346853.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c85346853.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and c:IsFaceup()
and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER) and bc:IsReason(REASON_BATTLE)
end
function c85346853.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c85346853.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--エクシーズ・アヴェンジャー
function c86062400.initial_effect(c)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c86062400.efilter)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86062400,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetCondition(c86062400.tgcon)
e2:SetTarget(c86062400.tgtg)
e2:SetOperation(c86062400.tgop)
c:RegisterEffect(e2)
end
function c86062400.efilter(e,te)
return te:IsActiveType(TYPE_XYZ)
end
function c86062400.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and rp~=tp
and bc:IsFaceup() and bc:IsRelateToBattle() and bc:IsType(TYPE_XYZ)
end
function c86062400.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local rk=e:GetHandler():GetBattleTarget():GetRank()
if rk<5 then
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_EXTRA)
else
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,rk,1-tp,LOCATION_EXTRA)
end
end
function c86062400.tgop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
if bc:IsFaceup() and bc:IsRelateToBattle() then
local rk=bc:GetRank()
local g=nil
if rk<4 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
g=Duel.SelectMatchingCard(1-tp,nil,tp,0,LOCATION_EXTRA,1,1,nil)
elseif rk==4 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_EXTRA,1,1,nil)
else
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
g=Duel.SelectMatchingCard(1-tp,nil,tp,0,LOCATION_EXTRA,rk,rk,nil)
end
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
--紅姫チルビメ
function c87294988.initial_effect(c)
--cannot be battle target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetTarget(c87294988.bttg)
e1:SetValue(1)
c:RegisterEffect(e1)
--summon success
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(87294988,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c87294988.spcon)
e2:SetTarget(c87294988.sptg)
e2:SetOperation(c87294988.spop)
c:RegisterEffect(e2)
end
function c87294988.bttg(e,c)
return c~=e:GetHandler() and c:IsRace(RACE_PLANT)
end
function c87294988.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and e:GetHandler():GetPreviousControler()==tp
end
function c87294988.filter(c,e,tp)
return c:IsRace(RACE_PLANT) and not c:IsCode(87294988) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c87294988.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c87294988.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c87294988.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c87294988.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--森羅の恵み
function c91650245.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c91650245.target)
e1:SetOperation(c91650245.activate)
c:RegisterEffect(e1)
end
function c91650245.filter(c,e,tp)
return c:IsAbleToDeck() and Duel.IsExistingMatchingCard(c91650245.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,c,e,tp)
end
function c91650245.spfilter(c,e,tp)
return c:IsSetCard(0x90) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c91650245.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c91650245.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c91650245.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c91650245.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
local opt=Duel.SelectOption(tp,aux.Stringid(91650245,0),aux.Stringid(91650245,1))
Duel.SendtoDeck(g,nil,opt,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c91650245.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,tc,e,tp)
local sc=sg:GetFirst()
if sc then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(91650245,2))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_REPEAT)
e1:SetCountLimit(1)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetTarget(c91650245.tdtg)
e1:SetOperation(c91650245.tdop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e2:SetValue(1)
sc:RegisterEffect(e2)
end
end
end
function c91650245.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function c91650245.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
or Duel.SelectOption(tp,aux.Stringid(91650245,0),aux.Stringid(91650245,1))==0 then
Duel.SendtoDeck(c,nil,0,REASON_EFFECT)
else
Duel.SendtoDeck(c,nil,1,REASON_EFFECT)
end
end
end
--森羅の影胞子 ストール
function c99641125.initial_effect(c)
function c99641328.initial_effect(c)
--deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(99641125,0))
e1:SetDescription(aux.Stringid(99641328,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FLIP)
e1:SetTarget(c99641125.target)
e1:SetOperation(c99641125.operation)
e1:SetTarget(c99641328.target)
e1:SetOperation(c99641328.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(99641125,2))
e2:SetDescription(aux.Stringid(99641328,2))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c99641125.descon)
e2:SetTarget(c99641125.destg)
e2:SetOperation(c99641125.desop)
e2:SetCondition(c99641328.descon)
e2:SetTarget(c99641328.destg)
e2:SetOperation(c99641328.desop)
c:RegisterEffect(e2)
if not c99641125.global_check then
c99641125.global_check=true
c99641125[0]=Group.CreateGroup()
c99641125[0]:KeepAlive()
c99641125[1]=0
if not c99641328.global_check then
c99641328.global_check=true
c99641328[0]=Group.CreateGroup()
c99641328[0]:KeepAlive()
c99641328[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c99641125.checkop)
ge1:SetOperation(c99641328.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c99641125.checkop(e,tp,eg,ep,ev,re,r,rp)
c99641125[0]:Clear()
c99641125[0]:Merge(eg)
c99641125[1]=re
function c99641328.checkop(e,tp,eg,ep,ev,re,r,rp)
c99641328[0]:Clear()
c99641328[0]:Merge(eg)
c99641328[1]=re
end
function c99641125.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c99641328.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c99641125.operation(e,tp,eg,ep,ev,re,r,rp)
function c99641328.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end
if ct>5 then ct=5 end
local t={}
for i=1,ct do t[i]=i end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(99641125,1))
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(99641328,1))
local ac=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.ConfirmDecktop(tp,ac)
local g=Duel.GetDecktopGroup(tp,ac)
......@@ -65,21 +65,21 @@ function c99641125.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c99641125.descon(e,tp,eg,ep,ev,re,r,rp)
function c99641328.descon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c99641125[0]:IsContains(e:GetHandler()) and c99641125[1]==re
and c99641328[0]:IsContains(e:GetHandler()) and c99641328[1]==re
end
function c99641125.desfilter(c)
function c99641328.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c99641125.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c99641125.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c99641125.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
function c99641328.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c99641328.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c99641328.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c99641125.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,c99641328.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c99641125.desop(e,tp,eg,ep,ev,re,r,rp)
function c99641328.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
......
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