Commit 7942b644 authored by mercury233's avatar mercury233

rm & new

parent c37ba140
#created by ... #created by ...
#main #main
100342001
100200203 100200203
100200202 100200202
100200204 100200204
...@@ -15,8 +14,6 @@ ...@@ -15,8 +14,6 @@
101106062 101106062
101106063 101106063
101106077 101106077
100342036
100342037
101106012 101106012
101106013 101106013
101106014 101106014
...@@ -30,16 +27,12 @@ ...@@ -30,16 +27,12 @@
101106201 101106201
101106202 101106202
101106203 101106203
100342021
100342055
#extra #extra
100312051 100312051
101106044 101106044
101106047 101106047
101106048 101106048
101106049 101106049
100342052
100342051
!side !side
100280001 100280001
100280002 100280002
......
#The first line is used for comment #The first line is used for comment
!setname 0x26a 随风旅鸟 !setname 0x26a 随风旅鸟
!setname 0x26b 许珀里翁 !setname 0x26b 许珀里翁
!setname 0x26c №系
--Arcana Triumph Joker
--scripted by XyLeN
function c100280001.initial_effect(c)
aux.AddCodeList(c,25652259,64788463,90876561)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100280001,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCost(c100280001.spcost)
e1:SetTarget(c100280001.sptg)
e1:SetOperation(c100280001.spop)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c100280001.atkval)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100280001,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c100280001.descost)
e3:SetTarget(c100280001.destg)
e3:SetOperation(c100280001.desop)
c:RegisterEffect(e3)
end
c100280001.tgchecks=aux.CreateChecks(Card.IsCode,{25652259,64788463,90876561})
function c100280001.cfilter(c)
return c:IsCode(25652259,64788463,90876561) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost()
end
function c100280001.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100280001.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
if chk==0 then return g:CheckSubGroupEach(c100280001.tgchecks,aux.mzctcheck,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroupEach(tp,c100280001.tgchecks,false,aux.mzctcheck,tp)
Duel.SendtoGrave(sg,REASON_COST)
end
function c100280001.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100280001.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c100280001.atkval(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,LOCATION_HAND)*500
end
function c100280001.descostfilter(c,tp)
local type=bit.band(c:GetType(),0x7)
return c:IsDiscardable() and Duel.IsExistingMatchingCard(c100280001.desfilter,tp,0,LOCATION_ONFIELD,1,nil,type)
end
function c100280001.desfilter(c,type)
return c:IsType(type) and c:IsFaceup()
end
function c100280001.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
e:SetLabel(100)
return Duel.IsExistingMatchingCard(c100280001.descostfilter,tp,LOCATION_HAND,0,1,nil,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local cost=Duel.SelectMatchingCard(tp,c100280001.descostfilter,tp,LOCATION_HAND,0,1,1,nil,tp):GetFirst()
e:SetLabel(bit.band(cost:GetType(),0x7))
Duel.SendtoGrave(cost,REASON_COST+REASON_DISCARD)
end
function c100280001.destg(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 true
end
local type=e:GetLabel()
local g=Duel.GetMatchingGroup(c100280001.desfilter,tp,0,LOCATION_ONFIELD,nil,type)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function c100280001.desop(e,tp,eg,ep,ev,re,r,rp)
local type=e:GetLabel()
local g=Duel.GetMatchingGroup(c100280001.desfilter,tp,0,LOCATION_ONFIELD,nil,type)
if #g>0 then Duel.Destroy(g,REASON_EFFECT) end
end
--Joker's Knight
--scripted by XyLeN
function c100280002.initial_effect(c)
aux.AddCodeList(c,25652259,64788463,90876561)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100280002,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100280002)
e1:SetCost(c100280002.spcost)
e1:SetTarget(c100280002.sptg)
e1:SetOperation(c100280002.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100280002,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100280002+100)
e2:SetTarget(c100280002.thtg)
e2:SetOperation(c100280002.thop)
c:RegisterEffect(e2)
end
function c100280002.cfilter(c)
return c:IsCode(25652259,64788463,90876561) and c:IsAbleToGraveAsCost()
end
function c100280002.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100280002.cfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100280002.cfilter,tp,LOCATION_DECK,0,1,1,nil)
e:SetLabel(g:GetFirst():GetCode())
Duel.SendtoGrave(g,REASON_COST)
end
function c100280002.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 c100280002.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local code=e:GetLabel()
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+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
function c100280002.tdfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_WARRIOR) and c:IsAbleToDeck()
end
function c100280002.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100280002.tdfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c100280002.tdfilter,tp,LOCATION_GRAVE,0,1,c) and c:IsAbleToHand() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c100280002.tdfilter,tp,LOCATION_GRAVE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function c100280002.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--Imperial Bower
--script by 222DIY
function c100280003.initial_effect(c)
aux.AddCodeList(c,25652259,64788463,90876561)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100280003,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100280003)
e1:SetCondition(c100280003.spcon)
e1:SetCost(c100280003.spcost)
e1:SetTarget(c100280003.sptg)
e1:SetOperation(c100280003.spop)
c:RegisterEffect(e1)
end
function c100280003.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
end
function c100280003.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 c100280003.thfilter(c)
return c:IsAbleToHand() and c:IsCode(64788463,25652259,90876561)
end
function c100280003.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(64788463,25652259,90876561)
end
function c100280003.opfilter(c,e,tp)
return c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(64788463,25652259,90876561)
end
function c100280003.opcheck(g,e,tp)
return g:GetClassCount(Card.GetCode)==#g
and (g:FilterCount(c100280003.thfilter,nil)==2 or g:FilterCount(c100280003.spfilter,nil,e,tp)==2)
end
function c100280003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetMZoneCount(tp,e:GetHandler())
if chk==0 then
local g1=Duel.GetMatchingGroup(c100280003.thfilter,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(c100280003.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return g1:GetClassCount(Card.GetCode)>=2
or not Duel.IsPlayerAffectedByEffect(tp,59822133) and ft>1 and g2:GetClassCount(Card.GetCode)>=2 end
end
function c100280003.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c100280003.thfilter,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(c100280003.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
local g3=Duel.GetMatchingGroup(c100280003.opfilter,tp,LOCATION_DECK,0,nil,e,tp)
local cg1=g1:GetClassCount(Card.GetCode)
local cg2=g2:GetClassCount(Card.GetCode)
if (Duel.IsPlayerAffectedByEffect(tp,59822133) or ft<=1 or cg2<2) and cg1>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=g1:SelectSubGroup(tp,aux.dncheck,false,2,2)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
elseif cg1<2 and cg2>=2 and ft>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=g2:SelectSubGroup(tp,aux.dncheck,false,2,2)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
elseif cg1>=2 or (cg2>=2 and ft>1) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=g3:SelectSubGroup(tp,c100280003.opcheck,false,2,2,e,tp)
local tg=g:FilterCount(c100280003.thfilter,nil)
local sg=g:FilterCount(c100280003.spfilter,nil,e,tp)
if tg>1 and (sg<2 or ft<=1 or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
else
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--Joker's Straight
--script by 222DIY
function c100280004.initial_effect(c)
aux.AddCodeList(c,25652259,64788463,90876561)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100280004,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100280004)
e1:SetCost(c100280004.spcost)
e1:SetTarget(c100280004.sptg)
e1:SetOperation(c100280004.spop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100280004,2))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100280004+100)
e2:SetTarget(c100280004.tdtg)
e2:SetOperation(c100280004.tdop)
c:RegisterEffect(e2)
end
function c100280004.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c100280004.spfilter(c,e,tp)
return c:IsCode(25652259) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100280004.thfilter(c)
return c:IsCode(64788463,90876561) and c:IsAbleToHand()
end
function c100280004.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100280004.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c100280004.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,0,0,0)
end
function c100280004.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,c100280004.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g1:GetCount()>0 and Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c100280004.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g2:GetCount()>0 then
Duel.SendtoHand(g2,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
if Duel.IsExistingMatchingCard(Card.IsSummonable,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,true,nil)
and Duel.SelectYesNo(tp,aux.Stringid(100280004,1)) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,Card.IsSummonable,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,true,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
end
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c100280004.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100280004.splimit(e,c)
return not (c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_LIGHT)) and c:IsLocation(LOCATION_EXTRA)
end
function c100280004.tdfilter(c)
return c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeck()
end
function c100280004.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100280004.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100280004.tdfilter,tp,LOCATION_GRAVE,0,1,nil)
and e:GetHandler():IsAbleToHand() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c100280004.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c100280004.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--Face Card Fusion
--scripted by XyLeN
function c100280005.initial_effect(c)
aux.AddCodeList(c,25652259,64788463,90876561)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100280005+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100280005.target)
e1:SetOperation(c100280005.activate)
c:RegisterEffect(e1)
end
function c100280005.exconfilter(c)
return c:IsCode(25652259,64788463,90876561) and c:IsFaceup()
end
function c100280005.excon(tp)
return Duel.IsExistingMatchingCard(c100280005.exconfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100280005.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c100280005.filter2(c,e,tp,m,f,chkf)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c100280005.fexfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c100280005.frcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
end
function c100280005.gcheck(sg)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
end
function c100280005.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
if c100280005.excon(tp) then
local mg2=Duel.GetMatchingGroup(c100280005.fexfilter,tp,LOCATION_DECK,0,nil)
if mg2:GetCount()>0 then
mg1:Merge(mg2)
aux.FCheckAdditional=c100280005.frcheck
aux.GCheckAdditional=c100280005.gcheck
end
end
local res=Duel.IsExistingMatchingCard(c100280005.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c100280005.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100280005.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c100280005.filter1,nil,e)
local exmat=false
if c100280005.excon(tp) then
local mg2=Duel.GetMatchingGroup(c100280005.fexfilter,tp,LOCATION_DECK,0,nil)
if mg2:GetCount()>0 then
mg1:Merge(mg2)
exmat=true
end
end
if exmat then
aux.FCheckAdditional=c100280005.frcheck
aux.GCheckAdditional=c100280005.gcheck
end
local sg1=Duel.GetMatchingGroup(c100280005.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c100280005.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
if exmat then
aux.FCheckAdditional=c100280005.fcheck
aux.GCheckAdditional=c100280005.gcheck
end
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--Thunderspeed Summon
--script by 222DIY
function c100280006.initial_effect(c)
aux.AddCodeList(c,25652259,64788463,90876561)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100280006+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100280006.condition)
e1:SetTarget(c100280006.target)
e1:SetOperation(c100280006.operation)
c:RegisterEffect(e1)
end
function c100280006.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
function c100280006.checkfilter(c)
return c:IsFaceup() and c:IsCode(64788463,25652259,90876561)
end
function c100280006.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsLevel(10)
end
function c100280006.thfilter(c)
return c:GetTextAttack()==-2 and c:IsAbleToHand() and c:IsType(TYPE_MONSTER) and c:IsLevel(10) and not c:IsAttribute(ATTRIBUTE_DARK)
end
function c100280006.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100280006.checkfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c100280006.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
or (g:GetClassCount(Card.GetCode)==3 and Duel.IsExistingMatchingCard(c100280006.thfilter,tp,LOCATION_DECK,0,1,nil)) end
end
function c100280006.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100280006.checkfilter,tp,LOCATION_MZONE,0,nil)
local check1=g:GetClassCount(Card.GetCode)==3
if check1 and Duel.IsExistingMatchingCard(c100280006.thfilter,tp,LOCATION_DECK,0,1,nil)
and (not Duel.IsExistingMatchingCard(c100280006.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
or Duel.SelectYesNo(tp,aux.Stringid(100280006,1))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100280006.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsExistingMatchingCard(c100280006.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(100280006,2)) then
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,c100280006.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
elseif Duel.IsExistingMatchingCard(c100280006.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c100280006.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
end
--Joker's Wild
--script by 222DIY
function c100280007.initial_effect(c)
aux.AddCodeList(c,25652259,64788463,90876561)
--copy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100280007,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100280007)
e1:SetCost(c100280007.cpcost)
e1:SetCondition(c100280007.cpcon)
e1:SetTarget(c100280007.cptg)
e1:SetOperation(c100280007.cpop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100280007,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100280007+100)
e2:SetTarget(c100280007.tdtg)
e2:SetOperation(c100280007.tdop)
c:RegisterEffect(e2)
end
function c100280007.cpcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)
end
function c100280007.cpfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost() and c:CheckActivateEffect(false,true,false)~=nil
and aux.IsCodeListed(c,25652259) and aux.IsCodeListed(c,64788463) and aux.IsCodeListed(c,90876561)
end
function c100280007.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c100280007.cptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c100280007.cpfilter,tp,LOCATION_DECK,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100280007.cpfilter,tp,LOCATION_DECK,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.SendtoGrave(g,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function c100280007.cpop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if te then
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
function c100280007.tdfilter(c)
return c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeck()
end
function c100280007.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100280007.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100280007.tdfilter,tp,LOCATION_GRAVE,0,1,nil)
and e:GetHandler():IsAbleToHand() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c100280007.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c100280007.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--Court of Cards
--script by 222DIY
function c100280008.initial_effect(c)
aux.AddCodeList(c,25652259,64788463,90876561)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100280008,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,100280008)
e2:SetCondition(c100280008.spcon)
e2:SetTarget(c100280008.sptg)
e2:SetOperation(c100280008.spop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100280008,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,100280008)
e3:SetCost(c100280008.drcost)
e3:SetTarget(c100280008.drtg)
e3:SetOperation(c100280008.drop)
c:RegisterEffect(e3)
end
function c100280008.confilter(c)
return c:IsFaceup() and c:IsCode(64788463,25652259,90876561)
end
function c100280008.spcon(e,tp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
return #g==0 or (g:GetCount()>0 and g:FilterCount(c100280008.confilter,nil)==g:GetCount())
end
function c100280008.spfilter(c,e,tp)
return c:IsCode(64788463,25652259,90876561) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100280008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100280008.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 c100280008.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,c100280008.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100280008.cfilter(c)
return c:IsCode(64788463,25652259,90876561) and c:IsAbleToRemoveAsCost()
end
function c100280008.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100280008.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil)
local mt=g:GetClassCount(Card.GetCode)
if chk==0 then return mt>0 end
local ct=1
for i=2,3 do
if Duel.IsPlayerCanDraw(tp,i) then ct=i end
end
if mt<ct then ct=mt end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ct)
e:SetLabel(Duel.Remove(sg,POS_FACEUP,REASON_COST))
end
function c100280008.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
local ct=e:GetLabel()
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function c100280008.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
--Magnet Induction
--script by 222DIY
function c100280009.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100280009+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100280009.spcon)
e1:SetTarget(c100280009.sptg)
e1:SetOperation(c100280009.spop)
c:RegisterEffect(e1)
end
function c100280009.cpfilter(c)
return c:IsFaceup() and c:IsSetCard(0x2066) and c:GetOriginalLevel()<=4
end
function c100280009.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100280009.cpfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100280009.cfilter2(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function c100280009.spfilter(c,e,tp)
return c:IsSetCard(0x2066) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not Duel.IsExistingMatchingCard(c100280009.cfilter2,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode())
end
function c100280009.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100280009.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100280009.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
--change damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c100280009.indtg)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(aux.indoval)
Duel.RegisterEffect(e2,tp)
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100280009.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100280009.indtg(e,c)
return c:IsType(TYPE_MONSTER) and (c:IsSetCard(0x2066) or c:IsSetCard(0xe9)) and c:IsFaceup()
end
--XYZ Hyper Cannon
--script by 222DIY
function c100280010.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--turn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100280010,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,100280010)
e2:SetCondition(c100280010.condition)
e2:SetTarget(c100280010.target)
e2:SetOperation(c100280010.operation)
c:RegisterEffect(e2)
end
function c100280010.cfilter(c)
return c:IsFaceup() and (c:IsCode(91998119) or aux.IsMaterialListCode(c,91998119))
end
function c100280010.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100280010.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100280010.tdfilter(c)
return c:IsFaceup() and c:IsType(TYPE_UNION) and c:IsAbleToDeck()
end
function c100280010.target(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetTurnPlayer()==tp then
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c100280010.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100280010.tdfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp)
and Duel.IsPlayerCanDraw(tp,1) end
e:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c100280010.tdfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
else
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
e:SetCategory(CATEGORY_DESTROY)
local rt=Duel.GetTargetCount(nil,tp,0,LOCATION_ONFIELD,nil)
local ct=Duel.DiscardHand(tp,Card.IsDiscardable,1,rt,REASON_COST+REASON_DISCARD,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,ct,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,ct,0,0)
end
end
function c100280010.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,1,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_DECK) then
Duel.Draw(tp,1,REASON_EFFECT)
end
else
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local rg=tg:Filter(Card.IsRelateToEffect,nil,e)
if rg:GetCount()>0 then
Duel.Destroy(rg,REASON_EFFECT)
end
end
end
--希望皇アストラル・ホープ
--Scripted by mallu11
function c100342001.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100342001,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100342001)
e1:SetCondition(c100342001.spcon)
e1:SetTarget(c100342001.sptg)
e1:SetOperation(c100342001.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100342001,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100342001+100)
e2:SetCost(c100342001.thcost)
e2:SetTarget(c100342001.thtg)
e2:SetOperation(c100342001.thop)
c:RegisterEffect(e2)
end
function c100342001.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c100342001.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100342001.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function c100342001.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 c100342001.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100342001.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function c100342001.thfilter(c)
return c:IsSetCard(0x73,0x13a,0x7e,0x26c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100342001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100342001.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100342001.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100342001.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
--ゼアル・フィールド
--
--Script by mercury233
function c100342021.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--act limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_FZONE)
e2:SetOperation(c100342021.chainop)
c:RegisterEffect(e2)
--material
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100342021,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,100342021)
e3:SetTarget(c100342021.mattg)
e3:SetOperation(c100342021.matop)
c:RegisterEffect(e3)
--deck top
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100342021,1))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PREDRAW)
e4:SetRange(LOCATION_FZONE)
e4:SetCondition(c100342021.tdcon)
e4:SetTarget(c100342021.tdtg)
e4:SetOperation(c100342021.tdop)
c:RegisterEffect(e4)
end
function c100342021.cfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c100342021.chainop(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if tg and tg:IsExists(c100342021.cfilter,1,nil) and ep==tp then
Duel.SetChainLimit(c100342021.chainlm)
end
end
function c100342021.chainlm(e,rp,tp)
return tp==rp
end
function c100342021.tgfilter(c,e,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsType(TYPE_XYZ) and c:IsCanBeEffectTarget(e)
end
function c100342021.matfilter(c)
return c:IsType(TYPE_XYZ) and c:IsCanOverlay()
end
function c100342021.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c100342021.tgfilter(chkc,e,tp) end
if chk==0 then return eg:IsExists(c100342021.tgfilter,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c100342021.matfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil) end
local g=eg
if #eg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
g=eg:FilterSelect(tp,c100342021.tgfilter,1,1,nil,e,tp)
end
Duel.SetTargetCard(g)
end
function c100342021.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(c100342021.matfilter),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
end
end
function c100342021.tdcon(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 c100342021.tdfilter(c)
return c:IsCode(35906693)
end
function c100342021.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1
and Duel.IsExistingMatchingCard(c100342021.tdfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c100342021.tdop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=1 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100342021,2))
local dc=Duel.SelectMatchingCard(tp,c100342021.tdfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if dc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(dc,0)
Duel.ConfirmDecktop(tp,1)
end
end
--運命の契約
--scripted by XyLeN
function c100342036.initial_effect(c)
c:EnableCounterPermit(0x15e,LOCATION_SZONE)
c:SetCounterLimit(0x15e,1)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_SZONE)
e1:SetOperation(c100342036.ctop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100342036,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100342036)
e2:SetCondition(c100342036.spcon)
e2:SetCost(c100342036.spcost)
e2:SetTarget(c100342036.sptg)
e2:SetOperation(c100342036.spop)
c:RegisterEffect(e2)
end
function c100342036.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c100342036.ctop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(c100342036.cfilter,1,nil,tp) then
e:GetHandler():AddCounter(0x15e,1)
end
end
function c100342036.cfilter2(c,tp)
return c:IsSummonLocation(LOCATION_EXTRA) and c:IsSummonPlayer(1-tp)
end
function c100342036.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100342036.cfilter2,1,nil,tp)
end
function c100342036.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x15e,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x15e,1,REASON_COST)
end
function c100342036.tgfilter(c)
return (c:IsLocation(LOCATION_HAND+LOCATION_DECK) or c:IsFaceup())
and c:IsCode(27062594) and c:IsAbleToGrave()
end
function c100342036.spfilter(c,e,tp)
return c:IsSetCard(0x7f) and c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_LIGHT)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c100342036.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100342036.tgfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil)
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) and e:GetHandler():IsCanOverlay()
and Duel.IsExistingMatchingCard(c100342036.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100342036.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100342036.tgfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c100342036.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local sc=sg:GetFirst()
if sc and Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
sc:CompleteProcedure()
if c:IsRelateToEffect(e) then
Duel.Overlay(sc,Group.FromCards(c))
end
end
end
end
--ナンバーズ・プロテクト
--scripted by XyLeN
function c100342037.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100342037,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,100342037)
e1:SetCondition(c100342037.condition)
e1:SetTarget(c100342037.target)
e1:SetOperation(c100342037.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100342037,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100342037)
e2:SetCondition(c100342037.setcon)
e2:SetTarget(c100342037.settg)
e2:SetOperation(c100342037.setop)
c:RegisterEffect(e2)
end
function c100342037.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x48) and c:IsType(TYPE_XYZ)
end
function c100342037.condition(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(c100342037.cfilter,tp,LOCATION_MZONE,0,1,nil) then return false end
if not Duel.IsChainNegatable(ev) then return false end
return re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c100342037.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c100342037.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c100342037.setfilter(c,tp)
return c:IsSetCard(0x48) and c:IsType(TYPE_XYZ) and c:IsPreviousControler(tp) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c100342037.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100342037.setfilter,1,nil,tp)
end
function c100342037.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c100342037.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c)~=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+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
end
end
--No.99 希望皇ホープドラグナー
--Script by XyLeN
function c100342051.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,12,3,nil,nil,99)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100342051,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,100342051)
e1:SetCost(c100342051.spcost)
e1:SetTarget(c100342051.sptg)
e1:SetOperation(c100342051.spop)
c:RegisterEffect(e1)
--loses ATK
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100342051,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1,100342051+100)
e2:SetCondition(c100342051.atkcon)
e2:SetOperation(c100342051.atkop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(100342051,ACTIVITY_SPSUMMON,c100342051.counterfilter)
if not c100342051.global_check then
c100342051.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c100342051.dacheck)
Duel.RegisterEffect(ge1,0)
end
end
c100342051.xyz_number=99
function c100342051.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsType(TYPE_XYZ)
end
function c100342051.dacheck(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p=tc:GetControler()
if Duel.GetAttackTarget()~=nil then return end
if tc:GetFlagEffect(100342051)==0 then
tc:RegisterFlagEffect(100342051,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
if Duel.GetFlagEffect(p,100342051)==0 then
Duel.RegisterFlagEffect(p,100342051,RESET_PHASE+PHASE_END,0,1)
else
Duel.RegisterFlagEffect(p,100342051+100,RESET_PHASE+PHASE_END,0,1)
end
end
end
function c100342051.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,2,REASON_COST)
and Duel.GetCustomActivityCount(100342051,tp,ACTIVITY_SPSUMMON)==0
and Duel.GetFlagEffect(tp,100342051+100)==0
and (Duel.GetFlagEffect(tp,100342051)==0 or c:GetFlagEffect(100342051)~=0) end
--splimit
local e1=Effect.CreateEffect(c)
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(c100342051.splimit)
Duel.RegisterEffect(e1,tp)
--cannot attack directly
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OATH)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c100342051.ftarget)
e2:SetLabel(c:GetFieldID())
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
c:RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c100342051.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
end
function c100342051.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c100342051.spfilter(c,e,tp)
local no=c.xyz_number
return no and no>=1 and no<=100 and c:IsSetCard(0x48)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c100342051.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c100342051.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100342051.spop(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c100342051.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c100342051.atkcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and aux.nzatk(Duel.GetAttacker())
end
function c100342051.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
--ZS-希望賢者
--scripted by XyLeN
function c100342052.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100342052,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100342052)
e1:SetCost(c100342052.spcost)
e1:SetTarget(c100342052.sptg)
e1:SetOperation(c100342052.spop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetTarget(c100342052.reptg)
e2:SetValue(c100342052.repval)
e2:SetOperation(c100342052.repop)
c:RegisterEffect(e2)
end
function c100342052.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c100342052.spfilter(c,e,tp)
return c:IsSetCard(0x107e,0x207e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100342052.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100342052.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100342052.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100342052.spfilter,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
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100342052.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c100342052.atklimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c100342052.splimit(e,c)
return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
end
function c100342052.atklimit(e,c)
return not c:IsSetCard(0x48)
end
function c100342052.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x7f) and c:GetOriginalAttribute()==ATTRIBUTE_LIGHT and not c:IsCode(100342052)
and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function c100342052.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c100342052.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c100342052.repval(e,c)
return c100342052.repfilter(c,e:GetHandlerPlayer())
end
function c100342052.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--HRUM-ユートピア・フォース
--
--Script by mercury233
function c100342055.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100342055,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100342055)
e1:SetTarget(c100342055.target)
e1:SetOperation(c100342055.activate)
c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100342055,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100342055+100)
e2:SetCondition(c100342055.matcon)
e2:SetTarget(c100342055.mattg)
e2:SetOperation(c100342055.matop)
c:RegisterEffect(e2)
end
function c100342055.filter1(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x107f) and c:IsType(TYPE_XYZ) and c:IsRankBelow(9)
and Duel.IsExistingMatchingCard(c100342055.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function c100342055.filter2(c,e,tp,mc)
return c:IsRankAbove(10) and c:IsSetCard(0x7f) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c100342055.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c100342055.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c100342055.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100342055.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100342055.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
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,c100342055.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
function c100342055.cfilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsCanBeEffectTarget(e)
end
function c100342055.matcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rc and rc:IsType(TYPE_XYZ) and rc:IsRankAbove(10) and rc:IsSetCard(0x7f) and eg:IsExists(c100342055.cfilter,1,nil,e)
end
function c100342055.tgfilter(c,eg)
return eg:IsContains(c) and c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c100342055.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100342055.tgfilter(chkc,eg) end
if chk==0 then return Duel.IsExistingTarget(c100342055.tgfilter,tp,LOCATION_MZONE,0,1,nil,eg)
and e:GetHandler():IsCanOverlay() end
if eg:GetCount()==1 then
Duel.SetTargetCard(eg)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c100342055.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,eg)
end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c100342055.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
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