author | nireco |
Sat, 31 Jan 2009 12:33:08 +0200 | |
changeset 443 | 5d1119729f58 |
parent 338 | fe2b3c6fff54 |
permissions | -rw-r--r-- |
236 | 1 |
|
2 |
#include "Weapons.hh" |
|
3 |
||
4 |
static struct WeaponParams { |
|
5 |
TickCount age; |
|
6 |
float speed; |
|
253
747b1037d83e
Added recoil to weapon constructor. Recoil still not used.
saiam
parents:
237
diff
changeset
|
7 |
float recoil; |
305 | 8 |
int damage; |
236 | 9 |
float explosionRadius; |
263
8c999cf4c182
weapon projectile radiuses and fix network play (local_player == NULL, Rope releasing upon being hit
terom
parents:
258
diff
changeset
|
10 |
float radius; |
236 | 11 |
TickCount reloadTime; |
279
e36f5e1a1c8d
let projectiles bounce, the new BounceBounce weapon puts the Physics engine into an infinite loop
terom
parents:
275
diff
changeset
|
12 |
float bounce; |
338 | 13 |
float mass; |
236 | 14 |
std::string name; |
15 |
} WEAPON_PARAMS[] = { |
|
338 | 16 |
/* age speed recoil damage expRadius radius reloadTime bounce mass name */ |
17 |
{ 10000, 5 * 80 + 50, 0 * 5 + 10000, 1, 0 * 6 + 5, 1, 0 * 100 + 50, 0.00, 10.0, "Weapon 1" }, |
|
18 |
{ 10000, 4 * 80 + 50, 2 * 5 + 5, 2, 1 * 6 + 5, 2, 1 * 100 + 50, 0.00, 10.0, "Weapon 2" }, |
|
19 |
{ 10000, 3 * 80 + 50, 3 * 5 + 5, 3, 2 * 6 + 5, 3, 2 * 100 + 50, 0.00, 10.0, "Weapon 3" }, |
|
20 |
{ 10000, 2 * 80 + 50, 4 * 5 + 5, 5, 3 * 6 + 5, 4, 3 * 100 + 50, 0.00, 10.0, "Weapon 4" }, |
|
21 |
{ 10000, 1 * 80 + 50, 5 * 5 + 5, 8, 4 * 6 + 5, 5, 4 * 100 + 50, 0.00, 10.0, "Weapon 5" }, |
|
22 |
{ 1000, 600, 999000, 13, 100, 10, 1000, 1.05, 10.0, "BounceBounce" }, |
|
23 |
{ 1000, 400, 100000, 0, 250, 10, 1200, 0.00, 10.0, "DigDig" }, |
|
24 |
{ 0, 0, 0, 0, 0, 0, 0, 0.00, 10.0, "" } |
|
236 | 25 |
}; |
26 |
||
27 |
std::vector<Weapon*> buildWeaponsList (void) { |
|
28 |
std::vector<Weapon*> weapons; |
|
271
bf6784a95b08
touch up weapon/projectile with comments and slight tweaking
terom
parents:
263
diff
changeset
|
29 |
int idx = 0; |
236 | 30 |
|
253
747b1037d83e
Added recoil to weapon constructor. Recoil still not used.
saiam
parents:
237
diff
changeset
|
31 |
for (WeaponParams *wp = WEAPON_PARAMS; |
305 | 32 |
wp->age || wp->speed || wp->recoil || wp->damage || wp->explosionRadius || wp->radius || wp->bounce || wp->reloadTime; |
338 | 33 |
wp++, idx++ |
34 |
) { |
|
35 |
weapons.push_back(new Weapon(idx, |
|
36 |
wp->age, wp->speed, wp->recoil, wp->damage, wp->explosionRadius, wp->radius, |
|
37 |
wp->reloadTime, wp->name, wp->bounce, wp->mass |
|
38 |
)); |
|
236 | 39 |
} |
40 |
||
41 |
return weapons; |
|
42 |
} |
|
43 |