Commit 9002088a authored by POLYMER's avatar POLYMER

fix

parent 224af9cc
No preview for this file type
No preview for this file type
--崇拝者の獄獣 イエイヌ
local m=22520000
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.actcon)
e1:SetCost(cm.actcost)
e1:SetTarget(cm.acttg)
e1:SetOperation(cm.actop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(cm.actcon2)
c:RegisterEffect(e2)
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,1))
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetRange(LOCATION_HAND)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET)
e0:SetCondition(cm.spcon1)
e0:SetCost(cm.cost)
e0:SetTarget(cm.negtg)
e0:SetOperation(cm.operation)
c:RegisterEffect(e0)
local e3=e0:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(cm.spcon2)
c:RegisterEffect(e3)
end
function cm.actcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_GRAVE,0,1,nil,RACE_FIEND) and not Duel.IsPlayerAffectedByEffect(tp,22520006)
end
function cm.actcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_GRAVE,0,1,nil,RACE_FIEND) and Duel.IsPlayerAffectedByEffect(tp,22520006)
end
function cm.actcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.actfilter(c,tp)
return c:IsCode(22520011) and c:GetActivateEffect():IsActivatable(tp,false,false)
end
function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,tp) end
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,cm.actfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
local te=tc:GetActivateEffect()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local tep=tc:GetControler()
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPublic() and not Duel.IsPlayerAffectedByEffect(tp,22520006)
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPublic() and Duel.IsPlayerAffectedByEffect(tp,22520006)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
end
function cm.negfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and aux.NegateAnyFilter(c)
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and cm.negfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.negfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,cm.negfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local fid=c:GetFieldID()
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,fid,66)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+PHASE_END)
c:RegisterEffect(e1)
local tc=Duel.GetFirstTarget()
if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetLabel(fid)
e1:SetLabelObject(c)
e1:SetCondition(cm.indcon)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=e1:Clone()
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
tc:RegisterEffect(e3)
end
end
end
function cm.indcon(e)
local c=e:GetLabelObject()
return c:GetFlagEffectLabel(m)==e:GetLabel()
end
--魔術師の獄獣 フウチョウ
local m=22520001
local cm=_G["c"..m]
function cm.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.spcon1)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
local e1=e2:Clone()
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.spcon2)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.actcon)
e3:SetTarget(cm.acttarget)
e3:SetOperation(cm.actactivate)
c:RegisterEffect(e3)
end
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,22520006)
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,22520006)
end
function cm.cost(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 cm.filter(c)
return c:IsCode(22520006) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.actcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,22520006)
end
function cm.acttarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.actactivate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
if Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT)==0 or not tc:IsLocation(LOCATION_REMOVED) then return end
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
end
......@@ -57,7 +57,7 @@ function cm.thtg(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 #g>0 and count>math.min(3,#g) and Duel.GetDecktopGroup(tp,math.min(3,count)):IsExists(Card.IsAbleToHand,1,nil) and Duel.GetDecktopGroup(tp,math.min(3,count)):IsExists(Card.IsAbleToRemove,1,nil,POS_FACEDOWN)
return #g>0 and count>math.min(3,#g) and Duel.GetDecktopGroup(tp,math.min(3,count)):IsExists(Card.IsAbleToHand,1,nil) and Duel.GetDecktopGroup(tp,math.min(3,count)):IsExists(Card.IsAbleToRemove,1,nil,tp,POS_FACEDOWN)
end
SNNM.UpConfirm(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......
......@@ -53,11 +53,11 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function cm.dcfilter(c)
return c:IsRace(RACE_PLANT) and c:IsAbleToRemoveAsCost(POS_FACEDOWN)
function cm.dcfilter(c,tp)
return c:IsRace(RACE_PLANT) and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(cm.dcfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingMatchingCard(cm.dcfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
......@@ -65,10 +65,10 @@ end
function cm.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)
if not Duel.IsExistingMatchingCard(cm.dcfilter,tp,LOCATION_DECK,0,1,nil) then return end
if not Duel.IsExistingMatchingCard(cm.dcfilter,tp,LOCATION_DECK,0,1,nil,tp) then return end
SNNM.UpConfirm(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.dcfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,cm.dcfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.ConfirmCards(1-tp,g)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
......@@ -38,7 +38,7 @@ function cm.dspop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK,0,3,3,c,e)
Duel.ConfirmCards(1-tp,g)
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
Duel.Remove(g,POS_FACEDOWN,REASON_SPSUMMON)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END+RESET_SELF_TURN,0,2)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -50,7 +50,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=g:GetCount()-1
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:FilterSelect(tp,Card.IsAbleToRemove,ct,ct,nil,tp,nil)
local sg=g:FilterSelect(tp,Card.IsAbleToRemove,ct,ct,nil,tp,POS_FACEDOWN)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
end
end
......
......@@ -58,7 +58,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) then
if Duel.NegateActivation(ev) and e:GetLabel()==1 then
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil)
local off=1
......
......@@ -96,10 +96,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then
if c:GetFlagEffect(m)==0 then c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) end
return c:GetFlagEffectLabel(m)&(1<<(tp+1))==0 and eg:IsExists(Card.IsAbleToRemove,1,nil,pos)
return c:GetFlagEffectLabel(m)&(1<<(tp+1))==0 and eg:IsExists(Card.IsAbleToRemove,1,nil,tp,pos)
end
c:SetFlagEffectLabel(m,1<<(tp+1))
local g=eg:Filter(Card.IsAbleToRemove,nil,pos)
local g=eg:Filter(Card.IsAbleToRemove,nil,tp,pos)
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
......@@ -109,7 +109,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local pos=POS_FACEUP
if Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) then pos=POS_FACEDOWN end
local g=Duel.GetTargetsRelateToChain():Filter(Card.IsAbleToRemove,nil,pos)
local g=Duel.GetTargetsRelateToChain():Filter(Card.IsAbleToRemove,nil,tp,pos)
if #g==0 then return end
Duel.Remove(g,pos,REASON_EFFECT)
end
......@@ -26,10 +26,10 @@ function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
if g:GetCount()==0 then return false end
local tc=g:GetMinGroup(Card.GetSequence):GetFirst()
return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,POS_FACEDOWN) and tc:IsAbleToRemove(POS_FACEDOWN)
return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,tp,POS_FACEDOWN) and tc:IsAbleToRemove(tp,POS_FACEDOWN)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,POS_FACEDOWN)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp,POS_FACEDOWN)
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
......
......@@ -22,10 +22,10 @@ function cm.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_SPELL)
end
function cm.cpfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost() and c:IsAbleToRemove(POS_FACEDOWN) and c:CheckActivateEffect(false,true,false)~=nil and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND+LOCATION_DECK,0,2,c,c:GetCode())
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost() and c:IsAbleToRemove(tp,POS_FACEDOWN) and c:CheckActivateEffect(false,true,false)~=nil and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND+LOCATION_DECK,0,2,c,c:GetCode())
end
function cm.filter(c,code)
return c:IsCode(code) and c:IsAbleToGraveAsCost() and c:IsAbleToRemove(POS_FACEDOWN)
return c:IsCode(code) and c:IsAbleToGraveAsCost() and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function cm.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
......
--傲慢源码·露茜法
function c74500000.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,12,2,nil,nil,99)
c:EnableReviveLimit()
--change effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74500000,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,74500000)
e1:SetCondition(c74500000.chcon)
e1:SetTarget(c74500000.chtg)
e1:SetOperation(c74500000.chop)
c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74500000,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,74600000)
e2:SetCondition(c74500000.macon)
e2:SetTarget(c74500000.matg)
e2:SetOperation(c74500000.maop)
c:RegisterEffect(e2)
--release
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74500000,3))
e3:SetCategory(CATEGORY_RELEASE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,74700000)
e3:SetCondition(c74500000.relcon)
e3:SetTarget(c74500000.reltg)
e3:SetOperation(c74500000.relop)
c:RegisterEffect(e3)
--recover
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(74500000,4))
e4:SetCategory(CATEGORY_RECOVER)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,74800000)
e4:SetCondition(c74500000.reccon)
e4:SetTarget(c74500000.rectg)
e4:SetOperation(c74500000.recop)
c:RegisterEffect(e4)
--cannot target
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetValue(1)
e5:SetCondition(c74500000.effcon)
e5:SetLabel(3)
c:RegisterEffect(e5)
--immune
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EFFECT_IMMUNE_EFFECT)
e6:SetValue(c74500000.efilter)
e6:SetCondition(c74500000.effcon)
e6:SetLabel(7)
c:RegisterEffect(e6)
end
function c74500000.syfilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_SYNCHRO)
end
function c74500000.chcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetOverlayGroup():FilterCount(c74500000.syfilter,nil)~=0
end
function c74500000.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,rp,LOCATION_EXTRA,0,1,nil,REASON_EFFECT) end
end
function c74500000.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c74500000.repop)
end
function c74500000.repop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_EXTRA,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
function c74500000.exfilter(c,tp)
return c:IsFaceup() and c:IsSummonLocation(LOCATION_EXTRA)
end
function c74500000.fufilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_FUSION)
end
function c74500000.macon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c74500000.exfilter,1,nil,tp) and e:GetHandler():GetOverlayGroup():FilterCount(c74500000.fufilter,nil)~=0
end
function c74500000.tgfilter(c,eg)
return c:IsCanOverlay() and eg:IsContains(c)
end
function c74500000.matg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c74500000.tgfilter(chkc,eg) and chkc~=e:GetHandler() end
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingTarget(c74500000.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler(),eg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,c74500000.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler(),eg)
end
function c74500000.matfilter(c,e)
return c:IsCanOverlay() and not (e and c:IsImmuneToEffect(e))
end
function c74500000.maop(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
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,Group.FromCards(tc))
if tc:IsSetCard(0x745) and Duel.SelectYesNo(tp,aux.Stringid(74500000,2)) then
Duel.BreakEffect()
local tg=Duel.GetMatchingGroup(c74500000.matfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,aux.ExceptThisCard(e),e)
if tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=tg:Select(tp,1,1,nil):GetFirst()
Duel.Overlay(c,Group.FromCards(sg))
end
end
end
end
function c74500000.rifilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_RITUAL)
end
function c74500000.relcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():FilterCount(c74500000.rifilter,nil)~=0
end
function c74500000.reltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsReleasable,1-tp,LOCATION_MZONE,0,1,nil,REASON_RULE) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,1-tp,LOCATION_MZONE)
end
function c74500000.relop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsReleasable,1-tp,LOCATION_MZONE,0,nil,REASON_RULE)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_RELEASE)
local sg=g:Select(1-tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Release(sg,REASON_RULE)
end
end
function c74500000.dufilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_DUAL)
end
function c74500000.reccon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():FilterCount(c74500000.dufilter,nil)~=0
end
function c74500000.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetOverlayCount() end
local ct=e:GetHandler():GetOverlayCount()
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*500)
end
function c74500000.recop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=e:GetHandler():GetOverlayCount()
if ct>0 then
Duel.Recover(p,ct*500,REASON_EFFECT)
end
end
function c74500000.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayCount()>=e:GetLabel()
end
function c74500000.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
--优胜者·死神十三
function c74500013.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c74500013.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,74500013)
e2:SetCondition(c74500013.spcon)
e2:SetCost(c74500013.spcost)
e2:SetTarget(c74500013.sptg)
e2:SetOperation(c74500013.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74500013,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(3,84500013)
e3:SetCondition(c74500013.decon)
e3:SetCost(c74500013.decost)
e3:SetTarget(c74500013.detg)
e3:SetOperation(c74500013.deop)
c:RegisterEffect(e3)
end
function c74500013.splimit(e,se,sp,st)
return st&SUMMON_TYPE_RITUAL~=SUMMON_TYPE_RITUAL or (se and se:GetHandler():IsSetCard(0x745))
end
function c74500013.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,84500013)==0
end
function c74500013.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() end
Duel.RegisterFlagEffect(tp,74500013,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c74500013.spfilter(c,e,tp)
return c:IsCode(74516549) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74500013.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74500013.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c74500013.tdfilter(c,e,tp)
return Card.IsAbleToDeck(c) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end
function c74500013.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstMatchingCard(c74500013.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) then
Duel.BreakEffect()
local sg=Duel.SelectMatchingCard(tp,c74500013.tdfilter,tp,LOCATION_HAND,0,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
function c74500013.decon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return rc~=c and rc:IsControler(tp) and rc:IsOnField() and rc:IsAttribute(ATTRIBUTE_LIGHT) and rc:IsSetCard(0x745) and re:IsActiveType(TYPE_MONSTER) and Duel.GetFlagEffect(tp,74500013)==0
end
function c74500013.decost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.RegisterFlagEffect(tp,84500013,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c74500013.detg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c74500013.deop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if dg:GetCount()>0 then
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
--全力除灵☆!
function c74500501.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74500501)
e1:SetCondition(c74500501.rmcon)
e1:SetTarget(c74500501.rmtg)
e1:SetOperation(c74500501.rmop)
c:RegisterEffect(e1)
--recycle
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,84500501)
e2:SetTarget(c74500501.thtg)
e2:SetOperation(c74500501.thop)
c:RegisterEffect(e2)
end
function c74500501.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
end
function c74500501.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c74500501.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x745) and c:IsType(TYPE_MONSTER)
end
function c74500501.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
Duel.BreakEffect()
if Duel.SelectYesNo(tp,aux.Stringid(74500501,0)) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74500501.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74500501.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()==1 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c74500501.thfilter(c)
return c:IsSetCard(0x745) and c:IsAbleToHand() and not c:IsCode(74500501)
end
function c74500501.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74500501.thfilter,tp,LOCATION_REMOVED,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function c74500501.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74500501.filter,tp,LOCATION_REMOVED,0,1,1,e:GetHandler())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--星光
function c74500602.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74500602,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74500602)
e1:SetTarget(c74500602.thtg)
e1:SetOperation(c74500602.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74500602,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,74500602)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c74500602.sptg)
e2:SetOperation(c74500602.spop)
c:RegisterEffect(e2)
end
function c74500602.thfilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c74500602.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c74500602.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74500602.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c74500602.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=tg:GetFirst()
if not tc then return end
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
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(c74500602.sumlimit)
e1:SetLabel(tc:GetCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c74500602.sumlimit(e,c)
return c:IsCode(e:GetLabel())
end
function c74500602.spfilter(c,e,tp)
return c:IsSetCard(0x745) and c:IsType(TYPE_DUAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74500602.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c74500602.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c74500602.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c74500602.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c74500602.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,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)
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)
end
Duel.SpecialSummonComplete()
end
--旁观者
function c74500702.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74500702+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCondition(c74500702.condition1)
e1:SetCost(c74500702.cost1)
e1:SetTarget(c74500702.target)
e1:SetOperation(c74500702.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(c74500702.condition2)
e2:SetCost(c74500702.cost2)
c:RegisterEffect(e2)
end
function c74500702.condition1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74500702.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c74500702.condition2(e,tp,eg,ep,ev,re,r,rp)
return aux.dscon() and Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74500702.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Recover(tp,1000,REASON_COST)
end
function c74500702.dfilter(c)
return c:IsReleasableByEffect() and c:IsSetCard(0x745) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_DUAL)
end
function c74500702.rfilter(c)
return c:IsReleasableByEffect() and c:IsSetCard(0x745) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_RITUAL)
end
function c74500702.exfilter(c)
return c:IsReleasableByEffect() and c:IsSetCard(0x745) and c:IsType(TYPE_MONSTER) and c:IsSummonLocation(LOCATION_EXTRA)
end
function c74500702.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(c74500702.dfilter,tp,LOCATION_MZONE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(c74500702.rfilter,tp,LOCATION_MZONE,0,1,nil)
local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(c74500702.exfilter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return b1 or b2 or b3 end
end
function c74500702.operation(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(c74500702.dfilter,tp,LOCATION_MZONE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(c74500702.rfilter,tp,LOCATION_MZONE,0,1,nil)
local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(c74500702.exfilter,tp,LOCATION_MZONE,0,1,nil)
if not (b1 or b2 or b3) then return end
local d=0
local r=0
local ex=0
--release
local sg=Group.CreateGroup()
repeat
if b1 and Duel.SelectYesNo(tp,aux.Stringid(74500702,0)) then
local dsg=Duel.SelectReleaseGroup(tp,c74500702.dfilter,1,1,nil,tp)
sg:Merge(dsg)
d=1
end
if b2 and Duel.SelectYesNo(tp,aux.Stringid(74500702,1)) then
local rsg=Duel.SelectReleaseGroup(tp,c74500702.rfilter,1,1,nil,tp)
sg:Merge(rsg)
r=1
end
if b3 and Duel.SelectYesNo(tp,aux.Stringid(74500702,2)) then
local esg=Duel.SelectReleaseGroup(tp,c74500702.exfilter,1,1,nil,tp)
sg:Merge(esg)
ex=1
end
until sg:GetCount()>0
Duel.Release(sg,REASON_EFFECT)
Duel.BreakEffect()
--dual
if d==1 then
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
if tc:IsType(TYPE_MONSTER) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UNRELEASABLE_NONSUM)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e2:SetValue(c74500702.fuslimit)
tc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e5)
end
end
end
--ritual
if r==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rc=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)
end
--extra
if ex==1 then
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
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+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
end
function c74500702.fuslimit(e,c,st)
return st==SUMMON_TYPE_FUSION
end
--奇迹变身☆魔法人偶
function c74500721.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,74500721)
e1:SetTarget(c74500721.target)
e1:SetOperation(c74500721.activate)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,74500721)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c74500721.sutg)
e2:SetOperation(c74500721.suop)
c:RegisterEffect(e2)
end
function c74500721.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x745) and c:IsLevelAbove(1)
and Duel.IsExistingMatchingCard(c74500721.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLevel(),c:GetAttribute())
end
function c74500721.spfilter(c,e,tp,lv,attr)
return c:IsLevel(lv) and not c:IsAttribute(attr) and c:IsSetCard(0x745)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c74500721.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c74500721.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c74500721.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c74500721.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c74500721.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local attr=tc:GetAttribute()
local lv=tc:GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74500721.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv,attr)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c74500721.sutg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=0
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_SET_SUMMON_COUNT_LIMIT)}
for _,te in ipairs(ce) do
ct=math.max(ct,te:GetValue())
end
return ct<2
end
end
function c74500721.suop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(2)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--神之光·祭月修女
function c74501015.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c74501015.splimit)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c74501015.regcon)
e2:SetOperation(c74501015.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74501015,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,74501015)
e3:SetCondition(c74501015.secon)
e3:SetTarget(c74501015.setg)
e3:SetOperation(c74501015.seop)
c:RegisterEffect(e3)
--recover
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(74501015,1))
e4:SetCategory(CATEGORY_RECOVER)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,38301015)
e4:SetTarget(c74501015.rectg)
e4:SetOperation(c74501015.recop)
c:RegisterEffect(e4)
end
function c74501015.splimit(e,se,sp,st)
return st&SUMMON_TYPE_RITUAL~=SUMMON_TYPE_RITUAL or (se and se:GetHandler():IsSetCard(0x745))
end
function c74501015.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_RELEASE) and e:GetHandler():IsReason(REASON_EFFECT)
end
function c74501015.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(74501015,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c74501015.secon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(74501015)>0
end
function c74501015.sefilter(c)
if not (c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL)) then return false end
return c:IsAbleToHand() or c:IsSSetable()
end
function c74501015.setg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74501015.sefilter,tp,LOCATION_DECK,0,1,nil) end
end
function c74501015.seop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c74501015.sefilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:IsSSetable() or Duel.SelectOption(tp,1190,1153)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SSet(tp,tc)
end
end
end
function c74501015.recfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL)
end
function c74501015.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74501015.recfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local ct=Duel.GetMatchingGroupCount(c74501015.recfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*1000)
end
function c74501015.recop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=Duel.GetMatchingGroupCount(c74501015.recfilter,p,LOCATION_MZONE,LOCATION_MZONE,nil)
if ct>0 then
Duel.Recover(p,ct*1000,REASON_EFFECT)
end
end
--恶魔庇护之翼
function c74501303.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74501303)
e1:SetCost(c74501303.cost)
e1:SetCondition(c74501303.condition)
e1:SetTarget(c74501303.target)
e1:SetOperation(c74501303.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,74501303)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c74501303.thtg)
e2:SetOperation(c74501303.thop)
c:RegisterEffect(e2)
end
function c74501303.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,74534626) end
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,74534626)
Duel.Release(g,REASON_COST)
end
function c74501303.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c74501303.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c74501303.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c74501303.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if tc:IsType(TYPE_DUAL) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DUAL_STATUS)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_DUAL))
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
elseif tc:IsType(TYPE_RITUAL) then
Duel.BreakEffect()
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
elseif tc:IsType(TYPE_LINK) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
tc:RegisterEffect(e2)
elseif tc:IsType(TYPE_XYZ) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsCanOverlay),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.Overlay(tc,g)
elseif tc:IsType(TYPE_SYNCHRO) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetTargetRange(1,0)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
elseif tc:IsType(TYPE_FUSION) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetCondition(c74501303.actcon)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c74501303.efilter(e,te)
return not te:GetOwner():IsSetCard(0x745)
end
function c74501303.actcon(e)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c74501303.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x745) and c:IsAbleToHand()
end
function c74501303.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c74501303.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74501303.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c74501303.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c74501303.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--不可视界限
function c74501502.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--move
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74501502,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetTarget(c74501502.seqtg1)
e1:SetOperation(c74501502.seqop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(74501502,1))
e2:SetTarget(c74501502.seqtg2)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_SELF_TOGRAVE)
e3:SetCondition(c74501502.tgcon)
c:RegisterEffect(e3)
--tohand/spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(74501502,3))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,74501502)
e4:SetCost(c74501502.thcost)
e4:SetTarget(c74501502.thtg)
e4:SetOperation(c74501502.thop)
c:RegisterEffect(e4)
end
function c74501502.rfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end
function c74501502.lfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsType(TYPE_MONSTER)
end
function c74501502.seqtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c74501502.rfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74501502.rfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(74501502,2))
Duel.SelectTarget(tp,c74501502.rfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c74501502.seqtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c74501502.lfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74501502.lfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(74501502,2))
Duel.SelectTarget(tp,c74501502.lfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c74501502.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)<=0 then return end
c:AddCounter(0x1746,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
function c74501502.cfilter(c)
return c:IsSetCard(0x745) and c:IsAbleToDeckOrExtraAsCost()
end
function c74501502.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x1746)==2
end
function c74501502.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckAsCost() and Duel.IsExistingMatchingCard(c74501502.cfilter,tp,LOCATION_GRAVE,0,2,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c74501502.cfilter,tp,LOCATION_GRAVE,0,2,2,c)
g:AddCard(c)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c74501502.thfilter(c)
return c:IsCode(74516549) and c:IsAbleToHand()
end
function c74501502.filter(c)
return c:IsCode(74546765)
end
function c74501502.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local res=Duel.IsExistingMatchingCard(c74501502.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
return Duel.IsExistingMatchingCard(c74501502.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,res)
end
end
function c74501502.thop(e,tp,eg,ep,ev,re,r,rp)
local res=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c74501502.filter,tp,LOCATION_MZONE,0,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c74501502.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,res):GetFirst()
if tc then
if res and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
tc:EnableDualState()
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
end
--希望蔷薇
function c74502003.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--copy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74502003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1,74502003)
e1:SetCondition(c74502003.cpcon)
e1:SetCost(c74502003.cpcost)
e1:SetTarget(c74502003.cptg)
e1:SetOperation(c74502003.cpop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74502003,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,84502003)
e2:SetCondition(c74502003.thcon)
e2:SetTarget(c74502003.thtg)
e2:SetOperation(c74502003.thop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(74502003,ACTIVITY_CHAIN,aux.FilterBoolFunction(aux.NOT(Effect.IsActiveType),TYPE_MONSTER))
end
function c74502003.cpcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c74502003.cpfilter(c)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_RITUAL) and c:IsAbleToGraveAsCost() and c:IsSetCard(0x745)
and c:CheckActivateEffect(false,true,false)~=nil
end
function c74502003.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c74502003.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(c74502003.cpfilter,tp,LOCATION_DECK,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c74502003.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)
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 c74502003.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 c74502003.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(74502003,1-tp,ACTIVITY_CHAIN)~=0
end
function c74502003.thfilter(c)
return c:IsSetCard(0x745) and c:IsAbleToHand()
end
function c74502003.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c74502003.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74502003.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74502003.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
--理论
function c74502602.initial_effect(c)
--announce
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ANNOUNCE+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74502602+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c74502602.cost)
e1:SetTarget(c74502602.target)
e1:SetOperation(c74502602.operation)
c:RegisterEffect(e1)
end
function c74502602.cfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToRemoveAsCost()
end
function c74502602.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74502602.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c74502602.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c74502602.filter(c,e,tp)
return c:IsSetCard(0x745) and c:IsType(TYPE_MONSTER) and (c:IsAbleToHand() or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c74502602.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1)
and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
getmetatable(e:GetHandler()).announce_filter={TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK,OPCODE_ISTYPE,OPCODE_NOT}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c74502602.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst()
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if tc:IsCode(ac) and tc:IsAbleToHand() then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
local g=Duel.GetMatchingGroup(c74502602.filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(74502602,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
local b1=sc:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,1190,1152)
elseif b1 then op=0
else op=1 end
if op==0 then
Duel.SendtoHand(sc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
else
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
if sc:IsType(TYPE_DUAL) then
sc:EnableDualState()
end
end
else
Duel.DisableShuffleCheck()
end
Duel.ShuffleHand(tp)
else
Duel.DisableShuffleCheck()
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_REVEAL)
end
end
--人偶·阿卡赛特
function c74512926.initial_effect(c)
aux.EnableDualAttribute(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74512926,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c74512926.discon1)
e1:SetCost(c74512926.cost1)
e1:SetTarget(c74512926.distg)
e1:SetOperation(c74512926.disop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(c74512926.discon2)
e2:SetCost(c74512926.cost2)
c:RegisterEffect(e2)
end
function c74512926.discon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and rp==1-tp and Duel.IsChainNegatable(ev) and not Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74512926.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
end
function c74512926.discon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and rp==1-tp and Duel.IsChainNegatable(ev) and aux.dscon() and Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74512926.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Recover(tp,1000,REASON_COST)
end
function c74512926.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function c74512926.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
--人偶·欧若拉
function c74514435.initial_effect(c)
aux.EnableDualAttribute(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74514435,0))
e1:SetCategory(CATEGORY_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_SSET+TIMING_SUMMON+TIMING_SPSUMMON+TIMING_MAIN_END)
e1:SetCondition(c74514435.sucon1)
e1:SetCost(c74514435.sucost1)
e1:SetTarget(c74514435.sutg)
e1:SetOperation(c74514435.suop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(c74514435.sucon2)
e2:SetCost(c74514435.sucost2)
c:RegisterEffect(e2)
end
function c74514435.sucon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and not Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74514435.sucost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c74514435.sucon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and aux.dscon() and Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74514435.sucost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Recover(tp,1000,REASON_COST)
end
function c74514435.filter(c)
return c:IsSummonable(true,nil) or c:IsMSetable(true,nil)
end
function c74514435.sutg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74514435.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c74514435.suop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(dg)
if Duel.Destroy(dg,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c74514435.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsSummonable(true,nil) and (not tc:IsMSetable(true,nil)
or Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) then
Duel.Summon(tp,tc,true,nil)
else Duel.MSet(tp,tc,true,nil) end
end
end
end
--人偶·叶隐琉璃
function c74514436.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetDescription(aux.Stringid(74514436,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,74514436)
e1:SetCondition(c74514436.thcon)
e1:SetTarget(c74514436.thtg)
e1:SetOperation(c74514436.thop)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74514436,1))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,84514436)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c74514436.sucost)
e2:SetTarget(c74514436.sutg)
e2:SetOperation(c74514436.suop)
c:RegisterEffect(e2)
end
function c74514436.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_EFFECT)
end
function c74514436.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_RITUAL) and c:IsSetCard(0x745) and c:IsAbleToHand()
end
function c74514436.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c74514436.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74514436.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c74514436.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c74514436.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function c74514436.sucost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
function c74514436.sufilter(c)
return c:IsSummonable(true,nil)
end
function c74514436.sutg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74514436.sufilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c74514436.suop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c74514436.sufilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
--人偶·西勒诺斯
function c74514534.initial_effect(c)
aux.EnableDualAttribute(c)
--look
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74514534,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c74514534.con1)
e1:SetCost(c74514534.cost1)
e1:SetTarget(c74514534.target)
e1:SetOperation(c74514534.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(c74514534.con2)
e2:SetCost(c74514534.cost2)
c:RegisterEffect(e2)
end
function c74514534.con1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and not Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74514534.cost1(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 c74514534.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and aux.dscon() and Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74514534.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Recover(tp,1000,REASON_COST)
end
function c74514534.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=2 and Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>=2 end
end
function c74514534.operation(e,tp,eg,ep,ev,re,r,rp)
local d1=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local d2=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
if #d1==0 or #d2==0 then return end
Duel.ConfirmCards(tp,d2)
Duel.ConfirmCards(1-tp,d1)
Duel.BreakEffect()
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=2 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(74514534,1))
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,SEQ_DECKTOP)
Duel.ConfirmDecktop(tp,1)
end
if Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>=2 then
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(74514534,1))
local tc2=Duel.SelectMatchingCard(1-tp,nil,1-tp,LOCATION_DECK,0,1,1,nil):GetFirst()
Duel.ShuffleDeck(1-tp)
Duel.MoveSequence(tc2,SEQ_DECKTOP)
Duel.ConfirmDecktop(1-tp,1)
end
end
--人偶·朔耶真子
function c74514738.initial_effect(c)
aux.EnableDualAttribute(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74514738,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetCondition(aux.IsDualState)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c74514738.sptg)
e1:SetOperation(c74514738.spop)
c:RegisterEffect(e1)
end
function c74514738.spfilter(c,e,tp)
return c:IsSetCard(0x745) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74514738.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74514738.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_HAND+LOCATION_GRAVE)
end
function c74514738.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c74514738.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--人偶·梦咲音月
function c74515141.initial_effect(c)
aux.EnableDualAttribute(c)
--copy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74515141,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCondition(aux.IsDualState)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c74515141.cpcost)
e1:SetTarget(c74515141.cptg)
e1:SetOperation(c74515141.cpop)
c:RegisterEffect(e1)
end
function c74515141.cpfilter(c)
return c:IsType(TYPE_SPELL) and not c:IsType(TYPE_CONTINUOUS) and c:IsAbleToGraveAsCost() and c:IsSetCard(0x745)
and c:CheckActivateEffect(false,true,false)~=nil
end
function c74515141.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c74515141.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(c74515141.cpfilter,tp,LOCATION_DECK,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c74515141.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)
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 c74515141.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 c74515545.initial_effect(c)
aux.EnableDualAttribute(c)
--counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74515545,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCondition(c74515545.con1)
e1:SetCost(c74515545.ctcost1)
e1:SetTarget(c74515545.cttg)
e1:SetOperation(c74515545.ctop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(c74515545.con2)
e2:SetCost(c74515545.ctcost2)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74515545,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetCondition(aux.IsDualState)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c74515545.sptg)
e3:SetOperation(c74515545.spop)
c:RegisterEffect(e3)
end
function c74515545.con1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and not Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74515545.ctcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c74515545.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and aux.dscon() and Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74515545.ctcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Recover(tp,1000,REASON_COST)
end
function c74515545.ctfilter(c)
return c:IsCanAddCounter(0x1745,1) and c:IsFaceup()
end
function c74515545.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74515545.ctfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function c74515545.ctop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c74515545.ctfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g then
g:GetFirst():AddCounter(0x1745,1)
end
end
function c74515545.spfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x745) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74515545.rlfilter(c,tp)
return c:GetCounter(0x1745)>0 and c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0
end
function c74515545.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74515545.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c74515545.rlfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,nil,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function c74515545.spop(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74515545.rlfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp) end
local tc=Duel.SelectMatchingCard(tp,c74515545.rlfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp):GetFirst()
Duel.Release(tc,REASON_EFFECT)
Duel.BreakEffect()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74515545.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c74515545.splimit)
Duel.RegisterEffect(e1,tp)
end
function c74515545.splimit(e,c)
return not c:IsSetCard(0x745)
end
--人偶·安德莉亚
function c74515546.initial_effect(c)
aux.EnableDualAttribute(c)
--position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74515546,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1)
e1:SetCondition(aux.IsDualState)
e1:SetTarget(c74515546.settg)
e1:SetOperation(c74515546.setop)
c:RegisterEffect(e1)
end
function c74515546.cfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c74515546.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c74515546.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74515546.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c74515546.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c74515546.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
--人偶·敖绫
function c74515550.initial_effect(c)
aux.EnableDualAttribute(c)
--position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74515550,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_CONFIRM)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(aux.IsDualState)
e1:SetTarget(c74515550.postg)
e1:SetOperation(c74515550.posop)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetCondition(aux.IsDualState)
c:RegisterEffect(e2)
end
function c74515550.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c74515550.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74515550.posfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c74515550.posfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c74515550.posop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c74515550.posfilter,tp,0,LOCATION_MZONE,nil)
if g1:GetCount()>0 then
Duel.ChangePosition(g1,POS_FACEDOWN_DEFENSE)
end
end
--人偶·星见亚砂
function c74515847.initial_effect(c)
aux.EnableDualAttribute(c)
--sort
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74515847,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCondition(aux.IsDualState)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c74515847.sttg)
e1:SetOperation(c74515847.stop)
c:RegisterEffect(e1)
end
function c74515847.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>2 end
end
function c74515847.stop(e,tp,eg,ep,ev,re,r,rp)
Duel.SortDecktop(tp,1-tp,3)
Duel.BreakEffect()
if Duel.SelectYesNo(tp,aux.Stringid(74515847,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
local ac=Duel.AnnounceCard(tp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetTarget(c74515847.distg)
e1:SetLabel(ac)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCondition(c74515847.discon)
e2:SetOperation(c74515847.disop)
e2:SetLabel(ac)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c74515847.distg)
e3:SetLabel(ac)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
end
end
function c74515847.distg(e,c)
local ac=e:GetLabel(ac)
return c:IsOriginalCodeRule(ac)
end
function c74515847.discon(e,tp,eg,ep,ev,re,r,rp)
local ac=e:GetLabel(ac)
return re:GetHandler():IsOriginalCodeRule(ac)
end
function c74515847.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--人偶·贞德
function c74515848.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74515848,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1,74515848)
e1:SetCondition(c74515848.spcon)
e1:SetTarget(c74515848.sptg)
e1:SetOperation(c74515848.spop)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74515848,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,84515848)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c74515848.sutg)
e2:SetOperation(c74515848.suop)
c:RegisterEffect(e2)
end
function c74515848.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c74515848.rfilter(c)
return c:IsFaceup() and c:IsSetCard(0x745) and c:IsReleasableByEffect()
end
function c74515848.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c74515848.rfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74515848.rfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectTarget(tp,c74515848.rfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c74515848.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Release(tc,REASON_EFFECT)~=0 then
if c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
end
end
end
function c74515848.sufilter(c)
return c:IsSummonable(true,nil)
end
function c74515848.sutg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74515848.sufilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c74515848.suop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.HintSelection(dg)
if Duel.Destroy(dg,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c74515848.sufilter,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
--人偶·密丝特
function c74516045.initial_effect(c)
aux.EnableDualAttribute(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74516045,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_SSET+TIMING_END_PHASE)
e1:SetCondition(c74516045.con1)
e1:SetCost(c74516045.rmcost1)
e1:SetTarget(c74516045.rmtg)
e1:SetOperation(c74516045.rmop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(c74516045.con2)
e2:SetCost(c74516045.rmcost2)
c:RegisterEffect(e2)
end
function c74516045.con1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and not Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74516045.rmcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c74516045.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and aux.dscon() and Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74516045.rmcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Recover(tp,1000,REASON_COST)
end
function c74516045.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_ONFIELD)
end
function c74516045.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
end
end
--人偶·萨缇娅
function c74516050.initial_effect(c)
aux.EnableDualAttribute(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_SSET+TIMING_END_PHASE)
e1:SetCondition(c74516050.con1)
e1:SetCost(c74516050.decost1)
e1:SetTarget(c74516050.detg)
e1:SetOperation(c74516050.deop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(c74516050.con2)
e2:SetCost(c74516050.decost2)
c:RegisterEffect(e2)
end
function c74516050.con1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and not Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74516050.decost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c74516050.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and aux.dscon() and Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74516050.decost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Recover(tp,1000,REASON_COST)
end
function c74516050.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsFaceup()
end
function c74516050.detg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c74516050.filter,tp,0,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(c74516050.filter,tp,0,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c74516050.deop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c74516050.filter,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
--人偶·越一弥心
function c74516146.initial_effect(c)
aux.EnableDualAttribute(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74516146,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c74516146.con1)
e1:SetCost(c74516146.descost1)
e1:SetTarget(c74516146.destg)
e1:SetOperation(c74516146.desop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(c74516146.con2)
e2:SetCost(c74516146.descost2)
c:RegisterEffect(e2)
end
function c74516146.con1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and not Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74516146.descost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c74516146.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and aux.dscon() and Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74516146.descost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Recover(tp,1000,REASON_COST)
end
function c74516146.desfilter(c,g)
return g:IsContains(c)
end
function c74516146.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=e:GetHandler():GetColumnGroup()
local g=Duel.GetMatchingGroup(c74516146.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c74516146.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cg=c:GetColumnGroup()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local g=Duel.GetMatchingGroup(c74516146.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,cg)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
end
--人偶·伊汐尔
function c74516153.initial_effect(c)
--to grave/special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,74516153)
e1:SetTarget(c74516153.tgtg)
e1:SetOperation(c74516153.tgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--ritual level
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_RITUAL_LEVEL)
e3:SetValue(c74516153.rlevel)
c:RegisterEffect(e3)
end
function c74516153.filter(c,ct,e,tp)
return c:IsSetCard(0x745) and c:IsType(TYPE_MONSTER) and ((c:IsAbleToGrave() and ct==1) or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ct==2))
end
function c74516153.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=0
if e:GetHandler():IsAttackPos() then
ct=1
elseif e:GetHandler():IsDefensePos() then
ct=2
end
if chk==0 then return Duel.IsExistingMatchingCard(c74516153.filter,tp,LOCATION_DECK,0,1,nil,ct,e,tp) end
if ct==1 then
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
elseif ct==2 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
end
function c74516153.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ct=0
if c:IsAttackPos() then
ct=1
elseif c:IsDefensePos() then
ct=2
end
if ct==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c74516153.filter,tp,LOCATION_DECK,0,1,1,nil,ct,e,tp)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
elseif ct==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74516153.filter,tp,LOCATION_DECK,0,1,1,nil,ct,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c74516153.rlevel(e,c)
local lv=aux.GetCappedLevel(e:GetHandler())
if c:IsLevel(8) and c:IsSetCard(0x745) then
local clv=c:GetLevel()
return (lv<<16)+clv
else return lv end
end
--人偶·柯露雪儿
function c74516251.initial_effect(c)
aux.EnableDualAttribute(c)
--copy effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74516251,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,74516251)
e1:SetCondition(aux.IsDualState)
e1:SetCost(c74516251.copycost)
e1:SetTarget(c74516251.copytg)
e1:SetOperation(c74516251.copyop)
c:RegisterEffect(e1)
end
function c74516251.copycost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(41209827)==0 end
e:GetHandler():RegisterFlagEffect(41209827,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c74516251.copyfilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_TOKEN) and c:IsFaceup()
end
function c74516251.copytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c74516251.copyfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c74516251.copyfilter,tp,LOCATION_MZONE,nil,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c74516251.copyfilter,tp,LOCATION_MZONE,nil,1,1,c)
end
function c74516251.copyop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local code=tc:GetOriginalCodeRule()
local cid=0
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)
if not tc:IsType(TYPE_TRAPMONSTER) then
cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,1)
end
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74516251,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetLabelObject(e1)
e2:SetLabel(cid)
e2:SetOperation(c74516251.rstop)
c:RegisterEffect(e2)
end
end
function c74516251.rstop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cid=e:GetLabel()
if cid~=0 then
c:ResetEffect(cid,RESET_COPY)
c:ResetEffect(RESET_DISABLE,RESET_EVENT)
end
local e1=e:GetLabelObject()
e1:Reset()
Duel.HintSelection(Group.FromCards(c))
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
--人偶·艾妮斯
function c74516252.initial_effect(c)
aux.EnableDualAttribute(c)
--control
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74516252,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(aux.IsDualState)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_SUMMON+TIMING_SPSUMMON+TIMING_END_PHASE)
e1:SetCountLimit(1)
e1:SetCost(c74516252.cost)
e1:SetTarget(c74516252.target)
e1:SetOperation(c74516252.activate)
c:RegisterEffect(e1)
end
function c74516252.cfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToRemoveAsCost()
end
function c74516252.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74516252.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c74516252.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c74516252.filter(c,check)
return c:IsControlerCanBeChanged(check)
end
function c74516252.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local check=e:GetLabel()==100
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c74516252.filter,tp,0,LOCATION_MZONE,1,nil,check)
end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,0,0)
end
function c74516252.filter2(c)
return c:IsControlerCanBeChanged()
end
function c74516252.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectMatchingCard(tp,c74516252.filter2,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.GetControl(tc,tp,PHASE_END,1)
end
end
--人偶·薇姬娜
function c74516355.initial_effect(c)
aux.EnableDualAttribute(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74516355,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c74516355.con1)
e1:SetCost(c74516355.cost1)
e1:SetTarget(c74516355.thtg)
e1:SetOperation(c74516355.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(c74516355.con2)
e2:SetCost(c74516355.cost2)
c:RegisterEffect(e2)
end
function c74516355.con1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and not Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74516355.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c74516355.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and aux.dscon() and Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74516355.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Recover(tp,1000,REASON_COST)
end
function c74516355.thfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c74516355.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x745) and c:IsType(TYPE_MONSTER)
end
function c74516355.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c74516355.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74516355.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c74516355.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c74516355.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(74516355,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74516355.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()==1 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--人偶·德莱洁恩
function c74516549.initial_effect(c)
aux.EnableDualAttribute(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74516549,0))
e1:SetHintTiming(0,TIMING_BATTLE_PHASE+TIMING_END_PHASE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCondition(c74516549.con1)
e1:SetCost(c74516549.spcost1)
e1:SetTarget(c74516549.sptg)
e1:SetOperation(c74516549.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(c74516549.con2)
e2:SetCost(c74516549.spcost2)
c:RegisterEffect(e2)
end
function c74516549.con1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and not Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74516549.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c74516549.con2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsDualState() and aux.dscon() and Duel.IsPlayerAffectedByEffect(tp,74590055)
end
function c74516549.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Recover(tp,1000,REASON_COST)
end
function c74516549.spfilter(c,e,tp)
return c:IsSetCard(0x745) and not c:IsCode(74516549) and c:IsLevelBelow(4) and c:IsType(TYPE_DUAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74516549.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74516549.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c74516549.thfilter(c)
return c:IsSetCard(0x745) and c:IsAbleToHand()
end
function c74516549.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,c74516549.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsExistingMatchingCard(c74516549.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(74516549,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74516549.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
end
end
--人偶·莉莉艾洛
function c74516555.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetDescription(aux.Stringid(74516555,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,74516555)
e1:SetCondition(c74516555.thcon)
e1:SetTarget(c74516555.thtg)
e1:SetOperation(c74516555.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74516555,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,84516555)
e2:SetCondition(c74516555.spcon)
e2:SetTarget(c74516555.sptg)
e2:SetOperation(c74516555.spop)
c:RegisterEffect(e2)
end
function c74516555.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_EFFECT)
end
function c74516555.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x745) and c:IsAbleToHand()
end
function c74516555.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c74516555.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74516555.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c74516555.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c74516555.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function c74516555.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_REMOVED) and e:GetHandler():IsReason(REASON_EFFECT)
end
function c74516555.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 c74516555.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 c74516653.initial_effect(c)
aux.EnableDualAttribute(c)
--to hand/set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74516653,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(aux.IsDualState)
e1:SetCost(c74516653.thcost)
e1:SetTarget(c74516653.thtg)
e1:SetOperation(c74516653.thop)
c:RegisterEffect(e1)
end
function c74516653.cfilter(c)
return c:IsSetCard(0x745) and c:IsAbleToRemoveAsCost()
end
function c74516653.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74516653.cfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c74516653.cfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c74516653.thfilter(c)
if not (c:IsSetCard(0x745) and c:IsType(TYPE_SPELL+TYPE_TRAP)) then return false end
return c:IsAbleToHand() or c:IsSSetable()
end
function c74516653.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74516653.thfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c74516653.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c74516653.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:IsSSetable() or Duel.SelectOption(tp,1190,1153)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SSet(tp,tc)
end
end
end
--人偶·米涅德温
function c74516856.initial_effect(c)
aux.EnableDualAttribute(c)
--copy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74516856,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_BATTLE_START)
e1:SetCountLimit(1)
e1:SetCondition(c74516856.condition)
e1:SetCost(c74516856.cost)
e1:SetTarget(c74516856.target)
e1:SetOperation(c74516856.operation)
c:RegisterEffect(e1)
end
function c74516856.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
return c:IsDualState() and (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) and Duel.GetTurnPlayer()==tp
end
function c74516856.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(74516856)==0 end
e:GetHandler():RegisterFlagEffect(74516856,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c74516856.copyfilter(c)
return c:IsFaceup() and not c:IsType(TYPE_TOKEN)
end
function c74516856.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c74516856.copyfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74516856.copyfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c74516856.copyfilter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c74516856.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsType(TYPE_TOKEN) then
local code=tc:GetOriginalCodeRule()
local cid=0
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)
if not tc:IsType(TYPE_TRAPMONSTER) then
cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,1)
end
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74516856,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetLabelObject(e1)
e2:SetLabel(cid)
e2:SetOperation(c74516856.rstop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(0)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
end
end
function c74516856.rstop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cid=e:GetLabel()
if cid~=0 then
c:ResetEffect(cid,RESET_COPY)
c:ResetEffect(RESET_DISABLE,RESET_EVENT)
end
local e1=e:GetLabelObject()
e1:Reset()
Duel.HintSelection(Group.FromCards(c))
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
--人偶·南宫凛
function c74516857.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74516857,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c74516857.spcon)
e1:SetTarget(c74516857.sptg)
e1:SetOperation(c74516857.spop)
c:RegisterEffect(e1)
--atk limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetValue(c74516857.atlimit)
c:RegisterEffect(e3)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_GRAVE)
e4:SetTarget(c74516857.reptg)
e4:SetValue(c74516857.repval)
e4:SetOperation(c74516857.repop)
c:RegisterEffect(e4)
end
function c74516857.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT))
end
function c74516857.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c74516857.cfilter,1,e:GetHandler(),tp)
end
function c74516857.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 c74516857.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e2)
end
end
function c74516857.atlimit(e,c)
return c:IsFaceup() and c:IsSetCard(0x745) and c~=e:GetHandler()
end
function c74516857.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x745) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c74516857.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c74516857.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c74516857.repval(e,c)
return c74516857.repfilter(c,e:GetHandlerPlayer())
end
function c74516857.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--人偶·尼柯莱特
function c74517054.initial_effect(c)
aux.EnableDualAttribute(c)
--fusion summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74517054,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCondition(aux.IsDualState)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c74517054.fstg)
e1:SetOperation(c74517054.fsop)
c:RegisterEffect(e1)
end
function c74517054.filter0(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_MZONE)) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function c74517054.filter1(c,e)
return (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_MZONE)) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c74517054.filter2(c,e,tp,m,f,chkf)
return 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 c74517054.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(c74517054.filter0,tp,LOCATION_GRAVE+LOCATION_MZONE,0,nil)
local res=Duel.IsExistingMatchingCard(c74517054.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c74517054.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE+LOCATION_MZONE)
end
function c74517054.fsop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c74517054.filter1),tp,LOCATION_GRAVE+LOCATION_MZONE,0,nil,e)
local sg1=Duel.GetMatchingGroup(c74517054.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c74517054.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,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
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
tc:SetMaterial(mat)
if mat:IsExists(Card.IsFacedown,1,nil) then
local cg=mat:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(mat,nil,2,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,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--人偶·天音祈
function c74517055.initial_effect(c)
aux.EnableDualAttribute(c)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74517055,0))
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCondition(aux.IsDualState)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c74517055.cost)
e1:SetTarget(c74517055.tdtg)
e1:SetOperation(c74517055.tdop)
c:RegisterEffect(e1)
end
function c74517055.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,1,1,nil)
if g:GetFirst():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,g)
end
Duel.SendtoDeck(g,tp,2,REASON_COST)
end
function c74517055.tdfilter(c)
return c:IsLocation(LOCATION_ONFIELD) and c:IsFaceup() and c:IsAbleToDeck()
end
function c74517055.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c74517055.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,LOCATION_ONFIELD)
end
function c74517055.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c74517055.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
--人偶·拉薇拉
function c74517057.initial_effect(c)
--to grave and spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74517057,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,74517057)
e1:SetCost(c74517057.tgcost)
e1:SetTarget(c74517057.tgtg)
e1:SetOperation(c74517057.tgop)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74517057,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,84517057)
e2:SetTarget(c74517057.tktg)
e2:SetOperation(c74517057.tkop)
c:RegisterEffect(e2)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74517057,2))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,94517057)
e1:SetCost(c74517057.decost)
e1:SetTarget(c74517057.detg)
e1:SetOperation(c74517057.deop)
c:RegisterEffect(e1)
end
function c74517057.costfilter(c,ec,e,tp)
if not c:IsSetCard(0x745) or not c:IsType(TYPE_MONSTER) or c:IsPublic() then return false end
local g=Group.FromCards(c,ec)
return g:IsExists(c74517057.tgspfilter,1,nil,g,e,tp)
end
function c74517057.tgspfilter(c,g,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and g:IsExists(Card.IsAbleToGrave,1,c)
end
function c74517057.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c74517057.costfilter,tp,LOCATION_HAND,0,1,c,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sc=Duel.SelectMatchingCard(tp,c74517057.costfilter,tp,LOCATION_HAND,0,1,1,c,c,e,tp):GetFirst()
Duel.ConfirmCards(1-tp,sc)
Duel.ShuffleHand(tp)
sc:CreateEffectRelation(e)
e:SetLabelObject(sc)
end
function c74517057.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c74517057.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=e:GetLabelObject()
local g=Group.FromCards(c,sc)
local fg=g:Filter(Card.IsRelateToEffect,nil,e)
if fg:GetCount()~=2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=fg:FilterSelect(tp,c74517057.tgspfilter,1,1,nil,fg,e,tp)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.SendtoGrave(g-sg,REASON_EFFECT)
end
end
function c74517057.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,74510203,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_MACHINE,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c74517057.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,74510203,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_MACHINE,ATTRIBUTE_EARTH) then return end
local token=Duel.CreateToken(tp,74510203)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
token:RegisterEffect(e1,true)
end
function c74517057.decost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,74510203) end
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,74510203)
Duel.Release(g,REASON_COST)
end
function c74517057.detg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c74517057.deop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--森语恶魔·蔬田密友
function c74517172.initial_effect(c)
aux.AddFusionProcFunRep(c,c74517172.ffilter,2,true)
c:EnableReviveLimit()
--cannot be fusion material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e0:SetValue(1)
c:RegisterEffect(e0)
--recover
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74517172,0))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c74517172.reccost)
e1:SetTarget(c74517172.rectg)
e1:SetOperation(c74517172.recop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74517172,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,74517172)
e2:SetCondition(c74517172.spcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c74517172.sptg)
e2:SetOperation(c74517172.spop)
c:RegisterEffect(e2)
end
function c74517172.ffilter(c,fc,sub,mg,sg)
return not sg or sg:FilterCount(aux.TRUE,c)==0
or sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute())
end
function c74517172.reccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c74517172.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c74517172.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,1000,REASON_EFFECT)
end
function c74517172.spcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c74517172.spfilter(c,e,tp)
return c:IsSetCard(0x745) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74517172.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74517172.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c74517172.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,c74517172.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--人偶·月野未夜
function c74517256.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74517256,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,74517256)
e1:SetCondition(c74517256.spcon)
e1:SetTarget(c74517256.sptg1)
e1:SetOperation(c74517256.spop1)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,84517256)
e2:SetCost(c74517256.spcost)
e2:SetTarget(c74517256.sptg2)
e2:SetOperation(c74517256.spop2)
c:RegisterEffect(e2)
end
function c74517256.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
end
function c74517256.sptg1(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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c74517256.spop1(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
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c74517256.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c74517256.splimit(e,c)
return not c:IsSetCard(0x745)
end
function c74517256.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsReleasable() end
Duel.Release(c,REASON_COST)
end
function c74517256.spfilter(c,e,tp)
return c:IsSetCard(0x745) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function c74517256.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c74517256.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c74517256.spop2(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,c74517256.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_ATTACK)
end
end
--卢纳魔术使·迪安娜
function c74520829.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,74546765,c74520829.matfilter,1,true,true)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74520829,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,74520829)
e1:SetCondition(c74520829.thcon)
e1:SetTarget(c74520829.thtg)
e1:SetOperation(c74520829.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,84520829)
e2:SetCost(c74520829.spcost)
e2:SetTarget(c74520829.sptg)
e2:SetOperation(c74520829.spop)
c:RegisterEffect(e2)
end
function c74520829.matfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsLocation(LOCATION_MZONE)
end
function c74520829.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c74520829.thfilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c74520829.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74520829.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74520829.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74520829.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c74520829.filter(c,e,tp)
return not c:IsPublic() and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_SPELLCASTER)
and Duel.IsExistingMatchingCard(c74520829.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c)
end
function c74520829.spfilter(c,e,tp,pc)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevel(pc:GetLevel()) and not c:IsCode(pc:GetCode())
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74520829.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74520829.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c74520829.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
e:SetLabelObject(g:GetFirst())
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c74520829.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked() end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c74520829.spop(e,tp,eg,ep,ev,re,r,rp)
local pc=e:GetLabelObject()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or pc==nil then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c74520829.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,pc):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
if tc:IsType(TYPE_DUAL) then
tc:EnableDualState()
end
end
end
--人偶塑灵·魂芯解放
function c74521513.initial_effect(c)
--Activate
local e1=aux.AddRitualProcEqual2(c,c74521513.filter,LOCATION_DECK,c74521513.filter,aux.FilterBoolFunction(Card.IsLocation,LOCATION_ONFIELD),true)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74521513,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,74521513)
e2:SetCost(aux.bfgcost)
e2:SetCondition(c74521513.setcon)
e2:SetTarget(c74521513.settg)
e2:SetOperation(c74521513.setop)
c:RegisterEffect(e2)
end
function c74521513.filter(c)
return c:IsSetCard(0x745)
end
function c74521513.cfilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function c74521513.setcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.IsExistingMatchingCard(c74521513.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c74521513.setfilter(c)
return c:IsSetCard(0x745) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)) and c:IsSSetable()
end
function c74521513.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74521513.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c74521513.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c74521513.setfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.SSet(tp,tc)
end
end
--以梦想之名·二重歌姬
function c74529401.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,3,c74529401.lcheck)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74529401,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetCountLimit(1,74529401)
e1:SetTarget(c74529401.sptg)
e1:SetOperation(c74529401.spop)
c:RegisterEffect(e1)
--duel status
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DUAL_STATUS)
e2:SetCondition(c74529401.dscon)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c74529401.lcheck(g)
return g:GetClassCount(Card.GetLinkRace)==g:GetCount()
end
function c74529401.spfilter(c,tp)
return c:IsSetCard(0x745) and c:IsType(TYPE_DUAL) and c:CheckUniqueOnField(tp)
end
function c74529401.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c74529401.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c74529401.spfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectTarget(tp,c74529401.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,1,0,0)
end
function c74529401.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e)
and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Equip(tp,c,tc,false)
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c74529401.eqlimit)
c:RegisterEffect(e1)
end
end
end
function c74529401.eqlimit(e,c)
return e:GetOwner()==c
end
function c74529401.dscon(e,ctp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget():IsSetCard(0x745) and e:GetHandler():GetEquipTarget():IsType(TYPE_DUAL)
end
--魔主·罪业红莲
function c74534626.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c74534626.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,74534626)
e2:SetCost(c74534626.spcost)
e2:SetTarget(c74534626.sptg)
e2:SetOperation(c74534626.spop)
c:RegisterEffect(e2)
--activate cost
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
e3:SetCondition(c74534626.costcon)
e3:SetCost(c74534626.costchk)
e3:SetOperation(c74534626.costop)
c:RegisterEffect(e3)
--accumulate
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_FLAG_EFFECT+74534626)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCondition(c74534626.costcon)
e4:SetTargetRange(0,1)
c:RegisterEffect(e4)
end
function c74534626.splimit(e,se,sp,st)
return st&SUMMON_TYPE_RITUAL~=SUMMON_TYPE_RITUAL or (se and se:GetHandler():IsSetCard(0x745))
end
function c74534626.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() end
end
function c74534626.spfilter(c,e,tp)
return c:IsCode(74516050) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74534626.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74534626.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c74534626.tdfilter(c,e,tp)
return Card.IsAbleToDeck(c) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end
function c74534626.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstMatchingCard(c74534626.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) then
Duel.BreakEffect()
local sg=Duel.SelectMatchingCard(tp,c74534626.tdfilter,tp,LOCATION_HAND,0,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
function c74534626.costcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c74534626.costchk(e,te_or_c,tp)
local ct=Duel.GetFlagEffect(tp,74534626)
return Duel.CheckLPCost(tp,ct*500)
end
function c74534626.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,500)
end
--净世法印·光明云
function c74536108.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c74536108.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,74536108)
e2:SetTarget(c74536108.thtg)
e2:SetOperation(c74536108.thop)
c:RegisterEffect(e2)
--synchro limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function c74536108.splimit(e,se,sp,st)
return st&SUMMON_TYPE_RITUAL~=SUMMON_TYPE_RITUAL or (se and se:GetHandler():IsSetCard(0x745))
end
function c74536108.thfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsSetCard(0x745) and c:IsAbleToHand()
end
function c74536108.tdfilter(c,e,tp)
return Card.IsAbleToDeck(c) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end
function c74536108.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74536108.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(c74536108.tdfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c74536108.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c74536108.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
if Duel.IsExistingMatchingCard(c74536108.tdfilter,tp,LOCATION_HAND,0,1,nil) then
Duel.BreakEffect()
local sg=Duel.SelectMatchingCard(tp,c74536108.tdfilter,tp,LOCATION_HAND,0,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
--人偶宣召·月女神雪拉
function c74539103.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c74539103.splimit)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74539103,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,74539103)
e2:SetTarget(c74539103.thtg)
e2:SetOperation(c74539103.thop)
c:RegisterEffect(e2)
--ritual summon
local e3=aux.AddRitualProcEqual2(c,c74539103.rsfilter,LOCATION_HAND+LOCATION_GRAVE,nil,c74539103.matfilter,true,c74539103.extraop)
e3:SetDescription(aux.Stringid(74539103,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCountLimit(1,84539103)
e3:SetCost(c74539103.rscost)
c:RegisterEffect(e3)
--atk
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SET_BASE_ATTACK)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(c74539103.atkval)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(e5)
end
function c74539103.splimit(e,se,sp,st)
return st&SUMMON_TYPE_RITUAL~=SUMMON_TYPE_RITUAL or (se and se:GetHandler():IsSetCard(0x745))
end
function c74539103.thfilter(c)
return c:IsAbleToHand()
end
function c74539103.spfilter(c,e,tp)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x745) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74539103.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return e:GetHandler():IsAbleToHand() and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(c74539103.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and Duel.IsExistingMatchingCard(c74539103.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c74539103.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c74539103.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local rg=Group.FromCards(c,tc)
if Duel.SendtoHand(rg,nil,REASON_EFFECT) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.BreakEffect()
local sg=Duel.SelectMatchingCard(tp,c74539103.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function c74539103.rsfilter(c,e,tp,chk)
return c:IsSetCard(0x745)
end
function c74539103.matfilter(c,e,tp,chk)
return c~=e:GetHandler()
end
function c74539103.rscost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() end
end
function c74539103.tdfilter(c,e,tp)
return Card.IsAbleToDeck(c) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end
function c74539103.extraop(e,tp,eg,ep,ev,re,r,rp,tc,mat)
if not tc then return end
Duel.BreakEffect()
local sg=Duel.SelectMatchingCard(tp,c74539103.tdfilter,tp,LOCATION_HAND,0,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function c74539103.atkfilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_MONSTER)
end
function c74539103.atkval(e,c)
return Duel.GetMatchingGroupCount(c74539103.atkfilter,c:GetControler(),LOCATION_GRAVE,0,nil)*500
end
--人偶·九华
function c74541229.initial_effect(c)
aux.EnableDualAttribute(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(aux.IsDualState)
e1:SetTarget(c74541229.target)
e1:SetOperation(c74541229.operation)
c:RegisterEffect(e1)
end
function c74541229.pfilter(c,tp)
return c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0x745) and not c:IsForbidden()
end
function c74541229.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c74541229.pfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,tp) end
end
function c74541229.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c74541229.pfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end
if Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(74541229,0)) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--光噬·千染群青
function c74541665.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x745),aux.NonTuner(Card.IsSetCard,0x745),1)
c:EnableReviveLimit()
--cannot target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
--summon limit
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74541665,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c74541665.slcon)
e3:SetOperation(c74541665.slop)
c:RegisterEffect(e3)
--attack all
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ATTACK_ALL)
e4:SetValue(1)
c:RegisterEffect(e4)
--remove
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(74541665,1))
e5:SetCategory(CATEGORY_REMOVE)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,74541665)
e5:SetCost(c74541665.rmcost)
e5:SetCondition(c74541665.rmcon1)
e5:SetTarget(c74541665.rmtg)
e5:SetOperation(c74541665.rmop1)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCondition(c74541665.rmcon2)
e6:SetOperation(c74541665.rmop2)
c:RegisterEffect(e6)
end
function c74541665.slcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c74541665.slop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetTargetRange(0,1)
e1:SetTarget(c74541665.sumlimit)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
function c74541665.sumlimit(e,c)
return c:IsAttribute(0x6f)
end
function c74541665.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
if Duel.Remove(c,0,REASON_COST+REASON_TEMPORARY)~=0 then
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_PHASE+PHASE_END)
e0:SetReset(RESET_PHASE+PHASE_END)
e0:SetLabelObject(c)
e0:SetCountLimit(1)
e0:SetOperation(c74541665.retop0)
Duel.RegisterEffect(e0,tp)
end
end
function c74541665.rmcon1(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsAttribute(ATTRIBUTE_LIGHT)
end
function c74541665.rmcon2(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:GetHandler():IsLocation(LOCATION_HAND) and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsAttribute(ATTRIBUTE_LIGHT)
end
function c74541665.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=re:GetHandler()
if chk==0 then return rc:IsRelateToEffect(re) and rc:IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rc,1,0,0)
end
function c74541665.rmop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
if not rc:IsRelateToEffect(re) then return end
if Duel.Remove(rc,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 and rc:IsLocation(LOCATION_REMOVED) then
rc:RegisterFlagEffect(74541665,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(rc)
e1:SetCountLimit(1)
e1:SetCondition(c74541665.retcon)
e1:SetOperation(c74541665.retop1)
Duel.RegisterEffect(e1,tp)
end
end
function c74541665.rmop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
if not rc:IsRelateToEffect(re) then return end
if Duel.Remove(rc,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 and rc:IsLocation(LOCATION_REMOVED) then
rc:RegisterFlagEffect(74541665,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(rc)
e1:SetCountLimit(1)
e1:SetCondition(c74541665.retcon)
e1:SetOperation(c74541665.retop2)
Duel.RegisterEffect(e1,tp)
end
end
function c74541665.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetFlagEffect(74541665)~=0
end
function c74541665.retop0(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
function c74541665.retop1(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
function c74541665.retop2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,tc:GetPreviousControler(),REASON_EFFECT)
end
--独行·未来读破
function c74542246.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c74542246.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,74542246)
e2:SetCost(c74542246.spcost)
e2:SetTarget(c74542246.sptg)
e2:SetOperation(c74542246.spop)
c:RegisterEffect(e2)
--discard
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_HANDES+CATEGORY_COIN)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,74542246)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCost(c74542246.discost)
e3:SetTarget(c74542246.distg)
e3:SetOperation(c74542246.disop)
c:RegisterEffect(e3)
end
c74542246.toss_coin=true
function c74542246.splimit(e,se,sp,st)
return st&SUMMON_TYPE_RITUAL~=SUMMON_TYPE_RITUAL or (se and se:GetHandler():IsSetCard(0x745))
end
function c74542246.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() end
end
function c74542246.spfilter(c,e,tp)
return c:IsCode(74515847) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74542246.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74542246.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c74542246.tdfilter(c,e,tp)
return Card.IsAbleToDeck(c) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end
function c74542246.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstMatchingCard(c74542246.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) then
Duel.BreakEffect()
local sg=Duel.SelectMatchingCard(tp,c74542246.tdfilter,tp,LOCATION_HAND,0,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
function c74542246.cfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsAbleToRemoveAsCost()
end
function c74542246.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74542246.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c74542246.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c74542246.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,2)
end
function c74542246.disop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
local c1,c2=Duel.TossCoin(tp,2)
if c1+c2==0 then
if g:GetCount()>0 then
Duel.ConfirmCards(p,g)
end
elseif c1+c2>0 then
if g:GetCount()>0 then
Duel.ConfirmCards(p,g)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DISCARD)
local sg=g:Select(p,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
Duel.ShuffleHand(1-p)
end
end
end
--绝对数律S·阿卡赛特
function c74543232.initial_effect(c)
--synchro summon
aux.AddSynchroMixProcedure(c,c74543232.tufilter,aux.NonTuner(Card.IsSynchroType,TYPE_RITUAL),nil,aux.NonTuner(Card.IsSynchroType,TYPE_DUAL),1,1)
c:EnableReviveLimit()
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74543232,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,74543232)
e1:SetCondition(c74543232.dacon)
e1:SetTarget(c74543232.datg)
e1:SetOperation(c74543232.daop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74543232,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,84543232+EFFECT_COUNT_CODE_DUEL)
e2:SetCondition(c74543232.spcon)
e2:SetTarget(c74543232.sptg)
e2:SetOperation(c74543232.spop)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74543232,2))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c74543232.necon)
e3:SetTarget(c74543232.netg)
e3:SetOperation(c74543232.neop)
c:RegisterEffect(e3)
end
function c74543232.tufilter(c)
return c:IsType(TYPE_SYNCHRO) and c:IsType(TYPE_TUNER)
end
function c74543232.dafilter(c)
return c:IsType(TYPE_MONSTER) and bit.band(c:GetPreviousTypeOnField(),TYPE_MONSTER)~=0
end
function c74543232.dacon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return bit.band(r,REASON_EFFECT)~=0 and rc:IsControler(tp) and rc:IsAttribute(ATTRIBUTE_LIGHT) and eg:IsExists(c74543232.dafilter,1,nil)
end
function c74543232.datg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=eg:Filter(Card.IsType,nil,TYPE_MONSTER)
if chk==0 then return true end
local dmg=mg:GetSum(Card.GetBaseAttack)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dmg)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dmg)
end
function c74543232.daop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function c74543232.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function c74543232.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,tp,nil)
end
function c74543232.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetValue(c74543232.efilter)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetOwnerPlayer(tp)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e4)
end
Duel.SpecialSummonComplete()
end
function c74543232.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function c74543232.necon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetCurrentChain()
if ct<2 then return end
local te,p=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return te and te:GetHandler():IsSetCard(0x745) and p==tp and rp==1-tp
end
function c74543232.netg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,0,0)
end
function c74543232.neop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if not g then return end
local tc=g:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
end
--卢纳人偶师
function c74546765.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c74546765.matfilter,1,1)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74546765,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,74546765)
e1:SetCondition(c74546765.thcon)
e1:SetTarget(c74546765.thtg)
e1:SetOperation(c74546765.thop)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74546765,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c74546765.spcon)
e2:SetTarget(c74546765.sptg)
e2:SetOperation(c74546765.spop)
c:RegisterEffect(e2)
end
function c74546765.matfilter(c)
return c:IsLinkSetCard(0x745) and not c:IsLinkType(TYPE_LINK)
end
function c74546765.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c74546765.thfilter(c)
return c:IsSetCard(0x745) and c:IsAbleToHand()
end
function c74546765.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74546765.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74546765.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74546765.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c74546765.cfilter(c,ec)
if c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsSummonType(SUMMON_TYPE_RITUAL) then
if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c)
else
return bit.band(ec:GetLinkedZone(c:GetPreviousControler()),bit.lshift(0x1,c:GetPreviousSequence()))~=0
end
end
end
function c74546765.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c74546765.cfilter,1,nil,e:GetHandler())
end
function c74546765.spfilter(c,e,tp)
return c:IsType(TYPE_DUAL) and c:IsSetCard(0x745) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74546765.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c74546765.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c74546765.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 tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c74546765.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) then
if tc:IsSummonable(true,nil) and Duel.SelectYesNo(tp,aux.Stringid(74546765,2)) then Duel.Summon(tp,tc,true,nil) end
end
end
--成田的皇帝·炎械帝王
function c74550504.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,4,c74550504.lcheck)
c:EnableReviveLimit()
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74550504,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,74550504)
e1:SetCondition(c74550504.discon)
e1:SetTarget(c74550504.distg)
e1:SetOperation(c74550504.disop)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74550504,1))
e2:SetRange(LOCATION_MZONE)
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,84550504)
e2:SetTarget(c74550504.target)
e2:SetOperation(c74550504.operation)
c:RegisterEffect(e2)
end
function c74550504.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x745)
end
function c74550504.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c74550504.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c74550504.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+PHASE_END)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
function c74550504.cfilter(c)
return c:IsSetCard(0x745) and c:IsAbleToRemoveAsCost()
end
function c74550504.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(c74550504.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
local dg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,nil)
local ct=dg:GetCount()
if ct>3 then ct=3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c74550504.cfilter,tp,LOCATION_GRAVE,0,1,ct,nil)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
Duel.SetTargetParam(rg:GetCount())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,dg,rg:GetCount(),0,0)
end
function c74550504.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,ct,ct,nil)
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
--幻夜童话·绮言万卷
function c74552991.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,3,5,c74552991.lcheck)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74552991,0))
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,74552991)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c74552991.discon)
e1:SetTarget(c74552991.distg)
e1:SetOperation(c74552991.disop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c74552991.indtg)
e2:SetValue(c74552991.indct)
c:RegisterEffect(e2)
--cannot be target
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--to deck
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(74552991,1))
e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,84552991)
e4:SetCondition(c74552991.tdcon)
e4:SetTarget(c74552991.tdtg)
e4:SetOperation(c74552991.tdop)
c:RegisterEffect(e4)
end
function c74552991.lcheck(g)
return g:GetClassCount(Card.GetLinkAttribute)==g:GetCount()
end
function c74552991.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if rp~=1-tp or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsContains(c) and Duel.IsChainNegatable(ev)
end
function c74552991.distg(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)
end
function c74552991.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
function c74552991.indtg(e,c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x745) and not c:IsCode(74552991)
end
function c74552991.indct(e,re,r,rp)
if bit.band(r,REASON_EFFECT)~=0 then
return 1
else return 0 end
end
function c74552991.cfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c74552991.tdcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c74552991.cfilter,1,nil,tp)
end
function c74552991.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.GetFlagEffect(tp,74552991)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.RegisterFlagEffect(tp,74552991,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c74552991.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
--亡国厄咒·缭棘公主
function c74557525.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,74514435,c74557525.matfilter,1,true,true)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c74557525.splimit)
c:RegisterEffect(e0)
--cannot target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(74557525,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1,74557525)
e4:SetRange(LOCATION_MZONE)
e4:SetHintTiming(0,TIMING_SSET+TIMING_SUMMON+TIMING_SPSUMMON+TIMING_MAIN_END)
e4:SetTarget(c74557525.sptg)
e4:SetOperation(c74557525.spop)
c:RegisterEffect(e4)
end
function c74557525.matfilter(c)
return c:IsFusionSetCard(0x745) and c:IsLevelAbove(10)
end
function c74557525.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x745)
end
function c74557525.spfilter(c,e,tp)
return c:IsSetCard(0x745) and c:IsType(TYPE_DUAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74557525.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c74557525.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(dg)
if Duel.Destroy(dg,REASON_EFFECT)==0 then return end
local tg=Duel.GetMatchingGroup(c74557525.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if tg:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(74557525,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=tg:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
sg:EnableDualState()
end
end
--幻陨花曲·绝园之镰
function c74566699.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c74566699.splimit)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74566699,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCountLimit(1,74566699)
e2:SetCondition(c74566699.decon)
e2:SetTarget(c74566699.detg)
e2:SetOperation(c74566699.deop)
c:RegisterEffect(e2)
--dis set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74566699,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c74566699.dscon)
e3:SetTarget(c74566699.dstg)
e3:SetOperation(c74566699.dsop)
c:RegisterEffect(e3)
end
function c74566699.splimit(e,se,sp,st)
return st&SUMMON_TYPE_RITUAL~=SUMMON_TYPE_RITUAL or (se and se:GetHandler():IsSetCard(0x745))
end
function c74566699.decon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c74566699.defilter(c)
return not c:IsType(TYPE_LINK)
end
function c74566699.detg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74566699.defilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c74566699.defilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c74566699.deop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c74566699.defilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function c74566699.dscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_RITUAL) and rp==1-tp and c:IsReason(REASON_EFFECT)
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c74566699.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_ONFIELD)
end
function c74566699.dsop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.HintSelection(dg)
if Duel.Destroy(dg,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_MSET)
e1:SetTargetRange(0,1)
e1:SetTarget(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SSET)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_TURN_SET)
Duel.RegisterEffect(e3,tp)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetTarget(c74566699.sumlimit)
Duel.RegisterEffect(e4,tp)
end
end
function c74566699.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
--湮灭·万海龙王
function c74566924.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0x745),1)
c:EnableReviveLimit()
--special summon1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74566924,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,74566924)
e1:SetCondition(c74566924.spcon)
e1:SetTarget(c74566924.sptg)
e1:SetOperation(c74566924.spop)
c:RegisterEffect(e1)
--special summon2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74566924,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,84566924)
e2:SetCondition(c74566924.spcon2)
e2:SetTarget(c74566924.sptg2)
e2:SetOperation(c74566924.spop2)
c:RegisterEffect(e2)
end
function c74566924.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c74566924.spfilter(c,e,tp,check)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74566924.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local check=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c74566924.spfilter(chkc,e,tp,check) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c74566924.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp,check) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c74566924.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp,check)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c74566924.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c74566924.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c74566924.rmfilter(c)
return c:IsAbleToRemove() and c:IsAttribute(ATTRIBUTE_WATER)
end
function c74566924.sptg2(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)
and Duel.IsExistingMatchingCard(c74566924.rmfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function c74566924.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c74566924.rmfilter),tp,LOCATION_GRAVE,0,1,1,c)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--璀璨冬日·狡黠雪兔
function c74569179.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c74569179.splimit)
c:RegisterEffect(e1)
--position
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74569179,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCountLimit(1,74569179)
e2:SetTarget(c74569179.settg)
e2:SetOperation(c74569179.setop)
c:RegisterEffect(e2)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74569179,1))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,84569179)
e3:SetCondition(c74569179.con)
e3:SetOperation(c74569179.op)
c:RegisterEffect(e3)
end
function c74569179.splimit(e,se,sp,st)
return st&SUMMON_TYPE_RITUAL~=SUMMON_TYPE_RITUAL or (se and se:GetHandler():IsSetCard(0x745))
end
function c74569179.sfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c74569179.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c74569179.sfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74569179.sfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c74569179.sfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetChainLimit(c74569179.chainlm)
end
function c74569179.chainlm(e,rp,tp)
return tp==rp
end
function c74569179.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function c74569179.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c74569179.op(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(c74569179.tdcon)
e1:SetOperation(c74569179.tdop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c74569179.tdfilter(c)
return c:IsAbleToDeck()
end
function c74569179.cfilter(c,tp)
return c:IsPreviousControler(tp)
end
function c74569179.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and c:IsSetCard(0x745)
end
function c74569179.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c74569179.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c74569179.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,74569179)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c74569179.tdfilter),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and g:IsExists(c74569179.cfilter,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(74569179,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c74569179.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g2:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--花间灵·清涓芙华
function c74570403.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,8,2)
c:EnableReviveLimit()
--material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74570403,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,74570403)
e1:SetCondition(c74570403.macon1)
e1:SetTarget(c74570403.target)
e1:SetOperation(c74570403.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c74570403.macon2)
c:RegisterEffect(e2)
--check
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74570403,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,84570403)
e3:SetCost(c74570403.cost)
e3:SetTarget(c74570403.chktg)
e3:SetOperation(c74570403.chkop)
c:RegisterEffect(e3)
end
function c74570403.macon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():FilterCount(Card.IsSetCard,nil,0x745)==0
end
function c74570403.macon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():FilterCount(Card.IsSetCard,nil,0x745)~=0
end
function c74570403.filter(c)
return c:IsCanOverlay()
end
function c74570403.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c74570403.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingTarget(c74570403.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,c74570403.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
end
function c74570403.operation(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
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,Group.FromCards(tc))
end
end
function c74570403.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c74570403.chktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) end
end
function c74570403.chkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_SZONE,nil)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
Duel.BreakEffect()
local dg=g:Filter(Card.IsType,nil,TYPE_TRAP)
Duel.Destroy(dg,REASON_EFFECT)
end
end
--人偶·剑灵青蒿
function c74571833.initial_effect(c)
--xyz summon
aux.AddXyzProcedureLevelFree(c,c74571833.mfilter,c74571833.xyzcheck,2,2,c74571833.ovfilter,aux.Stringid(74571833,0),c74571833.xyzop)
c:EnableReviveLimit()
--xyzlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74571833,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,74571833+74585399)
e2:SetCondition(c74571833.thcon)
e2:SetCost(c74571833.thcost)
e2:SetTarget(c74571833.thtg)
e2:SetOperation(c74571833.thop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74571833,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,74571833)
e3:SetCost(c74571833.spcost)
e3:SetTarget(c74571833.sptg)
e3:SetOperation(c74571833.spop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(74571833,3))
e4:SetCost(c74571833.thcost)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(74571833,ACTIVITY_SPSUMMON,c74571833.counterfilter)
end
function c74571833.counterfilter(c)
return c:IsSetCard(0x745)
end
function c74571833.mfilter(c,xyzc)
return c:IsFaceup() and c:IsXyzLevel(xyzc,4)
end
function c74571833.xyzcheck(g)
return true
end
function c74571833.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x745)
end
function c74571833.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,74571833)==0 and Duel.GetCustomActivityCount(74571833,tp,ACTIVITY_SPSUMMON)==0 end
Duel.RegisterFlagEffect(tp,74571833,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c74571833.splimit)
Duel.RegisterEffect(e1,tp)
end
function c74571833.splimit(e,c)
return not c:IsSetCard(0x745)
end
function c74571833.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c74571833.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c74571833.thfilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c74571833.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74571833.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74571833.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74571833.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c74571833.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 c74571833.spfilter(c,e,tp)
return c:IsSetCard(0x745) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74571833.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74571833.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c74571833.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,c74571833.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--帷幄决者·暗阁魔女
function c74580816.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0x745),1)
c:EnableReviveLimit()
--move
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74580816,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,74580816)
e1:SetCondition(c74580816.seqcon)
e1:SetTarget(c74580816.seqtg)
e1:SetOperation(c74580816.seqop)
c:RegisterEffect(e1)
--lv change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74580816,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,84580816)
e2:SetTarget(c74580816.lctg)
e2:SetOperation(c74580816.lcop)
c:RegisterEffect(e2)
end
function c74580816.cfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c74580816.seqcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c74580816.cfilter,1,nil,tp)
end
function c74580816.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=eg:Filter(c74580816.cfilter,nil,tp)
if chkc then return e:GetHandler():IsLevelAbove(5) and chkc:IsLocation(LOCATION_MZONE) and c74580816.cfilter(chkc,tp,g) end
if chk==0 then return Duel.IsExistingTarget(c74580816.cfilter,tp,LOCATION_MZONE,0,1,nil,tp,g) end
if g:GetCount()==1 then
Duel.SetTargetCard(g)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c74580816.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,g)
end
end
function c74580816.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-4)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
function c74580816.filter(c)
return c:IsFaceup() and c:IsLevelAbove(5)
end
function c74580816.lctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c74580816.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c74580816.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c74580816.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c74580816.lcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and tc:GetLevel()>5 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-4)
tc:RegisterEffect(e1)
if tc:IsType(TYPE_RITUAL) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
--人偶·剑灵青黛
function c74585399.initial_effect(c)
--xyz summon
aux.AddXyzProcedureLevelFree(c,c74585399.mfilter,c74585399.xyzcheck,2,2,c74585399.ovfilter,aux.Stringid(74585399,0),c74585399.xyzop)
c:EnableReviveLimit()
--xyzlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74585399,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,74571833+74585399)
e2:SetCondition(c74585399.thcon)
e2:SetCost(c74585399.thcost)
e2:SetTarget(c74585399.thtg)
e2:SetOperation(c74585399.thop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74585399,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,74585399)
e3:SetCost(c74585399.spcost)
e3:SetTarget(c74585399.sptg)
e3:SetOperation(c74585399.spop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(74585399,3))
e4:SetCost(c74585399.thcost)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(74585399,ACTIVITY_SPSUMMON,c74585399.counterfilter)
end
function c74585399.counterfilter(c)
return c:IsSetCard(0x745)
end
function c74585399.mfilter(c,xyzc)
return c:IsFaceup() and c:IsXyzLevel(xyzc,4)
end
function c74585399.xyzcheck(g)
return true
end
function c74585399.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x745)
end
function c74585399.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,74585399)==0 and Duel.GetCustomActivityCount(74585399,tp,ACTIVITY_SPSUMMON)==0 end
Duel.RegisterFlagEffect(tp,74585399,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c74585399.splimit)
Duel.RegisterEffect(e1,tp)
end
function c74585399.splimit(e,c)
return not c:IsSetCard(0x745)
end
function c74585399.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c74585399.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c74585399.thfilter(c)
return c:IsSetCard(0x745) and c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end
function c74585399.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74585399.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74585399.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74585399.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c74585399.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 c74585399.spfilter(c,e,tp)
return c:IsSetCard(0x745) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74585399.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74585399.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c74585399.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,c74585399.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--人偶师助手·妲丽安
function c74586611.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74586611,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,74586611)
e1:SetCondition(c74586611.spcon)
e1:SetTarget(c74586611.sptg)
e1:SetOperation(c74586611.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74586611,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,84586611)
e2:SetCost(c74586611.cost)
e2:SetTarget(c74586611.thtg)
e2:SetOperation(c74586611.thop)
c:RegisterEffect(e2)
end
function c74586611.cfilter(c)
return c:IsCode(74546765) and c:IsFaceup()
end
function c74586611.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c74586611.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c74586611.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 c74586611.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c74586611.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c74586611.thfilter(c)
return c:IsCode(74594972) and c:IsAbleToHand()
end
function c74586611.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74586611.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74586611.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74586611.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--人偶·迦瓦娜
function c74590055.initial_effect(c)
aux.EnableDualAttribute(c)
--cost
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_LPCOST_CHANGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetCondition(aux.IsDualState)
e1:SetValue(c74590055.costchange)
c:RegisterEffect(e1)
--code
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(74590055)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
e2:SetCondition(aux.IsDualState)
c:RegisterEffect(e2)
end
function c74590055.costchange(e,re,rp,val)
if re and re:GetHandler():IsSetCard(0x745) then
return 0
else
return val
end
end
--教团终端·SID72
function c74594972.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--dual summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74594972,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,74594972)
e1:SetTarget(c74594972.sumtg)
e1:SetOperation(c74594972.sumop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74594972,1))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,84594972)
e3:SetTarget(c74594972.tdtg)
e3:SetOperation(c74594972.tdop)
c:RegisterEffect(e3)
--ritual summon
local e4=aux.AddRitualProcEqual2(c,c74594972.rsfilter,LOCATION_HAND,nil,nil,true)
e4:SetDescription(aux.Stringid(74594972,2))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,94594972)
c:RegisterEffect(e4)
end
function c74594972.filter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_DUAL) and c:IsSetCard(0x745) and c:IsSummonable(true,nil) and (not e or c:IsRelateToEffect(e)) and not c:IsHasEffect(74594972) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
end
function c74594972.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c74594972.filter,1,nil,nil,tp) end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,eg,1,0,0)
end
function c74594972.sumop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c74594972.filter,nil,e,tp)
local tc=g:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
if #g>1 then tc=g:Select(tp,1,1,nil):GetFirst() end
if not tc then return end
Duel.Summon(tp,tc,true,nil)
end
function c74594972.rfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end
function c74594972.tdfilter(c,check)
return c:IsSetCard(0x745) and c:IsAbleToDeck() and (c:IsLocation(LOCATION_GRAVE) or (check and c:IsFaceup()))
end
function c74594972.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local check=Duel.IsExistingMatchingCard(c74594972.rfilter,tp,LOCATION_MZONE,0,1,nil)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c74594972.tdfilter(chkc,check) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c74594972.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,3,nil,check) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c74594972.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,3,3,nil,check)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c74594972.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if not tg then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c74594972.rsfilter(c)
return c:IsSetCard(0x745)
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