Commit 3337bebd authored by mercury233's avatar mercury233

update new cards

parent 051176c4
#created by ...
#main
100200002
101202001
100200236
100207008
100207009
......
......@@ -68,7 +68,7 @@ function s.sdcon(e)
return e:GetHandler():GetCounter(0x28)==3
end
function s.ddfilter(c)
return c:IsAttack(0)
return c:IsAttack(0) and c:IsRace(RACE_ROCK)
end
function s.ddcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.ddfilter,tp,LOCATION_GRAVE,0,nil)
......@@ -76,13 +76,11 @@ function s.ddcon(e,tp,eg,ep,ev,re,r,rp)
end
function s.ddop(e,tp,eg,ep,ev,re,r,rp)
--becomes doubled
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetLabel(cid)
e1:SetValue(s.damval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
......
......@@ -15,8 +15,9 @@ function s.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id)
e2:SetLabelObject(e1)
e2:SetCondition(s.regcon)
......@@ -75,7 +76,8 @@ function s.sfilter(c,e,tp)
end
function s.dlvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.sfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.sfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.sfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.sfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
......@@ -13,7 +13,7 @@ function c100428020.initial_effect(c)
c:RegisterEffect(e1)
end
function c100428020.tgfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x32) and c:IsAbleToGrave()
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x32) and not c:IsCode(100428020) and c:IsAbleToGrave()
end
function c100428020.rmfilter(c,tp)
return c:IsSetCard(0xb9) and c:IsFaceupEx() and c:IsAbleToRemove()
......
......@@ -16,7 +16,9 @@ function s.initial_effect(c)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return aux.bpcon() and eg:IsExists(Card.IsReason,1,nil,REASON_BATTLE+REASON_EFFECT)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
and eg:IsExists(Card.IsReason,1,nil,REASON_BATTLE+REASON_EFFECT)
end
function s.tfilter(c)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0x48) and c:IsCanOverlay()
......
......@@ -46,8 +46,10 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=tg:SelectSubGroup(tp,s.check,false,1,2)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if g then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
......
......@@ -20,6 +20,7 @@ function s.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,id)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
......@@ -45,15 +46,14 @@ function s.indtg(e,c)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() end
if chk==0 then return c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0 end
Duel.Release(c,REASON_COST)
end
function s.filter(c,e,tp)
return aux.IsCodeListed(c,101201052) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
......@@ -67,8 +67,9 @@ function s.cfilter(c)
return c:IsFaceup() and c:IsCode(4796100)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsOnField() and re:GetHandler():IsControler(1-tp)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsChainDisablable(ev)
local tgp,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CONTROLER,CHAININFO_TRIGGERING_LOCATION)
return tgp==1-tp and loc==LOCATION_MZONE and Duel.IsChainDisablable(ev)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -31,7 +31,8 @@ function Auxiliary.SelectFromOptions(tp,...)
return opvals[select+1]
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and 1-tp==rp and r&(REASON_EFFECT+REASON_BATTLE)>0
if ep~=tp then return false end
return r&REASON_BATTLE>0 and Duel.GetAttacker():IsControler(1-tp) or r&REASON_EFFECT>0 and rp==1-tp
end
function s.filter(c,v,e,tp)
return c:IsAttackBelow(v) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
--クロノグラフ・マジシャン
function c12289247.initial_effect(c)
aux.AddCodeList(c,13331639)
aux.EnablePendulumAttribute(c)
--pendulum set/spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12289247,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,12289247)
e1:SetTarget(c12289247.rptg)
e1:SetOperation(c12289247.rpop)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12289247,3))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+12289247)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c12289247.spcon)
e2:SetTarget(c12289247.sptg)
e2:SetOperation(c12289247.spop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12289247,5))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c12289247.hncost)
e3:SetTarget(c12289247.hntg)
e3:SetOperation(c12289247.hnop)
c:RegisterEffect(e3)
if not c12289247.global_check then
c12289247.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetCondition(c12289247.regcon)
ge1:SetOperation(c12289247.regop)
Duel.RegisterEffect(ge1,0)
end
end
c12289247.hnchecks=aux.CreateChecks(Card.IsSetCard,{0x10f2,0x2073,0x2017,0x1046})
function c12289247.spcfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c12289247.regcon(e,tp,eg,ep,ev,re,r,rp)
local v=0
if eg:IsExists(c12289247.spcfilter,1,nil,0) then v=v+1 end
if eg:IsExists(c12289247.spcfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function c12289247.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+12289247,re,r,rp,ep,e:GetLabel())
end
function c12289247.rpfilter(c,e,tp)
return c:IsCode(20409757) and (not c:IsForbidden()
or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c12289247.rptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12289247.rpfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c12289247.rpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(12289247,6))
local g=Duel.SelectMatchingCard(tp,c12289247.rpfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
local op=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
op=Duel.SelectOption(tp,aux.Stringid(12289247,1),aux.Stringid(12289247,2))
else
op=Duel.SelectOption(tp,aux.Stringid(12289247,1))
end
if op==0 then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c12289247.spcon(e,tp,eg,ep,ev,re,r,rp)
return ev==tp or ev==PLAYER_ALL
end
function c12289247.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c12289247.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then
return
end
local g=Duel.GetMatchingGroup(Card.IsCanBeSpecialSummoned,tp,LOCATION_HAND,0,nil,e,0,tp,false,false)
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(12289247,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
function c12289247.cfilter(c)
return c:IsSetCard(0x10f2,0x2073,0x2017,0x1046)
and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup())
end
function c12289247.hngoal(g,e,tp,c)
local sg=Group.FromCards(c)
sg:Merge(g)
return Duel.IsExistingMatchingCard(c12289247.hnfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,sg)
end
function c12289247.hnfilter(c,e,tp,sg)
return c:IsCode(13331639) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial()
and (not sg or Duel.GetLocationCountFromEx(tp,tp,sg,c)>0)
end
function c12289247.hncost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(c12289247.cfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil)
if chk==0 then return c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c12289247.hnfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
and mg:CheckSubGroupEach(c12289247.hnchecks,c12289247.hngoal,e,tp,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=mg:SelectSubGroupEach(tp,c12289247.hnchecks,false,c12289247.hngoal,e,tp,c)
sg:AddCard(c)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c12289247.hntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c12289247.hnop(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c12289247.hnfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,nil)
local tc=g:GetFirst()
if tc then
tc:SetMaterial(nil)
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
--覇王門無限
function c22211622.initial_effect(c)
aux.AddCodeList(c,13331639)
aux.EnablePendulumAttribute(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetTargetRange(1,0)
e1:SetCondition(c22211622.splimcon)
e1:SetTarget(c22211622.splimit)
c:RegisterEffect(e1)
--gain lp
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22211622,0))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c22211622.rccon)
e2:SetTarget(c22211622.rctg)
e2:SetOperation(c22211622.rcop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(22211622,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetTarget(c22211622.sptg)
e3:SetOperation(c22211622.spop)
c:RegisterEffect(e3)
--pendulum
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(22211622,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c22211622.pencon)
e4:SetTarget(c22211622.pentg)
e4:SetOperation(c22211622.penop)
c:RegisterEffect(e4)
end
function c22211622.splimcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)>0
end
function c22211622.splimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c22211622.rccfilter(c)
return c:IsFaceup() and c:IsCode(13331639)
end
function c22211622.rccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c22211622.rccfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c22211622.rcfilter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function c22211622.rctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c22211622.rcfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22211622.rcfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c22211622.rcfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetAttack())
end
function c22211622.rcop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
end
end
function c22211622.desfilter(c,e,tp,mc)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c22211622.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,Group.FromCards(c,mc))
end
function c22211622.spfilter(c,e,tp,dg)
return c:IsType(TYPE_XYZ+TYPE_PENDULUM) and c:IsRace(RACE_DRAGON)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,dg,c)>0
end
function c22211622.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c22211622.desfilter(chkc,e,tp,c) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c22211622.desfilter,tp,LOCATION_ONFIELD,0,1,c,e,tp,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c22211622.desfilter,tp,LOCATION_ONFIELD,0,1,1,c,e,tp,c)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c22211622.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
local dg=Group.FromCards(c,tc)
if Duel.Destroy(dg,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c22211622.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,nil)
if g:GetCount()==0 then return end
local sc=g:GetFirst()
if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(0)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e3,true)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
sc:RegisterEffect(e4,true)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e5:SetValue(1)
sc:RegisterEffect(e5,true)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
sc:RegisterEffect(e6,true)
end
Duel.SpecialSummonComplete()
end
end
function c22211622.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c22211622.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c22211622.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--アストログラフ・マジシャン
function c76794549.initial_effect(c)
aux.AddCodeList(c,13331639)
aux.EnablePendulumAttribute(c)
--pendulum set/spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(76794549,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,76794549)
e1:SetTarget(c76794549.rptg)
e1:SetOperation(c76794549.rpop)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(76794549,3))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+76794549)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c76794549.spcon)
e2:SetTarget(c76794549.sptg)
e2:SetOperation(c76794549.spop)
c:RegisterEffect(e2)
--fusion summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(76794549,5))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c76794549.hncost)
e3:SetTarget(c76794549.hntg)
e3:SetOperation(c76794549.hnop)
c:RegisterEffect(e3)
if not c76794549.global_check then
c76794549.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(c76794549.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_DESTROYED)
ge2:SetCondition(c76794549.regcon)
ge2:SetOperation(c76794549.regop)
Duel.RegisterEffect(ge2,0)
end
end
c76794549.hnchecks=aux.CreateChecks(Card.IsSetCard,{0x10f2,0x2073,0x2017,0x1046})
function c76794549.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) then
tc:RegisterFlagEffect(76794549,RESET_EVENT+0x1f20000+RESET_PHASE+PHASE_END,0,1)
elseif tc:IsLocation(LOCATION_EXTRA) then
tc:RegisterFlagEffect(76794549,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
tc=eg:GetNext()
end
end
function c76794549.spcfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c76794549.regcon(e,tp,eg,ep,ev,re,r,rp)
local v=0
if eg:IsExists(c76794549.spcfilter,1,nil,0) then v=v+1 end
if eg:IsExists(c76794549.spcfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function c76794549.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+76794549,re,r,rp,ep,e:GetLabel())
end
function c76794549.rpfilter(c,e,tp)
return c:IsCode(94415058) and (not c:IsForbidden()
or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c76794549.rptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c76794549.rpfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c76794549.rpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(76794549,6))
local g=Duel.SelectMatchingCard(tp,c76794549.rpfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
local op=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
op=Duel.SelectOption(tp,aux.Stringid(76794549,1),aux.Stringid(76794549,2))
else
op=Duel.SelectOption(tp,aux.Stringid(76794549,1))
end
if op==0 then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c76794549.spcon(e,tp,eg,ep,ev,re,r,rp)
return ev==tp or ev==PLAYER_ALL
end
function c76794549.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c76794549.thfilter1(c,tp,id)
return c:IsType(TYPE_MONSTER) and c:GetFlagEffect(76794549)~=0
and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
and Duel.IsExistingMatchingCard(c76794549.thfilter2,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c76794549.thfilter2(c,code)
return c:IsCode(code) and c:IsAbleToHand()
end
function c76794549.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g=Duel.GetMatchingGroup(c76794549.thfilter1,tp,0x70,0x70,nil,tp,Duel.GetTurnCount())
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(76794549,4)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(76794549,7))
local cg=g:Select(tp,1,1,nil)
Duel.HintSelection(cg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,c76794549.thfilter2,tp,LOCATION_DECK,0,1,1,nil,cg:GetFirst():GetCode())
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function c76794549.cfilter(c)
return c:IsSetCard(0x10f2,0x2073,0x2017,0x1046)
and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup())
end
function c76794549.hngoal(g,e,tp,c)
local sg=Group.FromCards(c)
sg:Merge(g)
return Duel.IsExistingMatchingCard(c76794549.hnfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,sg)
end
function c76794549.hnfilter(c,e,tp,sg)
return c:IsCode(13331639) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial()
and (not sg or Duel.GetLocationCountFromEx(tp,tp,sg,c)>0)
end
function c76794549.hncost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(c76794549.cfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil)
if chk==0 then return c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c76794549.hnfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,nil)
and mg:CheckSubGroupEach(c76794549.hnchecks,c76794549.hngoal,e,tp,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=mg:SelectSubGroupEach(tp,c76794549.hnchecks,false,c76794549.hngoal,e,tp,c)
sg:AddCard(c)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c76794549.hntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c76794549.hnop(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c76794549.hnfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,nil)
local tc=g:GetFirst()
if tc then
tc:SetMaterial(nil)
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
--覇王の逆鱗
function c84869738.initial_effect(c)
aux.AddCodeList(c,13331639)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c84869738.condition)
e1:SetTarget(c84869738.target)
e1:SetOperation(c84869738.activate)
c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c84869738.mattg)
e2:SetOperation(c84869738.matop)
c:RegisterEffect(e2)
end
function c84869738.cfilter(c)
return c:IsFaceup() and c:IsCode(13331639)
end
function c84869738.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c84869738.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c84869738.desfilter(c)
return not c84869738.cfilter(c)
end
function c84869738.spfilter(c,e,tp,g)
if not (c:IsSetCard(0x20f8) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)) then return false end
if c:IsLocation(LOCATION_EXTRA) then
return Duel.GetLocationCountFromEx(tp,tp,g,c)>0
else
return Duel.GetMZoneCount(tp,g)>0
end
end
function c84869738.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c84869738.desfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return g:GetCount()>0
and Duel.IsExistingMatchingCard(c84869738.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp,g) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA)
end
function c84869738.exfilter2(c)
return c:IsLocation(LOCATION_EXTRA) and c:IsFacedown() and c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
end
function c84869738.exfilter3(c)
return c:IsLocation(LOCATION_EXTRA) and (c:IsType(TYPE_LINK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
end
function c84869738.gcheck(g,ft1,ft2,ft3,ect,ft)
return aux.dncheck(g) and #g<=ft
and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)<=ft1
and g:FilterCount(c84869738.exfilter2,nil)<=ft2
and g:FilterCount(c84869738.exfilter3,nil)<=ft3
and g:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=ect
end
function c84869738.activate(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(c84869738.desfilter,tp,LOCATION_MZONE,0,nil)
if Duel.Destroy(dg,REASON_EFFECT)==0 then return end
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
local ft3=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM+TYPE_LINK)
local ft=Duel.GetUsableMZoneCount(tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
if ft3>0 then ft3=1 end
ft=1
end
local ect=(c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]) or ft
local loc=0
if ft1>0 then loc=loc+LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE end
if ect>0 and (ft2>0 or ft3>0) then loc=loc+LOCATION_EXTRA end
if loc==0 then return end
local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c84869738.spfilter),tp,loc,0,nil,e,tp)
if sg:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local rg=sg:SelectSubGroup(tp,c84869738.gcheck,false,1,4,ft1,ft2,ft3,ect,ft)
Duel.SpecialSummon(rg,0,tp,tp,true,false,POS_FACEUP)
end
function c84869738.xyzfilter(c)
return c:IsFaceup() and c:IsSetCard(0x20f8) and c:IsType(TYPE_XYZ)
end
function c84869738.matfilter(c)
return c:IsSetCard(0x20f8) and c:IsType(TYPE_MONSTER) and (c:IsFaceup() or not c:IsLocation(LOCATION_EXTRA)) and c:IsCanOverlay()
end
function c84869738.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c84869738.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c84869738.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c84869738.matfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c84869738.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c84869738.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c84869738.matfilter),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,2,2,nil)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
end
end
--覇王龍の魂
function c92428405.initial_effect(c)
aux.AddCodeList(c,13331639)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(92428405,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c92428405.cost)
e1:SetTarget(c92428405.target)
e1:SetOperation(c92428405.activate)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(92428405,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c92428405.spcon)
e2:SetCost(c92428405.spcost)
e2:SetTarget(c92428405.sptg)
e2:SetOperation(c92428405.spop)
c:RegisterEffect(e2)
end
function c92428405.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c92428405.filter(c,e,tp)
return c:IsCode(13331639) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c92428405.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c92428405.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c92428405.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c92428405.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) then
tc:RegisterFlagEffect(92428405,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCountLimit(1)
e3:SetLabel(Duel.GetTurnCount())
e3:SetLabelObject(tc)
e3:SetCondition(c92428405.tdcon)
e3:SetOperation(c92428405.tdop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
end
Duel.SpecialSummonComplete()
end
function c92428405.tdcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(92428405)~=0
end
function c92428405.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,92428405)
local tc=e:GetLabelObject()
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
function c92428405.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and re:IsActiveType(TYPE_SPELL)
end
function c92428405.costfilter(c,e,tp)
return c:IsFaceup() and c:IsCode(13331639) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c92428405.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp,c)
end
function c92428405.spfilter(c,e,tp,tc)
if not (c:IsSetCard(0x10f2,0x2073,0x2017,0x1046) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then return false end
if c:IsLocation(LOCATION_EXTRA) then
return Duel.GetLocationCountFromEx(tp,tp,tc,c)>0
else
return Duel.GetMZoneCount(tp,tc)>0
end
end
function c92428405.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c92428405.costfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c92428405.costfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
g:AddCard(c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c92428405.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==100 then
e:SetLabel(0)
return true
end
return Duel.IsExistingMatchingCard(c92428405.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp)
end
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE)
end
function c92428405.exfilter2(c)
return c:IsLocation(LOCATION_EXTRA) and c:IsFacedown() and c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
end
function c92428405.exfilter3(c)
return c:IsLocation(LOCATION_EXTRA) and (c:IsType(TYPE_LINK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
end
function c92428405.gcheck(g,ft1,ft2,ft3,ect,ft)
return #g<=ft
and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)<=ft1
and g:FilterCount(c92428405.exfilter2,nil)<=ft2
and g:FilterCount(c92428405.exfilter3,nil)<=ft3
and g:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=ect
and g:FilterCount(Card.IsSetCard,nil,0x10f2)<=1
and g:FilterCount(Card.IsSetCard,nil,0x2073)<=1
and g:FilterCount(Card.IsSetCard,nil,0x2017)<=1
and g:FilterCount(Card.IsSetCard,nil,0x1046)<=1
end
function c92428405.spop(e,tp,eg,ep,ev,re,r,rp)
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
local ft3=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM+TYPE_LINK)
local ft=Duel.GetUsableMZoneCount(tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
if ft3>0 then ft3=1 end
ft=1
end
local ect=(c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]) or ft
local loc=0
if ft1>0 then loc=loc+LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE end
if ect>0 and (ft2>0 or ft3>0) then loc=loc+LOCATION_EXTRA end
if loc==0 then return end
local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c92428405.spfilter),tp,loc,0,nil,e,tp)
if sg:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local rg=sg:SelectSubGroup(tp,c92428405.gcheck,false,1,4,ft1,ft2,ft3,ect,ft)
Duel.SpecialSummon(rg,0,tp,tp,false,false,POS_FACEUP)
end
--覇王門零
function c96227613.initial_effect(c)
aux.AddCodeList(c,13331639)
aux.EnablePendulumAttribute(c)
--avoid damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCondition(c96227613.ndcon)
e1:SetValue(0)
c:RegisterEffect(e1)
local e0=e1:Clone()
e0:SetCode(EFFECT_NO_EFFECT_DAMAGE)
c:RegisterEffect(e0)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(96227613,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetCondition(c96227613.thcon)
e2:SetTarget(c96227613.thtg)
e2:SetOperation(c96227613.thop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(96227613,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetTarget(c96227613.sptg)
e3:SetOperation(c96227613.spop)
c:RegisterEffect(e3)
--pendulum
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(96227613,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c96227613.pencon)
e4:SetTarget(c96227613.pentg)
e4:SetOperation(c96227613.penop)
c:RegisterEffect(e4)
end
function c96227613.ndcfilter(c)
return c:IsFaceup() and c:IsCode(13331639)
end
function c96227613.ndcon(e)
return Duel.IsExistingMatchingCard(c96227613.ndcfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c96227613.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_PZONE,0,1,e:GetHandler(),22211622)
end
function c96227613.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x46) and c:IsAbleToHand()
end
function c96227613.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c96227613.thfilter,tp,LOCATION_DECK,0,1,nil) end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c96227613.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
if g:GetCount()<2 then return end
if Duel.Destroy(g,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,c96227613.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function c96227613.desfilter(c,ec,e,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c96227613.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,Group.FromCards(c,ec))
end
function c96227613.spfilter(c,e,tp,mg)
return c:IsType(TYPE_FUSION+TYPE_SYNCHRO) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end
function c96227613.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c96227613.desfilter(chkc,c,e,tp) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c96227613.desfilter,tp,LOCATION_ONFIELD,0,1,c,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c96227613.desfilter,tp,LOCATION_ONFIELD,0,1,1,c,c,e,tp)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c96227613.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
local dg=Group.FromCards(c,tc)
if Duel.Destroy(dg,REASON_EFFECT)==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c96227613.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,nil)
if g:GetCount()==0 then return end
local sc=g:GetFirst()
if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(0)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e3,true)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
sc:RegisterEffect(e4,true)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e5:SetValue(1)
sc:RegisterEffect(e5,true)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
sc:RegisterEffect(e6,true)
end
Duel.SpecialSummonComplete()
end
end
function c96227613.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c96227613.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c96227613.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
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