Commit 594517dc authored by mercury233's avatar mercury233

fix

parent 742d610b
...@@ -11,26 +11,34 @@ function c87990236.initial_effect(c) ...@@ -11,26 +11,34 @@ function c87990236.initial_effect(c)
e1:SetOperation(c87990236.activate) e1:SetOperation(c87990236.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c87990236.costfilter(c) function c87990236.costfilter(c,tp)
return c:IsSetCard(0xef) return c:IsSetCard(0xef) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
and c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToGraveAsCost() and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0
end end
function c87990236.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c87990236.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87990236.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end e:SetLabel(100)
if chk==0 then return Duel.IsExistingMatchingCard(c87990236.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c87990236.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c87990236.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function c87990236.filter(c) function c87990236.filter(c,check)
return c:IsControlerCanBeChanged() and c:IsFaceup() return c:IsControlerCanBeChanged(check) and c:IsFaceup()
end end
function c87990236.target(e,tp,eg,ep,ev,re,r,rp,chk) function c87990236.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87990236.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then
local check=e:GetLabel()==100
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c87990236.filter,tp,0,LOCATION_MZONE,1,nil,check)
end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,0,0)
end end
function c87990236.filter2(c)
return c:IsControlerCanBeChanged() and c:IsFaceup()
end
function c87990236.activate(e,tp,eg,ep,ev,re,r,rp) function c87990236.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectMatchingCard(tp,c87990236.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectMatchingCard(tp,c87990236.filter2,tp,0,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.GetControl(tc,tp,PHASE_END,1) Duel.GetControl(tc,tp,PHASE_END,1)
......
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