Commit 8ff42bfb authored by root's avatar root

Refresh on 2024-07-06 11:56:28

parent 09e87a36
......@@ -16,6 +16,7 @@ function s.initial_effect(c)
e1:SetCondition(s.condition)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--attack
local e2=Effect.CreateEffect(c)
......@@ -53,31 +54,42 @@ function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x3cfe) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
return c:IsSetCard(0x3cfe) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup())
end
--[[
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return ft>0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
local rt=Duel.GetMatchingGroupCount(s.spfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,nil,e,tp)
if rt>ft then rt=ft end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then rt=1 end
local ct=c:RemoveOverlayCard(tp,1,rt,REASON_COST)
--local dt=Duel.GetMatchingGroupCount(s.spfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,nil,e,tp)
local dt=Duel.GetTargetCount(s.spfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,nil,e,tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
local mt=math.min(ft,dt)
--if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
local ct=c:RemoveOverlayCard(tp,1,mt,REASON_COST)
e:SetLabel(ct)
end]]
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
e:SetLabel(100)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local dt=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,nil,e,tp)
local rg=Duel.IsPlayerAffectedByEffect(tp,59822133) and 1 or 5
local maxc=math.min(rg,ft,dt:GetCount())
if chk==0 then return maxc>0 and c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
local ct=c:RemoveOverlayCard(tp,1,maxc,REASON_COST)
e:SetLabel(ct)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetLabel()
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,ct,nil,e,tp) end
e:SetOperation(s.spop)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,0,0)
if chk==0 then return e:GetLabel()==100 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,tp,LOCATION_DECK+LOCATION_REMOVED)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if ft>0 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local ct=e:GetLabel()
if ct>ft then ct=ft end
if ft<ct or ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local dg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,ct,ct,nil,e,tp)
if dg:GetCount()>0 then
......@@ -91,6 +103,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return ep~=tp and tc:IsControler(tp) and tc:IsSetCard(0x3cfe)
......
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