Commit f9d79112 authored by mercury233's avatar mercury233

update scripts

parent 24c006ce
--百年竜
--Scripted by mallu11
function c100200182.initial_effect(c)
--lv/atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200182,0))
e1:SetCategory(CATEGORY_LVCHANGE+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c100200182.lvtg)
e1:SetOperation(c100200182.lvop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100200182,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100200182)
e2:SetTarget(c100200182.indtg)
e2:SetOperation(c100200182.indop)
c:RegisterEffect(e2)
end
function c100200182.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)>0 end
end
function c100200182.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lv=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
if c:IsFaceup() and c:IsRelateToEffect(e) and lv>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(lv*100)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
function c100200182.indfilter(c)
return c:IsFaceup() and c:GetSummonLocation()==LOCATION_EXTRA
end
function c100200182.indtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100200182.indfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100200182.indfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100200182.indfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100200182.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200182,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_NO_TURN_RESET)
e1:SetRange(LOCATION_ONFIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetCountLimit(1)
e1:SetValue(c100200182.indct)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function c100200182.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
return 1
else
return 0
end
end
--ペンギン魚雷
--Scripted by mallu11
function c100266004.initial_effect(c)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
--control
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100266004,0))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCountLimit(1,100266004)
e2:SetCondition(c100266004.ctrcon)
e2:SetTarget(c100266004.ctrtg)
e2:SetOperation(c100266004.ctrop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100266004,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetCondition(c100266004.descon)
e3:SetTarget(c100266004.destg)
e3:SetOperation(c100266004.desop)
c:RegisterEffect(e3)
end
function c100266004.ctrcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c100266004.ctrfilter(c)
return c:IsFaceup() and c:IsLevelBelow(6) and c:IsControlerCanBeChanged()
end
function c100266004.ctrtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c100266004.ctrfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100266004.ctrfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c100266004.ctrfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c100266004.ctrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetControl(tc,tp,PHASE_END,1)~=0 then
if tc:IsFaceup() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
function c100266004.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler() and e:GetHandler():IsRelateToBattle()
end
function c100266004.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c100266004.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() then
Duel.Destroy(c,REASON_EFFECT)
end
end
--ヌメロン・ウォール
--Scripted by mallu11
function c100266020.initial_effect(c)
--activate card
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100266020,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,100266020)
e1:SetCondition(c100266020.actcon)
e1:SetCost(c100266020.actcost)
e1:SetTarget(c100266020.acttg)
e1:SetOperation(c100266020.actop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100266020,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c100266020.spcon)
e2:SetTarget(c100266020.sptg)
e2:SetOperation(c100266020.spop)
c:RegisterEffect(e2)
end
function c100266020.confilter(c)
return c:IsFaceup() and c:IsCode(100266020)
end
function c100266020.actcon(e,tp,eg,ep,ev,re,r,rp)
local ct1=Duel.GetMatchingGroupCount(c100266020.confilter,tp,LOCATION_ONFIELD,0,nil)
local ct2=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
return ct1==ct2
end
function c100266020.actcost(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 c100266020.actfilter(c,tp)
return c:IsCode(100266026) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function c100266020.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100266020.actfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,tp) end
if not Duel.CheckPhaseActivity() then e:SetLabel(1) else e:SetLabel(0) end
end
function c100266020.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
if e:GetLabel()==1 then Duel.RegisterFlagEffect(tp,15248873,RESET_CHAIN,0,1) end
local g=Duel.SelectMatchingCard(tp,c100266020.actfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tp)
Duel.ResetFlagEffect(tp,15248873)
local tc=g:GetFirst()
if tc then
local te=tc:GetActivateEffect()
if e:GetLabel()==1 then Duel.RegisterFlagEffect(tp,15248873,RESET_CHAIN,0,1) end
Duel.ResetFlagEffect(tp,15248873)
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
function c100266020.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE)~=0
end
function c100266020.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 c100266020.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,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c100266020.skipop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
end
function c100266020.skipop(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(Duel.GetTurnPlayer(),PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
end
--CNo.1 ゲート・オブ・カオス・ヌメロン-シニューニャ
--Scripted by mallu11
function c100266021.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,2,4,c100266021.ovfilter,aux.Stringid(100266021,0))
c:EnableReviveLimit()
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100266021,1))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c100266021.rmcon)
e1:SetTarget(c100266021.rmtg)
e1:SetOperation(c100266021.rmop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_REMOVE)
e2:SetOperation(c100266021.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100266021,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1)
e3:SetCondition(c100266021.spcon)
e3:SetTarget(c100266021.sptg)
e3:SetOperation(c100266021.spop)
c:RegisterEffect(e3)
end
c100266021.xyz_number=1
function c100266021.ovfilter(c)
return c:IsFaceup() and c:IsCode(100266022)
end
function c100266021.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c100266021.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c100266021.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c100266021.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
c:RegisterFlagEffect(100266021,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
c:RegisterFlagEffect(100266021,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
else
c:RegisterFlagEffect(100266021,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end
function c100266021.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and e:GetHandler():GetFlagEffect(100266021)==1
end
function c100266021.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 c100266021.damfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetAttack()>0
end
function c100266021.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.IsEnvironment(100266026,tp,LOCATION_FZONE)
and Duel.IsExistingMatchingCard(c100266021.damfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(c100266021.damfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
local dam=g:GetSum(Card.GetAttack)
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end
--No.1 ゲート・オブ・ヌメロン-エーカム
--Number 1: Numeron Gate Ekam
--Scripted by TOP
function c100266022.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,1,3)
c:EnableReviveLimit()
--battle indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100266022,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCost(c100266022.atkcost)
e2:SetCondition(c100266022.atkcon)
e2:SetTarget(c100266022.atktg)
e2:SetOperation(c100266022.atkop)
c:RegisterEffect(e2)
end
c100266022.xyz_number=1
function c100266022.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 c100266022.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsControler(1-tp)
end
function c100266022.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x24a)
end
function c100266022.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100266022.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c100266022.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100266022.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--No.2 ゲート・オブ・ヌメロン-ドゥヴェー
--Number 2: Numeron Gate Dve
--Scripted by TOP
function c100266023.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,1,3)
c:EnableReviveLimit()
--battle indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100266023,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCost(c100266023.atkcost)
e2:SetCondition(c100266023.atkcon)
e2:SetTarget(c100266023.atktg)
e2:SetOperation(c100266023.atkop)
c:RegisterEffect(e2)
end
c100266023.xyz_number=2
function c100266023.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 c100266023.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsControler(1-tp)
end
function c100266023.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x24a)
end
function c100266023.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100266023.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c100266023.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100266023.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--No.3 ゲート・オブ・ヌメロン-トゥリーニ
--Number 3: Numeron Gate Trini
--Scripted by TOP
function c100266024.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,1,3)
c:EnableReviveLimit()
--battle indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100266024,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCost(c100266024.atkcost)
e2:SetCondition(c100266024.atkcon)
e2:SetTarget(c100266024.atktg)
e2:SetOperation(c100266024.atkop)
c:RegisterEffect(e2)
end
c100266024.xyz_number=3
function c100266024.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 c100266024.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsControler(1-tp)
end
function c100266024.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x24a)
end
function c100266024.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100266024.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c100266024.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100266024.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--No.4 ゲート・オブ・ヌメロン-チャトゥヴァーリ
--Number 4: Numeron Gate Catvari
--Scripted by TOP
function c100266025.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,1,3)
c:EnableReviveLimit()
--battle indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100266025,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetCost(c100266025.atkcost)
e2:SetCondition(c100266025.atkcon)
e2:SetTarget(c100266025.atktg)
e2:SetOperation(c100266025.atkop)
c:RegisterEffect(e2)
end
c100266025.xyz_number=4
function c100266025.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 c100266025.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsControler(1-tp)
end
function c100266025.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x24a)
end
function c100266025.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100266025.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c100266025.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100266025.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--ヌメロン・ネットワーク
--Scripted by mallu11
function c100266026.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--copy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100266026,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1,100266026)
e1:SetCost(c100266026.cpcost)
e1:SetTarget(c100266026.cptg)
e1:SetOperation(c100266026.cpop)
c:RegisterEffect(e1)
--remove overlay replace
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100266026,1))
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_OVERLAY_REMOVE_REPLACE)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(c100266026.rcon)
e2:SetOperation(c100266026.rop)
c:RegisterEffect(e2)
end
function c100266026.cpfilter(c)
return c:GetType()==TYPE_SPELL and c:IsSetCard(0x24a) and c:IsAbleToGraveAsCost()
and c:CheckActivateEffect(false,true,false)~=nil
end
function c100266026.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c100266026.cptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c100266026.cpfilter,tp,LOCATION_DECK,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100266026.cpfilter,tp,LOCATION_DECK,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.SendtoGrave(g,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function c100266026.cpop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if te then
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
function c100266026.rcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ) and re:GetHandler():IsSetCard(0x24a)
and ep==e:GetOwnerPlayer()
end
function c100266026.rop(e,tp,eg,ep,ev,re,r,rp)
return ev
end
--ヌメロン・ダイレクト
--Scripted by mallu11
function c100266027.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:SetCondition(c100266027.condition)
e1:SetTarget(c100266027.target)
e1:SetOperation(c100266027.activate)
c:RegisterEffect(e1)
end
function c100266027.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(100266026,tp,LOCATION_FZONE) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c100266027.spfilter(c,e,tp)
return c:IsSetCard(0x124a) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c100266027.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100266027.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100266027.exfilter1(c)
return c:IsFacedown() and c:IsType(TYPE_XYZ)
end
function c100266027.exfilter2(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM)
end
function c100266027.fselect(g,ft1,ft2,ect,ft)
return aux.dncheck(g) and #g<=ft and #g<=ect
and g:FilterCount(c100266027.exfilter1,nil)<=ft1
and g:FilterCount(c100266027.exfilter2,nil)<=ft2
end
function c100266027.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft1=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_XYZ)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
local ft=Duel.GetUsableMZoneCount(tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
if ft>0 then ft=1 end
end
local ect=(c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]) or ft
if ect>0 and (ft1>0 or ft2>0) then
local sg=Duel.GetMatchingGroup(c100266027.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local rg=sg:SelectSubGroup(tp,c100266027.fselect,false,1,4,ft1,ft2,ect,ft)
if rg:GetCount()>0 then
local fid=c:GetFieldID()
local tc=rg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(100266027,RESET_EVENT+RESETS_STANDARD,0,1,fid)
tc=rg:GetNext()
end
Duel.SpecialSummonComplete()
rg:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(rg)
e1:SetCondition(c100266027.rmcon)
e1:SetOperation(c100266027.rmop)
Duel.RegisterEffect(e1,tp)
end
end
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetTargetRange(1,0)
e2:SetTarget(c100266027.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetOperation(c100266027.checkop)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e5,tp)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_SPSUMMON_COUNT_LIMIT)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetTargetRange(1,0)
e6:SetValue(1)
e6:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e6,tp)
end
function c100266027.rmfilter(c,fid)
return c:GetFlagEffectLabel(100266027)==fid
end
function c100266027.rmcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(c100266027.rmfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function c100266027.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c100266027.rmfilter,nil,e:GetLabel())
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
function c100266027.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return Duel.GetFlagEffect(sump,100266027)>0
end
function c100266027.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(Card.GetSummonPlayer,1,nil,tp) then
Duel.RegisterFlagEffect(tp,100266027,RESET_PHASE+PHASE_END,0,1)
end
end
--時の魔導士
--Scripted by mallu11
function c100267001.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,71625222,aux.FilterBoolFunction(Card.IsFusionType,TYPE_EFFECT),1,true,true)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100267001,0))
e1:SetCategory(CATEGORY_COIN+CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c100267001.descon)
e1:SetTarget(c100267001.destg)
e1:SetOperation(c100267001.desop)
c:RegisterEffect(e1)
end
c100267001.toss_coin=true
function c100267001.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c100267001.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c100267001.damfilter(c)
if c:IsPreviousPosition(POS_FACEUP) then
return math.max(c:GetTextAttack(),0)
else
return 0
end
end
function c100267001.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COIN)
local coin=Duel.AnnounceCoin(tp)
local res=Duel.TossCoin(tp,1)
if coin~=res then
damp=1-tp
else
damp=tp
end
if Duel.Destroy(g,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
local atk=math.ceil((og:GetSum(c100267001.damfilter))/2)
Duel.Damage(damp,atk,REASON_EFFECT)
end
end
end
--ハーピィ・レディ・SC
--Scripted by mallu11
function c100267002.initial_effect(c)
--synchro summon
c:EnableReviveLimit()
aux.AddSynchroMixProcedure(c,c100267002.matfilter1,nil,nil,aux.NonTuner(nil),1,99)
--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(76812113)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100267002,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100267002)
e2:SetCondition(c100267002.thcon)
e2:SetTarget(c100267002.thtg)
e2:SetOperation(c100267002.thop)
c:RegisterEffect(e2)
end
function c100267002.matfilter1(c)
return c:IsSynchroType(TYPE_TUNER) or c:IsSetCard(0x64)
end
function c100267002.thcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c100267002.thfilter(c,tp)
return (c:IsControler(1-tp) or (c:IsFaceup() and c:IsSetCard(0x64))) and c:IsAbleToHand()
end
function c100267002.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100267002.thfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c100267002.thfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c100267002.thfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100267002.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
--人造人間-サイコ・レイヤー
--Scripted by mallu11
function c100267003.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2)
c:EnableReviveLimit()
--control
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100267003,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100267003)
e1:SetCost(c100267003.ctrcost)
e1:SetTarget(c100267003.ctrtg)
e1:SetOperation(c100267003.ctrop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100267003,1))
e2:SetCategory(CATEGORY_RELEASE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100267103)
e2:SetCondition(c100267003.descon)
e2:SetTarget(c100267003.destg)
e2:SetOperation(c100267003.desop)
c:RegisterEffect(e2)
end
function c100267003.ctrcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c100267003.ctrfilter(c)
return c:IsFaceup() and c:IsControlerCanBeChanged()
end
function c100267003.ctrtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c100267003.ctrfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100267003.ctrfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,c100267003.ctrfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c100267003.ctrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetControl(tc,tp,PHASE_END,1)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c100267003.confilter(c)
return c:IsFaceup() and c:IsType(TYPE_TRAP)
end
function c100267003.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100267003.confilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c100267003.rlfilter(c,tp)
return c:IsReleasableByEffect() and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c100267003.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100267003.rlfilter,1,nil,tp) end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100267003.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100267003.rlfilter,1,1,nil,tp)
if g:GetCount()==0 then
g=Duel.SelectReleaseGroup(tp,Card.IsReleasableByEffect,1,1,nil)
end
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.Release(g,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if dg:GetCount()>0 then
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
end
...@@ -29,7 +29,7 @@ function c100424003.initial_effect(c) ...@@ -29,7 +29,7 @@ function c100424003.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--to hand --to hand
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100424003,0)) e3:SetDescription(aux.Stringid(100424003,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
......
...@@ -52,17 +52,24 @@ function c100424007.atkcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,17 +52,24 @@ function c100424007.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end end
function c100424007.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) function c100424007.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>100 end e:SetLabel(100,0)
local c=e:GetHandler()
if chk==0 then return Duel.GetLP(tp)>100 and c:GetFlagEffect(100424107)==0 end
local lp=Duel.GetLP(tp) local lp=Duel.GetLP(tp)
e:SetLabel(lp-100) e:SetLabel(100,lp-100)
Duel.PayLPCost(tp,lp-100) Duel.PayLPCost(tp,lp-100)
c:RegisterFlagEffect(100424007,RESET_CHAIN,0,1)
end end
function c100424007.atkfilter(c) function c100424007.atkfilter(c)
return c:IsFaceup() and c:IsCode(10000010) and c:IsSummonType(SUMMON_TYPE_SPECIAL) return c:IsFaceup() and c:IsCode(10000010) and c:IsSummonType(SUMMON_TYPE_SPECIAL)
end end
function c100424007.atktg(e,tp,eg,ep,ev,re,r,rp,chk) function c100424007.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424007.atkfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetFlagEffect(tp,100424007)==0 end local label,atk=e:GetLabel()
Duel.RegisterFlagEffect(tp,100424007,RESET_CHAIN,0,1) if chk==0 then
e:SetLabel(0,atk)
if label~=100 then return false end
return Duel.IsExistingMatchingCard(c100424007.atkfilter,tp,LOCATION_MZONE,0,1,nil)
end
end end
function c100424007.atkop(e,tp,eg,ep,ev,re,r,rp) function c100424007.atkop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
...@@ -70,12 +77,13 @@ function c100424007.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,12 +77,13 @@ function c100424007.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.HintSelection(g) Duel.HintSelection(g)
local label,atk=e:GetLabel()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel()) e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
...@@ -88,23 +96,24 @@ function c100424007.recfilter(c) ...@@ -88,23 +96,24 @@ function c100424007.recfilter(c)
end end
function c100424007.reccost(e,tp,eg,ep,ev,re,r,rp,chk) function c100424007.reccost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100,0) e:SetLabel(100,0)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100424007.recfilter,1,nil) end local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroup(tp,c100424007.recfilter,1,nil) and c:GetFlagEffect(100424007)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100424007.recfilter,1,1,nil) local g=Duel.SelectReleaseGroup(tp,c100424007.recfilter,1,1,nil)
e:SetLabel(100,g:GetFirst():GetAttack()) e:SetLabel(100,g:GetFirst():GetAttack())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
c:RegisterFlagEffect(100424107,RESET_CHAIN,0,1)
end end
function c100424007.rectg(e,tp,eg,ep,ev,re,r,rp,chk) function c100424007.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
local label,rec=e:GetLabel() local label,rec=e:GetLabel()
if chk==0 then if chk==0 then
e:SetLabel(0,0) e:SetLabel(0,0)
if label~=100 then return false end if label~=100 then return false end
return Duel.GetFlagEffect(tp,100424007)==0 return true
end end
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(rec) Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
Duel.RegisterFlagEffect(tp,100424007,RESET_CHAIN,0,1)
end end
function c100424007.recop(e,tp,eg,ep,ev,re,r,rp) function c100424007.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
......
--機皇神龍トリスケリア
--Meklord Astro Dragon Triskelia
--by Sk00ps
function c100424016.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c100424016.spcon)
e2:SetOperation(c100424016.spop)
c:RegisterEffect(e2)
--equip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100424016,0))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetCountLimit(1)
e3:SetTarget(c100424016.eqtg)
e3:SetOperation(c100424016.eqop)
c:RegisterEffect(e3)
--attack thrice
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c100424016.pcon)
e4:SetValue(2)
c:RegisterEffect(e4)
end
function c100424016.spfilter(c)
return c:IsSetCard(0x13) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c100424016.spcon(e,c)
if c==nil then return true end
if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)<=0 then return false end
local g=Duel.GetMatchingGroup(c100424016.spfilter,c:GetControler(),LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
return ct>=3
end
function c100424016.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c100424016.spfilter,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
aux.GCheckAdditional=aux.dncheck
local rg=g:SelectSubGroup(tp,aux.TRUE,false,3,3)
aux.GCheckAdditional=nil
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c100424016.eqfilter(c,tp)
return not c:IsForbidden() and c:CheckUniqueOnField(tp,LOCATION_SZONE)
end
function c100424016.filter(c,tp)
return c:IsFacedown() or c100424016.eqfilter(c,tp)
end
function c100424016.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and g:GetCount()>0
and g:IsExists(c100424016.filter,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,1-tp,LOCATION_EXTRA)
end
function c100424016.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local sg=g:FilterSelect(tp,c100424016.eqfilter,1,1,nil,tp)
local tc=sg:GetFirst()
if tc then
if Duel.Equip(tp,tc,c) then
local atk=tc:GetTextAttack()
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c100424016.eqlimit)
tc:RegisterEffect(e1)
if atk>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(atk)
tc:RegisterEffect(e2)
end
end
end
Duel.ShuffleExtra(1-tp)
end
function c100424016.eqlimit(e,c)
return e:GetOwner()==c
end
function c100424016.xatkfilter(c)
return c:IsFaceup() and c:GetOriginalType()&TYPE_SYNCHRO~=0
end
function c100424016.pcon(e)
return e:GetHandler():GetEquipGroup():IsExists(c100424016.xatkfilter,1,nil)
end
--機皇枢インフィニティ・コア
--
--Script by JoyJ
function c100424018.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424018,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100424018)
e1:SetTarget(c100424018.thtg)
e1:SetOperation(c100424018.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e3:SetCountLimit(1)
e3:SetValue(c100424018.valcon)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100424018,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROYED)
e4:SetCountLimit(1,100424018+100)
e4:SetCondition(c100424018.spcon2)
e4:SetTarget(c100424018.sptg2)
e4:SetOperation(c100424018.spop2)
c:RegisterEffect(e4)
end
function c100424018.thfilter(c)
return c:IsSetCard(0x13) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100424018.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100424018.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100424018.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100424018.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c100424018.valcon(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
function c100424018.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c100424018.filter(c,att)
return c:IsFaceup() and c:IsAttribute(att)
end
function c100424018.spfilter(c,e,tp)
return c:IsSetCard(0x3013) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and not Duel.IsExistingMatchingCard(c100424018.filter,tp,LOCATION_MZONE,0,1,nil,c:GetAttribute())
end
function c100424018.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100424018.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c100424018.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100424018.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
local c=e:GetHandler()
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(c100424018.atkcon)
e2:SetTarget(c100424018.atktg)
Duel.RegisterEffect(e2,tp)
--check
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetOperation(c100424018.checkop)
e3:SetLabelObject(e2)
Duel.RegisterEffect(e3,tp)
end
function c100424018.atkcon(e)
return e:GetLabel()~=0
end
function c100424018.atktg(e,c)
return c:GetFieldID()~=e:GetLabel()
end
function c100424018.checkop(e,tp,eg,ep,ev,re,r,rp)
local fid=eg:GetFirst():GetFieldID()
e:GetLabelObject():SetLabel(fid)
end
--機皇兵廠オブリガード
--
--Script by JoyJ
function c100424019.initial_effect(c)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424019,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,100424019)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c100424019.sptg)
e1:SetOperation(c100424019.spop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424019,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100424019+100)
e2:SetOperation(c100424019.regop)
c:RegisterEffect(e2)
end
function c100424019.spfilter(c,e,tp)
return c:IsSetCard(0x6013) and not c:IsCode(100424019) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100424019.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>1
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingMatchingCard(c100424019.spfilter,tp,LOCATION_DECK,0,2,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c100424019.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and not Duel.IsPlayerAffectedByEffect(tp,59822133) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100424019.spfilter,tp,LOCATION_DECK,0,2,2,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100424019.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100424019.splimit(e,c)
return not c:IsRace(RACE_MACHINE)
end
function c100424019.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(c100424019.damop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100424019.damfilter(c)
return c:IsSetCard(0x13) and c:IsFaceup()
end
function c100424019.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,100424019)
local ct=Duel.GetMatchingGroupCount(c100424019.damfilter,tp,LOCATION_MZONE,0,nil)
Duel.Damage(1-tp,ct*100,REASON_EFFECT)
end
--機皇創出
--
--Script by JoyJ
function c100424020.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,100424020+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c100424020.activate)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424020,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,100424020+100)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(c100424020.descost)
e2:SetTarget(c100424020.destg)
e2:SetOperation(c100424020.desop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100424020,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,100424020+200)
e3:SetCondition(c100424020.descon2)
e3:SetTarget(c100424020.destg2)
e3:SetOperation(c100424020.desop)
c:RegisterEffect(e3)
end
function c100424020.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x13) and c:IsAbleToHand()
end
function c100424020.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c100424020.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(100424020,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c100424020.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c100424020.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100424020.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c100424020.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousSetCard(0x13) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c100424020.descon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100424020.cfilter,1,nil,tp)
end
function c100424020.desfilter2(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsFaceup()
end
function c100424020.destg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() and c100424020.desfilter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100424020.desfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c100424020.desfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
--機皇統制
--Scripted by mallu11
function c100424021.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424021,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,100424021+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(aux.dscon)
e1:SetTarget(c100424021.target)
e1:SetOperation(c100424021.activate)
c:RegisterEffect(e1)
--Destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(c100424021.reptg)
e2:SetValue(c100424021.repval)
c:RegisterEffect(e2)
end
function c100424021.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x13)
end
function c100424021.filter(c,atk)
return c100424021.atkfilter(c) and not c:IsAttack(atk)
end
function c100424021.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c100424021.atkfilter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()<=0 then return false end
local atk=g:GetSum(Card.GetBaseAttack)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100424021.filter(chkc,atk) end
if chk==0 then return Duel.IsExistingTarget(c100424021.filter,tp,LOCATION_MZONE,0,1,nil,atk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100424021.filter,tp,LOCATION_MZONE,0,1,1,nil,atk)
end
function c100424021.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc:IsFaceup() then
local atk=0
local g=Duel.GetMatchingGroup(c100424021.atkfilter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()>0 then atk=g:GetSum(Card.GetBaseAttack) end
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
--damage 0
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e2:SetCondition(c100424021.damcon)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetOwnerPlayer(tp)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetCondition(c100424021.damcon2)
e3:SetValue(1)
tc:RegisterEffect(e3,true)
end
end
function c100424021.damcon(e)
return e:GetHandlerPlayer()==e:GetOwnerPlayer()
end
function c100424021.damcon2(e)
return 1-e:GetHandlerPlayer()==e:GetOwnerPlayer()
end
function c100424021.repfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsFaceup() and c:IsSetCard(0x13)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c100424021.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c100424021.repfilter,1,nil,tp) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
return true
else return false end
end
function c100424021.repval(e,c)
return c100424021.repfilter(c,e:GetHandlerPlayer())
end
--根絶の機皇神
--Scripted by mallu11
function c100424022.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100424022,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,100424022)
e1:SetTarget(c100424022.target)
e1:SetOperation(c100424022.activate)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100424022,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,100424122)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c100424022.descon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100424022.destg)
e2:SetOperation(c100424022.desop)
c:RegisterEffect(e2)
end
function c100424022.filter(c,e,tp)
return c:IsSetCard(0x13) and c:IsType(TYPE_MONSTER) and c:IsCanBeEffectTarget(e)
and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,true,false))
end
function c100424022.fselect(g,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct1=g:FilterCount(Card.IsAbleToHand,nil)
local ct2=g:FilterCount(Card.IsCanBeSpecialSummoned,nil,e,0,tp,true,false)
return (ct1==#g or ct2==#g and ct2<=ft and not Duel.IsPlayerAffectedByEffect(tp,59822133)) and aux.dncheck(g)
end
function c100424022.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c100424022.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chkc then return false end
if chk==0 then return g:CheckSubGroup(c100424022.fselect,3,3,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tg=g:SelectSubGroup(tp,c100424022.fselect,false,3,3,e,tp)
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,0,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,0,0,0)
end
function c100424022.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local b1=tg:IsExists(Card.IsAbleToHand,1,nil)
local b2=tg:IsExists(Card.IsCanBeSpecialSummoned,1,nil,e,0,tp,true,false) and ft>0
local opt=0
if b1 and not b2 then
opt=Duel.SelectOption(tp,1190)
elseif not b1 and b2 then
opt=Duel.SelectOption(tp,1152)+1
elseif b1 and b2 then
opt=Duel.SelectOption(tp,1190,1152)
end
if opt==0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
else
local sg=tg:Filter(Card.IsCanBeSpecialSummoned,nil,e,0,tp,true,false)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if sg:GetCount()<=ft then
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local pg=sg:Select(tp,ft,ft,nil)
Duel.SpecialSummon(pg,0,tp,tp,true,false,POS_FACEUP)
sg:Sub(pg)
Duel.SendtoGrave(sg,REASON_RULE)
end
end
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100424022.splimit)
if Duel.GetTurnPlayer()==tp then
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e1,tp)
end
end
function c100424022.splimit(e,c)
return not c:IsRace(RACE_MACHINE)
end
function c100424022.confilter(c)
return c:IsFaceup() and c:IsSetCard(0x5013)
end
function c100424022.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100424022.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100424022.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO)
end
function c100424022.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100424022.desfilter,tp,0,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c100424022.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c100424022.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.HintSelection(g)
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
local atk=tc:GetTextAttack()
if atk>0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
end
...@@ -20,7 +20,7 @@ function c101012087.initial_effect(c) ...@@ -20,7 +20,7 @@ function c101012087.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--negate --negate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(27346636,0)) e2:SetDescription(aux.Stringid(101012087,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
......
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