summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_ents.c92
-rw-r--r--src/cgame/cg_players.c6
-rw-r--r--src/cgame/cg_playerstate.c1
-rw-r--r--src/cgame/cg_weapons.c21
-rw-r--r--src/game/bg_misc.c53
-rw-r--r--src/game/bg_pmove.c3
-rw-r--r--src/game/bg_public.h2
-rw-r--r--src/game/g_buildable.c199
-rw-r--r--src/game/g_combat.c6
-rw-r--r--src/game/g_local.h11
-rw-r--r--src/game/g_main.c30
-rw-r--r--src/game/g_missile.c53
-rw-r--r--src/game/g_weapon.c51
13 files changed, 439 insertions, 89 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c
index 1c36c2f8..57b89fc6 100644
--- a/src/cgame/cg_ents.c
+++ b/src/cgame/cg_ents.c
@@ -377,10 +377,12 @@ static void CG_Item( centity_t *cent ) {
CG_Missile
===============
*/
-static void CG_Missile( centity_t *cent ) {
- refEntity_t ent;
- entityState_t *s1;
- const weaponInfo_t *weapon;
+static void CG_Missile( centity_t *cent )
+{
+ refEntity_t ent;
+ entityState_t *s1;
+ const weaponInfo_t *weapon;
+ vec3_t up;
s1 = &cent->currentState;
if ( s1->weapon > WP_NUM_WEAPONS ) {
@@ -421,43 +423,55 @@ static void CG_Missile( centity_t *cent ) {
VectorCopy( cent->lerpOrigin, ent.origin);
VectorCopy( cent->lerpOrigin, ent.oldorigin);
- if( cent->currentState.weapon == WP_PLASMAGUN )
- {
- ent.reType = RT_SPRITE;
- ent.radius = 16;
- ent.rotation = 0;
- ent.customShader = cgs.media.plasmaBallShader;
- trap_R_AddRefEntityToScene( &ent );
- return;
- }
-
- if( cent->currentState.weapon == WP_FLAMER )
+ switch( cent->currentState.weapon )
{
- ent.reType = RT_SPRITE;
- ent.radius = ( ( cg.time - s1->pos.trTime ) * ( cg.time - s1->pos.trTime ) ) / 9000;
- ent.rotation = 0;
- ent.customShader = cgs.media.flameShader;
- trap_R_AddRefEntityToScene( &ent );
- return;
- }
-
- // flicker between two skins
- ent.skinNum = cg.clientFrame & 1;
- ent.hModel = weapon->missileModel;
- ent.renderfx = weapon->missileRenderfx | RF_NOSHADOW;
-
- // convert direction of travel into axis
- if ( VectorNormalize2( s1->pos.trDelta, ent.axis[0] ) == 0 ) {
- ent.axis[0][2] = 1;
- }
-
- // spin as it moves
- if ( s1->pos.trType != TR_STATIONARY ) {
- RotateAroundDirection( ent.axis, cg.time / 4 );
- } else {
- RotateAroundDirection( ent.axis, s1->time );
+ case WP_PLASMAGUN:
+ ent.reType = RT_SPRITE;
+ ent.radius = 16;
+ ent.rotation = 0;
+ ent.customShader = cgs.media.plasmaBallShader;
+ trap_R_AddRefEntityToScene( &ent );
+ return;
+ break;
+
+ case WP_FLAMER:
+ ent.reType = RT_SPRITE;
+ ent.radius = ( ( cg.time - s1->pos.trTime ) * ( cg.time - s1->pos.trTime ) ) / 9000;
+ ent.rotation = 0;
+ ent.customShader = cgs.media.flameShader;
+ trap_R_AddRefEntityToScene( &ent );
+ return;
+ break;
+
+ case WP_SAWBLADE_LAUNCHER:
+ ent.hModel = weapon->missileModel;
+
+ // convert direction of travel into axis
+ AngleVectors( s1->angles, NULL, NULL, up );
+ if( VectorNormalize2( up, ent.axis[ 0 ] ) == 0 )
+ ent.axis[ 0 ][ 2 ] = 1;
+
+ // spin as it moves
+ RotateAroundDirection( ent.axis, cg.time );
+ break;
+
+ default:
+ // flicker between two skins
+ ent.skinNum = cg.clientFrame & 1;
+ ent.hModel = weapon->missileModel;
+ ent.renderfx = weapon->missileRenderfx | RF_NOSHADOW;
+
+ // convert direction of travel into axis
+ if ( VectorNormalize2( s1->pos.trDelta, ent.axis[ 0 ] ) == 0 )
+ ent.axis[ 0 ][ 2 ] = 1;
+
+ // spin as it moves
+ if( s1->pos.trType != TR_STATIONARY )
+ RotateAroundDirection( ent.axis, cg.time / 4 );
+ else
+ RotateAroundDirection( ent.axis, s1->time );
}
-
+
// add to refresh list, possibly with quad glow
CG_AddRefEntityWithPowerups( &ent, s1->powerups, TEAM_FREE );
}
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index 9cb8c47a..77c01f81 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -1753,7 +1753,8 @@ int CG_AmbientLight( vec3_t point )
CG_Player
===============
*/
-void CG_Player( centity_t *cent ) {
+void CG_Player( centity_t *cent )
+{
clientInfo_t *ci;
refEntity_t legs;
refEntity_t torso;
@@ -1932,7 +1933,8 @@ void CG_Player( centity_t *cent ) {
//
CG_AddPlayerWeapon( &torso, NULL, cent );
- if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_DROIDS )
+ if( ( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_DROIDS ) &&
+ ( ( cent->currentState.powerups & 0xFF ) == PTE_HUMANS ) )
trap_R_AddAdditiveLightToScene( cent->lerpOrigin, 64, 0.1, 0.1, 0.4 );
}
diff --git a/src/cgame/cg_playerstate.c b/src/cgame/cg_playerstate.c
index 032a1841..c31216b2 100644
--- a/src/cgame/cg_playerstate.c
+++ b/src/cgame/cg_playerstate.c
@@ -55,6 +55,7 @@ void CG_CheckAmmo( void ) {
switch ( i ) {
case WP_ROCKET_LAUNCHER:
+ case WP_SAWBLADE_LAUNCHER:
case WP_GRENADE_LAUNCHER:
case WP_RAILGUN:
case WP_SHOTGUN:
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index a53336f9..7640fb0c 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -549,6 +549,19 @@ void CG_RegisterWeapon( int weaponNum ) {
cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" );
break;
+ case WP_SAWBLADE_LAUNCHER:
+ weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/sawblade/sawblade.md3" );
+ weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/rocket/rockfly.wav", qfalse );
+/* weaponInfo->missileTrailFunc = CG_RocketTrail;
+ weaponInfo->missileDlight = 200;
+ weaponInfo->wiTrailTime = 2000;
+ weaponInfo->trailRadius = 64;
+ MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 );
+ MAKERGB( weaponInfo->flashDlightColor, 1, 0.75f, 0 );*/
+ weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse );
+ /*cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" );*/
+ break;
+
case WP_GRENADE_LAUNCHER:
weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/grenade1.md3" );
weaponInfo->missileTrailFunc = CG_GrenadeTrail;
@@ -1625,6 +1638,14 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im
lightColor[1] = 0.75;
lightColor[2] = 0.0;
break;
+ case WP_SAWBLADE_LAUNCHER:
+ mod = cgs.media.dishFlashModel;
+ shader = cgs.media.rocketExplosionShader;
+ sfx = cgs.media.sfx_rockexp;
+ mark = cgs.media.burnMarkShader;
+ radius = 64;
+ isSprite = qtrue;
+ break;
case WP_RAILGUN:
mod = cgs.media.ringFlashModel;
shader = cgs.media.railExplosionShader;
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index e12c315a..ba21ca43 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -434,6 +434,22 @@ gitem_t bg_itemlist[] =
""
},
+/*QUAKED weapon_sawbladelauncher (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
+*/
+ {
+ "weapon_sawbladelauncher",
+ "sound/misc/w_pkup.wav",
+ { "models/weapons2/rocketl/rocketl.md3",
+ 0, 0, 0},
+ "icons/iconw_rocket",
+ "Sawblade Launcher",
+ 10,
+ IT_WEAPON,
+ WP_SAWBLADE_LAUNCHER,
+ "",
+ ""
+ },
+
/*QUAKED weapon_plasmagun (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
*/
{
@@ -802,6 +818,22 @@ TA: droid defense item
"" //sounds
},
+/*QUAKED team_droid_def2 (0 0 1) (-16 -16 -16) (16 16 16)
+TA: droid defense item
+*/
+ {
+ "team_droid_def2",
+ "sound/items/holdable.wav",
+ { "models/bitems/adef1.md3", 0, 0, 0 },
+ "icons/teleporter", //icon
+ "Droid Sawblade Launcher", //pickup
+ 0,
+ IT_BUILDABLE,
+ BA_D_DEF2,
+ "", //precache
+ "" //sounds
+ },
+
/*QUAKED team_droid_hivemind (0 0 1) (-16 -16 -16) (16 16 16)
TA: droid build limitation item
*/
@@ -1107,6 +1139,27 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse //qboolean reactorTest;
},
{
+ BA_D_DEF2, //int buildNum;
+ "sawbladel", //char *buildName;
+ "team_droid_def2", //char *entityName;
+ { -15, -15, -15 }, //vec3_t mins;
+ { 15, 15, 15 }, //vec3_t maxs;
+ 80, //int buildPoints;
+ 1000, //int health;
+ 50, //int damage;
+ 20, //int splashDamage;
+ 50, //int splashRadius;
+ MOD_DSPAWN, //int meansOfDeath;
+ BIT_DROIDS, //int team;
+ EV_ITEM_GROW, //int spawnEvent;
+ 100, //int nextthink;
+ 1500, //int turretFireSpeed;
+ 500, //int turretRange;
+ WP_SAWBLADE_LAUNCHER, //weapon_t turretProjType;
+ qtrue, //qboolean creepTest;
+ qfalse //qboolean reactorTest;
+ },
+ {
BA_D_HIVEMIND, //int buildNum;
"hivemind", //char *buildName;
"team_droid_hivemind", //char *entityName;
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index c6bc6d07..adccbca6 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -2474,6 +2474,9 @@ static void PM_Weapon( void )
case WP_RAILGUN:
addTime = 1500;
break;
+ case WP_SAWBLADE_LAUNCHER:
+ addTime = 1000;
+ break;
case WP_BFG:
addTime = 200;
break;
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 4e7c3c2b..0860b5e2 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -331,6 +331,7 @@ typedef enum {
WP_SHOTGUN,
WP_GRENADE_LAUNCHER,
WP_ROCKET_LAUNCHER,
+ WP_SAWBLADE_LAUNCHER,
WP_LIGHTNING,
WP_RAILGUN,
WP_FLAMER,
@@ -381,6 +382,7 @@ typedef enum {
BA_D_SPAWN,
BA_D_DEF1,
+ BA_D_DEF2,
BA_D_HIVEMIND,
BA_H_SPAWN,
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index d51465f6..9d836776 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -160,6 +160,13 @@ void nullDieFunction( gentity_t *self, gentity_t *inflictor, gentity_t *attacker
{
}
+
+
+
+//==================================================================================
+
+
+
/*
================
D_CreepRecede
@@ -184,6 +191,13 @@ void D_CreepRecede( gentity_t *self )
}
+
+
+//==================================================================================
+
+
+
+
/*
================
DSpawn_Melt
@@ -253,6 +267,13 @@ void DSpawn_Think( gentity_t *self )
{
}
+
+
+
+//==================================================================================
+
+
+
/*
================
DDef1_Die
@@ -307,6 +328,149 @@ void DDef1_Think( gentity_t *self )
self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.clientNum );
}
+
+
+
+//==================================================================================
+
+
+
+/*
+================
+ddef_fireonemeny
+
+Used by DDef2_Think to fire at enemy
+================
+*/
+void ddef_fireonenemy( gentity_t *self, int firespeed )
+{
+ vec3_t dirToTarget;
+
+ VectorSubtract( self->enemy->s.pos.trBase, self->s.pos.trBase, dirToTarget );
+ VectorNormalize( dirToTarget );
+ vectoangles( dirToTarget, self->s.angles2 );
+
+ //fire at target
+ FireWeapon( self );
+ self->count = level.time + firespeed;
+}
+
+/*
+================
+ddef_checktarget
+
+Used by DDef2_Think to check enemies for validity
+================
+*/
+qboolean ddef_checktarget( gentity_t *self, gentity_t *target, int range )
+{
+ vec3_t distance;
+ trace_t trace;
+
+ if( !target ) // Do we have a target?
+ return qfalse;
+ if( !target->inuse ) // Does the target still exist?
+ return qfalse;
+ if( target == self ) // is the target us?
+ return qfalse;
+ if( !target->client ) // is the target a bot or player?
+ return qfalse;
+ if( target->client->ps.stats[ STAT_PTEAM ] == PTE_DROIDS ) // is the target one of us?
+ return qfalse;
+ if( target->client->sess.sessionTeam == TEAM_SPECTATOR ) // is the target alive?
+ return qfalse;
+ if( target->health <= 0 ) // is the target still alive?
+ return qfalse;
+
+ VectorSubtract( target->r.currentOrigin, self->r.currentOrigin, distance );
+ if( VectorLength( distance ) > range ) // is the target within range?
+ return qfalse;
+
+ trap_Trace( &trace, self->s.pos.trBase, NULL, NULL, target->s.pos.trBase, self->s.number, MASK_SHOT );
+ if ( trace.contents & CONTENTS_SOLID ) // can we see the target?
+ return qfalse;
+
+ return qtrue;
+}
+
+/*
+================
+ddef_findenemy
+
+Used by DDef2_Think to locate enemy gentities
+================
+*/
+void ddef_findenemy( gentity_t *ent, int range )
+{
+ gentity_t *target;
+
+ target = g_entities;
+
+ //iterate through entities
+ for (; target < &g_entities[ level.num_entities ]; target++)
+ {
+ //if target is not valid keep searching
+ if( !ddef_checktarget( ent, target, range ) )
+ continue;
+
+ //we found a target
+ ent->enemy = target;
+ return;
+ }
+
+ //couldn't find a target
+ ent->enemy = NULL;
+}
+
+/*
+================
+DDef2_Think
+
+think function for Droid Defense
+================
+*/
+void DDef2_Think( gentity_t *self )
+{
+ int range = BG_FindRangeForBuildable( self->s.clientNum );
+ int firespeed = BG_FindFireSpeedForBuildable( self->s.clientNum );
+
+ self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.clientNum );
+
+ //if there is no creep nearby die
+ if( !findCreep( self ) )
+ {
+ G_Damage( self, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE );
+ return;
+ }
+
+ //if the current target is not valid find a new one
+ if( !ddef_checktarget( self, self->enemy, range ) )
+ ddef_findenemy( self, range );
+
+ //if a new target cannot be found don't do anything
+ if( !self->enemy )
+ return;
+
+ //if we are pointing at our target and we can fire shoot it
+ switch( self->s.clientNum )
+ {
+ case BA_D_DEF2:
+ if( self->count < level.time )
+ ddef_fireonenemy( self, firespeed );
+ break;
+
+ default:
+ Com_Printf( S_COLOR_YELLOW "WARNING: Unknown turret type in think\n" );
+ break;
+ }
+}
+
+
+
+//==================================================================================
+
+
+
/*
================
HRpt_Think
@@ -342,6 +506,13 @@ void HRpt_Think( gentity_t *self )
self->nextthink = level.time + REFRESH_TIME;
}
+
+
+
+//==================================================================================
+
+
+
/*
================
HMCU_Activate
@@ -376,6 +547,13 @@ void HMCU_Think( gentity_t *self )
self->powered = findPower( self );
}
+
+
+
+//==================================================================================
+
+
+
//TA: the following defense turret code was written by
// "fuzzysteve" (fuzzysteve@quakefiles.com) and
// Anthony "inolen" Pesch (www.inolen.com)
@@ -738,6 +916,13 @@ void HDef_Think( gentity_t *self )
}
+
+
+//==================================================================================
+
+
+
+
/*
================
HSpawn_blast
@@ -799,6 +984,13 @@ void HSpawn_Think( gentity_t *self )
}
+
+
+//==================================================================================
+
+
+
+
/*
================
itemFits
@@ -1029,6 +1221,13 @@ gentity_t *Build_Item( gentity_t *ent, buildable_t buildable, int distance ) {
built->think = DDef1_Think;
break;
+ case BA_D_DEF2:
+ built->die = DDef1_Die;
+ built->think = DDef2_Think;
+ built->enemy = NULL;
+ built->s.weapon = BG_FindProjTypeForBuildable( buildable );
+ break;
+
case BA_D_HIVEMIND:
built->die = DSpawn_Die;
break;
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 34ab8e16..fb4e073e 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -1203,14 +1203,14 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
/* asave = CheckArmor (targ, take, dflags);
take -= asave;*/
//TA: armour is the chance of deflecting an attack (out of 100)
- if( targ->client && targ->client->ps.stats[ STAT_ARMOR ] > 0 )
+/* if( targ->client && targ->client->ps.stats[ STAT_ARMOR ] > 0 )
{
//TA: this whole thing is probably a bad idea. Worth a try I guess.
float chance = (float)targ->client->ps.stats[ STAT_ARMOR ] / 100.0f;
if( crandom( ) > chance )
- take /= ( 1.0f / chance );
- }
+ take *= chance;
+ }*/
if( g_debugDamage.integer )
{
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 3c49ab2f..f4e796ae 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -600,13 +600,14 @@ void G_InitDamageLocations( );
//
void G_RunMissile( gentity_t *ent );
-gentity_t *fire_blaster (gentity_t *self, vec3_t start, vec3_t aimdir);
+gentity_t *fire_blaster( gentity_t *self, vec3_t start, vec3_t aimdir );
gentity_t *fire_flamer( gentity_t *self, vec3_t start, vec3_t aimdir );
gentity_t *fire_plasma( gentity_t *self, vec3_t start, vec3_t aimdir );
-gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t aimdir);
-gentity_t *fire_rocket (gentity_t *self, vec3_t start, vec3_t dir);
-gentity_t *fire_bfg (gentity_t *self, vec3_t start, vec3_t dir);
-gentity_t *fire_grapple (gentity_t *self, vec3_t start, vec3_t dir);
+gentity_t *fire_grenade( gentity_t *self, vec3_t start, vec3_t aimdir );
+gentity_t *fire_rocket( gentity_t *self, vec3_t start, vec3_t dir );
+gentity_t *fire_sawblade( gentity_t *self, vec3_t start, vec3_t dir );
+gentity_t *fire_bfg( gentity_t *self, vec3_t start, vec3_t dir );
+gentity_t *fire_grapple( gentity_t *self, vec3_t start, vec3_t dir );
//
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 12c39e80..3d5fb1e8 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -1854,26 +1854,34 @@ int start, end;
//
start = trap_Milliseconds();
ent = &g_entities[0];
- for (i=0 ; i<level.num_entities ; i++, ent++) {
- if ( !ent->inuse ) {
+
+ for ( i = 0; i < level.num_entities; i++, ent++ )
+ {
+ if( !ent->inuse )
continue;
- }
// clear events that are too old
- if ( level.time - ent->eventTime > EVENT_VALID_MSEC ) {
- if ( ent->s.event ) {
+ if( level.time - ent->eventTime > EVENT_VALID_MSEC )
+ {
+ if( ent->s.event )
+ {
ent->s.event = 0; // &= EV_EVENT_BITS;
- if ( ent->client ) {
+ if ( ent->client )
+ {
ent->client->ps.externalEvent = 0;
//ent->client->ps.events[0] = 0;
//ent->client->ps.events[1] = 0;
}
}
- if ( ent->freeAfterEvent ) {
+
+ if( ent->freeAfterEvent )
+ {
// tempEntities or dropped items completely go away after their event
G_FreeEntity( ent );
continue;
- } else if ( ent->unlinkAfterEvent ) {
+ }
+ else if( ent->unlinkAfterEvent )
+ {
// items that will respawn will hide themselves after their pickup event
ent->unlinkAfterEvent = qfalse;
trap_UnlinkEntity( ent );
@@ -1881,9 +1889,8 @@ start = trap_Milliseconds();
}
// temporary entities don't think
- if ( ent->freeAfterEvent ) {
+ if ( ent->freeAfterEvent )
continue;
- }
//TA: calculate the acceleration of this entity
if( ent->evaluateAcceleration )
@@ -1893,7 +1900,8 @@ start = trap_Milliseconds();
continue;
}
- if ( ent->s.eType == ET_MISSILE ) {
+ if ( ent->s.eType == ET_MISSILE )
+ {
G_RunMissile( ent );
continue;
}
diff --git a/src/game/g_missile.c b/src/game/g_missile.c
index 13b05997..b067a58d 100644
--- a/src/game/g_missile.c
+++ b/src/game/g_missile.c
@@ -81,7 +81,10 @@ void G_ExplodeMissile( gentity_t *ent ) {
dir[2] = 1;
ent->s.eType = ET_GENERAL;
- G_AddEvent( ent, EV_MISSILE_MISS, DirToByte( dir ) );
+
+ //TA: tired... can't be fucked... hack
+ if( ent->s.weapon != WP_SAWBLADE_LAUNCHER )
+ G_AddEvent( ent, EV_MISSILE_MISS, DirToByte( dir ) );
ent->freeAfterEvent = qtrue;
@@ -223,7 +226,8 @@ G_RunMissile
================
*/
-void G_RunMissile( gentity_t *ent ) {
+void G_RunMissile( gentity_t *ent )
+{
vec3_t origin;
trace_t tr;
int passent;
@@ -286,7 +290,8 @@ fire_flamer
=================
*/
-gentity_t *fire_flamer (gentity_t *self, vec3_t start, vec3_t dir) {
+gentity_t *fire_flamer( gentity_t *self, vec3_t start, vec3_t dir )
+{
gentity_t *bolt;
VectorNormalize (dir);
@@ -328,7 +333,7 @@ fire_plasma
=================
*/
-gentity_t *fire_plasma (gentity_t *self, vec3_t start, vec3_t dir)
+gentity_t *fire_plasma( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
@@ -358,6 +363,7 @@ gentity_t *fire_plasma (gentity_t *self, vec3_t start, vec3_t dir)
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy (start, bolt->r.currentOrigin);
+
return bolt;
}
@@ -484,6 +490,45 @@ gentity_t *fire_rocket (gentity_t *self, vec3_t start, vec3_t dir) {
/*
=================
+fire_sawblade
+=================
+*/
+gentity_t *fire_sawblade( gentity_t *self, vec3_t start, vec3_t dir )
+{
+ gentity_t *bolt;
+
+ VectorNormalize ( dir );
+
+ bolt = G_Spawn( );
+ bolt->classname = "sawblade";
+ bolt->nextthink = level.time + 20000;
+ bolt->think = G_ExplodeMissile;
+ bolt->s.eType = ET_MISSILE;
+ bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
+ bolt->s.eFlags = EF_BOUNCE;
+ bolt->s.weapon = WP_SAWBLADE_LAUNCHER;
+ bolt->r.ownerNum = self->s.number;
+ bolt->parent = self;
+ bolt->damage = 100;
+ bolt->splashDamage = 0;
+ bolt->splashRadius = 0;
+ bolt->methodOfDeath = MOD_ROCKET;
+ bolt->splashMethodOfDeath = MOD_ROCKET_SPLASH;
+ bolt->clipmask = MASK_SHOT;
+ bolt->target_ent = NULL;
+
+ bolt->s.pos.trType = TR_LINEAR;
+ bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
+ VectorCopy( start, bolt->s.pos.trBase );
+ VectorScale( dir, 1000, bolt->s.pos.trDelta );
+ SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
+ VectorCopy (start, bolt->r.currentOrigin);
+
+ return bolt;
+}
+
+/*
+=================
fire_grapple
=================
*/
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index b1f94d7e..7a9c7779 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -29,7 +29,6 @@
#include "g_local.h"
-static float s_quadFactor;
static vec3_t forward, right, up;
static vec3_t muzzle;
@@ -102,14 +101,7 @@ qboolean CheckGauntletAttack( gentity_t *ent ) {
return qfalse;
}
- /*if (ent->client->ps.powerups[PW_QUAD] ) {
- G_AddEvent( ent, EV_POWERUP_QUAD, 0 );
- s_quadFactor = g_quadfactor.value;
- } else*/ {
- s_quadFactor = 1;
- }
-
- damage = 50 * s_quadFactor;
+ damage = 50;
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
damage, 0, MOD_GAUNTLET );
@@ -163,8 +155,6 @@ void Bullet_Fire (gentity_t *ent, float spread, int damage, int mod ) {
gentity_t *traceEnt;
int i, passent;
- damage *= s_quadFactor;
-
r = random() * M_PI * 2.0f;
u = sin(r) * crandom() * spread * 16;
r = cos(r) * crandom() * spread * 16;
@@ -219,8 +209,6 @@ void BFG_Fire ( gentity_t *ent ) {
gentity_t *m;
m = fire_bfg (ent, muzzle, forward);
- m->damage *= s_quadFactor;
- m->splashDamage *= s_quadFactor;
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
}
@@ -257,7 +245,7 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
}
if ( traceEnt->takedamage) {
- damage = DEFAULT_SHOTGUN_DAMAGE * s_quadFactor;
+ damage = DEFAULT_SHOTGUN_DAMAGE;
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_SHOTGUN);
if( LogAccuracyHit( traceEnt, ent ) ) {
return qtrue;
@@ -330,8 +318,6 @@ void weapon_grenadelauncher_fire (gentity_t *ent) {
VectorNormalize( forward );
m = fire_grenade (ent, muzzle, forward);
- m->damage *= s_quadFactor;
- m->splashDamage *= s_quadFactor;
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
}
@@ -348,8 +334,23 @@ void Weapon_RocketLauncher_Fire (gentity_t *ent) {
gentity_t *m;
m = fire_rocket (ent, muzzle, forward);
- m->damage *= s_quadFactor;
- m->splashDamage *= s_quadFactor;
+
+// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
+}
+
+/*
+======================================================================
+
+SAWBLADE
+
+======================================================================
+*/
+
+void Weapon_SawbladeLauncher_Fire( gentity_t *ent )
+{
+ gentity_t *m;
+
+ m = fire_sawblade( ent, muzzle, forward );
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
}
@@ -366,8 +367,6 @@ void Weapon_Plasma_Fire (gentity_t *ent) {
gentity_t *m;
m = fire_plasma (ent, muzzle, forward);
- m->damage *= s_quadFactor;
- m->splashDamage *= s_quadFactor;
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
}
@@ -384,8 +383,6 @@ void Weapon_Flamer_Fire (gentity_t *ent) {
gentity_t *m;
m = fire_flamer (ent, muzzle, forward);
- m->damage *= s_quadFactor;
- m->splashDamage *= s_quadFactor;
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
}
@@ -418,7 +415,7 @@ void weapon_railgun_fire( gentity_t *ent )
int passent;
gentity_t *unlinkedEntities[MAX_RAIL_HITS];
- damage = 100 * s_quadFactor;
+ damage = 100;
VectorMA (muzzle, 8192, forward, end);
@@ -531,7 +528,7 @@ void Weapon_LightningFire( gentity_t *ent ) {
gentity_t *traceEnt, *tent;
int damage, i, passent;
- damage = 8 * s_quadFactor;
+ damage = 8;
passent = ent->s.number;
for (i = 0; i < 10; i++) {
@@ -1007,6 +1004,8 @@ void FireWeapon2( gentity_t *ent )
case WP_RAILGUN:
weapon_railgun_fire( ent );
break;
+ case WP_SAWBLADE_LAUNCHER:
+ break;
case WP_BFG:
BFG_Fire( ent );
break;
@@ -1020,7 +1019,6 @@ void FireWeapon2( gentity_t *ent )
Weapon_Grab_Fire( ent );
break;
case WP_POUNCE:
- //Weapon_Claw_Fire( ent );
break;
case WP_DBUILD:
Weapon_Abuild_Fire( ent );
@@ -1087,6 +1085,9 @@ void FireWeapon( gentity_t *ent )
case WP_RAILGUN:
weapon_railgun_fire( ent );
break;
+ case WP_SAWBLADE_LAUNCHER:
+ Weapon_SawbladeLauncher_Fire( ent );
+ break;
case WP_BFG:
BFG_Fire( ent );
break;