summaryrefslogtreecommitdiff
path: root/src/game/bg_pmove.c
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2015-06-26 11:34:41 +0200
committerPaweł Redman <pawel.redman@gmail.com>2015-06-26 13:17:24 +0200
commite99ab52825d6b713a12a8ee19b5eaa81e78db28e (patch)
tree6e05d09962f6c6109e799082de9f62796a5b905d /src/game/bg_pmove.c
parent1895729b01532be9589d3606c331cc8f9ca9a9e3 (diff)
More Wraith changes.
Diffstat (limited to 'src/game/bg_pmove.c')
-rw-r--r--src/game/bg_pmove.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 1e1fb69..0d8bfda 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -3855,25 +3855,39 @@ void PM_WraithMechanics( void )
target = !!( pm->cmd.buttons & BUTTON_ATTACK2 );
force_exit = qfalse;
- if( pm->ps->stats[ STAT_MISC ] <= 0 )
+ if( pm->ps->stats[ STAT_MISC ] < 0 )
{
+ if( target && pm->ps->weaponTime <= 0 )
+ {
+ PM_AddEvent( EV_NOAMMO );
+ pm->ps->weaponTime += 500;
+ }
+
target = qfalse;
force_exit = qtrue;
-#ifdef GAME
- //Com_Printf( "out of ammo\n" );
-#endif
}
- if( !!( pm->ps->eFlags & EF_WARPING ) == target )
+ if( ( !force_exit && pm->ps->weaponTime ) ||
+ !!( pm->ps->eFlags & EF_WARPING ) == target )
{
goto done;
}
if( target )
{
+ if( pm->ps->stats[ STAT_MISC ] < LEVEL1_WARP_MIN_TIME )
+ {
+ if( pm->ps->weaponTime <= 0 )
+ {
+ PM_AddEvent( EV_NOAMMO );
+ pm->ps->weaponTime += 500;
+ }
+ goto done;
+ }
+
pm->ps->eFlags |= EF_WARPING;
PM_AddEvent( EV_WARP_ENTER );
- pm->ps->stats[ STAT_MISC ] -= LEVEL1_WARP_COST;
+ pm->ps->weaponTime += LEVEL1_WARP_MIN_TIME;
}
else
{
@@ -3899,6 +3913,7 @@ void PM_WraithMechanics( void )
pm->ps->eFlags &= ~EF_WARPING;
PM_AddEvent( EV_WARP_EXIT );
+ pm->ps->weaponTime += LEVEL1_WARP_REPEAT;
}
done:
@@ -3907,6 +3922,7 @@ done:
{
pm->tracemask = MASK_SOLID;
pm->ps->stats[ STAT_MISC ] -= pml.msec;
+ pm->cmd.buttons &= ~BUTTON_ATTACK;
}
else
{