summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorenneract <trem.redman@gmail.com>2014-12-14 14:56:38 +0100
committerenneract <trem.redman@gmail.com>2014-12-14 14:56:38 +0100
commit7c02e34b08a4e44a7f7935bf6b1bee45c3a8df6c (patch)
treee3ff69394522a6cc7dd11edf27cd69df6c0a5819 /src/game
parentbd6fc418d171378de5de2b7450e22f70b4899b5c (diff)
parent5130cdd357c5b3b442d39ee05052739419456e77 (diff)
Merge branch 'newguns'
Conflicts: src/cgame/cg_local.h src/cgame/cg_main.c
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_misc.c50
-rw-r--r--src/game/bg_mod.h2
-rw-r--r--src/game/bg_public.h2
-rw-r--r--src/game/g_active.c15
-rw-r--r--src/game/g_missile.c38
-rw-r--r--src/game/g_weapon.c64
-rw-r--r--src/game/tremulous.h8
7 files changed, 81 insertions, 98 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 92f3826..efdc300 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -3575,6 +3575,31 @@ static const weaponAttributes_t bg_weapons[ ] =
TEAM_HUMANS //team_t team;
},
{
+ WP_LIGHTNING_GUN, //int weaponNum;
+ LIGHTNING_PRICE, //int price;
+ STAGE_GE_5, //int stages
+ SLOT_WEAPON, //int slots;
+ "lightning", //char *weaponName;
+ "[yefarms]Lightning Gun", //char *humanName;
+ "This is a lightning gun. It guns lightning.",
+ LIGHTNING_AMMO, //int maxAmmo;
+ 0, //int maxClips;
+ qfalse, //int infiniteAmmo;
+ qtrue, //int usesEnergy;
+ LIGHTNING_REPEAT, //int repeatRate1;
+ 0, //int repeatRate2;
+ 0, //int repeatRate3;
+ 0, //int reloadTime;
+ LIGHTNING_K_SCALE, //float knockbackScale;
+ qfalse, //qboolean hasAltMode;
+ qfalse, //qboolean hasThirdMode;
+ qfalse, //qboolean canZoom;
+ 90.0f, //float zoomFov;
+ qtrue, //qboolean purchasable;
+ qtrue, //qboolean longRanged;
+ TEAM_HUMANS //team_t team;
+ },
+ {
WP_LUCIFER_CANNON, //int weaponNum;
LCANNON_PRICE, //int price;
STAGE_GE_5, //int stages
@@ -3652,31 +3677,6 @@ static const weaponAttributes_t bg_weapons[ ] =
TEAM_HUMANS //team_t team;
},
{
- WP_SMOKE, //int weaponNum;
- SMOKE_PRICE, //int price;
- STAGE_GE_5, //int stages
- SLOT_NONE, //int slots;
- "smoke", //char *weaponName;
- "Smoke", //char *weaponHumanName;
- "",
- 1, //int maxAmmo;
- 0, //int maxClips;
- qfalse, //int infiniteAmmo;
- qfalse, //int usesEnergy;
- SMOKE_REPEAT, //int repeatRate1;
- 0, //int repeatRate2;
- 0, //int repeatRate3;
- 0, //int reloadTime;
- SMOKE_K_SCALE, //float knockbackScale;
- qfalse, //qboolean hasAltMode;
- qfalse, //qboolean hasThirdMode;
- qfalse, //qboolean canZoom;
- 90.0f, //float zoomFov;
- qfalse, //qboolean purchasable;
- qfalse, //qboolean longRanged;
- TEAM_HUMANS //WUTeam_t team;
- },
- {
WP_MINE, //int weaponNum;
MINE_PRICE, //int price;
STAGE_GE_5, //int stages
diff --git a/src/game/bg_mod.h b/src/game/bg_mod.h
index 5e4245b..6f09037 100644
--- a/src/game/bg_mod.h
+++ b/src/game/bg_mod.h
@@ -8,6 +8,7 @@ MOD( MOD_CHAINGUN ),
MOD( MOD_PRIFLE ),
MOD( MOD_MDRIVER ),
MOD( MOD_LASGUN ),
+MOD( MOD_LIGHTNING ),
MOD( MOD_LCANNON ),
MOD( MOD_LCANNON_SPLASH ),
MOD( MOD_FLAMER ),
@@ -18,7 +19,6 @@ MOD( MOD_GRENADE ),
MOD( MOD_PSAWBLADE ),
MOD( MOD_MINE ),
MOD( MOD_FLAMES ),
-MOD( MOD_SMOKE ),
MOD( MOD_SPITEFUL_ABCESS ),
MOD( MOD_WATER ),
MOD( MOD_SLIME ),
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 9edd57b..bbf064e 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -357,10 +357,10 @@ typedef enum
WP_CHAINGUN,
WP_FLAMER,
WP_PULSE_RIFLE,
+ WP_LIGHTNING_GUN,
WP_LUCIFER_CANNON,
WP_ROCKET_LAUNCHER,
WP_GRENADE,
- WP_SMOKE,
WP_MINE,
WP_LOCKBLOB_LAUNCHER,
WP_HIVE,
diff --git a/src/game/g_active.c b/src/game/g_active.c
index c7a8977..951a3a9 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -1941,21 +1941,6 @@ void ClientThink_real( gentity_t *ent )
ent->s.weapon = lastWeapon;
}
- if( BG_InventoryContainsUpgrade( UP_SMOKE, client->ps.stats ) &&
- BG_UpgradeIsActive( UP_SMOKE, client->ps.stats ) )
- {
- int lastWeapon = ent->s.weapon;
-
- //remove SMOKE
- BG_DeactivateUpgrade( UP_SMOKE, client->ps.stats );
- BG_RemoveUpgradeFromInventory( UP_SMOKE, client->ps.stats );
-
- //M-M-M-M-MONSTER HACK
- ent->s.weapon = WP_SMOKE;
- FireWeapon( ent );
- ent->s.weapon = lastWeapon;
- }
-
// set speed
if( client->ps.pm_type == PM_NOCLIP )
client->ps.speed = client->pers.flySpeed;
diff --git a/src/game/g_missile.c b/src/game/g_missile.c
index fddfe3b..ab0156b 100644
--- a/src/game/g_missile.c
+++ b/src/game/g_missile.c
@@ -1242,44 +1242,6 @@ gentity_t *launch_saw( gentity_t *self, vec3_t start, vec3_t dir )
return bolt;
}
-
-gentity_t *launch_smoke( gentity_t *self, vec3_t start, vec3_t dir )
-{
- gentity_t *bolt;
-
- VectorNormalize( dir );
- bolt = G_Spawn( );
- bolt->classname = "smoke";
- bolt->nextthink = level.time + 200;
- bolt->think = G_ProcessSmoke;
- bolt->s.eType = ET_MISSILE;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
- bolt->s.weapon = WP_SMOKE;
- bolt->s.eFlags = EF_BOUNCE_HALF;
- bolt->s.generic1 = WPM_PRIMARY; //weaponMode
- bolt->r.ownerNum = self->s.number;
- bolt->parent = self;
- bolt->damage = SMOKE_DAMAGE;
- bolt->splashDamage = 0;
- bolt->splashRadius = 0;
- bolt->methodOfDeath = MOD_SMOKE;
- bolt->splashMethodOfDeath = MOD_SMOKE;
- bolt->clipmask = MASK_SHOT;
- bolt->target_ent = NULL;
- bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -3.0f;
- bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = 3.0f;
- bolt->s.time = level.time;
- bolt->s.pos.trType = TR_GRAVITY;
- 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, SMOKE_SPEED, bolt->s.pos.trDelta );
- SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
-
- VectorCopy( start, bolt->r.currentOrigin );
-
- return bolt;
-}
-
/*
================
AHive_SearchAndDestroy
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index 5453913..1c333ab 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -698,18 +698,6 @@ void acidBombFire2x( gentity_t *ent, int wp )
/*
======================================================================
-SMOKE
-======================================================================
-*/
-
-void throwSmoke( gentity_t *ent )
-{
- gentity_t *m;
- m = launch_smoke( ent, muzzle, forward );
-}
-
-/*
-======================================================================
LAS GUN
======================================================================
*/
@@ -831,9 +819,7 @@ void LCChargeFire( gentity_t *ent, qboolean secondary )
/*
======================================================================
-
-PULSE RIFLE
-
+ROCKET LAUNCHER
======================================================================
*/
@@ -842,6 +828,48 @@ void rocketLauncherFire( gentity_t *ent )
fire_rocket( ent, muzzle, forward );
}
+
+/*
+======================================================================
+LIGHTNING GUN
+======================================================================
+*/
+
+void lightningGunFire( gentity_t *ent )
+{
+ vec3_t start, end;
+ trace_t tr;
+ gentity_t *target;
+
+ VectorMA( muzzle, LIGHTNING_RANGE, forward, end );
+
+ G_UnlaggedOn( ent, muzzle, LIGHTNING_RANGE );
+ trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT );
+ G_UnlaggedOff( );
+
+ if( tr.fraction == 1.0f ||
+ tr.entityNum == ENTITYNUM_NONE ||
+ ( tr.surfaceFlags & SURF_NOIMPACT ) )
+ return;
+
+ target = g_entities + tr.entityNum;
+
+ if( target->s.eType == ET_PLAYER || target->s.eType == ET_BUILDABLE )
+ BloodSpurt( ent, target, &tr );
+ else
+ {
+ gentity_t *tent;
+
+ tent = G_TempEntity( tr.endpos, EV_MISSILE_MISS );
+ tent->s.eventParm = DirToByte( tr.plane.normal );
+ tent->s.weapon = ent->s.weapon;
+ tent->s.generic1 = ent->s.generic1;
+ }
+
+ G_Damage( target, ent, ent, forward, tr.endpos, LIGHTNING_DAMAGE, 0, MOD_LIGHTNING );
+}
+
+
/*
======================================================================
TESLA GENERATOR
@@ -1988,15 +2016,15 @@ void FireWeapon( gentity_t *ent )
case WP_ROCKET_LAUNCHER:
rocketLauncherFire( ent );
break;
+ case WP_LIGHTNING_GUN:
+ lightningGunFire( ent );
+ break;
case WP_GRENADE:
throwGrenade( ent );
break;
case WP_MINE:
throwMine( ent );
break;
- case WP_SMOKE:
- throwSmoke( ent );
- break;
case WP_LOCKBLOB_LAUNCHER:
lockBlobLauncherFire( ent );
break;
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index d05ebe4..3b9c8bc 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -514,6 +514,14 @@ TREMULOUS EDGE MOD SRC FILE
#define PRIFLE_SECONDARY_SPEED 900
#define PRIFLE_SECONDARY_REPEAT 400
+#define LIGHTNING_PRICE 500
+#define LIGHTNING_AMMO 300
+#define LIGHTNING_K_SCALE 1
+#define LIGHTNING_DPS 60 // damage per second
+#define LIGHTNING_REPEAT 50 // keep it as low as possible
+#define LIGHTNING_DAMAGE ( LIGHTNING_DPS * LIGHTNING_REPEAT / 1000 )
+#define LIGHTNING_RANGE 450
+
#define LCANNON_PRICE 600
#define LCANNON_AMMO 80
#define LCANNON_K_SCALE 1.0f