Commit 6c1f571d authored by 八宫一月's avatar 八宫一月

add bot herder

parent a55efe45
--Bot Herder
local s,id,o=GetID()
function s.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c,tp)
return c:IsFacedown() or (c:IsFaceup() and c:GetOwner()==tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsOnField() and tc:IsFacedown() then Duel.ConfirmCards(1-tp,tc) end
if not tc:IsRelateToChain() or tc:GetOwner()==tp then
Duel.Damage(1-tp,200,REASON_EFFECT)
Duel.BreakEffect()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,ft,ft,tc)
Duel.GetControl(g,tp)
end
end
\ No newline at end of file
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