Commit e010b0e4 authored by fallenstardust's avatar fallenstardust

update fixed scripts

parent 87afd03e
--エレキハダマグロ
local s,id,o=GetID()
function s.initial_effect(c)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
if not s.global_check then
s.global_check=true
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(s.regcon)
e3:SetOperation(s.regop)
Duel.RegisterEffect(e3,0)
end
--s summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetCountLimit(1,id+o)
e4:SetCondition(s.sscon)
e4:SetTarget(s.sstg)
e4:SetOperation(s.ssop)
c:RegisterEffect(e4)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)>0
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.regcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=rp
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(rp,id,RESET_PHASE+PHASE_DAMAGE,0,1)
end
function s.sscon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and Duel.GetAttackTarget()==nil
end
function s.mfilter(c)
return not c:IsType(TYPE_TUNER) and c:IsFaceupEx() and c:GetLevel()>0
end
function s.spfilter(c,e,tp,g)
return c:IsSetCard(0xe) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and g:CheckSubGroup(s.gcheck,1,#g,tp,e:GetHandler(),c)
end
function s.gcheck(g,tp,ec,sc)
return Duel.GetLocationCountFromEx(tp,tp,g+ec,sc)>0 and g:GetSum(Card.GetLevel)+ec:GetLevel()==sc:GetLevel()
end
function s.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetReleaseGroup(tp,true,REASON_EFFECT):Filter(s.mfilter,c)
if chk==0 then return c:IsReleasableByEffect() and c:GetLevel()>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,g) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,g,2,0,0)
end
function s.ssop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetReleaseGroup(tp,true,REASON_EFFECT):Filter(s.mfilter,c)
if not (c:IsRelateToEffect(e) and c:IsReleasableByEffect()) or #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,g):GetFirst()
if tc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:SelectSubGroup(tp,s.gcheck,false,1,#g,tp,c,tc)+c
if Duel.Release(sg,REASON_EFFECT)>0 then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end
end
end
--幻想召喚師
function c14644902.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(14644902,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c14644902.target)
e1:SetOperation(c14644902.operation)
c:RegisterEffect(e1)
end
function c14644902.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c14644902.rfilter(c,e,tp)
return not c:IsImmuneToEffect(e)
and Duel.IsExistingMatchingCard(c14644902.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function c14644902.filter(c,e,tp,mc)
return c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c14644902.rfilter2(c,tp)
return Duel.GetLocationCountFromEx(tp,tp,c,TYPE_FUSION)>0
end
function c14644902.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,c14644902.rfilter,1,1,aux.ExceptThisCard(e),e,tp)
if Duel.Release(rg,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c14644902.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local fid=c:GetFieldID()
sg:GetFirst():RegisterFlagEffect(14644902,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(sg:GetFirst())
e1:SetCondition(c14644902.descon)
e1:SetOperation(c14644902.desop)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
Duel.RegisterEffect(e1,tp)
end
end
if #rg==0 then
rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,c14644902.rfilter2,1,1,aux.ExceptThisCard(e),tp)
if #rg>0 then
Duel.Release(rg,REASON_EFFECT)
end
end
end
function c14644902.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return tc:GetFlagEffectLabel(14644902)==e:GetLabel()
end
function c14644902.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
end
--サブテラーの戦士
function c16719140.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16719140,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,16719140)
e1:SetCost(c16719140.spcost)
e1:SetTarget(c16719140.sptg1)
e1:SetOperation(c16719140.spop1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16719140,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FLIP)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,16719141)
e2:SetCondition(c16719140.spcon)
e2:SetTarget(c16719140.sptg2)
e2:SetOperation(c16719140.spop2)
c:RegisterEffect(e2)
end
function c16719140.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c16719140.costfilter(c,e,tp,mg,rlv,mc)
if not (c:IsLevelAbove(0) and c:IsSetCard(0xed) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_DEFENSE)) then return false end
return mg:CheckSubGroup(c16719140.fselect,1,c:GetLevel(),tp,c:GetLevel()-rlv,mc)
end
function c16719140.fselect(g,tp,lv,mc)
local mg=g:Clone()
mg:AddCard(mc)
if Duel.GetMZoneCount(tp,mg)>0 then
if lv<=0 then
return g:GetCount()==1
else
Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetOriginalLevel,lv)
end
else return false end
end
function c16719140.relfilter(c)
return c:IsLevelAbove(1)
end
function c16719140.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mg=Duel.GetReleaseGroup(tp,false,REASON_EFFECT):Filter(c16719140.relfilter,c)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
if not c:IsLevelAbove(1) or not c:IsReleasableByEffect() or mg:GetCount()==0 then return false end
return Duel.IsExistingMatchingCard(c16719140.costfilter,tp,LOCATION_DECK,0,1,nil,e,tp,mg,c:GetOriginalLevel(),c)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c16719140.costfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,mg,c:GetOriginalLevel(),c)
Duel.SendtoGrave(g,REASON_COST)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c16719140.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
local mg=Duel.GetReleaseGroup(tp,false,REASON_EFFECT):Filter(c16719140.relfilter,c)
if mg:GetCount()==0 then return end
if aux.NecroValleyFilter()(tc) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_DEFENSE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=mg:SelectSubGroup(tp,c16719140.fselect,false,1,tc:GetLevel(),tp,tc:GetLevel()-c:GetOriginalLevel(),c)
if g and g:GetCount()>0 then
g:AddCard(c)
if Duel.Release(g,REASON_EFFECT)~=0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_DEFENSE)
if tc:IsFacedown() then
Duel.ConfirmCards(1-tp,tc)
end
end
end
end
end
function c16719140.cfilter(c,tp)
return c:IsSetCard(0x10ed) and c:IsControler(tp)
end
function c16719140.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c16719140.cfilter,1,nil,tp)
end
function c16719140.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c16719140.spop2(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 c16960351.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:SetDescription(aux.Stringid(16960351,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(c16960351.spcost)
e2:SetTarget(c16960351.sptg)
e2:SetOperation(c16960351.spop)
c:RegisterEffect(e2)
end
function c16960351.rfilter(c,e,tp,ft)
local lv=c:GetOriginalLevel()
return lv>0 and c:IsRace(RACE_DRAGON)
and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup())
and Duel.IsExistingMatchingCard(c16960351.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,lv)
end
function c16960351.spfilter(c,e,tp,lv)
return c:IsLevel(lv) and c:IsRace(RACE_WYRM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c16960351.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(REASON_COST,tp,c16960351.rfilter,1,nil,e,tp,ft) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,c16960351.rfilter,1,1,nil,e,tp,ft)
local tc=g:GetFirst()
e:SetLabel(tc:GetOriginalLevel())
Duel.Release(g,REASON_COST)
end
function c16960351.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c16960351.spop(e,tp,eg,ep,ev,re,r,rp)
local lv=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c16960351.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT)
e1:SetValue(LOCATION_DECKSHF)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
--天球の聖刻印
function c24361622.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_DRAGON),2,2)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24361622,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c24361622.thcon)
e1:SetCost(c24361622.thcost)
e1:SetTarget(c24361622.thtg)
e1:SetOperation(c24361622.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(24361622,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_RELEASE)
e2:SetCountLimit(1,24361622)
e2:SetTarget(c24361622.sptg)
e2:SetOperation(c24361622.spop)
c:RegisterEffect(e2)
end
function c24361622.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSequence()>4 and Duel.GetTurnPlayer()~=tp
end
function c24361622.thcfilter(c,tp)
return c:IsType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(c24361622.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c24361622.thfilter(c)
return c:IsFaceup() and c:IsAbleToHand()
end
function c24361622.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(REASON_COST,tp,c24361622.thcfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroupEx(REASON_COST,tp,c24361622.thcfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c24361622.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_ONFIELD)
end
function c24361622.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c24361622.thfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function c24361622.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c24361622.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c24361622.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,c24361622.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if not tc then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
--インフェルノイド・アシュメダイ
function c25811989.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCondition(c25811989.spcon)
e2:SetTarget(c25811989.sptg)
e2:SetOperation(c25811989.spop)
c:RegisterEffect(e2)
--handes
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(25811989,0))
e3:SetCategory(CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(c25811989.thcon)
e3:SetTarget(c25811989.thtg)
e3:SetOperation(c25811989.thop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(25811989,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCost(c25811989.rmcost)
e4:SetTarget(c25811989.rmtg)
e4:SetOperation(c25811989.rmop)
c:RegisterEffect(e4)
end
function c25811989.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c25811989.sumfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c25811989.lv_or_rk(c)
if c:IsType(TYPE_XYZ) then return c:GetRank()
else return c:GetLevel() end
end
function c25811989.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=Duel.GetMatchingGroup(c25811989.sumfilter,tp,LOCATION_MZONE,0,nil):GetSum(c25811989.lv_or_rk)
if sum>8 then return false end
local loc=LOCATION_GRAVE+LOCATION_HAND
if c:IsHasEffect(34822850) then loc=loc+LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c25811989.spfilter,tp,loc,0,c)
return g:CheckSubGroup(aux.mzctcheck,2,2,tp)
end
function c25811989.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local loc=LOCATION_GRAVE+LOCATION_HAND
if c:IsHasEffect(34822850) then loc=loc+LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c25811989.spfilter,tp,loc,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,true,2,2,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c25811989.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Remove(g,POS_FACEUP,REASON_COST)
g:DeleteGroup()
end
function c25811989.thcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget()~=nil
end
function c25811989.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1)
end
function c25811989.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(ep,LOCATION_HAND,0)
local sg=g:RandomSelect(ep,1)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
function c25811989.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c25811989.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function c25811989.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--ヴァルキュルスの影霊衣
function c25857246.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.ritlimit)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(25857246,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,25857246)
e2:SetCondition(c25857246.atkcon)
e2:SetCost(c25857246.atkcost)
e2:SetOperation(c25857246.atkop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(25857246,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,25857247)
e3:SetTarget(c25857246.target)
e3:SetOperation(c25857246.operation)
c:RegisterEffect(e3)
end
function c25857246.mat_filter(c)
return not c:IsLevel(8)
end
function c25857246.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c25857246.cfilter(c)
return c:IsSetCard(0xb4) and c:IsAbleToRemoveAsCost()
end
function c25857246.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c25857246.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c25857246.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c25857246.atkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateAttack() then
Duel.BreakEffect()
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
end
end
function c25857246.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.CheckReleaseGroupEx(REASON_EFFECT,tp,nil,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c25857246.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDraw(tp) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then ct=1 end
if ct>2 then ct=2 end
local g=Duel.SelectReleaseGroupEx(REASON_EFFECT,tp,nil,1,ct,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local rct=Duel.Release(g,REASON_EFFECT)
Duel.Draw(tp,rct,REASON_EFFECT)
end
end
--インフェルノイド・ベルゼブル
function c26034577.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c26034577.spcon)
e2:SetOperation(c26034577.spop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(26034577,0))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetTarget(c26034577.thtg)
e3:SetOperation(c26034577.thop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(26034577,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCondition(c26034577.rmcon)
e4:SetCost(c26034577.rmcost)
e4:SetTarget(c26034577.rmtg)
e4:SetOperation(c26034577.rmop)
c:RegisterEffect(e4)
end
function c26034577.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c26034577.sumfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c26034577.lv_or_rk(c)
if c:IsType(TYPE_XYZ) then return c:GetRank()
else return c:GetLevel() end
end
function c26034577.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=Duel.GetMatchingGroup(c26034577.sumfilter,tp,LOCATION_MZONE,0,nil):GetSum(c26034577.lv_or_rk)
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c26034577.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,c)
else
return Duel.IsExistingMatchingCard(c26034577.spfilter,tp,LOCATION_MZONE,0,1,nil)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c26034577.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,c)
end
end
function c26034577.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
g=Duel.SelectMatchingCard(tp,c26034577.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
else
g=Duel.SelectMatchingCard(tp,c26034577.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
else
g=Duel.SelectMatchingCard(tp,c26034577.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c26034577.thfilter(c)
return c:IsFaceup() and c:IsAbleToHand()
end
function c26034577.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c26034577.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c26034577.thfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c26034577.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c26034577.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c26034577.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c26034577.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c26034577.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function c26034577.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--ディメンション・マジック
function c28553439.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCondition(c28553439.condition)
e1:SetTarget(c28553439.target)
e1:SetOperation(c28553439.activate)
c:RegisterEffect(e1)
end
function c28553439.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end
function c28553439.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c28553439.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c28553439.filter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c28553439.rfilter(c,e,tp,ft)
return c:IsCanBeEffectTarget(e)
and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5))
end
function c28553439.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c28553439.rfilter(chkc,e,tp,ft) end
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(REASON_EFFECT,tp,c28553439.rfilter,1,nil,e,tp,ft)
and Duel.IsExistingMatchingCard(c28553439.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
local g=Duel.SelectReleaseGroup(REASON_EFFECT,tp,c28553439.rfilter,1,1,nil,e,tp,ft)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c28553439.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsControler(tp) and not tc:IsImmuneToEffect(e) then
if Duel.Release(tc,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c28553439.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if sg:GetCount()==0 then return end
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(28553439,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local des=dg:Select(tp,1,1,nil)
Duel.HintSelection(des)
Duel.BreakEffect()
Duel.Destroy(des,REASON_EFFECT)
end
end
end
--S:Pリトルナイト
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--material
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_EFFECT),2,2)
--banish 1 card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCondition(s.srmcon)
e1:SetTarget(s.srmtg)
e1:SetOperation(s.srmop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetLabelObject(e1)
e2:SetValue(s.mchk)
c:RegisterEffect(e2)
--banish 2 cards
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(s.drmcon)
e3:SetTarget(s.drmtg)
e3:SetOperation(s.drmop)
c:RegisterEffect(e3)
end
function s.srmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK) and e:GetLabel()==1
end
function s.srmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_ONFIELD) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.srmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.mchk(e,c)
if c:GetMaterial():IsExists(Card.IsType,1,nil,TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) then
e:GetLabelObject():SetLabel(1)
else e:GetLabelObject():SetLabel(0) end
end
function s.drmcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function s.cfilter1(c,tp)
return c:IsFaceup() and c:IsAbleToRemove()
and Duel.IsExistingTarget(s.cfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function s.cfilter2(c)
return c:IsFaceup() and c:IsAbleToRemove()
end
function s.drmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.cfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.cfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectTarget(tp,s.cfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g)
g:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0)
end
function s.drmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain()
if #g~=2 or Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)==0
or not g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then return end
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
local c=e:GetHandler()
local fid=c:GetFieldID()
for tc in aux.Next(og) do
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
end
og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabel(fid)
e1:SetLabelObject(og)
e1:SetCountLimit(1)
e1:SetCondition(s.retcon)
e1:SetOperation(s.retop)
Duel.RegisterEffect(e1,tp)
end
function s.retfilter(c,fid)
return c:GetFlagEffectLabel(id)==fid
end
function s.retfilter1(c,tp,fid)
return c:GetFlagEffectLabel(id)==fid and c:IsPreviousControler(tp)
end
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
if not e:GetLabelObject():IsExists(s.retfilter,1,nil,e:GetLabel()) then
e:GetLabelObject():DeleteGroup()
e:Reset()
return false
end
return true
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local fid=e:GetLabel()
local g1=e:GetLabelObject():Filter(s.retfilter1,nil,tp,fid)
local g2=e:GetLabelObject():Filter(s.retfilter1,nil,1-tp,fid)
local turnp=Duel.GetTurnPlayer()
if #g2==0 then
if #g1==1 then
Duel.ReturnToField(g1:GetFirst())
else
local tc=g1:Select(tp,1,1,nil):GetFirst()
Duel.ReturnToField(tc)
g1:RemoveCard(tc)
Duel.ReturnToField(g1:GetFirst())
end
else
if turnp==tp then
if #g1>0 then
Duel.ReturnToField(g1:GetFirst())
end
Duel.ReturnToField(g2:GetFirst())
else
Duel.ReturnToField(g2:GetFirst())
if #g1>0 then
Duel.ReturnToField(g1:GetFirst())
end
end
end
e:GetLabelObject():DeleteGroup()
end
--一族の掟
function c296499.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c296499.target)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c296499.atktarget)
c:RegisterEffect(e2)
e2:SetLabelObject(e1)
--maintain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c296499.mtcon)
e3:SetOperation(c296499.mtop)
c:RegisterEffect(e3)
end
function c296499.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RACE)
local rc=Duel.AnnounceRace(tp,1,RACE_ALL)
e:SetLabel(rc)
e:GetHandler():SetHint(CHINT_RACE,rc)
end
function c296499.atktarget(e,c)
return c:IsRace(e:GetLabelObject():GetLabel())
end
function c296499.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c296499.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.CheckReleaseGroup(REASON_MAINTENANCE,tp,nil,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(296499,0)) then
local g=Duel.SelectReleaseGroup(REASON_MAINTENANCE,tp,nil,1,1,nil)
Duel.Release(g,REASON_MAINTENANCE)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
end
end
--F.A.ライトニングマスター
function c33158448.initial_effect(c)
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c33158448.atkval)
c:RegisterEffect(e1)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(c33158448.spchk)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33158448,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c33158448.lvcon)
e3:SetOperation(c33158448.lvop)
c:RegisterEffect(e3)
--pierce
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e4)
--negate
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(33158448,1))
e5:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e5:SetCountLimit(1)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(c33158448.negcon)
e5:SetTarget(c33158448.negtg)
e5:SetOperation(c33158448.negop)
c:RegisterEffect(e5)
end
function c33158448.atkval(e,c)
return c:GetLevel()*300
end
function c33158448.spchk(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107)
end
function c33158448.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(1)>0
end
function c33158448.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_LEVEL)
e4:SetValue(1)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e4)
end
end
function c33158448.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if ep==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c33158448.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLevelAbove(3) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c33158448.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or c:IsLevelBelow(2) then return end
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(-2)
c:RegisterEffect(e1)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--地縛神 Cusillu
function c33537328.initial_effect(c)
c:SetUniqueOnField(1,1,aux.FilterBoolFunction(Card.IsSetCard,0x1021),LOCATION_MZONE)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_SELF_DESTROY)
e4:SetCondition(c33537328.sdcon)
c:RegisterEffect(e4)
--battle target
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(aux.imval1)
c:RegisterEffect(e5)
--direct atk
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e6)
--destroy replace
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_DESTROY_REPLACE)
e7:SetTarget(c33537328.desreptg)
c:RegisterEffect(e7)
end
function c33537328.sdcon(e)
return not Duel.IsExistingMatchingCard(Card.IsFaceup,0,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function c33537328.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReason(REASON_BATTLE) and c:GetBattlePosition()~=POS_FACEUP_DEFENSE
and Duel.CheckReleaseGroup(REASON_EFFECT,tp,nil,1,c) end
if Duel.SelectEffectYesNo(tp,c,96) then
local g=Duel.SelectReleaseGroup(REASON_EFFECT,tp,nil,1,1,c)
Duel.Release(g,REASON_EFFECT)
Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2))
return true
else return false end
end
--F.A.シャイニングスターGT
function c37414347.initial_effect(c)
c:EnableCounterPermit(0x4a)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_MACHINE),2,2)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c37414347.atkval)
c:RegisterEffect(e1)
--avoid damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_NO_BATTLE_DAMAGE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetValue(1)
c:RegisterEffect(e3)
--counter
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(c37414347.spchk)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(37414347,0))
e4:SetCategory(CATEGORY_COUNTER)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e4:SetCondition(c37414347.ctcon)
e4:SetTarget(c37414347.cttg)
e4:SetOperation(c37414347.ctop)
c:RegisterEffect(e4)
--negate
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(37414347,1))
e5:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,37414347)
e5:SetCondition(c37414347.discon)
e5:SetCost(c37414347.discost)
e5:SetTarget(c37414347.distg)
e5:SetOperation(c37414347.disop)
c:RegisterEffect(e5)
end
function c37414347.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x107) and c:GetLevel()>=0
end
function c37414347.atkval(e,c)
local lg=c:GetLinkedGroup():Filter(c37414347.atkfilter,nil)
return lg:GetSum(Card.GetLevel)*300
end
function c37414347.spchk(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107)
end
function c37414347.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(1)>0
end
function c37414347.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x4a)
end
function c37414347.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
c:AddCounter(0x4a,1)
end
end
function c37414347.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c37414347.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanRemoveCounter(tp,0x4a,1,REASON_COST) end
c:RemoveCounter(tp,0x4a,1,REASON_COST)
end
function c37414347.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c37414347.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--アラドヴァルの影霊衣
function c39468724.initial_effect(c)
c:EnableReviveLimit()
--Cannot Special Summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.ritlimit)
c:RegisterEffect(e1)
--Burialing
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(39468724,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,39468724)
e2:SetCost(c39468724.tgcost)
e2:SetTarget(c39468724.tgtg)
e2:SetOperation(c39468724.tgop)
c:RegisterEffect(e2)
--Negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(39468724,1))
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,39468725)
e3:SetCondition(c39468724.negcon)
e3:SetCost(c39468724.negcost)
e3:SetTarget(aux.nbtg)
e3:SetOperation(c39468724.negop)
c:RegisterEffect(e3)
end
function c39468724.mat_filter(c)
return not c:IsLevel(10)
end
function c39468724.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c39468724.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xb4)
end
function c39468724.tgfilter(c)
return c:IsSetCard(0xb4) and c:IsAbleToGrave()
end
function c39468724.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c39468724.tgfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.CheckReleaseGroupEx(REASON_EFFECT,tp,c39468724.filter,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c39468724.tgop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c39468724.tgfilter,tp,LOCATION_DECK,0,nil)
if ct==0 then ct=1 end
if ct>2 then ct=2 end
local g=Duel.SelectReleaseGroupEx(REASON_EFFECT,tp,c39468724.filter,1,ct,nil)
if g:GetCount()>0 then
local rct=Duel.Release(g,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,c39468724.tgfilter,tp,LOCATION_DECK,0,rct,rct,nil)
Duel.SendtoGrave(tg,REASON_EFFECT)
end
end
function c39468724.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and re:IsActiveType(TYPE_MONSTER)
end
function c39468724.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(REASON_COST,tp,nil,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroupEx(REASON_COST,tp,nil,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c39468724.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
--スタンド・イン
function c49154689.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:SetLabel(0)
e1:SetCountLimit(1,49154689+EFFECT_COUNT_CODE_OATH)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c49154689.cost)
e1:SetTarget(c49154689.target)
e1:SetOperation(c49154689.activate)
c:RegisterEffect(e1)
end
function c49154689.cfilter(c,e,tp)
local race=c:GetOriginalRace()
local attr=c:GetOriginalAttribute()
return bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0
and Duel.GetMZoneCount(tp,c,tp)>0
and Duel.IsExistingMatchingCard(c49154689.spfilter,tp,0,LOCATION_GRAVE,1,nil,race,attr,e,tp)
end
function c49154689.spfilter(c,race,attr,e,tp)
return c:GetOriginalRace()==race and c:GetOriginalAttribute()==attr
and c:IsCanBeEffectTarget(e)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp)
end
function c49154689.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,c49154689.cfilter,1,nil,e,tp) end
local sg=Duel.SelectReleaseGroup(REASON_COST,tp,c49154689.cfilter,1,1,nil,e,tp)
e:SetLabelObject(sg:GetFirst())
Duel.Release(sg,REASON_COST)
end
function c49154689.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local rc=e:GetLabelObject()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp)
and c49154689.spfilter(chkc,rc:GetOriginalRace(),rc:GetOriginalAttribute(),e,tp) end
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return true
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectTarget(tp,c49154689.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,rc:GetOriginalRace(),rc:GetOriginalAttribute(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,1,0,0)
end
function c49154689.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
--F.A.ウィップクロッサー
function c49655592.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c49655592.atkval)
c:RegisterEffect(e1)
--activate cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetCost(c49655592.costchk)
e2:SetTarget(c49655592.costtg)
e2:SetOperation(c49655592.costop)
c:RegisterEffect(e2)
--accumulate
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_FLAG_EFFECT+49655592)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
c:RegisterEffect(e3)
--lv up
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(c49655592.spchk)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(49655592,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e4:SetCondition(c49655592.lvcon)
e4:SetOperation(c49655592.lvop)
c:RegisterEffect(e4)
--discard limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,1)
e5:SetCode(EFFECT_CANNOT_DISCARD_HAND)
e5:SetCondition(c49655592.excon)
e5:SetValue(1)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_CANNOT_TO_GRAVE_AS_COST)
e6:SetRange(LOCATION_MZONE)
e6:SetTargetRange(0,LOCATION_HAND)
e6:SetCondition(c49655592.excon)
e6:SetValue(1)
c:RegisterEffect(e6)
end
function c49655592.atkval(e,c)
return c:GetLevel()*300
end
function c49655592.spchk(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107)
end
function c49655592.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(1)>0
end
function c49655592.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function c49655592.costchk(e,te_or_c,tp)
local ct=Duel.GetFlagEffect(tp,49655592)
return Duel.CheckLPCost(tp,ct*300)
end
function c49655592.costtg(e,te,tp)
if not te:IsActiveType(TYPE_MONSTER) then return false end
local tc=te:GetHandler()
local lv=e:GetHandler():GetLevel()
if tc:GetRank()>0 then
return tc:GetOriginalRank()<lv
elseif tc:GetLevel()>0 then
return tc:GetOriginalLevel()<lv
else return false end
end
function c49655592.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,300)
end
function c49655592.excon(e)
return e:GetHandler():IsLevelAbove(7)
end
--インフェルノイド・ヴァエル
function c51316684.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCondition(c51316684.spcon)
e2:SetTarget(c51316684.sptg)
e2:SetOperation(c51316684.spop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(51316684,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c51316684.rmcon)
e3:SetTarget(c51316684.rmtg)
e3:SetOperation(c51316684.rmop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(51316684,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCost(c51316684.rmcost2)
e4:SetTarget(c51316684.rmtg2)
e4:SetOperation(c51316684.rmop2)
c:RegisterEffect(e4)
end
function c51316684.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c51316684.sumfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c51316684.lv_or_rk(c)
if c:IsType(TYPE_XYZ) then return c:GetRank()
else return c:GetLevel() end
end
function c51316684.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=Duel.GetMatchingGroup(c51316684.sumfilter,tp,LOCATION_MZONE,0,nil):GetSum(c51316684.lv_or_rk)
if sum>8 then return false end
local loc=LOCATION_GRAVE+LOCATION_HAND
if c:IsHasEffect(34822850) then loc=loc+LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c51316684.spfilter,tp,loc,0,c)
return g:CheckSubGroup(aux.mzctcheck,2,2,tp)
end
function c51316684.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local loc=LOCATION_GRAVE+LOCATION_HAND
if c:IsHasEffect(34822850) then loc=loc+LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c51316684.spfilter,tp,loc,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,true,2,2,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c51316684.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Remove(g,POS_FACEUP,REASON_COST)
g:DeleteGroup()
end
function c51316684.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and e:GetHandler():GetBattledGroup():GetCount()>0
end
function c51316684.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c51316684.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c51316684.rmcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c51316684.rmtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function c51316684.rmop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--インフェルノイド・ルキフグス
function c52038272.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c52038272.spcon)
e2:SetOperation(c52038272.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(52038272,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCost(c52038272.descost)
e3:SetTarget(c52038272.destg)
e3:SetOperation(c52038272.desop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(52038272,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCondition(c52038272.rmcon)
e4:SetCost(c52038272.rmcost)
e4:SetTarget(c52038272.rmtg)
e4:SetOperation(c52038272.rmop)
c:RegisterEffect(e4)
end
function c52038272.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c52038272.sumfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c52038272.lv_or_rk(c)
if c:IsType(TYPE_XYZ) then return c:GetRank()
else return c:GetLevel() end
end
function c52038272.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=Duel.GetMatchingGroup(c52038272.sumfilter,tp,LOCATION_MZONE,0,nil):GetSum(c52038272.lv_or_rk)
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c52038272.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,c)
else
return Duel.IsExistingMatchingCard(c52038272.spfilter,tp,LOCATION_MZONE,0,1,nil)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c52038272.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,c)
end
end
function c52038272.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
g=Duel.SelectMatchingCard(tp,c52038272.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
else
g=Duel.SelectMatchingCard(tp,c52038272.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
else
g=Duel.SelectMatchingCard(tp,c52038272.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c52038272.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c52038272.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c52038272.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c52038272.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c52038272.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c52038272.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function c52038272.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--インフェルノイド・シャイターン
function c60551528.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c60551528.spcon)
e2:SetOperation(c60551528.spop)
c:RegisterEffect(e2)
--todeck
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetTarget(c60551528.tdtg)
e3:SetOperation(c60551528.tdop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCondition(c60551528.rmcon)
e4:SetCost(c60551528.rmcost)
e4:SetTarget(c60551528.rmtg)
e4:SetOperation(c60551528.rmop)
c:RegisterEffect(e4)
end
function c60551528.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c60551528.sumfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c60551528.lv_or_rk(c)
if c:IsType(TYPE_XYZ) then return c:GetRank()
else return c:GetLevel() end
end
function c60551528.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=Duel.GetMatchingGroup(c60551528.sumfilter,tp,LOCATION_MZONE,0,nil):GetSum(c60551528.lv_or_rk)
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c60551528.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,c)
else
return Duel.IsExistingMatchingCard(c60551528.spfilter,tp,LOCATION_MZONE,0,1,nil)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c60551528.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,c)
end
end
function c60551528.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
g=Duel.SelectMatchingCard(tp,c60551528.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
else
g=Duel.SelectMatchingCard(tp,c60551528.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
else
g=Duel.SelectMatchingCard(tp,c60551528.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c60551528.tdfilter(c)
return c:IsFacedown() and c:IsAbleToDeck()
end
function c60551528.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c60551528.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c60551528.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c60551528.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetChainLimit(c60551528.limit(g:GetFirst()))
end
function c60551528.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function c60551528.limit(c)
return function (e,lp,tp)
return e:GetHandler()~=c
end
end
function c60551528.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c60551528.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c60551528.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function c60551528.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--EMERGENCY!
local s,id,o=GetID()
function s.initial_effect(c)
--summon and release
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+o)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x18b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.target(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) and Duel.IsPlayerCanRelease(tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.rfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x18b)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectReleaseGroupEx(REASON_EFFECT,tp,s.rfilter,1,1,nil)
if rg:GetCount()>0 then
Duel.HintSelection(rg)
Duel.Release(rg,REASON_EFFECT)
end
end
end
function s.setfilter(c)
return c:IsSetCard(0x18b) and c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SSet(tp,tc)
end
end
--六花聖カンザシ
function c6284176.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(6284176,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,6284176)
e1:SetCondition(c6284176.spcon)
e1:SetCost(c6284176.spcost)
e1:SetTarget(c6284176.sptg)
e1:SetOperation(c6284176.spop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,6284177)
e2:SetTarget(c6284176.reptg)
e2:SetValue(c6284176.repval)
e2:SetOperation(c6284176.repop)
c:RegisterEffect(e2)
end
function c6284176.cfilter(c)
return (c:IsType(TYPE_MONSTER) and not c:IsPreviousLocation(LOCATION_SZONE)) or c:IsPreviousLocation(LOCATION_MZONE)
end
function c6284176.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c6284176.cfilter,1,nil) and not eg:IsContains(e:GetHandler())
end
function c6284176.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c6284176.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c6284176.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c6284176.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c6284176.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c6284176.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c6284176.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_RACE)
e3:SetValue(RACE_PLANT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
function c6284176.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_PLANT) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c6284176.rfilter(c)
return c:IsRace(RACE_PLANT) and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED)
end
function c6284176.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c6284176.repfilter,1,nil,tp)
and Duel.CheckReleaseGroupEx(REASON_EFFECT,tp,c6284176.rfilter,1,nil) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c6284176.repval(e,c)
return c6284176.repfilter(c,e:GetHandlerPlayer())
end
function c6284176.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectReleaseGroupEx(REASON_EFFECT,tp,c6284176.rfilter,1,1,nil)
Duel.Hint(HINT_CARD,0,6284176)
Duel.Release(g,REASON_EFFECT+REASON_REPLACE)
end
--聖刻神龍-エネアード
function c64332231.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,8,2)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(64332231,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c64332231.descost)
e1:SetTarget(c64332231.destg)
e1:SetOperation(c64332231.desop)
c:RegisterEffect(e1)
end
function c64332231.descost(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 c64332231.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(REASON_EFFECT,tp,nil,1,nil)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c64332231.desop(e,tp,eg,ep,ev,re,r,rp)
local ct1=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local rg=Duel.SelectReleaseGroupEx(REASON_EFFECT,tp,nil,1,ct1,nil)
local ct2=Duel.Release(rg,REASON_EFFECT)
if ct2==0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct2,ct2,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
--慈悲深き機械天使
function c64442155.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,64442155+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c64442155.cost)
e1:SetTarget(c64442155.target)
e1:SetOperation(c64442155.activate)
c:RegisterEffect(e1)
end
function c64442155.costfilter(c)
return c:IsSetCard(0x2093) and c:GetType()&0x81==0x81
end
function c64442155.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroupEx(REASON_COST,tp,c64442155.costfilter,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectReleaseGroupEx(REASON_COST,tp,c64442155.costfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c64442155.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c64442155.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,p,LOCATION_HAND,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local sg=g:Select(p,1,1,nil)
Duel.SendtoDeck(sg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c64442155.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c64442155.splimit(e,c)
return c:GetType()&0x81~=0x81
end
--F.A.ソニックマイスター
function c67045745.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c67045745.atkval)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(c67045745.indval)
c:RegisterEffect(e2)
--lv up
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(c67045745.spchk)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(67045745,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c67045745.lvcon)
e3:SetOperation(c67045745.lvop)
c:RegisterEffect(e3)
--attack twice
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e4:SetCondition(c67045745.excon)
e4:SetValue(1)
c:RegisterEffect(e4)
end
function c67045745.atkval(e,c)
return c:GetLevel()*300
end
function c67045745.indval(e,c)
local lv=e:GetHandler():GetLevel()
if c:GetRank()>0 then
return c:GetOriginalRank()<lv
elseif c:GetLevel()>0 then
return c:GetOriginalLevel()<lv
else return false end
end
function c67045745.spchk(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107)
end
function c67045745.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(1)>0
end
function c67045745.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function c67045745.excon(e)
return e:GetHandler():IsLevelAbove(7)
end
--F.A.ダークネスマスター
function c6764709.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c6764709.spcon)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c6764709.atkval)
c:RegisterEffect(e2)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(c6764709.spchk)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(6764709,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e4:SetCondition(c6764709.lvcon)
e4:SetOperation(c6764709.lvop)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(6764709,1))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetCountLimit(1)
e5:SetRange(LOCATION_MZONE)
e5:SetTarget(c6764709.rdtg)
e5:SetOperation(c6764709.rdop)
c:RegisterEffect(e5)
end
function c6764709.spfilter1(c)
return c:IsFaceup() and c:IsCode(6764709)
end
function c6764709.spfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x107) and c:IsLevelAbove(7)
end
function c6764709.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or Duel.IsExistingMatchingCard(c6764709.spfilter1,tp,LOCATION_MZONE,0,1,nil) then return false end
return Duel.IsExistingMatchingCard(c6764709.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function c6764709.atkval(e,c)
return c:GetLevel()*300
end
function c6764709.spchk(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107)
end
function c6764709.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(1)>0
end
function c6764709.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_LEVEL)
e4:SetValue(1)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e4)
end
end
function c6764709.rdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and e:GetHandler():IsLevelAbove(4) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c6764709.rdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsLevelBelow(3) then return end
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(-3)
c:RegisterEffect(e1)
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -48,7 +48,7 @@ function c70226289.activate(e,tp,eg,ep,ev,re,r,rp)
end
function c70226289.chainop(e,tp,eg,ep,ev,re,r,rp)
local race=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_RACE)
if re:IsActiveType(TYPE_MONSTER) and race&RACE_SPELLCASTER>0 and ep==tp then
if re:IsActiveType(TYPE_MONSTER) and bit.band(race,RACE_SPELLCASTER)~=0 and ep==tp then
Duel.SetChainLimit(c70226289.chainlm)
end
end
......
--魔界特派員デスキャスター
local s,id,o=GetID()
function s.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2)
--cannot link material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e0:SetValue(s.lmlimit)
c:RegisterEffect(e0)
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(s.desreptg)
e1:SetValue(s.desrepval)
e1:SetOperation(s.desrepop)
c:RegisterEffect(e1)
--Special Summon
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:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.lmlimit(e)
local c=e:GetHandler()
return c:IsStatus(STATUS_SPSUMMON_TURN) and c:IsSummonType(SUMMON_TYPE_LINK)
end
function s.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsReason(REASON_BATTLE+REASON_EFFECT)
and not c:IsReason(REASON_REPLACE)
end
function s.rfilter(c)
return c:IsRace(RACE_FIEND)
and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED)
end
function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp)
and Duel.CheckReleaseGroup(REASON_EFFECT,tp,s.rfilter,1,nil) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function s.desrepval(e,c)
return s.repfilter(c,e:GetHandlerPlayer())
end
function s.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectReleaseGroup(REASON_EFFECT,tp,s.rfilter,1,1,nil)
Duel.Hint(HINT_CARD,0,id)
Duel.Release(g,REASON_EFFECT+REASON_REPLACE)
end
function s.spfilter(c,e,tp)
return not c:IsCode(id) and c:IsRace(RACE_FIEND) 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)
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT) 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 Duel.DiscardHand(tp,nil,1,1,REASON_DISCARD+REASON_EFFECT,nil)>0
and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
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)
return not c:IsRace(RACE_FIEND)
end
--F.A.ターボチャージャー
function c75059201.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c75059201.atkval)
c:RegisterEffect(e1)
--untargetable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(c75059201.atglimit)
e2:SetValue(c75059201.atlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0xff,0xff)
e3:SetTarget(c75059201.tglimit)
e3:SetValue(c75059201.tgval)
c:RegisterEffect(e3)
--lv up
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(c75059201.spchk)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(75059201,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e4:SetCondition(c75059201.lvcon)
e4:SetOperation(c75059201.lvop)
c:RegisterEffect(e4)
--actlimit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,1)
e5:SetValue(c75059201.aclimit)
e5:SetCondition(c75059201.actcon)
c:RegisterEffect(e5)
end
function c75059201.atkval(e,c)
return c:GetLevel()*300
end
function c75059201.atglimit(e,c)
local lv=e:GetHandler():GetLevel()
if c:GetRank()>0 then
return c:GetOriginalRank()<lv
elseif c:GetLevel()>0 then
return c:GetOriginalLevel()<lv
else return false end
end
function c75059201.atlimit(e,c)
return c~=e:GetHandler()
end
function c75059201.tglimit(e,c)
return c~=e:GetHandler()
end
function c75059201.tgval(e,re,rp)
if not aux.tgoval(e,re,rp) then return false end
local c=re:GetHandler()
local lv=e:GetHandler():GetLevel()
if c:GetRank()>0 then
return c:GetOriginalRank()<lv
elseif c:GetLevel()>0 then
return c:GetOriginalLevel()<lv
else return false end
end
function c75059201.spchk(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107)
end
function c75059201.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(1)>0
end
function c75059201.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function c75059201.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function c75059201.actcon(e)
if not e:GetHandler():IsLevelAbove(7) then return false end
local a=Duel.GetAttacker()
if not a then return false end
local d=a:GetBattleTarget()
if a:IsControler(1-e:GetHandler():GetControler()) then a,d=d,a end
return a and a:IsSetCard(0x107)
end
--F.A.ホームトランスポーター
function c75676192.initial_effect(c)
--synchro summon
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c75676192.atkval)
c:RegisterEffect(e1)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(c75676192.spchk)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(75676192,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c75676192.lvcon)
e3:SetOperation(c75676192.lvop)
c:RegisterEffect(e3)
--indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetCondition(c75676192.indcon)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e5)
--special summon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(75676192,1))
e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetCountLimit(1)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(c75676192.spcon)
e6:SetTarget(c75676192.sptg)
e6:SetOperation(c75676192.spop)
c:RegisterEffect(e6)
end
function c75676192.atkval(e,c)
return c:GetLevel()*300
end
function c75676192.spchk(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107)
end
function c75676192.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(1)>0
end
function c75676192.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_LEVEL)
e4:SetValue(1)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e4)
end
end
function c75676192.indcon(e)
return e:GetHandler():IsLevelAbove(11)
end
function c75676192.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLevelAbove(13)
end
function c75676192.filter(c,e,tp)
return c:IsSetCard(0x107) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c75676192.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c75676192.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c75676192.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c75676192.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c75676192.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--ユベル
function c78371393.initial_effect(c)
--battle
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(78371393,0))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_CONFIRM)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCondition(c78371393.damcon)
e3:SetTarget(c78371393.damtg)
e3:SetOperation(c78371393.damop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_RELEASE+CATEGORY_DESTROY)
e4:SetDescription(aux.Stringid(78371393,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetCondition(c78371393.descon)
e4:SetTarget(c78371393.destg)
e4:SetOperation(c78371393.desop)
c:RegisterEffect(e4)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(78371393,3))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e5:SetCode(EVENT_DESTROYED)
e5:SetCondition(c78371393.spcon)
e5:SetTarget(c78371393.sptg)
e5:SetOperation(c78371393.spop)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
end
function c78371393.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttackTarget()
end
function c78371393.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAttackPos() end
Duel.SetTargetPlayer(1-tp)
local atk=Duel.GetAttacker():GetAttack()
Duel.SetTargetParam(atk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
function c78371393.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function c78371393.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c78371393.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if not Duel.CheckReleaseGroup(REASON_EFFECT,tp,nil,1,nil) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
end
function c78371393.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
if Duel.CheckReleaseGroup(REASON_EFFECT,tp,nil,1,c) and Duel.SelectYesNo(tp,aux.Stringid(78371393,2)) then
local g=Duel.SelectReleaseGroup(REASON_EFFECT,tp,nil,1,1,c)
Duel.Release(g,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
end
end
function c78371393.spcon(e,tp,eg,ep,ev,re,r,rp)
return re~=e:GetLabelObject()
end
function c78371393.filter(c,e,tp)
return c:IsCode(4779091) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
function c78371393.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c78371393.filter,tp,0x13,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0x13)
end
function c78371393.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c78371393.filter),tp,0x13,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP)
Duel.ShuffleDeck(tp)
end
end
--デュアル・アブレーション
function c80758812.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(80758812,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,80758812)
e2:SetCondition(c80758812.condition)
e2:SetCost(c80758812.cost)
e2:SetTarget(c80758812.sptg1)
e2:SetOperation(c80758812.spop1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetDescription(aux.Stringid(80758812,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e3:SetTarget(c80758812.sptg2)
e3:SetOperation(c80758812.spop2)
c:RegisterEffect(e3)
end
c80758812.has_text_type=TYPE_DUAL
function c80758812.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c80758812.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c80758812.spfilter1(c,e,tp)
return c:IsType(TYPE_DUAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c80758812.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c80758812.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c80758812.spop1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c80758812.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
tc:EnableDualState()
end
Duel.SpecialSummonComplete()
end
function c80758812.relfilter(c,tp)
return c:IsType(TYPE_DUAL) and Duel.GetMZoneCount(tp,c)>0
end
function c80758812.spfilter2(c,e,tp)
return c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c80758812.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_EFFECT,tp,c80758812.relfilter,1,nil)
and Duel.IsExistingMatchingCard(c80758812.spfilter2,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 c80758812.spop2(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,c80758812.relfilter,1,1,nil,tp)
if rg:GetCount()==0 then return end
local relchk=rg:GetFirst():IsDualState()
if Duel.Release(rg,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c80758812.spfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local dg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if dg:GetCount()>0 and relchk and Duel.SelectYesNo(tp,aux.Stringid(80758812,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=dg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
--インフェルノイド・アドラメレク
function c88301393.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCondition(c88301393.spcon)
e2:SetTarget(c88301393.sptg)
e2:SetOperation(c88301393.spop)
c:RegisterEffect(e2)
--chain attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(88301393,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetCondition(c88301393.atcon)
e3:SetOperation(c88301393.atop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(88301393,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCost(c88301393.rmcost)
e4:SetTarget(c88301393.rmtg)
e4:SetOperation(c88301393.rmop)
c:RegisterEffect(e4)
end
function c88301393.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c88301393.sumfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c88301393.lv_or_rk(c)
if c:IsType(TYPE_XYZ) then return c:GetRank()
else return c:GetLevel() end
end
function c88301393.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=Duel.GetMatchingGroup(c88301393.sumfilter,tp,LOCATION_MZONE,0,nil):GetSum(c88301393.lv_or_rk)
if sum>8 then return false end
local loc=LOCATION_GRAVE+LOCATION_HAND
if c:IsHasEffect(34822850) then loc=loc+LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c88301393.spfilter,tp,loc,0,c)
return g:CheckSubGroup(aux.mzctcheck,2,2,tp)
end
function c88301393.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local loc=LOCATION_GRAVE+LOCATION_HAND
if c:IsHasEffect(34822850) then loc=loc+LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c88301393.spfilter,tp,loc,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,true,2,2,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c88301393.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Remove(g,POS_FACEUP,REASON_COST)
g:DeleteGroup()
end
function c88301393.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER) and c:IsChainAttackable() and c:IsStatus(STATUS_OPPO_BATTLE)
end
function c88301393.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
end
function c88301393.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c88301393.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function c88301393.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--インフェルノイド・アスタロス
function c89423971.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c89423971.spcon)
e2:SetOperation(c89423971.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(89423971,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCost(c89423971.descost)
e3:SetTarget(c89423971.destg)
e3:SetOperation(c89423971.desop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(89423971,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCondition(c89423971.rmcon)
e4:SetCost(c89423971.rmcost)
e4:SetTarget(c89423971.rmtg)
e4:SetOperation(c89423971.rmop)
c:RegisterEffect(e4)
end
function c89423971.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c89423971.sumfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c89423971.lv_or_rk(c)
if c:IsType(TYPE_XYZ) then return c:GetRank()
else return c:GetLevel() end
end
function c89423971.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=Duel.GetMatchingGroup(c89423971.sumfilter,tp,LOCATION_MZONE,0,nil):GetSum(c89423971.lv_or_rk)
if sum>8 then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return false end
if c:IsHasEffect(34822850) then
if ft>0 then
return Duel.IsExistingMatchingCard(c89423971.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,c)
else
return Duel.IsExistingMatchingCard(c89423971.spfilter,tp,LOCATION_MZONE,0,1,nil)
end
else
return ft>0 and Duel.IsExistingMatchingCard(c89423971.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,c)
end
end
function c89423971.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if c:IsHasEffect(34822850) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
g=Duel.SelectMatchingCard(tp,c89423971.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
else
g=Duel.SelectMatchingCard(tp,c89423971.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
else
g=Duel.SelectMatchingCard(tp,c89423971.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,c)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c89423971.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c89423971.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
function c89423971.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c89423971.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c89423971.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c89423971.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c89423971.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c89423971.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c89423971.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c89423971.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function c89423971.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--エヴォルド・フォリス
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
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:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o)
e3:SetTarget(s.settg)
e3:SetOperation(s.setop)
c:RegisterEffect(e3)
--replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(s.desreptg)
e4:SetValue(s.desrepval)
e4:SetOperation(s.desrepop)
c:RegisterEffect(e4)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x304e) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_EVOLTILE,tp,false,false,POS_FACEDOWN_DEFENSE)
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_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
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,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 and Duel.SpecialSummon(g,SUMMON_VALUE_EVOLTILE,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(1-tp,g)
end
end
function s.setfilter(c)
return c:IsCode(5338223,24362891) and c:IsSSetable()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SSet(tp,g)
end
end
function s.desrepfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function s.rfilter(c)
return c:IsRace(RACE_REPTILE+RACE_DINOSAUR)
and not c:IsStatus(STATUS_DESTROY_CONFIRMED+STATUS_BATTLE_DESTROYED)
end
function s.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.desrepfilter,1,nil,tp)
and Duel.CheckReleaseGroup(REASON_EFFECT,tp,s.rfilter,1,nil) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function s.desrepval(e,c)
return s.desrepfilter(c,e:GetHandlerPlayer())
end
function s.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local g=Duel.SelectReleaseGroup(REASON_EFFECT,tp,s.rfilter,1,1,nil)
if #g>0 then
Duel.Hint(HINT_CARD,0,id)
Duel.HintSelection(g)
Duel.Release(g,REASON_EFFECT+REASON_REPLACE)
end
end
--F.A.ハングオンマッハ
function c93449450.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c93449450.atkval)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c93449450.immval)
c:RegisterEffect(e2)
--lv up
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(c93449450.spchk)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(93449450,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c93449450.lvcon)
e3:SetOperation(c93449450.lvop)
c:RegisterEffect(e3)
--redirect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c93449450.excon)
e4:SetTarget(c93449450.extg)
e4:SetTargetRange(0xfe,0xff)
e4:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e4)
end
function c93449450.atkval(e,c)
return c:GetLevel()*300
end
function c93449450.immval(e,te)
if te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:IsActiveType(TYPE_MONSTER) and te:IsActivated() then
local lv=e:GetHandler():GetLevel()
local tc=te:GetHandler()
if tc:GetRank()>0 then
return tc:GetOriginalRank()<lv
elseif tc:GetLevel()>0 then
return tc:GetOriginalLevel()<lv
else return false end
else return false end
end
function c93449450.spchk(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107)
end
function c93449450.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(1)>0
end
function c93449450.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_LEVEL)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e4)
end
end
function c93449450.excon(e)
return e:GetHandler():IsLevelAbove(7)
end
function c93449450.extg(e,c)
return c:GetOwner()~=e:GetHandlerPlayer()
end
--インフェルノイド・ベルフェゴル
function c96055137.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCondition(c96055137.spcon)
e2:SetTarget(c96055137.sptg)
e2:SetOperation(c96055137.spop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetTarget(c96055137.rmtg1)
e3:SetOperation(c96055137.rmop1)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCost(c96055137.rmcost2)
e4:SetTarget(c96055137.rmtg2)
e4:SetOperation(c96055137.rmop2)
c:RegisterEffect(e4)
end
function c96055137.spfilter(c)
return c:IsSetCard(0xbb) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c96055137.sumfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c96055137.lv_or_rk(c)
if c:IsType(TYPE_XYZ) then return c:GetRank()
else return c:GetLevel() end
end
function c96055137.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local sum=Duel.GetMatchingGroup(c96055137.sumfilter,tp,LOCATION_MZONE,0,nil):GetSum(c96055137.lv_or_rk)
if sum>8 then return false end
local loc=LOCATION_GRAVE+LOCATION_HAND
if c:IsHasEffect(34822850) then loc=loc+LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c96055137.spfilter,tp,loc,0,c)
return g:CheckSubGroup(aux.mzctcheck,2,2,tp)
end
function c96055137.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local loc=LOCATION_GRAVE+LOCATION_HAND
if c:IsHasEffect(34822850) then loc=loc+LOCATION_MZONE end
local g=Duel.GetMatchingGroup(c96055137.spfilter,tp,loc,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,true,2,2,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c96055137.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Remove(g,POS_FACEUP,REASON_COST)
g:DeleteGroup()
end
function c96055137.rmtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_EXTRA)
end
function c96055137.rmop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(1-tp,nil,1-tp,LOCATION_EXTRA,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
function c96055137.rmcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c96055137.rmtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function c96055137.rmop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
--エクトプラズマー
function c97342942.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--release
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(97342942,0))
e2:SetCategory(CATEGORY_RELEASE+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(c97342942.condition)
e2:SetTarget(c97342942.target)
e2:SetOperation(c97342942.operation)
c:RegisterEffect(e2)
end
function c97342942.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c97342942.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_MZONE)
end
function c97342942.rfilter(c,e)
return c:IsFaceup() and not c:IsImmuneToEffect(e)
end
function c97342942.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rg=Duel.SelectReleaseGroup(REASON_EFFECT,tp,c97342942.rfilter,1,1,e:GetHandler(),e)
if Duel.Release(rg,REASON_EFFECT)>0 then
local atk=math.floor(rg:GetFirst():GetBaseAttack()/2)
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
--人造人間-サイコ・レイヤー
function c99666430.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2)
c:EnableReviveLimit()
--control
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(99666430,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,99666430)
e1:SetCost(c99666430.ctrcost)
e1:SetTarget(c99666430.ctrtg)
e1:SetOperation(c99666430.ctrop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(99666430,1))
e2:SetCategory(CATEGORY_RELEASE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,99666431)
e2:SetCondition(c99666430.descon)
e2:SetTarget(c99666430.destg)
e2:SetOperation(c99666430.desop)
c:RegisterEffect(e2)
end
function c99666430.ctrcost(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 c99666430.ctrfilter(c)
return c:IsFaceup() and c:IsControlerCanBeChanged()
end
function c99666430.ctrtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c99666430.ctrfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c99666430.ctrfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c99666430.ctrfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c99666430.ctrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetControl(tc,tp,PHASE_END,1)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c99666430.confilter(c)
return c:IsFaceup() and c:IsType(TYPE_TRAP)
end
function c99666430.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c99666430.confilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c99666430.rlfilter(c,tp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c99666430.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_EFFECT,tp,c99666430.rlfilter,1,nil,tp) end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c99666430.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(REASON_EFFECT,tp,c99666430.rlfilter,1,1,nil,tp)
if g:GetCount()==0 then
g=Duel.SelectReleaseGroup(REASON_EFFECT,tp,nil,1,1,nil)
end
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.Release(g,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if dg:GetCount()>0 then
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
end
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