Commit 535f50b2 authored by wind2009's avatar wind2009

Fix

parent 939b633d
Pipeline #32515 passed with stages
in 2 minutes and 1 second
......@@ -49,8 +49,9 @@ function s.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function s.costfilter2(c,e,tp)
return c:IsFaceup() and c:GetOriginalLevel()>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,c,e,tp)
return c:IsFaceup() and c:GetOriginalLevel()>0 and c:IsLevelBelow(4)
and Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,c,e,tp)
end
function s.spfilter(c,tc,e,tp)
return (c:GetOriginalLevel()==tc:GetOriginalLevel()-1
......@@ -66,6 +67,7 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.IsExistingMatchingCard(s.costfilter2,tp,LOCATION_MZONE,0,1,nil,e,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter2,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.SetTargetCard(g)
......@@ -73,7 +75,6 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,tc,e,tp)
......
......@@ -10,7 +10,7 @@ function s.initial_effect(c)
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_REMOVE)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE+CATEGORY_DRAW)
e2:SetCategory(CATEGORY_DISABLE|CATEGORY_DRAW|CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(custom_code)
e2:SetRange(LOCATION_SZONE)
......@@ -64,7 +64,7 @@ function s.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and g:IsExists(Card.IsType,1,nil,TYPE_TRAP)
if chk==0 then return b1 or b2 or b3 end
local category=0
if b1 then category=category|CATEGORY_NEGATE end
if b1 then category=category|CATEGORY_DISABLE end
if b2 then category=category|CATEGORY_DRAW end
if b3 then category=category|CATEGORY_REMOVE end
e:SetCategory(category)
......@@ -138,7 +138,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_REMOVED,0,1,1,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
......@@ -20,7 +20,7 @@ function s.initial_effect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetHintTiming(0,TIMING_MAIN_END)
e3:SetCountLimit(1)
e3:SetCondition(s.rmcon)
e3:SetTarget(s.rmtg)
......@@ -50,7 +50,7 @@ function s.atkval(e,c)
return g:GetClassCount(s.GetType)*300
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
return Duel.IsMainPhase()
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) end
......
......@@ -51,7 +51,7 @@ function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then
if tc and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
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