Commit 0f193f7c authored by 聖園ミカ's avatar 聖園ミカ 🐟

Replace c64800180.lua

parent 52d9d79f
Pipeline #30725 canceled with stages
in 4 minutes and 11 seconds
...@@ -14,7 +14,7 @@ function cm.initial_effect(c) ...@@ -14,7 +14,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--to hand --to hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOGRAVE) e1:SetCategory(CATEGORY_DECKDES+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE) e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
...@@ -24,11 +24,11 @@ function cm.initial_effect(c) ...@@ -24,11 +24,11 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--equip --equip
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_EQUIP) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,m+200) e2:SetCountLimit(1,m+200)
e2:SetCost(cm.cost) e2:SetCost(cm.spcost)
e2:SetTarget(cm.target) e2:SetTarget(cm.target)
e2:SetOperation(cm.activate) e2:SetOperation(cm.activate)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -64,7 +64,7 @@ function cm.eqlimit(e,c) ...@@ -64,7 +64,7 @@ function cm.eqlimit(e,c)
return c==e:GetLabelObject() return c==e:GetLabelObject()
end end
function cm.tgfilter(c) function cm.tgfilter(c)
return c:IsSetCard(0x412) and not c:IsCode(64800180) and c:IsAbleToGrave() return c:IsSetCard(0x412) and c:IsType(TYPE_MONSTER) and not c:IsCode(64800180) and c:IsAbleToGrave()
end end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
...@@ -77,49 +77,27 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,49 +77,27 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
end end
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local ec=e:GetHandler():GetEquipTarget()
local ec = c:GetEquipTarget() if chk==0 then return ec and ec:IsReleasable() end
if chk == 0 then return ec and ec:IsReleasable() end
Duel.Release(ec,REASON_COST) Duel.Release(ec,REASON_COST)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) return c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end local ec=e:GetHandler():GetEquipTarget()
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) if chk==0 then return ec and Duel.GetMZoneCount(tp,ec)>0
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,0,0) and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local max=2
local ct = 2 if Duel.GetMZoneCount(tp)<1 then return end
if ft<=0 then return end if Duel.GetMZoneCount(tp)<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then max=1 end
if ct >= ft then ct = ft end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,max,nil,e,tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end if g:GetCount()>0 then
if g:GetCount()>=2 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(tp,1,ct,nil)
end end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
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