From 3a336d349ccd44d0f6b7bdc308a4af86468940c0 Mon Sep 17 00:00:00 2001 From: Scott Brooks Date: Tue, 10 Jul 2001 01:26:35 +0000 Subject: [PATCH] Blaze: Falling damage tweaks --- reaction/game/bg_pmove.c | 49 +++++++++++++++++++++------------------- reaction/game/g_items.c | 7 ++++-- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/reaction/game/bg_pmove.c b/reaction/game/bg_pmove.c index 2b67ab83..e6595aad 100644 --- a/reaction/game/bg_pmove.c +++ b/reaction/game/bg_pmove.c @@ -1121,7 +1121,7 @@ static void PM_CrashLand( void ) { pm->ps->legsTimer = TIMER_LAND; // calculate the exact velocity on landing - dist = pm->ps->origin[2] - pml.previous_origin[2]; + /*dist = pm->ps->origin[2] - pml.previous_origin[2]; vel = pml.previous_velocity[2]; acc = -pm->ps->gravity; @@ -1134,7 +1134,7 @@ static void PM_CrashLand( void ) { return; } t = (-b - sqrt( den ) ) / ( 2 * a ); - +*/ //delta = vel + t * acc; //Blaze: added to make it more like aq2 delta = pm->ps->velocity[2] - pml.previous_velocity[2]; @@ -1166,27 +1166,28 @@ static void PM_CrashLand( void ) { // SURF_NODAMAGE is used for bounce pads where you don't ever // want to take damage or play a crunch sound - damage = (int)(((delta-30)/2)); - if (damage < 1) damage = 1; - damage *= 10; + + if (delta > 30) + { + + //Com_Printf("delta =(%f), delta - 30 = (%f), damage = (%d)",delta,delta-30,(int)(((delta-30)/2))); + damage = (int)(((delta-30)/2)); + if (damage < 1) damage = 1; + damage *= 10; - if ( !(pml.groundTrace.surfaceFlags & SURF_NODAMAGE) ) { - if ( delta > 30 ) { - //Blaze lots of changes to make it more like aq2 - // this is a pain grunt, so don't play it if dead - if ( pm->ps->stats[STAT_HEALTH] > 0 ) { - PM_AddEvent( EV_FALL_FAR ); - pm->ps->stats[STAT_FALLDAMAGE] = damage; + if ( !(pml.groundTrace.surfaceFlags & SURF_NODAMAGE) ) { + //Blaze lots of changes to make it more like aq2 + // this is a pain grunt, so don't play it if dead + if ( pm->ps->stats[STAT_HEALTH] > 0 && damage > 0) { + PM_AddEvent( EV_FALL_FAR ); + pm->ps->stats[STAT_FALLDAMAGE] = damage; + } + else + { + PM_AddEvent( PM_FootstepForSurface() ); + //Elder: added? useful? + pm->ps->stats[STAT_FALLDAMAGE] = 0; } - } else if ( delta > 7 ) { - PM_AddEvent( EV_FALL_SHORT ); - pm->ps->stats[STAT_FALLDAMAGE] = 0; - - } - else { - PM_AddEvent( PM_FootstepForSurface() ); - //Elder: added? useful? - pm->ps->stats[STAT_FALLDAMAGE] = 0; } } @@ -1833,14 +1834,16 @@ static void PM_Weapon( void ) { // check for item using if ( pm->cmd.buttons & BUTTON_USE_HOLDABLE ) { if ( ! ( pm->ps->pm_flags & PMF_USE_ITEM_HELD ) ) { + + /* Blaze: No more medkit if ( bg_itemlist[pm->ps->stats[STAT_HOLDABLE_ITEM]].giTag == HI_MEDKIT && pm->ps->stats[STAT_HEALTH] >= (125) ) { //medikit check pm->ps->stats[STAT_MAX_HEALTH] + 25) ) { // don't use medkit if at max health - } else { + } else {*/ pm->ps->pm_flags |= PMF_USE_ITEM_HELD; PM_AddEvent( EV_USE_ITEM0 + bg_itemlist[pm->ps->stats[STAT_HOLDABLE_ITEM]].giTag ); pm->ps->stats[STAT_HOLDABLE_ITEM] = 0; - } + //} return; } } else { diff --git a/reaction/game/g_items.c b/reaction/game/g_items.c index e25cee8a..3dd62a77 100644 --- a/reaction/game/g_items.c +++ b/reaction/game/g_items.c @@ -178,9 +178,10 @@ int Pickup_Holdable( gentity_t *ent, gentity_t *other ) { other->client->ps.stats[STAT_HOLDABLE_ITEM] = ent->item - bg_itemlist; +/* Blaze: No Kamikazie if( ent->item->giTag == HI_KAMIKAZE ) { other->client->ps.eFlags |= EF_KAMIKAZE; - } + }*/ return RESPAWN_HOLDABLE; } @@ -537,6 +538,7 @@ void RespawnItem( gentity_t *ent ) { te->r.svFlags |= SVF_BROADCAST; } +/* Blaze: No Kamikaze item if ( ent->item->giType == IT_HOLDABLE && ent->item->giTag == HI_KAMIKAZE ) { // play powerup spawn sound to all clients gentity_t *te; @@ -551,6 +553,7 @@ void RespawnItem( gentity_t *ent ) { te->s.eventParm = G_SoundIndex( "sound/items/kamikazerespawn.wav" ); te->r.svFlags |= SVF_BROADCAST; } + */ // play the normal respawn sound only to nearby clients G_AddEvent( ent, EV_ITEM_RESPAWN, 0 ); @@ -929,7 +932,7 @@ gentity_t *LaunchItem( gitem_t *item, vec3_t origin, vec3_t velocity, int xr_fla dropped->s.pos.trTime = level.time; // +50; no pre-step if it doesn't clip players VectorScale( velocity, 40, dropped->s.pos.trDelta ); // 700 500 400 SnapVector( dropped->s.pos.trDelta ); // save net bandwidth - dropped->physicsBounce = 0.1; + dropped->physicsBounce = 0.1f; } trap_LinkEntity (dropped);