Commit 7bf84be8 authored by GuGu's avatar GuGu

Delete c19500037.lua

parent cab14f97
Pipeline #29169 passed with stage
in 7 seconds
--七色人形剧剧团
function c19500037.initial_effect(c)
c:SetUniqueOnField(1,0,19500037)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_DISCARD)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c19500037.acop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_RELEASE)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_DESTROYED)
c:RegisterEffect(e4)
--counter
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(19500037,0))
e5:SetCategory(CATEGORY_COUNTER)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCountLimit(1)
e5:SetTarget(c19500037.coutg)
e5:SetOperation(c19500037.couop)
c:RegisterEffect(e5)
--search
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e6:SetDescription(aux.Stringid(19500037,1))
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1,19500037)
e6:SetCost(c19500037.thcost)
e6:SetTarget(c19500037.thtg)
e6:SetOperation(c19500037.thop)
c:RegisterEffect(e6)
end
function c19500037.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x186) and c:IsRace(RACE_MACHINE)
end
function c19500037.acop(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(c19500037.cfilter,nil)
if ct>0 then
e:GetHandler():AddCounter(0x128d,ct,true)
end
end
function c19500037.coufilter(c)
return c:IsFaceup() and c:IsCanAddCounter(0x128d,1)
end
function c19500037.coutg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c19500037.coufilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c19500037.coufilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x128d)
end
function c19500037.couop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
tc:AddCounter(0x128d,1)
end
end
function c19500037.spfilter1(c,e,tp)
return c:IsSetCard(0x186) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end
function c19500037.spfilter2(c,e,tp)
return c:IsSetCard(0x300) and c:IsLevelBelow(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c19500037.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsPlayerCanDraw(tp,1) and Duel.IsCanRemoveCounter(tp,1,1,0x128d,1,REASON_COST)
local b2=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_REMOVED,LOCATION_REMOVED,3,nil) and Duel.IsCanRemoveCounter(tp,1,1,0x128d,3,REASON_COST)
local b3=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(c19500037.spfilter1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,2,nil,e,tp) and Duel.IsCanRemoveCounter(tp,1,1,0x128d,5,REASON_COST)
local b4=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
and Duel.IsExistingMatchingCard(c19500037.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.IsCanRemoveCounter(tp,1,1,0x128d,7,REASON_COST)
if chk==0 then return b1 or b2 or b3 or b4 end
local off=1
local ops={}
local opval={}
if b1 then
ops[off]=aux.Stringid(19500037,2)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(19500037,3)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(19500037,4)
opval[off-1]=3
off=off+1
end
if b4 then
ops[off]=aux.Stringid(19500037,5)
opval[off-1]=4
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
e:SetLabel(sel)
Duel.RemoveCounter(tp,1,0,0x128d,(sel*2)-1,REASON_COST)
end
function c19500037.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c19500037.thop(e,tp,eg,ep,ev,re,r,rp)
c=e:GetHandler()
local sel=e:GetLabel()
if sel==1 then
if Duel.Draw(tp,1,REASON_EFFECT)~=0 then
local g=Duel.GetOperatedGroup()
local tc=g:GetFirst()
Duel.ConfirmCards(1-tp,tc)
Duel.BreakEffect()
if tc:IsSetCard(0x186) then
local g1=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,c)
if #g1>0 and Duel.SelectYesNo(tp,aux.Stringid(19500037,8)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g1:Select(tp,1,1,c)
local disg=dg:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
disg:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
disg:RegisterEffect(e2)
if disg:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
disg:RegisterEffect(e3)
end
end
Duel.BreakEffect()
if Duel.SelectYesNo(tp,aux.Stringid(19500037,9)) then
Duel.Destroy(g,REASON_EFFECT)
end
else
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
Duel.ShuffleHand(tp)
end
elseif sel==2 then
local g2=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if #g2>2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g2:Select(tp,3,3,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
elseif sel==3 then
local g3=Duel.GetMatchingGroup(c19500037.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if g3:GetCount()>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(19500037,6))
local sg1=g3:Select(tp,1,1,nil)
local tc1=sg1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(19500037,7))
local sg2=g3:Select(tp,1,1,tc1)
local tc2=sg2:GetFirst()
Duel.SpecialSummon(tc1,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(tc2,0,tp,1-tp,false,false,POS_FACEUP)
local fid=e:GetHandler():GetFieldID()
tc1:RegisterFlagEffect(19500037,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE_START+PHASE_END)
e4:SetCountLimit(1)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetLabel(fid)
e4:SetLabelObject(tc1)
e4:SetCondition(c19500037.descon)
e4:SetOperation(c19500037.desop)
Duel.RegisterEffect(e4,tp)
local fid=e:GetHandler():GetFieldID()
tc2:RegisterFlagEffect(19500037,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e5=e4:Clone()
e5:SetLabelObject(tc2)
Duel.RegisterEffect(e5,tp)
end
else
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g4=Duel.SelectMatchingCard(tp,c19500037.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g4:GetCount()>0 then
Duel.SpecialSummon(g4,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function c19500037.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(652362)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c19500037.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
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