forked from smogon/pokemon-showdown-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotocol.txt
171 lines (110 loc) · 4.9 KB
/
protocol.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
The Showdown protocol.
Changes from old protocol:
- "ally" renamed "p1", "foe" renamed "p2"
- Dashes in commands are no longer used, and abbreviations are used more liberally. It's still human-readable _enough_, and saves a tiny bit of bandwidth.
- "r-" and "residual " were merged into "-"
The main thing is that stuff that previously like:
stealth-rock-damage foe-Excadrill 3.125
residual foe-Rotom-W item-heal Leftovers
r-volatile ally-Seviper leech-seed
will look something like:
-damage p2-Excadrill 3.125 e:StealthRock
-heal p2-Rotom-W 6.25 i:Leftovers
-start p1-Seviper e:LeechSeed
Out-of-game
------------------------------------------------------------------------
p1 [user full]
p2 [user full]
Initialize a Side associated with [user], in the corresponding slot.
If [side full] is empty, remove the Side in that slot.
p3 [user full]
p4 [user full]
The same as p1 and p2. Can be ignored by clients that don't support 3-player and 4-player.
In 2v2, alliances are p1 and p3 against p2 and p4.
chat [user] [message full]
The log records that [user] says [message full].
join [user]
The log records that [user] joins the room.
leave [user]
The log records that [user] leaves the room.
message [message full]
[message full] is broadcast in the log.
rawmessage [rawmessage full]
[rawmessage full] is broadcast as raw HTML in the log.
Initialization
------------------------------------------------------------------------
poke [pokemon]
Initialize a pokemon with the given ID, if it exists.
previewpoke [pokemon]
Initialize a pokemon for the purposes of Team Preview.
Two differences from `poke`: Will initialize a new pokemon even if a pokemon with that ID already exists, and the initialized pokemon will have an unknown name.
preview
Start Team Preview.
endpreview
End Team Preview.
Gameplay (major)
------------------------------------------------------------------------
switch [pokemon]
Switch in [pokemon].
drag [pokemon]
Drag in [pokemon].
replace [pokemon]
[pokemon] replaces what was in its slot previously. Generally used for Illusion reveals.
move [pokemon] [move] [pokemon2] [attr]
Make [pokemon] use [move] against [pokemon2].
[attr] describes how to handle the move animation:
"miss" - the move missed
"notarget" - the move's target fainted before the start of the move, and no other suitable target was found
"fail" - the move hit, but failed for some reason
anything else - the move connected normally
faint [pokemon]
[pokemon] faints.
Health
------------------------------------------------------------------------
-damage [pokemon] [damage] [source]
[pokemon] receives [damage] damage.
-heal [pokemon] [damage] [source]
[pokemon] is healed by [damage] damage.
Effects
------------------------------------------------------------------------
-start [pokemon] [effect] [source]
The effect [effect] starts on [pokemon].
Clients that track effects should keep in mind that some effects may end without a message.
-turnstart [pokemon] [effect] [source]
The 1-turn volatile effect [effect] starts on [pokemon]. No corresponding "-end" message will be given, but the effect will expire at the end of the turn.
-end [pokemon] [effect] [source]
The effect [effect] ends on [pokemon].
Generally not used for abilities ("-start" is called on the new ability, which replaces it).
Generally not used for items ("-take" or "-start" is called, depending on whether the item was replaced or removed).
-remove [pokemon] [effect] [source]
The effect [effect] ends on [pokemon], unnaturally.
Aside from animation and message differences, this is identical to using "-end".
-activate [pokemon] [effect] [source]
The effect [effect] activates on [pokemon].
This is usually just a message and/or an animation; the results of the effect activation are described later.
-use [pokemon] [effect] [source]
[pokemon] uses the item [effect].
Aside from animation and message differences, this is identical to using "-activate" followed by "-end".
-take [pokemon] [effect] [source]
[pokemon]'s item [effect] is taken from it.
Identical to -end, but usually comes with a different animation and message.
-sidestart [user] [effect] [source]
The side condition [effect] starts on the side associated with [user].
-sideend [user] [effect] [source]
The side condition [effect] ends on the side associated with [user].
-fieldstart [effect] [source]
The field effect [effect] starts.
-fieldstart [effect] [source]
The field effect [effect] ends.
Boosts
------------------------------------------------------------------------
-boost [pokemon] [boost] [source]
Boost [pokemon] by [boost].
-setboost [pokemon] [boost] [source]
Set [pokemon]'s boost levels to [boost].
-clearboost [pokemon] [source]
Clear all of [pokemon]'s [boost].
-copyboost [pokemon] [pokemon2] [source]
Replace [pokemon]'s boosts with [pokemon2]'s boosts.
-swapboost [pokemon] [pokemon2] [source]
Swap [pokemon]'s boosts and [pokemon2]'s boosts.