1
2
3
4
5
6
7
8
9
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages;
12 import java.util.*;
13 import javax.vecmath.*;
14 import cz.cuni.amis.pogamut.base.communication.messages.*;
15 import cz.cuni.amis.pogamut.base.communication.worldview.*;
16 import cz.cuni.amis.pogamut.base.communication.worldview.event.*;
17 import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
18 import cz.cuni.amis.pogamut.base.communication.translator.event.*;
19 import cz.cuni.amis.pogamut.base3d.worldview.object.*;
20 import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;
21 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
22 import cz.cuni.amis.pogamut.udk.communication.messages.*;
23 import cz.cuni.amis.pogamut.udk.communication.worldview.objects.*;
24 import cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.*;
25 import cz.cuni.amis.pogamut.udk.communication.messages.ItemType.Category;
26 import cz.cuni.amis.utils.exception.*;
27 import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;
28 import cz.cuni.amis.utils.SafeEquals;
29 import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;
30
31
32
33
34
35
36
37
38
39
40
41 public class
42 BotDamaged
43 extends GBEvent
44
45 implements IWorldEvent, IWorldChangeEvent
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 public BotDamaged(
83 int Damage, String DamageType, String WeaponName, boolean Flaming, boolean CausedByWorld, boolean DirectDamage, boolean BulletHit, boolean VehicleHit, UnrealId Instigator) {
84
85 this.Damage = Damage;
86
87 this.DamageType = DamageType;
88
89 this.WeaponName = WeaponName;
90
91 this.Flaming = Flaming;
92
93 this.CausedByWorld = CausedByWorld;
94
95 this.DirectDamage = DirectDamage;
96
97 this.BulletHit = BulletHit;
98
99 this.VehicleHit = VehicleHit;
100
101 this.Instigator = Instigator;
102
103 }
104
105
106
107 public static final String PROTOTYPE =
108 "DAM {Damage 0} {DamageType text} {WeaponName text} {Flaming False} {CausedByWorld False} {DirectDamage False} {BulletHit False} {VehicleHit False} {Instigator unreal_id}";
109
110
111
112
113
114
115 protected
116 int Damage =
117 0;
118
119
120
121
122 public
123 int getDamage() {
124 return
125 Damage;
126 }
127
128
129
130
131
132
133
134 protected
135 String DamageType =
136 null;
137
138
139
140
141
142
143 public
144 String getDamageType() {
145 return
146 DamageType;
147 }
148
149
150
151
152
153
154
155 protected
156 String WeaponName =
157 null;
158
159
160
161
162
163
164 public
165 String getWeaponName() {
166 return
167 WeaponName;
168 }
169
170
171
172
173
174
175
176 protected
177 boolean Flaming =
178 false;
179
180
181
182
183
184
185 public
186 boolean isFlaming() {
187 return
188 Flaming;
189 }
190
191
192
193
194
195
196
197 protected
198 boolean CausedByWorld =
199 false;
200
201
202
203
204
205
206 public
207 boolean isCausedByWorld() {
208 return
209 CausedByWorld;
210 }
211
212
213
214
215
216
217
218 protected
219 boolean DirectDamage =
220 false;
221
222
223
224
225
226
227 public
228 boolean isDirectDamage() {
229 return
230 DirectDamage;
231 }
232
233
234
235
236
237
238
239 protected
240 boolean BulletHit =
241 false;
242
243
244
245
246
247
248 public
249 boolean isBulletHit() {
250 return
251 BulletHit;
252 }
253
254
255
256
257
258
259
260 protected
261 boolean VehicleHit =
262 false;
263
264
265
266
267
268
269 public
270 boolean isVehicleHit() {
271 return
272 VehicleHit;
273 }
274
275
276
277
278
279
280
281
282 protected
283 UnrealId Instigator =
284 null;
285
286
287
288
289
290
291
292 public
293 UnrealId getInstigator() {
294 return
295 Instigator;
296 }
297
298
299
300
301
302
303
304
305
306 public long getSimTime() {
307
308 return 0;
309 }
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326 public BotDamaged(BotDamaged original) {
327
328 this.Damage=original.Damage;
329
330 this.DamageType=original.DamageType;
331
332 this.WeaponName=original.WeaponName;
333
334 this.Flaming=original.Flaming;
335
336 this.CausedByWorld=original.CausedByWorld;
337
338 this.DirectDamage=original.DirectDamage;
339
340 this.BulletHit=original.BulletHit;
341
342 this.VehicleHit=original.VehicleHit;
343
344 this.Instigator=original.Instigator;
345
346 }
347
348
349
350
351
352 public BotDamaged() {
353 }
354
355
356
357 public String toString() {
358 return
359
360 super.toString() + " | " +
361
362 "Damage = " +
363 String.valueOf(Damage) + " | " +
364
365 "DamageType = " +
366 String.valueOf(DamageType) + " | " +
367
368 "WeaponName = " +
369 String.valueOf(WeaponName) + " | " +
370
371 "Flaming = " +
372 String.valueOf(Flaming) + " | " +
373
374 "CausedByWorld = " +
375 String.valueOf(CausedByWorld) + " | " +
376
377 "DirectDamage = " +
378 String.valueOf(DirectDamage) + " | " +
379
380 "BulletHit = " +
381 String.valueOf(BulletHit) + " | " +
382
383 "VehicleHit = " +
384 String.valueOf(VehicleHit) + " | " +
385
386 "Instigator = " +
387 String.valueOf(Instigator) + " | " +
388 "";
389
390 }
391
392 public String toHtmlString() {
393 return super.toString() +
394
395 "<b>Damage</b> : " +
396 String.valueOf(Damage) +
397 " <br/> " +
398
399 "<b>DamageType</b> : " +
400 String.valueOf(DamageType) +
401 " <br/> " +
402
403 "<b>WeaponName</b> : " +
404 String.valueOf(WeaponName) +
405 " <br/> " +
406
407 "<b>Flaming</b> : " +
408 String.valueOf(Flaming) +
409 " <br/> " +
410
411 "<b>CausedByWorld</b> : " +
412 String.valueOf(CausedByWorld) +
413 " <br/> " +
414
415 "<b>DirectDamage</b> : " +
416 String.valueOf(DirectDamage) +
417 " <br/> " +
418
419 "<b>BulletHit</b> : " +
420 String.valueOf(BulletHit) +
421 " <br/> " +
422
423 "<b>VehicleHit</b> : " +
424 String.valueOf(VehicleHit) +
425 " <br/> " +
426
427 "<b>Instigator</b> : " +
428 String.valueOf(Instigator) +
429 " <br/> " +
430 "";
431 }
432
433
434
435 }
436
437