Commit fdcb4b93 authored by mercury233's avatar mercury233

update scripts

parent 726d74de
Pipeline #16717 passed with stages
in 1 minute and 13 seconds
--転轍地点
--scripted by JoyJ
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>2 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,1-tp,LOCATION_MZONE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)<3 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(g)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local opt=Duel.SelectOption(1-tp,aux.Stringid(id,1),aux.Stringid(id,2))
if opt==0 then
Duel.SendtoGrave(g,REASON_RULE)
else
local g2=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,g)
Duel.SendtoGrave(g2,REASON_RULE)
end
end
--スウィートルームメイド
--scripted by JoyJ
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cfilter(c)
return c:IsPreviousLocation(LOCATION_HAND+LOCATION_DECK)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function s.activate(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
--クシャトリラ・ライズハート
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--remove and lvchange
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.lvcon)
e2:SetCost(s.lvcost)
e2:SetTarget(s.lvtg)
e2:SetOperation(s.lvop)
c:RegisterEffect(e2)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetLabel(id)
ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetLabel(id)
Duel.RegisterEffect(ge2,0)
end
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x189)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
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 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
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
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:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
end
function s.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)>0
end
function s.costfilter(c)
return not c:IsCode(id) and c:IsSetCard(0x189) and c:IsAbleToRemoveAsCost()
end
function s.lvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tg=Duel.GetDecktopGroup(1-tp,3)
if chk==0 then return c:IsLevelAbove(0) and not c:IsLevel(7)
and tg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==3 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,1-tp,LOCATION_DECK)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetDecktopGroup(1-tp,3)
if #tg<3 then return end
Duel.DisableShuffleCheck()
if Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT)>0
and c:IsFaceup() and c:IsRelateToChain() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(7)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
--スケアクロー・クシャトリラ
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--defense attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DEFENSE_ATTACK)
e2:SetValue(1)
c:RegisterEffect(e2)
--bp disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCondition(s.discon)
e3:SetOperation(s.disop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_DISABLE)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,LOCATION_MZONE)
e5:SetTarget(s.distg)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_DISABLE_EFFECT)
c:RegisterEffect(e6)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function s.rmfilter(c)
return c:IsSetCard(0x189,0x17a) and c:IsAbleToRemove()
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,c)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and #g>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.rmfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
end
function s.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x189,0x17a) and c:IsControler(tp)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetAttackTarget()
if not c then return false end
if c:IsControler(1-tp) then c=Duel.GetAttacker() end
return c and s.cfilter(c,tp)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttackTarget()
if tc:IsControler(tp) then tc=Duel.GetAttacker() end
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
Duel.AdjustInstantly(c)
end
function s.distg(e,c)
return c:GetFlagEffect(id)~=0
end
--ティアラメンツ・クシャトリラ
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--deckdes
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.ddtg)
e2:SetOperation(s.ddop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--to grave deckdes
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DECKDES)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,id+o*2)
e4:SetCondition(s.discon)
e4:SetTarget(s.distg)
e4:SetOperation(s.disop)
c:RegisterEffect(e4)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function s.rmfilter(c)
return c:IsSetCard(0x189,0x181) and c:IsAbleToRemove()
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,c)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and #g>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.rmfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end
end
function s.ddtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local b1=Duel.IsPlayerCanDiscardDeck(tp,3)
local b2=Duel.IsPlayerCanDiscardDeck(1-tp,3)
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,PLAYER_ALL,3)
end
function s.ddop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsPlayerCanDiscardDeck(tp,3)
local b2=Duel.IsPlayerCanDiscardDeck(1-tp,3)
if not b1 and not b2 then return end
local opt=0
if b1 and not b2 then
opt=Duel.SelectOption(tp,aux.Stringid(id,1))
end
if not b1 and b2 then
opt=Duel.SelectOption(tp,aux.Stringid(id,2))+1
end
if b1 and b2 then
opt=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
end
if opt==0 then
Duel.DiscardDeck(tp,3,REASON_EFFECT)
else
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)
end
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.DiscardDeck(p,d,REASON_EFFECT)
end
--呪眼の眷属 バジリコック
--Script by mercury233
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_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--link summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.lkcon)
e2:SetTarget(s.lktg)
e2:SetOperation(s.lkop)
c:RegisterEffect(e2)
end
function s.spcfilter(c)
return c:IsSetCard(0x129) and c:IsFaceup()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.spcfilter,tp,LOCATION_MZONE,0,1,nil)
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 e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1,true)
end
end
function s.regop(e,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetTargetRange(LOCATION_SZONE,0)
e1:SetTarget(s.mattg)
e1:SetValue(s.matval)
Duel.RegisterEffect(e1,tp)
return e1
end
function s.mattg(e,c)
return c:IsSetCard(0x129) and c:IsType(TYPE_EQUIP) and c:IsType(TYPE_SPELL)
end
function s.matval(e,lc,mg,c,tp)
if not (lc:IsSetCard(0x129) and e:GetHandlerPlayer()==tp) then return false,nil end
return true,true
end
function s.lkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function s.lkfilter(c)
return c:IsSetCard(0x129) and c:IsLinkSummonable(nil)
end
function s.lktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local e1=s.regop(e,tp)
local res=Duel.IsExistingMatchingCard(s.lkfilter,tp,LOCATION_EXTRA,0,1,nil)
e1:Reset()
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.lkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=s.regop(e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.lkfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_COST)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetLabelObject(e1)
e2:SetOperation(s.resetop)
tc:RegisterEffect(e2)
Duel.LinkSummon(tp,tc,nil)
else
e1:Reset()
end
end
function s.resetop(e,tp,eg,ep,ev,re,r,rp)
local e1=e:GetLabelObject()
e1:Reset()
e:Reset()
end
--王の呪 ヴァラ
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--special summon self
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost1)
e1:SetTarget(s.sptg1)
e1:SetOperation(s.spop1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
end
function s.cfilter(c)
return c:IsAbleToGraveAsCost() and c:IsSetCard(0x134)
end
function s.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
function s.spfilter(c,e,tp)
return not c:IsCode(id) and c:IsSetCard(0x134) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.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.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--クシャトリラ・アライズハート
--Script by 奥克斯 & mercury233
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,73542331)
--xyz summon
aux.AddXyzProcedure(c,nil,7,3,s.ovfilter,aux.Stringid(id,0),3,s.xyzop)
c:EnableReviveLimit()
--macro cosmos
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTargetRange(0xff,0xff)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_REMOVE)
e2:SetCondition(s.mtcon)
e2:SetTarget(s.mttg)
e2:SetOperation(s.mtop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCost(s.rmcost)
e3:SetTarget(s.rmtg)
e3:SetOperation(s.rmop)
c:RegisterEffect(e3)
--
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:GetHandler():IsCode(73542331)
end
function s.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x189)
end
function s.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0
and (Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)>0
or Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)>0) end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function s.remfilter(c)
return not c:IsType(TYPE_TOKEN)
end
function s.mtcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsExists(s.remfilter,1,nil)
end
function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
--workaround check of only 1 activation
local g=e:GetLabelObject()
local res=c:GetFlagEffect(id)==0 and (g==nil or g:Equal(eg))
if res then e:SetLabelObject(eg) end
return res
end
e:SetLabelObject(nil)
c:RegisterFlagEffect(id,RESET_CHAIN,0,1)
end
function s.mtfilter1(c,tp)
return c:IsCanOverlay() and (c:IsFaceup() or c:IsControler(tp))
end
function s.mtfilter2(c)
return c:IsCanOverlay() and c:IsFacedown()
end
function s.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToChain() and c:IsType(TYPE_XYZ)) then return end
local mg1=Duel.GetMatchingGroup(s.mtfilter1,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil,tp)
local mg2=Duel.GetMatchingGroup(s.mtfilter2,tp,0,LOCATION_REMOVED,nil)
if #mg1==0 and #mg2==0 then return end
local g
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPTION)
if #mg1==0 or #mg2>0 and Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))==1 then
g=mg2:RandomSelect(tp,1)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg1:Select(tp,1,1,nil)
end
Duel.Overlay(c,g)
end
function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST)
end
function s.rmfilter(c,tp)
return c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.rmfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)
end
end
--影の王 レイヴァーテイン
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
c:SetUniqueOnField(1,0,id)
--xyz summon
aux.AddXyzProcedure(c,nil,9,2,nil,nil,99)
c:EnableReviveLimit()
--decrease atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(-1000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--special summon xyz
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCost(s.spcost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and c:IsSummonType(SUMMON_TYPE_XYZ) end
local ct=c:GetOverlayCount()
Duel.Release(c,REASON_COST)
e:SetLabel(ct)
end
function s.filter(c,e,tp,rc)
return not c:IsRace(RACE_FAIRY)
and c:IsSetCard(0x134) and c:IsType(TYPE_XYZ)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,rc,c)>0
end
function s.mtfilter(c,e)
return c:IsCanOverlay() and not c:IsImmuneToEffect(e)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,e:GetHandler())
if #g>0 then
local tc=g:GetFirst()
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.mtfilter),tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,tc,e)
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and ct>0
and #mg>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local xg=mg:Select(tp,1,ct,nil)
local tc1=xg:GetFirst()
while tc1 do
local og=tc1:GetOverlayGroup()
if #og>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
tc1=xg:GetNext()
end
Duel.Overlay(tc,xg)
end
end
end
--クシャトリラ・オーバーラップ
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMINGS_CHECK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCondition(aux.dscon)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.distg)
e2:SetOperation(s.disop)
c:RegisterEffect(e2)
end
function s.filter(c,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE,1,c)
end
function s.rmfilter(c)
return c:IsAttack(1500) and c:IsDefense(2100)
and c:IsAbleToRemove() and c:IsFaceupEx()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
local g=Duel.GetMatchingGroup(s.rmfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local exc
if tc:IsRelateToEffect(e) then exc=tc end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.rmfilter),tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE,1,1,exc)
if #sg>0 and Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)>0
and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x189)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and aux.NegateEffectMonsterFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
--六世壊他化自在天
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x189)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetAttribute())
end
function s.spfilter(c,e,tp,attr)
return not c:IsAttribute(attr) and c:IsSetCard(0x189)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local attr=tc:GetAttribute()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,attr)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
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:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
end
function s.thfilter(c)
return not c:IsCode(id) and c:IsSetCard(0x189) and c:IsFaceup() and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and s.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--六世壊=パライゾス
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--atk/def up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetValue(s.val)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,id+o)
e4:SetCondition(s.descon)
e4:SetTarget(s.destg)
e4:SetOperation(s.desop)
c:RegisterEffect(e4)
end
function s.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x189)
and c:IsAbleToHand()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function s.atkfilter(c)
return c:IsFaceup() and c:GetAttribute()~=0
end
function s.val(e,c)
local g=Duel.GetMatchingGroup(s.atkfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
return aux.GetAttributeCount(g)*100
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
local rc=re:GetHandler()
return bit.band(loc,LOCATION_ONFIELD)~=0 and rp==tp and rc:IsCode(73542331)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.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
--界放せし肆世壊
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,56099748)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--cannot target/indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(s.immtg)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
--bp remove
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT)
e3:SetValue(LOCATION_REMOVED)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(s.immtg)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,0))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCost(s.descost)
e5:SetTarget(s.destg)
e5:SetOperation(s.desop)
c:RegisterEffect(e5)
end
function s.immtg(e,c)
return c:IsFaceup() and (c:IsCode(56099748) or (c:IsType(TYPE_LINK) and c:IsSetCard(0x17a)))
end
function s.cfilter(c)
return c:IsType(TYPE_LINK) and c:IsSetCard(0x17a)
and c:IsAbleToRemoveAsCost()
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.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
--嫋々たる漣歌姫の壱世壊
--Script by mercury233
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(s.atktg)
e2:SetValue(500)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,id)
e3:SetCondition(s.tgcon)
e3:SetTarget(s.tgtg)
e3:SetOperation(s.tgop)
c:RegisterEffect(e3)
end
function s.atktg(e,c)
return c:IsType(TYPE_FUSION) or c:IsSetCard(0x181)
end
function s.cfilter(c,tp)
return c:IsReason(REASON_EFFECT) and c:IsControler(tp) and c:IsRace(RACE_AQUA) and c:IsSetCard(0x181)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_AQUA) and c:IsLevelBelow(4) and c:IsAbleToGrave()
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE)
and not tc:IsSetCard(0x181) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetLabel(tc:GetCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
......@@ -23,14 +23,15 @@ end
function c101111066.filter(c,e,tp)
return c:IsSetCard(0x3a)
end
function c101111066.rfilter2(c,e,tp,m1)
function c101111066.rfilter2(c,e,tp)
return bit.band(c:GetType(),0x81)==0x81 and c:IsSetCard(0x3a) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
end
function c101111066.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetReleaseGroup(1-tp):Filter(Card.IsFaceup,nil)
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c101111066.filter,e,tp,mg1,nil,Card.GetLevel,"Equal") or mg2:GetCount()>0
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c101111066.filter,e,tp,mg1,nil,Card.GetLevel,"Equal")
or mg2:GetCount()>0 and Duel.IsExistingMatchingCard(c101111066.rfilter2,tp,LOCATION_HAND,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
......
--災誕の呪眼
--Script by mercury233
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.eqcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.eqtg)
e2:SetOperation(s.eqop)
c:RegisterEffect(e2)
end
function s.tgfilter(c)
return c:IsSetCard(0x129) and c:IsAbleToGraveAsCost()
end
function s.thfilter(c)
return c:IsSetCard(0x129) and c:IsType(TYPE_EQUIP) and c:IsAbleToHand()
end
function s.gcheck(g,tp)
return aux.gfcheck(g,Card.IsType,TYPE_MONSTER,TYPE_SPELL+TYPE_TRAP)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,g)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then return g:CheckSubGroup(s.gcheck,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,s.gcheck,false,2,2,tp)
Duel.SendtoGrave(sg,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:IsCostChecked()
or Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
--lose lp
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetOperation(s.lpop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.lpop(e,tp,eg,ep,ev,re,r,rp)
if rp==tp and not re:GetHandler():IsSetCard(0x129) then
Duel.SetLP(tp,Duel.GetLP(tp)-500)
end
end
function s.cfilter(c,tp)
return c:IsType(TYPE_LINK) and c:IsSetCard(0x129) and c:IsSummonType(SUMMON_TYPE_LINK) and c:IsSummonPlayer(tp)
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.eqfilter(c,tp)
return c:IsSetCard(0x129) and c:IsType(TYPE_EQUIP) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
and Duel.IsExistingMatchingCard(s.eqtgfilter,tp,LOCATION_MZONE,0,1,nil,c)
end
function s.eqtgfilter(c,eqc)
return c:IsFaceup() and c:IsSetCard(0x129) and c:IsType(TYPE_LINK) and eqc:CheckEquipTarget(c)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if ec then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,s.eqtgfilter,tp,LOCATION_MZONE,0,1,1,nil,ec):GetFirst()
Duel.Equip(tp,ec,tc)
end
end
end
--トリヴィカルマ
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMINGS_CHECK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCondition(aux.dscon)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,id)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsFaceup() and c:IsCode(56099748)
end
function s.negfilter(c)
return aux.NegateEffectMonsterFilter(c) and (c:GetBaseAttack()>0 or c:GetBaseDefense()>0)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(s.negfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g2=Duel.SelectTarget(tp,s.negfilter,tp,0,LOCATION_MZONE,1,1,nil)
e:SetLabelObject(g2:GetFirst())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g2,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local lc=tg:GetFirst()
if #tg~=2 then return end
if lc==tc then lc=tg:GetNext() end
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp)
and not tc:IsDisabled() and not tc:IsImmuneToEffect(e) then
local upatk=tc:GetBaseAttack()
if tc:GetBaseAttack()<tc:GetBaseDefense() then
upatk=tc:GetBaseDefense()
end
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if lc:IsRelateToEffect(e) and lc:IsControler(tp)
and lc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(upatk/2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
lc:RegisterEffect(e1)
end
end
end
function s.thfilter(c)
return not c:IsCode(id) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
and aux.IsCodeListed(c,56099748)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--六世壊根清净
--Script by 奥克斯
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--xyzmat to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x189) and c:IsType(TYPE_XYZ)
end
function s.condition(e)
return Duel.IsExistingMatchingCard(s.cfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
local b1=#g1>1 and g1:IsExists(Card.IsAbleToRemove,1,nil,tp,POS_FACEDOWN,REASON_RULE)
local b2=#g2>1 and g2:IsExists(Card.IsAbleToRemove,1,nil,1-tp,POS_FACEDOWN,REASON_RULE)
if chk==0 then return Duel.IsPlayerCanRemove(tp) and (b1 or b2) end
local g3=g1+g2
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g3,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanRemove(tp) then return end
local g1=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
local b1=#g1>1 and g1:IsExists(Card.IsAbleToRemove,1,nil,tp,POS_FACEDOWN,REASON_RULE)
local b2=#g2>1 and g2:IsExists(Card.IsAbleToRemove,1,nil,1-tp,POS_FACEDOWN,REASON_RULE)
if b1 then
local ct=#g1-1
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g1:FilterSelect(tp,Card.IsAbleToRemove,ct,ct,nil,tp,POS_FACEDOWN,REASON_RULE)
Duel.Remove(sg,POS_FACEDOWN,REASON_RULE)
end
if b2 then
local ct=#g2-1
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local sg=g2:FilterSelect(1-tp,Card.IsAbleToRemove,ct,ct,nil,1-tp,POS_FACEDOWN,REASON_RULE)
Duel.Remove(sg,POS_FACEDOWN,REASON_RULE)
end
end
function s.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x189)
and c:IsAbleToHand()
end
function s.xfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x189)
and c:GetOverlayGroup():IsExists(s.thfilter,1,nil)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.xfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.xfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.xfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_OVERLAY)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local mg=tc:GetOverlayGroup():Filter(s.thfilter,nil)
if tc:IsRelateToEffect(e) and tc:IsFaceup() and #mg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local bc=mg:Select(tp,1,1,nil):GetFirst()
if Duel.SendtoHand(bc,nil,REASON_EFFECT)>0
and bc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,bc)
Duel.ShuffleHand(tp)
if bc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.SpecialSummon(bc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
--壱世壊に澄み渡る残響
function c1329620.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_TODECK+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,1329620)
e1:SetCondition(c1329620.condition)
e1:SetTarget(c1329620.target)
e1:SetOperation(c1329620.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,1329620)
e2:SetCondition(c1329620.thcon)
e2:SetTarget(c1329620.thtg)
e2:SetOperation(c1329620.thop)
c:RegisterEffect(e2)
end
function c1329620.actcfilter(c)
return ((c:IsSetCard(0x181) and c:IsLocation(LOCATION_MZONE)) or c:IsCode(56099748)) and c:IsFaceup()
end
function c1329620.condition(e,tp,eg,ep,ev,re,r,rp)
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(c1329620.actcfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c1329620.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c1329620.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1329620.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0)
end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
end
function c1329620.activate(e,tp,eg,ep,ev,re,r,rp)
local ec=re:GetHandler()
if Duel.NegateActivation(ev) and ec:IsRelateToEffect(re) then
ec:CancelToGrave()
if Duel.SendtoDeck(ec,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and ec:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c1329620.cfilter,tp,LOCATION_HAND,0,1,1,nil)
if #g>0 then
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
end
function c1329620.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c1329620.thfilter(c)
return c:IsSetCard(0x181) and c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsAbleToHand()
end
function c1329620.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c1329620.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1329620.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c1329620.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c1329620.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 c32152870.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(32152870,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c32152870.target)
e1:SetOperation(c32152870.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32152870,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,32152870)
e2:SetCondition(c32152870.thcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c32152870.thtg)
e2:SetOperation(c32152870.thop)
c:RegisterEffect(e2)
end
function c32152870.filter(c)
return c:IsCode(56063182) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsAbleToHand()
end
function c32152870.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsControler(tp)
and c32152870.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c32152870.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c32152870.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c32152870.actcfilter(c,tp)
return c:IsFaceup() and c:IsCode(56099748)
end
function c32152870.actfilter(c,tp)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c32152870.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND)
and Duel.IsExistingMatchingCard(c32152870.actcfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(c32152870.actfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(32152870,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectMatchingCard(tp,c32152870.actfilter,tp,0,LOCATION_MZONE,1,1,nil)
if #g>0 then
Duel.BreakEffect()
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
end
function c32152870.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsDefensePos,tp,LOCATION_MZONE,LOCATION_MZONE,3,nil)
end
function c32152870.thfilter(c)
return c:IsSetCard(0x17a) and c:IsAbleToHand()
end
function c32152870.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c32152870.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c32152870.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c32152870.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
--壱世壊に渦巻く反響
function c33878367.initial_effect(c)
aux.AddCodeList(c,56099748)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,33878367)
e1:SetTarget(c33878367.sptg)
e1:SetOperation(c33878367.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,33878367)
e2:SetCondition(c33878367.thcon)
e2:SetTarget(c33878367.thtg)
e2:SetOperation(c33878367.thop)
c:RegisterEffect(e2)
end
function c33878367.spfilter(c,e,tp)
return (c:IsSetCard(0x181) or c:IsCode(56099748)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33878367.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c33878367.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,1,nil,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,1,nil,tp,LOCATION_MZONE)
end
function c33878367.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(c33878367.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local sg=Duel.GetMatchingGroup(c33878367.tgfilter,tp,LOCATION_MZONE,0,nil,tc:GetRace(),tc:GetAttribute())
if sg:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sc=sg:Select(tp,1,1,nil)
Duel.SendtoGrave(sc,REASON_EFFECT)
end
end
end
function c33878367.tgfilter(c,race,attr)
return c:IsFaceup() and (c:IsRace(race) or c:IsAttribute(attr)) and c:IsAbleToGrave()
end
function c33878367.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c33878367.thfilter(c)
return c:IsSetCard(0x181) and c:IsType(TYPE_TRAP) and c:IsFaceup() and c:IsAbleToHand()
end
function c33878367.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c33878367.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33878367.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c33878367.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c33878367.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 c38436986.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,38436986)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c38436986.condition)
e1:SetTarget(c38436986.target)
e1:SetOperation(c38436986.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,38436986)
e2:SetCondition(c38436986.thcon)
e2:SetTarget(c38436986.thtg)
e2:SetOperation(c38436986.thop)
c:RegisterEffect(e2)
end
function c38436986.actcfilter(c)
return ((c:IsSetCard(0x181) and c:IsLocation(LOCATION_MZONE)) or c:IsCode(56099748)) and c:IsFaceup()
end
function c38436986.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c38436986.actcfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c38436986.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c38436986.tgfilter(c)
return c:IsSetCard(0x181) and c:IsAbleToGrave() and c:IsType(TYPE_MONSTER)
end
function c38436986.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c38436986.posfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c38436986.posfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c38436986.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c38436986.posfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c38436986.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c38436986.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
function c38436986.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c38436986.thfilter(c)
return c:IsSetCard(0x181) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c38436986.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c38436986.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c38436986.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c38436986.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c38436986.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 c41619242.initial_effect(c)
aux.AddCodeList(c,56099748)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(41619242,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,41619242+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(aux.dscon)
e1:SetTarget(c41619242.atktg)
e1:SetOperation(c41619242.atkop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(41619242,1))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,41619242+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c41619242.discon)
e2:SetTarget(c41619242.distg)
e2:SetOperation(c41619242.disop)
c:RegisterEffect(e2)
end
function c41619242.atkfilter(c)
return c:IsSetCard(0x17a) or c:IsCode(56099748)
end
function c41619242.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c41619242.atkfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,c41619242.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g2=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
g1:Merge(g2)
end
function c41619242.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()<2 then return end
local sc1=tg:Filter(Card.IsControler,nil,tp):GetFirst()
local sc2=tg:Filter(Card.IsControler,nil,1-tp):GetFirst()
if not sc1 or not sc2 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(math.max(sc2:GetAttack(),sc2:GetDefense()))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc1:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
sc1:RegisterEffect(e2)
end
function c41619242.disfilter(c,tp)
return (c:IsSetCard(0x17a) or c:IsCode(56099748))
and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsControler(tp)
end
function c41619242.discon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(c41619242.disfilter,1,nil,tp) and Duel.IsChainDisablable(ev)
end
function c41619242.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c41619242.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--スケアクロー・ライトハート
function c53776969.initial_effect(c)
aux.AddCodeList(c,56099748)
--link summon
aux.AddLinkProcedure(c,c53776969.mfilter,1,1)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c53776969.thcon)
e1:SetTarget(c53776969.thtg)
e1:SetOperation(c53776969.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,53776969+EFFECT_COUNT_CODE_DUEL)
e2:SetCondition(c53776969.spcon)
e2:SetTarget(c53776969.sptg)
e2:SetOperation(c53776969.spop)
c:RegisterEffect(e2)
end
function c53776969.mfilter(c)
return (c:IsLinkSetCard(0x17a) or c:IsLinkCode(56099748))
and (c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 or not c:IsLocation(LOCATION_MZONE))
end
function c53776969.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK) and c:GetSequence()>4
end
function c53776969.thfilter(c)
return c:IsCode(56063182) and c:IsAbleToHand()
end
function c53776969.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c53776969.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c53776969.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c53776969.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c53776969.filter(c)
return c:IsCode(56099748) and c:IsFaceup()
end
function c53776969.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c53776969.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c53776969.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c53776969.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
--肆世壊=ライフォビア
local s,id,o=GetID()
function c56063182.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,56063182+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c56063182.activate)
c:RegisterEffect(e1)
--Decrease Atk
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(c56063182.atkval)
c:RegisterEffect(e2)
--Decrease Atk
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--destroy1
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(56063182,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,56063182+o)
e4:SetCondition(c56063182.descon)
e4:SetTarget(c56063182.destg)
e4:SetOperation(c56063182.desop)
c:RegisterEffect(e4)
end
function c56063182.filter(c)
return ((c:IsSetCard(0x17a) and c:IsType(TYPE_MONSTER)) or c:IsCode(56099748)) and c:IsAbleToHand()
end
function c56063182.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c56063182.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(56063182,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c56063182.atkval(e)
return Duel.GetMatchingGroupCount(Card.IsDefensePos,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)*-100
end
function c56063182.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsDefensePos,tp,LOCATION_MZONE,LOCATION_MZONE,nil)>=3
end
function c56063182.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c56063182.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 c60362066.initial_effect(c)
aux.AddCodeList(c,56099748)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,60362066)
e1:SetTarget(c60362066.tdtg)
e1:SetOperation(c60362066.tdop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,60362066)
e2:SetCondition(c60362066.thcon)
e2:SetTarget(c60362066.thtg)
e2:SetOperation(c60362066.thop)
c:RegisterEffect(e2)
end
function c60362066.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeck()
end
function c60362066.cfilter(c)
return c:IsCode(56099748) and c:IsFaceup()
end
function c60362066.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c60362066.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c60362066.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,e:GetHandler()) end
local ct=1
if Duel.IsExistingMatchingCard(c60362066.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then ct=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c60362066.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,1,nil,tp,LOCATION_HAND)
end
function c60362066.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 and Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
and g:FilterCount(Card.IsLocation,nil,LOCATION_DECK)==g:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,1,nil)
if #sg>0 then
Duel.BreakEffect()
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
end
function c60362066.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c60362066.thfilter(c)
return c:IsSetCard(0x181) and c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end
function c60362066.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c60362066.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c60362066.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c60362066.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c60362066.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 c6767771.initial_effect(c)
aux.AddCodeList(c,56099748)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,6767771)
e2:SetTarget(c6767771.distg)
e2:SetOperation(c6767771.disop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,6767772)
e4:SetCondition(c6767771.thcon)
e4:SetTarget(c6767771.thtg)
e4:SetOperation(c6767771.thop)
c:RegisterEffect(e4)
end
function c6767771.disfilter(c)
return ((c:IsSetCard(0x181) and c:IsLocation(LOCATION_MZONE)) or c:IsCode(56099748)) and c:IsFaceup()
end
function c6767771.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3)
and Duel.IsExistingMatchingCard(c6767771.disfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(3)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end
function c6767771.disop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.DiscardDeck(p,d,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(-500)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c6767771.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c6767771.thfilter(c)
return c:IsSetCard(0x181) and c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end
function c6767771.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c6767771.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c6767771.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c6767771.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--壱世壊に奏でる哀唱
function c74920585.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--quick
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74920585,0))
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,74920585)
e2:SetCondition(c74920585.condition)
e2:SetTarget(c74920585.target)
e2:SetOperation(c74920585.activate)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,74920586)
e3:SetCondition(c74920585.thcon)
e3:SetTarget(c74920585.thtg)
e3:SetOperation(c74920585.thop)
c:RegisterEffect(e3)
end
function c74920585.actcfilter(c)
return ((c:IsSetCard(0x181) and c:IsLocation(LOCATION_MZONE)) or c:IsCode(56099748)) and c:IsFaceup()
end
function c74920585.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c74920585.actcfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c74920585.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.NegateEffectMonsterFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
Duel.SelectTarget(tp,aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_MZONE)
end
function c74920585.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
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)
Duel.AdjustInstantly()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,1,nil)
if #g>0 then
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
function c74920585.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c74920585.thfilter(c)
return c:IsSetCard(0x181) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c74920585.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74920585.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c74920585.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74920585.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--壱世壊=ペルレイノ
function c77103950.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,77103950+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c77103950.activate)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c77103950.atktg)
e2:SetValue(500)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(77103950,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,77103951)
e3:SetCode(EVENT_TO_DECK)
e3:SetCondition(c77103950.descon)
e3:SetTarget(c77103950.destg)
e3:SetOperation(c77103950.desop)
c:RegisterEffect(e3)
end
function c77103950.filter(c)
return ((c:IsSetCard(0x181) and c:IsType(TYPE_MONSTER)) or c:IsCode(56099748)) and c:IsAbleToHand()
end
function c77103950.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c77103950.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(77103950,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c77103950.atktg(e,c)
return c:IsType(TYPE_FUSION) or c:IsSetCard(0x181)
end
function c77103950.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsSetCard(0x181) and c:IsType(TYPE_MONSTER)
and (c:IsPreviousLocation(LOCATION_GRAVE)
or (c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousSetCard(0x181)))
end
function c77103950.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c77103950.cfilter,1,nil,tp)
end
function c77103950.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c77103950.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 c79552283.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--able to be DefensePos attack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(79552283,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetTarget(c79552283.adatktg)
e2:SetOperation(c79552283.adatkop)
c:RegisterEffect(e2)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(79552283,1))
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,79552283)
e4:SetCondition(c79552283.discon)
e4:SetCost(c79552283.discost)
e4:SetTarget(c79552283.distg)
e4:SetOperation(c79552283.disop)
c:RegisterEffect(e4)
end
function c79552283.filter(c,e,tp)
return (c:IsSetCard(0x17a) or c:IsCode(56099748)) and not c:IsType(TYPE_LINK)
end
function c79552283.adatktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c79552283.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c79552283.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c79552283.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
end
function c79552283.adatkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
--defense attack
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(c79552283.adaval)
tc:RegisterEffect(e1)
end
function c79552283.adaval(e)
local c=e:GetHandler()
return c:GetAttack()>c:GetDefense() and 0 or 1
end
function c79552283.exfilter(c)
return c:IsFaceup() and c:IsSetCard(0x17a) and c:GetSequence()>=5
end
function c79552283.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainDisablable(ev) and Duel.IsExistingMatchingCard(c79552283.exfilter,tp,LOCATION_MZONE,0,1,nil) and rp==1-tp
end
function c79552283.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and c:IsStatus(STATUS_EFFECT_ENABLED) end
Duel.SendtoGrave(c,REASON_COST)
end
function c79552283.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c79552283.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--肆世壊の新星
function c83558891.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c83558891.target)
e1:SetOperation(c83558891.activate)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,83558891)
e2:SetTarget(c83558891.reptg)
e2:SetValue(c83558891.repval)
e2:SetOperation(c83558891.repop)
c:RegisterEffect(e2)
end
function c83558891.filter(c,e,tp)
return (c:IsSetCard(0x17a) or c:IsCode(56099748)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c83558891.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c83558891.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c83558891.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c83558891.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c83558891.activate(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_DEFENSE)
end
end
function c83558891.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x17a) and c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function c83558891.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c83558891.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c83558891.repval(e,c)
return c83558891.repfilter(c,e:GetHandlerPlayer())
end
function c83558891.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--肆世壊の双牙
function c95245571.initial_effect(c)
aux.AddCodeList(c,56099748)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(95245571,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,95245571+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c95245571.cost)
e1:SetTarget(c95245571.target)
e1:SetOperation(c95245571.activate)
c:RegisterEffect(e1)
--cannot activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95245571,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMING_DRAW_PHASE)
e2:SetCondition(c95245571.cacon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c95245571.catg)
e2:SetOperation(c95245571.caop)
c:RegisterEffect(e2)
end
function c95245571.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c95245571.actfilter(c)
return c:IsCode(56099748) and c:IsFaceup()
end
function c95245571.desfilter(c,check)
return check or c:IsAbleToRemove()
end
function c95245571.descfilter(c,tc,ec,check)
return c95245571.desfilter(c,check) and c:GetEquipTarget()~=tc and c~=ec
end
function c95245571.costfilter(c,ec,tp,check)
if not c:IsSetCard(0x17a) then return false end
return Duel.IsExistingTarget(c95245571.descfilter,tp,0,LOCATION_ONFIELD,2,c,c,ec,check)
end
function c95245571.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local check=not Duel.IsExistingMatchingCard(c95245571.actfilter,tp,LOCATION_ONFIELD,0,1,nil)
if chkc then return chkc:IsOnField() and chkc~=c and c95245571.desfilter(chkc,check) end
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c95245571.costfilter,1,c,c,tp,check)
else
return Duel.IsExistingTarget(c95245571.desfilter,tp,0,LOCATION_ONFIELD,2,c,check)
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
local sg=Duel.SelectReleaseGroup(tp,c95245571.costfilter,1,1,c,c,tp,check)
Duel.Release(sg,REASON_COST)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c95245571.desfilter,tp,0,LOCATION_ONFIELD,2,2,c,check)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
function c95245571.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if Duel.IsExistingMatchingCard(c95245571.actfilter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.Destroy(sg,REASON_EFFECT,LOCATION_REMOVED)
else
Duel.Destroy(sg,REASON_EFFECT)
end
end
function c95245571.cacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsLinkAbove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,3)
end
function c95245571.catg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,95245571)==0 end
end
function c95245571.caop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetValue(c95245571.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,95245571,RESET_PHASE+PHASE_END,0,1)
end
function c95245571.aclimit(e,re,tp)
local c=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_MZONE)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment