Commit 8280036b authored by nanahira's avatar nanahira

prescripts

parent 77e558c2
......@@ -47,15 +47,16 @@ function c101003016.hspval(e,c)
end
return 0,zone
end
function c101003016.spcfilter(c,tp,zone)
if c:GetPreviousControler()==tp or not zone then return false end
function c101003016.spcfilter(c,tp,mc)
if c:GetPreviousControler()==tp then return false end
local loc=LOCATION_MZONE
if c:IsPreviousLocation(LOCATION_SZONE) then loc=LOCATION_SZONE
local zone=mc:GetColumnZone(loc)
local seq=c:GetPreviousSequence()+16
return bit.extract(zone,seq)~=0
return zone and bit.extract(zone,seq)~=0
end
function c101003016.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=bit.bor(0,c:GetColumnZone(LOCATION_MZONE),c:GetColumnZone(LOCATION_SZONE))
return eg:IsExists(c101003016.spcfilter,1,nil,tp,zone)
return eg:IsExists(c101003016.spcfilter,1,nil,tp,e:GetHandler())
end
function c101003016.filter(c,e,tp)
return c:IsSetCard(0x20c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
--アーティファクト-ミョルニル
--Artifact Mjolnir
--Script by nekrozar
function c101003028.initial_effect(c)
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101003028,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c101003028.spcon1)
e2:SetTarget(c101003028.sptg1)
e2:SetOperation(c101003028.spop1)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101003028,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,101003028)
e3:SetCondition(c101003028.spcon2)
e3:SetTarget(c101003028.sptg2)
e3:SetOperation(c101003028.spop2)
c:RegisterEffect(e3)
end
function c101003028.spcon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEDOWN)
and c:IsReason(REASON_DESTROY) and Duel.GetTurnPlayer()~=tp
end
function c101003028.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101003028.spop1(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c101003028.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c101003028.spfilter(c,e,tp)
return c:IsSetCard(0x97) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101003028.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101003028.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101003028.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101003028.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101003028.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
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(c101003028.splimit)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
function c101003028.splimit(e,c)
return not c:IsSetCard(0x97)
end
--ナーゲルの守護天
--Protected Sky of Nagel
--Nagel's Protection
--Scripted by Eerie Code
function c101003054.initial_effect(c)
--activate
......@@ -47,7 +47,7 @@ function c101003054.damval(e,re,val,r,rp,rc)
local tp=e:GetHandlerPlayer()
if Duel.GetFlagEffect(tp,101003054)~=0 or bit.band(r,REASON_BATTLE)==0
or not rc:IsSetCard(0x20b) or not rc:IsControler(tp) then return val end
Duel.ResetFlagEffect(tp,101003054)
Duel.RegisterFlagEffect(tp,101003054,RESET_PHASE+PHASE_END,0,1)
return val*2
end
function c101003054.cfilter(c)
......
--サイバネット・リフレッシュ
--Cynet Refresh
--Scripted by Eerie Code
function c101003067.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c101003067.condition)
e1:SetTarget(c101003067.target)
e1:SetOperation(c101003067.activate)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c101003067.immcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101003067.immtg)
e2:SetOperation(c101003067.immop)
c:RegisterEffect(e2)
end
function c101003067.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetAttacker():IsRace(RACE_CYBERSE)
end
function c101003067.desfilter(c)
return c:GetSequence()<5
end
function c101003067.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c101003067.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c101003067.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c101003067.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
og:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(og)
e1:SetOperation(c101003067.spop)
Duel.RegisterEffect(e1,tp)
end
end
function c101003067.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_GRAVE)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,c:GetControler())
end
function c101003067.spop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject():Filter(c101003067.spfilter,nil,e,tp)
if g:GetCount()==0 then return end
for p=0,1 do
local tg=g:Filter(Card.IsControler,nil,p)
local ft=Duel.GetLocationCount(p,LOCATION_MZONE)
if tg:GetCount()>ft then
tg=tg:Select(tp,ft,ft,nil)
end
for tc in aux.Next(tg) do
Duel.SpecialSummonStep(tc,0,tp,p,false,false,POS_FACEUP)
end
end
Duel.SpecialSummonComplete()
end
function c101003067.immcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER)
end
function c101003067.immfilter(c)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK)
end
function c101003067.immtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003067.immfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c101003067.immop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c101003067.immfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101003067.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function c101003067.efilter(e,te)
return te:GetOwner()~=e:GetHandler()
end
--電送擬人エレキネシス
--Electronic Transimulation Wattkinesis
--Scripted by Eerie Code
function c101003100.initial_effect(c)
--move
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c101003100.seqcost)
e2:SetTarget(c101003100.seqtg)
e2:SetOperation(c101003100.seqop)
c:RegisterEffect(e2)
end
function c101003100.seqcost(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 c101003100.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil)
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101003100,0))
Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
end
function c101003100.seqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(tp) then return end
local seq=tc:GetSequence()
local flag=0
for i=0,4 do
if Duel.CheckLocation(1-tp,LOCATION_MZONE,i) then flag=bit.bor(flag,math.pow(2,i)) end
end
if flag==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,571)
local s=Duel.SelectDisableField(tp,1,0,LOCATION_MZONE,flag)
local nseq=math.sqrt(s)
Duel.MoveSequence(tc,nseq)
end
--見切りの極意
--Critical Timing
--Scripted by Eerie Code
function c101003101.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c101003101.condition)
e1:SetTarget(c101003101.target)
e1:SetOperation(c101003101.activate)
c:RegisterEffect(e1)
end
function c101003101.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
and Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_GRAVE,1,nil,re:GetHandler():GetCode())
and Duel.IsChainNegatable(ev)
end
function c101003101.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c101003101.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--サブテラーの導師
--Subterror Guru
--Scripted by Eerie Code
function c100200138.initial_effect(c)
function c16428514.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200138,0))
e1:SetDescription(aux.Stringid(16428514,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100200138)
e1:SetTarget(c100200138.thtg)
e1:SetOperation(c100200138.thop)
e1:SetCountLimit(1,16428514)
e1:SetTarget(c16428514.thtg)
e1:SetOperation(c16428514.thop)
c:RegisterEffect(e1)
--position
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100200138,1))
e2:SetDescription(aux.Stringid(16428514,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100200138+100)
e2:SetCondition(c100200138.setcon1)
e2:SetTarget(c100200138.settg)
e2:SetOperation(c100200138.setop)
e2:SetCountLimit(1,16428515)
e2:SetCondition(c16428514.setcon1)
e2:SetTarget(c16428514.settg)
e2:SetOperation(c16428514.setop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,0x1e0)
e3:SetCondition(c100200138.setcon2)
e3:SetCondition(c16428514.setcon2)
c:RegisterEffect(e3)
end
function c100200138.thfilter(c)
return c:IsSetCard(0xed) and not c:IsCode(100200138) and c:IsAbleToHand()
function c16428514.thfilter(c)
return c:IsSetCard(0xed) and not c:IsCode(16428514) and c:IsAbleToHand()
end
function c100200138.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100200138.thfilter,tp,LOCATION_DECK,0,1,nil) end
function c16428514.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16428514.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100200138.thop(e,tp,eg,ep,ev,re,r,rp)
function c16428514.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100200138.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c16428514.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c100200138.setcfilter(c)
function c16428514.setcfilter(c)
return c:IsFaceup() and c:IsSetCard(0xed)
end
function c100200138.setcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100200138.setcfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
function c16428514.setcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c16428514.setcfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
function c100200138.setcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100200138.setcfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
function c16428514.setcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c16428514.setcfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
function c100200138.setfilter(c)
function c16428514.setfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c100200138.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c16428514.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc~=c and c100200138.setfilter(chkc) end
if chk==0 then return c100200138.setfilter(c)
and Duel.IsExistingTarget(c100200138.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc~=c and c16428514.setfilter(chkc) end
if chk==0 then return c16428514.setfilter(c)
and Duel.IsExistingTarget(c16428514.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c100200138.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
local g=Duel.SelectTarget(tp,c16428514.setfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,2,0,0)
end
function c100200138.setop(e,tp,eg,ep,ev,re,r,rp)
function c16428514.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local g=Group.FromCards(c,tc)
local g=Group.CreateGroup()
if c:IsFaceup() and c:IsRelateToEffect(e) then g:AddCard(c) end
if tc:IsFaceup() and tc:IsRelateToEffect(e) then g:AddCard(tc) end
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
--白棘鱏
--White Stingray
--Scripted by Eerie Code
function c100200134.initial_effect(c)
function c49930315.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100200134)
e1:SetCondition(c100200134.spcon)
e1:SetOperation(c100200134.spop)
e1:SetCountLimit(1,49930315)
e1:SetCondition(c49930315.spcon)
e1:SetOperation(c49930315.spop)
c:RegisterEffect(e1)
--Tuner
--tuner
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100200134+100)
e2:SetCondition(c100200134.tncon)
e2:SetOperation(c100200134.tnop)
e2:SetCountLimit(1,49930316)
e2:SetCondition(c49930315.tncon)
e2:SetOperation(c49930315.tnop)
c:RegisterEffect(e2)
end
function c100200134.cfilter(c)
function c49930315.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER)
end
function c100200134.spcon(e,c)
function c49930315.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100200134.cfilter,c:GetControler(),LOCATION_HAND,0,1,c)
and Duel.IsExistingMatchingCard(c49930315.cfilter,c:GetControler(),LOCATION_HAND,0,1,c)
end
function c100200134.spop(e,tp,eg,ep,ev,re,r,rp,c)
function c49930315.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c100200134.cfilter,tp,LOCATION_HAND,0,1,1,c)
local g=Duel.SelectMatchingCard(tp,c49930315.cfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_DISCARD+REASON_COST)
end
function c100200134.tncon(e,tp,eg,ep,ev,re,r,rp)
function c49930315.tncon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE)
end
function c100200134.tnop(e,tp,eg,ep,ev,re,r,rp)
function c49930315.tnop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
......
--DDD超視王ゼロ・マクスウェル
--D/D/D Supersight King Zero Maxwell
--Scripted by Eerie Code
function c100200135.initial_effect(c)
function c76029419.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--defdown
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200135,0))
e1:SetDescription(aux.Stringid(76029419,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100200135)
e1:SetTarget(c100200135.deftg)
e1:SetOperation(c100200135.defop)
e1:SetCountLimit(1,76029419)
e1:SetTarget(c76029419.deftg)
e1:SetOperation(c76029419.defop)
c:RegisterEffect(e1)
--defdown
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100200135,1))
e2:SetDescription(aux.Stringid(76029419,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_CONFIRM)
e2:SetCondition(c100200135.defcon2)
e2:SetOperation(c100200135.defop2)
e2:SetCondition(c76029419.defcon2)
e2:SetOperation(c76029419.defop2)
c:RegisterEffect(e2)
--pierce
local e3=Effect.CreateEffect(c)
......@@ -34,13 +34,13 @@ function c100200135.initial_effect(c)
e4:SetValue(1)
c:RegisterEffect(e4)
end
function c100200135.deftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c76029419.deftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and aux.nzdef(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.nzdef,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.nzdef,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c100200135.defop(e,tp,eg,ep,ev,re,r,rp)
function c76029419.defop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
......@@ -48,23 +48,23 @@ function c100200135.defop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c100200135.defcon2(e,tp,eg,ep,ev,re,r,rp)
function c76029419.defcon2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttackTarget()
e:SetLabelObject(tc)
return Duel.GetAttacker()==e:GetHandler() and tc and tc:IsPosition(POS_FACEUP_DEFENSE) and tc:GetDefense()>0
end
function c100200135.defop2(e,tp,eg,ep,ev,re,r,rp)
function c76029419.defop2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:IsFaceup() and tc:IsRelateToBattle() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE)
tc:RegisterEffect(e1)
end
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