From f4413207a03658c719987d02fdbb87443843f43b Mon Sep 17 00:00:00 2001 From: enneract Date: Sun, 23 Nov 2014 22:29:30 +0100 Subject: Remove Smoke Grenade. --- src/game/bg_misc.c | 25 ------------------------- src/game/bg_mod.h | 1 - src/game/bg_public.h | 1 - src/game/g_active.c | 15 --------------- src/game/g_missile.c | 38 -------------------------------------- src/game/g_weapon.c | 15 --------------- 6 files changed, 95 deletions(-) (limited to 'src/game') diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 92f3826..742363d 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -3651,31 +3651,6 @@ static const weaponAttributes_t bg_weapons[ ] = qfalse, //qboolean longRanged; 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; diff --git a/src/game/bg_mod.h b/src/game/bg_mod.h index 5e4245b..4929b32 100644 --- a/src/game/bg_mod.h +++ b/src/game/bg_mod.h @@ -18,7 +18,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 2ca9e32..c0b6381 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -359,7 +359,6 @@ typedef enum 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 830d72a..2056f79 100644 --- a/src/game/g_missile.c +++ b/src/game/g_missile.c @@ -1241,44 +1241,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..d869fb1 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -696,18 +696,6 @@ void acidBombFire2x( gentity_t *ent, int wp ) m = fire_acidBomb2( ent, muzzle, forward, wp ); } -/* -====================================================================== -SMOKE -====================================================================== -*/ - -void throwSmoke( gentity_t *ent ) -{ - gentity_t *m; - m = launch_smoke( ent, muzzle, forward ); -} - /* ====================================================================== LAS GUN @@ -1994,9 +1982,6 @@ void FireWeapon( gentity_t *ent ) case WP_MINE: throwMine( ent ); break; - case WP_SMOKE: - throwSmoke( ent ); - break; case WP_LOCKBLOB_LAUNCHER: lockBlobLauncherFire( ent ); break; -- cgit From b0a9981e09bbc7c30769f680a4e0ff17c9ea8239 Mon Sep 17 00:00:00 2001 From: enneract Date: Mon, 24 Nov 2014 02:20:51 +0100 Subject: Implement the Lightning Gun. --- src/game/bg_misc.c | 25 +++++++++++++++++++++++++ src/game/bg_mod.h | 1 + src/game/bg_public.h | 1 + src/game/g_weapon.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- src/game/tremulous.h | 8 ++++++++ 5 files changed, 81 insertions(+), 3 deletions(-) (limited to 'src/game') diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 742363d..efdc300 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -3574,6 +3574,31 @@ static const weaponAttributes_t bg_weapons[ ] = qtrue, //qboolean longRanged; 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; diff --git a/src/game/bg_mod.h b/src/game/bg_mod.h index 4929b32..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 ), diff --git a/src/game/bg_public.h b/src/game/bg_public.h index c0b6381..18b0d2e 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -356,6 +356,7 @@ typedef enum WP_CHAINGUN, WP_FLAMER, WP_PULSE_RIFLE, + WP_LIGHTNING_GUN, WP_LUCIFER_CANNON, WP_ROCKET_LAUNCHER, WP_GRENADE, diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index d869fb1..1c333ab 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -819,9 +819,7 @@ void LCChargeFire( gentity_t *ent, qboolean secondary ) /* ====================================================================== - -PULSE RIFLE - +ROCKET LAUNCHER ====================================================================== */ @@ -830,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 @@ -1976,6 +2016,9 @@ 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; diff --git a/src/game/tremulous.h b/src/game/tremulous.h index e7512d5..b42a7b4 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -514,6 +514,14 @@ TREMULOUS EDGE MOD SRC FILE #define PRIFLE_SECONDARY_SPEED 800 #define PRIFLE_SECONDARY_REPEAT 400 +#define LIGHTNING_PRICE 500 +#define LIGHTNING_AMMO 500 +#define LIGHTNING_K_SCALE 500 +#define LIGHTNING_DPS 100 // 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 -- cgit From 0aa94f6b6b7b49972a839aadaee4dbb42a3a53de Mon Sep 17 00:00:00 2001 From: enneract Date: Tue, 25 Nov 2014 01:45:57 +0100 Subject: Lightning Gun assets. --- src/game/tremulous.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/game') diff --git a/src/game/tremulous.h b/src/game/tremulous.h index b42a7b4..ad4a688 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -515,9 +515,9 @@ TREMULOUS EDGE MOD SRC FILE #define PRIFLE_SECONDARY_REPEAT 400 #define LIGHTNING_PRICE 500 -#define LIGHTNING_AMMO 500 -#define LIGHTNING_K_SCALE 500 -#define LIGHTNING_DPS 100 // damage per second +#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 -- cgit