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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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