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