Skip to content

Commit a792c2d

Browse files
authored
Added new card script
1 parent f78b80a commit a792c2d

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

pre-release/c100444149.lua

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
--
2+
--Bot Herder
3+
--Scripted by Hatter
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Apply these effects in sequence
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_CONTROL)
10+
e1:SetType(EFFECT_TYPE_ACTIVATE)
11+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
12+
e1:SetCode(EVENT_FREE_CHAIN)
13+
e1:SetTarget(s.efftg)
14+
e1:SetOperation(s.effop)
15+
c:RegisterEffect(e1)
16+
end
17+
function s.efftgfilter(c,tp)
18+
return (c:IsOwner(tp) and c:IsFaceup()) or c:IsPosition(POS_FACEDOWN_DEFENSE)
19+
end
20+
function s.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
21+
if chkc then return c:IsLocation(LOCATION_MZONE) and c:IsControler(1-tp) and s.efftgfilter(chkc,tp) end
22+
if chk==0 then return Duel.IsExistingTarget(s.efftgfilter,tp,0,LOCATION_MZONE,1,nil,tp) end
23+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
24+
local tc=Duel.SelectTarget(tp,s.efftgfilter,tp,0,LOCATION_MZONE,1,1,nil,tp):GetFirst()
25+
if tc:IsFaceup() then
26+
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,200)
27+
Duel.SetOperationInfo(0,CATEGORY_CONTROL,nil,1,1-tp,LOCATION_MZONE)
28+
end
29+
Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,200)
30+
Duel.SetPossibleOperationInfo(0,CATEGORY_CONTROL,nil,1,1-tp,LOCATION_MZONE)
31+
end
32+
function s.effop(e,tp,eg,ep,ev,re,r,rp)
33+
local tc=Duel.GetFirstTarget()
34+
if tc:IsRelateToEffect(e) then
35+
if tc:IsFacedown() then Duel.ConfirmCards(tp,tc) end
36+
if tc:IsOwner(1-tp) then return end
37+
else tc=nil end
38+
--Inflict 200 damage to your opponent
39+
Duel.Damage(1-tp,200,REASON_EFFECT)
40+
--Take control of all monsters your opponent controls, except that monster
41+
local g=Duel.GetMatchingGroup(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,tc,true)
42+
if #g>0 then
43+
Duel.BreakEffect()
44+
Duel.GetControl(g,tp)
45+
end
46+
end

0 commit comments

Comments
 (0)