summaryrefslogtreecommitdiff
path: root/src/game/g_active.c
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2015-06-26 01:29:00 +0200
committerPaweł Redman <pawel.redman@gmail.com>2015-06-26 01:29:00 +0200
commitb28d5f6dbedd5b895eed4cc5b730581df3b2215d (patch)
tree9bb750d3f30ff731ce2c60f6a845fff25f20b668 /src/game/g_active.c
parent6c7152aada204bfdfa6e39cdfea5e10440e0ed36 (diff)
Initial implementation of Wraith.
Diffstat (limited to 'src/game/g_active.c')
-rw-r--r--src/game/g_active.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c
index b15c5a5..cac7e7f 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -1669,6 +1669,17 @@ void ClientThink_real( gentity_t *ent )
}
}
+ if( client->ps.weapon == WP_ALEVEL1 &&
+ client->lastWarpTime + LEVEL1_WARP_REGEN_DELAY <= level.time )
+ {
+ client->ps.stats[ STAT_MISC ] += msec * LEVEL1_WARP_REGEN_RATE;
+
+ if( client->ps.stats[ STAT_MISC ] > LEVEL1_WARP_TIME )
+ {
+ client->ps.stats[ STAT_MISC ] = LEVEL1_WARP_TIME;
+ }
+ }
+
if( BG_InventoryContainsUpgrade( UP_GRENADE, client->ps.stats ) &&
BG_UpgradeIsActive( UP_GRENADE, client->ps.stats ) )
{
@@ -1801,6 +1812,38 @@ void ClientThink_real( gentity_t *ent )
}
break;
+ case WP_ALEVEL1:
+ if( pm.pmext->warpExitedBlocked )
+ {
+ G_Damage( ent, NULL, ent, NULL, NULL, 10000, DAMAGE_NO_KNOCKBACK, MOD_CRUSH );
+ }
+ else
+ {
+ int old_contents;
+
+ old_contents = ent->r.contents;
+
+ if( ent->s.eFlags & EF_WARPING )
+ {
+ ent->r.contents = 0;
+ ent->clipmask = 0;
+ ent->flags |= FL_NOTARGET;
+ ent->client->lastWarpTime = level.time;
+ }
+ else
+ {
+ ent->r.contents = CONTENTS_BODY;
+ ent->clipmask = MASK_PLAYERSOLID;
+ ent->flags &= ~FL_NOTARGET;
+ }
+
+ if( ent->r.contents != old_contents )
+ {
+ trap_LinkEntity( ent );
+ }
+ }
+ break;
+
case WP_ALEVEL3:
case WP_ALEVEL3_UPG:
if( !CheckPounceAttack( ent ) )