Commit 4134794c authored by mercury233's avatar mercury233

add Auxiliary.AtkEqualsDef

parent f69a4ce4
...@@ -49,7 +49,7 @@ function c46809548.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -49,7 +49,7 @@ function c46809548.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,c46809548.costfilter,1,1,REASON_COST+REASON_DISCARD,nil) Duel.DiscardHand(tp,c46809548.costfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end end
function c46809548.thfilter(c) function c46809548.thfilter(c)
return c:GetTextAttack()>=0 and c:GetAttack()==c:GetDefense() and not c:IsCode(46809548) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return aux.AtkEqualsDef(c) and not c:IsCode(46809548) and c:IsAbleToHand()
end end
function c46809548.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c46809548.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c46809548.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c46809548.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
...@@ -62,7 +62,7 @@ function c90361289.cfilter(c,e,tp) ...@@ -62,7 +62,7 @@ function c90361289.cfilter(c,e,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c90361289.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,c:GetAttribute()) return c:IsFaceup() and Duel.IsExistingMatchingCard(c90361289.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,c:GetAttribute())
end end
function c90361289.spfilter(c,e,tp,attr) function c90361289.spfilter(c,e,tp,attr)
return c:GetTextAttack()>=0 and c:GetTextAttack()==c:GetTextDefense() and c:IsAttribute(attr) return aux.AtkEqualsDef(c) and c:IsAttribute(attr)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c90361289.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c90361289.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -2375,6 +2375,12 @@ end ...@@ -2375,6 +2375,12 @@ end
function Auxiliary.UrsarcticSpSummonLimit(e,c) function Auxiliary.UrsarcticSpSummonLimit(e,c)
return c:IsLevel(0) return c:IsLevel(0)
end end
--shortcut for Gizmek cards
function Auxiliary.AtkEqualsDef(c)
if not c:IsType(TYPE_MONSTER) or c:IsType(TYPE_LINK) then return false end
if c:GetAttack()~=c:GetDefense() then return false end
return c:IsLocation(LOCATION_MZONE) or c:GetTextAttack()>=0 and c:GetTextDefense()>=0
end
--shortcut for self-banish costs --shortcut for self-banish costs
function Auxiliary.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk) function Auxiliary.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() 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