Commit 993361a9 authored by GuGu's avatar GuGu

Delete c19500038.lua

parent 7bf84be8
Pipeline #29170 passed with stage
in 21 seconds
--花开幻想·爱丽丝
function c19500038.initial_effect(c)
--synchro summon
aux.AddSynchroMixProcedure(c,nil,c19500038.mfilter,nil,aux.NonTuner(nil),1,1)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19500038,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,19500038)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c19500038.cost)
e1:SetOperation(c19500038.activate)
c:RegisterEffect(e1)
if not c19500038.global_check then
c19500038.global_check=true
c19500038[0]=0
c19500038[1]=0
--reflect damage
local ex1=Effect.CreateEffect(c)
ex1:SetType(EFFECT_TYPE_FIELD)
ex1:SetCode(EFFECT_REFLECT_DAMAGE)
ex1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ex1:SetTargetRange(1,0)
ex1:SetValue(c19500038.refcon)
Duel.RegisterEffect(ex1,0)
--negate
local ex2=Effect.CreateEffect(c)
ex2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex2:SetCode(EVENT_CHAIN_SOLVING)
ex2:SetCondition(c19500038.negcon)
ex2:SetOperation(c19500038.negop)
Duel.RegisterEffect(ex2,0)
end
end
function c19500038.refcon(e,re,val,r,rp,rc)
if c19500038[0]==0 then return end
c19500038[0]=c19500038[0]-1
return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
function c19500038.negcon(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandlerPlayer()
return rp==1-p and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and c19500038[1]>0
end
function c19500038.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,17061490)
Duel.NegateEffect(ev)
c19500038[1]=c19500038[1]-1
end
function c19500038.mfilter(c,syncard,c1)
return c:IsSetCard(0x300) and (c:IsType(TYPE_TUNER) or c1:IsType(TYPE_TUNER))
end
function c19500038.cfilter(c)
return c:IsSetCard(0x186) and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_MACHINE) and c:IsAbleToRemoveAsCost()
end
function c19500038.spfilter(c,e,tp)
return c:IsSetCard(0x186) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c19500038.thfilter(c)
return c:IsSetCard(0x186) and c:IsAbleToHand()
end
function c19500038.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19500038.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c19500038.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
local tc=g:GetFirst()
e:SetLabel(tc:GetAttribute())
end
function c19500038.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local att=e:GetLabel()
if att==ATTRIBUTE_EARTH then
local g1=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if g1:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(19500038,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg1=g1:Select(tp,1,1,nil)
Duel.HintSelection(sg1)
Duel.SendtoDeck(sg1,nil,2,REASON_EFFECT)
end
elseif att==ATTRIBUTE_WATER then
c19500038[0]=c19500038[0]+1
elseif att==ATTRIBUTE_FIRE then
c19500038[1]=c19500038[1]+1
elseif att==ATTRIBUTE_WIND then
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(700)
c:RegisterEffect(e1)
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
elseif att==ATTRIBUTE_LIGHT then
local g2=Duel.GetMatchingGroup(aux.NecroValleyFilter(c19500038.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
if g2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(19500038,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=g2:Select(tp,1,1,nil)
Duel.SpecialSummon(sg2,0,tp,tp,false,false,POS_FACEUP)
end
elseif att==ATTRIBUTE_DARK then
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c19500038.thfilter),tp,LOCATION_GRAVE,0,nil)
if tg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(19500038,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg3=tg:Select(tp,1,1,nil)
Duel.SendtoHand(sg3,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg3)
end
local tg2=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_DECK,0,nil,0x186)
if tg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(19500038,4)) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(19500038,5))
local sg4=tg2:Select(tp,1,1,nil)
local tc=sg4:GetFirst()
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
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