Commit 63aa6c77 authored by mercury233's avatar mercury233

new cards CYHO

parent 0704cd0c
--剛鬼ジャドウ・オーガ
function c10552026.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xfc),2,2)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10552026,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c10552026.negcon)
e1:SetTarget(c10552026.negtg)
e1:SetOperation(c10552026.negop)
c:RegisterEffect(e1)
end
function c10552026.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
local loc,seq,p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE,CHAININFO_TRIGGERING_CONTROLER)
if p==1-tp then seq=seq+16 end
return re:IsActiveType(TYPE_MONSTER) and bit.band(loc,LOCATION_MZONE)~=0 and bit.extract(c:GetLinkedZone(),seq)~=0 and Duel.IsChainNegatable(ev)
end
function c10552026.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c10552026.spfilter(c,e,tp)
return c:IsSetCard(0xfc) and not c:IsCode(10552026) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c10552026.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)>0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c10552026.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(10552026,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--魔晶龍ジルドラス
function c11074235.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11074235,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,11074235)
e1:SetCondition(c11074235.spcon)
e1:SetTarget(c11074235.sptg)
e1:SetOperation(c11074235.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
end
function c11074235.cfilter(c,tp)
return bit.band(c:GetPreviousTypeOnField(),TYPE_SPELL+TYPE_TRAP)~=0 and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp
end
function c11074235.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c11074235.cfilter,1,nil,tp)
end
function c11074235.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 c11074235.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsType(TYPE_FIELD) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSSetable()
end
function c11074235.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c11074235.setfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(11074235,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
Duel.SSet(tp,sg)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--サイバース・ウィッチ
function c11674673.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_CYBERSE),2,2)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11674673,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,11674673)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c11674673.thcon)
e1:SetCost(c11674673.thcost)
e1:SetTarget(c11674673.thtg)
e1:SetOperation(c11674673.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11674673,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,11674674)
e2:SetCondition(c11674673.spcon)
e2:SetTarget(c11674673.sptg)
e2:SetOperation(c11674673.spop)
c:RegisterEffect(e2)
end
function c11674673.thcfilter(c,tp,lg)
return c:IsControler(tp) and lg:IsContains(c)
end
function c11674673.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c11674673.thcfilter,1,nil,tp,lg)
end
function c11674673.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost()
end
function c11674673.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11674673.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c11674673.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c11674673.thfilter1(c,tp)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(c11674673.thfilter2,tp,LOCATION_DECK,0,1,c)
end
function c11674673.thfilter2(c)
return c:IsCode(34767865) and c:IsAbleToHand()
end
function c11674673.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11674673.thfilter1,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function c11674673.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.SelectMatchingCard(tp,c11674673.thfilter1,tp,LOCATION_DECK,0,1,1,nil,tp)
if g1:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c11674673.thfilter2,tp,LOCATION_DECK,0,1,1,g1:GetFirst())
g1:Merge(g2)
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
Duel.RegisterFlagEffect(tp,11674673,RESET_PHASE+PHASE_END,0,1)
end
function c11674673.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,11674673)>0
end
function c11674673.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c11674673.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c11674673.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c11674673.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c11674673.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c11674673.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--ハイ・キューピット
function c11851647.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(11851647,0))
e1:SetCategory(CATEGORY_LVCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,11851647)
e1:SetCost(c11851647.lvcost)
e1:SetOperation(c11851647.lvop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(11851647,1))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,11851648)
e2:SetCondition(c11851647.reccon)
e2:SetTarget(c11851647.rectg)
e2:SetOperation(c11851647.recop)
c:RegisterEffect(e2)
end
function c11851647.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
local ct={}
for i=3,1,-1 do
if Duel.IsPlayerCanDiscardDeckAsCost(tp,i) then
table.insert(ct,i)
end
end
if #ct==1 then
Duel.DiscardDeck(tp,ct[1],REASON_COST)
e:SetLabel(1)
else
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11851647,2))
local ac=Duel.AnnounceNumber(tp,table.unpack(ct))
Duel.DiscardDeck(tp,ac,REASON_COST)
e:SetLabel(ac)
end
end
function c11851647.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local ct=e:GetLabel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
e1:SetValue(ct)
c:RegisterEffect(e1)
end
end
function c11851647.reccon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:GetPreviousControler()==tp and bit.band(r,REASON_DESTROY)~=0 and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c11851647.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1500)
end
function c11851647.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--メタファイズ・デコイドラゴン
function c12196873.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12196873,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,12196873)
e1:SetCondition(c12196873.spcon1)
e1:SetTarget(c12196873.sptg1)
e1:SetOperation(c12196873.spop1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,12196874)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12196873,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCountLimit(1,12196875)
e3:SetRange(LOCATION_REMOVED)
e3:SetCondition(c12196873.spcon2)
e3:SetTarget(c12196873.sptg2)
e3:SetOperation(c12196873.spop2)
c:RegisterEffect(e3)
end
function c12196873.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget() and Duel.GetAttackTarget():IsControler(tp)
end
function c12196873.spfilter(c,e,tp)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0x105) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function c12196873.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c12196873.spfilter(chkc,e,tp) end
if chk==0 then return e:GetHandler():IsAbleToRemove()
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c12196873.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c12196873.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c12196873.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0
and c:IsLocation(LOCATION_REMOVED) and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK)
end
end
function c12196873.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetHandler():GetTurnID()+1
end
function c12196873.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c12196873.spop2(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 c12496261.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x29),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12496261,0))
e1:SetCategory(CATEGORY_LEAVE_GRAVE+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,12496261)
e1:SetTarget(c12496261.eqtg)
e1:SetOperation(c12496261.eqop)
c:RegisterEffect(e1)
--equip(self)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12496261,1))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,12496262)
e2:SetTarget(c12496261.eqstg)
e2:SetOperation(c12496261.eqsop)
c:RegisterEffect(e2)
end
function c12496261.filter(c)
return c:IsSetCard(0x29) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c12496261.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c12496261.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c12496261.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c12496261.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c12496261.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if not Duel.Equip(tp,tc,c,false) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c12496261.eqlimit)
tc:RegisterEffect(e1)
end
end
function c12496261.eqlimit(e,c)
return e:GetOwner()==c
end
function c12496261.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x29)
end
function c12496261.eqstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c12496261.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c12496261.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c12496261.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c12496261.eqsop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
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+0x1fe0000)
e1:SetValue(c12496261.eqlimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
end
--破滅の美神ルイン
function c13518809.initial_effect(c)
c:EnableReviveLimit()
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetValue(46427957)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(c13518809.indcon)
e2:SetTarget(c13518809.indtg)
e2:SetValue(1)
c:RegisterEffect(e2)
--extra attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetCondition(c13518809.condition)
e3:SetValue(1)
c:RegisterEffect(e3)
--damage
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetCondition(aux.bdocon)
e4:SetTarget(c13518809.damtg)
e4:SetOperation(c13518809.damop)
c:RegisterEffect(e4)
end
function c13518809.indcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c13518809.indtg(e,c)
return c:IsType(TYPE_RITUAL)
end
function c13518809.mfilter(c)
return not c:IsType(TYPE_RITUAL)
end
function c13518809.condition(e)
local c=e:GetHandler()
local mg=c:GetMaterial()
return c:GetSummonType()==SUMMON_TYPE_RITUAL and mg:GetCount()>0 and not mg:IsExists(c13518809.mfilter,1,nil)
end
function c13518809.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetHandler():GetBattleTarget()
local atk=tc:GetBaseAttack()
if atk<0 then atk=0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(atk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
function c13518809.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 c17688543.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c17688543.target)
e1:SetOperation(c17688543.activate)
c:RegisterEffect(e1)
end
function c17688543.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c17688543.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c17688543.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c17688543.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c17688543.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c17688543.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local fid=c:GetFieldID()
tc:RegisterFlagEffect(17688543,RESET_EVENT+0x1fe0000,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c17688543.spcon)
e1:SetOperation(c17688543.spop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
end
function c17688543.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c17688543.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc and tc:GetFlagEffectLabel(17688543)==e:GetLabel() then
Duel.Hint(HINT_CARD,0,17688543)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--剛鬼ムーンサルト
function c20191720.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(20191720,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,20191720)
e1:SetCost(c20191720.spcost)
e1:SetTarget(c20191720.sptg)
e1:SetOperation(c20191720.spop)
c:RegisterEffect(e1)
--to extra
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(20191720,1))
e2:SetCategory(CATEGORY_TOEXTRA)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,20191721)
e2:SetTarget(c20191720.tdtg)
e2:SetOperation(c20191720.tdop)
c:RegisterEffect(e2)
end
function c20191720.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c20191720.spfilter(c)
return c:IsSetCard(0xfc) and c:IsFaceup() and c:IsAbleToHand() and not c:IsCode(20191720)
end
function c20191720.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c20191720.spfilter(chkc) end
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c20191720.spfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c20191720.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c20191720.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
function c20191720.tdfilter(c)
return c:IsSetCard(0xfc) and c:IsType(TYPE_LINK) and c:IsAbleToExtra()
end
function c20191720.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c20191720.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c20191720.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c20191720.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c20191720.thfilter(c)
return c:IsSetCard(0xfc) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c20191720.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_EXTRA) then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c20191720.thfilter),tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(20191720,2)) then
Duel.BreakEffect()
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
end
--クロス・ブリード
function c20862918.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:SetCountLimit(1,20862918+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c20862918.cost)
e1:SetTarget(c20862918.target)
e1:SetOperation(c20862918.activate)
e1:SetLabel(0)
c:RegisterEffect(e1)
end
function c20862918.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c20862918.costfilter1(c,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c20862918.costfilter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,c,c,tp)
end
function c20862918.costfilter2(c,tc,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and c:GetOriginalRace()==tc:GetOriginalRace() and c:GetOriginalAttribute()==tc:GetOriginalAttribute() and c:GetOriginalCode()~=tc:GetOriginalCode()
and Duel.IsExistingMatchingCard(c20862918.thfilter,tp,LOCATION_DECK,0,1,nil,c,tc)
end
function c20862918.thfilter(c,tc1,tc2)
return c:GetOriginalRace()==tc1:GetOriginalRace() and c:GetOriginalAttribute()==tc1:GetOriginalAttribute()
and c:GetOriginalCode()~=tc1:GetOriginalCode() and c:GetOriginalCode()~=tc2:GetOriginalCode()
and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c20862918.target(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 e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsExistingMatchingCard(c20862918.costfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c20862918.costfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c20862918.costfilter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,g1:GetFirst(),g1:GetFirst(),tp)
g1:Merge(g2)
g1:KeepAlive()
e:SetLabelObject(g1)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c20862918.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=e:GetLabelObject()
local tc1=tg:GetFirst()
local tc2=tg:GetNext()
tg:DeleteGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c20862918.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc1,tc2)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--獣・魔・導
function c21984400.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21984400,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,21984400+EFFECT_COUNT_CODE_OATH)
e1:SetLabel(2)
e1:SetCost(c21984400.cost)
e1:SetTarget(c21984400.thtg)
e1:SetOperation(c21984400.thop)
c:RegisterEffect(e1)
--spsummon (mythical)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(21984400,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetLabel(4)
e2:SetTarget(c21984400.sptg1)
e2:SetOperation(c21984400.spop1)
c:RegisterEffect(e2)
--spsummon (generic)
local e3=e2:Clone()
e3:SetDescription(aux.Stringid(21984400,2))
e3:SetLabel(6)
e3:SetTarget(c21984400.sptg2)
e3:SetOperation(c21984400.spop2)
c:RegisterEffect(e3)
end
function c21984400.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetLabel()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x1,ct,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RemoveCounter(tp,1,0,0x1,ct,REASON_COST)
end
function c21984400.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10d) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c21984400.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21984400.thfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_MZONE)
end
function c21984400.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c21984400.thfilter,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function c21984400.spfilter1(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x10d) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c21984400.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c21984400.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c21984400.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c21984400.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
if tc:IsCanAddCounter(0x1,2) and Duel.SelectYesNo(tp,aux.Stringid(21984400,3)) then
tc:AddCounter(0x1,2)
end
end
end
function c21984400.spfilter2(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c21984400.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c21984400.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c21984400.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c21984400.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--サイバース・マジシャン
function c24731391.initial_effect(c)
c:EnableReviveLimit()
--halve damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetLabel(tp)
e1:SetValue(c24731391.val)
c:RegisterEffect(e1)
--target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetCondition(c24731391.atcon)
e2:SetValue(c24731391.atlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c24731391.atcon)
e3:SetTarget(c24731391.tglimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e4:SetCondition(c24731391.atkcon)
e4:SetOperation(c24731391.atkop)
c:RegisterEffect(e4)
--to hand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(24731391,0))
e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED)
e5:SetCondition(c24731391.thcon)
e5:SetTarget(c24731391.thtg)
e5:SetOperation(c24731391.thop)
c:RegisterEffect(e5)
end
function c24731391.val(e,re,dam,r,rp,rc)
if bit.band(r,REASON_BATTLE)>0 then return dam end
if bit.band(r,REASON_EFFECT)~=0 or bit.band(r,REASON_BATTLE)~=0 then
return dam/2
else
return dam
end
end
function c24731391.filter(c)
return c:IsType(TYPE_LINK)
end
function c24731391.atcon(e)
return Duel.IsExistingMatchingCard(c24731391.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c24731391.atlimit(e,c)
return c~=e:GetHandler()
end
function c24731391.tglimit(e,c)
return c~=e:GetHandler()
end
function c24731391.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsType(TYPE_LINK)
end
function c24731391.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(1000)
c:RegisterEffect(e1)
end
end
function c24731391.thfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c24731391.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp~=tp and c:GetPreviousControler()==tp
end
function c24731391.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c24731391.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c24731391.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c24731391.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--星遺物の交心
function c27705190.initial_effect(c)
--change effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(27705190,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,27705190)
e1:SetCondition(c27705190.cecondition)
e1:SetTarget(c27705190.cetarget)
e1:SetOperation(c27705190.ceoperation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(27705190,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,27705190)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c27705190.sptarget)
e2:SetOperation(c27705190.spoperation)
c:RegisterEffect(e2)
end
function c27705190.repop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.SelectMatchingCard(tp,c27705190.thfilter,tp,0,LOCATION_MZONE,1,1,nil)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end
function c27705190.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x104)
end
function c27705190.cecondition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(c27705190.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c27705190.thfilter(c)
return c:IsFaceup() and c:IsAbleToHand()
end
function c27705190.cetarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c27705190.thfilter,rp,0,LOCATION_MZONE,1,nil) end
end
function c27705190.ceoperation(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c27705190.repop)
end
function c27705190.spfilter1(c,e,tp)
local zone=bit.band(c:GetLinkedZone(tp),0x1f)
return c:IsFaceup() and c:IsType(TYPE_LINK) and zone>0 and Duel.IsExistingMatchingCard(c27705190.spfilter2,tp,0x13,0,1,c,e,tp,zone)
end
function c27705190.spfilter2(c,e,tp,zone)
return c:IsSetCard(0x104) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE,tp,zone)
end
function c27705190.sptarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c27705190.spfilter1(chkc,e,tp) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(c27705190.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c27705190.spfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0x13)
end
function c27705190.spoperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
local zone=bit.band(tc:GetLinkedZone(tp),0x1f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c27705190.spfilter2),tp,0x13,0,1,1,c,e,tp,zone)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE,zone)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--星遺物-『星冠』
function c27918365.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(27918365,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,27918365)
e1:SetCondition(c27918365.spcon)
e1:SetValue(c27918365.spval)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(27918365,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c27918365.negcon)
e2:SetCost(c27918365.negcost)
e2:SetTarget(c27918365.negtg)
e2:SetOperation(c27918365.negop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(27918365,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_RELEASE)
e3:SetCountLimit(1,27918366)
e3:SetCondition(c27918365.thcon)
e3:SetTarget(c27918365.thtg)
e3:SetOperation(c27918365.thop)
c:RegisterEffect(e3)
end
function c27918365.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c27918365.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c27918365.negcon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():GetSummonLocation()==LOCATION_EXTRA and loc==LOCATION_MZONE
and Duel.IsChainNegatable(ev)
end
function c27918365.negcost(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 c27918365.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c27918365.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c27918365.thfilter(c)
return c:IsSetCard(0xfe) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c27918365.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
end
function c27918365.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c27918365.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c27918365.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c27918365.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--百獣のパラディオン
function c28031913.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,28031913)
e1:SetCondition(c28031913.spcon)
e1:SetValue(c28031913.spval)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(28031913,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,28031914)
e2:SetCondition(c28031913.condition)
e2:SetTarget(c28031913.target)
e2:SetOperation(c28031913.operation)
c:RegisterEffect(e2)
end
function c28031913.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c28031913.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c28031913.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c28031913.filter(c)
return c:IsFaceup() and c:IsSetCard(0x116) and c:IsType(TYPE_LINK) and not c:IsHasEffect(EFFECT_PIERCE)
end
function c28031913.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(c28031913.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c28031913.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c28031913.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PIERCE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--ドラグニティ・ドライブ
function c28927782.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,28927782)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c28927782.eftg)
e2:SetOperation(c28927782.efop)
c:RegisterEffect(e2)
end
function c28927782.spfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x29) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c28927782.eqfilter1(c,tp)
return c:IsFaceup() and c:IsSetCard(0x29) and Duel.IsExistingMatchingCard(c28927782.eqfilter2,tp,LOCATION_GRAVE,0,1,nil,c,tp)
end
function c28927782.eqfilter2(c,tc,tp)
return c:IsSetCard(0x29) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c28927782.eftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
if e:GetLabel()==0 then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c28927782.spfilter(chkc,e,tp)
else return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c28927782.eqfilter1(chkc,tp) end
end
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c28927782.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c28927782.eqfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(28927782,1),aux.Stringid(28927782,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(28927782,1))
else op=Duel.SelectOption(tp,aux.Stringid(28927782,2))+1 end
e:SetLabel(op)
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c28927782.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
else
e:SetCategory(CATEGORY_EQUIP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c28927782.eqfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
end
function c28927782.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if e:GetLabel()==0 then
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
else
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local ec=Duel.GetFirstTarget()
if ec:IsRelateToEffect(e) and ec:IsFaceup() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c28927782.eqfilter2),tp,LOCATION_GRAVE,0,1,1,nil,ec,tp)
local tc=g:GetFirst()
if not tc or not Duel.Equip(tp,tc,ec,true) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c28927782.eqlimit2)
e1:SetLabelObject(ec)
tc:RegisterEffect(e1)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(c28927782.splimit)
Duel.RegisterEffect(e1,tp)
end
function c28927782.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x29)
end
function c28927782.eqlimit2(e,c)
return c==e:GetLabelObject()
end
--ドラグニティ-クーゼ
function c29253591.initial_effect(c)
--synchro limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(c29253591.synlimit)
c:RegisterEffect(e1)
--synchro level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SYNCHRO_LEVEL)
e2:SetValue(c29253591.slevel)
c:RegisterEffect(e2)
--special summon while equipped
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29253591,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(c29253591.sptg)
e3:SetOperation(c29253591.spop)
c:RegisterEffect(e3)
end
function c29253591.synlimit(e,c)
if not c then return false end
return not c:IsSetCard(0x29)
end
function c29253591.slevel(e,c)
local lv=e:GetHandler():GetLevel()
return 4*65536+lv
end
function c29253591.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 c29253591.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 c29649320.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c29649320.thcon)
e2:SetCost(c29649320.thcost)
e2:SetTarget(c29649320.thtg)
e2:SetOperation(c29649320.thop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c29649320.setcon)
e3:SetTarget(c29649320.settg)
e3:SetOperation(c29649320.setop)
c:RegisterEffect(e3)
end
function c29649320.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c29649320.thcfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function c29649320.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29649320.thcfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c29649320.thcfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c29649320.thfilter(c)
return c:IsCode(44095762) and c:IsAbleToHand()
end
function c29649320.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29649320.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c29649320.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29649320.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c29649320.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c29649320.setfilter(c)
return c:IsCode(44095762) and c:IsSSetable()
end
function c29649320.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>1
and e:GetHandler():IsSSetable() and Duel.IsExistingMatchingCard(c29649320.setfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c29649320.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<2 or not c:IsRelateToEffect(e) or not c:IsSSetable() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29649320.setfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local sg=Group.FromCards(c,tc)
Duel.SSet(tp,sg)
Duel.ConfirmCards(1-tp,sg)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
tc:RegisterEffect(e2)
end
end
--サイバー・ドラゴン・フィーア
function c29975188.initial_effect(c)
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetValue(70095154)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29975188,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,29975188)
e2:SetCondition(c29975188.spcon)
e2:SetTarget(c29975188.sptg)
e2:SetOperation(c29975188.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(aux.TargetBoolFunction(Card.IsCode,70095154))
e4:SetValue(500)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e5)
end
function c29975188.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(70095154) and c:GetSummonPlayer()==tp
end
function c29975188.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c29975188.cfilter,1,nil,tp)
end
function c29975188.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,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29975188.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--星遺物の醒存
function c31706048.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,31706048+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c31706048.target)
e1:SetOperation(c31706048.activate)
c:RegisterEffect(e1)
end
function c31706048.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c31706048.filter(c)
return (c:IsSetCard(0x104) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0xfe)
end
function c31706048.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,5) then return end
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5)
if g:GetCount()>0 then
if g:IsExists(c31706048.filter,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c31706048.filter,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
g:Sub(sg)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
else
Duel.ShuffleDeck(tp)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c31706048.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c31706048.splimit(e,c)
return not c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_EXTRA)
end
--エンドレス・オブ・ザ・ワールド
function c32828635.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:SetTarget(c32828635.target)
e1:SetOperation(c32828635.activate)
c:RegisterEffect(e1)
--salvage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32828635,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(c32828635.thcost)
e2:SetTarget(c32828635.thtg)
e2:SetOperation(c32828635.thop)
c:RegisterEffect(e2)
end
c32828635.fit_monster={46427957,72426662}
function c32828635.cfilter(c,e,tp,m)
if bit.band(c:GetType(),0x81)~=0x81 or not c:IsCode(46427957,72426662)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
function c32828635.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
mg1:Remove(Card.IsLocation,nil,LOCATION_HAND)
return Duel.IsExistingMatchingCard(c32828635.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c32828635.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp)
mg1:Remove(Card.IsLocation,nil,LOCATION_HAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c32828635.cfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1)
local tc=tg:GetFirst()
if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c32828635.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function c32828635.filter(c)
return c:IsCode(8198712) and c:IsAbleToHand()
end
function c32828635.filter2(c)
return c:IsCode(46427957,72426662) and c:IsAbleToHand()
end
function c32828635.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c32828635.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c32828635.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c32828635.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c32828635.filter2),tp,LOCATION_GRAVE,0,nil)
if mg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(32828635,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=mg:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--サイバー・レヴシステム
function c33041277.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:SetTarget(c33041277.target)
e1:SetOperation(c33041277.activate)
c:RegisterEffect(e1)
end
function c33041277.filter(c,e,tp)
return c:IsCode(70095154) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33041277.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c33041277.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c33041277.activate(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(c33041277.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
g:GetFirst():RegisterEffect(e1)
end
end
--サイバネット・リチューアル
function c34767865.initial_effect(c)
aux.AddRitualProcGreater(c,c34767865.ritual_filter)
--token
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetDescription(aux.Stringid(34767865,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c34767865.spcon)
e1:SetCost(c34767865.spcost)
e1:SetTarget(c34767865.sptg)
e1:SetOperation(c34767865.spop)
c:RegisterEffect(e1)
end
function c34767865.ritual_filter(c)
return c:IsType(TYPE_RITUAL) and c:IsRace(RACE_CYBERSE)
end
function c34767865.spcon(e,tp,eg,ep,ev,re,r,rp)
return aux.exccon(e) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c34767865.cfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c34767865.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c34767865.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c34767865.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c34767865.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,34767866,0,0x4011,0,0,4,RACE_CYBERSE,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0)
end
function c34767865.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,34767866,0,0x4011,0,0,4,RACE_CYBERSE,ATTRIBUTE_LIGHT) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,34767866)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
--リプロドクス
function c34989413.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34989413,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,34989413)
e1:SetTarget(c34989413.ractg)
e1:SetOperation(c34989413.racop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(34989413,1))
e2:SetTarget(c34989413.atttg)
e2:SetOperation(c34989413.attop)
c:RegisterEffect(e2)
end
function c34989413.filter(c,g)
return c:IsFaceup() and g:IsContains(c)
end
function c34989413.ractg(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.IsExistingMatchingCard(c34989413.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,lg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RACE)
local rac=Duel.AnnounceRace(tp,1,RACE_ALL)
e:SetLabel(rac)
end
function c34989413.racop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local lg=c:GetLinkedGroup()
local g=Duel.GetMatchingGroup(c34989413.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,lg)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function c34989413.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.IsExistingMatchingCard(c34989413.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,lg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xffff)
e:SetLabel(att)
end
function c34989413.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local lg=c:GetLinkedGroup()
local g=Duel.GetMatchingGroup(c34989413.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,lg)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--アークロード・パラディオン
function c45002991.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,99,c45002991.lcheck)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c45002991.atkval)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c45002991.antg)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(45002991,0))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,0x1c0)
e3:SetCountLimit(1)
e3:SetCost(c45002991.discost)
e3:SetTarget(c45002991.distg)
e3:SetOperation(c45002991.disop)
c:RegisterEffect(e3)
end
function c45002991.lcheck(g,lc)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_LINK)
end
function c45002991.atkval(e,c)
local g=e:GetHandler():GetLinkedGroup():Filter(Card.IsFaceup,nil)
return g:GetSum(Card.GetBaseAttack)
end
function c45002991.antg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c45002991.cfilter(c,g)
return (c:IsSetCard(0xfe) or c:IsSetCard(0x116)) and g:IsContains(c)
end
function c45002991.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.CheckReleaseGroup(tp,c45002991.cfilter,1,nil,lg) end
local g=Duel.SelectReleaseGroup(tp,c45002991.cfilter,1,1,nil,lg)
Duel.Release(g,REASON_COST)
end
function c45002991.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c45002991.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
end
--サイバー・ドラゴン・ズィーガー
function c46724542.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_MACHINE),2,2,c46724542.lcheck)
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetValue(70095154)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(46724542,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCountLimit(1,46724542)
e2:SetCondition(c46724542.con)
e2:SetTarget(c46724542.target)
e2:SetOperation(c46724542.operation)
c:RegisterEffect(e2)
end
function c46724542.lcheck(g,lc)
return g:IsExists(Card.IsLinkCode,1,nil,70095154)
end
function c46724542.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()) and e:GetHandler():GetAttackAnnouncedCount()<1
end
function c46724542.filter(c)
return c:IsFaceup() and c:IsAttackAbove(2100) and c:IsRace(RACE_MACHINE)
end
function c46724542.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c46724542.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c46724542.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c46724542.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c46724542.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(2100)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e4:SetValue(1)
c:RegisterEffect(e4)
end
end
--寝ガエル
function c47346782.initial_effect(c)
--cannot material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e4)
--to defense
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(47346782,0))
e5:SetCategory(CATEGORY_POSITION)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_SUMMON_SUCCESS)
e5:SetTarget(c47346782.postg)
e5:SetOperation(c47346782.posop)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e6)
--control
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(47346782,1))
e7:SetCategory(CATEGORY_CONTROL)
e7:SetType(EFFECT_TYPE_IGNITION)
e7:SetProperty(EFFECT_FLAG_CARD_TARGET)
e7:SetRange(LOCATION_MZONE)
e7:SetCountLimit(1)
e7:SetTarget(c47346782.cttg)
e7:SetOperation(c47346782.ctop)
c:RegisterEffect(e7)
end
function c47346782.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_POSITION,e:GetHandler(),1,0,0)
end
function c47346782.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttackPos() and c:IsRelateToEffect(e) then
Duel.ChangePosition(c,POS_FACEUP_DEFENSE)
end
end
function c47346782.ctfilter1(c,tp)
local seq=c:GetSequence()
if seq>4 then return false end
return (seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1))
end
function c47346782.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c47346782.ctfilter1(chkc,1-tp) end
if chk==0 then return Duel.IsExistingTarget(c47346782.ctfilter1,tp,0,LOCATION_MZONE,1,nil,1-tp)
and e:GetHandler():IsControlerCanBeChanged() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c47346782.ctfilter1,tp,0,LOCATION_MZONE,1,1,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end
function c47346782.ctfilter2(c)
return c:GetSequence()<5 and c:IsFaceup() and c:IsCode(47346782)
end
function c47346782.ctfilter3(c,seq1,seq2)
local seq=c:GetSequence()
return seq>seq1 and seq<seq2 and c:IsControlerCanBeChanged()
end
function c47346782.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) or not c:IsPosition(POS_FACEUP_DEFENSE) then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or not tc:IsControler(1-tp) then return end
local seq=tc:GetSequence()
if seq>4 then return end
if (seq>0 and Duel.CheckLocation(1-tp,LOCATION_MZONE,seq-1))
or (seq<4 and Duel.CheckLocation(1-tp,LOCATION_MZONE,seq+1)) then
local zone=0
if seq>0 and Duel.CheckLocation(1-tp,LOCATION_MZONE,seq-1) then zone=bit.replace(zone,0x1,seq-1) end
if seq<4 and Duel.CheckLocation(1-tp,LOCATION_MZONE,seq+1) then zone=bit.replace(zone,0x1,seq+1) end
if Duel.GetControl(c,1-tp,0,0,zone)==0 then return end
local g1=Duel.GetMatchingGroup(c47346782.ctfilter2,tp,0,LOCATION_MZONE,nil)
if g1:GetCount()==2 then
local seq1=g1:GetFirst():GetSequence()
local seq2=g1:GetNext():GetSequence()
if seq1>seq2 then seq1,seq2=seq2,seq1 end
local g2=Duel.GetMatchingGroup(c47346782.ctfilter3,tp,0,LOCATION_MZONE,nil,seq1,seq2)
if g2:GetCount()>0 then
Duel.BreakEffect()
Duel.GetControl(g2,tp)
end
end
end
end
--剛鬼ザ・ジャイアント・オーガ
function c47946130.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0xfc),3)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c47946130.immval)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(47946130,0))
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c47946130.negcon)
e3:SetTarget(c47946130.negtg)
e3:SetOperation(c47946130.negop)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(47946130,1))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c47946130.atkcon)
e4:SetOperation(c47946130.atkop)
c:RegisterEffect(e4)
end
function c47946130.immval(e,te)
return te:GetOwner()~=e:GetHandler() and te:IsActiveType(TYPE_MONSTER) and te:GetOwnerPlayer()~=e:GetHandlerPlayer()
and te:GetOwner():GetAttack()<=e:GetHandler():GetAttack() and te:IsActivated()
end
function c47946130.negfilter(c,g)
return g:IsContains(c)
end
function c47946130.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if rp==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local lg=e:GetHandler():GetLinkedGroup()
lg:AddCard(c)
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and lg:IsExists(c47946130.negfilter,1,nil,tg) and Duel.IsChainNegatable(ev)
end
function c47946130.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c47946130.negop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:IsFacedown() or c:GetAttack()<500 or not c:IsRelateToEffect(e)
or Duel.GetCurrentChain()~=ev+1 or c:IsStatus(STATUS_BATTLE_DESTROYED) then
return
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
c:RegisterEffect(e1)
if not c:IsImmuneToEffect(e1) and not c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
Duel.NegateActivation(ev)
end
end
function c47946130.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetAttack()~=c:GetBaseAttack() and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated())
end
function c47946130.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
--リンク・ディヴォーティー
function c48068378.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c48068378.matfilter,1,1)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(48068378,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c48068378.limop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(48068378,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,48068378)
e2:SetCondition(c48068378.spcon)
e2:SetTarget(c48068378.sptg)
e2:SetOperation(c48068378.spop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_LEAVE_FIELD_P)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetLabelObject(e2)
e3:SetOperation(c48068378.chk)
c:RegisterEffect(e3)
end
function c48068378.chk(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(e:GetHandler():GetMutualLinkedGroupCount())
end
function c48068378.matfilter(c,lc,sumtype,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE,lc,sumtype,tp)
end
function c48068378.limop(e,tp,eg,ep,ev,re,r,rp,c)
--cannot link summon
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c48068378.splimit)
Duel.RegisterEffect(e1,tp)
end
function c48068378.splimit(e,c,tp,sumtp,sumpos)
return c:IsType(TYPE_LINK) and c:IsLinkAbove(3) and bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function c48068378.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabel()>0
end
function c48068378.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,48068379,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0)
end
function c48068378.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2
or not Duel.IsPlayerCanSpecialSummonMonster(tp,48068379,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT) then return end
for i=1,2 do
local token=Duel.CreateToken(tp,48068379)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
--魔神童
function c48468330.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(48468330,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,48468330)
e1:SetCondition(c48468330.spcon)
e1:SetTarget(c48468330.sptg)
e1:SetOperation(c48468330.spop)
c:RegisterEffect(e1)
--flip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(48468330,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,48468331)
e2:SetTarget(c48468330.tgtg)
e2:SetOperation(c48468330.tgop)
c:RegisterEffect(e2)
end
function c48468330.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_DECK)
end
function c48468330.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,POS_FACEDOWN_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c48468330.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)~=0 then
Duel.ConfirmCards(1-tp,c)
end
end
function c48468330.tgfilter(c)
return c:IsRace(RACE_FIEND) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c48468330.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c48468330.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c48468330.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c48468330.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--ドラグニティナイト-アスカロン
function c48891960.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x29),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--banish
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(48891960,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c48891960.rmcost)
e1:SetTarget(c48891960.rmtg)
e1:SetOperation(c48891960.rmop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(48891960,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,48891960)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c48891960.spcon)
e2:SetTarget(c48891960.sptg)
e2:SetOperation(c48891960.spop)
c:RegisterEffect(e2)
end
function c48891960.cfilter(c)
return c:IsSetCard(0x29) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c48891960.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c48891960.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c48891960.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c48891960.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c48891960.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function c48891960.spfilter(c,e,tp)
return c:IsSetCard(0x29) and c:IsAttackBelow(3000) and c:IsType(TYPE_SYNCHRO)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function c48891960.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c48891960.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL)
and Duel.IsExistingMatchingCard(c48891960.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c48891960.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 or not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c48891960.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then
tc:CompleteProcedure()
end
end
--破滅の天使ルイン
function c50139096.initial_effect(c)
c:EnableReviveLimit()
--multi attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(aux.Stringid(50139096,0))
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c50139096.atkcon)
e1:SetOperation(c50139096.atkop)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50139096,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetTarget(c50139096.target)
e2:SetOperation(c50139096.operation)
c:RegisterEffect(e2)
--name change
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetRange(LOCATION_MZONE+LOCATION_HAND)
e3:SetValue(46427957)
c:RegisterEffect(e3)
end
function c50139096.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c50139096.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetValue(2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c50139096.filter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL)
end
function c50139096.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c50139096.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c50139096.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c50139096.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c50139096.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c50139096.actcon)
e1:SetOperation(c50139096.actop)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(50139096,2))
end
end
function c50139096.actcon(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetAttacker()
return ac and ac:IsControler(tp) and ac:IsType(TYPE_RITUAL)
end
function c50139096.actop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(c50139096.actlimit)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
function c50139096.actlimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
--単一化
function c53077251.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c53077251.condition)
e1:SetTarget(c53077251.target)
e1:SetOperation(c53077251.activate)
c:RegisterEffect(e1)
end
function c53077251.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c53077251.filter(c,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c53077251.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetAttack())
end
function c53077251.filter2(c,atk)
return c:IsFaceup() and c:GetAttack()~=atk
end
function c53077251.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c53077251.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c53077251.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c53077251.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
end
function c53077251.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
local atk=tc:GetAttack()
local g=Duel.GetMatchingGroup(c53077251.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,tc,atk)
for sc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
end
end
--魔神儀-キャンドール
function c53303460.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53303460,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,53303460)
e1:SetCost(c53303460.spcost)
e1:SetTarget(c53303460.sptg)
e1:SetOperation(c53303460.spop)
c:RegisterEffect(e1)
--effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(53303460,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,53303460)
e2:SetCondition(c53303460.thcon)
e2:SetTarget(c53303460.thtg)
e2:SetOperation(c53303460.thop)
c:RegisterEffect(e2)
--spsummon limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c53303460.sumlimit)
c:RegisterEffect(e3)
end
function c53303460.filter(c,e,tp)
return c:IsSetCard(0x117) and not c:IsCode(53303460) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c53303460.costfilter(c)
return c:GetType()==0x82 and not c:IsPublic()
end
function c53303460.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c53303460.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c53303460.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c53303460.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c53303460.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function c53303460.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c53303460.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
g:AddCard(e:GetHandler())
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c53303460.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function c53303460.thfilter(c)
return c:GetType()==0x82 and c:IsAbleToHand()
end
function c53303460.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c53303460.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c53303460.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c53303460.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c53303460.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA)
end
--メタファイズ・アセンション
function c54199839.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,54199839)
e1:SetCost(c54199839.cost)
e1:SetTarget(c54199839.target)
e1:SetOperation(c54199839.activate)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,54199839)
e2:SetTarget(c54199839.thtg)
e2:SetOperation(c54199839.thop)
c:RegisterEffect(e2)
end
function c54199839.cfilter(c)
return c:IsSetCard(0x105) and c:IsDiscardable()
end
function c54199839.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c54199839.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c54199839.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c54199839.target(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 c54199839.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x105) and c:IsAbleToRemove()
end
function c54199839.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(c54199839.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(54199839,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
end
function c54199839.thfilter(c)
return c:IsSetCard(0x105) and not c:IsCode(54199839) and c:IsAbleToHand()
end
function c54199839.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c54199839.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c54199839.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c54199839.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--星辰のパラディオン
function c54525057.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,54525057)
e1:SetCondition(c54525057.spcon)
e1:SetValue(c54525057.spval)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(54525057,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,54525058)
e2:SetCondition(c54525057.thcon)
e2:SetTarget(c54525057.thtg)
e2:SetOperation(c54525057.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c54525057.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c54525057.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c54525057.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg1=Duel.GetLinkedGroup(tp,1,1)
local lg2=Duel.GetLinkedGroup(1-tp,1,1)
lg1:Merge(lg2)
return lg1 and lg1:IsContains(e:GetHandler())
end
function c54525057.thfilter(c)
return c:IsSetCard(0x116) and not c:IsCode(54525057) and c:IsAbleToHand()
end
function c54525057.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c54525057.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c54525057.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c54525057.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c54525057.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--リンク・デス・ターレット
function c55034079.initial_effect(c)
c:EnableCounterPermit(0x48)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c55034079.target)
e1:SetOperation(c55034079.activate)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c55034079.ctcon)
e2:SetOperation(c55034079.ctop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c55034079.spcon)
e3:SetCost(c55034079.spcost)
e3:SetTarget(c55034079.sptg)
e3:SetOperation(c55034079.spop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(55034079,ACTIVITY_SPSUMMON,c55034079.counterfilter)
end
function c55034079.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanAddCounter(tp,0x48,4,c) end
end
function c55034079.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(0x48,4)
end
end
function c55034079.counterfilter(c)
return c:GetSummonLocation()~=LOCATION_EXTRA or (c:IsType(TYPE_LINK) and c:IsAttribute(ATTRIBUTE_DARK))
end
function c55034079.ctcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE)==REASON_BATTLE
end
function c55034079.ctop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x48,1)
end
function c55034079.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c55034079.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanRemoveCounter(tp,0x48,1,REASON_EFFECT)
and Duel.GetCustomActivityCount(55034079,tp,ACTIVITY_SPSUMMON)==0 end
c:RemoveCounter(tp,0x48,1,REASON_EFFECT)
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:SetTargetRange(1,0)
e1:SetTarget(c55034079.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c55034079.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsType(TYPE_LINK) and c:IsAttribute(ATTRIBUTE_DARK)) and c:IsLocation(LOCATION_EXTRA)
end
function c55034079.spfilter(c,e,tp)
return c:IsSetCard(0x102) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c55034079.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c55034079.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c55034079.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c55034079.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c55034079.spop(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 Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0xfe0000)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0xfe0000)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+0x47e0000)
e3:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e3,true)
end
end
--魔境のパラディオン
function c55241609.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,55241609)
e1:SetCondition(c55241609.spcon)
e1:SetValue(c55241609.spval)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(55241609,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,55241610)
e2:SetCondition(c55241609.descon)
e2:SetTarget(c55241609.destg)
e2:SetOperation(c55241609.desop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c55241609.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c55241609.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c55241609.descon(e,tp,eg,ep,ev,re,r,rp)
local lg1=Duel.GetLinkedGroup(tp,1,1)
local lg2=Duel.GetLinkedGroup(1-tp,1,1)
lg1:Merge(lg2)
return lg1 and lg1:IsContains(e:GetHandler())
end
function c55241609.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0x116)
end
function c55241609.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c55241609.desfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c55241609.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
end
function c55241609.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--クルセイド・パラディオン
function c55312487.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,55312487+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c55312487.target)
c:RegisterEffect(e1)
--atk limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(c55312487.atcon)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetValue(c55312487.atlimit)
c:RegisterEffect(e3)
end
function c55312487.spfilter1(c,e,tp)
return (c:IsSetCard(0xfe) or c:IsSetCard(0x116)) and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c55312487.spfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,c:GetOriginalCode())
end
function c55312487.spfilter2(c,e,tp,code)
return (c:IsSetCard(0xfe) or c:IsSetCard(0x116)) and c:GetOriginalCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c55312487.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.CheckReleaseGroup(tp,c55312487.spfilter1,1,nil,e,tp)
and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(55312487,0)) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(c55312487.activate)
local rg=Duel.SelectReleaseGroup(tp,c55312487.spfilter1,1,1,nil,e,tp)
e:SetLabel(rg:GetFirst():GetOriginalCode())
Duel.Release(rg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
else
e:SetCategory(0)
e:SetOperation(nil)
end
end
function c55312487.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local code=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c55312487.spfilter2),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,code)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c55312487.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x116) and c:IsType(TYPE_LINK)
end
function c55312487.atcon(e)
return Duel.IsExistingMatchingCard(c55312487.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c55312487.atlimit(e,c)
return c:IsFacedown() or not c:IsType(TYPE_LINK)
end
--予言通帳
function c56256517.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,56256517+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c56256517.target)
e1:SetOperation(c56256517.activate)
c:RegisterEffect(e1)
end
function c56256517.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,3)
if chk==0 then return g:FilterCount(Card.IsAbleToRemove,nil)==3 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK)
end
function c56256517.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end
if ct>3 then ct=3 end
local g=Duel.GetDecktopGroup(tp,ct)
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
g:KeepAlive()
local c=e:GetHandler()
c:SetTurnCounter(0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabelObject(g)
e1:SetCondition(c56256517.thcon)
e1:SetOperation(c56256517.thop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,3)
Duel.RegisterEffect(e1,tp)
end
function c56256517.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c56256517.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==3 then
local g=e:GetLabelObject()
if g:GetCount()==3 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
end
--サイバー・ドラゴン・ヘルツ
function c56364287.initial_effect(c)
--name change
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetValue(70095154)
c:RegisterEffect(e1)
--level change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(56364287,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,56364287)
e2:SetTarget(c56364287.lvtg)
e2:SetOperation(c56364287.lvop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(56364287,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,56364287)
e3:SetTarget(c56364287.thtg)
e3:SetOperation(c56364287.thop)
c:RegisterEffect(e3)
end
function c56364287.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsLevel(5) end
end
function c56364287.lvop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(5)
c:RegisterEffect(e1)
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTargetRange(1,0)
e2:SetLabelObject(e)
e2:SetTarget(c56364287.splimit)
Duel.RegisterEffect(e2,tp)
end
function c56364287.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_MACHINE)
end
function c56364287.thfilter(c)
return c:IsCode(70095154) and c:IsAbleToHand()
end
function c56364287.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c56364287.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c56364287.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c56364287.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,e:GetHandler())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--闇霊神オブルミラージュ
function c59281822.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c59281822.spcon)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(59281822,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,59281822)
e3:SetTarget(c59281822.thtg)
e3:SetOperation(c59281822.thop)
c:RegisterEffect(e3)
--leave
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetOperation(c59281822.leaveop)
c:RegisterEffect(e4)
end
function c59281822.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.GetMatchingGroupCount(Card.IsAttribute,c:GetControler(),LOCATION_GRAVE,0,nil,ATTRIBUTE_DARK)==5
end
function c59281822.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c59281822.thfilter(c)
return c:IsAttackBelow(1500) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c59281822.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c59281822.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c59281822.leaveop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsFacedown() then return end
local effp=e:GetHandler():GetControler()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
if Duel.GetTurnPlayer()==effp then
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c59281822.skipcon)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e1,effp)
end
function c59281822.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
--終焉の覇王デミス
function c59913418.initial_effect(c)
c:EnableReviveLimit()
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetValue(72426662)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(c59913418.indcon)
e2:SetTarget(c59913418.indtg)
e2:SetValue(1)
c:RegisterEffect(e2)
--cost change
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_LPCOST_CHANGE)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetRange(LOCATION_MZONE)
e0:SetTargetRange(1,1)
e0:SetCondition(c59913418.costcon)
e0:SetValue(c59913418.costval)
c:RegisterEffect(e0)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c59913418.descost)
e3:SetTarget(c59913418.destg)
e3:SetOperation(c59913418.desop)
c:RegisterEffect(e3)
end
function c59913418.indcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c59913418.indtg(e,c)
return c:IsType(TYPE_RITUAL)
end
function c59913418.mfilter(c)
return not c:IsType(TYPE_RITUAL)
end
function c59913418.costcon(e)
local c=e:GetHandler()
local mg=c:GetMaterial()
return c:GetSummonType()==SUMMON_TYPE_RITUAL and mg:GetCount()>0 and not mg:IsExists(c59913418.mfilter,1,nil)
end
function c59913418.costchange(e,re,rp,val)
if re and re:IsHasType(0x7e0) and re:GetHandler()==e:GetHandler() then
return 0
else return val end
end
function c59913418.descost(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 c59913418.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local ct=g:FilterCount(Card.IsControler,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*200)
end
function c59913418.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.Destroy(g,REASON_EFFECT)
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsControler,nil,1-tp)
if ct>0 then
Duel.Damage(1-tp,ct*200,REASON_EFFECT)
end
end
--ゼロ・エクストラリンク
function c60162470.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c60162470.target)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetLabelObject(e1)
e2:SetCondition(c60162470.tgcon)
e2:SetOperation(c60162470.tgop)
c:RegisterEffect(e2)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c60162470.atktg1)
e3:SetValue(c60162470.atkval1)
c:RegisterEffect(e3)
--atkup
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(60162470,0))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_SZONE)
e4:SetTarget(c60162470.atktg2)
e4:SetOperation(c60162470.atkop2)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
e5:SetCode(EFFECT_MATERIAL_CHECK)
e5:SetRange(LOCATION_SZONE)
e5:SetValue(c60162470.valcheck)
c:RegisterEffect(e5)
--destroy
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(60162470,0))
e6:SetCategory(CATEGORY_DESTROY)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_BATTLED)
e6:SetRange(LOCATION_SZONE)
e6:SetCondition(c60162470.descon)
e6:SetTarget(c60162470.destg)
e6:SetOperation(c60162470.desop)
c:RegisterEffect(e6)
end
function c60162470.lkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:GetSequence()>4
end
function c60162470.filter(c,g)
return c:IsFaceup() and c:IsType(TYPE_LINK) and g:IsContains(c)
end
function c60162470.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Group.CreateGroup()
local lg=Duel.GetMatchingGroup(c60162470.lkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(lg) do
tg:Merge(tc:GetMutualLinkedGroup())
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c60162470.filter(chkc,tg) end
if chk==0 then return Duel.IsExistingTarget(c60162470.filter,tp,LOCATION_MZONE,0,1,nil,tg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c60162470.filter,tp,LOCATION_MZONE,0,1,1,nil,tg)
end
function c60162470.tgcon(e,tp,eg,ep,ev,re,r,rp)
return re==e:GetLabelObject()
end
function c60162470.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS):GetFirst()
if c:IsRelateToEffect(re) and tc:IsFaceup() and tc:IsRelateToEffect(re) then
c:SetCardTarget(tc)
end
end
function c60162470.atktg1(e,c)
return e:GetHandler():IsHasCardTarget(c)
end
function c60162470.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c60162470.atkval1(e,c)
local atk=Duel.GetMatchingGroupCount(c60162470.atkfilter,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,nil)*800
e:SetLabel(atk)
return atk
end
function c60162470.matfilter(c,mc)
return mc:IsHasCardTarget(c)
end
function c60162470.valcheck(e,c)
if c:GetMaterial():IsExists(c60162470.matfilter,1,nil,e:GetHandler()) then
c:RegisterFlagEffect(60162470,RESET_EVENT+0x4fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c60162470.cfilter(c,tp)
return c:IsControler(tp) and c:IsSummonType(SUMMON_TYPE_LINK) and c:GetFlagEffect(60162470)~=0
end
function c60162470.atktg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c60162470.cfilter,1,nil,tp) end
Duel.SetTargetCard(eg)
end
function c60162470.atkop2(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=e:GetLabelObject():GetLabel()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c60162470.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsHasCardTarget(Duel.GetAttacker())
end
function c60162470.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c60162470.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Destroy(c,REASON_EFFECT)
end
end
--ヴァレル・リロード
function c6556178.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,6556178)
e1:SetTarget(c6556178.target)
e1:SetOperation(c6556178.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetOperation(c6556178.checkop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(c6556178.rmop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(6556178,1))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,6556179)
e4:SetCondition(c6556178.drcon)
e4:SetTarget(c6556178.drtg)
e4:SetOperation(c6556178.drop)
c:RegisterEffect(e4)
end
function c6556178.spfilter(c,e,tp)
return c:IsSetCard(0x102) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c6556178.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c6556178.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c6556178.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c6556178.spfilter,tp,LOCATION_GRAVE,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 c6556178.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e)
and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
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+0x1fe0000)
e1:SetValue(c6556178.eqlimit)
c:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end
end
function c6556178.eqlimit(e,c)
return e:GetOwner()==c
end
function c6556178.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then
e:SetLabel(1)
else e:SetLabel(0) end
end
function c6556178.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
if c:IsReason(REASON_DESTROY) and tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function c6556178.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_DESTROY)
end
function c6556178.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 c6556178.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--SIMMタブラス
function c67218327.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67218327,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,67218327)
e1:SetCost(c67218327.cost)
e1:SetTarget(c67218327.target)
e1:SetOperation(c67218327.operation)
c:RegisterEffect(e1)
end
function c67218327.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c67218327.lkfilter(c)
return c:IsType(TYPE_LINK) and c:IsLinkState()
end
function c67218327.filter(c)
return c:IsRace(RACE_CYBERSE) and c:GetLevel()==4 and c:IsAbleToHand()
end
function c67218327.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c67218327.filter(chkc) end
local c=e:GetHandler()
if chk==0 then
local lg=Duel.GetMatchingGroup(c67218327.lkfilter,tp,LOCATION_MZONE,0,nil)
local zone=0
for tc in aux.Next(lg) do
zone=bit.bor(zone,bit.band(tc:GetLinkedZone(),0x1f))
end
return zone~=0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c67218327.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c67218327.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c67218327.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local lg=Duel.GetMatchingGroup(c67218327.lkfilter,tp,LOCATION_MZONE,0,nil)
local zone=0
for tc in aux.Next(lg) do
zone=bit.bor(zone,bit.band(tc:GetLinkedZone(),0x1f))
end
if zone~=0 and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP,zone)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
--星呼びの天儀台
function c67378104.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,67378104+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c67378104.cost)
e1:SetTarget(c67378104.target)
e1:SetOperation(c67378104.activate)
c:RegisterEffect(e1)
end
function c67378104.filter(c)
return c:IsLevel(6) and (c:IsFaceup() or not c:IsLocation(LOCATION_MZONE)) and c:IsAbleToDeckAsCost()
end
function c67378104.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67378104.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c67378104.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,1,REASON_COST)
end
function c67378104.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c67378104.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--剛鬼ツープラトン
function c67586735.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(67586735,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCondition(c67586735.atkcon)
e1:SetOperation(c67586735.atkop)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(67586735,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c67586735.tdtg)
e2:SetOperation(c67586735.tdop)
c:RegisterEffect(e2)
end
function c67586735.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0xfc)
end
function c67586735.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if rc:IsFaceup() and rc:IsLocation(LOCATION_MZONE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
rc:RegisterEffect(e1)
end
end
function c67586735.tdfilter(c)
return c:IsSetCard(0xfc) and c:IsType(TYPE_SPELL) and c:IsAbleToDeck()
end
function c67586735.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c67586735.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c67586735.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c67586735.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c67586735.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
--星遺物の機憶
function c68191756.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:SetCountLimit(1,68191756+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c68191756.target)
e1:SetOperation(c68191756.activate)
c:RegisterEffect(e1)
end
function c68191756.filter(c,e,tp)
return c:IsSetCard(0x10c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c68191756.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c68191756.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c68191756.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c68191756.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c68191756.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local fid=c:GetFieldID()
tc:RegisterFlagEffect(68191756,RESET_EVENT+0x1fe0000,0,1,fid)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetLabel(fid)
e3:SetLabelObject(tc)
e3:SetCondition(c68191756.thcon)
e3:SetOperation(c68191756.thop)
Duel.RegisterEffect(e3,tp)
Duel.SpecialSummonComplete()
end
end
function c68191756.splimit(e,c)
return not c:IsSetCard(0x10c)
end
function c68191756.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(68191756)==e:GetLabel() then
return true
else
e:Reset()
return false
end
end
function c68191756.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
--リユナイト・パラディオン
function c69039982.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetValue(500)
e2:SetTarget(c69039982.atktg)
c:RegisterEffect(e2)
--extra attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(69039982,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(c69039982.condition)
e3:SetTarget(c69039982.eatg)
e3:SetOperation(c69039982.eaop)
c:RegisterEffect(e3)
end
function c69039982.atktg(e,c)
return c:IsSetCard(0x116) and c:IsType(TYPE_LINK)
end
function c69039982.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c69039982.eafilter(c)
return c:IsFaceup() and c:IsSetCard(0x116) and c:IsType(TYPE_LINK)
end
function c69039982.eatg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c69039982.eafilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c69039982.eafilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c69039982.eafilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c69039982.eaop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_ALL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c69039982.ftarget)
e2:SetLabel(tc:GetFieldID())
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c69039982.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
--ブレイク・オブ・ザ・ワールド
function c69217334.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--change level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(69217334,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetTarget(c69217334.lvtg)
e2:SetOperation(c69217334.lvop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(c69217334.condition)
e3:SetTarget(c69217334.target)
c:RegisterEffect(e3)
end
function c69217334.lvfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_RITUAL)
and Duel.IsExistingMatchingCard(c69217334.lvcfilter,tp,LOCATION_HAND,0,1,nil,c)
end
function c69217334.lvcfilter(c,mc)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
and (not mc or not c:IsLevel(mc:GetLevel()))
end
function c69217334.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c69217334.lvfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c69217334.lvfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c69217334.lvfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function c69217334.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
local ec=tc
if not tc:IsRelateToEffect(e) then ec=nil end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=Duel.SelectMatchingCard(tp,c69217334.lvcfilter,tp,LOCATION_HAND,0,1,1,nil,ec)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
local pc=cg:GetFirst()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
pc:RegisterEffect(e2)
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(tc:GetLevel())
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
pc:RegisterEffect(e1)
end
end
end
function c69217334.cfilter(c,tp)
return c:IsCode(46427957,72426662) and c:IsControler(tp) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c69217334.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c69217334.cfilter,1,nil,tp)
end
function c69217334.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsPlayerCanDraw(tp,1)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
local b2=g:GetCount()>0
if chk==0 then return b1 or b2 end
local sel=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
if b1 and b2 then
sel=Duel.SelectOption(tp,aux.Stringid(69217334,0),aux.Stringid(69217334,1))
elseif b1 then
sel=Duel.SelectOption(tp,aux.Stringid(69217334,0))
else
sel=Duel.SelectOption(tp,aux.Stringid(69217334,1))+1
end
if sel==0 then
e:SetCategory(CATEGORY_DRAW)
e:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e:SetOperation(c69217334.drop)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
else
e:SetCategory(CATEGORY_DESTROY)
e:SetOperation(c69217334.desop)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
end
function c69217334.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c69217334.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--見習い魔嬢
function c71384012.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_DARK),2,2)
c:EnableReviveLimit()
--atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK))
e1:SetValue(500)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT))
e3:SetValue(-400)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
--tohand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(71384012,0))
e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,71384012)
e5:SetCondition(c71384012.thcon)
e5:SetTarget(c71384012.thtg)
e5:SetOperation(c71384012.thop)
c:RegisterEffect(e5)
end
function c71384012.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c71384012.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
end
function c71384012.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c71384012.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c71384012.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c71384012.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c71384012.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--明星の機械騎士
function c72006609.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c72006609.lcheck)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(72006609,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,72006609)
e1:SetCondition(c72006609.thcon)
e1:SetCost(c72006609.thcost)
e1:SetTarget(c72006609.thtg)
e1:SetOperation(c72006609.thop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x10c))
e2:SetValue(c72006609.tglimit)
c:RegisterEffect(e2)
--avoid battle damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x10c))
e3:SetValue(c72006609.tglimit)
c:RegisterEffect(e3)
end
function c72006609.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x10c)
end
function c72006609.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c72006609.costfilter(c)
return ((c:IsSetCard(0x10c) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0xfe)) and c:IsDiscardable()
end
function c72006609.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c72006609.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c72006609.costfilter,1,1,REASON_DISCARD+REASON_COST)
end
function c72006609.thfilter(c)
return c:IsSetCard(0xfe) and c:IsAbleToHand()
end
function c72006609.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c72006609.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c72006609.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c72006609.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c72006609.tglimit(e,c)
return not c:GetBattleTarget():GetColumnGroup():IsContains(c)
end
--マギアス・パラディオン
function c72228247.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c72228247.matfilter,1,1)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c72228247.atkval)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c72228247.antg)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(72228247,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,72228247)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c72228247.thcon)
e3:SetTarget(c72228247.thtg)
e3:SetOperation(c72228247.thop)
c:RegisterEffect(e3)
end
function c72228247.matfilter(c)
return c:IsLinkSetCard(0x116) and not c:IsLinkCode(72228247)
end
function c72228247.atkval(e,c)
local g=e:GetHandler():GetLinkedGroup():Filter(Card.IsFaceup,nil)
return g:GetSum(Card.GetBaseAttack)
end
function c72228247.antg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c72228247.cfilter(c,lg)
return c:IsType(TYPE_EFFECT) and lg:IsContains(c)
end
function c72228247.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c72228247.cfilter,1,nil,lg)
end
function c72228247.thfilter(c)
return c:IsSetCard(0x116) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c72228247.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c72228247.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c72228247.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c72228247.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--ショートヴァレル・ドラゴン
function c73341839.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x102),2,2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(73341839,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,73341839)
e1:SetCondition(c73341839.spcon)
e1:SetCost(c73341839.spcost)
e1:SetTarget(c73341839.sptg)
e1:SetOperation(c73341839.spop)
c:RegisterEffect(e1)
end
function c73341839.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10f) and c:IsType(TYPE_LINK)
end
function c73341839.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c73341839.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c73341839.costfilter(c,tp)
return c:IsLinkBelow(3) and Duel.GetMZoneCount(tp,c)>0
end
function c73341839.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c73341839.costfilter,1,nil,tp) end
local sg=Duel.SelectReleaseGroup(tp,c73341839.costfilter,1,1,nil,tp)
e:SetLabel(sg:GetFirst():GetLink())
Duel.Release(sg,REASON_COST)
end
function c73341839.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c73341839.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetTarget(c73341839.lklimit)
e1:SetLabel(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
end
function c73341839.lklimit(e,c)
if not c then return false end
local lk=e:GetLabel()
return c:IsLink(lk)
end
--マガジンドラムゴン
function c739444.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c739444.matfilter,3,3)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(739444,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,739444)
e1:SetTarget(c739444.drtg)
e1:SetOperation(c739444.drop)
c:RegisterEffect(e1)
--disable field
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c739444.discon)
e2:SetOperation(c739444.disop)
c:RegisterEffect(e2)
end
function c739444.matfilter(c)
return c:IsLinkRace(RACE_DRAGON) and c:IsLinkAttribute(ATTRIBUTE_DARK)
end
function c739444.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 c739444.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)
e:GetHandler():RegisterFlagEffect(739444,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
function c739444.discon(e)
return e:GetHandler():GetFlagEffect(739444)~=0
end
function c739444.disop(e,tp)
local c=e:GetHandler()
local flag1=bit.band(c:GetLinkedZone(tp),0xffffff00)
local flag2=bit.band(c:GetLinkedZone(1-tp),0xff00ffff)
return flag1+flag2
end
--レストレーション・ポイントガード
function c74163487.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_CYBERSE),2,2)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c74163487.incon)
e1:SetOperation(c74163487.inop)
c:RegisterEffect(e1)
--be material
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c74163487.regcon)
e2:SetOperation(c74163487.regop)
c:RegisterEffect(e2)
end
function c74163487.incon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsType,1,nil,TYPE_LINK) and not eg:IsContains(e:GetHandler())
end
function c74163487.inop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
end
function c74163487.regcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_LINK
end
function c74163487.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,74163487)
e1:SetLabelObject(rc)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c74163487.spcon)
e1:SetTarget(c74163487.sptg)
e1:SetOperation(c74163487.spop)
c:RegisterEffect(e1)
end
function c74163487.spcon(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetLabelObject()
return eg:IsContains(rc) and bit.band(r,REASON_EFFECT)~=0 and rp~=tp
end
function c74163487.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 c74163487.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--ハイパースター
function c7778726.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_LIGHT),2,2)
c:EnableReviveLimit()
--atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT))
e1:SetValue(500)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK))
e3:SetValue(-400)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
--tohand
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(7778726,0))
e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,7778726)
e5:SetCondition(c7778726.thcon)
e5:SetTarget(c7778726.thtg)
e5:SetOperation(c7778726.thop)
c:RegisterEffect(e5)
end
function c7778726.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c7778726.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand()
end
function c7778726.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c7778726.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c7778726.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c7778726.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c7778726.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--弩弓部隊
function c80584548.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetCost(c80584548.cost)
e1:SetTarget(c80584548.target)
e1:SetOperation(c80584548.activate)
c:RegisterEffect(e1)
end
function c80584548.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c80584548.desfilter(c,tc,ec)
return c:GetEquipTarget()~=tc and c~=ec
end
function c80584548.costfilter(c,ec)
return Duel.IsExistingTarget(c80584548.desfilter,tp,0,LOCATION_ONFIELD,1,c,c,ec)
end
function c80584548.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c80584548.costfilter,1,c,c)
else
return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,c)
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local sg=Duel.SelectReleaseGroup(tp,c80584548.costfilter,1,1,c,c)
Duel.Release(sg,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c80584548.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--魔神儀-タリスマンドラ
function c80701178.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(80701178,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,80701178)
e1:SetCost(c80701178.spcost)
e1:SetTarget(c80701178.sptg)
e1:SetOperation(c80701178.spop)
c:RegisterEffect(e1)
--effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(80701178,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,80701178)
e2:SetCondition(c80701178.thcon)
e2:SetTarget(c80701178.thtg)
e2:SetOperation(c80701178.thop)
c:RegisterEffect(e2)
--spsummon limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c80701178.sumlimit)
c:RegisterEffect(e3)
end
function c80701178.filter(c,e,tp)
return c:IsSetCard(0x117) and not c:IsCode(80701178) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c80701178.costfilter(c)
return bit.band(c:GetType(),0x81)==0x81 and not c:IsPublic()
end
function c80701178.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c80701178.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c80701178.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c80701178.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c80701178.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function c80701178.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c80701178.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
g:AddCard(e:GetHandler())
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c80701178.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function c80701178.thfilter(c)
return bit.band(c:GetType(),0x81)==0x81 and c:IsAbleToHand()
end
function c80701178.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c80701178.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c80701178.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c80701178.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c80701178.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA)
end
--リターン・オブ・ザ・ワールド
function c81306186.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,81306186)
e1:SetTarget(c81306186.rmtg)
e1:SetOperation(c81306186.rmop)
c:RegisterEffect(e1)
--ritual summon/to hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,81306186)
e2:SetLabelObject(e1)
e2:SetCost(c81306186.cost)
e2:SetTarget(c81306186.target)
c:RegisterEffect(e2)
end
function c81306186.filter(c)
return bit.band(c:GetType(),0x81)==0x81 and c:IsAbleToRemove()
end
function c81306186.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c81306186.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c81306186.rmop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,c81306186.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
tc:RegisterFlagEffect(81306186,RESET_EVENT+0x1fe0000,0,0)
e:SetLabelObject(tc)
end
end
function c81306186.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c81306186.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetLabelObject():GetLabelObject()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then
if not tc or tc:IsFacedown() or tc:GetFlagEffect(81306186)==0 then return false end
local b1=tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
and Duel.IsExistingMatchingCard(c81306186.relfilter,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,1,tc,e,tp,tc,ft)
local b2=tc:IsAbleToHand()
return b1 or b2
end
local b1=tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
and Duel.IsExistingMatchingCard(c81306186.relfilter,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,1,tc,e,tp,tc,ft)
local b2=tc:IsAbleToHand()
local sel=0
if b1 and b2 then
sel=Duel.SelectOption(tp,aux.Stringid(81306186,0),aux.Stringid(81306186,1))
elseif b1 then
sel=Duel.SelectOption(tp,aux.Stringid(81306186,0))
else
sel=Duel.SelectOption(tp,aux.Stringid(81306186,1))+1
end
if sel==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(c81306186.spop)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
else
e:SetCategory(CATEGORY_TOHAND)
e:SetOperation(c81306186.thop)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tc,1,0,0)
end
end
function c81306186.relfilter(c,e,tp,tc,ft)
if not c:IsLevelAbove(tc:GetLevel()) then return false end
if tc.mat_filter and not tc.mat_filter(c) then return false end
if c:IsLocation(LOCATION_GRAVE) then
return c:IsType(TYPE_RITUAL) and ft>0 and c:IsAbleToDeck()
else
return (ft>0 or c:IsControler(tp)) and c:IsReleasableByEffect(e)
end
end
function c81306186.spop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetLabelObject():GetLabelObject()
if not rc or rc:IsFacedown() or rc:GetFlagEffect(81306186)==0 then return end
if not rc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c81306186.relfilter),tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,1,1,rc,e,tp,rc,ft):GetFirst()
if tc then
rc:SetMaterial(Group.FromCards(tc))
if tc:IsLocation(LOCATION_GRAVE) then
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)==0 then return end
else
if Duel.Release(tc,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)==0 then return end
end
Duel.SpecialSummon(rc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
rc:CompleteProcedure()
end
end
function c81306186.thop(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetLabelObject():GetLabelObject()
if not rc or rc:IsFacedown() or rc:GetFlagEffect(81306186)==0 then return end
Duel.SendtoHand(rc,nil,REASON_EFFECT)
end
--天穹のパラディオン
function c81524756.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,81524756)
e1:SetCondition(c81524756.spcon)
e1:SetValue(c81524756.spval)
c:RegisterEffect(e1)
--double damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(81524756,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,81524757)
e2:SetCondition(c81524756.dbcon)
e2:SetTarget(c81524756.dbtg)
e2:SetOperation(c81524756.dbop)
c:RegisterEffect(e2)
end
function c81524756.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c81524756.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c81524756.dbcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c81524756.dbfilter(c)
return c:IsFaceup() and c:IsSetCard(0x116) and c:IsType(TYPE_LINK) and c:GetFlagEffect(81524756)==0
end
function c81524756.dbtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c81524756.dbfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c81524756.dbfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c81524756.dbfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c81524756.dbop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c81524756.ftarget)
e1:SetLabel(tc:GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if tc:IsRelateToEffect(e) then
tc:RegisterFlagEffect(81524756,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(c81524756.damcon)
e1:SetOperation(c81524756.damop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c81524756.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c81524756.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetBattleTarget()~=nil
end
function c81524756.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
end
--サイバネティック・オーバーフロー
function c82428674.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,82428674)
e1:SetTarget(c82428674.target)
e1:SetOperation(c82428674.activate)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,82428675)
e2:SetCondition(c82428674.thcon)
e2:SetTarget(c82428674.thtg)
e2:SetOperation(c82428674.thop)
c:RegisterEffect(e2)
end
function c82428674.rmfilter(c)
return (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup()) and c:IsCode(70095154) and c:IsLevelAbove(1) and c:IsAbleToRemove()
end
function c82428674.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c82428674.rmfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_ONFIELD)
end
function c82428674.rescon(sg,e,tp,mg)
return sg:GetClassCount(Card.GetLevel)==sg:GetCount()
end
function c82428674.activate(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
local ct=dg:GetCount()
local g=Duel.GetMatchingGroup(c82428674.rmfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,nil)
if ct==0 or g:GetCount()==0 then return end
local rg=Group.CreateGroup()
repeat
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
rg:Merge(sg)
g:Remove(Card.IsLevel,nil,sg:GetFirst():GetLevel())
ct=ct-1
until ct==0 or g:GetCount()==0 or not Duel.SelectYesNo(tp,aux.Stringid(82428674,0))
local rc=Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
if rc>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=dg:Select(tp,rc,rc,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
end
function c82428674.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and bit.band(r,REASON_EFFECT)~=0
end
function c82428674.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and (c:IsSetCard(0x94) or c:IsSetCard(0x93)) and c:IsAbleToHand()
end
function c82428674.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c82428674.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c82428674.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c82428674.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--サイコ・エース
function c84453939.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84453939,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_RELEASE)
e1:SetCondition(c84453939.descon)
e1:SetTarget(c84453939.destg)
e1:SetOperation(c84453939.desop)
c:RegisterEffect(e1)
end
function c84453939.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c84453939.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c84453939.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--閃刀姫-ハヤテ
function c8491308.initial_effect(c)
c:SetSPSummonOnce(8491308)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c8491308.matfilter,1,1)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(8491308,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetTarget(c8491308.tgtg)
e2:SetOperation(c8491308.tgop)
c:RegisterEffect(e2)
end
function c8491308.matfilter(c)
return c:IsLinkSetCard(0x1115) and not c:IsLinkAttribute(ATTRIBUTE_WIND)
end
function c8491308.tgfilter(c)
return c:IsSetCard(0x115) and c:IsAbleToGrave()
end
function c8491308.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c8491308.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c8491308.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c8491308.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--ヴァレルソード・ドラゴン
function c85289965.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),3)
c:EnableReviveLimit()
--battle indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--position
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(85289965,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetHintTiming(0,0x1e0)
e2:SetTarget(c85289965.postg)
e2:SetOperation(c85289965.posop)
c:RegisterEffect(e2)
--atk change
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(85289965,1))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetCountLimit(1)
e3:SetCondition(c85289965.atkcon)
e3:SetTarget(c85289965.atktg)
e3:SetOperation(c85289965.atkop)
c:RegisterEffect(e3)
end
function c85289965.posfilter(c)
return c:IsAttackPos() and c:IsCanChangePosition()
end
function c85289965.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c85289965.posfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c85289965.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c85289965.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
Duel.SetChainLimit(c85289965.chlimit)
end
function c85289965.chlimit(e,ep,tp)
return tp==ep
end
function c85289965.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsAttackPos() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
end
if c:IsRelateToEffect(e) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
function c85289965.atkcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return tc and tc:IsFaceup() and tc:GetAttack()>0
end
function c85289965.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
e:GetHandler():GetBattleTarget():CreateEffectRelation(e)
end
function c85289965.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if not c:IsRelateToEffect(e) or c:IsFacedown() or tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
if c:IsRelateToEffect(e) and c:IsFaceup() then
local atk=tc:GetAttack()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e2:SetValue(math.ceil(atk/2))
c:RegisterEffect(e2)
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(math.ceil(atk/2))
tc:RegisterEffect(e1)
end
end
end
--コスモブレイン
function c85679527.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c85679527.sprcon)
e1:SetOperation(c85679527.sprop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(85679527,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,85679527)
e2:SetCost(c85679527.spcost)
e2:SetTarget(c85679527.sptg)
e2:SetOperation(c85679527.spop)
c:RegisterEffect(e2)
end
function c85679527.sprfilter(c,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and not c:IsType(TYPE_EFFECT) and c:IsType(TYPE_MONSTER)
and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c85679527.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c85679527.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp)
end
function c85679527.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c85679527.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp)
local lv=g:GetFirst():GetLevel()
Duel.SendtoGrave(g,REASON_COST)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(lv*200)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
function c85679527.costfilter(c,tp)
return c:IsType(TYPE_EFFECT) and Duel.GetMZoneCount(tp,c,tp)>0
end
function c85679527.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c85679527.costfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c85679527.costfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c85679527.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c85679527.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c85679527.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
end
function c85679527.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,c85679527.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--終焉の悪魔デミス
function c86124104.initial_effect(c)
c:EnableReviveLimit()
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetValue(72426662)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86124104,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c86124104.descon)
e2:SetTarget(c86124104.destg)
e2:SetOperation(c86124104.desop)
c:RegisterEffect(e2)
--actlimit
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(86124104,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetTarget(c86124104.target)
e3:SetOperation(c86124104.operation)
c:RegisterEffect(e3)
end
function c86124104.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c86124104.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c86124104.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
function c86124104.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL)
end
function c86124104.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c86124104.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c86124104.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c86124104.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c86124104.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c86124104.actop)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(86124104,2))
end
end
function c86124104.actop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_RITUAL) and re:IsActiveType(TYPE_MONSTER) and ep==tp then
Duel.SetChainLimit(c86124104.chainlm)
end
end
function c86124104.chainlm(e,rp,tp)
return tp==rp
end
--嵐竜の聖騎士
function c86401517.initial_effect(c)
c:EnableReviveLimit()
--return to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86401517,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCountLimit(1,86401517)
e1:SetTarget(c86401517.thtg)
e1:SetOperation(c86401517.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86401517,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,86401518)
e2:SetCost(c86401517.spcost)
e2:SetTarget(c86401517.sptg)
e2:SetOperation(c86401517.spop)
c:RegisterEffect(e2)
end
function c86401517.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local d=Duel.GetAttackTarget()
if chk==0 then return Duel.GetAttacker()==c and d and d:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,d,1,0,0)
end
function c86401517.thop(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d and d:IsRelateToBattle() then
Duel.SendtoHand(d,nil,REASON_EFFECT)
end
end
function c86401517.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp,c)>0 and c:IsReleasable() end
Duel.Release(c,REASON_COST)
end
function c86401517.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsLevelAbove(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c86401517.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c86401517.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c86401517.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,c86401517.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
--ディーラーズ・チョイス
function c89462956.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c89462956.target)
e1:SetOperation(c89462956.activate)
c:RegisterEffect(e1)
end
function c89462956.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(1-tp,1) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,PLAYER_ALL,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end
function c89462956.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetDecktopGroup(tp,1)
local g2=Duel.GetDecktopGroup(1-tp,1)
if g1:GetCount()==0 or g2:GetCount()==0 then return end
Duel.ShuffleDeck(tp)
Duel.ShuffleDeck(1-tp)
local h1=Duel.Draw(tp,1,REASON_EFFECT)
local h2=Duel.Draw(1-tp,1,REASON_EFFECT)
if h1>0 or h2>0 then Duel.BreakEffect() end
if h1>0 then
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
end
if h2>0 then
Duel.ShuffleHand(1-tp)
Duel.DiscardHand(1-tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
--神樹のパラディオン
function c91646304.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,91646304)
e1:SetCondition(c91646304.spcon)
e1:SetValue(c91646304.spval)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetCountLimit(1,91646305)
e2:SetTarget(c91646304.reptg)
e2:SetValue(c91646304.repval)
e2:SetOperation(c91646304.repop)
c:RegisterEffect(e2)
end
function c91646304.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c91646304.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c91646304.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsSetCard(0x116) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c91646304.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c91646304.repfilter,1,c,tp) and c:IsAbleToRemove()
and Duel.GetFlagEffect(tp,91646304)==0 end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c91646304.repval(e,c)
return c91646304.repfilter(c,e:GetHandlerPlayer())
end
function c91646304.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,91646304,RESET_PHASE+PHASE_END,0,1)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
--ドラグニティ-セナート
function c92868896.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(92868896,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,92868896)
e1:SetCost(c92868896.eqcost)
e1:SetTarget(c92868896.eqtg)
e1:SetOperation(c92868896.eqop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(92868896,1))
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c92868896.reptg)
e2:SetValue(c92868896.repval)
e2:SetOperation(c92868896.repop)
c:RegisterEffect(e2)
end
function c92868896.cfilter(c)
return c:IsSetCard(0x29) and c:IsDiscardable()
end
function c92868896.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c92868896.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c92868896.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c92868896.eqfilter(c,ec)
return c:IsSetCard(0x29) and c:IsType(TYPE_TUNER) and not c:IsForbidden()
end
function c92868896.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c92868896.eqfilter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function c92868896.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c92868896.eqfilter,tp,LOCATION_DECK,0,1,1,nil,c)
if g:GetCount()>0 then
Duel.Equip(tp,g:GetFirst(),c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c92868896.eqlimit)
e1:SetLabelObject(c)
g:GetFirst():RegisterEffect(e1)
end
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(c92868896.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c92868896.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c92868896.splimit(e,c)
return not c:IsRace(RACE_DRAGON) and c:IsLocation(LOCATION_EXTRA)
end
function c92868896.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) and c:IsSetCard(0x29)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT)) and not c:IsReason(REASON_REPLACE)
end
function c92868896.desfilter(c,e,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_SZONE) and c:IsSetCard(0x29)
and e:GetHandler():GetEquipGroup():IsContains(c)
and c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
end
function c92868896.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c92868896.repfilter,1,nil,tp)
and Duel.IsExistingMatchingCard(c92868896.desfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectMatchingCard(tp,c92868896.desfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
e:SetLabelObject(g:GetFirst())
g:GetFirst():SetStatus(STATUS_DESTROY_CONFIRMED,true)
return true
end
return false
end
function c92868896.repval(e,c)
return c92868896.repfilter(c,e:GetHandlerPlayer())
end
function c92868896.repop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
tc:SetStatus(STATUS_DESTROY_CONFIRMED,false)
Duel.Destroy(tc,REASON_EFFECT+REASON_REPLACE)
end
--孤毒の剣
function c93377803.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
c:SetUniqueOnField(1,0,93377803)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c93377803.target)
e1:SetOperation(c93377803.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(c93377803.eqlimit)
c:RegisterEffect(e2)
--self destroy
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(c93377803.sdcon)
c:RegisterEffect(e3)
--double atk/def
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_SET_BASE_ATTACK)
e4:SetCondition(c93377803.adcon)
e4:SetValue(c93377803.atkval)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE)
e5:SetValue(c93377803.defval)
c:RegisterEffect(e5)
end
function c93377803.eqlimit(e,c)
return c:IsControler(e:GetHandlerPlayer())
end
function c93377803.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_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c93377803.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(tp) then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c93377803.sdcon(e)
local tc=e:GetHandler():GetEquipTarget()
return tc and Duel.IsExistingMatchingCard(nil,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,tc)
end
function c93377803.adcon(e)
if Duel.GetCurrentPhase()~=PHASE_DAMAGE_CAL then return false end
local eqc=e:GetHandler():GetEquipTarget()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d and (a==eqc or d==eqc)
end
function c93377803.atkval(e,c)
return c:GetBaseAttack()*2
end
function c93377803.defval(e,c)
return c:GetBaseDefense()*2
end
--剛鬼ヘルトレーナー
function c93581434.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(93581434,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,93581434)
e1:SetCondition(c93581434.spcon)
e1:SetCost(c93581434.spcost)
e1:SetTarget(c93581434.sptg)
e1:SetOperation(c93581434.spop)
c:RegisterEffect(e1)
--indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetCondition(c93581434.indcon)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c93581434.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c93581434.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c93581434.spfilter(c,e,tp)
return c:IsSetCard(0xfc) and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c93581434.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c93581434.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c93581434.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c93581434.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function c93581434.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end
end
end
function c93581434.indfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsSetCard(0xfc)
end
function c93581434.indcon(e)
return Duel.IsExistingMatchingCard(c93581434.indfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
--シールド・ハンドラ
function c93655221.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c93655221.condition)
e1:SetCost(c93655221.cost)
e1:SetTarget(c93655221.target)
e1:SetOperation(c93655221.activate)
c:RegisterEffect(e1)
end
function c93655221.cfilter(c)
return c:IsOnField() and c:IsType(TYPE_MONSTER)
end
function c93655221.condition(e,tp,eg,ep,ev,re,r,rp)
if tp==ep then return false end
if not re:IsActiveType(TYPE_MONSTER) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return ex and tg~=nil and tc+tg:FilterCount(c93655221.cfilter,nil)-tg:GetCount()>0
end
function c93655221.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_DISABLED)
e2:SetOperation(c93655221.tgop)
e2:SetLabel(cid)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function c93655221.tgop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return end
e:GetOwner():CancelToGrave(false)
end
function c93655221.eqfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c93655221.disfilter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_LINK)
end
function c93655221.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c93655221.eqfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(c93655221.disfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
Duel.SelectTarget(tp,c93655221.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local g=Duel.SelectTarget(tp,c93655221.disfilter,tp,0,LOCATION_MZONE,1,1,nil)
e:SetLabelObject(g:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c93655221.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
if tc==hc then tc=g:GetNext() end
if hc:IsFaceup() and hc:IsRelateToEffect(e) and hc:IsType(TYPE_MONSTER) and not hc:IsDisabled() and hc:IsControler(1-tp) then
Duel.NegateRelatedChain(hc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
hc: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+0x1fe0000)
hc:RegisterEffect(e2)
if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c93655221.eqlimit)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e4)
else
c:CancelToGrave(false)
end
end
end
function c93655221.eqlimit(e,c)
return c:GetControler()==e:GetHandlerPlayer() and c:IsType(TYPE_LINK)
end
--魔導研究所
function c94599451.initial_effect(c)
c:EnableCounterPermit(0x1)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c94599451.ctcon)
e2:SetOperation(c94599451.ctop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(94243005,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(c94599451.thtg)
e3:SetOperation(c94599451.thop)
c:RegisterEffect(e3)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_SZONE)
e4:SetTarget(c94599451.reptg)
c:RegisterEffect(e4)
end
function c94599451.ctfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
and bit.band(c:GetPreviousTypeOnField(),TYPE_PENDULUM)~=0 and c:IsPreviousSetCard(0x10d)
end
function c94599451.ctcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c94599451.ctfilter,1,nil)
end
function c94599451.ctop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x1,2)
end
function c94599451.thfilter1(c,tp)
local lv=c:GetLevel()
return (c:IsLocation(LOCATION_DECK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and lv>0 and c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE)
and Duel.IsCanRemoveCounter(tp,1,0,0x1,lv,REASON_COST) and c:IsAbleToHand()
end
function c94599451.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c94599451.thfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,tp) end
local g=Duel.GetMatchingGroup(c94599451.thfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,tp)
local lvt={}
local tc=g:GetFirst()
while tc do
local tlv=tc:GetLevel()
lvt[tlv]=tlv
tc=g:GetNext()
end
local pc=1
for i=1,12 do
if lvt[i] then lvt[i]=nil lvt[pc]=i pc=pc+1 end
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(94599451,1))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
Duel.RemoveCounter(tp,1,0,0x1,lv,REASON_COST)
e:SetLabel(lv)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function c94599451.thfilter2(c,lv)
return (c:IsLocation(LOCATION_DECK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and c:IsCanAddCounter(0x1,1,false,LOCATION_MZONE)
and c:GetLevel()==lv and c:IsAbleToHand()
end
function c94599451.thop(e,tp,eg,ep,ev,re,r,rp)
local lv=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c94599451.thfilter2,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,lv)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c94599451.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_EFFECT) and Duel.IsCanRemoveCounter(tp,1,0,0x1,1,REASON_EFFECT) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.RemoveCounter(tp,1,0,0x1,1,REASON_EFFECT+REASON_REPLACE)
return true
else return false end
end
--クラスター・コンジェスター
function c94703021.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,94703021)
e1:SetCondition(c94703021.tkcon1)
e1:SetTarget(c94703021.tktg1)
e1:SetOperation(c94703021.tkop1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--tokens
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMING_BATTLE_PHASE)
e3:SetCondition(c94703021.tkcon2)
e3:SetCost(c94703021.tkcost2)
e3:SetTarget(c94703021.tktg2)
e3:SetOperation(c94703021.tkop)
c:RegisterEffect(e3)
end
function c94703021.tkcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_MZONE,0,nil,TYPE_LINK)==0
end
function c94703021.tktg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,94703022,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
end
function c94703021.tkop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,94703022,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_DARK) then
local tk=Duel.CreateToken(tp,94703022)
Duel.SpecialSummon(tk,0,tp,tp,false,false,POS_FACEUP)
end
end
function c94703021.tkcon2(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE,0,nil,TYPE_LINK)
return at and g:IsContains(at)
end
function c94703021.tkcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.GetAttackTarget() and Duel.GetAttackTarget():IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,Duel.GetAttackTarget())>0 end
local g=Group.FromCards(e:GetHandler(),Duel.GetAttackTarget())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c94703021.tktg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_MZONE,1,nil,TYPE_LINK)
and Duel.IsPlayerCanSpecialSummonMonster(tp,94703022,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
end
function c94703021.tkop2(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanSpecialSummonMonster(tp,94703022,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_DARK) then return end
local ct=math.min(Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_MZONE,nil,TYPE_LINK),Duel.GetLocationCount(tp,LOCATION_MZONE))
if ct<1 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
repeat
local token=Duel.CreateToken(tp,94703022)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
ct=ct-1
until ct<=0 or not Duel.SelectYesNo(tp,aux.Stringid(94703021,0))
Duel.SpecialSummonComplete()
end
--リバース・オブ・ザ・ワールド
function c95612049.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:SetCountLimit(1,95612049+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c95612049.target)
e1:SetOperation(c95612049.activate)
c:RegisterEffect(e1)
end
function c95612049.mfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsType(TYPE_RITUAL)
end
function c95612049.filter(c,e,tp,m)
if not c:IsCode(72426662,46427957) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
function c95612049.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp):Filter(c95612049.mfilter,nil)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c95612049.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c95612049.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local mg=Duel.GetRitualMaterial(tp):Filter(c95612049.mfilter,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c95612049.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp,mg)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
--レグレクス・パラディオン
function c9617996.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2,c9617996.lcheck)
c:EnableReviveLimit()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c9617996.atkval)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c9617996.antg)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9617996,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,9617996)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c9617996.thcon)
e3:SetTarget(c9617996.thtg)
e3:SetOperation(c9617996.thop)
c:RegisterEffect(e3)
end
function c9617996.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x116)
end
function c9617996.atkval(e,c)
local g=e:GetHandler():GetLinkedGroup():Filter(Card.IsFaceup,nil)
return g:GetSum(Card.GetBaseAttack)
end
function c9617996.antg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c9617996.cfilter(c,lg)
return c:IsType(TYPE_EFFECT) and lg:IsContains(c)
end
function c9617996.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c9617996.cfilter,1,nil,lg)
end
function c9617996.thfilter(c)
return c:IsSetCard(0x116) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c9617996.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9617996.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c9617996.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c9617996.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--オーバード・パラディオン
function c96434581.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,96434581+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c96434581.target)
e1:SetOperation(c96434581.activate)
c:RegisterEffect(e1)
end
function c96434581.filter(c)
return c:IsFaceup() and c:IsSetCard(0x116)
end
function c96434581.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c96434581.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c96434581.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c96434581.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c96434581.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
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(c96434581.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c96434581.efilter(e,re)
return e:GetHandler()~=re:GetOwner()
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