Commit 2147995b authored by wind2009's avatar wind2009

Fix Bot Herder

parent 6c1f571d
No preview for this file type
...@@ -8,4 +8,6 @@ ...@@ -8,4 +8,6 @@
100243001 100243001
100246001 100246001
100246002 100246002
100247147 100247147
\ No newline at end of file 100247149
100248001
\ No newline at end of file
--Bot Herder --Bot Herder
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
-- --activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_CONTROL) e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.filter(c,tp) function s.filter(c,tp)
return c:IsFacedown() or (c:IsFaceup() and c:GetOwner()==tp) return c:IsFacedown() or (c:IsFaceup() and c:GetOwner()==tp)
...@@ -17,19 +18,21 @@ end ...@@ -17,19 +18,21 @@ end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) 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 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 if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil,tp) Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
end
function s.ctfilter(c)
return c:IsControlerCanBeChanged(true)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsOnField() and tc:IsFacedown() then Duel.ConfirmCards(1-tp,tc) end if tc and tc:IsOnField() and tc:IsFacedown() then Duel.ConfirmCards(tp,tc) end
if not tc:IsRelateToChain() or tc:GetOwner()==tp then if not tc:IsRelateToChain() or tc:GetOwner()==tp then
Duel.Damage(1-tp,200,REASON_EFFECT) Duel.Damage(1-tp,200,REASON_EFFECT)
Duel.BreakEffect() local g=Duel.GetMatchingGroup(s.ctfilter,tp,0,LOCATION_MZONE,tc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if g:GetCount()>0 then
local c=e:GetHandler() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.GetControl(g,tp)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,ft,ft,tc) end
Duel.GetControl(g,tp)
end end
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