Commit f71118e6 authored by Grajade's avatar Grajade

Update c51562804.lua

parent 0da3b2fd
Pipeline #6869 passed with stages
in 22 minutes and 55 seconds
......@@ -12,7 +12,7 @@ function c51562804.initial_effect(c)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(51562804,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
......@@ -21,13 +21,13 @@ function c51562804.initial_effect(c)
e2:SetOperation(c51562804.desop)
c:RegisterEffect(e2)
--atk up
local e1=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c51562804.atkcon)
e1:SetOperation(c51562804.atkop)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c51562804.atkcon)
e3:SetOperation(c51562804.atkop)
c:RegisterEffect(e3)
end
--ef1
function c51562804.repcon(e)
......@@ -59,11 +59,15 @@ function c51562804.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_SZONE)
end
function c51562804.desfilter(c)
return c:IsCode(51562803) and not c:IsForbidden()
end
function c51562804.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetMZoneCount(tp)>0 then
if not tc:IsRelateToEffect(e) then return end
if Duel.Destroy(tc,REASON_EFFECT)>0 then
if Duel.GetMZoneCount(tp)<1 then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_ATTACK)
else
local e1=Effect.CreateEffect(c)
......@@ -74,12 +78,13 @@ function c51562804.desop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
if Duel.SelectYesNo(tp,aux.Stringid(51562804,2)) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
if not c:IsRelateToEffect(e) then return end
if Duel.SendtoDeck(c,nil,2,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(51562804,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sc=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_DECK,0,1,1,nil,51562803):GetFirst()
local sc=Duel.SelectMatchingCard(tp,c51562804.desfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
Duel.MoveToField(sc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(sc)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......@@ -88,11 +93,10 @@ function c51562804.desop(e,tp,eg,ep,ev,re,r,rp)
sc:RegisterEffect(e1)
end
end
end
end
--ef3
function c51562804.szfilter(c)
return c:IsSetCard(0x351a) and c:GetOriginalType()==TYPE_MONSTER and c:IsFaceup()
return c:IsSetCard(0x351a) and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and c:IsFaceup()
end
function c51562804.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) and Duel.IsExistingMatchingCard(c51562804.szfilter,tp,LOCATION_SZONE,0,1,nil)
......@@ -105,6 +109,6 @@ function c51562804.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(lv*100)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
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