Commit 5db07a11 authored by mercury233's avatar mercury233 Committed by GitHub

fix ブービートラップE

parent e320c9d5
......@@ -5,6 +5,7 @@ function c24425055.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c24425055.cost)
e1:SetTarget(c24425055.target)
e1:SetOperation(c24425055.activate)
c:RegisterEffect(e1)
end
......@@ -19,6 +20,14 @@ function c24425055.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24425055.filter1,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.DiscardHand(tp,c24425055.filter1,1,1,REASON_COST+REASON_DISCARD,nil,tp)
end
function c24425055.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ct=ct-1 end
return ct>0 and (e:IsCostChecked()
or Duel.IsExistingMatchingCard(c24425055.filter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil))
end
end
function c24425055.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c24425055.filter2),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil)
......
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