Commit f376cc93 authored by wind2009's avatar wind2009

Remove released cards

parent 8d2e8225
Pipeline #28063 passed with stages
in 1 minute and 37 seconds
...@@ -53,7 +53,7 @@ merge_databases: ...@@ -53,7 +53,7 @@ merge_databases:
FIELDS: 'name,desc,overallString,picUrl' FIELDS: 'name,desc,overallString,picUrl'
GIT_DEPTH: '1000' GIT_DEPTH: '1000'
OUTPUT_FILENAME: test-release.json OUTPUT_FILENAME: test-release.json
REF_COMMIT: '4.12' # 更新的时候改这里,修改成上一个tag的版本号 REF_COMMIT: '4.13' # 更新的时候改这里,修改成上一个tag的版本号
script: script:
- apt update;apt -y install wget - apt update;apt -y install wget
- currentPath=$PWD - currentPath=$PWD
......
File deleted
No preview for this file type
--精霊コロゾ
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--fusion material
aux.AddFusionProcFun2(c,s.mfilter1,s.mfilter2,true)
--special summon rule
aux.AddContactFusionProcedure(c,s.cfilter,LOCATION_ONFIELD,0,Duel.SendtoGrave,REASON_SPSUMMON)
--special summon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetRange(LOCATION_EXTRA)
e0:SetValue(aux.fuslimit)
c:RegisterEffect(e0)
--negate attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.natg)
e1:SetOperation(s.naop)
c:RegisterEffect(e1)
end
function s.mfilter1(c)
return bit.band(c:GetOriginalType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_LINK+TYPE_XYZ)~=0
end
function s.mfilter2(c)
return c:IsRace(RACE_SPELLCASTER) or (c:IsLocation(LOCATION_SZONE) and bit.band(c:GetOriginalRace(),RACE_SPELLCASTER)~=0)
end
function s.cfilter(c,fc)
return c:IsAbleToGraveAsCost() and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0
end
function s.natg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local a=Duel.GetAttacker()
if chkc then return chkc==a end
if chk==0 then return a~=nil and a:IsCanBeEffectTarget(e) and a:GetAttack()>0 end
Duel.SetTargetCard(a)
end
function s.naop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if Duel.NegateAttack() and tc:IsRelateToEffect(e) and c:IsFaceup() and c:IsRelateToEffect(e) then
local preatk=c:GetAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc:GetAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local aftatk=c:GetAttack()
if preatk<aftatk and tc:IsAbleToHand() and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
\ No newline at end of file
--嘆きの石版
local s,id,o=GetID()
function s.initial_effect(c)
--equip
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_EQUIP)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e0:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e0:SetTarget(s.target)
e0:SetOperation(s.activate)
c:RegisterEffect(e0)
--lock
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_CANNOT_ATTACK)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UNRELEASABLE_SUM)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e4)
--search
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,1))
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1)
e5:SetCondition(s.thcon)
e5:SetTarget(s.thtg)
e5:SetOperation(s.thop)
c:RegisterEffect(e5)
--inflict damage
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,2))
e6:SetCategory(CATEGORY_DAMAGE)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetCondition(s.damcon)
e6:SetTarget(s.damtg)
e6:SetOperation(s.damop)
c:RegisterEffect(e6)
--equip limit
local e7=Effect.CreateEffect(c)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_EQUIP_LIMIT)
e7:SetValue(1)
c:RegisterEffect(e7)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function s.thcon(e)
local c=e:GetHandler()
local tc=c:GetEquipTarget()
return tc and c:GetControler()==tc:GetControler()
end
function s.thfilter(c)
return not c:IsCode(id) and c:IsSetCard(0x2b8) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return ec and c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_DESTROY)
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
\ No newline at end of file
--死靈公爵
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddFusionProcFunRep(c,s.ffilter,2,true)
c:EnableReviveLimit()
--indestructable
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)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sumtg)
e2:SetOperation(s.sumop)
c:RegisterEffect(e2)
--recycle
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,id+o)
e4:SetCost(aux.bfgcost)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
--maintain
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(s.mtcon)
e4:SetOperation(s.mtop)
c:RegisterEffect(e4)
end
function s.ffilter(c)
return c:IsRace(RACE_FIEND+RACE_ZOMBIE)
end
function s.filter(c)
return c:IsSummonable(true,nil)
end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function s.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function s.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.CheckLPCost(tp,500) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
end
end
function s.thfilter(c)
return c:IsRace(RACE_FIEND+RACE_ZOMBIE) and c:IsLevelAbove(4) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
\ No newline at end of file
--死靈の殘像
local s,id,o=GetID()
function s.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(s.eqlimit)
c:RegisterEffect(e2)
--fusion
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id)
e3:SetCondition(s.fcon)
e3:SetTarget(s.ftg)
e3:SetOperation(s.fop)
c:RegisterEffect(e3)
--spsummon token
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,id)
e4:SetCondition(s.fcon)
e4:SetTarget(s.tokentg)
e4:SetOperation(s.tokenop)
c:RegisterEffect(e4)
--decrease attack
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCategory(CATEGORY_ATKCHANGE)
e5:SetCode(EVENT_ATTACK_ANNOUNCE)
e5:SetRange(LOCATION_SZONE)
e5:SetCondition(s.atkcon)
e5:SetTarget(s.atktg)
e5:SetOperation(s.atkop)
c:RegisterEffect(e5)
end
function s.eqlimit(e,c)
return c:IsLevelAbove(5) and c:IsRace(RACE_FIEND+RACE_ZOMBIE)
end
function s.filter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsRace(RACE_FIEND+RACE_ZOMBIE)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.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 tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function s.fcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget()
end
function s.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.ftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.fop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not (ce~=nil and Duel.SelectYesNo(tp,ce:GetDescription()))) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
elseif ce~=nil then
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function s.tokentg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetEquipTarget()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+o,0,TYPES_TOKEN_MONSTER,tc:GetAttack(),0,5,tc:GetRace(),tc:GetAttribute()) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.tokenop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetEquipTarget()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,id+o,0,TYPES_TOKEN_MONSTER,tc:GetAttack(),0,5,tc:GetRace(),tc:GetAttribute()) then
local token=Duel.CreateToken(tp,id+o)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(tc:GetAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(tc:GetRace())
token:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e3:SetValue(tc:GetAttribute())
token:RegisterEffect(e3)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
local tc=ec:GetBattleTarget()
e:SetLabelObject(tc)
return not ec:IsAttack(0) and tc and tc:IsFaceup()
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetLabelObject():CreateEffectRelation(e)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
local tc=e:GetLabelObject()
if ec:GetAttack() > 0 and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(1-tp) and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue((ec:GetAttack())*-1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--死靈の盾
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--negate attack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(s.condition)
e2:SetCost(s.cost)
e2:SetOperation(s.activate)
c:RegisterEffect(e2)
--negate effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_CHAINING)
e3:SetCountLimit(1)
e3:SetCondition(s.negcon)
e3:SetCost(s.cost)
e3:SetTarget(s.negtg)
e3:SetOperation(s.negop)
c:RegisterEffect(e3)
--self destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCondition(s.tgcon)
e4:SetTarget(s.tgtg)
e4:SetOperation(s.tgop)
c:RegisterEffect(e4)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function s.cfilter(c)
return c:IsRace(RACE_FIEND+RACE_ZOMBIE) and c:IsAbleToRemoveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return ex and rp==1-tp
end
function s.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)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsRace),tp,LOCATION_MZONE,0,1,nil,RACE_FIEND+RACE_ZOMBIE)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
\ No newline at end of file
--再生の海
local s,id,o=GetID()
function s.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:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.spfilter(c,e,tp)
return c:IsAttackBelow(1000) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local fid=tc:GetFieldID()
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(s.descon)
e1:SetOperation(s.desop)
Duel.RegisterEffect(e1,tp)
end
Duel.SpecialSummonComplete()
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(id)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
end
\ No newline at end of file
--クリアー・ファントム
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,33900648)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.thcost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--unaffected
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
e2:SetCode(97811903)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.costfilter(c)
return c:IsDiscardable()
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,c) and c:IsDiscardable() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function s.filter(c)
return (c:IsCode(33900648) or aux.IsCodeListed(c,33900648) and c:IsType(TYPE_SPELL+TYPE_TRAP)) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil)
if rg:GetCount()<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=rg:Select(tp,2,2,nil)
if g:GetCount()==2 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and Duel.IsPlayerCanDiscardDeck(1-tp,3) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,3)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and Duel.Destroy(tc,REASON_EFFECT)~=0 and Duel.IsPlayerCanDiscardDeck(1-tp,1) then
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)
end
end
\ No newline at end of file
--クリアー・レイジ・ゴーレム
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,33900648)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(s.atkcon)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--unaffected
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(1,0)
e3:SetCode(97811903)
c:RegisterEffect(e3)
--inflict damage
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetCondition(s.damcon)
e4:SetTarget(s.damtg)
e4:SetOperation(s.damop)
c:RegisterEffect(e4)
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(s.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.atktg(e,c)
return aux.IsCodeListed(c,33900648)
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)>0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)*300)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Damage(p,Duel.GetFieldGroupCount(p,LOCATION_HAND,0)*300,REASON_EFFECT)
end
\ No newline at end of file
--クリアー・キューブ
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,33900648)
--unaffected
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,0)
e1:SetCode(97811903)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e2:SetTarget(s.suntg)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.suntg(e,c)
return aux.IsCodeListed(c,33900648)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD)
and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp
end
function s.spfilter(c,e,tp)
return aux.IsCodeListed(c,33900648) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.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,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--クリアー・ヴィシャス・ナイト
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,33900648)
--summon proc
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(s.otcon)
e1:SetOperation(s.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE,EFFECT_FLAG2_WICKED)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(s.adval)
c:RegisterEffect(e3)
--unaffected
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0)
e4:SetCode(97811903)
c:RegisterEffect(e4)
--cannot activate
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,1)
e5:SetCondition(s.thcon)
e5:SetValue(s.limval)
c:RegisterEffect(e5)
end
function s.otfilter(c)
return aux.IsCodeListed(c,33900648)
end
function s.otcon(e,c,minc)
if c==nil then return true end
local mg=Duel.GetMatchingGroup(s.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
return c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg)
end
function s.otop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(s.otfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
local sg=Duel.SelectTribute(tp,c,1,1,mg)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function s.adval(e,c)
local g=Duel.GetMatchingGroup(Card.IsFaceup,e:GetOwnerPlayer(),0,LOCATION_MZONE,nil)
if g:GetCount()==0 then
return 0
else
local tg,val=g:GetMaxGroup(Card.GetBaseAttack)
return val
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_ADVANCE)
end
function s.limval(e,re,rp)
local rc=re:GetHandler()
return rc:IsLocation(LOCATION_MZONE) and re:IsActiveType(TYPE_MONSTER)
and rc:IsSummonType(SUMMON_TYPE_SPECIAL)
and rc:GetAttack()<e:GetHandler():GetAttack()
end
\ No newline at end of file
--クリアー・ウォール
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,33900648)
--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:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--indestructable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(s.indestg)
e3:SetValue(1)
c:RegisterEffect(e3)
--avoid battle damage
local e4=e3:Clone()
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e4:SetTargetRange(LOCATION_MZONE,0)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e5:SetTargetRange(0,LOCATION_MZONE)
c:RegisterEffect(e5)
--affected
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetRange(LOCATION_SZONE)
e6:SetTargetRange(0,1)
e6:SetCondition(s.ieecon)
e6:SetCode(id)
c:RegisterEffect(e6)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(33900648)
end
function s.thfilter(c)
return aux.IsCodeListed(c,33900648) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.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 s.indestg(e,c)
return aux.IsCodeListed(c,33900648)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsLevelAbove(7) and aux.IsCodeListed(c,33900648)
end
function s.ieecon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
\ No newline at end of file
--ブレイク・ザ・シール
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--place
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.totg)
e2:SetOperation(s.toop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id)
e3:SetCost(s.thcost)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
--bounce
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROYED)
e4:SetCountLimit(1,id+o)
e4:SetCondition(s.thcon2)
e4:SetCost(s.thcost2)
e4:SetTarget(s.thtg2)
e4:SetOperation(s.thop2)
c:RegisterEffect(e4)
end
function s.tofilter(c,tp)
return c:IsCode(id) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function s.totg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(s.tofilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
end
function s.toop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.tofilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) end
end
function s.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(id) and c:IsAbleToGraveAsCost()
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp)+c
Duel.SendtoGrave(g,REASON_COST)
end
function s.thfilter(c)
return c:IsSetCard(0x40) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) and c:IsStatus(STATUS_EFFECT_ENABLED) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.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 s.thcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD)
end
function s.cpfilter(c)
return c:IsSetCard(0x40) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function s.thcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.cpfilter,tp,LOCATION_HAND,0,nil)
local ct=Duel.GetMatchingGroupCount(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
if ct>5 then ct=5 end
if chk==0 then return #g>0 and ct>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:Select(tp,1,ct,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
e:SetLabel(#sg)
end
function s.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
local ct=e:GetLabel()
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,ct,0,0)
end
function s.thop2(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,ct,ct,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--地縛神 スカーレッド・ノヴァ
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,70902743,97489701)
c:SetUniqueOnField(1,1,aux.FilterBoolFunction(Card.IsSetCard,0x1021),LOCATION_MZONE)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function s.tgfilter(c)
return c:IsFaceupEx() and c:IsAbleToGrave() and (c:IsCode(70902743) or (c:IsSetCard(0x1021) and c:IsType(TYPE_MONSTER)))
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_MZONE)
end
function s.spfilter(c,e,tp)
return ((c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x21))
or (c:IsCode(97489701) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)))
and (c:IsLocation(LOCATION_DECK) and Duel.GetMZoneCount(tp)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if spc then
if spc:IsCode(97489701) then
if Duel.SpecialSummon(spc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP) then
spc:CompleteProcedure()
end
else
Duel.SpecialSummon(spc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
\ No newline at end of file
--カツト・イン・シャーク
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_BECOME_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon1)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetCondition(s.spcon2)
c:RegisterEffect(e2)
--recycle
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id+o)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
function s.cfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
end
function s.spcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:FilterCount(s.cfilter,nil,tp)==1 and eg:GetCount()==1
end
function s.costfilter(c,eg,tp)
return eg:IsContains(c) and Duel.GetMZoneCount(tp,c)>0
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,s.costfilter,1,nil,eg,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,s.costfilter,1,1,nil,eg,tp)
Duel.Release(g,REASON_COST)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:FilterCount(s.cfilter,nil,tp)==1 and eg:GetCount()==1 and Duel.GetAttacker():IsControler(1-tp)
end
function s.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 s.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 s.thop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(s.cthop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.thfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand() and not c:IsCode(id)
end
function s.cthop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--ギミック・パペット-キラーナイト
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.thcon)
e2:SetCost(s.cost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsSetCard(0x1083)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x1083) and c:IsLocation(LOCATION_EXTRA)
end
function s.spfilter(c,e,tp)
local cp=c:GetOwner()
return (c:IsSetCard(0x1083) and c:IsControler(tp) or c:IsControler(1-tp))
and (cp==tp and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
or cp==1-tp and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp))
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local res=false
local cp=tc:GetOwner()
if cp==tp and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) then
res=Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
if res then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
elseif cp==1-tp and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp) then
res=Duel.SpecialSummonStep(tc,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
if res then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
if res and c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.BreakEffect()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
--Emファイヤー・ダンサー
local s,id,o=GetID()
function s.initial_effect(c)
aux.EnablePendulumAttribute(c)
--pierce
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetCondition(s.atkcon)
e4:SetTarget(s.atktg)
e4:SetOperation(s.atkop)
c:RegisterEffect(e4)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(0xc6) and not c:IsHasEffect(EFFECT_PIERCE)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.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+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function s.thfilter(c)
return c:IsSetCard(0xc6) and not c:IsCode(id) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.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 s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--Emウォーター・ダンサー
local s,id,o=GetID()
function s.initial_effect(c)
aux.EnablePendulumAttribute(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--change pos
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.postg)
e2:SetOperation(s.posop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,id+o*2)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
--change pos
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3))
e4:SetCategory(CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetCondition(s.poscon)
e4:SetTarget(s.postg)
e4:SetOperation(s.posop)
c:RegisterEffect(e4)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc6)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.sptg(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 s.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 s.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition()
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsPosition(POS_DEFENSE) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_PENDULUM)
end
function s.thfilter(c)
return c:IsCode(24094653) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.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 s.poscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
\ No newline at end of file
--Emウィンド・サッカー
local s,id,o=GetID()
function s.initial_effect(c)
aux.EnablePendulumAttribute(c)
--pendulum effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetTarget(s.lvtg)
e1:SetOperation(s.lvop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--decrease level
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,3))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(s.lvtg2)
e3:SetOperation(s.lvop2)
c:RegisterEffect(e3)
--change level
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,4))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(s.lvtg3)
e4:SetOperation(s.lvop3)
c:RegisterEffect(e4)
end
function s.lvfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc6) and c:IsType(TYPE_PENDULUM)
and (c:IsLevelAbove(2) or c:GetLeftScale()>0)
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
local off=1
local ops={}
local opval={}
if tc:IsLevelAbove(2) then
ops[off]=aux.Stringid(id,0)
opval[off-1]=1
off=off+1
end
if tc:GetLeftScale()>0 then
ops[off]=aux.Stringid(id,1)
opval[off-1]=2
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
e:SetLabel(opval[op])
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local op=e:GetLabel()
local tc=Duel.GetFirstTarget()
if op==1 then
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and tc:IsLevelAbove(2) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-1)
tc:RegisterEffect(e1)
end
elseif op==2 then
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and c:IsRelateToEffect(e) then
local ct=tc:GetLeftScale()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LSCALE)
e1:SetValue(ct)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE)
c:RegisterEffect(e2)
end
end
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc6)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
or Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil)
end
function s.sptg(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 s.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_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetAbsoluteRange(tp,1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
end
end
function s.splimit(e,c)
return not c:IsSetCard(0xc6)
end
function s.lvtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLevelAbove(2) end
end
function s.lvop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and c:IsLevelAbove(2) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(-1)
c:RegisterEffect(e1)
end
end
function s.lvfilter3(c)
return c:IsFaceup() and c:IsLevel(4) and c:IsSetCard(0xc6)
end
function s.lvtg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.lvfilter3,tp,LOCATION_MZONE,0,1,nil) end
end
function s.lvop3(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.lvfilter3,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(5)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--Emカップ・トリッカー
local s,id,o=GetID()
function s.initial_effect(c)
aux.EnablePendulumAttribute(c)
--overlay
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.ovtg)
e1:SetOperation(s.ovop)
c:RegisterEffect(e1)
--add to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_DECK)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,id+o*2)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
--move overlay
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,id+o*3)
e4:SetCondition(s.xyzcon)
e4:SetTarget(s.xyztg)
e4:SetOperation(s.xyzop)
c:RegisterEffect(e4)
end
function s.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc6) and c:IsType(TYPE_XYZ)
end
function s.ovtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.ovfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(s.ovfilter,tp,LOCATION_MZONE,0,1,c) and c:IsCanOverlay() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.ovfilter,tp,LOCATION_MZONE,0,1,1,c)
end
function s.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local og=c:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(tc,Group.FromCards(c))
end
end
function s.cfilter(c,tp)
return c:IsLocation(LOCATION_EXTRA) and c:IsControler(tp)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc6) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.xfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if tc:GetOverlayCount()>0 and tc:RemoveOverlayCard(tp,1,1,REASON_EFFECT)~=0
and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,s.xfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.BreakEffect()
local dc=g:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e1)
end
end
end
function s.xyzcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ)
and c:IsPreviousLocation(LOCATION_OVERLAY)
end
function s.xyzfilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsCanBeEffectTarget(e)
end
function s.gcheck(g)
return g:IsExists(s.xyzfilter2,1,nil)
end
function s.xyzfilter2(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayGroup():GetCount()>0
end
function s.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_MZONE,0,nil,e)
if chkc then return false end
if chk==0 then return g:CheckSubGroup(s.gcheck,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=g:SelectSubGroup(tp,s.gcheck,false,2,2)
Duel.SetTargetCard(sg)
end
function s.xyzop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()~=2 or not tg:IsExists(s.xyzfilter2,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,4))
local tg2=tg:FilterSelect(tp,s.xyzfilter2,1,1,nil)
tg:Sub(tg2)
local tc=tg2:GetFirst()
local tc2=tg:GetFirst()
if tc2 and not tc2:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
local sg=og:Select(tp,1,1,nil)
Duel.Overlay(tc2,sg,false)
local oc=sg:GetFirst():GetOverlayTarget()
Duel.RaiseSingleEvent(oc,EVENT_DETACH_MATERIAL,e,0,0,0,0)
Duel.RaiseEvent(oc,EVENT_DETACH_MATERIAL,e,0,0,0,0)
end
end
\ No newline at end of file
--Emトラピーズ・フォース・ウィッチ
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xc6),2,true)
c:EnableReviveLimit()
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(aux.AND(Card.IsSetCard,Card.IsFaceup),0xc6))
e1:SetValue(aux.NOT(aux.indoval))
c:RegisterEffect(e1)
--cannot be targeted
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--cannot be attacked
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetCondition(s.atkcon)
e3:SetValue(aux.imval1)
c:RegisterEffect(e3)
--decrease attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(s.atkcon2)
e4:SetTarget(s.atktg)
e4:SetOperation(s.atkop)
c:RegisterEffect(e4)
end
function s.cfilter(c)
return not c:IsCode(id) and c:IsFaceup() and c:IsSetCard(0xc6)
end
function s.atkcon(e)
return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.atkcon2(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not d or a:GetControler()==d:GetControler() or d:IsFacedown() or a:IsFacedown() then return end
if a:IsControler(tp) and a:IsSetCard(0xc6) then e:SetLabelObject(d)
elseif d:IsControler(tp) and d:IsSetCard(0xc6) then e:SetLabelObject(a)
else return false end
return true
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetLabelObject()
if chk==0 then return tc:IsOnField() end
Duel.SetTargetCard(tc)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsControler(1-tp) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--Em影絵師シャドー・メイカー
local s,id,o=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT)
aux.AddXyzProcedure(c,nil,5,3)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.thcost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--spsummon(itself)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_DETACH_MATERIAL)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.spcon2)
e3:SetTarget(s.sptg2)
e3:SetOperation(s.spop2)
c:RegisterEffect(e3)
end
function s.costfilter(c)
return c:IsSetCard(0xc6) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.thfilter(c)
return c:IsSetCard(0x95) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.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 s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsContains(c)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetFirstMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if tg then
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayGroup():GetCount()==0
end
function s.spfilter2(c,e,tp)
return c:IsSetCard(0xc6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter2),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--Emトラピーズ・ハイ・マジシャン
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,17016362)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),5,2)
c:EnableReviveLimit()
--indestructable
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:SetCondition(s.intcon)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--reflect damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_REFLECT_DAMAGE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetValue(s.val)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(s.tacon)
e4:SetCost(s.tacost)
e4:SetTarget(s.tatg)
e4:SetOperation(s.taop)
c:RegisterEffect(e4)
end
function s.intcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayCount()~=0
end
function s.tacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP() and e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,17016362)
end
function s.tacost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.tatg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEffectCount(EFFECT_EXTRA_ATTACK)==0 end
end
function s.taop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(2)
c:RegisterEffect(e1)
end
function s.val(e,re,ev,r,rp,rc)
local ct=e:GetHandler():GetFlagEffect(id)
if bit.band(r,REASON_EFFECT)~=0 and e:GetHandler():GetOverlayCount()>ct then
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
return true
end
return false
end
\ No newline at end of file
--RUM-マジカル・フォース
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter1(c,e,tp)
return c:IsRank(4) and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function s.filter2(c,e,tp,mc)
if c:GetOriginalCode()==6165656 and not mc:IsCode(48995978) then return false end
return c:IsRank(5) and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter1(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingTarget(s.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
local sc=g:GetFirst()
if sc then
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummonStep(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
if c:IsRelateToEffect(e) and c:IsCanOverlay() then
c:CancelToGrave()
Duel.Overlay(sc,Group.FromCards(c))
end
end
end
Duel.SpecialSummonComplete()
end
end
--金色の魅惑の女王
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddLinkProcedure(c,s.matfilter,3,3)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--change effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(id)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.matfilter(c)
return c:IsLinkRace(RACE_SPELLCASTER)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x2b6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsRelateToChain() and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,2)
e1:SetValue(1500)
c:RegisterEffect(e1)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and ep==1-tp
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if chk==0 then return #g>0 end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD):Select(tp,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x2b6))
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--魅惑の宮殿
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--update atk/def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_SPELLCASTER))
e2:SetValue(500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(s.spcost)
e4:SetTarget(s.sptg)
e4:SetOperation(s.spop)
--grant effect
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(s.eftg)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
--search or spsummon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,1))
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(3,id)
e6:SetCost(s.thcost)
e6:SetTarget(s.thtg)
e6:SetOperation(s.thop)
c:RegisterEffect(e6)
end
function s.costfilter(c,code)
return c:GetFlagEffect(code)~=0
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local qg=e:GetHandler():GetEquipGroup()
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() and qg:IsExists(s.costfilter,1,nil,e:GetHandler():GetCode()) end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsAttackBelow(1500) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp,e:GetHandler():GetCode()) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function s.eftg(e,c)
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x2b6)
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.thfilter(c,e,tp)
if not (c:IsSetCard(0x2b6) and c:IsType(TYPE_MONSTER)) then return false end
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
return c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp))
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) or ft<=0 or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEUP)
end
end
end
\ No newline at end of file
--魅惑の舞
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,100222028)
--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,id+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--update atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetValue(s.val)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id+o)
e3:SetCost(s.spcost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.filter(c)
return (c:IsSetCard(0x2b6) and c:IsType(TYPE_MONSTER) or c:IsCode(100222028)) and c:IsAbleToHand()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function s.atkfilter(c,code)
return c:IsFaceup() and bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER
and c:GetFlagEffect(code)~=0
end
function s.val(e,c)
local g=c:GetEquipGroup():Filter(s.atkfilter,nil,c:GetCode())
if g:GetCount()>0 then
return g:GetSum(Card.GetBaseAttack)
else return 0 end
end
function s.spcfilter(c,tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.spcfilter,tp,LOCATION_ONFIELD,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.spcfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function s.sfilter(c,e,tp)
return c:IsSetCard(0x2b6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.sfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
local ft=math.min(Duel.GetLocationCount(tp,LOCATION_MZONE),g:GetClassCount(Card.GetCode))
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,ft,ft)
if sg then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end
end
\ No newline at end of file
--特異点の悪魔
local s,id,o=GetID()
function s.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(s.descon)
e1:SetCost(s.descost)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
end
function s.cfilter(c,tp)
return c:IsSummonPlayer(1-tp)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.costfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and
Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST)
end
function s.desfilter(c,e,tp)
return c:IsSummonPlayer(1-tp) and (not e or c:IsRelateToEffect(e))
and c:IsType(TYPE_MONSTER) and c:IsLocation(LOCATION_MZONE)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.desfilter,1,nil,nil,tp) end
local g=eg:Filter(s.desfilter,nil,nil,tp)
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.desfilter,nil,e,tp):Filter(Card.IsRelateToChain,nil)
Duel.Destroy(g,REASON_EFFECT)
end
\ No newline at end of file
--古代の機械像
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,83104731)
--spsummon itself
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--spsummon from deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)<Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function s.spfilter(c,e,tp)
return (c:IsCode(83104731) or aux.IsCodeListed(c,83104731)) and c:IsType(TYPE_MONSTER) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
end
\ No newline at end of file
--ワクチンゲール
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddXyzProcedure(c,nil,3,2,nil,nil,99)
c:EnableReviveLimit()
--change atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(s.atkcost)
e1:SetTarget(s.atktg)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
--increase atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_CUSTOM+id)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(s.atkcon2)
e2:SetTarget(s.atktg2)
e2:SetOperation(s.atkop2)
c:RegisterEffect(e2)
aux.RegisterMergedDelayedEvent(c,id,EVENT_SPSUMMON_SUCCESS)
end
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.arkfilter(c)
return c:IsFaceup() and (not c:IsAttack(c:GetBaseAttack()) or (not c:IsType(TYPE_LINK) and not c:IsDefense(c:GetBaseDefense())))
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.arkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.arkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.arkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 and g:GetFirst():IsControler(tp) then
e:SetLabel(1)
end
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) then
if s.arkfilter(tc) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetBaseAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(tc:GetBaseDefense())
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
if e:GetLabel()==1 then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e4)
end
end
end
function s.cfilter(c,tp)
return c:IsControler(tp)
end
function s.atkcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function s.atkfilter(c,e,tp)
return c:IsControler(tp) and (not e or c:IsRelateToEffect(e))
and c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsLocation(LOCATION_MZONE)
end
function s.atktg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.atkfilter,1,nil,nil,tp) and e:GetHandler():GetOverlayCount()>2 end
local g=eg:Filter(s.atkfilter,nil,nil,tp)
Duel.SetTargetCard(g)
end
function s.atkop2(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(Card.IsRelateToChain,nil)
for tc in aux.Next(g) do
if tc:IsType(TYPE_MONSTER) and tc:IsFaceup() and tc:IsLocation(LOCATION_MZONE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(900)
tc:RegisterEffect(e1)
end
end
end
\ No newline at end of file
--魂を刻む右
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,70902743)
--equip
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
--equip limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(s.eqlimit)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetValue(s.immval)
c:RegisterEffect(e3)
--change atk
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetTarget(s.atktg)
e4:SetOperation(s.atkop)
c:RegisterEffect(e4)
--remove
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,1))
e5:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_ATTACK_ANNOUNCE)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1)
e5:SetCondition(s.atkcon2)
e5:SetTarget(s.atktg2)
e5:SetOperation(s.atkop2)
c:RegisterEffect(e5)
end
function s.eqlimit(e,c)
return c:IsControler(e:GetHandlerPlayer()) and c:IsType(TYPE_SYNCHRO)
and c:IsRace(RACE_DRAGON)
end
function s.eqfilter(c,tp)
return c:IsControler(tp) and c:IsType(TYPE_SYNCHRO)
and c:IsRace(RACE_DRAGON)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc,tp) and s.eqlimit(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function s.immval(e,re)
local qc=e:GetHandler():GetEquipTarget()
return re:IsActivated() and e:GetHandlerPlayer()~=re:GetOwnerPlayer() and qc and qc:IsCode(70902743)
end
function s.atkfilter(c,atk)
return c:IsFaceup() and c:GetAttack()~=atk
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local qc=e:GetHandler():GetEquipTarget()
if chk==0 then return qc and Duel.IsExistingMatchingCard(s.atkfilter,tp,0,LOCATION_MZONE,1,nil,qc:GetAttack()) end
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local qc=e:GetHandler():GetEquipTarget()
if qc and qc:IsType(TYPE_MONSTER) and qc:IsFaceup() then
local atk=qc:GetAttack()
local g=Duel.GetMatchingGroup(s.atkfilter,tp,0,LOCATION_MZONE,nil,atk)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
function s.atkcon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetEquipTarget()
return Duel.GetAttacker()==tc or Duel.GetAttackTarget()==tc
end
function s.rmfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and not c:IsAttack(0)
end
function s.atktg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and s.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.rmfilter,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function s.atkop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
local qc=c:GetEquipTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
local atk=tc:GetAttack()
if qc:IsFaceup() and c:IsRelateToEffect(e) and atk>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
qc:RegisterEffect(e1)
end
end
end
\ No newline at end of file
--雷帝家臣ミスラ
function c22404675.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,22404675)
e1:SetTarget(c22404675.sptg)
e1:SetOperation(c22404675.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_RELEASE)
e2:SetCountLimit(1,22404676)
e2:SetCondition(c22404675.sumcon)
e2:SetTarget(c22404675.sumtg)
e2:SetOperation(c22404675.sumop)
c:RegisterEffect(e2)
end
function c22404675.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)>0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsPlayerCanSpecialSummonMonster(tp,22404676,0,TYPES_TOKEN_MONSTER,800,1000,1,RACE_THUNDER,ATTRIBUTE_LIGHT,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
function c22404675.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,22404676,0,TYPES_TOKEN_MONSTER,800,1000,1,RACE_THUNDER,ATTRIBUTE_LIGHT,POS_FACEUP_DEFENSE) and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
local token=Duel.CreateToken(tp,22404676)
Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end
end
Duel.SpecialSummonComplete()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c22404675.splimit)
Duel.RegisterEffect(e1,tp)
end
function c22404675.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA)
end
function c22404675.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_SUMMON) and Duel.GetTurnPlayer()==tp
end
function c22404675.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
end
function c22404675.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,22404675)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(22404675,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetValue(0x1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_EXTRA_SET_COUNT)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,22404675,RESET_PHASE+PHASE_END,0,1)
end
--魅惑の女王 LV5
function c23756165.initial_effect(c)
aux.AddCodeList(c,87257460,50140163)
--equip
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c23756165.regop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23756165,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCondition(c23756165.spcon)
e2:SetCost(c23756165.spcost)
e2:SetTarget(c23756165.sptg)
e2:SetOperation(c23756165.spop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
c23756165.lvup={50140163,87257460}
c23756165.lvdn={87257460}
function c23756165.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_LV or (re and re:GetHandler():IsCode(87257460)) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23756165,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCondition(c23756165.eqcon1)
e1:SetTarget(c23756165.eqtg)
e1:SetOperation(c23756165.eqop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetLabelObject(e)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c23756165.eqcon2)
c:RegisterEffect(e2)
end
end
function c23756165.eqcon1(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject():GetLabelObject()
return (ec==nil or ec:GetFlagEffect(23756165)==0) and not Duel.IsPlayerAffectedByEffect(tp,100222027)
end
function c23756165.eqcon2(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject():GetLabelObject()
return (ec==nil or ec:GetFlagEffect(23756165)==0) and Duel.IsPlayerAffectedByEffect(tp,100222027)
end
function c23756165.filter(c)
return c:IsLevelBelow(5) and c:IsFaceup() and c:IsAbleToChangeControler()
end
function c23756165.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c23756165.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c23756165.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c23756165.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c23756165.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled()
end
function c23756165.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()
local def=tc:GetTextDefense()
if atk<0 then atk=0 end
if def<0 then def=0 end
if not Duel.Equip(tp,tc,c,false) then return end
--Add Equip limit
tc:RegisterFlagEffect(23756165,RESET_EVENT+RESETS_STANDARD,0,0)
e:GetLabelObject():SetLabelObject(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c23756165.eqlimit)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e2:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(c23756165.repval)
tc:RegisterEffect(e2)
end
end
function c23756165.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c23756165.spcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject():GetLabelObject()
return Duel.GetTurnPlayer()==tp and ec and ec:GetFlagEffect(23756165)~=0
end
function c23756165.spcost(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 c23756165.spfilter(c,e,tp)
return c:IsCode(50140163) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_LV,tp,true,false)
end
function c23756165.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c23756165.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c23756165.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,c23756165.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
--クリアー・ワールド
function c33900648.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--maintain
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33900648,4))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCondition(c33900648.mtcon)
e2:SetOperation(c33900648.mtop)
c:RegisterEffect(e2)
--light
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_PUBLIC)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e4:SetTarget(c33900648.lighttg)
c:RegisterEffect(e4)
--dark
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e5:SetRange(LOCATION_FZONE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1,0)
e5:SetCondition(c33900648.darkcon1)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCondition(c33900648.darkcon2)
e6:SetTargetRange(0,1)
c:RegisterEffect(e6)
--earth
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(33900648,1))
e7:SetCategory(CATEGORY_DESTROY)
e7:SetCode(EVENT_PHASE+PHASE_STANDBY)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetRange(LOCATION_FZONE)
e7:SetProperty(EFFECT_FLAG_CARD_TARGET)
e7:SetCountLimit(1)
e7:SetCondition(c33900648.descon)
e7:SetTarget(c33900648.destg)
e7:SetOperation(c33900648.desop)
c:RegisterEffect(e7)
--water
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(33900648,2))
e8:SetCategory(CATEGORY_HANDES)
e8:SetCode(EVENT_PHASE+PHASE_END)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e8:SetRange(LOCATION_FZONE)
e8:SetCountLimit(1)
e8:SetCondition(c33900648.hdcon)
e8:SetTarget(c33900648.hdtg)
e8:SetOperation(c33900648.hdop)
c:RegisterEffect(e8)
--fire
local e9=Effect.CreateEffect(c)
e9:SetDescription(aux.Stringid(33900648,3))
e9:SetCategory(CATEGORY_DAMAGE)
e9:SetCode(EVENT_PHASE+PHASE_END)
e9:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e9:SetRange(LOCATION_FZONE)
e9:SetCountLimit(1)
e9:SetCondition(c33900648.damcon)
e9:SetTarget(c33900648.damtg)
e9:SetOperation(c33900648.damop)
c:RegisterEffect(e9)
--wind
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_ACTIVATE_COST)
e10:SetRange(LOCATION_FZONE)
e10:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e10:SetTargetRange(1,0)
e10:SetTarget(c33900648.actarget)
e10:SetCondition(c33900648.windcon1)
e10:SetCost(c33900648.costchk)
e10:SetOperation(c33900648.costop)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetTargetRange(0,1)
e11:SetCondition(c33900648.windcon2)
c:RegisterEffect(e11)
end
function c33900648.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c33900648.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.CheckLPCost(tp,500) and Duel.SelectYesNo(tp,aux.Stringid(33900648,0)) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
end
end
function c33900648.attributechk(tp)
local attchk=0
if Duel.IsPlayerAffectedByEffect(tp,100222010) then
attchk=ATTRIBUTE_LIGHT+ATTRIBUTE_DARK+ATTRIBUTE_EARTH+ATTRIBUTE_WATER+ATTRIBUTE_FIRE+ATTRIBUTE_WIND
else
local rac=0
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
rac=bit.bor(rac,tc:GetAttribute())
tc=g:GetNext()
end
attchk=rac
end
return attchk
end
function c33900648.lighttg(e,c)
return bit.band(c33900648.attributechk(c:GetControler()),ATTRIBUTE_LIGHT)~=0
and not Duel.IsPlayerAffectedByEffect(c:GetControler(),97811903)
end
function c33900648.darkcon1(e)
local tp=e:GetHandlerPlayer()
return bit.band(c33900648.attributechk(tp),ATTRIBUTE_DARK)~=0
and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>=2
and not Duel.IsPlayerAffectedByEffect(tp,97811903)
end
function c33900648.darkcon2(e)
local tp=e:GetHandlerPlayer()
return bit.band(c33900648.attributechk(1-tp),ATTRIBUTE_DARK)~=0
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>=2
and not Duel.IsPlayerAffectedByEffect(1-tp,97811903)
end
function c33900648.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(c33900648.attributechk(Duel.GetTurnPlayer()),ATTRIBUTE_EARTH)~=0
end
function c33900648.desfilter(c)
return c:IsPosition(POS_FACEUP_DEFENSE)
end
function c33900648.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local turnp=Duel.GetTurnPlayer()
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-turnp,aux.Stringid(33900648,1))
end
function c33900648.desop(e,tp,eg,ep,ev,re,r,rp)
local turnp=Duel.GetTurnPlayer()
if bit.band(c33900648.attributechk(turnp),ATTRIBUTE_EARTH)==0
or Duel.IsPlayerAffectedByEffect(turnp,97811903) then return end
Duel.Hint(HINT_SELECTMSG,turnp,HINTMSG_DESTROY)
local tg=Duel.SelectMatchingCard(turnp,c33900648.desfilter,turnp,LOCATION_MZONE,0,1,1,nil)
if tg:GetCount()>0 then
Duel.HintSelection(tg)
Duel.Destroy(tg,REASON_EFFECT)
end
end
function c33900648.hdcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(c33900648.attributechk(Duel.GetTurnPlayer()),ATTRIBUTE_WATER)~=0
end
function c33900648.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local turnp=Duel.GetTurnPlayer()
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,turnp,1)
Duel.Hint(HINT_OPSELECTED,1-turnp,aux.Stringid(33900648,2))
end
function c33900648.hdop(e,tp,eg,ep,ev,re,r,rp)
local turnp=Duel.GetTurnPlayer()
if bit.band(c33900648.attributechk(turnp),ATTRIBUTE_WATER)==0
or Duel.IsPlayerAffectedByEffect(turnp,97811903) then return end
Duel.DiscardHand(turnp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
function c33900648.damcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(c33900648.attributechk(Duel.GetTurnPlayer()),ATTRIBUTE_FIRE)~=0
end
function c33900648.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local turnp=Duel.GetTurnPlayer()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,turnp,1000)
Duel.Hint(HINT_OPSELECTED,1-turnp,aux.Stringid(33900648,3))
end
function c33900648.damop(e,tp,eg,ep,ev,re,r,rp)
local turnp=Duel.GetTurnPlayer()
if bit.band(c33900648.attributechk(turnp),ATTRIBUTE_FIRE)==0
or Duel.IsPlayerAffectedByEffect(turnp,97811903) then return end
Duel.Damage(turnp,1000,REASON_EFFECT)
end
function c33900648.windcon1(e)
local tp=e:GetHandlerPlayer()
return bit.band(c33900648.attributechk(tp),ATTRIBUTE_WIND)~=0
and not Duel.IsPlayerAffectedByEffect(tp,97811903)
end
function c33900648.windcon2(e)
local tp=e:GetHandlerPlayer()
return bit.band(c33900648.attributechk(1-tp),ATTRIBUTE_WIND)~=0
and not Duel.IsPlayerAffectedByEffect(1-tp,97811903)
end
function c33900648.actarget(e,te,tp)
return te:IsHasType(EFFECT_TYPE_ACTIVATE) and te:IsActiveType(TYPE_SPELL)
end
function c33900648.costchk(e,te_or_c,tp)
return Duel.CheckLPCost(tp,500)
end
function c33900648.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,500)
end
\ No newline at end of file
--エクソシスター・マルファ
function c37343995.initial_effect(c)
aux.AddCodeList(c,16474916)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37343995,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,37343995)
e1:SetCondition(c37343995.spcon)
e1:SetCost(c37343995.spcost)
e1:SetTarget(c37343995.sptg)
e1:SetOperation(c37343995.spop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(37343995,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_GRAVE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,37343996)
e2:SetTarget(c37343995.xyztg)
e2:SetOperation(c37343995.xyzop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(37343995,ACTIVITY_SPSUMMON,c37343995.counterfilter)
end
function c37343995.counterfilter(c)
return c:IsSetCard(0x172)
end
function c37343995.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c37343995.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
return ct==0 or ct==Duel.GetMatchingGroupCount(c37343995.cfilter,tp,LOCATION_MZONE,0,nil)
end
function c37343995.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(37343995,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c37343995.splimit)
Duel.RegisterEffect(e1,tp)
end
function c37343995.splimit(e,c)
return not c:IsSetCard(0x172)
end
function c37343995.spfilter(c,e,tp)
return c:IsCode(16474916) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c37343995.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c37343995.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c37343995.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c37343995.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummonStep(g:GetFirst(),0,tp,tp,false,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end
function c37343995.xyzfilter(c,e,tp,mc)
return c:IsSetCard(0x172) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c37343995.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c37343995.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c37343995.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c37343995.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local sc=g:GetFirst()
if sc then
local mg=c:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(c))
Duel.Overlay(sc,Group.FromCards(c))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
end
--シード・オブ・フレイム
function c38041940.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(38041940,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c38041940.condition)
e1:SetTarget(c38041940.target)
e1:SetOperation(c38041940.operation)
c:RegisterEffect(e1)
end
function c38041940.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(c:GetReason(),0x41)==0x41 and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:IsPreviousControler(tp)
end
function c38041940.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_PLANT) and not c:IsCode(38041940) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c38041940.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c38041940.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingTarget(c38041940.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsPlayerCanSpecialSummonMonster(tp,38041941,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH,POS_FACEUP_DEFENSE,1-tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c38041940.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0)
end
function c38041940.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsRace(RACE_PLANT) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsPlayerCanSpecialSummonMonster(tp,38041941,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH,POS_FACEUP_DEFENSE,1-tp) then
local token=Duel.CreateToken(tp,38041941)
Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
token:RegisterEffect(e1,true)
end
end
Duel.SpecialSummonComplete()
end
--魅惑の女王 LV7
function c50140163.initial_effect(c)
aux.AddCodeList(c,23756165)
--equip
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c50140163.regop)
c:RegisterEffect(e1)
end
c50140163.lvup={23756165}
c50140163.lvdn={23756165,87257460}
function c50140163.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_LV or (re and re:GetHandler():IsCode(23756165)) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50140163,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c50140163.eqcon1)
e1:SetTarget(c50140163.eqtg)
e1:SetOperation(c50140163.eqop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetLabelObject(e)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c50140163.eqcon2)
c:RegisterEffect(e2)
end
end
function c50140163.eqcon1(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject():GetLabelObject()
return (ec==nil or ec:GetFlagEffect(50140163)==0) and not Duel.IsPlayerAffectedByEffect(tp,100222027)
end
function c50140163.eqcon2(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject():GetLabelObject()
return (ec==nil or ec:GetFlagEffect(50140163)==0) and Duel.IsPlayerAffectedByEffect(tp,100222027)
end
function c50140163.filter(c)
return c:IsAbleToChangeControler()
end
function c50140163.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c50140163.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c50140163.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c50140163.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c50140163.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled()
end
function c50140163.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()
local def=tc:GetTextDefense()
if atk<0 then atk=0 end
if def<0 then def=0 end
if not Duel.Equip(tp,tc,c,false) then return end
--Add Equip limit
tc:RegisterFlagEffect(50140163,RESET_EVENT+RESETS_STANDARD,0,0)
e:GetLabelObject():SetLabelObject(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c50140163.eqlimit)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SET_AVAILABLE)
e2:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(c50140163.repval)
tc:RegisterEffect(e2)
end
end
function c50140163.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
--白曼波
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--Tuner
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(s.tncon)
e2:SetOperation(s.tnop)
c:RegisterEffect(e2)
end
s.treat_itself_tuner=true
function s.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_FISH)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_ONFIELD,0,1,nil,c:GetCode())
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
local c=e:GetHandler()
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)+c
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsRelateToEffect(e) and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
function s.tncon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE)
end
function s.tnop(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_ADD_TYPE)
e1:SetValue(TYPE_TUNER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--真紅眼の遡刻竜
function c53485634.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53485634,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CUSTOM+53485634)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetTarget(c53485634.sptg)
e1:SetOperation(c53485634.spop)
c:RegisterEffect(e1)
aux.RegisterMergedDelayedEvent(c,53485634,EVENT_TO_GRAVE)
--extra summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(53485634,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c53485634.sumcon)
e2:SetCost(c53485634.sumcost)
e2:SetTarget(c53485634.sumtg)
e2:SetOperation(c53485634.sumop)
c:RegisterEffect(e2)
end
function c53485634.spfilter(c,e,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_DESTROY)
and (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp or c:IsReason(REASON_BATTLE) and Duel.GetAttacker():IsControler(1-tp))
and c:IsSetCard(0x3b) and c:IsLevelBelow(7) and c:IsControler(tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,c:GetPreviousPosition())
end
function c53485634.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)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and eg:IsExists(c53485634.spfilter,1,nil,e,tp) end
local g=eg:Filter(c53485634.spfilter,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,g:GetCount(),0,0)
end
function c53485634.filter(c,e,tp)
return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,c:GetPreviousPosition())
end
function c53485634.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c53485634.filter,nil,e,tp)
if c:IsRelateToEffect(e) then
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>0 and g:GetCount()>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
if g:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(tp,ft,ft,nil)
end
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,tc:GetPreviousPosition())
tc=g:GetNext()
end
end
end
Duel.SpecialSummonComplete()
end
end
function c53485634.sumcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,53485634)==0
end
function c53485634.sumcost(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 c53485634.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
end
function c53485634.sumop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(53485634,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x3b))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,53485634,RESET_PHASE+PHASE_END,0,1)
end
--ペンデュラム・エボリューション
function c55795155.initial_effect(c)
aux.AddCodeList(c,13331639)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(55795155,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,55795155)
e2:SetTarget(c55795155.thtg)
e2:SetOperation(c55795155.thop)
c:RegisterEffect(e2)
--pendulum summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(55795155,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,55795156)
e3:SetCondition(c55795155.pcon)
e3:SetTarget(c55795155.ptg)
e3:SetOperation(c55795155.pop)
c:RegisterEffect(e3)
--multi attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(55795155,2))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1,55795157)
e4:SetCondition(c55795155.atkcon)
e4:SetTarget(c55795155.atktg)
e4:SetOperation(c55795155.atkop)
c:RegisterEffect(e4)
if not c55795155.global_check then
c55795155.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c55795155.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c55795155.checkfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsPreviousPosition(POS_FACEDOWN) and c:IsSummonLocation(LOCATION_EXTRA)
end
function c55795155.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c55795155.checkfilter,nil)
local tc=g:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),55795155,RESET_PHASE+PHASE_END,0,1)
tc=g:GetNext()
end
end
function c55795155.cfilter(c,tp)
return c:IsType(TYPE_PENDULUM) and c:IsAbleToDeckAsCost()
and Duel.IsExistingMatchingCard(c55795155.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c55795155.thfilter(c,code)
return c:IsType(TYPE_PENDULUM) and c:IsAttack(2500) and not c:IsCode(code) and c:IsAbleToHand()
end
function c55795155.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked()
and Duel.IsExistingMatchingCard(c55795155.cfilter,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c55795155.cfilter,tp,LOCATION_HAND,0,1,1,nil,tp)
e:SetLabel(g:GetFirst():GetCode())
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c55795155.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c55795155.thfilter,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c55795155.pcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,55795155)>0
end
function c55795155.ptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if lpz==nil or rpz==nil then return false end
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local eset={e1}
local lscale=lpz:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local g=Duel.GetFieldGroup(tp,loc,0)
local res=g:IsExists(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
e1:Reset()
return res
end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c55795155.pop(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_EXTRA_PENDULUM_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local eset={e1}
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local lscale=lpz:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local loc=0
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
local ft=Duel.GetUsableMZoneCount(tp)
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and ect<ft2 then ft2=ect end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
ft=1
end
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
local tg=Duel.GetMatchingGroup(aux.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset)
tg=tg:Filter(aux.PConditionExtraFilterSpecific,nil,e,tp,lscale,rscale,e1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
aux.GCheckAdditional=aux.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,false,1,math.min(#tg,ft))
aux.GCheckAdditional=nil
if not g then
e1:Reset()
return
end
local sg=Group.CreateGroup()
sg:Merge(g)
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
Duel.RaiseEvent(sg,EVENT_SPSUMMON_SUCCESS_G_P,e,REASON_EFFECT,tp,tp,0)
Duel.SpecialSummon(sg,SUMMON_TYPE_PENDULUM,tp,tp,true,true,POS_FACEUP)
e1:Reset()
end
function c55795155.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c55795155.atkfilter(c)
return c:IsCode(13331639) and c:IsFaceup()
end
function c55795155.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsCode(13331639) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(c55795155.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c55795155.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c55795155.atkop(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+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--ペンデュラム・アンコール
--not fully implemented
function c6992184.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:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1,6992184+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c6992184.condition)
e1:SetCost(c6992184.cost)
e1:SetTarget(c6992184.target)
e1:SetOperation(c6992184.activate)
e1:SetLabel(0)
c:RegisterEffect(e1)
end
function c6992184.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c6992184.check(e,tp,exc)
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
if lpz==nil then return false end
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_EXTRA,0,exc,TYPE_PENDULUM)
if #g==0 then return false end
local pcon=aux.PendCondition()
return pcon(e,lpz,g)
end
function c6992184.cfilter(c,e,tp)
return c:IsDiscardable() and c6992184.check(e,tp,c)
end
function c6992184.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
e:SetLabel(100)
if not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,nil,TYPE_PENDULUM)
or Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)<2 then return false end
return Duel.IsExistingMatchingCard(c6992184.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
end
e:SetLabel(0)
Duel.DiscardHand(tp,c6992184.cfilter,1,1,REASON_COST+REASON_DISCARD,nil,e,tp)
end
function c6992184.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==100 then
e:SetLabel(0)
return true
end
return c6992184.check(e,tp,nil)
end
e:SetLabel(0)
end
function c6992184.activate(e,tp,eg,ep,ev,re,r,rp)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetTargetRange(LOCATION_PZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(aux.indsval)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCountLimit(1)
e3:SetOperation(c6992184.retop)
Duel.RegisterEffect(e3,tp)
end
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
if lpz==nil then return end
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,TYPE_PENDULUM)
if #g==0 then return end
--the summon should be done after the chain end
local sg=Group.CreateGroup()
local pop=aux.PendOperation()
pop(e,tp,eg,ep,ev,re,r,rp,lpz,sg,g)
Duel.RaiseEvent(sg,EVENT_SPSUMMON_SUCCESS_G_P,e,REASON_EFFECT,tp,tp,0)
Duel.SpecialSummon(sg,SUMMON_TYPE_PENDULUM,tp,tp,true,true,POS_FACEUP)
end
function c6992184.retop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
--女王親衛隊
function c71411377.initial_effect(c)
--at limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetTarget(c71411377.atlimit)
e1:SetValue(aux.imval1)
c:RegisterEffect(e1)
end
function c71411377.atlimit(e,c)
return c:IsSetCard(0x3)
end
--魔法名-「解体し統合せよ」
local s,id,o=GetID()
function s.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,id+EFFECT_COUNT_CODE_OATH)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c,e,tp)
local p=tp
if c:IsControler(tp) then p=1-p end
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,p)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp)
and Duel.IsExistingTarget(s.filter,tp,0,LOCATION_REMOVED,1,nil,e,tp)
and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,s.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_REMOVED,1,1,nil,e,tp)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,2,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain()
local sc1=g:Filter(Card.IsControler,nil,tp):GetFirst()
local sc2=g:Filter(Card.IsControler,nil,1-tp):GetFirst()
if sc1 and Duel.SpecialSummonStep(sc1,0,tp,1-tp,false,false,POS_FACEUP) and sc2 and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.SpecialSummonStep(sc2,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
--Emヒグルミ
function c7563579.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1,7563579)
e2:SetCondition(c7563579.spcon1)
e2:SetTarget(c7563579.sptg1)
e2:SetOperation(c7563579.spop1)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,7563580)
e3:SetCondition(c7563579.spcon2)
e3:SetTarget(c7563579.sptg2)
e3:SetOperation(c7563579.spop2)
c:RegisterEffect(e3)
end
function c7563579.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsSetCard(0xc6)
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp)
end
function c7563579.spcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c7563579.cfilter,1,nil,tp)
end
function c7563579.sptg1(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)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,500)
end
function c7563579.spop1(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
Duel.BreakEffect()
Duel.Damage(tp,500,REASON_EFFECT)
end
end
function c7563579.spcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c7563579.spfilter(c,e,tp)
return c:IsSetCard(0xc6) and not c:IsCode(7563579) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c7563579.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c7563579.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c7563579.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c7563579.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
--魅惑の女王 LV3
function c87257460.initial_effect(c)
aux.AddCodeList(c,87257460,23756165)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(87257460,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCondition(c87257460.eqcon1)
e1:SetTarget(c87257460.eqtg)
e1:SetOperation(c87257460.eqop1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c87257460.eqcon2)
e2:SetOperation(c87257460.eqop2)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(87257460,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCondition(c87257460.spcon)
e3:SetCost(c87257460.spcost)
e3:SetTarget(c87257460.sptg)
e3:SetOperation(c87257460.spop)
e3:SetLabelObject(e1)
c:RegisterEffect(e3)
end
c87257460.lvup={23756165}
function c87257460.eqcon1(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject()
return (ec==nil or ec:GetFlagEffect(87257460)==0) and not Duel.IsPlayerAffectedByEffect(tp,100222027)
end
function c87257460.eqcon2(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject():GetLabelObject()
return (ec==nil or ec:GetFlagEffect(87257460)==0) and Duel.IsPlayerAffectedByEffect(tp,100222027)
end
function c87257460.filter(c)
return c:IsLevelBelow(3) and c:IsFaceup() and c:IsAbleToChangeControler()
end
function c87257460.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c87257460.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c87257460.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c87257460.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c87257460.eqlimit(e,c)
return e:GetOwner()==c and not c:IsDisabled()
end
function c87257460.eqop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
if not Duel.Equip(tp,tc,c,false) then return end
--Add Equip limit
tc:RegisterFlagEffect(87257460,RESET_EVENT+RESETS_STANDARD,0,0)
e:SetLabelObject(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c87257460.eqlimit)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(c87257460.repval)
tc:RegisterEffect(e2)
end
end
function c87257460.eqop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
if not Duel.Equip(tp,tc,c,false) then return end
--Add Equip limit
tc:RegisterFlagEffect(87257460,RESET_EVENT+RESETS_STANDARD,0,0)
e:GetLabelObject():SetLabelObject(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c87257460.eqlimit)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(c87257460.repval)
tc:RegisterEffect(e2)
end
end
function c87257460.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c87257460.spcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject():GetLabelObject()
return Duel.GetTurnPlayer()==tp and ec and ec:GetFlagEffect(87257460)~=0
end
function c87257460.spcost(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 c87257460.spfilter(c,e,tp)
return c:IsCode(23756165) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_LV,tp,true,false)
end
function c87257460.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c87257460.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c87257460.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,c87257460.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
--クリアー・バイス・ドラゴン
function c97811903.initial_effect(c)
aux.AddCodeList(c,33900648)
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c97811903.atkcon)
e1:SetValue(c97811903.atkval)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetTarget(c97811903.reptg)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(1,0)
e3:SetCode(97811903)
c:RegisterEffect(e3)
end
function c97811903.atkcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL
and e:GetHandler()==Duel.GetAttacker() and Duel.GetAttackTarget()
end
function c97811903.atkval(e,c)
return Duel.GetAttackTarget():GetAttack()*2
end
function c97811903.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp
and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
return true
else return false end
end
--光波分光
function c98905.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c98905.target)
e1:SetOperation(c98905.activate)
c:RegisterEffect(e1)
if not c98905.global_check then
c98905.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(c98905.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c98905.callback(c)
local tp=c:GetPreviousControler()
if c:IsSetCard(0xe5) and c:IsType(TYPE_XYZ) and c:IsControler(tp) and c:GetOverlayCount()>0 then
c:RegisterFlagEffect(98905,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function c98905.checkop(e,tp,eg,ep,ev,re,r,rp)
eg:ForEach(c98905.callback)
end
function c98905.filter(c,e,tp)
return c:GetFlagEffect(98905)~=0 and c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
and c:IsReason(REASON_DESTROY) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c98905.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode())
end
function c98905.spfilter(c,e,tp,cd)
return c:IsType(TYPE_XYZ) and c:IsCode(cd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c98905.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c98905.filter(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and eg:IsExists(c98905.filter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=eg:FilterSelect(tp,c98905.filter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c98905.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c98905.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetCode())
if g:GetCount()>0 then
Duel.SpecialSummonStep(g:GetFirst(),0,tp,tp,false,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end
This diff is collapsed.
No preview for this file type
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