Commit 876b63c2 authored by GuGu's avatar GuGu

Delete c19500043.lua

parent 993361a9
Pipeline #29171 passed with stage
in 9 seconds
--Princess Lucia·Alice Margatroid
function c19500043.initial_effect(c)
-- c:SetSPSummonOnce(19500043)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,3,5,c19500043.lcheck)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.linklimit)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetTarget(c19500043.eqtg)
e2:SetOperation(c19500043.eqop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(19500043,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCountLimit(1,19500043)
e3:SetTarget(c19500043.thtg)
e3:SetOperation(c19500043.thop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(19500043,2))
e4:SetCategory(CATEGORY_TODECK+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_DESTROYING)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCondition(aux.bdocon)
e4:SetTarget(c19500043.tdtg)
e4:SetOperation(c19500043.tdop)
c:RegisterEffect(e4)
if not c19500043.global_check then
c19500043.global_check=true
c19500043[0]=0
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_TURN_END+PHASE_END)
ge2:SetOperation(c19500043.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c19500043.clear(e,tp,eg,ep,ev,re,r,rp)
c19500043[0]=0
end
function c19500043.lcfilter1(c)
return c:IsSetCard(0x186) and c:IsRace(RACE_MACHINE)
end
function c19500043.lcheck(g,lc)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x186) and g:IsExists(c19500043.lcfilter1,1,nil)
end
function c19500043.filter(c)
return c:IsSetCard(0x186) and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c19500043.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,19500043)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c19500043.filter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE+LOCATION_DECK)
Duel.RegisterFlagEffect(tp,19500043,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c19500043.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c19500043.filter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c19500043.eqlimit)
tc:RegisterEffect(e1)
end
end
function c19500043.eqlimit(e,c)
return e:GetOwner()==c
end
function c19500043.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEquipCount()>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c19500043.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return end
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
Duel.DisableShuffleCheck()
local dest=Duel.Destroy(g,REASON_EFFECT)
if dest>0 then
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(Card.IsSetCard,nil,0x186)
if ct>0 then
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(ct*700)
c:RegisterEffect(e1)
--pierce
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
--end
-- if ct>1 then
--extra attack
-- local e3=Effect.CreateEffect(c)
-- e3:SetType(EFFECT_TYPE_SINGLE)
-- e3:SetCode(EFFECT_EXTRA_ATTACK)
-- e3:SetValue(dest)
-- c:RegisterEffect(e3)
-- end
--if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local dis=Duel.SelectMatchingCard(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,1,ct,nil)
local sg=Group.CreateGroup()
for tc in aux.Next(dis) do
--disable
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DISABLE)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_DISABLE_EFFECT)
e5:SetValue(RESET_TURN_SET)
e5:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e5)
if tc:IsType(TYPE_TRAPMONSTER) then
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e6:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e6)
end
end
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
for tc in aux.Next(dis) do
--battle damage
if tc:IsType(TYPE_MONSTER) and tc:IsFaceup() then
Duel.CalculateDamage(c,tc,true)
if c:GetAttack()>tc:GetAttack() then
Duel.Destroy(tc,REASON_BATTLE)
elseif c:GetAttack()==tc:GetAttack()then
local gr=Group.FromCards(c,tc)
Duel.Destroy(gr,REASON_BATTLE)
else
Duel.Destroy(c,REASON_BATTLE)
end
end
Duel.BreakEffect()
end
end
end
end
function c19500043.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not (c19500043[0]>0) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
c19500043[0]=c19500043[0]+1
end
function c19500043.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToDeck),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
if Duel.SendtoDeck(g,nil,1,REASON_EFFECT)~=0 then
local des=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil)
if des:GetCount()>0 then
local sg=des:RandomSelect(tp,1)
Duel.Destroy(sg,REASON_EFFECT)
end
end
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