~ubuntu-branches/ubuntu/trusty/teeworlds/trusty-updates

« back to all changes in this revision

Viewing changes to src/game/g_protocol.def

  • Committer: Bazaar Package Importer
  • Author(s): Jack Coulter
  • Date: 2008-04-13 18:48:12 UTC
  • Revision ID: james.westby@ubuntu.com-20080413184812-efc80waq2er6p1bs
Tags: upstream-0.4.2
ImportĀ upstreamĀ versionĀ 0.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
raw_source
 
3
        #include <engine/e_common_interface.h>
 
4
        #include "g_protocol.h"
 
5
        extern "C" {
 
6
                #include "g_protocol_ids.h"
 
7
        }
 
8
        #define max_int 2147483647
 
9
end
 
10
 
 
11
raw_header
 
12
        enum
 
13
        {
 
14
                // emotes
 
15
                EMOTE_NORMAL=0,
 
16
                EMOTE_PAIN,
 
17
                EMOTE_HAPPY,
 
18
                EMOTE_SURPRISE,
 
19
                EMOTE_ANGRY,
 
20
                EMOTE_BLINK,
 
21
                NUM_EMOTES,
 
22
                
 
23
                // playerstates
 
24
                PLAYERSTATE_UNKNOWN=0,
 
25
                PLAYERSTATE_PLAYING,
 
26
                PLAYERSTATE_IN_MENU,
 
27
                PLAYERSTATE_CHATTING,
 
28
                NUM_PLAYERSTATES,
 
29
 
 
30
                // game types
 
31
                GAMETYPE_DM=0,
 
32
                GAMETYPE_TDM,
 
33
                GAMETYPE_CTF,
 
34
                NUM_GAMETYPES,
 
35
                
 
36
                // other stuff
 
37
                INPUT_STATE_MASK=0x1f,
 
38
                NUM_EMOTICONS=16,
 
39
        };
 
40
        
 
41
end
 
42
 
 
43
 
 
44
 
 
45
object player_input
 
46
        any left
 
47
        any right
 
48
 
 
49
        any target_x
 
50
        any target_y
 
51
 
 
52
        any jump
 
53
        any fire
 
54
        any hook
 
55
        any blink
 
56
 
 
57
        any player_state
 
58
 
 
59
        any wanted_weapon
 
60
        any next_weapon
 
61
        any prev_weapon
 
62
end
 
63
 
 
64
object projectile
 
65
        any x, y
 
66
        any vx, vy
 
67
        range(0, NUM_WEAPONS-1) type
 
68
        range(0, max_int) start_tick
 
69
end
 
70
 
 
71
object laser
 
72
        any x
 
73
        any y
 
74
        any from_x
 
75
        any from_y
 
76
        range(0, max_int) eval_tick
 
77
end
 
78
 
 
79
object powerup
 
80
        any x, y
 
81
        range(0, max_int) type
 
82
        range(0, max_int) subtype
 
83
end
 
84
 
 
85
object flag
 
86
        any x, y
 
87
        range(0, 1) team
 
88
        range(-2,MAX_CLIENTS-1) carried_by // -2 == at stand -1 == on the field
 
89
end
 
90
 
 
91
object game
 
92
        range(0, max_int) round_start_tick
 
93
        
 
94
        range(0, 1) game_over
 
95
        range(0, 1) sudden_death
 
96
        range(0, 1) paused
 
97
 
 
98
        range(0, max_int) score_limit
 
99
        range(0, max_int) time_limit
 
100
        range(0, NUM_GAMETYPES-1) gametype
 
101
 
 
102
        range(0, max_int) warmup
 
103
 
 
104
        any teamscore_red
 
105
        any teamscore_blue
 
106
end
 
107
 
 
108
// core object needed for physics
 
109
object player_core
 
110
        any x, y
 
111
        any vx, vy
 
112
 
 
113
        any angle
 
114
        range(0, 3) jumped
 
115
 
 
116
        range(-1,MAX_CLIENTS-1) hooked_player
 
117
        range(-1,5) hook_state
 
118
        range(0, max_int) hook_tick
 
119
 
 
120
        any hook_x
 
121
        any hook_y
 
122
        any hook_dx
 
123
        any hook_dy
 
124
end
 
125
 
 
126
// info about the player that is only needed when it's on screen
 
127
object player_character extends player_core
 
128
        range(0, NUM_PLAYERSTATES-1) player_state
 
129
        
 
130
        range(-1, 1) wanted_direction
 
131
        
 
132
        range(0, 10) health
 
133
        range(0, 10) armor
 
134
        range(0, 10) ammocount
 
135
 
 
136
        range(0, NUM_WEAPONS-1) weapon
 
137
        range(0, NUM_EMOTES-1) emote
 
138
        
 
139
        range(0, max_int) attacktick
 
140
end
 
141
 
 
142
// information about the player that is always needed
 
143
object player_info
 
144
        range(0, 1) local
 
145
        range(0,MAX_CLIENTS-1) cid
 
146
        range(-1, 1) team
 
147
        
 
148
        any score
 
149
        
 
150
        any latency
 
151
        any latency_flux
 
152
end
 
153
 
 
154
event common
 
155
        any x, y
 
156
end
 
157
 
 
158
event explosion
 
159
        any x, y
 
160
end
 
161
 
 
162
event spawn
 
163
        any x, y
 
164
end
 
165
 
 
166
event death
 
167
        any x, y
 
168
        range(0,MAX_CLIENTS-1) cid
 
169
end
 
170
 
 
171
event air_jump
 
172
        any x, y
 
173
end
 
174
 
 
175
event sound_global
 
176
        any x, y
 
177
        range(0, NUM_SOUNDS-1) soundid
 
178
end
 
179
 
 
180
event sound_world
 
181
        any x, y
 
182
        range(0, NUM_SOUNDS-1) soundid
 
183
end
 
184
 
 
185
event damageind
 
186
        any x, y
 
187
        any angle
 
188
end
 
189
 
 
190
message sv_motd
 
191
        string message
 
192
end
 
193
 
 
194
message cl_say
 
195
        range(0, 1) team
 
196
        string message
 
197
end
 
198
 
 
199
message sv_chat
 
200
        range(-1, 1) team
 
201
        range(-1,MAX_CLIENTS-1) cid
 
202
        string message
 
203
end
 
204
 
 
205
message sv_broadcast
 
206
        string message
 
207
end
 
208
 
 
209
message sv_setinfo
 
210
        range(0,MAX_CLIENTS-1) cid
 
211
        string name
 
212
        string skin
 
213
        range(0,1) use_custom_color
 
214
        any color_body
 
215
        any color_feet
 
216
end
 
217
 
 
218
message sv_killmsg
 
219
        range(-1,MAX_CLIENTS-1) killer
 
220
        range(-1,MAX_CLIENTS-1) victim
 
221
        range(-1,NUM_WEAPONS-1) weapon
 
222
        any mode_special
 
223
end
 
224
 
 
225
message cl_setteam
 
226
        range(-1,1) team
 
227
end
 
228
 
 
229
message sv_ready_to_ender
 
230
end
 
231
 
 
232
message sv_sound_global
 
233
        range(0, NUM_SOUNDS-1) soundid
 
234
end
 
235
 
 
236
message cl_startinfo
 
237
        string name
 
238
        string skin
 
239
        range(0,1) use_custom_color
 
240
        any color_body
 
241
        any color_feet
 
242
end
 
243
 
 
244
message cl_changeinfo
 
245
        string name
 
246
        string skin
 
247
        range(0,1) use_custom_color
 
248
        any color_body
 
249
        any color_feet
 
250
end
 
251
 
 
252
message sv_weapon_pickup
 
253
        range(0,NUM_WEAPONS-1) weapon
 
254
end
 
255
 
 
256
message sv_emoticon
 
257
        range(0,MAX_CLIENTS-1) cid
 
258
        range(0,NUM_EMOTICONS-1) emoticon
 
259
end
 
260
 
 
261
message cl_emoticon
 
262
        range(0,NUM_EMOTICONS-1) emoticon
 
263
end
 
264
 
 
265
message cl_kill
 
266
end
 
267
 
 
268
message sv_tune_params
 
269
end
 
270
 
 
271
message sv_extra_projectile
 
272
end
 
273
 
 
274
message sv_ready_to_enter
 
275
end