summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordolcetriade <vcelestialragev@gmail.com>2013-09-17 18:18:13 -0700
committerdolcetriade <vcelestialragev@gmail.com>2013-09-17 18:18:13 -0700
commit5805d955ae792ff34b317ee2a25bf06456b94df7 (patch)
treeaea41fc45287b4919a66012d5d9056da84cb64a4
parentf7af9d418dd9b17d6c85c772480f6cb5508a6534 (diff)
Various whitespace fixes and revert zap to GPP
-rw-r--r--src/game/g_weapon.c65
-rw-r--r--src/game/tremulous.h12
2 files changed, 38 insertions, 39 deletions
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index 11d4892..42c85b5 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -45,7 +45,7 @@ void G_ForceWeaponChange( gentity_t *ent, weapon_t weapon )
ps->weaponTime = 250;
ps->weaponstate = WEAPON_READY;
}
-
+
if( weapon == WP_NONE ||
!BG_InventoryContainsWeapon( weapon, ps->stats ) )
{
@@ -76,7 +76,7 @@ void G_GiveClientMaxAmmo( gentity_t *ent, qboolean buyingEnergyAmmo )
for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ )
{
qboolean energyWeapon;
-
+
energyWeapon = BG_Weapon( i )->usesEnergy;
if( !BG_InventoryContainsWeapon( i, ent->client->ps.stats ) ||
BG_Weapon( i )->infiniteAmmo ||
@@ -84,10 +84,10 @@ void G_GiveClientMaxAmmo( gentity_t *ent, qboolean buyingEnergyAmmo )
ent->client->ps.ammo, ent->client->ps.clips ) ||
( buyingEnergyAmmo && !energyWeapon ) )
continue;
-
+
maxAmmo = BG_Weapon( i )->maxAmmo;
maxClips = BG_Weapon( i )->maxClips;
-
+
// Apply battery pack modifier
if( energyWeapon &&
BG_InventoryContainsUpgrade( UP_BATTPACK, ent->client->ps.stats ) )
@@ -142,7 +142,7 @@ static void G_WideTrace( trace_t *tr, gentity_t *ent, float range,
vec3_t end;
VectorSet( mins, -width, -width, -height );
- VectorSet( maxs, width, width, width );
+ VectorSet( maxs, width, width, height );
*target = NULL;
@@ -459,8 +459,8 @@ void massDriverFire( gentity_t *ent )
SnapVectorTowards( tr.endpos, muzzle );
// send impact
- if( traceEnt->takedamage &&
- (traceEnt->s.eType == ET_BUILDABLE ||
+ if( traceEnt->takedamage &&
+ (traceEnt->s.eType == ET_BUILDABLE ||
traceEnt->s.eType == ET_PLAYER ) )
{
BloodSpurt( ent, traceEnt, &tr );
@@ -507,7 +507,7 @@ void hiveFire( gentity_t *ent )
// Fire from the hive tip, not the center
VectorMA( muzzle, ent->r.maxs[ 2 ], ent->s.origin2, origin );
-
+
fire_hive( ent, origin, forward );
}
@@ -549,7 +549,7 @@ void flamerFire( gentity_t *ent )
{
vec3_t origin;
- // Correct muzzle so that the missile does not start in the ceiling
+ // Correct muzzle so that the missile does not start in the ceiling
VectorMA( muzzle, -7.0f, up, origin );
// Correct muzzle so that the missile fires from the player's hand
@@ -606,8 +606,8 @@ void lasGunFire( gentity_t *ent )
SnapVectorTowards( tr.endpos, muzzle );
// send impact
- if( traceEnt->takedamage &&
- (traceEnt->s.eType == ET_BUILDABLE ||
+ if( traceEnt->takedamage &&
+ (traceEnt->s.eType == ET_BUILDABLE ||
traceEnt->s.eType == ET_PLAYER ) )
{
BloodSpurt( ent, traceEnt, &tr );
@@ -771,9 +771,9 @@ void CheckCkitRepair( gentity_t *ent )
if(BG_Buildable(traceEnt->s.modelindex,NULL)->cuboid)
if(!BG_CuboidAttributes(traceEnt->s.modelindex)->repairable)
return;
-
+
bHealth = BG_Buildable( traceEnt->s.modelindex, traceEnt->cuboidSize )->health;
-
+
if( traceEnt->health < bHealth )
{
traceEnt->health += HBUILD_HEALRATE;
@@ -960,7 +960,7 @@ void CheckGrabAttack( gentity_t *ent )
if( traceEnt->client->ps.stats[ STAT_HEALTH ] <= 0 )
return;
-
+
if( !( traceEnt->client->ps.stats[ STAT_STATE ] & SS_GRABBED ) )
{
AngleVectors( traceEnt->client->ps.viewangles, dir, NULL, NULL );
@@ -1001,7 +1001,7 @@ void poisonCloud( gentity_t *ent )
for( i = 0; i < num; i++ )
{
humanPlayer = &g_entities[ entityList[ i ] ];
-
+
if( humanPlayer->client &&
humanPlayer->client->pers.teamSelection == TEAM_HUMANS )
{
@@ -1066,12 +1066,13 @@ static void G_FindZapChainTargets( zap_t *zap )
distance = Distance( ent->s.origin, enemy->s.origin );
- if((enemy->client&&enemy->client->ps.stats[STAT_TEAM]==TEAM_HUMANS) ||
- (enemy->s.eType==ET_BUILDABLE&&BG_Buildable(enemy->s.modelindex,NULL)->team==TEAM_HUMANS &&
- (!BG_Buildable(enemy->s.modelindex,NULL)->cuboid||BG_CuboidAttributes(enemy->s.modelindex)->zappable)) &&
- enemy->health>0 && distance <= LEVEL2_AREAZAP_CHAIN_RANGE)
+ if ( ( enemy->client
+ &&
+ enemy->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS) ||
+ ( enemy->s.eType == ET_BUILDABLE && BG_Buildable( enemy->s.modelindex, NULL )->team == TEAM_HUMANS &&
+ ( !BG_Buildable(enemy->s.modelindex,NULL)->cuboid||BG_CuboidAttributes( enemy->s.modelindex )->zappable ) ) &&
+ enemy->health > 0 && distance <= LEVEL2_AREAZAP_CHAIN_RANGE )
{
-
// world-LOS check: trace against the world, ignoring other BODY entities
trap_Trace( &tr, ent->s.origin, NULL, NULL,
enemy->s.origin, ent->s.number, CONTENTS_SOLID );
@@ -1136,9 +1137,7 @@ static void G_CreateNewZap( gentity_t *creator, gentity_t *target )
if( target->health > 0 )
{
G_Damage( target, creator, creator, forward,
- target->s.origin, LEVEL2_AREAZAP_DMG *
- ( ( target->s.eType == ET_BUILDABLE )
- ? LEVEL2_AREAZAP_DMG_MOD : 1.0f ),
+ target->s.origin, LEVEL2_AREAZAP_DMG,
DAMAGE_NO_KNOCKBACK | DAMAGE_NO_LOCDAMAGE,
MOD_LEVEL2_ZAP );
@@ -1147,9 +1146,8 @@ static void G_CreateNewZap( gentity_t *creator, gentity_t *target )
for( i = 1; i < zap->numTargets; i++ )
{
G_Damage( zap->targets[ i ], target, zap->creator, forward, target->s.origin,
- ( LEVEL2_AREAZAP_DMG * ( 1 - pow( (zap->distances[ i ] /
- LEVEL2_AREAZAP_CHAIN_RANGE ) , LEVEL2_AREAZAP_CHAIN_FALLOFF ) ) + 1 )
- * ( ( zap->targets[ i ]->s.eType == ET_BUILDABLE ) ? LEVEL2_AREAZAP_DMG_MOD : 1.0f ),
+ LEVEL2_AREAZAP_DMG * ( 1 - pow( (zap->distances[ i ] /
+ LEVEL2_AREAZAP_CHAIN_RANGE ), LEVEL2_AREAZAP_CHAIN_FALLOFF ) ) + 1,
DAMAGE_NO_KNOCKBACK | DAMAGE_NO_LOCDAMAGE,
MOD_LEVEL2_ZAP );
}
@@ -1165,6 +1163,7 @@ static void G_CreateNewZap( gentity_t *creator, gentity_t *target )
}
+
/*
===============
G_UpdateZaps
@@ -1254,9 +1253,9 @@ void areaZapFire( gentity_t *ent )
if( traceEnt == NULL )
return;
- if( ( traceEnt->client && traceEnt->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) ||
+ if( ( ( traceEnt->client && traceEnt->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) ||
( traceEnt->s.eType == ET_BUILDABLE &&
- BG_Buildable( traceEnt->s.modelindex, NULL )->team == TEAM_HUMANS ) &&
+ BG_Buildable( traceEnt->s.modelindex, NULL )->team == TEAM_HUMANS ) ) &&
( !BG_Buildable( traceEnt->s.modelindex, NULL )->cuboid ||
BG_CuboidAttributes( traceEnt->s.modelindex )->zappable ) )
{
@@ -1310,7 +1309,7 @@ qboolean CheckPounceAttack( gentity_t *ent )
if( !traceEnt->takedamage )
return qfalse;
-
+
// Deal damage
timeMax = ent->client->ps.weapon == WP_ALEVEL3 ? LEVEL3_POUNCE_TIME :
LEVEL3_POUNCE_TIME_UPG;
@@ -1412,7 +1411,7 @@ void G_CrushAttack( gentity_t *ent, gentity_t *victim )
if( damage < 0 )
damage = 0;
-
+
// Players also get damaged periodically
if( victim->client &&
ent->client->lastCrushTime + LEVEL4_CRUSH_REPEAT < level.time )
@@ -1420,7 +1419,7 @@ void G_CrushAttack( gentity_t *ent, gentity_t *victim )
ent->client->lastCrushTime = level.time;
damage += LEVEL4_CRUSH_DAMAGE;
}
-
+
if( damage < 1 )
return;
@@ -1528,7 +1527,7 @@ void FireWeapon2( gentity_t *ent )
case WP_ALEVEL2_UPG:
areaZapFire( ent );
break;
-
+
case WP_ABUILD:
case WP_ABUILD2:
case WP_HBUILD:
@@ -1550,7 +1549,7 @@ void FireWeapon( gentity_t *ent )
{
// set aiming directions
AngleVectors( ent->client->ps.viewangles, forward, right, up );
- CalcMuzzlePoint( ent, forward, right, up, muzzle );
+ CalcMuzzlePoint( ent, forward, right, up, muzzle );
}
else
{
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index a44a306..7f8836f 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -82,7 +82,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define LEVEL2_CLAW_K_SCALE 1.0f
#define LEVEL2_CLAW_U_REPEAT 400
#define LEVEL2_CLAW_U_K_SCALE 1.0f
-#define LEVEL2_AREAZAP_DMG 6 //ADM(60)
+#define LEVEL2_AREAZAP_DMG ADM(60)
#define LEVEL2_AREAZAP_RANGE 200.0f
#define LEVEL2_AREAZAP_CHAIN_RANGE 150.0f
#define LEVEL2_AREAZAP_CHAIN_FALLOFF 8.0f
@@ -95,7 +95,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define LEVEL3_CLAW_DMG ADM(80)
#define LEVEL3_CLAW_RANGE 80.0f
-#define LEVEL3_CLAW_UPG_RANGE LEVEL3_CLAW_RANGE + 3.0f
+#define LEVEL3_CLAW_UPG_RANGE LEVEL3_CLAW_RANGE + 3.0f
#define LEVEL3_CLAW_WIDTH 12.0f
#define LEVEL3_CLAW_REPEAT 900
#define LEVEL3_CLAW_K_SCALE 1.0f
@@ -107,7 +107,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define LEVEL3_POUNCE_WIDTH 14.0f
#define LEVEL3_POUNCE_TIME 800 // msec for full Dragoon pounce
#define LEVEL3_POUNCE_TIME_UPG 800 // msec for full Adv. Dragoon pounce
-#define LEVEL3_POUNCE_TIME_MIN 200 // msec before which pounce cancels
+#define LEVEL3_POUNCE_TIME_MIN 200 // msec before which pounce cancels
#define LEVEL3_POUNCE_REPEAT 400 // msec before a new pounce starts
#define LEVEL3_POUNCE_SPEED_MOD 0.75f // walking speed modifier for pounce charging
#define LEVEL3_POUNCE_JUMP_MAG 700 // Dragoon pounce jump power
@@ -139,7 +139,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define LEVEL4_CRUSH_REPEAT 500 // player damage repeat
#define LEVEL4_BOMB_DMG 150
-#define LEVEL4_BOMB_RADIUS 400
+#define LEVEL4_BOMB_RADIUS 400
#define LEVEL4_BOMB_SPEED 500.0f
#define LEVEL4_BOMB_REGEN 120000 // minimum time between getting a bomb
@@ -692,7 +692,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define DAMAGE_FRACTION_FOR_KILL 0.5f //how much damage players (versus structures) need to
//do to increment the stage kill counters
-
+
#define MAXIMUM_BUILD_TIME 20000 // used for pie timer
/*
@@ -715,5 +715,5 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define ALIEN_IMPLANT_MATURING_CHANCE 0.05f //chance of maturing (every second)
#define ALIEN_HATCHING_VELOCITY 250.0f
-#define ALIEN_HATCHING_MAX_BATTLESUIT_HEALTH 80 // alien dies if tried to spawn from a battlesuit at least this healthy
+#define ALIEN_HATCHING_MAX_BATTLESUIT_HEALTH 80 // alien dies if tried to spawn from a battlesuit at least this healthy
#define ALIEN_FAILED_HATCH_DAMAGE 65 // shouldn't be higher than the value above