Commit 1ea47a83 authored by mercury233's avatar mercury233

add cards SD38

parent bff68eb5
--ハイパーブレイズ
function c16317140.initial_effect(c)
aux.AddCodeList(c,6007213,32491822,69890967)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--alternate summon proc
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(16317140)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--change atk
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16317140,0))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c16317140.atkcon)
e3:SetCost(c16317140.atkcost)
e3:SetOperation(c16317140.atkop)
c:RegisterEffect(e3)
--tohand/spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(16317140,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCost(c16317140.spcost)
e4:SetTarget(c16317140.sptg)
e4:SetOperation(c16317140.spop)
c:RegisterEffect(e4)
end
function c16317140.cfilter(c)
return c:IsType(TYPE_TRAP) and c:IsAbleToGraveAsCost()
end
function c16317140.tpfilter(c)
return c:IsType(TYPE_TRAP) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function c16317140.atkcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not a:IsControler(tp) then a,d=d,a end
e:SetLabelObject(a)
return a and a:IsCode(6007213) and a:IsFaceup() and a:IsControler(tp)
end
function c16317140.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16317140.cfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c16317140.cfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g:GetFirst(),nil,REASON_COST)
end
function c16317140.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsFaceup() and tc:IsRelateToBattle() then
local val=Duel.GetMatchingGroupCount(c16317140.tpfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,nil)*1000
if val==0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(val)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(val)
tc:RegisterEffect(e2)
end
end
function c16317140.spfilter(c,e,tp)
return c:IsCode(32491822,6007213,69890967)
and (c:IsAbleToHand() or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false)))
end
function c16317140.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c16317140.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16317140.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_GRAVE)
end
function c16317140.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16317140.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local sc=sg:GetFirst()
if sc then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sc:IsCanBeSpecialSummoned(e,0,tp,true,false)
and (not sc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
Duel.SpecialSummon(sc,0,tp,tp,true,false,POS_FACEUP)
else
Duel.SendtoHand(sc,nil,REASON_EFFECT)
end
end
end
--混沌の召唤神
function c27439792.initial_effect(c)
aux.AddCodeList(c,6007213,32491822,69890967)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(27439792,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,27439792)
e1:SetCost(c27439792.spcost)
e1:SetTarget(c27439792.sptg)
e1:SetOperation(c27439792.spop)
c:RegisterEffect(e1)
--Search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(27439792,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,27439793)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c27439792.thtg)
e2:SetOperation(c27439792.thop)
c:RegisterEffect(e2)
end
function c27439792.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0 end
Duel.Release(c,REASON_COST)
end
function c27439792.spfilter(c,e,tp)
return c:IsCode(6007213,32491822,69890967) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c27439792.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local res=e:GetLabel()==100 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then
e:SetLabel(0)
return res and Duel.IsExistingMatchingCard(c27439792.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c27439792.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,c27439792.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
function c27439792.thfilter(c)
return c:IsCode(13301895) and c:IsAbleToHand()
end
function c27439792.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c27439792.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c27439792.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c27439792.thfilter,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 c28651380.initial_effect(c)
aux.AddCodeList(c,69890967)
c:EnableReviveLimit()
--special summon 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:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c28651380.sprcon)
e2:SetTarget(c28651380.sprtg)
e2:SetOperation(c28651380.sprop)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(28651380,0))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_HAND)
e3:SetHintTiming(TIMING_DAMAGE_STEP)
e3:SetCountLimit(1,28651380)
e3:SetCondition(aux.dscon)
e3:SetCost(c28651380.atkcost)
e3:SetTarget(c28651380.atktg)
e3:SetOperation(c28651380.atkop)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(28651380,1))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,28651381)
e4:SetCost(c28651380.thcost)
e4:SetTarget(c28651380.thtg)
e4:SetOperation(c28651380.thop)
c:RegisterEffect(e4)
end
function c28651380.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp)
return rg:CheckSubGroup(aux.mzctcheckrel,3,3,tp)
end
function c28651380.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetReleaseGroup(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,true,3,3,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c28651380.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_COST)
g:DeleteGroup()
end
function c28651380.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c28651380.atkfilter(c)
return c:IsFaceup() and c:IsCode(69890967)
end
function c28651380.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c28651380.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c28651380.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c28651380.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c28651380.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ATTACK_ALL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(1)
e2:SetCondition(c28651380.acon)
e2:SetOwnerPlayer(tp)
tc:RegisterEffect(e2)
end
end
function c28651380.acon(e)
return e:GetHandlerPlayer()==e:GetOwnerPlayer()
end
function c28651380.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,aux.TRUE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,aux.TRUE,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c28651380.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function c28651380.thop(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
......@@ -14,6 +14,7 @@ function c32491822.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c32491822.spcon)
e2:SetTarget(c32491822.sptg)
e2:SetOperation(c32491822.spop)
c:RegisterEffect(e2)
--damage
......@@ -36,41 +37,32 @@ function c32491822.initial_effect(c)
e4:SetValue(c32491822.atlimit)
c:RegisterEffect(e4)
end
function c32491822.spfilter(c)
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsAbleToGraveAsCost()
function c32491822.spfilter(c,check)
return c:IsAbleToGraveAsCost()
and (c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS or check and c:IsFacedown() and c:IsType(TYPE_SPELL))
end
function c32491822.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-2 then return false end
if ft<=0 then
local ct=-ft+1
return Duel.IsExistingMatchingCard(c32491822.spfilter,tp,LOCATION_MZONE,0,ct,nil)
and Duel.IsExistingMatchingCard(c32491822.spfilter,tp,LOCATION_ONFIELD,0,3,nil)
else
return Duel.IsExistingMatchingCard(c32491822.spfilter,tp,LOCATION_ONFIELD,0,3,nil)
end
local check=Duel.IsPlayerAffectedByEffect(tp,54828837)
local g=Duel.GetMatchingGroup(c32491822.spfilter,tp,LOCATION_ONFIELD,0,nil,check)
return g:CheckSubGroup(aux.mzctcheck,3,3,tp)
end
function c32491822.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local check=Duel.IsPlayerAffectedByEffect(tp,54828837)
local g=Duel.GetMatchingGroup(c32491822.spfilter,tp,LOCATION_ONFIELD,0,nil,check)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,true,3,3,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c32491822.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.GetMatchingGroup(c32491822.spfilter,tp,LOCATION_ONFIELD,0,nil)
local ct=-ft+1
local g1=sg:FilterSelect(tp,Card.IsLocation,ct,ct,nil,LOCATION_MZONE)
if ct<3 then
sg:Sub(g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=sg:Select(tp,3-ct,3-ct,nil)
g1:Merge(g2)
end
Duel.SendtoGrave(g1,REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c32491822.spfilter,tp,LOCATION_ONFIELD,0,3,3,nil)
Duel.SendtoGrave(g,REASON_COST)
end
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_COST)
g:DeleteGroup()
end
function c32491822.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
--覚醒の三幻魔
function c53701259.initial_effect(c)
aux.AddCodeList(c,6007213,32491822,69890967)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--recover
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetLabel(1)
e2:SetCondition(c53701259.lpcon)
e2:SetOperation(c53701259.lpop1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE)
e3:SetLabel(1)
e3:SetCondition(c53701259.lpcon1)
e3:SetOperation(c53701259.lpop1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetRange(LOCATION_SZONE)
e4:SetLabel(1)
e4:SetCondition(c53701259.regcon)
e4:SetOperation(c53701259.regop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetRange(LOCATION_SZONE)
e5:SetCondition(c53701259.lpcon2)
e5:SetOperation(c53701259.lpop2)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
--disable
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_CHAIN_SOLVING)
e6:SetRange(LOCATION_SZONE)
e6:SetLabel(2)
e6:SetCondition(c53701259.discon)
e6:SetOperation(c53701259.disop)
c:RegisterEffect(e6)
--remove
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e7:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e7:SetRange(LOCATION_SZONE)
e7:SetValue(LOCATION_REMOVED)
e7:SetTargetRange(0xfe,0xff)
e7:SetTarget(c53701259.rmtg)
e7:SetCondition(c53701259.rmcon)
c:RegisterEffect(e7)
--to hand
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(53701259,0))
e8:SetCategory(CATEGORY_TOHAND)
e8:SetType(EFFECT_TYPE_QUICK_O)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetRange(LOCATION_SZONE)
e8:SetCountLimit(1)
e8:SetCost(c53701259.thcon)
e8:SetTarget(c53701259.thtg)
e8:SetOperation(c53701259.thop)
c:RegisterEffect(e8)
end
function c53701259.filter(c)
return c:IsFaceup() and c:IsCode(6007213,32491822,69890967)
end
function c53701259.cfilter(c,sp)
return c:GetSummonPlayer()==sp and c:IsFaceup()
end
function c53701259.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c53701259.filter,tp,LOCATION_ONFIELD,0,nil)
local ct=e:GetLabel()
return ct and g:GetClassCount(Card.GetCode)>=ct
end
function c53701259.lpcon(e,tp,eg,ep,ev,re,r,rp)
return c53701259.condition(e,tp,eg,ep,ev,re,r,rp)
and eg:IsExists(c53701259.cfilter,1,nil,1-tp)
end
function c53701259.lpcon1(e,tp,eg,ep,ev,re,r,rp)
return c53701259.lpcon(e,tp,eg,ep,ev,re,r,rp)
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS))
end
function c53701259.lpop1(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(c53701259.cfilter,nil,1-tp)
local rnum=lg:GetSum(Card.GetAttack)
Duel.Recover(tp,rnum,REASON_EFFECT)
end
function c53701259.regcon(e,tp,eg,ep,ev,re,r,rp)
return c53701259.lpcon(e,tp,eg,ep,ev,re,r,rp)
and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS)
end
function c53701259.regop(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(c53701259.cfilter,nil,1-tp)
local g=e:GetLabelObject()
if g==nil or #g==0 then
lg:KeepAlive()
e:SetLabelObject(lg)
else
g:Merge(lg)
end
e:GetHandler():RegisterFlagEffect(53701259,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
end
function c53701259.lpcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(53701259)>0
end
function c53701259.lpop2(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():ResetFlagEffect(53701259)
local lg=e:GetLabelObject():GetLabelObject()
local rnum=lg:GetSum(Card.GetAttack)
local g=Group.CreateGroup()
g:KeepAlive()
e:GetLabelObject():SetLabelObject(g)
lg:DeleteGroup()
Duel.Recover(tp,rnum,REASON_EFFECT)
end
function c53701259.discon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return c53701259.condition(e,tp,eg,ep,ev,re,r,rp)
and re:IsActiveType(TYPE_MONSTER) and loc==LOCATION_MZONE and rp==1-tp
end
function c53701259.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c53701259.rmtg(e,c)
return c:GetOwner()~=e:GetHandlerPlayer() and not c:IsLocation(LOCATION_OVERLAY)
and not c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c53701259.rmcon(e)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(c53701259.filter,tp,LOCATION_ONFIELD,0,nil)
return g:GetClassCount(Card.GetCode)==3
end
function c53701259.ffilter(c)
return c:IsFaceup() and c:IsLevel(10)
end
function c53701259.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c53701259.ffilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetTurnPlayer()==tp
end
function c53701259.thfilter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end
function c53701259.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c53701259.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c53701259.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c53701259.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--カオス・コア
function c54040484.initial_effect(c)
c:EnableCounterPermit(0x57)
aux.AddCodeList(c,6007213,32491822,69890967)
--counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(54040484,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_BECOME_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,54040484)
e1:SetCondition(c54040484.countcon1)
e1:SetTarget(c54040484.counttg)
e1:SetOperation(c54040484.countop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetCondition(c54040484.countcon2)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c54040484.reptg)
e3:SetOperation(c54040484.repop)
c:RegisterEffect(e3)
end
function c54040484.countcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
end
function c54040484.countcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c54040484.tgfilter(c)
return c:IsCode(6007213,32491822,69890967) and c:IsAbleToGrave()
end
function c54040484.counttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c54040484.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) and c:IsCanAddCounter(0x57,1) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c54040484.fselect(g,c)
return aux.dncheck(g) and c:IsCanAddCounter(0x57,g:GetCount())
end
function c54040484.countop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c54040484.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,c54040484.fselect,false,1,g:GetCount(),c)
if sg and sg:GetCount()>0 and Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
if ct>0 and c:AddCounter(0x57,ct) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c54040484.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
and c:IsCanRemoveCounter(tp,0x57,1,REASON_EFFECT)
end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c54040484.repop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveCounter(tp,0x57,1,REASON_EFFECT)
end
--失楽の霹靂
function c54828837.initial_effect(c)
aux.AddCodeList(c,6007213,32491822,69890967)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--alternate summon proc
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(54828837)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_POSITION)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c54828837.negcon)
e3:SetOperation(c54828837.negop)
c:RegisterEffect(e3)
--damage protection
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(54828837,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c54828837.protcon)
e4:SetOperation(c54828837.protop)
c:RegisterEffect(e4)
end
function c54828837.cfilter(c)
return c:IsFaceup() and c:IsCode(32491822) and c:IsAttackPos()
end
function c54828837.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c54828837.cfilter,tp,LOCATION_MZONE,0,1,nil)
and rp==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainDisablable(ev)
and e:GetHandler():GetFlagEffect(54828837)<=0
end
function c54828837.negop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.SelectYesNo(tp,aux.Stringid(54828837,0)) then
Duel.Hint(HINT_CARD,0,54828837)
if Duel.NegateEffect(ev) and Duel.IsExistingMatchingCard(c54828837.cfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,c54828837.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g)
Duel.ChangePosition(g:GetFirst(),POS_FACEUP_DEFENSE)
end
e:GetHandler():RegisterFlagEffect(54828837,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c54828837.protfilter(c,tp)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
and (c:GetPreviousCodeOnField()==32491822 or c:GetPreviousCodeOnField()==6007213 or c:GetPreviousCodeOnField()==69890967)
end
function c54828837.protcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c54828837.protfilter,1,nil,tp)
end
function c54828837.protop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetTargetRange(1,0)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
......@@ -15,6 +15,7 @@ function c6007213.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c6007213.spcon)
e2:SetTarget(c6007213.sptg)
e2:SetOperation(c6007213.spop)
c:RegisterEffect(e2)
--atkup
......@@ -37,31 +38,32 @@ function c6007213.initial_effect(c)
e4:SetOperation(c6007213.desop)
c:RegisterEffect(e4)
end
function c6007213.spfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TRAP) and c:IsAbleToGraveAsCost()
function c6007213.spfilter(c,check)
return c:IsAbleToGraveAsCost() and c:IsType(TYPE_TRAP)
and (c:IsFaceup() or check and c:IsFacedown())
end
function c6007213.spcon(e,c)
if c==nil then return true end
if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)==0 then
return Duel.IsExistingMatchingCard(c6007213.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c6007213.spfilter,c:GetControler(),LOCATION_ONFIELD,0,3,nil)
else
return Duel.IsExistingMatchingCard(c6007213.spfilter,c:GetControler(),LOCATION_ONFIELD,0,3,nil)
end
local tp=c:GetControler()
local check=Duel.IsPlayerAffectedByEffect(tp,16317140)
local g=Duel.GetMatchingGroup(c6007213.spfilter,tp,LOCATION_ONFIELD,0,nil,check)
return g:CheckSubGroup(aux.mzctcheck,3,3,tp)
end
function c6007213.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local check=Duel.IsPlayerAffectedByEffect(tp,16317140)
local g=Duel.GetMatchingGroup(c6007213.spfilter,tp,LOCATION_ONFIELD,0,nil,check)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,true,3,3,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c6007213.spop(e,tp,eg,ep,ev,re,r,rp,c)
if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c6007213.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c6007213.spfilter,tp,LOCATION_ONFIELD,0,2,2,g1:GetFirst())
g2:AddCard(g1:GetFirst())
Duel.SendtoGrave(g2,REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c6007213.spfilter,tp,LOCATION_ONFIELD,0,3,3,nil)
Duel.SendtoGrave(g,REASON_COST)
end
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_COST)
g:DeleteGroup()
end
function c6007213.atkfilter(c)
return c:GetType()==TYPE_TRAP+TYPE_CONTINUOUS
......
--七精の解門
function c80312545.initial_effect(c)
aux.AddCodeList(c,6007213,32491822,69890967)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,80312545+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c80312545.target)
e1:SetOperation(c80312545.activate)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(80312545,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(c80312545.spcost)
e2:SetTarget(c80312545.sptg)
e2:SetOperation(c80312545.spop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(80312545,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCost(c80312545.thcon)
e3:SetTarget(c80312545.thtg)
e3:SetOperation(c80312545.thop)
c:RegisterEffect(e3)
end
function c80312545.filter(c)
return (c:IsCode(6007213,32491822,69890967)
or ((aux.IsCodeListed(c,6007213) or aux.IsCodeListed(c,32491822) or aux.IsCodeListed(c,69890967)) and c:IsType(TYPE_MONSTER))) and c:IsAbleToHand()
end
function c80312545.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c80312545.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c80312545.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c80312545.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 c80312545.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c80312545.spfilter(c,e,tp)
return c:IsAttack(0) and c:IsDefense(0) and c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c80312545.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c80312545.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c80312545.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,aux.NecroValleyFilter(c80312545.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c80312545.ffilter(c)
return c:IsFaceup() and c:IsLevel(10)
end
function c80312545.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c80312545.ffilter,tp,LOCATION_MZONE,0,1,nil)
end
function c80312545.thfilter(c)
return c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c80312545.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c80312545.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c80312545.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c80312545.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--暗黒の招来神
function c81034083.initial_effect(c)
aux.AddCodeList(c,6007213,32491822,69890967)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(81034083,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,81034083)
e1:SetTarget(c81034083.thtg)
e1:SetOperation(c81034083.thop)
c:RegisterEffect(e1)
--extra summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(81034083,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e2:SetTarget(c81034083.exstg)
c:RegisterEffect(e2)
end
function c81034083.thfilter(c)
return (c:IsCode(6007213,32491822,69890967)
or ((aux.IsCodeListed(c,6007213) or aux.IsCodeListed(c,32491822) or aux.IsCodeListed(c,69890967))
and not c:IsCode(81034083))) and c:IsAbleToHand()
end
function c81034083.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c81034083.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c81034083.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c81034083.thfilter,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 c81034083.exstg(e,c)
return c:IsRace(RACE_FIEND) and c:IsAttack(0) and c:IsDefense(0)
end
--次元融合殺
function c89190953.initial_effect(c)
aux.AddCodeList(c,6007213,32491822,69890967)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c89190953.target)
e1:SetOperation(c89190953.activate)
c:RegisterEffect(e1)
end
function c89190953.filter1(c,e)
return c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c89190953.filter2(c,e,tp,m,chkf)
return c:IsSetCard(0x144) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:CheckFusionMaterial(m,nil,chkf,true)
end
function c89190953.chfilter(c)
return c:IsFaceup() and c:IsCode(6007213,32491822,69890967)
end
function c89190953.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp|0x200
local mg=Duel.GetMatchingGroup(c89190953.filter1,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
return Duel.IsExistingMatchingCard(c89190953.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,chkf)
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsExistingMatchingCard(c89190953.chfilter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.SetChainLimit(c89190953.chainlm)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c89190953.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp|0x200
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c89190953.filter1),tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local sg=Duel.GetMatchingGroup(c89190953.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,chkf)
if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf,true)
Duel.Remove(mat,POS_FACEUP,REASON_EFFECT)
Duel.BreakEffect()
if Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetCondition(c89190953.damcon)
e1:SetValue(1)
e1:SetOwnerPlayer(tp)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e2:SetCondition(c89190953.damcon2)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
end
function c89190953.damcon(e)
return e:GetHandlerPlayer()==e:GetOwnerPlayer()
end
function c89190953.damcon2(e)
return 1-e:GetHandlerPlayer()==e:GetOwnerPlayer()
end
function c89190953.chainlm(e,ep,tp)
return tp==ep
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