summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_misc.c24
-rw-r--r--src/game/bg_public.h8
-rw-r--r--src/game/g_buildable.c15
-rw-r--r--src/game/g_combat.c4
-rw-r--r--src/game/g_weapon.c15
-rw-r--r--src/game/tremulous.h7
6 files changed, 61 insertions, 12 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index bcb90316..0a9e2928 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -344,7 +344,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean usable;
MGTURRET_RANGE, //int turretRange;
MGTURRET_REPEAT, //int turretFireSpeed;
- WP_MACHINEGUN, //weapon_t turretProjType;
+ WP_MGTURRET, //weapon_t turretProjType;
0.95f, //float minNormal;
qfalse, //qboolean invertNormal;
qfalse, //qboolean creepTest;
@@ -2624,6 +2624,28 @@ weaponAttributes_t bg_weapons[ ] =
WUT_ALIENS //WUTeam_t team;
},
{
+ WP_MGTURRET, //int weaponNum;
+ 0, //int price;
+ ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
+ SLOT_WEAPON, //int slots;
+ "mgturret", //char *weaponName;
+ "Machinegun Turret", //char *weaponHumanName;
+ 0, //int quan;
+ 0, //int clips;
+ 0, //int maxClips;
+ qtrue, //int infiniteAmmo;
+ qfalse, //int usesEnergy;
+ 0, //int repeatRate1;
+ 0, //int repeatRate2;
+ 0, //int repeatRate3;
+ 0, //int reloadTime;
+ qfalse, //qboolean hasAltMode;
+ qfalse, //qboolean hasThirdMode;
+ qfalse, //qboolean purchasable;
+ 0, //int buildDelay;
+ WUT_HUMANS //WUTeam_t team;
+ },
+ {
WP_TESLAGEN, //int weaponNum;
0, //int price;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index ffeefc70..f2b63342 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -332,6 +332,7 @@ typedef enum
WP_LOCKBLOB_LAUNCHER,
WP_TESLAGEN,
+ WP_MGTURRET,
//build weapons must remain in a block
WP_ABUILD,
@@ -717,7 +718,8 @@ typedef struct animation_s
// flip the togglebit every time an animation
// changes so a restart of the same anim can be detected
-#define ANIM_TOGGLEBIT 128
+#define ANIM_TOGGLEBIT 0x80
+#define ANIM_FORCEBIT 0x40
typedef enum
@@ -782,6 +784,8 @@ typedef enum
MOD_MACHINEGUN,
MOD_CHAINGUN,
MOD_PRIFLE,
+ MOD_MDRIVER,
+ MOD_LASGUN,
MOD_LCANNON,
MOD_LCANNON_SPLASH,
MOD_FLAMER,
@@ -812,6 +816,8 @@ typedef enum
MOD_HSPAWN,
MOD_TESLAGEN,
+ MOD_MGTURRET,
+
MOD_ASPAWN,
MOD_ATUBE,
MOD_OVERMIND
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 8163bbf9..cb48dc21 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -25,7 +25,9 @@ void G_setBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim, qboolean fo
int localAnim = anim;
if( force )
- localAnim |= ANIM_TOGGLEBIT;
+ localAnim |= ANIM_FORCEBIT;
+
+ localAnim |= ( ( ent->s.legsAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT );
ent->s.legsAnim = localAnim;
}
@@ -1534,7 +1536,11 @@ void HTeslaGen_FireOnEnemy( gentity_t *self, int firespeed )
//fire at target
FireWeapon( self );
+
+ self->s.eFlags |= EF_FIRING;
+ G_AddEvent( self, EV_FIRE_WEAPON, 0 );
G_setBuildableAnim( self, BANIM_ATTACK1, qfalse );
+
self->count = level.time + firespeed;
}
@@ -1549,7 +1555,11 @@ void HMGTurret_FireOnEnemy( gentity_t *self, int firespeed )
{
//fire at target
FireWeapon( self );
+
+ self->s.eFlags |= EF_FIRING;
+ G_AddEvent( self, EV_FIRE_WEAPON, 0 );
G_setBuildableAnim( self, BANIM_ATTACK1, qfalse );
+
self->count = level.time + firespeed;
}
@@ -1640,6 +1650,9 @@ void HDef_Think( gentity_t *self )
self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex );
+ //used for client side muzzle flashes
+ self->s.eFlags &= ~EF_FIRING;
+
//if not powered don't do anything and check again for power next think
if( !( self->powered = findPower( self ) ) )
{
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 8c82dd2e..2410821b 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -118,6 +118,8 @@ char *modNames[ ] =
"MOD_MACHINEGUN",
"MOD_CHAINGUN",
"MOD_PRIFLE",
+ "MOD_MDRIVER",
+ "MOD_LASGUN",
"MOD_LCANNON",
"MOD_LCANNON_SPLASH",
"MOD_FLAMER",
@@ -148,6 +150,8 @@ char *modNames[ ] =
"MOD_HSPAWN",
"MOD_TESLAGEN",
+ "MOD_MGTURRET",
+
"MOD_ASPAWN",
"MOD_ATUBE",
"MOD_OVERMIND"
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index a7809263..79bd1cb7 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -151,7 +151,7 @@ void bulletFire( gentity_t *ent, float spread, int damage, int mod )
if( traceEnt->takedamage )
{
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
- damage, 0, MOD_MACHINEGUN );
+ damage, 0, mod );
}
}
@@ -188,7 +188,7 @@ void massDriverFire( gentity_t *ent )
if( traceEnt->takedamage )
{
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
- MDRIVER_DMG, 0, MOD_MACHINEGUN );
+ MDRIVER_DMG, 0, MOD_MDRIVER );
}
}
@@ -303,7 +303,7 @@ void lasGunFire( gentity_t *ent )
tent->s.otherEntityNum = ent->s.number;
if( traceEnt->takedamage )
- G_Damage( traceEnt, ent, ent, forward, tr.endpos, LASGUN_DAMAGE, 0, MOD_MACHINEGUN );
+ G_Damage( traceEnt, ent, ent, forward, tr.endpos, LASGUN_DAMAGE, 0, MOD_LASGUN );
}
/*
@@ -386,9 +386,7 @@ void teslaFire( gentity_t *ent )
trace_t tr;
vec3_t end;
gentity_t *traceEnt, *tent;
- int damage, i, passent;
-
- damage = 8;
+ int i, passent;
VectorMA( muzzle, TESLAGEN_RANGE, forward, end );
@@ -402,7 +400,7 @@ void teslaFire( gentity_t *ent )
if( traceEnt->takedamage)
{
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
- damage, 0, MOD_TESLAGEN );
+ TESLAGEN_DMG, 0, MOD_TESLAGEN );
}
// snap the endpos to integers to save net bandwidth, but nudged towards the line
@@ -1091,6 +1089,9 @@ void FireWeapon( gentity_t *ent )
case WP_TESLAGEN:
teslaFire( ent );
break;
+ case WP_MGTURRET:
+ bulletFire( ent, MGTURRET_SPREAD, MGTURRET_DMG, MOD_MGTURRET );
+ break;
case WP_ABUILD:
buildFire( ent, MN_A_BUILD );
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index 4bac0e4e..f9ec2ef3 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -421,17 +421,20 @@
#define MGTURRET_SPLASHDAMAGE 50
#define MGTURRET_SPLASHRADIUS 100
#define MGTURRET_ANGULARSPEED 5 //degrees/think ~= 200deg/sec
-#define MGTURRET_ACCURACYTOLERANCE MGTURRET_ANGULARSPEED / 2 //angular difference for turret to fire
+#define MGTURRET_ACCURACYTOLERANCE MGTURRET_ANGULARSPEED / 1.5f //angular difference for turret to fire
#define MGTURRET_VERTICALCAP 30 // +/- maximum pitch
#define MGTURRET_REPEAT 100
#define MGTURRET_RANGE 250
+#define MGTURRET_SPREAD 200
+#define MGTURRET_DMG HDM(5)
#define TESLAGEN_BP 100
#define TESLAGEN_HEALTH HBHM(200)
#define TESLAGEN_SPLASHDAMAGE 50
#define TESLAGEN_SPLASHRADIUS 100
#define TESLAGEN_REPEAT 500
-#define TESLAGEN_RANGE 1500
+#define TESLAGEN_RANGE 750
+#define TESLAGEN_DMG HDM(50)
#define DC_BP 80
#define DC_HEALTH HBHM(150)