spectfov, weap code restructured

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1800 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-04-16 20:09:32 +00:00
parent 81d2cc3ac6
commit fb6fcf9138
5 changed files with 36 additions and 2 deletions
+26
View File
@@ -3,6 +3,32 @@
#include "pch.h"
#include "cube.h"
grenadeent::grenadeent (playerent *owner, int millis)
{
ASSERT(owner);
bounceent::owner = owner;
bounceent::millis = lastmillis;
timetolife = 2000-millis;
bouncestate = NADE_ACTIVATED;
maxspeed = 27.0f;
rotspeed = 6.0f;
}
void grenadeent::explode()
{
static vec n(0,0,0);
if(bouncestate != NADE_THROWED) owner->weapons[GUN_GRENADE]->attack(n);
playsound(S_FEXPLODE, &o);
newprojectile(o, o, 1, owner==player1, owner, GUN_GRENADE, millis);
}
void grenadeent::destroy()
{
if(bouncestate==NADE_ACTIVATED || bouncestate==NADE_THROWED) explode();
}
vector<entity> ents;
const char *entnames[] =