Commit 459d1dec authored by 聖園ミカ's avatar 聖園ミカ 🐟

Delete c16372019.lua

parent 9ad0f70a
--花信物语 春之契约
function c16372019.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,16372019)
e1:SetCost(c16372019.costoath)
e1:SetTarget(c16372019.target)
e1:SetOperation(c16372019.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,16372019)
e2:SetCost(c16372019.bfgcost)
e2:SetTarget(c16372019.pltg)
e2:SetOperation(c16372019.plop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(16372019,ACTIVITY_SPSUMMON,c16372019.counterfilter)
end
function c16372019.counterfilter(c)
return c:IsRace(RACE_PLANT)
end
function c16372019.costoath(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(16372019,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372019.splimitoath)
Duel.RegisterEffect(e1,tp)
end
function c16372019.splimitoath(e,c)
return not c:IsRace(RACE_PLANT)
end
function c16372019.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.GetCustomActivityCount(16372019,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c16372019.splimitoath)
Duel.RegisterEffect(e1,tp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c16372019.ffilter(c,e,tp)
return c:IsType(TYPE_FUSION)
and Duel.IsExistingMatchingCard(c16372019.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,c,e,tp)
end
function c16372019.spfilter(c,fc,e,tp)
return aux.IsCodeListed(fc,c:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c16372019.setfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,fc,c:GetCode())
end
function c16372019.setfilter(c,fc,code)
return aux.IsCodeListed(fc,c:GetCode()) and not c:IsForbidden() and not c:IsCode(code)
end
function c16372019.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=e:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler():IsLocation(LOCATION_HAND) and 1 or 0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>ft
and Duel.IsExistingMatchingCard(c16372019.ffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c16372019.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tc=Duel.SelectMatchingCard(tp,c16372019.ffilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c16372019.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tc,e,tp):GetFirst()
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sc2=Duel.SelectMatchingCard(tp,c16372019.setfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tc,sc:GetCode()):GetFirst()
Duel.MoveToField(sc2,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
sc2:RegisterEffect(e1)
end
end
end
function c16372019.plfilter(c)
return c:IsSetCard(0xdc1) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c16372019.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16372019.plfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE)
end
function c16372019.plop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c16372019.plfilter,tp,LOCATION_GRAVE,0,ft,ft,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCondition(c16372019.descon)
e1:SetOperation(c16372019.desop)
Duel.RegisterEffect(e1,tp)
end
function c16372019.desfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdc1)
end
function c16372019.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c16372019.desfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c16372019.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c16372019.desfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Destroy(g,REASON_EFFECT)
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