Skip to content

Commit 4903406

Browse files
committed
Add scripts for new versions of GOAT cards
Crimson Sentry, Cyber Jar, My Body as a Shield and Jirai Gumo
1 parent 36c5567 commit 4903406

File tree

4 files changed

+192
-0
lines changed

4 files changed

+192
-0
lines changed

goat/c504700187.lua

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
--紅蓮の女守護兵
2+
--Crimson Sentry (GOAT)
3+
--Works the same way as Last Will (GOAT)
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--to deck
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetCategory(CATEGORY_TODECK)
9+
e1:SetType(EFFECT_TYPE_IGNITION)
10+
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
11+
e1:SetRange(LOCATION_MZONE)
12+
e1:SetCost(Cost.SelfTribute)
13+
e1:SetOperation(s.operation)
14+
c:RegisterEffect(e1)
15+
end
16+
function s.cfilter(c,tp)
17+
return c:IsControler(tp) and c:IsPreviousControler(tp) and
18+
c:IsMonster() and c:IsReason(REASON_BATTLE) and c:IsAbleToDeck()
19+
end
20+
function s.operation(e,tp,eg,ep,ev,re,r,rp)
21+
local e1=Effect.CreateEffect(e:GetHandler())
22+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
23+
e1:SetCode(EVENT_TO_GRAVE)
24+
e1:SetReset(RESET_PHASE+PHASE_END)
25+
e1:SetOperation(s.checkop)
26+
Duel.RegisterEffect(e1,tp)
27+
local e2=Effect.CreateEffect(e:GetHandler())
28+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
29+
e2:SetCode(EVENT_CUSTOM+id)
30+
e2:SetCountLimit(1)
31+
e2:SetReset(RESET_PHASE+PHASE_END)
32+
e2:SetCondition(s.checkcon)
33+
e2:SetOperation(s.checkop2)
34+
Duel.RegisterEffect(e2,tp)
35+
end
36+
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
37+
local g=eg:Filter(s.cfilter,nil,tp)
38+
if #g>0 then
39+
Duel.RaiseEvent(g,EVENT_CUSTOM+id,e,0,0,0,0)
40+
e:Reset()
41+
end
42+
end
43+
function s.checkcon(e,tp,eg,ep,ev,re,r,rp)
44+
return re:GetHandler()==e:GetHandler()
45+
end
46+
function s.todeckfilter(c,tp)
47+
return c:IsControler(tp) and c:IsMonster() and c:IsAbleToDeck()
48+
end
49+
function s.checkop2(e,tp,eg,ep,ev,re,r,rp)
50+
e:Reset()
51+
if Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
52+
Duel.Hint(HINT_CARD,0,id)
53+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
54+
local tc=eg:FilterSelect(tp,s.todeckfilter,1,1,nil,tp)
55+
if tc then
56+
Duel.SendtoDeck(tc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
57+
end
58+
end
59+
end

goat/c504700188.lua

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
--サイバーポッド
2+
--Cyber Jar (GOAT)
3+
--Scripted by edo9300
4+
--Unlike OCG, first both players reveal, then both summon
5+
local s,id=GetID()
6+
function s.initial_effect(c)
7+
--flip
8+
local e1=Effect.CreateEffect(c)
9+
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
10+
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
11+
e1:SetTarget(s.target)
12+
e1:SetOperation(s.operation)
13+
c:RegisterEffect(e1)
14+
end
15+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
16+
if chk==0 then return true end
17+
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE)
18+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
19+
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,PLAYER_ALL,LOCATION_DECK)
20+
end
21+
function s.spchk(c,e,tp)
22+
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
23+
end
24+
local function summon(g,e,p,tograve,ft)
25+
if #g==0 then return end
26+
if ft==0 then
27+
tograve:Merge(g)
28+
return
29+
end
30+
if ft<#g then
31+
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_SPSUMMON)
32+
local newg=g:Select(p,ft,ft,nil)
33+
tograve:Merge(g:Sub(newg))
34+
g=newg
35+
end
36+
for tc in g:Iter() do
37+
Duel.SpecialSummonStep(tc,0,p,p,false,false,POS_FACEUP_ATTACK|POS_FACEDOWN_DEFENSE)
38+
end
39+
end
40+
function s.operation(e,tp,eg,ep,ev,re,r,rp)
41+
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE)
42+
Duel.Destroy(g,REASON_EFFECT)
43+
Duel.BreakEffect()
44+
local p=Duel.GetTurnPlayer()
45+
local summonable1,nonsummonable1=Duel.GetDecktopGroup(p,5):Split(s.spchk,nil,e,p)
46+
local summonable2,nonsummonable2=Duel.GetDecktopGroup(1-p,5):Split(s.spchk,nil,e,1-p)
47+
local ft1=Duel.GetLocationCount(p,LOCATION_MZONE)
48+
if ft1>1 and Duel.IsPlayerAffectedByEffect(p,CARD_BLUEEYES_SPIRIT) and #summonable1>1 then
49+
nonsummonable1:Merge(summonable1)
50+
summonable1:Clear()
51+
end
52+
local ft2=Duel.GetLocationCount(1-p,LOCATION_MZONE)
53+
if ft2>1 and Duel.IsPlayerAffectedByEffect(1-p,CARD_BLUEEYES_SPIRIT) and #summonable2>1 then
54+
nonsummonable2:Merge(summonable2)
55+
summonable2:Clear()
56+
end
57+
local tohand,tograve=nonsummonable1:Merge(nonsummonable2):Split(Card.IsAbleToHand,nil)
58+
Duel.DisableShuffleCheck()
59+
Duel.ConfirmDecktop(p,5)
60+
Duel.ConfirmDecktop(1-p,5)
61+
summon(summonable1,e,p,tograve,ft1)
62+
summon(summonable2,e,1-p,tograve,ft2)
63+
Duel.SpecialSummonComplete()
64+
if #tohand>0 then
65+
Duel.SendtoHand(tohand,nil,REASON_EFFECT)
66+
Duel.ShuffleHand(tp)
67+
Duel.ShuffleHand(1-tp)
68+
end
69+
if #tograve>0 then
70+
Duel.SendtoGrave(tograve,REASON_EFFECT)
71+
end
72+
local fg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
73+
Duel.ShuffleSetCard(fg)
74+
end

goat/c504700189.lua

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--我が身を盾に
2+
--My Body as a Shield (GOAT)
3+
--Cannot be used during the damage step
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Negate
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
9+
e1:SetType(EFFECT_TYPE_ACTIVATE)
10+
e1:SetCode(EVENT_CHAINING)
11+
e1:SetCondition(s.condition)
12+
e1:SetCost(Cost.PayLP(1500))
13+
e1:SetTarget(s.target)
14+
e1:SetOperation(s.operation)
15+
c:RegisterEffect(e1)
16+
end
17+
function s.cfilter(c)
18+
return c:IsOnField() and c:IsMonster()
19+
end
20+
function s.condition(e,tp,eg,ep,ev,re,r,rp)
21+
if tp==ep or not Duel.IsChainNegatable(ev) then return false end
22+
if not re:IsMonsterEffect() and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
23+
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
24+
return ex and tg~=nil and tc+tg:FilterCount(s.cfilter,nil)-#tg>0
25+
end
26+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
27+
if chk==0 then return true end
28+
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
29+
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
30+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
31+
end
32+
end
33+
function s.operation(e,tp,eg,ep,ev,re,r,rp)
34+
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
35+
Duel.Destroy(eg,REASON_EFFECT)
36+
end
37+
end

goat/c504700190.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--地雷蜘蛛
2+
--Jirai Gumo (GOAT)
3+
--Tossing a coin is a cost to attack, not an effect
4+
local s,id=GetID()
5+
function s.initial_effect(c)
6+
--Toss a coin and halve the player's LP
7+
local e1=Effect.CreateEffect(c)
8+
e1:SetDescription(aux.Stringid(id,0))
9+
e1:SetCategory(CATEGORY_COIN)
10+
e1:SetType(EFFECT_TYPE_SINGLE)
11+
e1:SetCode(EFFECT_ATTACK_COST)
12+
e1:SetOperation(s.atop)
13+
c:RegisterEffect(e1)
14+
end
15+
function s.atop(e,tp,eg,ep,ev,re,r,rp)
16+
if Duel.IsAttackCostPaid()~=2 and e:GetHandler():IsLocation(LOCATION_MZONE) then
17+
Duel.AttackCostPaid()
18+
if not Duel.CallCoin(tp) then
19+
Duel.SetLP(tp,Duel.GetLP(tp)//2)
20+
end
21+
end
22+
end

0 commit comments

Comments
 (0)