Commit a1c3a78d authored by 2924713558's avatar 2924713558 Committed by GitHub

Add files via upload

parent d666b3f2
--赤色制裁
function c11200109.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,11200109+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c11200109.cost)
e1:SetTarget(c11200109.target)
e1:SetOperation(c11200109.operation)
c:RegisterEffect(e1)
--Remove
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c11200109.rmop)
c:RegisterEffect(e2)
--atk down
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCondition(c11200109.atkcon)
e3:SetTarget(c11200109.atktg)
e3:SetValue(1000)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_REMOVE)
e4:SetCountLimit(1,11209109)
e4:SetCondition(c11200109.damcon)
e4:SetTarget(c11200109.damtg)
e4:SetOperation(c11200109.damop)
c:RegisterEffect(e4)
end
function c11200109.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1500)
else Duel.PayLPCost(tp,1500) end
end
function c11200109.filter(c,e,tp)
return bit.band(c:GetType(),0x81)==0x81 and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11200109.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c11200109.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c11200109.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c11200109.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c11200109.eqlimit(e,c)
return e:GetOwner()==c
end
function c11200109.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) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
Duel.Equip(tp,c,tc)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c11200109.eqlimit)
c:RegisterEffect(e1)
end
end
function c11200109.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetEquipTarget()
if tc then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function c11200109.atkcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL
and e:GetHandler():GetEquipTarget():GetBattleTarget()
end
function c11200109.atktg(e,c)
return c==e:GetHandler():GetEquipTarget():GetBattleTarget()
end
function c11200109.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function c11200109.damop(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 c11200109.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,11200109+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c11200109.cost)
e1:SetTarget(c11200109.target)
e1:SetOperation(c11200109.operation)
c:RegisterEffect(e1)
--Remove
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c11200109.rmop)
c:RegisterEffect(e2)
--atk down
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCondition(c11200109.atkcon)
e3:SetTarget(c11200109.atktg)
e3:SetValue(1000)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_REMOVE)
e4:SetCountLimit(1,11209109)
e4:SetTarget(c11200109.damtg)
e4:SetOperation(c11200109.damop)
c:RegisterEffect(e4)
end
function c11200109.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1500)
else Duel.PayLPCost(tp,1500) end
end
function c11200109.filter(c,e,tp)
return bit.band(c:GetType(),0x81)==0x81 and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11200109.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c11200109.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c11200109.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c11200109.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c11200109.eqlimit(e,c)
return e:GetOwner()==c
end
function c11200109.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) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
Duel.Equip(tp,c,tc)
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c11200109.eqlimit)
c:RegisterEffect(e1)
end
end
function c11200109.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetEquipTarget()
if tc then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function c11200109.atkcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL
and e:GetHandler():GetEquipTarget():GetBattleTarget()
end
function c11200109.atktg(e,c)
return c==e:GetHandler():GetEquipTarget():GetBattleTarget()
end
function c11200109.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)
end
function c11200109.damop(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
This diff is collapsed.
--飞球之魔弹
function c13254097.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(13254097,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_TOHAND)
e1:SetCountLimit(1,13254097+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c13254097.target)
e1:SetOperation(c13254097.activate)
c:RegisterEffect(e1)
end
function c13254097.filter(c)
return c:IsAbleToDeck() and c:IsRace(RACE_FAIRY) and c:IsLevelBelow(1)
end
function c13254097.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetControler()==tp and chkc:GetLocation()==LOCATION_GRAVE and c13254097.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c13254097.filter,tp,LOCATION_GRAVE,0,4,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c13254097.filter,tp,LOCATION_GRAVE,0,1,4,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c13254097.activate(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local j=Duel.SendtoDeck(tg,tp,2,REASON_EFFECT)
if j>0 then
Duel.ShuffleDeck(tp)
local i=0
while i<j and (i==0 or Duel.SelectYesNo(tp,aux.Stringid(13254097,1))) do
local t1=Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil)
local t2=Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_HAND,1,nil) and Duel.IsPlayerCanDraw(1-tp,1)
local op=0
local m={}
local n={}
local ct=1
if t1 then m[ct]=aux.Stringid(13254097,2) n[ct]=1 ct=ct+1 end
m[ct]=aux.Stringid(13254097,3) n[ct]=2 ct=ct+1
if t2 then m[ct]=aux.Stringid(13254097,4) n[ct]=3 ct=ct+1 end
local sp=Duel.SelectOption(tp,table.unpack(m))
op=n[sp+1]
if op==0 then return end
if op==1 then
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.Destroy(g,REASON_EFFECT)
end
end
if op==2 then
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
if op==3 then
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(p,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_HAND,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT)
Duel.ShuffleHand(1-tp)
end
end
end
if(j==0) then Duel.BreakEffect() end
i++
end
end
end
--飞球之魔弹
function c13254097.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(13254097,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_TOHAND)
e1:SetCountLimit(1,13254097+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c13254097.target)
e1:SetOperation(c13254097.activate)
c:RegisterEffect(e1)
end
function c13254097.filter(c)
return c:IsAbleToDeck() and c:IsRace(RACE_FAIRY) and c:IsLevelBelow(1)
end
function c13254097.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetControler()==tp and chkc:GetLocation()==LOCATION_GRAVE and c13254097.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c13254097.filter,tp,LOCATION_GRAVE,0,4,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c13254097.filter,tp,LOCATION_GRAVE,0,1,4,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c13254097.activate(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local j=Duel.SendtoDeck(tg,tp,2,REASON_EFFECT)
if j>0 then
Duel.ShuffleDeck(tp)
local i=0
while i<j and (i==0 or Duel.SelectYesNo(tp,aux.Stringid(13254097,1))) do
Duel.BreakEffect()
local t1=Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil)
local t2=Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_HAND,1,nil) and Duel.IsPlayerCanDraw(1-tp,1)
local op=0
local m={}
local n={}
local ct=1
if t1 then m[ct]=aux.Stringid(13254097,2) n[ct]=1 ct=ct+1 end
m[ct]=aux.Stringid(13254097,3) n[ct]=2 ct=ct+1
if t2 then m[ct]=aux.Stringid(13254097,4) n[ct]=3 ct=ct+1 end
local sp=Duel.SelectOption(tp,table.unpack(m))
op=n[sp+1]
if op==0 then return end
if op==1 then
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.Destroy(g,REASON_EFFECT)
end
end
if op==2 then
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
if op==3 then
local g=Duel.GetFieldGroup(p,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(p,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_HAND,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT)
Duel.ShuffleHand(1-tp)
end
end
end
i=i+1
end
end
end
--元始·飞球之乱流
function c13254131.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13254131,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCost(c13254131.ctcost)
e2:SetTarget(c13254131.cttg)
e2:SetOperation(c13254131.ctop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13254131,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(c13254131.drtg)
e3:SetOperation(c13254131.drop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCondition(c13254131.descon)
e4:SetTarget(c13254131.destg)
e4:SetOperation(c13254131.desop)
c:RegisterEffect(e4)
end
function c13254131.dfilter(c)
return c:IsRace(RACE_FAIRY) and c:IsLevelBelow(1) and c:IsDiscardable()
end
function c13254131.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13254131.dfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c13254131.dfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c13254131.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x356)
end
function c13254131.ctop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x356,1)
end
end
function c13254131.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetCounter(0x356)>0 end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,e:GetLabel())
end
function c13254131.drop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
end
function c13254131.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c13254131.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c13254131.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:RemoveCounter(tp,0x356,1,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
--元始·飞球之乱流
function c13254131.initial_effect(c)
c:EnableCounterPermit(0x356)
c:SetCounterLimit(0x356,4)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13254131,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCost(c13254131.ctcost)
e2:SetTarget(c13254131.cttg)
e2:SetOperation(c13254131.ctop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13254131,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(c13254131.drtg)
e3:SetOperation(c13254131.drop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCondition(c13254131.descon)
e4:SetTarget(c13254131.destg)
e4:SetOperation(c13254131.desop)
c:RegisterEffect(e4)
end
function c13254131.dfilter(c)
return c:IsRace(RACE_FAIRY) and c:IsLevelBelow(1) and c:IsDiscardable()
end
function c13254131.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13254131.dfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c13254131.dfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c13254131.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x356)
end
function c13254131.ctop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x356,1)
end
end
function c13254131.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetCounter(0x356)>0 end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,e:GetLabel())
end
function c13254131.drop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
end
function c13254131.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c13254131.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c13254131.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:RemoveCounter(tp,0x356,1,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
This diff is collapsed.
--宇宙惑星要塞 泽洛斯
function c13257209.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c13257209.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13257209,1))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,0x1c0+TIMING_MAIN_END+TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetCountLimit(1)
e2:SetCondition(c13257209.condition)
e2:SetTarget(c13257209.target)
e2:SetOperation(c13257209.activate)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13257209,2))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c13257209.drcon)
e3:SetTarget(c13257209.drtg)
e3:SetOperation(c13257209.drop)
c:RegisterEffect(e3)
end
function c13257209.thfilter(c)
return (c:IsCode(13257207) or c:IsCode(13257213)) and c:IsAbleToHand()
end
function c13257209.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(11,0,aux.Stringid(13257209,4))
local g=Duel.GetMatchingGroup(c13257209.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(13257209,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c13257209.condition(e,tp,eg,ep,ev,re,r,rp)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
return tn~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
end
function c13257209.filter(c)
return (c:IsRace(RACE_MACHINE) or c:IsRace(RACE_FIEND)) and c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)
end
function c13257209.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13257209.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c13257209.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c13257209.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil,1)
else
Duel.MSet(tp,tc,true,nil,1)
end
end
end
function c13257209.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsSetCard(0x353) and (c:GetReasonPlayer()~=tp and c:IsReason(REASON_EFFECT))
and c:IsPreviousLocation(LOCATION_MZONE)
end
function c13257209.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c13257209.cfilter,1,nil,tp)
end
function c13257209.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c13257209.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
--宇宙惑星要塞 泽洛斯
function c13257209.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c13257209.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13257209,1))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,0x1c0+TIMING_MAIN_END+TIMING_BATTLE_START+TIMING_BATTLE_END)
e2:SetCondition(c13257209.condition)
e2:SetTarget(c13257209.target)
e2:SetOperation(c13257209.activate)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13257209,2))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c13257209.drcon)
e3:SetTarget(c13257209.drtg)
e3:SetOperation(c13257209.drop)
c:RegisterEffect(e3)
end
function c13257209.thfilter(c)
return (c:IsCode(13257207) or c:IsCode(13257213)) and c:IsAbleToHand()
end
function c13257209.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(11,0,aux.Stringid(13257209,4))
local g=Duel.GetMatchingGroup(c13257209.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(13257209,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c13257209.condition(e,tp,eg,ep,ev,re,r,rp)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
return tn~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
end
function c13257209.filter(c)
return (c:IsRace(RACE_MACHINE) or c:IsRace(RACE_FIEND)) and c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)
end
function c13257209.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c13257209.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c13257209.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c13257209.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil,1)
else
Duel.MSet(tp,tc,true,nil,1)
end
end
end
function c13257209.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsSetCard(0x353) and (c:GetReasonPlayer()~=tp and c:IsReason(REASON_EFFECT))
and c:IsPreviousLocation(LOCATION_MZONE)
end
function c13257209.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c13257209.cfilter,1,nil,tp)
end
function c13257209.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c13257209.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--Actress! ReLive!
local m=20100120
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c20100002") end,function() require("script/c20100002") end)
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(aux.bfgcost)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.filter1(c,e,tp)
return c:IsSetCard(0xc99) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0xc99)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) then
Duel.BreakEffect()
tc:AddCounter(0xc99,1)
end
end
end
function cm.callback(c)
local tp=c:GetPreviousControler()
if c:IsSetCard(0xc99) and c:IsControler(tp) then
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
eg:ForEach(cm.callback)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function cm.filter(c,e,tp)
return c:GetFlagEffect(m)~=0 and c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:IsExists(cm.filter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=eg:FilterSelect(tp,cm.filter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.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
--Actress! ReLive!
local m=20100120
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c20100002") end,function() require("script/c20100002") end)
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCost(aux.bfgcost)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.filter1(c,e,tp)
return c:IsSetCard(0xc99) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0xc99)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) then
Duel.BreakEffect()
tc:AddCounter(0xc99,1)
end
end
end
function cm.callback(c)
local tp=c:GetPreviousControler()
if c:IsSetCard(0xc99) and c:IsControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) then
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
eg:ForEach(cm.callback)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function cm.filter(c,e,tp)
return c:GetFlagEffect(m)~=0 and c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:IsExists(cm.filter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=eg:FilterSelect(tp,cm.filter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.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
\ No newline at end of file
--THE DRAWER 玄墨
local m=33330319
local cm=_G["c"..m]
cm.name="THE DRAWER"
function c33330319.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,c33330319.tfilter,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--special summon
---- local e2=Effect.CreateEffect(c)
-- e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
-- e2:SetType(EFFECT_TYPE_IGNITION)
-- e2:SetRange(LOCATION_GRAVE)
-- e2:SetCountLimit(1,33330319)
-- e2:SetCost(c33330319.spcost)
-- e2:SetTarget(c33330319.sptg)
-- e2:SetOperation(c33330319.spop)
-- c:RegisterEffect(e2)
--end
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17031211,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,33330319)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33330319,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c33330319.tgtg)
e2:SetOperation(c33330319.tgop)
c:RegisterEffect(e2)
--nontuner
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_NONTUNER)
c:RegisterEffect(e4)
end
function c33330319.tfilter(c)
return c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function cm.spcfilter(c,ft,tp)
return ft>0 or (c:IsControler(tp) and c:GetSequence()<5)
end
function cm.costfilter(c)
return c:IsFaceup() and c:IsLevelBelow(2)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then
if ft<0 then return false end
if ft==0 then
return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil)
else
return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if ft==0 then
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Release(g,REASON_COST)
else
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.Release(g,REASON_COST)
end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
-- if not c:IsRelateToEffect(e) then return end
-- Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
---to deck
function c33330319.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_WARRIOR) and c:IsAbleToGrave()
end
function c33330319.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33330319.tgfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function c33330319.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=Duel.SelectMatchingCard(tp,c33330319.tgfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local lv=tc:GetLevel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
--THE DRAWER 玄墨
local m=33330319
local cm=_G["c"..m]
cm.name="THE DRAWER"
function c33330319.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,c33330319.tfilter,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--special summon
---- local e2=Effect.CreateEffect(c)
-- e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
-- e2:SetType(EFFECT_TYPE_IGNITION)
-- e2:SetRange(LOCATION_GRAVE)
-- e2:SetCountLimit(1,33330319)
-- e2:SetCost(c33330319.spcost)
-- e2:SetTarget(c33330319.sptg)
-- e2:SetOperation(c33330319.spop)
-- c:RegisterEffect(e2)
--end
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17031211,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,33330319)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33330319,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c33330319.tgtg)
e2:SetOperation(c33330319.tgop)
c:RegisterEffect(e2)
--nontuner
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_NONTUNER)
c:RegisterEffect(e4)
end
function c33330319.tfilter(c)
return c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_LIGHT)
end
function cm.spcfilter(c,ft,tp)
return ft>0 or (c:IsControler(tp) and c:GetSequence()<5)
end
function cm.costfilter(c)
return c:IsFaceup() and c:IsLevelBelow(2)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then
if ft<0 then return false end
if ft==0 then
return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,0,1,nil)
else
return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if ft==0 then
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Release(g,REASON_COST)
else
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.Release(g,REASON_COST)
end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
-- if not c:IsRelateToEffect(e) then return end
-- Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
---to deck
function c33330319.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_WARRIOR) and c:IsAbleToGrave()
end
function c33330319.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33330319.tgfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function c33330319.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=Duel.SelectMatchingCard(tp,c33330319.tgfilter,tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local lv=tc:GetLevel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
--幻梦迷境王将 普芙蕾
function c65010056.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,c65010056.mfilter,c65010056.xyzcheck,2,2)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c65010056.sumsuc)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetCost(c65010056.cost)
e2:SetTarget(c65010056.destg)
e2:SetOperation(c65010056.desop)
c:RegisterEffect(e2)
--cannot disable summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetTarget(aux.TargetBoolFunction(Card.IsSummonType,SUMMON_TYPE_XYZ))
c:RegisterEffect(e4)
end
function c65010056.mfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsXyzLevel(8)
end
function c65010056.xyzcheck(g)
return g:GetClassCount(Card.GetAttribute)==g:GetCount()
end
function c65010056.cost(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 c65010056.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c65010056.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65010056.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c65010056.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c65010056.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c65010056.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if Duel.Destroy(g,REASON_EFFECT)>=2 and Duel.SelectYesNo(tp,aux.Stringid(65010056,0)) then
local mg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if mg:GetCount()>0 then
Duel.HintSelection(mg)
Duel.SendtoGrave(mg,REASON_EFFECT)
end
end
end
function c65010056.sumsuc(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsSummonType(SUMMON_TYPE_XYZ) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetValue(c65010056.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e2:SetTarget(c65010056.disable)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c65010056.aclimit(e,re,tp)
return re:GetHandler():IsOnField() and e:GetHandler()~=re:GetHandler()
end
function c65010056.disable(e,c)
return c~=e:GetHandler() and (not c:IsType(TYPE_MONSTER) or (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT))
end
--幻梦迷境王将 普芙蕾
function c65010056.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,c65010056.mfilter,c65010056.xyzcheck,2,2)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c65010056.sumsuc)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetCost(c65010056.cost)
e2:SetTarget(c65010056.destg)
e2:SetOperation(c65010056.desop)
c:RegisterEffect(e2)
--cannot disable summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetTarget(aux.TargetBoolFunction(Card.IsSummonType,SUMMON_TYPE_XYZ))
c:RegisterEffect(e4)
end
function c65010056.mfilter(c,xyzc)
return c:IsRace(RACE_CYBERSE) and c:IsXyzLevel(xyzc,8)
end
function c65010056.xyzcheck(g)
return g:GetClassCount(Card.GetAttribute)==g:GetCount()
end
function c65010056.cost(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 c65010056.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c65010056.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65010056.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c65010056.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c65010056.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c65010056.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if Duel.Destroy(g,REASON_EFFECT)>=2 and Duel.SelectYesNo(tp,aux.Stringid(65010056,0)) then
local mg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if mg:GetCount()>0 then
Duel.HintSelection(mg)
Duel.SendtoGrave(mg,REASON_EFFECT)
end
end
end
function c65010056.sumsuc(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsSummonType(SUMMON_TYPE_XYZ) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetValue(c65010056.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e2:SetTarget(c65010056.disable)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c65010056.aclimit(e,re,tp)
return re:GetHandler():IsOnField() and e:GetHandler()~=re:GetHandler()
end
function c65010056.disable(e,c)
return c~=e:GetHandler() and (not c:IsType(TYPE_MONSTER) or (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT))
end
--星光歌剧 星见纯那Revue
function c65010125.initial_effect(c)
--summon with 1 tribute
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(65010125,0))
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SUMMON_PROC)
e0:SetCondition(c65010125.otcon)
e0:SetOperation(c65010125.otop)
e0:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e0)
local e1=e0:Clone()
e1:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(65010125,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetTarget(c65010125.target)
e2:SetOperation(c65010125.operation)
c:RegisterEffect(e2)
--des
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(65010125,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c65010125.descon)
e3:SetTarget(c65010125.destg)
e3:SetOperation(c65010125.desop)
c:RegisterEffect(e3)
--Activate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(65010125,3))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetHintTiming(TIMING_END_PHASE)
e4:SetCondition(c65010125.condition)
e4:SetOperation(c65010125.activate)
c:RegisterEffect(e4)
if c65010125.counter==nil then
c65010125.counter=true
c65010125[0]=0
c65010125[1]=0
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e5:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e5:SetOperation(c65010125.resetcount)
Duel.RegisterEffect(e5,0)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetOperation(c65010125.addcount)
Duel.RegisterEffect(e6,0)
end
end
function c65010125.resetcount(e,tp,eg,ep,ev,re,r,rp)
c65010125[0]=0
c65010125[1]=0
end
function c65010125.addcount(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
local pl=tc:GetPreviousLocation()
if pl==LOCATION_MZONE then
local p=tc:GetPreviousControler()
c65010125[p]=c65010125[p]+1
end
tc=eg:GetNext()
end
end
function c65010125.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c65010125.activate(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:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(c65010125.droperation)
Duel.RegisterEffect(e1,tp)
end
function c65010125.droperation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,65010125)
Duel.Draw(tp,c65010125[tp],REASON_EFFECT)
end
function c65010125.otfilter(c)
return c:IsSetCard(0x9da0)
end
function c65010125.otcon(e,c,minc)
if c==nil then return true end
local mg=Duel.GetMatchingGroup(c65010125.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
return c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg)
end
function c65010125.otop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c65010125.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
local sg=Duel.SelectTribute(tp,c,1,1,mg)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c65010125.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE) and Duel.GetTurnPlayer()~=tp
end
function c65010125.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end
local num=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,num,1-tp,LOCATION_ONFIELD)
end
function c65010125.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function c65010125.filter(c)
return c:IsFacedown()
end
function c65010125.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c65010125.filter,tp,0,LOCATION_ONFIELD,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c65010125.filter,tp,0,LOCATION_ONFIELD,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0)
local tc=g:GetFirst()
while tc do
Duel.SetChainLimit(c65010125.limit(tc))
tc=g:GetNext()
end
end
function c65010125.limit(c)
return function (e,lp,tp)
return e:GetHandler()~=c
end
end
function c65010125.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=tg:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
\ No newline at end of file
--『星光歌剧』台本-轮回Revue
function c65010126.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_SUMMON)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--token&summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,65010126)
e1:SetCondition(c65010126.con)
e1:SetCost(c65010126.cost)
e1:SetTarget(c65010126.tg)
e1:SetOperation(c65010126.op)
c:RegisterEffect(e1)
--draw!
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c65010126.drtg)
e2:SetOperation(c65010126.drop)
c:RegisterEffect(e2)
end
function c65010126.drfil(c)
return c:IsSetCard(0x9da0) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c65010126.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c65010126.drfil(chkc) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(c65010126.drfil,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsPlayerCanDraw(tp) end
local g=Duel.SelectTarget(tp,c65010126.drfil,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DRAW,0,0,tp,1)
end
function c65010126.drop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c65010126.con(e,tp,eg,ep,ev,re,r,rp)
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
return tn~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE))
end
function c65010126.costfil(c)
return c:IsSetCard(0x9da0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHandAsCost()
end
function c65010126.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65010126.costfil,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c65010126.costfil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST)
end
function c65010126.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,65010128,0,0x4011,1000,2800,8,RACE_FAIRY,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c65010126.filter(c)
return (c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)) and c:IsSetCard(0x9da0)
end
function c65010126.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,65010128,0,0x4011,1000,2800,8,RACE_FAIRY,ATTRIBUTE_DARK) or not e:GetHandler():IsRelateToEffect(e) then return end
local token=Duel.CreateToken(tp,65010128)
if Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsExistingMatchingCard(c65010126.filter,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(65010126,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c65010126.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil,1)
else
Duel.MSet(tp,tc,true,nil,1)
end
end
end
end
\ No newline at end of file
--『星光歌剧』台本-约定Revue
function c65010127.initial_effect(c)
--SearchCard
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c65010127.cost)
e1:SetTarget(c65010127.tg)
e1:SetOperation(c65010127.op)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,65010127)
e2:SetTarget(c65010127.drtg)
e2:SetOperation(c65010127.drop)
c:RegisterEffect(e2)
end
function c65010127.costfil(c)
return c:IsSetCard(0x9da0) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function c65010127.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65010127.costfil,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c65010127.costfil,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
end
function c65010127.thfil(c)
return c:IsSetCard(0x9da0) and not c:IsCode(65010127) and c:IsAbleToHand()
end
function c65010127.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65010127.thfil,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c65010127.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c65010127.thfil,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c65010127.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DRAW,0,0,tp,1)
end
function c65010127.drop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--星光歌剧 露崎真昼
function c65010129.initial_effect(c)
--summon proc
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(65010129,0))
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SUMMON_PROC)
e0:SetCondition(c65010129.sumcon)
e0:SetOperation(c65010129.sumop)
e0:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCost(c65010129.cost)
e1:SetOperation(c65010129.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(65010129,ACTIVITY_SPSUMMON,c65010129.counterfilter)
end
function c65010129.refil(c)
return c:IsAbleToRemoveAsCost() and c:IsSetCard(0x9da0)
end
function c65010129.sumcon(e,c)
local tp=e:GetHandler():GetControler()
return Duel.IsExistingMatchingCard(c65010129.refil,tp,LOCATION_EXTRA,0,1,nil)
end
function c65010129.sumop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectMatchingCard(tp,c65010129.refil,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c65010129.counterfilter(c)
return c:IsSetCard(0x9da0)
end
function c65010129.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(65010129,tp,ACTIVITY_SPSUMMON)==0 and Duel.GetFlagEffect(tp,65010129)==0 and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_COST) 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(c65010129.splimit)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,65010129,RESET_PHASE+PHASE_END,0,1)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST,nil,REASON_COST)
end
function c65010129.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x9da0)
end
function c65010129.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_RELEASE_SUM)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--星光歌剧 露崎真昼Revue
function c65010130.initial_effect(c)
--summon with 1 tribute
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(65010130,0))
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SUMMON_PROC)
e0:SetCondition(c65010130.otcon)
e0:SetOperation(c65010130.otop)
e0:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e0)
local e1=e0:Clone()
e1:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(c65010130.con)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSummonType,SUMMON_TYPE_ADVANCE))
e2:SetValue(1)
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)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(65010130,1))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetCountLimit(1)
e4:SetCondition(c65010130.thcon)
e4:SetTarget(c65010130.thtg)
e4:SetOperation(c65010130.thop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
--damage
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(65010130,2))
e6:SetCategory(CATEGORY_DAMAGE)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_TO_HAND)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetCondition(c65010130.damcon)
e6:SetTarget(c65010130.damtg)
e6:SetOperation(c65010130.damop)
c:RegisterEffect(e6)
end
function c65010130.otfilter(c)
return c:IsSetCard(0x9da0)
end
function c65010130.otcon(e,c,minc)
if c==nil then return true end
local mg=Duel.GetMatchingGroup(c65010130.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
return c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg)
end
function c65010130.otop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c65010130.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
local sg=Duel.SelectTribute(tp,c,1,1,mg)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c65010130.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function c65010130.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE) and not eg:IsContains(e:GetHandler())
end
function c65010130.thfil(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x9da0) and c:IsAbleToHand()
end
function c65010130.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65010130.thfil,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c65010130.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c65010130.thfil,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,tp,REASON_EFFECT)
end
end
function c65010130.damcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and Duel.GetCurrentPhase()~=PHASE_DRAW
end
function c65010130.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1500)
end
function c65010130.damop(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
\ No newline at end of file
--渺奏迷景曲-凝望至高
function c65072007.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,65072007+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c65072007.target)
e1:SetOperation(c65072007.activate)
c:RegisterEffect(e1)
end
c65072007.card_code_list={65072000}
function c65072007.filter(c)
return aux.IsCodeListed(c,65072000) and c:IsAbleToHand()
end
function c65072007.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65072007.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(11,0,aux.Stringid(65072007,0))
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c65072007.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c65072007.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
--actlimit
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(c65072007.actlimit)
Duel.RegisterEffect(e1,tp)
end
end
function c65072007.actlimit(e,te,tp)
return Duel.GetCurrentPhase()==PHASE_MAIN1
and te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:IsActiveType(TYPE_SPELL) and te:GetHandler():IsType(TYPE_FIELD)
end
--渺奏迷景曲-凝望至高
function c65072007.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,65072007+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c65072007.target)
e1:SetOperation(c65072007.activate)
c:RegisterEffect(e1)
end
c65072007.card_code_list={65072000}
function c65072007.filter(c)
return aux.IsCodeListed(c,65072000) and c:IsAbleToHand()
end
function c65072007.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65072007.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(11,0,aux.Stringid(65072007,0))
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c65072007.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c65072007.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
--actlimit
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(c65072007.actlimit)
Duel.RegisterEffect(e1,tp)
end
end
function c65072007.actlimit(e,te,tp)
return te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:IsActiveType(TYPE_SPELL) and te:GetHandler():IsType(TYPE_FIELD)
end
--鸡里奥
function c9980521.initial_effect(c)
aux.EnablePendulumAttribute(c)
--destroy & search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9980521,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,9980521)
e1:SetCondition(c9980521.thcon)
e1:SetTarget(c9980521.thtg)
e1:SetOperation(c9980521.thop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_ROCK))
e2:SetValue(500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--special summon from hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9980521,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_EXTRA+LOCATION_GRAVE)
e2:SetCountLimit(1,99805210)
e2:SetCondition(c9980521.spcon)
e2:SetCost(c9980521.spcost)
e2:SetTarget(c9980521.sptg)
e2:SetOperation(c9980521.spop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9980521,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetCountLimit(1,99805211)
e3:SetCondition(c9980521.atkcon)
e3:SetOperation(c9980521.atkop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(9980521,ACTIVITY_SPSUMMON,c9980521.counterfilter)
end
function c9980521.counterfilter(c)
return not c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c9980521.thcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c9980521.thfilter(c)
return c:IsSetCard(0x1bcf) and not c:IsCode(9980521)
and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c9980521.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDestructable() and Duel.IsExistingMatchingCard(c9980521.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c9980521.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c9980521.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
end
function c9980521.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldCard(tp,LOCATION_PZONE,0) and Duel.GetFieldCard(tp,LOCATION_PZONE,1)
end
function c9980521.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(9980521,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c9980521.splimit)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function c9980521.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c9980521.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 c9980521.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c9980521.atkfilter(c)
return c:IsRace(RACE_ROCK) and c:IsFaceup()
end
function c9980521.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d=c:GetBattleTarget()
local gc=Duel.GetMatchingGroupCount(c9980521.atkfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,nil)
return c==Duel.GetAttacker() and d and d:IsFaceup() and not d:IsControler(tp) and gc>0
end
function c9980521.atkop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttacker():GetBattleTarget()
local gc=Duel.GetMatchingGroupCount(c9980521.atkfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,nil)
if d:IsRelateToBattle() and d:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(-gc*500)
d:RegisterEffect(e1)
end
end
--鸡里奥
function c9980521.initial_effect(c)
aux.EnablePendulumAttribute(c)
--destroy & search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9980521,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,9980521)
e1:SetCondition(c9980521.thcon)
e1:SetTarget(c9980521.thtg)
e1:SetOperation(c9980521.thop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_ROCK))
e2:SetValue(500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--special summon from hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9980521,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_EXTRA+LOCATION_GRAVE)
e2:SetCountLimit(1,99805210)
e2:SetCondition(c9980521.spcon)
e2:SetCost(c9980521.spcost)
e2:SetTarget(c9980521.sptg)
e2:SetOperation(c9980521.spop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9980521,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetCountLimit(1,99805211)
e3:SetCondition(c9980521.atkcon)
e3:SetOperation(c9980521.atkop)
c:RegisterEffect(e3)
end
function c9980521.thcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c9980521.thfilter(c)
return c:IsSetCard(0x1bcf) and not c:IsCode(9980521)
and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c9980521.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDestructable() and Duel.IsExistingMatchingCard(c9980521.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c9980521.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c9980521.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
end
function c9980521.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldCard(tp,LOCATION_PZONE,0) and Duel.GetFieldCard(tp,LOCATION_PZONE,1)
end
function c9980521.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(9980521,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c9980521.splimit)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function c9980521.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c9980521.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 c9980521.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c9980521.atkfilter(c)
return c:IsRace(RACE_ROCK) and c:IsFaceup()
end
function c9980521.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d=c:GetBattleTarget()
local gc=Duel.GetMatchingGroupCount(c9980521.atkfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,nil)
return c==Duel.GetAttacker() and d and d:IsFaceup() and not d:IsControler(tp) and gc>0
end
function c9980521.atkop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttacker():GetBattleTarget()
local gc=Duel.GetMatchingGroupCount(c9980521.atkfilter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,nil)
if d:IsRelateToBattle() and d:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(-gc*500)
d:RegisterEffect(e1)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment