Commit 79835a47 authored by salix5's avatar salix5

add Auxiliary.EffectCategoryFilter

parent aa9fc5e7
...@@ -13,7 +13,7 @@ function c47292920.initial_effect(c) ...@@ -13,7 +13,7 @@ function c47292920.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c47292920.cfilter(c) function c47292920.cfilter(c)
return c:IsFaceup() and c.toss_dice return c:IsFaceup() and c:IsEffectProperty(aux.EffectCategoryFilter(CATEGORY_DICE))
end end
function c47292920.spcon(e,tp,eg,ep,ev,re,r,rp) function c47292920.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c47292920.cfilter,tp,LOCATION_ONFIELD,0,1,nil) return Duel.IsExistingMatchingCard(c47292920.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
...@@ -28,8 +28,8 @@ function c47292920.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,8 +28,8 @@ function c47292920.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c47292920.spfilter(c,e,tp) function c47292920.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_MONSTER) and c:IsEffectProperty(aux.MonsterEffectCategoryFilter(CATEGORY_DICE))
and c.toss_dice and not c.toss_dice_in_pendulum_only and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c47292920.target(e,tp,eg,ep,ev,re,r,rp,chk) function c47292920.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
......
...@@ -11,9 +11,8 @@ function c93078761.initial_effect(c) ...@@ -11,9 +11,8 @@ function c93078761.initial_effect(c)
e1:SetOperation(c93078761.activate) e1:SetOperation(c93078761.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c93078761.toss_dice=true
function c93078761.filter(c) function c93078761.filter(c)
return c.toss_dice and c:IsAbleToHand() return c:IsEffectProperty(aux.EffectCategoryFilter(CATEGORY_DICE)) and c:IsAbleToHand()
end end
function c93078761.target(e,tp,eg,ep,ev,re,r,rp,chk) function c93078761.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c93078761.filter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c93078761.filter,tp,LOCATION_DECK,0,1,nil) end
......
...@@ -1793,3 +1793,16 @@ function Auxiliary.BecomeOriginalCode(c,tc,reset) ...@@ -1793,3 +1793,16 @@ function Auxiliary.BecomeOriginalCode(c,tc,reset)
c:RegisterEffect(e1) c:RegisterEffect(e1)
return e1 return e1
end end
---@param category integer
---@return function
function Auxiliary.EffectCategoryFilter(category)
return aux.FilterBoolFunction(Effect.IsHasCategory,category)
end
---@param category integer
---@return function
function Auxiliary.MonsterEffectCategoryFilter(category)
---@param e Effect
return function (e)
return e:IsHasCategory(category) and not e:IsHasRange(LOCATION_PZONE)
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