Commit 5513c309 authored by Tachibana's avatar Tachibana

得得得得得

parent 6503c787
Pipeline #12734 passed with stages
in 30 minutes and 50 seconds
--高达试作3号机石斛兰 --高达试作3号机石斛兰
function c47530109.initial_effect(c) function c47530109.initial_effect(c)
--link summon --link summon
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,c47530109.lfilter,2,2,c47530109.lcheck) aux.AddLinkProcedure(c,c47530109.lfilter,2,2,c47530109.lcheck)
--spsummon condition --spsummon condition
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.linklimit) e0:SetValue(aux.linklimit)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--I FIELD --I FIELD
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetValue(c47530109.efilter) e1:SetValue(c47530109.efilter)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Missile Container --Missile Container
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47530109,0)) e2:SetDescription(aux.Stringid(47530109,0))
e2:SetCategory(CATEGORY_TOKEN+CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_TOKEN+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetTarget(c47530109.mctg) e2:SetTarget(c47530109.mctg)
e2:SetOperation(c47530109.mcop) e2:SetOperation(c47530109.mcop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--Purge --Purge
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetTarget(c47530109.sptg) e3:SetTarget(c47530109.sptg)
e3:SetOperation(c47530109.spop) e3:SetOperation(c47530109.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--Mega Beam Cannon --Mega Beam Cannon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(47530109,3)) e4:SetDescription(aux.Stringid(47530109,3))
e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN) e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1) e4:SetCountLimit(1)
e4:SetCondition(c47530109.mbccon) e4:SetCondition(c47530109.mbccon)
e4:SetTarget(c47530109.mbccon) e4:SetTarget(c47530109.mbccon)
e4:SetOperation(c47530109.mbcop) e4:SetOperation(c47530109.mbcop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c47530109.lfilter(c) function c47530109.lfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_LINK) return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_LINK)
end end
function c47530109.lcheck(g) function c47530109.lcheck(g)
local ec=g:GetFirst() local ec=g:GetFirst()
local lm=0 local lm=0
while ec do while ec do
if ec:IsLinkMarker(LINK_MARKER_TOP) then lm=lm+0x002 end if ec:IsLinkMarker(LINK_MARKER_TOP) then lm=lm+0x002 end
if ec:IsLinkMarker(LINK_MARKER_LEFT) then lm=lm+0x008 end if ec:IsLinkMarker(LINK_MARKER_LEFT) then lm=lm+0x008 end
if ec:IsLinkMarker(LINK_MARKER_RIGHT) then lm=lm+0x020 end if ec:IsLinkMarker(LINK_MARKER_RIGHT) then lm=lm+0x020 end
if ec:IsLinkMarker(LINK_MARKER_BOTTOM_LEFT) then lm=lm+0x040 end if ec:IsLinkMarker(LINK_MARKER_BOTTOM_LEFT) then lm=lm+0x040 end
if ec:IsLinkMarker(LINK_MARKER_BOTTOM) then lm=lm+0x080 end if ec:IsLinkMarker(LINK_MARKER_BOTTOM) then lm=lm+0x080 end
if ec:IsLinkMarker(LINK_MARKER_BOTTOM_RIGHT) then lm=lm+0x100 end if ec:IsLinkMarker(LINK_MARKER_BOTTOM_RIGHT) then lm=lm+0x100 end
ec=g:GetNext() ec=g:GetNext()
end end
return lm==0x1ea return lm==0x1ea
end end
function c47530109.efilter(e,te) function c47530109.efilter(e,te)
return not te:GetOwner():IsRace(RACE_MACHINE) return not te:GetOwner():IsRace(RACE_MACHINE)
end end
function c47530109.mctg(e,tp,eg,ep,ev,re,r,rp,chk) function c47530109.mctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,47530110,0,0x4011,0,0,2,RACE_MACHINE,ATTRIBUTE_EARTH) end and Duel.IsPlayerCanSpecialSummonMonster(tp,47530110,0,0x4011,0,0,2,RACE_MACHINE,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end end
function c47530109.mcop(e,tp,eg,ep,ev,re,r,rp) function c47530109.mcop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>1 if Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsPlayerCanSpecialSummonMonster(tp,47530110,0,0x4011,2000,2000,2,RACE_MACHINE,ATTRIBUTE_EARTH) then and Duel.IsPlayerCanSpecialSummonMonster(tp,47530110,0,0x4011,2000,2000,2,RACE_MACHINE,ATTRIBUTE_EARTH) then
for i=1,2 do for i=1,2 do
local token=Duel.CreateToken(tp,47530110) local token=Duel.CreateToken(tp,47530110)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
end --destroy
Duel.SpecialSummonComplete() local e3=Effect.CreateEffect(e:GetHandler())
end e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetTarget(c47530109.destg1)
e3:SetOperation(c47530109.desop1)
token:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
end
function c47530109.destg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD):RandomSelect(tp,2)
if g:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
Duel.SetTargetCard(g)
end
function c47530109.desop1(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=tg:Filter(Card.IsRelateToEffect,nil,e)
if #sg>0 then
Duel.Destroy(sg,REASON_EFFECT)
end
end end
function c47530109.spfilter(c,e,tp,g) function c47530109.spfilter(c,e,tp,g)
return g:IsContains(c) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false) return g:IsContains(c) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false)
end end
function c47530109.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c47530109.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local g=c:GetMaterial() local g=c:GetMaterial()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c47530109.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,g) end and Duel.IsExistingMatchingCard(c47530109.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,g) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function c47530109.spop(e,tp,eg,ep,ev,re,r,rp) function c47530109.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=c:GetMaterial() local g=c:GetMaterial()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c47530109.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,g) local sg=Duel.SelectMatchingCard(tp,c47530109.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,g)
if sg:GetCount()>0 then if sg:GetCount()>0 then
Duel.SpecialSummon(sg,SUMMON_TYPE_LINK,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(sg,SUMMON_TYPE_LINK,tp,tp,false,false,POS_FACEUP)
end end
end end
function c47530109.mbccon(e,tp,eg,ep,ev,re,r,rp) function c47530109.mbccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end end
function c47530109.mbzfilter(c,g) function c47530109.mbzfilter(c,g)
return g:IsContains(c) return g:IsContains(c)
end end
function c47530109.mbctg(e,tp,eg,ep,ev,re,r,rp,chk) function c47530109.mbctg(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=e:GetHandler():GetColumnGroup() local cg=e:GetHandler():GetColumnGroup()
local b1=Duel.IsExistingMatchingCard(c47530109.mbzfilter,tp,0,LOCATION_MZONE,1,nil,cg) local b1=Duel.IsExistingMatchingCard(c47530109.mbzfilter,tp,0,LOCATION_MZONE,1,nil,cg)
local b2=Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) local b2=Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
end end
function c47530109.desfilter(c,g) function c47530109.desfilter(c,g)
return g:IsContains(c) return g:IsContains(c)
end end
function c47530109.mbcop(e,tp,eg,ep,ev,re,r,rp) function c47530109.mbcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local cg=e:GetHandler():GetColumnGroup() local cg=e:GetHandler():GetColumnGroup()
local b1=Duel.IsExistingMatchingCard(c47530109.mbzfilter,tp,LOCATION_MZONE,0,1,nil,cg) local b1=Duel.IsExistingMatchingCard(c47530109.mbzfilter,tp,LOCATION_MZONE,0,1,nil,cg)
local b2=Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) local b2=Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil)
local op=0 local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(47530109,1),aux.Stringid(47530109,2)) if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(47530109,1),aux.Stringid(47530109,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(47530109,1)) elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(47530109,1))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(47530109,2))+1 elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(47530109,2))+1
else return end else return end
if op==0 then if op==0 then
if c:IsRelateToEffect(e) and c:IsFaceup() then if c:IsRelateToEffect(e) and c:IsFaceup() then
local g=Duel.GetMatchingGroup(c47530109.mbzfilter,tp,0,LOCATION_MZONE,nil,cg) local g=Duel.GetMatchingGroup(c47530109.mbzfilter,tp,0,LOCATION_MZONE,nil,cg)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
Duel.Damage(1-tp,3000,REASON_EFFECT) Duel.Damage(1-tp,3000,REASON_EFFECT)
end end
end end
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if g:GetCount()>0 then if g:GetCount()>0 then
local cg1=tc:GetColumnGroup() local cg1=tc:GetColumnGroup()
cg1:AddCard(tc) cg1:AddCard(tc)
local tg=Duel.GetMatchingGroup(c47530109.desfilter,tp,0,LOCATION_ONFIELD,nil,cg1) local tg=Duel.GetMatchingGroup(c47530109.desfilter,tp,0,LOCATION_ONFIELD,nil,cg1)
Duel.Destroy(tg,REASON_EFFECT) Duel.Destroy(tg,REASON_EFFECT)
end end
end end
end end
\ No newline at end of file
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