Commit c4917c96 authored by mercury233's avatar mercury233

update

parent 3cf0b7b0
#created by ...
#main
100276001
100416027
100416028
100416029
100416030
100416031
100416032
100416037
100416038
100416039
100274203
#extra
100416033
100416034
100416035
100274201
100274202
!side
#created by ...
#main
100200194
100277002
100416001
100416002
100416003
100416004
100416005
100416006
100416007
100416008
100416009
100416010
100416011
100416012
100416013
100416014
100416015
100416016
100416017
100416018
100416019
100416020
100416021
100416023
100416024
100416025
100416026
100416036
101105201
101105202
101105203
101105205
101105206
101105207
101105208
100276001
100416027
100416028
100416029
100416030
100416031
100416032
100416037
100416038
100416039
100275001
100274203
101103000
#extra
100277001
101105204
100416033
100416034
100416035
100274201
100274202
101103083
101103084
101103085
!side
101103081
101103082
101103086
101103087
101103088
101103089
101103090
101103091
101103092
101103093
101103094
101103095
101103096
101103097
101103098
......@@ -2,3 +2,5 @@
!counter 0x60 指示物(北极天熊北斗星)
!victory 0x21 「混沌虚数No.1000 梦幻虚光神 原数天灵·原数天地」特殊胜利
!setname 0x261 北极天熊
!setname 0x264 溟界
!setname 0x265 七音服
......@@ -20,7 +20,7 @@ function c100274201.initial_effect(c)
c:RegisterEffect(e1)
--Destroy all/Special Summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_GRAVE_SPSUMMON)
e2:SetDescription(aux.Stringid(100274201,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
......@@ -63,7 +63,6 @@ function c100274201.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local sg=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_GRAVE)
end
function c100274201.spfilter2(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
......
......@@ -20,7 +20,7 @@ function c100276001.initial_effect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100276001+100)
e2:SetTarget(c100276001.sptg)
e2:SetOperation(c100276001.spop)
......
--魔道騎竜カース・オブ・ドラゴン
--
--Script by mercury233
--not fully implemented
function c100277001.initial_effect(c)
aux.AddCodeList(c,66889139)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),c100277001.matfilter2,true)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100277001,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100277001)
e1:SetCondition(c100277001.thcon)
e1:SetTarget(c100277001.thtg)
e1:SetOperation(c100277001.thop)
c:RegisterEffect(e1)
--grave fusion material
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_FUSION_MATERIAL)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_GRAVE,0)
e2:SetTarget(c100277001.mttg)
e2:SetValue(c100277001.mtval)
c:RegisterEffect(e2)
--
if not c100277001.global_check then
_GetFusionMaterial=Duel.GetFusionMaterial
function Duel.GetFusionMaterial(tp)
local g=_GetFusionMaterial(tp)
local exg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_GRAVE,0,nil,EFFECT_EXTRA_FUSION_MATERIAL)
return g+exg
end
_SendtoGrave=Duel.SendtoGrave
function Duel.SendtoGrave(tg,reason)
if reason~=REASON_EFFECT+REASON_MATERIAL+REASON_FUSION or Auxiliary.GetValueType(tg)~="Group" then
return _SendtoGrave(tg,reason)
end
local rg=tg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
tg:Sub(rg)
local ct1=_SendtoGrave(tg,reason)
local ct2=Duel.Remove(rg,POS_FACEUP,reason)
return ct1+ct2
end
end
end
function c100277001.matfilter2(c)
return c:IsLevelAbove(5) and c:IsRace(RACE_DRAGON)
end
function c100277001.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c100277001.thfilter(c)
return aux.IsCodeListed(c,66889139) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100277001.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100277001.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100277001.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100277001.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100277001.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 c100277001.mttg(e,c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c100277001.mtval(e,c)
if not c then return false end
return c:IsLevel(7) and c:IsRace(RACE_DRAGON)
end
--パイル・アームド・ドラゴン
--
--Script by REIKAI
function c100277002.initial_effect(c)
--special summon (self)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100277002,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100277002)
e1:SetCost(c100277002.spcost)
e1:SetTarget(c100277002.sptg)
e1:SetOperation(c100277002.spop)
c:RegisterEffect(e1)
--attack up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100277002,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100277002+100)
e2:SetCost(c100277002.cost)
e2:SetTarget(c100277002.target)
e2:SetOperation(c100277002.operation)
c:RegisterEffect(e2)
end
function c100277002.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost()
and (c:IsAttribute(ATTRIBUTE_WIND) or c:IsLevelAbove(7))
end
function c100277002.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100277002.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c100277002.cfilter,1,1,REASON_COST,e:GetHandler())
end
function c100277002.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 c100277002.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c100277002.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x111) and not c:IsCode(100277002) and c:IsAbleToGraveAsCost()
end
function c100277002.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100277002.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,c100277002.tgfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(tg,REASON_COST)
e:SetLabelObject(tg:GetFirst())
end
function c100277002.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,1,0,0)
end
function c100277002.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local tgc=e:GetLabelObject()
if tc:IsRelateToEffect(e) then
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_UPDATE_ATTACK)
e0:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e0:SetValue(tgc:GetLevel()*300)
tc:RegisterEffect(e0)
--check
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetOperation(c100277002.checkop)
Duel.RegisterEffect(e1,tp)
--cannot announce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetCondition(c100277002.atkcon)
e2:SetTarget(c100277002.atktg)
e1:SetLabelObject(e2)
Duel.RegisterEffect(e2,tp)
end
end
function c100277002.checkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,100277002)~=0 then return end
local fid=eg:GetFirst():GetFieldID()
Duel.RegisterFlagEffect(tp,100277002,RESET_PHASE+PHASE_END,0,1)
e:GetLabelObject():SetLabel(fid)
end
function c100277002.atkcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),100277002)>0
end
function c100277002.atktg(e,c)
return c:GetFieldID()~=e:GetLabel()
end
--溟界の滓-ヌル
--Scripted by mallu11
function c100416001.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100416001,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100416001)
e1:SetCost(c100416001.tgcost)
e1:SetTarget(c100416001.tgtg)
e1:SetOperation(c100416001.tgop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416001,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100416001+100)
e2:SetCondition(c100416001.spcon)
e2:SetTarget(c100416001.sptg)
e2:SetOperation(c100416001.spop)
c:RegisterEffect(e2)
end
function c100416001.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c100416001.tgfilter(c)
return c:IsRace(RACE_REPTILE) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGrave()
end
function c100416001.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416001.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c100416001.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100416001.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c100416001.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x264)
end
function c100416001.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 or Duel.IsExistingMatchingCard(c100416001.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100416001.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 c100416001.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
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)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetAbsoluteRange(tp,1,0)
e2:SetTarget(c100416001.splimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
end
function c100416001.splimit(e,c)
return not c:IsRace(RACE_REPTILE)
end
--溟界の滓-ナイア
--Scripted by mallu11
function c100416002.initial_effect(c)
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100416002,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100416002)
e1:SetCost(c100416002.tgcost)
e1:SetTarget(c100416002.tgtg)
e1:SetOperation(c100416002.tgop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416002,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100416002+100)
e2:SetTarget(c100416002.srtg)
e2:SetOperation(c100416002.srop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c100416002.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c100416002.tgfilter(c)
return c:IsRace(RACE_REPTILE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToGrave()
end
function c100416002.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416002.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c100416002.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100416002.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c100416002.srfilter(c)
return c:IsSetCard(0x264) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100416002.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416002.srfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100416002.srop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100416002.srfilter,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
--溟界の漠-フロギ
--Scripted by mallu11
function c100416003.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100416003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100416003)
e1:SetCondition(c100416003.spcon)
e1:SetTarget(c100416003.sptg)
e1:SetOperation(c100416003.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c100416003.spcon2)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100416003,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100416003+100)
e3:SetCost(c100416003.thcost)
e3:SetTarget(c100416003.thtg)
e3:SetOperation(c100416003.thop)
c:RegisterEffect(e3)
end
function c100416003.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c100416003.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE)
end
function c100416003.tgfilter(c,e,tp)
return c:IsFaceup() and Duel.IsExistingTarget(c100416003.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp,c:GetAttack())
end
function c100416003.spfilter(c,e,tp,atk)
return c:IsAttackAbove(atk) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
function c100416003.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0 and Duel.IsExistingTarget(c100416003.tgfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectTarget(tp,c100416003.tgfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c100416003.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp,g1:GetFirst():GetAttack())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,1,0,0)
end
function c100416003.spop(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 lc==tc then lc=tg:GetNext() end
if lc:IsRelateToEffect(e) and Duel.SpecialSummon(lc,0,tp,1-tp,false,false,POS_FACEUP)~=0 and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function c100416003.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c100416003.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function c100416003.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--溟界の漠-ゾーハ
--Scripted by mallu11
function c100416004.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100416004,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100416004)
e1:SetCondition(c100416004.drcon)
e1:SetTarget(c100416004.drtg)
e1:SetOperation(c100416004.drop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c100416004.drcon2)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100416004,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100416004+100)
e3:SetCost(c100416004.thcost)
e3:SetTarget(c100416004.thtg)
e3:SetOperation(c100416004.thop)
c:RegisterEffect(e3)
end
function c100416004.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c100416004.drcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE)
end
function c100416004.drfilter(c)
return not c:IsCode(100416004) and c:IsSetCard(0x264) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c100416004.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(1-tp,1) and Duel.IsExistingMatchingCard(c100416004.drfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100416004.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(1-tp,1,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100416004.drfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local turnp=Duel.GetTurnPlayer()
local tg1=Duel.GetFieldGroup(turnp,LOCATION_HAND,0)
local tg2=Duel.GetFieldGroup(1-turnp,LOCATION_HAND,0)
if tg1:GetCount()<1 or tg2:GetCount()<1 then return end
Duel.BreakEffect()
Duel.ShuffleHand(turnp)
Duel.Hint(HINT_SELECTMSG,turnp,HINTMSG_TOGRAVE)
local tc1=tg1:Select(turnp,1,1,nil):GetFirst()
Duel.SendtoGrave(tc1,REASON_EFFECT)
Duel.ShuffleHand(1-turnp)
Duel.Hint(HINT_SELECTMSG,1-turnp,HINTMSG_TOGRAVE)
local tc2=tg2:Select(1-turnp,1,1,nil):GetFirst()
Duel.SendtoGrave(tc2,REASON_EFFECT)
end
end
end
function c100416004.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c100416004.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function c100416004.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--溟界の黄昏-カース
--Scripted by mallu11
function c100416005.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100416005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,100416005)
e1:SetCost(c100416005.spcost)
e1:SetTarget(c100416005.sptg)
e1:SetOperation(c100416005.spop)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416005,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100416005+100)
e2:SetTarget(c100416005.sptg2)
e2:SetOperation(c100416005.spop2)
c:RegisterEffect(e2)
end
function c100416005.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp)
if chk==0 then return g:CheckSubGroup(aux.mzctcheckrel,1,1,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroup(tp,aux.mzctcheckrel,false,1,1,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c100416005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100416005.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,1-tp,false,false)
end
function c100416005.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 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c100416005.spfilter),tp,0,LOCATION_GRAVE,1,nil,e,tp) and Duel.SelectYesNo(1-tp,aux.Stringid(100416005,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(1-tp,aux.NecroValleyFilter(c100416005.spfilter),tp,0,LOCATION_GRAVE,1,1,nil,e,tp):GetFirst()
if Duel.SpecialSummonStep(tc,0,1-tp,1-tp,false,false,POS_FACEUP) then
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)
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:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
end
function c100416005.spfilter2(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x264) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100416005.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100416005.spfilter2(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c100416005.spfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100416005.spfilter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100416005.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
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_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
end
--溟界の昏闇-アレート
--Scripted by mallu11
function c100416006.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100416006,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,100416006)
e1:SetCost(c100416006.spcost)
e1:SetTarget(c100416006.sptg)
e1:SetOperation(c100416006.spop)
c:RegisterEffect(e1)
--return to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416006,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100416006+100)
e2:SetTarget(c100416006.rgtg)
e2:SetOperation(c100416006.rgop)
c:RegisterEffect(e2)
end
function c100416006.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp)
if chk==0 then return g:CheckSubGroup(aux.mzctcheckrel,1,1,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroup(tp,aux.mzctcheckrel,false,1,1,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c100416006.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100416006.thfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand(1-tp)
end
function c100416006.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 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c100416006.thfilter),tp,0,LOCATION_GRAVE,1,nil,tp) and Duel.SelectYesNo(1-tp,aux.Stringid(100416006,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(1-tp,aux.NecroValleyFilter(c100416006.thfilter),tp,0,LOCATION_GRAVE,1,1,nil,tp)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(tp,g)
end
end
function c100416006.rgfilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsCanBeEffectTarget(e)
end
function c100416006.fselect(g)
return g:IsExists(Card.IsRace,1,nil,RACE_REPTILE)
end
function c100416006.rgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c100416006.rgfilter,tp,LOCATION_REMOVED,0,nil,e)
if chk==0 then return g:CheckSubGroup(c100416006.fselect,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,c100416006.fselect,false,2,2)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,sg,2,0,0)
end
function c100416006.rgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN)
end
end
--溟界王-アロン
--Scripted by mallu11
function c100416007.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100416007,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,100416007)
e1:SetCost(c100416007.spcost)
e1:SetTarget(c100416007.sptg)
e1:SetOperation(c100416007.spop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416007,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100416007+100)
e2:SetCondition(c100416007.tgcon)
e2:SetTarget(c100416007.tgtg)
e2:SetOperation(c100416007.tgop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100416007,2))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100416007+200)
e3:SetCondition(c100416007.thcon)
e3:SetTarget(c100416007.thtg)
e3:SetOperation(c100416007.thop)
c:RegisterEffect(e3)
end
function c100416007.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp)
if chk==0 then return g:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c100416007.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100416007.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 c100416007.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW and eg:IsExists(Card.IsControler,1,nil,1-tp)
end
function c100416007.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c100416007.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:RandomSelect(tp,1)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
function c100416007.cfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsPreviousControler(1-tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_EFFECT)
end
function c100416007.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100416007.cfilter,1,nil,tp)
end
function c100416007.thfilter(c)
return not c:IsCode(100416007) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and c:IsRace(RACE_REPTILE) and c:IsAbleToHand()
end
function c100416007.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416007.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c100416007.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100416007.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--溟界妃-アミュネシア
--Scripted by mallu11
function c100416008.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100416008,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,100416008)
e1:SetCost(c100416008.spcost)
e1:SetTarget(c100416008.sptg)
e1:SetOperation(c100416008.spop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416008,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100416008+100)
e2:SetCondition(c100416008.tgcon)
e2:SetTarget(c100416008.tgtg)
e2:SetOperation(c100416008.tgop)
c:RegisterEffect(e2)
--spsummon2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100416008,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100416008+200)
e3:SetCondition(c100416008.spcon2)
e3:SetTarget(c100416008.sptg2)
e3:SetOperation(c100416008.spop2)
c:RegisterEffect(e3)
end
function c100416008.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp)
if chk==0 then return g:CheckSubGroup(aux.mzctcheckrel,2,2,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c100416008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100416008.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 c100416008.cfilter(c,tp)
return c:IsPreviousControler(1-tp) and c:IsPreviousLocation(LOCATION_GRAVE) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function c100416008.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100416008.cfilter,1,e:GetHandler(),tp)
end
function c100416008.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c100416008.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
function c100416008.cfilter2(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsPreviousControler(1-tp) and c:IsPreviousLocation(LOCATION_HAND+LOCATION_DECK)
end
function c100416008.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100416008.cfilter2,1,nil,tp)
end
function c100416008.spfilter(c,e,tp)
return not c:IsCode(100416008) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and c:IsRace(RACE_REPTILE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100416008.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c100416008.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c100416008.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(c100416008.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--溟界神-オグドアビス
--Scripted by mallu11
function c100416009.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100416009,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,100416009)
e1:SetCost(c100416009.spcost)
e1:SetTarget(c100416009.sptg)
e1:SetOperation(c100416009.spop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416009,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,100416009+100)
e2:SetTarget(c100416009.tgtg)
e2:SetOperation(c100416009.tgop)
c:RegisterEffect(e2)
end
function c100416009.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp)
if chk==0 then return g:CheckSubGroup(aux.mzctcheckrel,3,3,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroup(tp,aux.mzctcheckrel,false,3,3,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c100416009.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100416009.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 c100416009.tgfilter(c)
return not (c:IsFaceup() and c:IsSummonLocation(LOCATION_GRAVE) and c:GetOriginalType()&TYPE_MONSTER~=0) and c:IsAbleToGrave()
end
function c100416009.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100416009.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
end
function c100416009.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100416009.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--溟界の蛇睡蓮
--Scripted by Lighty_The_Light
function c100416010.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100416010)
e1:SetTarget(c100416010.target)
e1:SetOperation(c100416010.activate)
c:RegisterEffect(e1)
end
function c100416010.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_REPTILE) and c:IsAbleToGrave()
end
function c100416010.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416010.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c100416010.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_REPTILE)
end
function c100416010.spfilter(c,e,tp)
return c100416010.cfilter(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100416010.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100416010.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()==0 then return end
if Duel.SendtoGrave(g,REASON_EFFECT)==0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local cg=Duel.GetMatchingGroup(c100416010.cfilter,tp,LOCATION_GRAVE,0,nil)
local ct=cg:GetClassCount(Card.GetCode)
if ct<5 then return end
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c100416010.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(100416010,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100416010.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
--溟界の淵源
--scripted by Xylen5967
function c100416011.initial_effect(c)
--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:SetDescription(aux.Stringid(100416011,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,100416011)
e2:SetCondition(c100416011.tgcon1)
e2:SetTarget(c100416011.tgtg1)
e2:SetOperation(c100416011.tgop1)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100416011,1))
e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,100416011+100)
e3:SetCondition(c100416011.tgcon2)
e3:SetTarget(c100416011.tgtg2)
e3:SetOperation(c100416011.tgop2)
c:RegisterEffect(e3)
end
function c100416011.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and bit.band(c:GetPreviousTypeOnField(),TYPE_MONSTER)~=0
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100416011.tgcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100416011.cfilter,1,nil,tp)
end
function c100416011.tgtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsAbleToGrave() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c100416011.tgop1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function c100416011.tgcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and rp==1-tp and c:IsReason(REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_FZONE) and c:GetPreviousControler()==tp
end
function c100416011.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroup(Card.IsRace,tp,LOCATION_GRAVE,0,nil,RACE_REPTILE):GetClassCount(Card.GetCode)
if chk==0 then return ct>0 and Duel.IsPlayerCanDiscardDeck(1-tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,ct)
end
function c100416011.tgop2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroup(Card.IsRace,tp,LOCATION_GRAVE,0,nil,RACE_REPTILE):GetClassCount(Card.GetCode)
Duel.DiscardDeck(1-tp,ct,REASON_EFFECT)
end
--溟界の虚
--scripted by Xylen5967
function c100416012.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(100416012,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetRange(LOCATION_SZONE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100416012)
e2:SetCost(c100416012.spcost)
e2:SetCondition(c100416012.spcon)
e2:SetTarget(c100416012.sptg)
e2:SetOperation(c100416012.spop)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100416012,1))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,100416012+100)
e3:SetCondition(c100416012.tgcon)
e3:SetTarget(c100416012.tgtg)
e3:SetOperation(c100416012.tgop)
c:RegisterEffect(e3)
end
function c100416012.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c100416012.rfilter(c,tp)
return c:IsRace(RACE_REPTILE) and (c:IsControler(tp) or c:IsFaceup()) and Duel.GetMZoneCount(tp,c)>0
end
function c100416012.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100416012.rfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100416012.rfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100416012.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100416012.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and c100416012.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c100416012.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100416012.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100416012.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 c100416012.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function c100416012.cfilter(c)
return not c:IsRace(RACE_REPTILE) and c:IsFaceup() and c:IsAbleToGrave()
end
function c100416012.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c100416012.cfilter,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
end
function c100416012.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100416012.cfilter,tp,LOCATION_MZONE,0,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--溟界の呼び蛟
--scripted by Xylen5967
function c100416013.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c100416013.target)
e1:SetOperation(c100416013.operation)
c:RegisterEffect(e1)
end
function c100416013.spfilter(c,e,tp)
return c:IsRace(RACE_REPTILE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100416013.cfilter(c)
return c:IsSetCard(0x264) and c:IsType(TYPE_MONSTER)
end
function c100416013.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return false end
local cg=Duel.GetMatchingGroup(c100416013.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(c100416013.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
return Duel.IsPlayerCanSpecialSummonMonster(tp,100416113,0,0x4011,0,0,2,RACE_REPTILE,ATTRIBUTE_DARK)
or cg:GetClassCount(Card.GetCode)>=8 and tg:GetClassCount(Card.GetCode)>=2
end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
function c100416013.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local cg=Duel.GetMatchingGroup(c100416013.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c100416013.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
local res1=Duel.IsPlayerCanSpecialSummonMonster(tp,100416113,0,0x4011,0,0,2,RACE_REPTILE,ATTRIBUTE_DARK)
local res2=cg:GetClassCount(Card.GetCode)>=2 and tg:GetClassCount(Card.GetCode)>=2
if res2 and (not res1 or Duel.SelectYesNo(tp,aux.Stringid(100416013,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=tg:SelectSubGroup(tp,aux.dncheck,false,2,2)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
elseif res1 then
for i=1,2 do
local token=Duel.CreateToken(tp,100416113)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
end
end
--ドドレミコード・キューティア
--Scripted by mallu11
function c100416014.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--cannot disable spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetTarget(c100416014.distg)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416014,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100416014)
e2:SetTarget(c100416014.srtg)
e2:SetOperation(c100416014.srop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--atk
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetCondition(c100416014.atkcon)
e4:SetTarget(c100416014.atktg)
e4:SetValue(c100416014.atkval)
c:RegisterEffect(e4)
end
function c100416014.distg(e,c)
return c:IsControler(e:GetHandlerPlayer()) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100416014.srfilter(c)
return not c:IsCode(100416014) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c100416014.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416014.srfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100416014.srop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100416014.srfilter,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 c100416014.atkcon(e)
local tp=e:GetHandlerPlayer()
local tc1=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local tc2=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local lsc,rsc
if tc1 then
lsc=tc1:GetLeftScale()
end
if tc2 then
rsc=tc2:GetRightScale()
end
return tc1 and lsc%2==0 or tc2 and rsc%2==0
end
function c100416014.atktg(e,c)
return c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM)
end
function c100416014.atkval(e,c)
return c:GetLeftScale()*100
end
--レドレミコード・ドリーミア
--Scripted by mallu11
function c100416015.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--cannot disable spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetTarget(c100416015.distg)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416015,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,100416015)
e2:SetCondition(c100416015.spcon)
e2:SetTarget(c100416015.sptg)
e2:SetOperation(c100416015.spop)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c100416015.repcon)
e3:SetTarget(c100416015.reptg)
e3:SetValue(c100416015.repval)
c:RegisterEffect(e3)
end
function c100416015.distg(e,c)
return c:IsControler(e:GetHandlerPlayer()) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100416015.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,0x265)
end
function c100416015.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 c100416015.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 c100416015.repcon(e)
local tp=e:GetHandlerPlayer()
local tc1=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local tc2=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local lsc,rsc
if tc1 then
lsc=tc1:GetLeftScale()
end
if tc2 then
rsc=tc2:GetRightScale()
end
return tc1 and lsc%2~=0 or tc2 and rsc%2~=0
end
function c100416015.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsOnField() and c:IsSetCard(0x265) and c:GetOriginalType()&TYPE_PENDULUM~=0
and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp and not c:IsReason(REASON_REPLACE)
end
function c100416015.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) and eg:IsExists(c100416015.repfilter,1,c,tp) end
if Duel.SelectEffectYesNo(tp,c,96) then
local sg=eg:Filter(c100416015.repfilter,c,tp)
if sg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100416015,1))
sg=sg:Select(tp,1,1,nil)
end
sg:KeepAlive()
e:SetLabelObject(sg)
Duel.Destroy(c,REASON_EFFECT+REASON_REPLACE)
return true
else return false end
end
function c100416015.repval(e,c)
local g=e:GetLabelObject()
return g:IsContains(c)
end
--ミドレミコード・エリーティア
--Scripted by mallu11
function c100416016.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--cannot disable spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetTarget(c100416016.distg)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416016,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100416016)
e2:SetTarget(c100416016.thtg)
e2:SetOperation(c100416016.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--avoid battle damage
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetCondition(c100416016.avcon)
e4:SetTarget(c100416016.avfilter)
e4:SetValue(1)
c:RegisterEffect(e4)
end
function c100416016.distg(e,c)
return c:IsControler(e:GetHandlerPlayer()) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100416016.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100416016.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c100416016.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100416016.thfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c100416016.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100416016.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 c100416016.avcon(e)
local tp=e:GetHandlerPlayer()
local tc1=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local tc2=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local lsc,rsc
if tc1 then
lsc=tc1:GetLeftScale()
end
if tc2 then
rsc=tc2:GetRightScale()
end
return tc1 and lsc%2==0 or tc2 and rsc%2==0
end
function c100416016.avfilter(e,c)
return c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM)
end
--ファドレミコード・ファンシア
--Scripted by mallu11
function c100416017.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--cannot disable spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetTarget(c100416017.distg)
c:RegisterEffect(e1)
--to extra
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416017,0))
e2:SetCategory(CATEGORY_TOEXTRA)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100416017)
e2:SetTarget(c100416017.tetg)
e2:SetOperation(c100416017.teop)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c100416017.repcon)
e3:SetTarget(c100416017.reptg)
e3:SetValue(c100416017.repval)
c:RegisterEffect(e3)
end
function c100416017.distg(e,c)
return c:IsControler(e:GetHandlerPlayer()) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100416017.tefilter(c)
return not c:IsCode(100416017) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM)
end
function c100416017.tetg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416017.tefilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_DECK)
end
function c100416017.teop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100416017,1))
local g=Duel.SelectMatchingCard(tp,c100416017.tefilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoExtraP(g,tp,REASON_EFFECT)
end
end
function c100416017.repcon(e)
local tp=e:GetHandlerPlayer()
local tc1=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local tc2=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local lsc,rsc
if tc1 then
lsc=tc1:GetLeftScale()
end
if tc2 then
rsc=tc2:GetRightScale()
end
return tc1 and lsc%2~=0 or tc2 and rsc%2~=0
end
function c100416017.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM)
and c:IsReason(REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function c100416017.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDestructable(e) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) and eg:IsExists(c100416017.repfilter,1,c,tp) end
if Duel.SelectEffectYesNo(tp,c,96) then
Duel.Destroy(c,REASON_EFFECT+REASON_REPLACE)
return true
else return false end
end
function c100416017.repval(e,c)
return c100416017.repfilter(c,e:GetHandlerPlayer())
end
--ソドレミコード・グレーシア
--Scripted by mallu11
function c100416018.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c100416018.limcon)
e1:SetOperation(c100416018.limop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_PZONE)
e2:SetCode(EVENT_CHAIN_END)
e2:SetOperation(c100416018.limop2)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100416018,0))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,100416018)
e3:SetTarget(c100416018.srtg)
e3:SetOperation(c100416018.srop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
--actlimit attack
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,1)
e5:SetCondition(c100416018.actcon)
e5:SetValue(c100416018.aclimit)
c:RegisterEffect(e5)
end
function c100416018.limfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100416018.limcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100416018.limfilter,1,nil,tp)
end
function c100416018.limop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(c100416018.chainlm)
elseif Duel.GetCurrentChain()==1 then
e:GetHandler():RegisterFlagEffect(100416018,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(c100416018.resetop)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
end
function c100416018.resetop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():ResetFlagEffect(100416018)
e:Reset()
end
function c100416018.limop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(100416018)~=0 then
Duel.SetChainLimitTillChainEnd(c100416018.chainlm)
end
end
function c100416018.chainlm(e,ep,tp)
return ep==tp or e:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not e:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c100416018.srfilter(c)
return c:IsSetCard(0x265) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100416018.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416018.srfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100416018.srop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100416018.srfilter,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 c100416018.cfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM)
end
function c100416018.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function c100416018.actcon(e)
local a=Duel.GetAttacker()
local tp=e:GetHandlerPlayer()
if not (a and c100416018.cfilter(a,tp)) then return false end
local tc1=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local tc2=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local lsc,rsc
if tc1 then
lsc=tc1:GetLeftScale()
end
if tc2 then
rsc=tc2:GetRightScale()
end
return tc1 and lsc%2==0 or tc2 and rsc%2==0
end
--ラドレミコード・エンジェリア
--scripted by Xylen5967
function c100416019.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c100416019.actcon1)
e1:SetOperation(c100416019.actop1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_PZONE)
e2:SetCode(EVENT_CHAIN_END)
e2:SetOperation(c100416019.subop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100416019,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100416019)
e3:SetTarget(c100416019.sptg)
e3:SetOperation(c100416019.spop)
c:RegisterEffect(e3)
--actlimit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,1)
e4:SetCondition(c100416019.actcon2)
e4:SetValue(c100416019.actlimit2)
c:RegisterEffect(e4)
end
function c100416019.actfilter1(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100416019.actcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100416019.actfilter1,1,nil,tp)
end
function c100416019.actop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(c100416019.chlimit)
elseif Duel.GetCurrentChain()==1 then
c:RegisterFlagEffect(100416019,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(c100416019.resetop)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
end
function c100416019.resetop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:ResetFlagEffect(100416019)
c:Reset()
end
function c100416019.subop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(100416021)~=0 then
Duel.SetChainLimitTillChainEnd(c100416019.chlimit)
end
end
function c100416019.chlimit(e,ep,tp)
return ep==tp or e:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not e:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c100416019.cfilter(c,e,tp)
return (c:IsControler(tp) or c:IsFaceup()) and Duel.IsExistingMatchingCard(c100416019.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLeftScale())
end
function c100416019.spfilter(c,e,tp,sc)
return c:IsSetCard(0x265) and c:IsType(TYPE_MONSTER) and not c:IsCode(100416019)
and math.abs(c:GetLeftScale()-sc)==2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100416019.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100416019.cfilter,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100416019.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100416019.cfilter,1,1,nil,e,tp)
if Duel.Release(g,REASON_COST)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c100416019.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,g:GetFirst():GetLeftScale())
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c100416019.pfilter(c)
local lsc=c:GetLeftScale()
local rsc=c:GetRightScale()
return (lsc%2~=0 or rsc%2~=0) and c:IsType(TYPE_PENDULUM)
end
function c100416019.actfilter2(c,tp)
return c:IsFaceup() and c:IsSetCard(0x265) and c:IsControler(tp)
end
function c100416019.actcon2(e)
local a=Duel.GetAttacker()
return a and a:IsControler(e:GetHandlerPlayer()) and a:IsSetCard(0x265)
and Duel.IsExistingMatchingCard(c100416019.pfilter,tp,LOCATION_PZONE,0,1,nil)
end
function c100416019.actlimit2(e,re,tp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
--シドレミコード・ビューティア
--scripted by Xylen5967
function c100416020.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c100416020.actcon)
e1:SetOperation(c100416020.actop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_PZONE)
e2:SetCode(EVENT_CHAIN_END)
e2:SetOperation(c100416020.subop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100416020,0))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,100416020)
e3:SetTarget(c100416020.rmtg)
e3:SetOperation(c100416020.rmop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100416020,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_BATTLE_START)
e4:SetCountLimit(1)
e4:SetTarget(c100416020.destg)
e4:SetOperation(c100416020.desop)
c:RegisterEffect(e4)
end
function c100416020.actfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100416020.actcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100416020.actfilter,1,nil,tp)
end
function c100416020.actop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(c100416020.chlimit)
elseif Duel.GetCurrentChain()==1 then
c:RegisterFlagEffect(100416020,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(c100416020.resetop)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
end
function c100416020.resetop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:ResetFlagEffect(100416020)
c:Reset()
end
function c100416020.subop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(100416020)~=0 then
Duel.SetChainLimitTillChainEnd(c100416020.chlimit)
end
end
function c100416020.chlimit(e,ep,tp)
return ep==tp or e:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not e:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c100416020.rfilter(c,szone)
return c:IsFaceup() and (c:IsType(TYPE_EFFECT) or szone and c:IsType(TYPE_SPELL+TYPE_TRAP))
end
function c100416020.pfilter(c)
local lsc=c:GetLeftScale()
local rsc=c:GetRightScale()
return (lsc%2==0 or rsc%2==0) and c:IsType(TYPE_PENDULUM)
end
function c100416020.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local szone=Duel.IsExistingMatchingCard(c100416020.pfilter,tp,LOCATION_PZONE,0,1,nil)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c100416020.rfilter(chkc,szone) end
if chk==0 then return Duel.IsExistingTarget(c100416020.rfilter,tp,0,LOCATION_ONFIELD,1,nil,szone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100416020.rfilter1,tp,0,LOCATION_ONFIELD,1,1,nil,szone)
end
function c100416020.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100416020,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT+RESET_PHASE+PHASE_END)
e1:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e1,true)
end
end
function c100416020.descon(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local p1=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local p2=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local sp1=255
local sp2=255
if p1 then sp1=p1:GetLeftScale() end
if p2 then sp2=p2:GetRightScale() end
local scale=math.min(sp1,sp2)
local bc=c:GetBattleTarget()
if chk==0 then return scale<255 and bc and bc:IsFaceup() and bc:IsAttackAbove(scale*300) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0)
end
function c100416020.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local bc=c:GetBattleTarget()
Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0)
end
function c100416020.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsRelateToBattle() then
Duel.Destroy(bc,REASON_EFFECT)
end
end
--ドドレミコード・クーリア
--Scripted by mallu11
function c100416021.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c100416021.limcon)
e1:SetOperation(c100416021.limop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_PZONE)
e2:SetCode(EVENT_CHAIN_END)
e2:SetOperation(c100416021.limop2)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_HAND)
e3:SetCondition(c100416021.spcon)
e3:SetOperation(c100416021.spop)
c:RegisterEffect(e3)
--disable
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100416021,0))
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,100416021)
e4:SetTarget(c100416021.distg)
e4:SetOperation(c100416021.disop)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100416021,1))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,100416021+100)
e5:SetCondition(c100416021.descon)
e5:SetTarget(c100416021.destg)
e5:SetOperation(c100416021.desop)
c:RegisterEffect(e5)
end
function c100416021.limfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100416021.limcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100416021.limfilter,1,nil,tp)
end
function c100416021.limop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(c100416021.chainlm)
elseif Duel.GetCurrentChain()==1 then
e:GetHandler():RegisterFlagEffect(100416021,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(c100416021.resetop)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
end
function c100416021.resetop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():ResetFlagEffect(100416021)
e:Reset()
end
function c100416021.limop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(100416021)~=0 then
Duel.SetChainLimitTillChainEnd(c100416021.chainlm)
end
end
function c100416021.chainlm(e,ep,tp)
return ep==tp or e:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not e:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c100416021.rfilter(c,tp)
return c:IsType(TYPE_PENDULUM) and (c:IsControler(tp) or c:IsFaceup())
end
function c100416021.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp):Filter(c100416021.rfilter,nil,tp)
return rg:CheckSubGroup(aux.mzctcheckrel,2,2,tp)
end
function c100416021.spop(e,tp,eg,ep,ev,re,r,rp,c)
local rg=Duel.GetReleaseGroup(tp):Filter(c100416021.rfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,false,2,2,tp)
Duel.Release(sg,REASON_COST)
end
function c100416021.exdiscon(tp)
local tc1=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local tc2=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local lsc,rsc
if tc1 then
lsc=tc1:GetLeftScale()
end
if tc2 then
rsc=tc2:GetRightScale()
end
return tc1 and lsc%2~=0 or tc2 and rsc%2~=0
end
function c100416021.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
local ct=1
if c100416021.exdiscon(tp) then ct=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,0,0)
end
function c100416021.disfilter(c,e)
return c:IsRelateToEffect(e) and c:IsFaceup()
end
function c100416021.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c100416021.disfilter,nil,e)
local tc=g:GetFirst()
while tc do
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+RESET_OPPO_TURN)
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+RESET_OPPO_TURN)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
tc:RegisterEffect(e3)
end
tc=g:GetNext()
end
end
function c100416021.descon(e,tp,eg,ep,ev,re,r,rp)
if not (re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsLocation(LOCATION_MZONE) and re:IsActiveType(TYPE_MONSTER)) then return false end
local tc1=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local tc2=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if not tc1 and not tc2 then return false end
local lsc=0
local rsc=0
if tc1 then
lsc=tc1:GetLeftScale()
end
if tc2 then
rsc=tc2:GetRightScale()
end
if lsc>rsc then lsc,rsc=rsc,lsc end
return re:GetHandler():IsAttackBelow(rsc*300)
end
function c100416021.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
function c100416021.desop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--ドレミコード・スケール
--scripted by Xylen5967 & mercury233
function c100416023.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100416023+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100416023.target)
c:RegisterEffect(e1)
end
function c100416023.cfilter(c)
return c:IsSetCard(0x265) and c:GetOriginalType()&TYPE_PENDULUM>0 and c:IsFaceup()
end
function c100416023.tpfilter(c)
return c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:IsFaceup() and not c:IsForbidden()
end
function c100416023.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x265) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100416023.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100416023.cfilter,tp,LOCATION_ONFIELD,0,nil)
local ct=g:GetClassCount(Card.GetCode)
local b1=ct>=3 and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c100416023.tpfilter,tp,LOCATION_EXTRA,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)>0
local b2=ct>=5 and Duel.IsExistingMatchingCard(c100416023.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b3=ct>=7 and Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)>0
if chk==0 then return b1 or b2 or b3 end
end
function c100416023.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100416023.cfilter,tp,LOCATION_ONFIELD,0,nil)
local ct=g:GetClassCount(Card.GetCode)
local b1=ct>=3 and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c100416023.tpfilter,tp,LOCATION_EXTRA,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)>0
local b2=ct>=5 and Duel.IsExistingMatchingCard(c100416023.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b3=ct>=7 and Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)>0
if b1 and Duel.SelectYesNo(tp,aux.Stringid(100416023,0)) then
c100416023.place(e,tp,eg,ep,ev,re,r,rp)
end
b2=ct>=5 and Duel.IsExistingMatchingCard(c100416023.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if b2 and Duel.SelectYesNo(tp,aux.Stringid(100416023,1)) then
Duel.BreakEffect()
c100416023.specialsummon(e,tp,eg,ep,ev,re,r,rp)
end
if b3 and Duel.SelectYesNo(tp,aux.Stringid(100416023,2)) then
Duel.BreakEffect()
c100416023.destroy(e,tp,eg,ep,ev,re,r,rp)
end
end
function c100416023.place(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,1,nil)
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg=Duel.SelectMatchingCard(tp,c100416023.tpfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=sg:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
function c100416023.specialsummon(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100416023.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
function c100416023.destroy(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--ドレミコード・ハルモニア
--scripted by Xylen5967 & mercury233
function c100416024.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416024,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,100416024)
e2:SetRange(LOCATION_FZONE)
e2:SetTarget(c100416024.thtg)
e2:SetOperation(c100416024.thop)
c:RegisterEffect(e2)
--increase scale
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100416024,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1,100416024+100)
e3:SetRange(LOCATION_FZONE)
e3:SetTarget(c100416024.sctg)
e3:SetOperation(c100416024.scop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100416024,2))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,100416024+200)
e4:SetCondition(c100416024.descon)
e4:SetOperation(c100416024.desop)
c:RegisterEffect(e4)
end
function c100416024.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x265) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c100416024.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416024.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end
function c100416024.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100416024.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c100416024.scfilter(c)
return c:IsFaceup() and c:IsSetCard(0x265) and c:GetOriginalType()&TYPE_PENDULUM>0
end
function c100416024.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416024.scfilter,tp,LOCATION_ONFIELD,0,1,nil) end
end
function c100416024.scop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c100416024.scfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
local sc=g:GetFirst()
if sc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LSCALE)
e1:SetValue(sc:GetLevel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RSCALE)
sc:RegisterEffect(e2)
end
end
function c100416024.getscale(c)
if c:GetSequence()>0 and c:IsLocation(LOCATION_PZONE) then return c:GetRightScale() else return c:GetLeftScale() end
end
function c100416024.desfilter(c,odevity)
local sc=c100416024.getscale(c)
return sc%2==odevity and c:GetOriginalType()&TYPE_PENDULUM>0 and c:IsFaceup()
end
function c100416024.descon(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c100416024.desfilter,tp,LOCATION_ONFIELD,0,nil,1)
local g2=Duel.GetMatchingGroup(c100416024.desfilter,tp,LOCATION_ONFIELD,0,nil,0)
return g1:GetClassCount(c100416024.getscale)>=3 or g2:GetClassCount(c100416024.getscale)>=3
end
function c100416024.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
--ドレミコード・ムジカ
--Scripted by mallu11
function c100416025.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,100416025+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100416025.target)
e1:SetOperation(c100416025.activate)
c:RegisterEffect(e1)
end
function c100416025.scfilter(c)
return c:IsFaceup() and c:IsSetCard(0x265) and c:GetOriginalType()&TYPE_PENDULUM~=0
end
function c100416025.chkfilter(c,tp,odevity)
if c:IsLocation(LOCATION_PZONE) and c==Duel.GetFieldCard(tp,LOCATION_PZONE,1) then
return c:GetRightScale()%2==odevity
else
return c:GetLeftScale()%2==odevity
end
end
function c100416025.spfilter(c,e,tp,odevity)
return c:IsFaceup() and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:GetLeftScale()%2==odevity and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c100416025.chkcon(g,e,tp,odevity)
return g:IsExists(c100416025.chkfilter,1,nil,tp,odevity) and Duel.IsExistingMatchingCard(c100416025.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,odevity)
end
function c100416025.chkcon2(g,tp)
return g:IsExists(c100416025.chkfilter,1,nil,tp,1) and g:IsExists(c100416025.chkfilter,1,nil,tp,0)
end
function c100416025.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
local g=Duel.GetMatchingGroup(c100416025.scfilter,tp,LOCATION_ONFIELD,0,nil)
local b1=c100416025.chkcon(g,e,tp,1)
local b2=c100416025.chkcon(g,e,tp,0)
local b3=c100416025.chkcon2(g,tp) and Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil)
if chk==0 then return b1 or b2 or b3 end
local off=0
local ops={}
local opval={}
off=1
if b1 then
ops[off]=aux.Stringid(100416025,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(100416025,1)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(100416025,2)
opval[off-1]=3
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
e:SetLabel(opval[op])
if opval[op]==1 or opval[op]==2 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetProperty(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
else
e:SetCategory(CATEGORY_DESTROY)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
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
end
function c100416025.activate(e,tp,eg,ep,ev,re,r,rp)
local opt=e:GetLabel()
if opt==1 or opt==2 then
local sc=opt==1 and 1 or 0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100416025.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,sc)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
else
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
--ドレミコード・フォーマル
--Scripted by mallu11
function c100416026.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,100416026+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100416026.condition)
e1:SetTarget(c100416026.target)
e1:SetOperation(c100416026.activate)
c:RegisterEffect(e1)
end
function c100416026.confilter(c)
return c:IsFaceup() and c:IsSetCard(0x265)
end
function c100416026.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100416026.confilter,tp,LOCATION_PZONE,0,1,nil) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and rp==1-tp
end
function c100416026.tdfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToDeck()
end
function c100416026.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416026.tdfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_EXTRA)
end
function c100416026.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM)
end
function c100416026.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c100416026.tdfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and Duel.IsExistingMatchingCard(c100416026.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_PENDULUM))
e1:SetValue(c100416026.efilter)
e1:SetLabelObject(re)
e1:SetReset(RESET_EVENT+RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetTargetRange(LOCATION_PZONE,0)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_REMOVE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetTarget(c100416026.rmlimit)
Duel.RegisterEffect(e3,tp)
end
end
function c100416026.efilter(e,re)
return re==e:GetLabelObject()
end
function c100416026.rmlimit(e,c,tp,r,re)
return c:IsControler(e:GetHandlerPlayer()) and c:IsLocation(LOCATION_PZONE) and r&REASON_EFFECT~=0 and re and re==e:GetLabelObject()
end
......@@ -3,19 +3,9 @@
--Scripted by Kohana Sonogami
function c100416027.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
local e1=aux.AddUrsarcticSpSummonEffect(c)
e1:SetDescription(aux.Stringid(100416027,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
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,100416027)
e1:SetCondition(c100416027.spcon)
e1:SetCost(c100416027.spcost)
e1:SetTarget(c100416027.sptg)
e1:SetOperation(c100416027.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416027,1))
......@@ -28,24 +18,40 @@ function c100416027.initial_effect(c)
e2:SetOperation(c100416027.thop)
c:RegisterEffect(e2)
end
function c100416027.spcon(e,tp,eg,ep,ev,re,r,rp)
if Auxiliary.AddUrsarcticSpSummonEffect==nil then
--Ursarctic common summon from hand effect
function Auxiliary.AddUrsarcticSpSummonEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
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:SetCondition(Auxiliary.UrsarcticSpSummonCondition)
e1:SetCost(Auxiliary.UrsarcticSpSummonCost)
e1:SetTarget(Auxiliary.UrsarcticSpSummonTarget)
e1:SetOperation(Auxiliary.UrsarcticSpSummonOperation)
c:RegisterEffect(e1)
return e1
end
function Auxiliary.UrsarcticSpSummonCondition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100416027.rfilter(c,tp)
function Auxiliary.UrsarcticReleaseFilter(c,tp)
return c:IsLevelAbove(7) and (c:IsControler(tp) and c:IsLocation(LOCATION_HAND) or c:IsFaceup() and c:IsControler(1-tp))
end
function c100416027.excostfilter(c,tp)
return c:IsAbleToRemove() and c:IsHasEffect(100416038,tp)
function Auxiliary.UrsarcticExCostFilter(c,tp)
return c:IsAbleToRemoveAsCost() and (c:IsHasEffect(100416036,tp) or c:IsHasEffect(100416038,tp))
end
function c100416027.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(c100416027.rfilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(c100416027.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Auxiliary.UrsarcticReleaseFilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(Auxiliary.UrsarcticExCostFilter,tp,LOCATION_GRAVE,0,nil,tp)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416038,tp)
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
......@@ -54,28 +60,29 @@ function c100416027.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(tc,REASON_COST)
end
end
function c100416027.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function Auxiliary.UrsarcticSpSummonTarget(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 c100416027.spop(e,tp,eg,ep,ev,re,r,rp)
function Auxiliary.UrsarcticSpSummonOperation(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:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c100416027.splimit)
e1:SetTarget(Auxiliary.UrsarcticSpSummonLimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100416027.splimit(e,c)
function Auxiliary.UrsarcticSpSummonLimit(e,c)
return c:IsLevel(0)
end
end
function c100416027.thfilter(c)
return c:IsSetCard(0x261) and c:IsType(TYPE_MONSTER) and not c:IsCode(100416027) and c:IsAbleToHand()
end
......
......@@ -3,19 +3,9 @@
--Scripted by mallu11
function c100416028.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
local e1=aux.AddUrsarcticSpSummonEffect(c)
e1:SetDescription(aux.Stringid(100416028,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100416028)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCondition(c100416028.spcon)
e1:SetCost(c100416028.spcost)
e1:SetTarget(c100416028.sptg)
e1:SetOperation(c100416028.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416028,1))
......@@ -28,24 +18,40 @@ function c100416028.initial_effect(c)
e2:SetOperation(c100416028.thop)
c:RegisterEffect(e2)
end
function c100416028.spcon(e,tp,eg,ep,ev,re,r,rp)
if Auxiliary.AddUrsarcticSpSummonEffect==nil then
--Ursarctic common summon from hand effect
function Auxiliary.AddUrsarcticSpSummonEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
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:SetCondition(Auxiliary.UrsarcticSpSummonCondition)
e1:SetCost(Auxiliary.UrsarcticSpSummonCost)
e1:SetTarget(Auxiliary.UrsarcticSpSummonTarget)
e1:SetOperation(Auxiliary.UrsarcticSpSummonOperation)
c:RegisterEffect(e1)
return e1
end
function Auxiliary.UrsarcticSpSummonCondition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100416028.rfilter(c,tp)
function Auxiliary.UrsarcticReleaseFilter(c,tp)
return c:IsLevelAbove(7) and (c:IsControler(tp) and c:IsLocation(LOCATION_HAND) or c:IsFaceup() and c:IsControler(1-tp))
end
function c100416028.excostfilter(c,tp)
return c:IsAbleToRemove() and c:IsHasEffect(100416038,tp)
function Auxiliary.UrsarcticExCostFilter(c,tp)
return c:IsAbleToRemoveAsCost() and (c:IsHasEffect(100416036,tp) or c:IsHasEffect(100416038,tp))
end
function c100416028.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(c100416028.rfilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(c100416028.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Auxiliary.UrsarcticReleaseFilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(Auxiliary.UrsarcticExCostFilter,tp,LOCATION_GRAVE,0,nil,tp)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416038,tp)
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
......@@ -54,12 +60,12 @@ function c100416028.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(tc,REASON_COST)
end
end
function c100416028.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function Auxiliary.UrsarcticSpSummonTarget(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 c100416028.spop(e,tp,eg,ep,ev,re,r,rp)
function Auxiliary.UrsarcticSpSummonOperation(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)
......@@ -69,13 +75,14 @@ function c100416028.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c100416028.splimit)
e1:SetTarget(Auxiliary.UrsarcticSpSummonLimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100416028.splimit(e,c)
function Auxiliary.UrsarcticSpSummonLimit(e,c)
return c:IsLevel(0)
end
end
function c100416028.thfilter(c)
return c:IsSetCard(0x261) and c:IsType(TYPE_MONSTER) and not c:IsCode(100416028) and c:IsAbleToHand()
end
......
......@@ -3,19 +3,9 @@
--Scripted by mallu11
function c100416029.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
local e1=aux.AddUrsarcticSpSummonEffect(c)
e1:SetDescription(aux.Stringid(100416029,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100416029)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCondition(c100416029.spcon)
e1:SetCost(c100416029.spcost)
e1:SetTarget(c100416029.sptg)
e1:SetOperation(c100416029.spop)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416029,1))
......@@ -28,24 +18,40 @@ function c100416029.initial_effect(c)
e2:SetOperation(c100416029.spop2)
c:RegisterEffect(e2)
end
function c100416029.spcon(e,tp,eg,ep,ev,re,r,rp)
if Auxiliary.AddUrsarcticSpSummonEffect==nil then
--Ursarctic common summon from hand effect
function Auxiliary.AddUrsarcticSpSummonEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
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:SetCondition(Auxiliary.UrsarcticSpSummonCondition)
e1:SetCost(Auxiliary.UrsarcticSpSummonCost)
e1:SetTarget(Auxiliary.UrsarcticSpSummonTarget)
e1:SetOperation(Auxiliary.UrsarcticSpSummonOperation)
c:RegisterEffect(e1)
return e1
end
function Auxiliary.UrsarcticSpSummonCondition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100416029.rfilter(c,tp)
function Auxiliary.UrsarcticReleaseFilter(c,tp)
return c:IsLevelAbove(7) and (c:IsControler(tp) and c:IsLocation(LOCATION_HAND) or c:IsFaceup() and c:IsControler(1-tp))
end
function c100416029.excostfilter(c,tp)
return c:IsAbleToRemove() and c:IsHasEffect(100416038,tp)
function Auxiliary.UrsarcticExCostFilter(c,tp)
return c:IsAbleToRemoveAsCost() and (c:IsHasEffect(100416036,tp) or c:IsHasEffect(100416038,tp))
end
function c100416029.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(c100416029.rfilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(c100416029.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Auxiliary.UrsarcticReleaseFilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(Auxiliary.UrsarcticExCostFilter,tp,LOCATION_GRAVE,0,nil,tp)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416038,tp)
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
......@@ -54,12 +60,12 @@ function c100416029.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(tc,REASON_COST)
end
end
function c100416029.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function Auxiliary.UrsarcticSpSummonTarget(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 c100416029.spop(e,tp,eg,ep,ev,re,r,rp)
function Auxiliary.UrsarcticSpSummonOperation(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)
......@@ -69,13 +75,14 @@ function c100416029.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c100416029.splimit)
e1:SetTarget(Auxiliary.UrsarcticSpSummonLimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100416029.splimit(e,c)
function Auxiliary.UrsarcticSpSummonLimit(e,c)
return c:IsLevel(0)
end
end
function c100416029.spfilter2(c,e,tp)
return c:IsSetCard(0x261) and not c:IsCode(100416029) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......
......@@ -3,19 +3,9 @@
--Scripted by mallu11
function c100416030.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
local e1=aux.AddUrsarcticSpSummonEffect(c)
e1:SetDescription(aux.Stringid(100416030,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100416030)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCondition(c100416030.spcon)
e1:SetCost(c100416030.spcost)
e1:SetTarget(c100416030.sptg)
e1:SetOperation(c100416030.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416030,1))
......@@ -29,24 +19,40 @@ function c100416030.initial_effect(c)
e2:SetOperation(c100416030.desop)
c:RegisterEffect(e2)
end
function c100416030.spcon(e,tp,eg,ep,ev,re,r,rp)
if Auxiliary.AddUrsarcticSpSummonEffect==nil then
--Ursarctic common summon from hand effect
function Auxiliary.AddUrsarcticSpSummonEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
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:SetCondition(Auxiliary.UrsarcticSpSummonCondition)
e1:SetCost(Auxiliary.UrsarcticSpSummonCost)
e1:SetTarget(Auxiliary.UrsarcticSpSummonTarget)
e1:SetOperation(Auxiliary.UrsarcticSpSummonOperation)
c:RegisterEffect(e1)
return e1
end
function Auxiliary.UrsarcticSpSummonCondition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100416030.rfilter(c,tp)
function Auxiliary.UrsarcticReleaseFilter(c,tp)
return c:IsLevelAbove(7) and (c:IsControler(tp) and c:IsLocation(LOCATION_HAND) or c:IsFaceup() and c:IsControler(1-tp))
end
function c100416030.excostfilter(c,tp)
return c:IsAbleToRemove() and c:IsHasEffect(100416038,tp)
function Auxiliary.UrsarcticExCostFilter(c,tp)
return c:IsAbleToRemoveAsCost() and (c:IsHasEffect(100416036,tp) or c:IsHasEffect(100416038,tp))
end
function c100416030.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(c100416030.rfilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(c100416030.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Auxiliary.UrsarcticReleaseFilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(Auxiliary.UrsarcticExCostFilter,tp,LOCATION_GRAVE,0,nil,tp)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416038,tp)
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
......@@ -55,12 +61,12 @@ function c100416030.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(tc,REASON_COST)
end
end
function c100416030.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function Auxiliary.UrsarcticSpSummonTarget(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 c100416030.spop(e,tp,eg,ep,ev,re,r,rp)
function Auxiliary.UrsarcticSpSummonOperation(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)
......@@ -70,13 +76,14 @@ function c100416030.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c100416030.splimit)
e1:SetTarget(Auxiliary.UrsarcticSpSummonLimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100416030.splimit(e,c)
function Auxiliary.UrsarcticSpSummonLimit(e,c)
return c:IsLevel(0)
end
end
function c100416030.confilter(c)
return c:IsFaceup() and c:IsSetCard(0x261)
end
......
......@@ -3,19 +3,9 @@
--Scripted by mallu11
function c100416031.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
local e1=aux.AddUrsarcticSpSummonEffect(c)
e1:SetDescription(aux.Stringid(100416031,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100416031)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCondition(c100416031.spcon)
e1:SetCost(c100416031.spcost)
e1:SetTarget(c100416031.sptg)
e1:SetOperation(c100416031.spop)
c:RegisterEffect(e1)
--position
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416031,1))
......@@ -29,24 +19,40 @@ function c100416031.initial_effect(c)
e2:SetOperation(c100416031.posop)
c:RegisterEffect(e2)
end
function c100416031.spcon(e,tp,eg,ep,ev,re,r,rp)
if Auxiliary.AddUrsarcticSpSummonEffect==nil then
--Ursarctic common summon from hand effect
function Auxiliary.AddUrsarcticSpSummonEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
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:SetCondition(Auxiliary.UrsarcticSpSummonCondition)
e1:SetCost(Auxiliary.UrsarcticSpSummonCost)
e1:SetTarget(Auxiliary.UrsarcticSpSummonTarget)
e1:SetOperation(Auxiliary.UrsarcticSpSummonOperation)
c:RegisterEffect(e1)
return e1
end
function Auxiliary.UrsarcticSpSummonCondition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100416031.rfilter(c,tp)
function Auxiliary.UrsarcticReleaseFilter(c,tp)
return c:IsLevelAbove(7) and (c:IsControler(tp) and c:IsLocation(LOCATION_HAND) or c:IsFaceup() and c:IsControler(1-tp))
end
function c100416031.excostfilter(c,tp)
return c:IsAbleToRemove() and c:IsHasEffect(100416038,tp)
function Auxiliary.UrsarcticExCostFilter(c,tp)
return c:IsAbleToRemoveAsCost() and (c:IsHasEffect(100416036,tp) or c:IsHasEffect(100416038,tp))
end
function c100416031.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(c100416031.rfilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(c100416031.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Auxiliary.UrsarcticReleaseFilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(Auxiliary.UrsarcticExCostFilter,tp,LOCATION_GRAVE,0,nil,tp)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416038,tp)
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
......@@ -55,12 +61,12 @@ function c100416031.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(tc,REASON_COST)
end
end
function c100416031.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function Auxiliary.UrsarcticSpSummonTarget(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 c100416031.spop(e,tp,eg,ep,ev,re,r,rp)
function Auxiliary.UrsarcticSpSummonOperation(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)
......@@ -70,13 +76,14 @@ function c100416031.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c100416031.splimit)
e1:SetTarget(Auxiliary.UrsarcticSpSummonLimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100416031.splimit(e,c)
function Auxiliary.UrsarcticSpSummonLimit(e,c)
return c:IsLevel(0)
end
end
function c100416031.confilter(c)
return c:IsFaceup() and c:IsSetCard(0x261)
end
......
......@@ -3,19 +3,9 @@
--Scripted by mallu11
function c100416032.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
local e1=aux.AddUrsarcticSpSummonEffect(c)
e1:SetDescription(aux.Stringid(100416032,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100416032)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCondition(c100416032.spcon)
e1:SetCost(c100416032.spcost)
e1:SetTarget(c100416032.sptg)
e1:SetOperation(c100416032.spop)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416032,1))
......@@ -29,24 +19,40 @@ function c100416032.initial_effect(c)
e2:SetOperation(c100416032.rmop)
c:RegisterEffect(e2)
end
function c100416032.spcon(e,tp,eg,ep,ev,re,r,rp)
if Auxiliary.AddUrsarcticSpSummonEffect==nil then
--Ursarctic common summon from hand effect
function Auxiliary.AddUrsarcticSpSummonEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
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:SetCondition(Auxiliary.UrsarcticSpSummonCondition)
e1:SetCost(Auxiliary.UrsarcticSpSummonCost)
e1:SetTarget(Auxiliary.UrsarcticSpSummonTarget)
e1:SetOperation(Auxiliary.UrsarcticSpSummonOperation)
c:RegisterEffect(e1)
return e1
end
function Auxiliary.UrsarcticSpSummonCondition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100416032.rfilter(c,tp)
function Auxiliary.UrsarcticReleaseFilter(c,tp)
return c:IsLevelAbove(7) and (c:IsControler(tp) and c:IsLocation(LOCATION_HAND) or c:IsFaceup() and c:IsControler(1-tp))
end
function c100416032.excostfilter(c,tp)
return c:IsAbleToRemove() and c:IsHasEffect(100416038,tp)
function Auxiliary.UrsarcticExCostFilter(c,tp)
return c:IsAbleToRemoveAsCost() and (c:IsHasEffect(100416036,tp) or c:IsHasEffect(100416038,tp))
end
function c100416032.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(c100416032.rfilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(c100416032.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Auxiliary.UrsarcticReleaseFilter,e:GetHandler(),tp)
local g2=Duel.GetMatchingGroup(Auxiliary.UrsarcticExCostFilter,tp,LOCATION_GRAVE,0,nil,tp)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416038,tp)
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
......@@ -55,12 +61,12 @@ function c100416032.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(tc,REASON_COST)
end
end
function c100416032.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function Auxiliary.UrsarcticSpSummonTarget(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 c100416032.spop(e,tp,eg,ep,ev,re,r,rp)
function Auxiliary.UrsarcticSpSummonOperation(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)
......@@ -70,13 +76,14 @@ function c100416032.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c100416032.splimit)
e1:SetTarget(Auxiliary.UrsarcticSpSummonLimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100416032.splimit(e,c)
function Auxiliary.UrsarcticSpSummonLimit(e,c)
return c:IsLevel(0)
end
end
function c100416032.confilter(c)
return c:IsFaceup() and c:IsSetCard(0x261)
end
......
--ベアルクティ・ディパーチャー
--Ursarctic Departure
--scripted by Warspite
function c100416036.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,100416036)
e1:SetCost(c100416036.cost)
e1:SetTarget(c100416036.target)
e1:SetOperation(c100416036.activate)
c:RegisterEffect(e1)
--substitute cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(100416036)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCountLimit(1,100416036+100)
c:RegisterEffect(e2)
end
function c100416036.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,c) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c100416036.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x261) and c:IsAbleToHand()
end
function c100416036.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416036.filter,tp,LOCATION_DECK,0,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function c100416036.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100416036.filter,tp,LOCATION_DECK,0,2,2,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
......@@ -116,15 +116,16 @@ function c100416039.tdcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100416039.cfilter,1,nil,tp) and Duel.GetAttacker():IsControler(1-tp)
end
function c100416039.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if chk==0 then return g:GetCount()>=7 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,7,0,0)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if chk==0 then return #g>7 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,#g-7,1-tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c100416039.tdop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,nil)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsAbleToDeck),tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if ct<=7 or #g==0 then return end
local tct=math.min(ct-7,#g)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local sg=g:Select(1-tp,7,7,nil)
if sg and sg:GetCount()==7 then
Duel.SendtoDeck(sg,nil,2,REASON_RULE)
end
local sg=g:Select(1-tp,tct,tct,nil)
Duel.SendtoDeck(sg,nil,2,REASON_RULE)
end
--思い集いし竜
--Scripted by mallu11
function c101105201.initial_effect(c)
c:SetSPSummonOnce(101105201)
--synchro limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetValue(c101105201.synlimit)
c:RegisterEffect(e0)
--change name
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetValue(21159309)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105201,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DRAW)
e2:SetCost(c101105201.spcost)
e2:SetTarget(c101105201.sptg)
e2:SetOperation(c101105201.spop)
c:RegisterEffect(e2)
end
function c101105201.synlimit(e,c)
if not c then return false end
return not c:IsSetCard(0x3f)
end
function c101105201.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101105201.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 c101105201.cfilter(c)
return c:IsFaceup() and c:IsLevelAbove(8) and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO)
end
function c101105201.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsLevel(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101105201.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 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101105201.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c101105201.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(101105201,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101105201.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--スターダスト・シンクロン
--Scripted by mallu11
function c101105202.initial_effect(c)
aux.AddCodeList(c,44508094)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105202,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,101105202)
e1:SetCost(c101105202.spcost)
e1:SetTarget(c101105202.sptg)
e1:SetOperation(c101105202.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105202,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101105202+100)
e2:SetTarget(c101105202.thtg)
e2:SetOperation(c101105202.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c101105202.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp)
if chk==0 then return g:CheckSubGroup(aux.mzctcheckrel,1,1,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g:SelectSubGroup(tp,aux.mzctcheckrel,false,1,1,tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(rg,REASON_COST)
end
function c101105202.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101105202.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
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)
end
Duel.SpecialSummonComplete()
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTarget(c101105202.splimit)
Duel.RegisterEffect(e2,tp)
end
function c101105202.splimit(e,c)
return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA)
end
function c101105202.thfilter(c)
return aux.IsCodeListed(c,44508094) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c101105202.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105202.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101105202.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101105202.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
--スターダスト・トレイル
--Scripted by mallu11
function c101105203.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105203,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,101105203)
e1:SetCondition(c101105203.spcon)
e1:SetTarget(c101105203.sptg)
e1:SetOperation(c101105203.spop)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105203,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101105203+100)
e2:SetCondition(c101105203.tkcon)
e2:SetTarget(c101105203.tktg)
e2:SetOperation(c101105203.tkop)
c:RegisterEffect(e2)
end
function c101105203.spcfilter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c101105203.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (not eg:IsContains(c) or c:IsLocation(LOCATION_HAND)) and eg:IsExists(c101105203.spcfilter,1,nil,tp)
end
function c101105203.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 c101105203.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
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)
end
Duel.SpecialSummonComplete()
end
end
function c101105203.tkcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO and e:GetHandler():GetReasonCard():IsSetCard(0x66,0x1017,0xa3)
end
function c101105203.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,101105303,0xa3,0x4011,0,0,1,RACE_DRAGON,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c101105203.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,101105303,0xa3,0x4011,0,0,1,RACE_DRAGON,ATTRIBUTE_LIGHT) then return end
local token=Duel.CreateToken(tp,101105303)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
--シューティング・セイヴァー・スター・ドラゴン
--Scripted by mallu11
function c101105204.initial_effect(c)
aux.AddCodeList(c,44508094)
--synchro summon
aux.AddSynchroMixProcedure(c,c101105204.mfilter,nil,nil,aux.NonTuner(nil),1,99,c101105204.gfilter)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetRange(LOCATION_EXTRA)
e1:SetValue(aux.synlimit)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105204,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c101105204.distg)
e2:SetOperation(c101105204.disop)
c:RegisterEffect(e2)
--extra attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c101105204.atkval)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101105204,1))
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c101105204.negcon)
e4:SetTarget(c101105204.negtg)
e4:SetOperation(c101105204.negop)
c:RegisterEffect(e4)
end
c101105204.material_type=TYPE_SYNCHRO
function c101105204.mfilter(c)
return c:IsCode(21159309) and c:IsSynchroType(TYPE_TUNER)
end
function c101105204.cfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsSynchroType(TYPE_SYNCHRO)
end
function c101105204.gfilter(g,syncard,c1)
return g:IsExists(c101105204.cfilter,1,c1)
end
function c101105204.disfilter(c)
return aux.disfilter1(c) and c:IsType(TYPE_EFFECT)
end
function c101105204.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105204.disfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,tp,LOCATION_MZONE)
end
function c101105204.disop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,c101105204.disfilter,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
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)
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)
tc:RegisterEffect(e2)
end
end
function c101105204.atkfilter(c)
return c:IsCode(44508094) or aux.IsCodeListed(c,44508094) and c:IsType(TYPE_SYNCHRO)
end
function c101105204.atkval(e,c)
return Duel.GetMatchingGroupCount(c101105204.atkfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
end
function c101105204.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and rp==1-tp
end
function c101105204.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() and aux.nbcon(tp,re) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
local g=eg:Clone()+c
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
end
function c101105204.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and c:IsLocation(LOCATION_REMOVED) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(c)
e1:SetCountLimit(1)
e1:SetOperation(c101105204.retop)
Duel.RegisterEffect(e1,tp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
end
function c101105204.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
--光来する奇跡
--scripted by Xylen5967
function c101105205.initial_effect(c)
aux.AddCodeList(c,44508094)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c101105205.activate)
c:RegisterEffect(e1)
--cannot to deck
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_TO_DECK)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(c101105205.tdlimit)
c:RegisterEffect(e2)
--apply
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c101105205.opcon)
e3:SetTarget(c101105205.optg)
e3:SetOperation(c101105205.opop)
c:RegisterEffect(e3)
end
function c101105205.tdfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsLevel(1) and c:IsAbleToDeck()
end
function c101105205.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.GetMatchingGroup(c101105205.tdfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
else
Duel.SendtoDeck(g,nil,0,REASON_EFFECT)
end
end
end
function c101105205.tdlimit(e,c)
return (c:IsCode(44508094) or c:IsType(TYPE_SYNCHRO) and aux.AddCodeList(c,44508094))
end
function c101105205.cfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsControler(tp)
end
function c101105205.opcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105205.cfilter,1,nil,tp)
end
function c101105205.optg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=Duel.IsPlayerCanDraw(tp,1) and Duel.GetFlagEffect(tp,101105205)==0
local b2=Duel.IsExistingMatchingCard(c101105205.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetFlagEffect(tp,101105205+100)==0
if chk==0 then
return c:RegisterFlagEffect(101105205,RESET_CHAIN,0,1) and (b1 or b2)
end
c:RegisterFlagEffect(101105205,RESET_CHAIN,0,1)
end
function c101105205.spfilter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101105205.opop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.IsPlayerCanDraw(tp,1) and Duel.GetFlagEffect(tp,101105205)==0
local b2=Duel.IsExistingMatchingCard(c101105205.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetFlagEffect(tp,101105205+100)==0
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(101105205,1),aux.Stringid(101105205,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(101105205,1)) --Draw 1 Card
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(101105205,2))+1 --Special Summoned 1 Tuner from your hand
else return end
if op==0 then
Duel.Draw(tp,1,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,101105205,RESET_PHASE+PHASE_END,0,1)
else
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101105205.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g==0 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.RegisterFlagEffect(tp,101105205+100,RESET_PHASE+PHASE_END,0,1)
end
end
--スターダスト・イルミネイト
--scripted by Xylen5967
function c101105206.initial_effect(c)
aux.AddCodeList(c,44508094)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101105206)
e1:SetTarget(c101105206.target)
e1:SetOperation(c101105206.activate)
c:RegisterEffect(e1)
--increase / decrease
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105206,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101105206+100)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101105206.lvltg)
e2:SetOperation(c101105206.lvlop)
c:RegisterEffect(e2)
end
function c101105206.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xa3) and c:IsAbleToGrave()
end
function c101105206.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105206.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,0,0,0)
end
function c101105206.cfilter(c)
return c:IsFaceup() and (c:IsCode(44508094) or c:IsType(TYPE_SYNCHRO) and aux.AddCodeList(c,44508094))
end
function c101105206.activate(e,tp,eg,ep,ev,re,r,rp)
local chk=Duel.IsExistingMatchingCard(c101105206.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c101105206.tgfilter,tp,LOCATION_DECK,0,1,1,nil,chk)
local tc=g:GetFirst()
if tc then
if chk and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1191,1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
end
function c101105206.lvlfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xa3)
end
function c101105206.lvltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101105206.lvlfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101105206.lvlfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectTarget(tp,c101105206.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101105206.lvlop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local opt=0
if tc:IsLevel(1) then
opt=Duel.SelectOption(tp,aux.Stringid(101105206,1))
else
opt=Duel.SelectOption(tp,aux.Stringid(101105206,1),aux.Stringid(101105206,2)) --increase / decrease
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
if opt==0 then
e1:SetValue(1)
else
e1:SetValue(-1)
end
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--セイヴァー・アブソープション
--scripted by Xylen5967
function c101105207.initial_effect(c)
aux.AddCodeList(c,44508094)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101105207+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101105207.target)
e1:SetOperation(c101105207.activate)
c:RegisterEffect(e1)
end
function c101105207.filter(c)
return c:IsFaceup() and (c:IsCode(44508094) or c:IsType(TYPE_SYNCHRO) and aux.IsCodeListed(c,44508094))
end
function c101105207.eqfilter(c)
return c:IsFaceup() and c:IsAbleToChangeControler()
end
function c101105207.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101105207.filter(chkc) end
local b1=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c101105207.eqfilter,tp,0,LOCATION_MZONE,1,nil)
local b2=aux.bpcon()
if chk==0 then return (b1 or b2)
and Duel.IsExistingTarget(c101105207.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c101105207.filter,tp,LOCATION_MZONE,0,1,1,nil)
local op
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(101105207,0),aux.Stringid(101105207,1),aux.Stringid(101105207,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(101105207,0))
else
op=Duel.SelectOption(tp,aux.Stringid(101105207,1),aux.Stringid(101105207,2))+1
end
e:SetLabel(op)
if op==0 then
e:SetCategory(CATEGORY_EQUIP)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
else
e:SetCategory(0)
end
end
function c101105207.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local op=e:GetLabel()
if op==0 then
c101105207.equip(e,tp,eg,ep,ev,re,r,rp)
elseif op==1 then
c101105207.directattack(e,tp,eg,ep,ev,re,r,rp)
else
c101105207.damage(e,tp,eg,ep,ev,re,r,rp)
end
end
function c101105207.equip(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_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c101105207.eqfilter,tp,0,LOCATION_MZONE,1,1,nil)
local ec=g:GetFirst()
if ec then
if not Duel.Equip(tp,ec,tc) then return end
--equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetLabelObject(tc)
e1:SetValue(c101105207.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e1)
end
end
end
function c101105207.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c101105207.directattack(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c101105207.damage(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) then return end
tc:RegisterFlagEffect(101105207,RESET_EVENT+RESETS_STANDARD,0,1,tc:GetFieldID())
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetLabelObject(tc)
e1:SetCondition(c101105207.damcon)
e1:SetOperation(c101105207.damop)
Duel.RegisterEffect(e1,tp)
end
function c101105207.damcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local fid=tc:GetFlagEffectLabel(101105207)
local bc=tc:GetBattleTarget()
return fid and fid==tc:GetFieldID() and tc==eg:GetFirst() and tc:IsRelateToBattle() and bc and bc:GetPreviousControler()==1-tp
end
function c101105207.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local bc=tc:GetBattleTarget()
if not bc then return end
local dam=math.max(bc:GetBaseAttack(),0)
if dam>0 then
Duel.Hint(HINT_CARD,0,101105207)
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end
--セイヴァー・ミラージュ
--scripted by Xylen5967 & mercury233
function c101105208.initial_effect(c)
aux.AddCodeList(c,44508094)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--apply
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c101105208.condition)
e2:SetTarget(c101105208.target)
e2:SetOperation(c101105208.activate)
c:RegisterEffect(e2)
end
function c101105208.cfilter(c,tp,re,rp)
return c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
and (c:IsCode(44508094) or c:IsType(TYPE_SYNCHRO) and aux.IsCodeListed(c,44508094))
and (c:IsReason(REASON_COST) and re:GetHandler():IsControler(tp) or c:IsReason(REASON_EFFECT) and rp==tp)
end
function c101105208.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105208.cfilter,1,nil,tp,re,rp)
end
function c101105208.rfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c101105208.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:Filter(c101105208.cfilter,nil,tp,re,rp):IsExists(Card.IsCanBeSpecialSummoned,1,nil,e,0,tp,false,false) and Duel.GetFlagEffect(tp,101105208)==0
local b2=Duel.IsExistingMatchingCard(c101105208.rfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) and Duel.GetFlagEffect(tp,101105208+100)==0
local b3=Duel.GetFlagEffect(tp,101105208+200)==0
return b1 or b2 or b3
end
end
function c101105208.activate(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:Filter(c101105208.cfilter,nil,tp,re,rp):IsExists(Card.IsCanBeSpecialSummoned,1,nil,e,0,tp,false,false) and Duel.GetFlagEffect(tp,101105208)==0
local b2=Duel.IsExistingMatchingCard(c101105208.rfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) and Duel.GetFlagEffect(tp,101105208+100)==0
local b3=Duel.GetFlagEffect(tp,101105208+200)==0
local off=1
local ops={}
local opval={}
if b1 then
ops[off]=aux.Stringid(101105208,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(101105208,1)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(101105208,2)
opval[off-1]=3
off=off+1
end
if off==1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local op=Duel.SelectOption(tp,table.unpack(ops))
if op==0 then
local sg=eg:Filter(c101105208.cfilter,nil,tp,re,rp)
if #sg>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=eg:Filter(c101105208.cfilter,nil,tp,re,rp):FilterSelect(tp,Card.IsCanBeSpecialSummoned,1,1,nil,e,0,tp,false,false)
end
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.RegisterFlagEffect(tp,101105208,RESET_PHASE+PHASE_END,0,1)
elseif op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c101105208.rfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
Duel.HintSelection(rg)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,101105208+100,RESET_PHASE+PHASE_END,0,1)
else
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c101105208.val)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,101105208+200,RESET_PHASE+PHASE_END,0,1)
end
end
function c101105208.val(e,re,dam,r,rp,rc)
return math.floor(val/2)
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