Commit 57d96e5e authored by mercury233's avatar mercury233

update scripts

parent bcd27825
--Sin Selector
--
--Script by JoyJ and mercury233
function c100236107.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,100236107+EFFECT_COUNT_CODE_OATH)
e1:SetLabel(0)
e1:SetCost(c100236107.cost)
e1:SetTarget(c100236107.target)
e1:SetOperation(c100236107.operation)
c:RegisterEffect(e1)
end
function c100236107.cfilter(c)
return c:IsSetCard(0x23) and c:IsAbleToRemoveAsCost()
end
function c100236107.thfilter(c,code1,code2)
return c:IsSetCard(0x23) and c:IsAbleToHand() and not c:IsCode(100236107,code1,code2)
end
function c100236107.costcheck(g,tp)
local code1=g:GetFirst():GetCode()
local code2=g:GetNext():GetCode()
local tg=Duel.GetMatchingGroup(c100236107.thfilter,tp,LOCATION_DECK,0,nil,code1,code2)
return tg:CheckSubGroup(c100236107.targetcheck,2,2)
end
function c100236107.targetcheck(g)
return g:GetClassCount(Card.GetCode)==#g
end
function c100236107.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c100236107.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100236107.cfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return g:CheckSubGroup(c100236107.costcheck,2,2,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,c100236107.costcheck,false,2,2,tp)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
sg:KeepAlive()
e:SetLabelObject(sg)
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function c100236107.operation(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local code1=g:GetFirst():GetCode()
local code2=g:GetNext():GetCode()
local tg=Duel.GetMatchingGroup(c100236107.thfilter,tp,LOCATION_DECK,0,nil,code1,code2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=tg:SelectSubGroup(tp,c100236107.targetcheck,false,2,2)
if sg then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
--Sin Tune
--
--Script by JoyJ
function c100236108.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100236108)
e1:SetCondition(c100236108.condition)
e1:SetTarget(c100236108.target)
e1:SetOperation(c100236108.activate)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100236108+100)
e2:SetCost(aux.bfgcost)
e2:SetCondition(c100236108.thcon)
e2:SetTarget(c100236108.thtg)
e2:SetOperation(c100236108.thop)
c:RegisterEffect(e2)
end
function c100236108.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and c:IsSetCard(0x23)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100236108.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100236108.cfilter,1,nil,tp)
end
function c100236108.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c100236108.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c100236108.cfilter2(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and c:IsSetCard(0x23) and not c:IsReason(REASON_BATTLE)
end
function c100236108.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100236108.cfilter2,1,nil,tp)
end
function c100236108.thfilter(c)
return c:IsSetCard(0x23) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c100236108.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100236108.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100236108.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100236108.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--黒・魔・導・連・弾
--
--Script by JoyJ
function c100236109.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100236109+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100236109.target)
e1:SetOperation(c100236109.activate)
c:RegisterEffect(e1)
end
function c100236109.filter(c)
return c:IsCode(38033121) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function c100236109.tgfilter(c)
return c:IsCode(46986414) and c:IsFaceup()
end
function c100236109.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100236109.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100236109.tgfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c100236109.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c100236109.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100236109.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local g=Duel.GetMatchingGroup(c100236109.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,nil)
local atk=g:GetSum(Card.GetAttack)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--スターダスト・ミラージュ
--
--Script by JoyJ and mercury233
function c100236110.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,100236110+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCondition(c100236110.spcon)
e1:SetTarget(c100236110.sptg)
e1:SetOperation(c100236110.spop)
c:RegisterEffect(e1)
end
function c100236110.cfilter(c)
return c:IsFaceup() and c:IsLevelAbove(8) and c:IsType(TYPE_SYNCHRO) and c:IsRace(RACE_DRAGON)
end
function c100236110.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100236110.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100236110.spfilter(c,e,tp,tid)
return c:GetTurnID()==tid and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100236110.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100236110.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,Duel.GetTurnCount()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c100236110.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tg=Duel.GetMatchingGroup(c100236110.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp,Duel.GetTurnCount())
if ft<1 or #tg<1 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,ft,ft,nil)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
--奇跡のマジック・ゲート
--
--Script by JoyJ
function c100236111.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100236111.condition)
e1:SetTarget(c100236111.target)
e1:SetOperation(c100236111.operation)
c:RegisterEffect(e1)
end
function c100236111.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
end
function c100236111.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100236111.cfilter,tp,LOCATION_MZONE,0,2,nil)
end
function c100236111.tgfilter(c)
return c:IsAttackPos() and c:IsCanChangePosition() and c:IsControlerCanBeChanged()
end
function c100236111.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c100236111.tgfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,1-tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,1-tp,LOCATION_MZONE)
end
function c100236111.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectMatchingCard(tp,c100236111.tgfilter,tp,0,LOCATION_MZONE,1,1,nil)
local c=g:GetFirst()
if c and Duel.ChangePosition(c,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE)>0 then
Duel.BreakEffect()
if Duel.GetControl(c,tp) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
end
--師弟の絆
--
--Script by JoyJ
function c100236112.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,100236112+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100236112.condition)
e1:SetTarget(c100236112.target)
e1:SetOperation(c100236112.activate)
c:RegisterEffect(e1)
end
function c100236112.cfilter(c)
return c:IsCode(46986414) and c:IsFaceup()
end
function c100236112.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100236112.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100236112.spfilter(c,e,tp)
return c:IsCode(38033121) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100236112.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100236112.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c100236112.setfilter(c)
return c:IsCode(2314238,75190122,49702428,100236109) and c:IsSSetable()
end
function c100236112.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100236112.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
local sc=g:GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(c100236112.setfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(100236112,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tc=g:Select(tp,1,1,nil)
Duel.SSet(tp,tc)
end
end
end
--身代わりの闇
--
--Script by JoyJ
function c100236113.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c100236113.condition)
e1:SetTarget(c100236113.target)
e1:SetOperation(c100236113.operation)
c:RegisterEffect(e1)
end
function c100236113.condition(e,tp,eg,ep,ev,re,r,rp)
if not (ep==1-tp and Duel.IsChainDisablable(ev)) then return false end
if re:IsHasCategory(CATEGORY_NEGATE)
and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return ex and tg~=nil and tc+tg:FilterCount(Card.IsOnField,nil)-tg:GetCount()>0
end
function c100236113.tgfilter(c)
return c:IsLevelBelow(3) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGrave()
end
function c100236113.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100236113.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c100236113.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and Duel.IsExistingMatchingCard(c100236113.tgfilter,tp,LOCATION_DECK,0,1,nil) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,c100236113.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(tg,REASON_EFFECT)
end
end
--Sin パラドクスギア
--
--Script by mercury233
function c100236115.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100236115+100)
e1:SetCondition(c100236115.condition)
e1:SetCost(c100236115.cost)
e1:SetTarget(c100236115.target)
e1:SetOperation(c100236115.operation)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(100236115)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetCountLimit(1,100236115)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c100236115.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end
function c100236115.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100236115.spfilter(c,e,tp)
return c:IsCode(74509280) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c100236115.thfilter,tp,LOCATION_DECK,0,1,c)
end
function c100236115.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x23) and c:IsAbleToHand() and not c:IsCode(100236115)
end
function c100236115.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100236115.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c100236115.operation(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 g1=Duel.SelectMatchingCard(tp,c100236115.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g1:GetCount()>0 then
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c100236115.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g2:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
end
end
end
--Sin Territory
--Script by nekrozar
function c100236116.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c100236116.activate)
c:RegisterEffect(e1)
--unique
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(100236116)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,1)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c100236116.discon)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x23))
c:RegisterEffect(e3)
end
function c100236116.actfilter(c,tp)
return c:IsCode(27564031) and c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function c100236116.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c100236116.actfilter,tp,LOCATION_DECK,0,nil,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(100236116,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg=g:Select(tp,1,1,nil)
local sc=sg:GetFirst()
Duel.MoveToField(sc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=sc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=sc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(sc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_FZONE)
e1:SetTargetRange(LOCATION_FZONE,LOCATION_FZONE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
end
end
function c100236116.discon(e)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
--方界法
--
--Script by JoyJ
function c100236117.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Avoid battle damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c100236117.filter)
e2:SetValue(1)
c:RegisterEffect(e2)
--Draw
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,100236117)
e3:SetTarget(c100236117.drawtg)
e3:SetOperation(c100236117.drawop)
c:RegisterEffect(e3)
--To hand
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,100236117+100)
e4:SetCost(aux.bfgcost)
e4:SetTarget(c100236117.thtg)
e4:SetOperation(c100236117.thop)
c:RegisterEffect(e4)
end
function c100236117.filter(e,c)
return c:IsSetCard(0xe3)
end
function c100236117.cfilter(c)
return c:IsSetCard(0xe3)
end
function c100236117.drawtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(c100236117.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100236117.drawop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.DiscardHand(tp,c100236117.cfilter,1,1,REASON_EFFECT)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c100236117.thfilter(c)
return c:IsSetCard(0xe3) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c100236117.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100236117.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100236117.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100236117.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100236117.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--無限起動ロックアンカー
--
--Script by JoyJ
function c100412002.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412002,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100412002)
e1:SetTarget(c100412002.sptg)
e1:SetOperation(c100412002.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--lv change
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100412002,1))
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101412104)
e3:SetTarget(c100412002.lvtg)
e3:SetOperation(c100412002.lvop)
c:RegisterEffect(e3)
end
function c100412002.spfilter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH) and not c:IsCode(100412002)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100412002.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100412002.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100412002.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100412002.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c100412002.lvfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsLevelAbove(0)
end
function c100412002.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100412002.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100412002.lvfilter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100412002.lvfilter,tp,LOCATION_MZONE,0,1,1,c)
end
function c100412002.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local lv=c:GetOriginalLevel()+tc:GetOriginalLevel()
c100412002.setlv(c,c,lv)
c100412002.setlv(c,tc,lv)
end
end
function c100412002.setlv(c,ec,lv)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(lv)
ec:RegisterEffect(e1)
end
--無限起動キャンサークレーン
--
--Script by JoyJ and mercury233
function c100412003.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100412003)
e1:SetCost(c100412003.spcost)
e1:SetTarget(c100412003.sptg)
e1:SetOperation(c100412003.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412003,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100412003+100)
e2:SetCost(c100412003.thcost)
e2:SetTarget(c100412003.thtg)
e2:SetOperation(c100412003.thop)
c:RegisterEffect(e2)
end
function c100412003.cfilter(c,tp)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_EARTH) and Duel.GetMZoneCount(tp,c)>0
end
function c100412003.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100412003.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c100412003.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100412003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100412003.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c100412003.thcfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c100412003.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412003.thcfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c100412003.thcfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c100412003.thfilter(c)
return c:IsAbleToHand() and c:IsCode(100412999)
end
function c100412003.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412003.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100412003.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100412003.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--無限起動コロッサルマウンテン
--
--Script by JoyJ and Justfish
function c100412008.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,7,2)
--attack up
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetDescription(aux.Stringid(100412008,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,100412008)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c100412008.atkcost)
e1:SetOperation(c100412008.atkop)
c:RegisterEffect(e1)
--Attach
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412008,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c100412008.xyzcon)
e2:SetTarget(c100412008.xyztg)
e2:SetOperation(c100412008.xyzop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100412008+100)
e3:SetCost(c100412008.spcost)
e3:SetTarget(c100412008.sptg)
e3:SetOperation(c100412008.spop)
c:RegisterEffect(e3)
end
function c100412008.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c100412008.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
function c100412008.xyzcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if not c:IsRelateToBattle() or c:IsFacedown() then return false end
e:SetLabelObject(tc)
return tc and tc:IsType(TYPE_MONSTER) and tc:IsReason(REASON_BATTLE)
end
function c100412008.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) end
local tc=e:GetLabelObject()
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,tc,1,0,0)
end
function c100412008.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Overlay(c,tc)
end
end
function c100412008.cfilter(c,tp)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_MACHINE) and Duel.GetMZoneCount(tp,c)>0
end
function c100412008.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100412008.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c100412008.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100412008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100412008.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--無限起動アースシェイカー
--
--Script by JoyJ and Justfish
function c100412009.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,9,2)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412009,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100412009)
e1:SetCost(c100412009.descost)
e1:SetTarget(c100412009.destg)
e1:SetOperation(c100412009.desop)
c:RegisterEffect(e1)
--Attach
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412009,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c100412009.xyzcon)
e2:SetTarget(c100412009.xyztg)
e2:SetOperation(c100412009.xyzop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100412009+100)
e3:SetCost(c100412009.spcost)
e3:SetTarget(c100412009.sptg)
e3:SetOperation(c100412009.spop)
c:RegisterEffect(e3)
end
function c100412009.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
local rt=math.min(Duel.GetTargetCount(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil),c:GetOverlayCount())
c:RemoveOverlayCard(tp,1,rt,REASON_COST)
local ct=Duel.GetOperatedGroup():GetCount()
e:SetLabel(ct)
end
function c100412009.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local ct=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tg=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,ct,0,0)
end
function c100412009.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function c100412009.xyzcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if not c:IsRelateToBattle() or c:IsFacedown() then return false end
e:SetLabelObject(tc)
return tc and tc:IsType(TYPE_MONSTER) and tc:IsReason(REASON_BATTLE)
end
function c100412009.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) end
local tc=e:GetLabelObject()
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,tc,1,0,0)
end
function c100412009.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Overlay(c,tc)
end
end
function c100412009.cfilter(c,tp)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_MACHINE) and Duel.GetMZoneCount(tp,c)>0
end
function c100412009.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100412009.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c100412009.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100412009.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100412009.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--無限起動要塞メガトンゲイル
--
--Script by JoyJ and mercury233
function c100412011.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_XYZ),3,3)
--immune effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c100412011.immunefilter)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(c100412011.indes)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100412011,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c100412011.sptg)
e3:SetOperation(c100412011.spop)
c:RegisterEffect(e3)
end
function c100412011.immunefilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetOwner()~=e:GetOwner() and not te:GetHandler():IsType(TYPE_XYZ)
end
function c100412011.indes(e,c)
return not c:IsType(TYPE_XYZ)
end
function c100412011.spfilter(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100412011.matfilter(c)
return not c:IsType(TYPE_TOKEN) and c:IsAbleToChangeControler()
end
function c100412011.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100412011.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsExistingTarget(c100412011.matfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100412011.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100412011,1))
local g2=Duel.SelectMatchingCard(tp,c100412011.matfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
g2:AddCard(g:GetFirst())
Duel.SetTargetCard(g2)
end
function c100412011.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=tg:Filter(c100412011.spfilter,nil,e,tp):GetFirst()
if tc and tc:IsRelateToEffect(e)
and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local mat=tg:Filter(c100412011.matfilter,tc,e,tp):GetFirst()
if mat and mat:IsRelateToEffect(e) then
local og=mat:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(tc,mat)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(c100412011.damval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100412011.damval(e,re,val,r,rp,rc)
return val/2
end
--ウィッチクラフトマスター・ヴェール
--
--Script by JoyJ and mercury233
function c100412019.initial_effect(c)
--atk & def
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412019,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100412019)
e1:SetCondition(c100412019.atkcon)
e1:SetTarget(c100412019.atktg)
e1:SetOperation(c100412019.atkop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101412017,1))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100412019+100)
e2:SetCost(c100412019.discost)
e2:SetTarget(c100412019.distg)
e2:SetOperation(c100412019.disop)
c:RegisterEffect(e2)
end
function c100412019.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()
and (Duel.GetAttacker():IsControler(tp) and Duel.GetAttacker():IsRace(RACE_SPELLCASTER)
or Duel.GetAttackTarget():IsControler(tp) and Duel.GetAttackTarget():IsRace(RACE_SPELLCASTER))
end
function c100412019.cfilter(c)
return c:IsType(TYPE_SPELL) and not c:IsPublic()
end
function c100412019.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412019.cfilter,tp,LOCATION_HAND,0,1,nil) end
end
function c100412019.check(g)
return g:GetClassCount(Card.GetCode)==#g
end
function c100412019.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
local g=Duel.GetMatchingGroup(c100412019.cfilter,tp,LOCATION_HAND,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:SelectSubGroup(tp,c100412019.check,false,1,#g)
if not sg then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(#sg*1000)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.Clone(e1)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
function c100412019.cfilter2(c)
return c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function c100412019.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100412019.cfilter2,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c100412019.cfilter2,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c100412019.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_MZONE,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(aux.disfilter1,tp,0,LOCATION_MZONE,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c100412019.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.disfilter1,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
--呪眼の眷属 カトブレパス
--
--Script by JoyJ
function c100412029.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100412029,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100412029)
e1:SetTarget(c100412029.indtg)
e1:SetOperation(c100412029.indop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100412029,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100412029+100)
e2:SetCondition(c100412029.spcon)
e2:SetTarget(c100412029.sptg)
e2:SetOperation(c100412029.spop)
c:RegisterEffect(e2)
end
function c100412029.tgfilter(c)
return c:IsSetCard(0x226) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsFaceup()
end
function c100412029.indtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and c100412029.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100412029.tgfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100412029.tgfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
end
function c100412029.indop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_NO_TURN_RESET)
e1:SetCountLimit(1)
e1:SetValue(c100412029.indval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1)
end
end
function c100412029.indval(e,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0 and rp~=e:GetHandlerPlayer()
end
function c100412029.spcfilter(c)
return c:IsFaceup() and c:IsSetCard(0x226) and not c:IsCode(100412029)
end
function c100412029.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100412029.spcfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100412029.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 c100412029.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
--Danger! Ogopogo!
--Script by JoyJ
function c101007000.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c101007000.spcost)
e1:SetTarget(c101007000.sptg)
e1:SetOperation(c101007000.spop)
c:RegisterEffect(e1)
--special summon from deck
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TO_GRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DISCARD)
e2:SetCountLimit(1,101007000)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(c101007000.tgtg)
e2:SetOperation(c101007000.tgop)
c:RegisterEffect(e2)
end
function c101007000.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101007000.spfilter(c,e,tp)
return c:IsCode(101007000) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101007000.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c101007000.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c101007000.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g:GetCount()<=0 then return end
local tc=g:RandomSelect(1-tp,1):GetFirst()
if Duel.SendtoGrave(tc,REASON_DISCARD+REASON_EFFECT)~=0 and not tc:IsCode(101007000)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local spg=Duel.GetMatchingGroup(c101007000.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if spg:GetCount()<=0 then return end
local sg=spg:GetFirst()
if spg:GetCount()~=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=spg:Select(tp,1,1,nil)
end
Duel.BreakEffect()
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c101007000.tgfilter(c)
return c:IsSetCard(0x11e) and c:IsAbleToGrave() and not c:IsCode(101007000)
end
function c101007000.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101007000.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101007000.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101007000.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--Super Anti-Kaiju War Machine Mecha-Thunder-King
--Script by JoyJ
function c101007081.initial_effect(c)
c:SetUniqueOnField(1,0,aux.FilterBoolFunction(Card.IsSetCard,0xd3),LOCATION_MZONE)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101007081,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCondition(c101007081.spcon)
e1:SetCost(c101007081.spcost)
e1:SetTarget(c101007081.sptg)
e1:SetOperation(c101007081.spop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(c101007081.indval)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetValue(c101007081.efilter)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101007081,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,101007081+EFFECT_COUNT_CODE_DUEL)
e4:SetTarget(c101007081.sptg2)
e4:SetOperation(c101007081.spop2)
c:RegisterEffect(e4)
end
function c101007081.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c101007081.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c101007081.rmfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xd3) and c:IsAbleToRemove() and c:GetOwner()==1-tp
end
function c101007081.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101007081.rmfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE)
end
function c101007081.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c101007081.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101007081.rmfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c101007081.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(101007081,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101007081.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101007081.indval(e,c)
return c:IsSetCard(0xd3)
end
function c101007081.efilter(e,te)
return te:GetHandler():IsSetCard(0xd3)
end
function c101007081.sptg2(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 c101007081.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--Time Thief Winder
--Script by JoyJ
function c101007082.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101007082,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101007082)
e1:SetCost(c101007082.spcost)
e1:SetTarget(c101007082.sptg)
e1:SetOperation(c101007082.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101007082,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,101007082+100)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(c101007082.thtg)
e2:SetOperation(c101007082.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c101007082.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end
function c101007082.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 c101007082.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 c101007082.thfilter(c)
return c:IsSetCard(0x229) and c:IsAbleToHand() and not c:IsCode(101007082)
end
function c101007082.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101007082.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101007082.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101007082.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
--Time Thief Bezel Ship
--Script by JoyJ
function c101007083.initial_effect(c)
--xyz material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101007083,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1,101007083)
e1:SetCost(c101007083.matcost)
e1:SetTarget(c101007083.mattg)
e1:SetOperation(c101007083.matop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101007083,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101007083+100)
e2:SetCost(c101007083.spcost)
e2:SetTarget(c101007083.sptg)
e2:SetOperation(c101007083.spop)
c:RegisterEffect(e2)
end
function c101007083.matcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c101007083.matfilter(c,tp)
return c:IsSetCard(0x229) and c:IsType(TYPE_XYZ) and c:IsFaceup()
and Duel.IsExistingMatchingCard(Card.IsCanBeXyzMaterial,tp,0,LOCATION_GRAVE,1,nil,c)
end
function c101007083.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c101007083.matfilter(c,tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(c101007083.matfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101007083.matfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function c101007083.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_XYZ) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,Card.IsCanBeXyzMaterial,tp,0,LOCATION_GRAVE,1,1,nil,tc)
Duel.Overlay(tc,g)
end
end
function c101007083.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end
function c101007083.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 c101007083.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1,true)
end
end
--Time Thief Regulator
--Script by JoyJ
function c101007084.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101007084,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101007084)
e1:SetCondition(c101007084.spcon)
e1:SetCost(c101007084.spcost)
e1:SetTarget(c101007084.sptg)
e1:SetOperation(c101007084.spop)
c:RegisterEffect(e1)
--spsummon from grave
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetDescription(aux.Stringid(101007084,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101007084+100)
e2:SetCondition(c101007084.spcon2)
e2:SetTarget(c101007084.sptg2)
e2:SetOperation(c101007084.spop2)
c:RegisterEffect(e2)
end
function c101007084.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
end
function c101007084.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST+REASON_RELEASE)
end
function c101007084.spfilter(c,e,tp)
return c:IsSetCard(0x229) and not c:IsCode(101007084) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101007084.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c101007084.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return Duel.GetMZoneCount(tp,e:GetHandler())>=2 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:GetClassCount(Card.GetCode)>=2
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c101007084.check(g)
return g:GetClassCount(Card.GetCode)==#g
end
function c101007084.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c101007084.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c101007084.check,false,2,2)
if sg then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function c101007084.cfilter(c,tp)
return c:IsType(TYPE_XYZ) and c:GetPreviousControler()==tp
end
function c101007084.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101007084.cfilter,1,nil,tp)
end
function c101007084.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101007084.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1,true)
end
end
--Time Thief Redoer
--Script by JoyJ and mercury233
function c101007085.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,4,2)
--attach
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101007085,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c101007085.mattg)
e1:SetOperation(c101007085.matop)
c:RegisterEffect(e1)
--activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101007085,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,101007085)
e2:SetTarget(c101007085.target)
e2:SetOperation(c101007085.operation)
c:RegisterEffect(e2)
end
function c101007085.mattg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>0 end
end
function c101007085.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetDecktopGroup(1-tp,1)
if c:IsRelateToEffect(e) and g:GetCount()==1 then
Duel.Overlay(c,g)
end
end
function c101007085.tgfilter(c)
return c:IsFaceup() and c:IsAbleToDeck()
end
function c101007085.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
if not c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) then return false end
local g=c:GetOverlayGroup()
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER)
and c:IsAbleToRemove() then return true end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL)
and Duel.IsPlayerCanDraw(tp,1) then return true end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP)
and Duel.IsExistingMatchingCard(c101007085.tgfilter,tp,0,LOCATION_ONFIELD,1,nil) then return true end
return false
end
end
function c101007085.check(g)
return g:FilterCount(Card.IsType,nil,TYPE_MONSTER)<=1
and g:FilterCount(Card.IsType,nil,TYPE_SPELL)<=1
and g:FilterCount(Card.IsType,nil,TYPE_TRAP)<=1
end
function c101007085.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) then return end
local g=c:GetOverlayGroup()
local tg=Group.CreateGroup()
if c:IsAbleToRemove() then
tg:Merge(g:Filter(Card.IsType,nil,TYPE_MONSTER))
end
if Duel.IsPlayerCanDraw(tp,1) then
tg:Merge(g:Filter(Card.IsType,nil,TYPE_SPELL))
end
if Duel.IsExistingMatchingCard(c101007085.tgfilter,tp,0,LOCATION_ONFIELD,1,nil) then
tg:Merge(g:Filter(Card.IsType,nil,TYPE_TRAP))
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
local sg=tg:SelectSubGroup(tp,c101007085.check,false,1,3)
if not sg then return end
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.RaiseSingleEvent(c,EVENT_DETACH_MATERIAL,e,0,0,0,0)
if sg:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
Duel.BreakEffect()
Duel.Remove(c,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)
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(c101007085.retop)
Duel.RegisterEffect(e1,tp)
end
if sg:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
if sg:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dg=Duel.SelectMatchingCard(tp,c101007085.tgfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SendtoDeck(dg,nil,0,REASON_EFFECT)
end
end
function c101007085.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
--Time Thief Hack
--Script by JoyJ
function c101007086.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c101007086.xyztarget)
e2:SetValue(c101007086.indesval)
c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c101007086.xyztarget)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--atkup
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101007086,0))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1,101007086)
e4:SetTarget(c101007086.atktg)
e4:SetOperation(c101007086.atkop)
c:RegisterEffect(e4)
end
function c101007086.indesval(e,re,rp)
return rp~=e:GetHandlerPlayer()
end
function c101007086.xyztarget(e,c)
return c:IsType(TYPE_XYZ) and c:IsStatus(STATUS_SPSUMMON_TURN)
end
function c101007086.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0
end
function c101007086.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101007086.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101007086.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101007086.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101007086.matfil(c,e)
return c:GetOwner()~=e:GetHandlerPlayer()
end
function c101007086.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc:GetOverlayCount()*300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if tc:GetOverlayGroup():IsExists(c101007086.matfil,1,nil,e) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
end
--Time Thief Flyback
--Script by JoyJ
function c101007087.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101007087,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101007087)
e1:SetTarget(c101007087.target)
e1:SetOperation(c101007087.activate)
c:RegisterEffect(e1)
--grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101007087,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101007087)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101007087.mattg)
e2:SetOperation(c101007087.matop)
c:RegisterEffect(e2)
end
function c101007087.xyzfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x229)
end
function c101007087.matfilter(c)
return c:IsSetCard(0x229)
end
function c101007087.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101007087.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101007087.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c101007087.matfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101007087.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function c101007087.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101007087,2))
local g=Duel.SelectMatchingCard(tp,c101007087.matfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,tc)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
end
end
function c101007087.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101007087.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101007087.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101007087.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function c101007087.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101007087,2))
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
end
end
--Valkyrie Sechste
--Script by JoyJ
function c101007088.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101007088,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101007088)
e1:SetTarget(c101007088.sptg)
e1:SetOperation(c101007088.spop)
c:RegisterEffect(e1)
--gy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101007088,1))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101007088+100)
e2:SetTarget(c101007088.tgtg)
e2:SetOperation(c101007088.tgop)
c:RegisterEffect(e2)
end
function c101007088.spfilter(c,e,tp)
return c:IsSetCard(0x122) and not c:IsCode(101007088) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101007088.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101007088.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101007088.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101007088.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101007088.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(1-tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,2)
end
function c101007088.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(1-tp,2,REASON_EFFECT)
end
--Valkyrie Vierte
--Script by JoyJ
function c101007089.initial_effect(c)
--deck search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101007089,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101007089)
e1:SetTarget(c101007089.target)
e1:SetOperation(c101007089.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101007089,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetCountLimit(1,101007089+100)
e2:SetCondition(c101007089.spcon)
e2:SetTarget(c101007089.sptg)
e2:SetOperation(c101007089.spop)
c:RegisterEffect(e2)
end
function c101007089.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x122)
end
function c101007089.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetMatchingGroupCount(c101007089.ctfilter,tp,LOCATION_MZONE,0,e:GetHandler())
if ct==0 or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ct then return false end
local g=Duel.GetDecktopGroup(tp,ct)
return g:FilterCount(Card.IsAbleToHand,nil)>0
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c101007089.thfilter(c)
return (c:GetType()==TYPE_SPELL or c:GetType()==TYPE_TRAP) and c:IsAbleToHand()
end
function c101007089.thfilter0(c)
return (c:GetType()==TYPE_SPELL or c:GetType()==TYPE_TRAP)
end
function c101007089.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c101007089.ctfilter,tp,LOCATION_MZONE,0,e:GetHandler())
if ct==0 then return end
local g=Duel.GetDecktopGroup(tp,ct)
Duel.ConfirmDecktop(tp,ct)
g=g:Filter(c101007089.thfilter0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc:IsAbleToHand() then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
Duel.ShuffleHand(tp)
else
Duel.SendtoGrave(tc,REASON_RULE)
end
g:RemoveCard(tc)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
end
Duel.ShuffleDeck(tp)
end
function c101007089.spfilter(c,e,tp)
return c:IsSetCard(0x122) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101007089.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE)
end
function c101007089.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101007089.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101007089.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101007089.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--Final Light
--Script by JoyJ and mercury233
function c101007090.initial_effect(c)
--activate
local e1 = Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101007090+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c101007090.condition)
e1:SetCost(c101007090.cost)
e1:SetTarget(c101007090.target)
e1:SetOperation(c101007090.operation)
c:RegisterEffect(e1)
end
function c101007090.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,EFFECT_LPCOST_CHANGE)
end
function c101007090.spfilter(c,e,tp)
return c:IsSetCard(0x122) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeEffectTarget(e)
end
function c101007090.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
e:SetLabel(100)
return true
end
end
function c101007090.check(g)
return g:GetClassCount(Card.GetCode)==#g
end
function c101007090.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c101007090.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return false end
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return ft>0 and g:GetCount()>0 and Duel.CheckLPCost(tp,1000)
end
e:SetLabel(0)
local ct=math.min(g:GetClassCount(Card.GetCode),ft)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
ct=1
end
local pay_list = {}
for p=1,ct do
if Duel.CheckLPCost(tp,1000*p) then table.insert(pay_list,p) end
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101007090,0))
local pay=Duel.AnnounceNumber(tp,table.unpack(pay_list))
Duel.PayLPCost(tp,pay*1000)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c101007090.check,false,pay,pay)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,sg:GetCount(),0,0)
end
function c101007090.spfilter2(c,e,tp)
return c:IsAttackBelow(2000) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101007090.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if sg:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil)
end
local ct=Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
if ct<=0 then return end
local g2=Duel.GetMatchingGroup(c101007090.spfilter2,tp,0,LOCATION_GRAVE,nil,e,1-tp)
local ct2=math.min(Duel.GetLocationCount(1-tp,LOCATION_MZONE),ct)
if g2:GetCount()>0 and ct2>0
and Duel.SelectYesNo(1-tp,aux.Stringid(101007090,1)) then
if Duel.IsPlayerAffectedByEffect(1-tp,59822133) then ct2=1 end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
sg=g2:Select(1-tp,1,ct2,nil)
Duel.SpecialSummon(sg,0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
--Apple of Enlightenment
--Script by JoyJ
function c101007091.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c101007091.target)
e1:SetOperation(c101007091.activate)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e2:SetCondition(c101007091.drcon)
e2:SetTarget(c101007091.drtg)
e2:SetOperation(c101007091.drop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
end
function c101007091.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x122)
end
function c101007091.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsAbleToRemove() and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c101007091.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
local ct=Duel.GetMatchingGroupCount(c101007091.cfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c101007091.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c101007091.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp~=tp and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c101007091.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(c101007091.cfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsPlayerCanDraw(tp,ct+1) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct+1)
end
function c101007091.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=Duel.GetMatchingGroupCount(c101007091.cfilter,p,LOCATION_MZONE,0,nil)
Duel.Draw(p,ct+1,REASON_EFFECT)
end
--Sin サイバー・エンド・ドラゴン
function c1710476.initial_effect(c)
c:EnableReviveLimit()
c:SetUniqueOnField(1,1,c1710476.uqfilter,LOCATION_MZONE)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c1710476.spcon)
e1:SetOperation(c1710476.spop)
c:RegisterEffect(e1)
--selfdes
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_SELF_DESTROY)
e7:SetCondition(c1710476.descon)
c:RegisterEffect(e7)
--cannot announce
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e8:SetTargetRange(LOCATION_MZONE,0)
e8:SetTarget(c1710476.antarget)
c:RegisterEffect(e8)
--spson
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e9:SetCode(EFFECT_SPSUMMON_CONDITION)
e9:SetValue(aux.FALSE)
c:RegisterEffect(e9)
end
function c1710476.uqfilter(c)
if Duel.IsPlayerAffectedByEffect(c:GetControler(),100236116) then
return c:IsCode(1710476)
else
return c:IsSetCard(0x23)
end
end
function c1710476.spfilter(c)
return c:IsCode(1546123) and c:IsAbleToRemoveAsCost()
end
function c1710476.spfilter2(c,tp)
return c:IsHasEffect(100236115) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c1710476.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c1710476.spfilter,tp,LOCATION_EXTRA,0,1,nil)
local b2=Duel.GetFlagEffect(tp,100236115)==0
and Duel.IsExistingMatchingCard(c1710476.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
return b1 or b2
end
function c1710476.spop(e,tp,eg,ep,ev,re,r,rp,c)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c1710476.spfilter,tp,LOCATION_EXTRA,0,1,nil)
local b2=Duel.GetFlagEffect(tp,100236115)==0
and Duel.IsExistingMatchingCard(c1710476.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(100236115,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,c1710476.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,100236115,RESET_PHASE+PHASE_END,0,1)
else
local tc=Duel.GetFirstMatchingCard(c1710476.spfilter,tp,LOCATION_EXTRA,0,nil)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end
end
function c1710476.descon(e)
local f1=Duel.GetFieldCard(0,LOCATION_SZONE,5)
local f2=Duel.GetFieldCard(1,LOCATION_SZONE,5)
return (f1==nil or f1:IsFacedown()) and (f2==nil or f2:IsFacedown())
end
function c1710476.antarget(e,c)
return c~=e:GetHandler()
end
--Sin スターダスト・ドラゴン
function c36521459.initial_effect(c)
c:EnableReviveLimit()
c:SetUniqueOnField(1,1,c36521459.uqfilter,LOCATION_MZONE)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c36521459.spcon)
e1:SetOperation(c36521459.spop)
c:RegisterEffect(e1)
--selfdes
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_SELF_DESTROY)
e7:SetCondition(c36521459.descon)
c:RegisterEffect(e7)
--cannot announce
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e8:SetTargetRange(LOCATION_MZONE,0)
e8:SetTarget(c36521459.antarget)
c:RegisterEffect(e8)
--indes
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_FIELD)
e9:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e9:SetRange(LOCATION_MZONE)
e9:SetTargetRange(LOCATION_FZONE,LOCATION_FZONE)
e9:SetValue(1)
c:RegisterEffect(e9)
--spson
local ea=Effect.CreateEffect(c)
ea:SetType(EFFECT_TYPE_SINGLE)
ea:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ea:SetCode(EFFECT_SPSUMMON_CONDITION)
ea:SetValue(aux.FALSE)
c:RegisterEffect(ea)
end
function c36521459.uqfilter(c)
if Duel.IsPlayerAffectedByEffect(c:GetControler(),100236116) then
return c:IsCode(36521459)
else
return c:IsSetCard(0x23)
end
end
function c36521459.spfilter(c)
return c:IsCode(44508094) and c:IsAbleToRemoveAsCost()
end
function c36521459.spfilter2(c,tp)
return c:IsHasEffect(100236115) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c36521459.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c36521459.spfilter,tp,LOCATION_EXTRA,0,1,nil)
local b2=Duel.GetFlagEffect(tp,100236115)==0
and Duel.IsExistingMatchingCard(c36521459.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
return b1 or b2
end
function c36521459.spop(e,tp,eg,ep,ev,re,r,rp,c)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c36521459.spfilter,tp,LOCATION_EXTRA,0,1,nil)
local b2=Duel.GetFlagEffect(tp,100236115)==0
and Duel.IsExistingMatchingCard(c36521459.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(100236115,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,c36521459.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,100236115,RESET_PHASE+PHASE_END,0,1)
else
local tc=Duel.GetFirstMatchingCard(c36521459.spfilter,tp,LOCATION_EXTRA,0,nil)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end
end
function c36521459.descon(e)
local f1=Duel.GetFieldCard(0,LOCATION_SZONE,5)
local f2=Duel.GetFieldCard(1,LOCATION_SZONE,5)
return (f1==nil or f1:IsFacedown()) and (f2==nil or f2:IsFacedown())
end
function c36521459.antarget(e,c)
return c~=e:GetHandler()
end
--Sin トゥルース・ドラゴン
function c37115575.initial_effect(c)
c:EnableReviveLimit()
c:SetUniqueOnField(1,1,c37115575.uqfilter,LOCATION_MZONE)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37115575,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(c37115575.spcon)
e1:SetCost(c37115575.spcost)
e1:SetTarget(c37115575.sptg)
e1:SetOperation(c37115575.spop)
c:RegisterEffect(e1)
--selfdes
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_SELF_DESTROY)
e7:SetCondition(c37115575.descon)
c:RegisterEffect(e7)
--spson
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e8:SetCode(EFFECT_SPSUMMON_CONDITION)
e8:SetValue(aux.FALSE)
c:RegisterEffect(e8)
--destroy
local e9=Effect.CreateEffect(c)
e9:SetDescription(aux.Stringid(37115575,1))
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e9:SetCategory(CATEGORY_DESTROY)
e9:SetCode(EVENT_BATTLE_DESTROYING)
e9:SetCondition(c37115575.decon)
e9:SetTarget(c37115575.detg)
e9:SetOperation(c37115575.deop)
c:RegisterEffect(e9)
end
function c37115575.uqfilter(c)
if Duel.IsPlayerAffectedByEffect(c:GetControler(),100236116) then
return c:IsCode(37115575)
else
return c:IsSetCard(0x23)
end
end
function c37115575.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
and c:IsPreviousSetCard(0x23) and c:GetPreviousCodeOnField()~=37115575 and not c:IsReason(REASON_RULE)
end
function c37115575.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c37115575.cfilter,1,nil,tp)
end
function c37115575.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c37115575.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,true,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c37115575.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)~=0 then
c:CompleteProcedure()
end
end
function c37115575.descon(e)
local f1=Duel.GetFieldCard(0,LOCATION_SZONE,5)
local f2=Duel.GetFieldCard(1,LOCATION_SZONE,5)
return (f1==nil or f1:IsFacedown()) and (f2==nil or f2:IsFacedown())
end
function c37115575.decon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsRelateToBattle() and c:GetBattleTarget():IsType(TYPE_MONSTER)
end
function c37115575.defilter(c)
return c:IsFaceup()
end
function c37115575.detg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c37115575.defilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c37115575.deop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c37115575.defilter,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--Sin 真紅眼の黒竜
function c55343236.initial_effect(c)
c:EnableReviveLimit()
c:SetUniqueOnField(1,1,c55343236.uqfilter,LOCATION_MZONE)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c55343236.spcon)
e1:SetOperation(c55343236.spop)
c:RegisterEffect(e1)
--selfdes
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_SELF_DESTROY)
e7:SetCondition(c55343236.descon)
c:RegisterEffect(e7)
--cannot announce
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e8:SetTargetRange(LOCATION_MZONE,0)
e8:SetTarget(c55343236.antarget)
c:RegisterEffect(e8)
end
function c55343236.uqfilter(c)
if Duel.IsPlayerAffectedByEffect(c:GetControler(),100236116) then
return c:IsCode(55343236)
else
return c:IsSetCard(0x23)
end
end
function c55343236.spfilter(c)
return c:IsCode(74677422) and c:IsAbleToRemoveAsCost()
end
function c55343236.spfilter2(c,tp)
return c:IsHasEffect(100236115) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c55343236.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c55343236.spfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.GetFlagEffect(tp,100236115)==0
and Duel.IsExistingMatchingCard(c55343236.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
return b1 or b2
end
function c55343236.spop(e,tp,eg,ep,ev,re,r,rp,c)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c55343236.spfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.GetFlagEffect(tp,100236115)==0
and Duel.IsExistingMatchingCard(c55343236.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(100236115,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,c55343236.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,100236115,RESET_PHASE+PHASE_END,0,1)
else
local tc=Duel.GetFirstMatchingCard(c55343236.spfilter,tp,LOCATION_DECK,0,nil)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end
end
function c55343236.descon(e)
local f1=Duel.GetFieldCard(0,LOCATION_SZONE,5)
local f2=Duel.GetFieldCard(1,LOCATION_SZONE,5)
return (f1==nil or f1:IsFacedown()) and (f2==nil or f2:IsFacedown())
end
function c55343236.antarget(e,c)
return c~=e:GetHandler()
end
--Sin レインボー・ドラゴン
function c598988.initial_effect(c)
c:EnableReviveLimit()
c:SetUniqueOnField(1,1,c598988.uqfilter,LOCATION_MZONE)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c598988.spcon)
e1:SetOperation(c598988.spop)
c:RegisterEffect(e1)
--selfdes
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_SELF_DESTROY)
e7:SetCondition(c598988.descon)
c:RegisterEffect(e7)
--cannot announce
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e8:SetTargetRange(LOCATION_MZONE,0)
e8:SetTarget(c598988.antarget)
c:RegisterEffect(e8)
--spson
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e9:SetCode(EFFECT_SPSUMMON_CONDITION)
e9:SetValue(aux.FALSE)
c:RegisterEffect(e9)
end
function c598988.uqfilter(c)
if Duel.IsPlayerAffectedByEffect(c:GetControler(),100236116) then
return c:IsCode(598988)
else
return c:IsSetCard(0x23)
end
end
function c598988.spfilter(c)
return c:IsCode(79856792) and c:IsAbleToRemoveAsCost()
end
function c598988.spfilter2(c,tp)
return c:IsHasEffect(100236115) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c598988.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c598988.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil)
local b2=Duel.GetFlagEffect(tp,100236115)==0
and Duel.IsExistingMatchingCard(c598988.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
return b1 or b2
end
function c598988.spop(e,tp,eg,ep,ev,re,r,rp,c)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c598988.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil)
local b2=Duel.GetFlagEffect(tp,100236115)==0
and Duel.IsExistingMatchingCard(c598988.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(100236115,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,c598988.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,100236115,RESET_PHASE+PHASE_END,0,1)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,c598988.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
end
end
function c598988.descon(e)
local f1=Duel.GetFieldCard(0,LOCATION_SZONE,5)
local f2=Duel.GetFieldCard(1,LOCATION_SZONE,5)
return (f1==nil or f1:IsFacedown()) and (f2==nil or f2:IsFacedown())
end
function c598988.antarget(e,c)
return c~=e:GetHandler()
end
--Sin 青眼の白龍
function c9433350.initial_effect(c)
c:EnableReviveLimit()
c:SetUniqueOnField(1,1,c9433350.uqfilter,LOCATION_MZONE)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c9433350.spcon)
e1:SetOperation(c9433350.spop)
c:RegisterEffect(e1)
--selfdes
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_SELF_DESTROY)
e7:SetCondition(c9433350.descon)
c:RegisterEffect(e7)
--cannot announce
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e8:SetTargetRange(LOCATION_MZONE,0)
e8:SetTarget(c9433350.antarget)
c:RegisterEffect(e8)
end
function c9433350.uqfilter(c)
if Duel.IsPlayerAffectedByEffect(c:GetControler(),100236116) then
return c:IsCode(9433350)
else
return c:IsSetCard(0x23)
end
end
function c9433350.spfilter(c)
return c:IsCode(89631139) and c:IsAbleToRemoveAsCost()
end
function c9433350.spfilter2(c,tp)
return c:IsHasEffect(100236115) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c9433350.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c9433350.spfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.GetFlagEffect(tp,100236115)==0
and Duel.IsExistingMatchingCard(c9433350.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
return b1 or b2
end
function c9433350.spop(e,tp,eg,ep,ev,re,r,rp,c)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c9433350.spfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.GetFlagEffect(tp,100236115)==0
and Duel.IsExistingMatchingCard(c9433350.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(100236115,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,c9433350.spfilter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
Duel.RegisterFlagEffect(tp,100236115,RESET_PHASE+PHASE_END,0,1)
else
local tc=Duel.GetFirstMatchingCard(c9433350.spfilter,tp,LOCATION_DECK,0,nil)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end
end
function c9433350.descon(e)
local f1=Duel.GetFieldCard(0,LOCATION_SZONE,5)
local f2=Duel.GetFieldCard(1,LOCATION_SZONE,5)
return (f1==nil or f1:IsFacedown()) and (f2==nil or f2:IsFacedown())
end
function c9433350.antarget(e,c)
return c~=e:GetHandler()
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