| author | saiam |
| Mon, 08 Dec 2008 22:33:24 +0000 | |
| changeset 320 | cb33eca69b29 |
| parent 305 | 56799ec8d7be |
| child 337 | ecde18d07879 |
| 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; |
| 236 | 13 |
std::string name; |
14 |
} WEAPON_PARAMS[] = {
|
|
| 305 | 15 |
/* age speed recoil damage expRadius radius reloadTime bounce name */ |
16 |
{ 10000, 5 * 80 + 50, 0 * 5 + 10000, 1, 0 * 6 + 5, 1, 0 * 100 + 50, 0.00, "Weapon 1" },
|
|
17 |
{ 10000, 4 * 80 + 50, 2 * 5 + 5, 2, 1 * 6 + 5, 2, 1 * 100 + 50, 0.00, "Weapon 2" },
|
|
18 |
{ 10000, 3 * 80 + 50, 3 * 5 + 5, 3, 2 * 6 + 5, 3, 2 * 100 + 50, 0.00, "Weapon 3" },
|
|
19 |
{ 10000, 2 * 80 + 50, 4 * 5 + 5, 5, 3 * 6 + 5, 4, 3 * 100 + 50, 0.00, "Weapon 4" },
|
|
20 |
{ 10000, 1 * 80 + 50, 5 * 5 + 5, 8, 4 * 6 + 5, 5, 4 * 100 + 50, 0.00, "Weapon 5" },
|
|
21 |
{ 1000, 600, 50000, 13, 100, 10, 1000, 1.05, "BounceBounce" },
|
|
22 |
{ 0, 0, 0, 0, 0, 0, 0, 0.00, "" }
|
|
| 236 | 23 |
}; |
24 |
||
25 |
std::vector<Weapon*> buildWeaponsList (void) {
|
|
26 |
std::vector<Weapon*> weapons; |
|
|
271
bf6784a95b08
touch up weapon/projectile with comments and slight tweaking
terom
parents:
263
diff
changeset
|
27 |
int idx = 0; |
| 236 | 28 |
|
|
253
747b1037d83e
Added recoil to weapon constructor. Recoil still not used.
saiam
parents:
237
diff
changeset
|
29 |
for (WeaponParams *wp = WEAPON_PARAMS; |
| 305 | 30 |
wp->age || wp->speed || wp->recoil || wp->damage || wp->explosionRadius || wp->radius || wp->bounce || wp->reloadTime; |
|
271
bf6784a95b08
touch up weapon/projectile with comments and slight tweaking
terom
parents:
263
diff
changeset
|
31 |
wp++, idx++) {
|
| 305 | 32 |
weapons.push_back(new Weapon(idx, wp->age, wp->speed, wp->recoil, wp->damage, wp->explosionRadius, wp->radius, wp->reloadTime, wp->name, wp->bounce)); |
| 236 | 33 |
} |
34 |
||
35 |
return weapons; |
|
36 |
} |
|
37 |