Skip to content

Commit e396158

Browse files
authored
Added new card script
1 parent 504827e commit e396158

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed

pre-release/c101305064.lua

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
--
2+
--Summer
3+
local s,id=GetID()
4+
local COUNTER_SEASON=0x214
5+
local CARD_SPRING=60600821
6+
function s.initial_effect(c)
7+
c:EnableCounterPermit(COUNTER_SEASON)
8+
--Activate
9+
local e0=Effect.CreateEffect(c)
10+
e0:SetType(EFFECT_TYPE_ACTIVATE)
11+
e0:SetCode(EVENT_FREE_CHAIN)
12+
c:RegisterEffect(e0)
13+
--Once per turn: You can place Season Counters on this card equal to the number of your opponent's unused Main Monster Zones
14+
local e1=Effect.CreateEffect(c)
15+
e1:SetDescription(aux.Stringid(id,0))
16+
e1:SetCategory(CATEGORY_COUNTER)
17+
e1:SetType(EFFECT_TYPE_IGNITION)
18+
e1:SetRange(LOCATION_FZONE)
19+
e1:SetCountLimit(1)
20+
e1:SetTarget(s.countertg)
21+
e1:SetOperation(s.counterop)
22+
c:RegisterEffect(e1)
23+
--Once per turn, when your monster declares an attack: You can inflict 400 damage to your opponent for each Season Counter on this card, and for each "Spring" in your GY
24+
local e2=Effect.CreateEffect(c)
25+
e2:SetDescription(aux.Stringid(id,1))
26+
e2:SetCategory(CATEGORY_DAMAGE)
27+
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
28+
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
29+
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
30+
e2:SetRange(LOCATION_FZONE)
31+
e2:SetCountLimit(1)
32+
e2:SetCondition(function(e,tp) return Duel.GetAttacker():IsControler(tp) end)
33+
e2:SetTarget(s.damtg)
34+
e2:SetOperation(s.damop)
35+
c:RegisterEffect(e2)
36+
--Once per turn, during your opponent's End Phase: You can take 1 Field Spell from your hand or Deck that you can place a Season Counter on, and place it face-up on your field (but neither player can activate its effects this turn), and if you do, place all Season Counters on this card on that card
37+
local e3=Effect.CreateEffect(c)
38+
e3:SetDescription(aux.Stringid(id,2))
39+
e3:SetCategory(CATEGORY_COUNTER)
40+
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
41+
e3:SetCode(EVENT_PHASE+PHASE_END)
42+
e3:SetRange(LOCATION_FZONE)
43+
e3:SetCountLimit(1)
44+
e3:SetCondition(function(e,tp) return Duel.IsTurnPlayer(1-tp) end)
45+
e3:SetTarget(s.pltg)
46+
e3:SetOperation(s.plop)
47+
c:RegisterEffect(e3)
48+
end
49+
s.counter_place_list={COUNTER_SEASON}
50+
s.listed_names={CARD_SPRING}
51+
function s.countertg(e,tp,eg,ep,ev,re,r,rp,chk)
52+
local zones_count=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
53+
if chk==0 then return zones_count>0 end
54+
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,zones_count,tp,COUNTER_SEASON)
55+
end
56+
function s.counterop(e,tp,eg,ep,ev,re,r,rp)
57+
local c=e:GetHandler()
58+
local zones_count=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
59+
if c:IsRelateToEffect(e) and zones_count>0 then
60+
c:AddCounter(COUNTER_SEASON,zones_count)
61+
end
62+
end
63+
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
64+
local season_counter_count=e:GetHandler():GetCounter(COUNTER_SEASON)
65+
local spring_count=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,CARD_SPRING)
66+
local total_damage=400*(season_counter_count+spring_count)
67+
if chk==0 then return total_damage>0 end
68+
Duel.SetTargetPlayer(1-tp)
69+
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,total_damage)
70+
end
71+
function s.damop(e,tp,eg,ep,ev,re,r,rp)
72+
local c=e:GetHandler()
73+
local player=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
74+
local season_counter_count=c:IsRelateToEffect(e) and c:GetCounter(COUNTER_SEASON) or 0
75+
local spring_count=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,CARD_SPRING)
76+
local total_damage=400*(season_counter_count+spring_count)
77+
if total_damage>0 then
78+
Duel.Damage(player,total_damage,REASON_EFFECT)
79+
end
80+
end
81+
function s.plfilter(c)
82+
return c:IsFieldSpell() and c:IsCanAddCounter(COUNTER_SEASON,1,false,LOCATION_ONFIELD) and not c:IsForbidden()
83+
end
84+
function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
85+
if chk==0 then return Duel.IsExistingMatchingCard(s.plfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil) end
86+
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,e:GetHandler():GetCounter(COUNTER_SEASON),tp,COUNTER_SEASON)
87+
end
88+
function s.plop(e,tp,eg,ep,ev,re,r,rp)
89+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
90+
local sc=Duel.SelectMatchingCard(tp,s.plfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil):GetFirst()
91+
if not sc then return end
92+
local c=e:GetHandler()
93+
local ct=c:GetCounter(COUNTER_SEASON)
94+
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
95+
if fc then
96+
Duel.SendtoGrave(fc,REASON_RULE)
97+
Duel.BreakEffect()
98+
end
99+
if Duel.MoveToField(sc,tp,tp,LOCATION_FZONE,POS_FACEUP,true) then
100+
--Neither player can activate its effects this turn
101+
local e1=Effect.CreateEffect(c)
102+
e1:SetDescription(3302)
103+
e1:SetType(EFFECT_TYPE_SINGLE)
104+
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
105+
e1:SetCode(EFFECT_CANNOT_TRIGGER)
106+
e1:SetReset(RESETS_STANDARD_PHASE_END)
107+
sc:RegisterEffect(e1)
108+
if ct>0 then
109+
sc:AddCounter(COUNTER_SEASON,ct)
110+
end
111+
end
112+
end

0 commit comments

Comments
 (0)