summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_misc.c59
-rw-r--r--src/game/bg_public.h4
-rw-r--r--src/game/g_buildable.c28
-rw-r--r--src/game/g_local.h2
-rw-r--r--src/game/g_weapon.c8
-rw-r--r--src/game/tremulous.h4
6 files changed, 85 insertions, 20 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index ccddcedb..2b51efbc 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -2063,6 +2063,7 @@ weaponAttributes_t bg_weapons[ ] =
"Rifle", //char *weaponHumanName;
{ "models/weapons2/machinegun/machinegun.md3", 0, 0, 0 },
"icons/iconw_machinegun",
+ "gfx/2d/crosshaira", 24,
RIFLE_CLIPSIZE, //int quan;
RIFLE_SPAWNCLIPS, //int clips;
RIFLE_MAXCLIPS, //int maxClips;
@@ -2087,6 +2088,7 @@ weaponAttributes_t bg_weapons[ ] =
"Flame Thrower", //char *weaponHumanName;
{ "models/weapons2/plasma/plasma.md3", 0, 0, 0 },
"icons/iconw_plasma",
+ "gfx/2d/crosshaira", 24,
FLAMER_GAS, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2111,6 +2113,7 @@ weaponAttributes_t bg_weapons[ ] =
"Chaingun", //char *weaponHumanName;
{ "models/weapons2/machinegun/machinegun.md3", 0, 0, 0 },
"icons/iconw_machinegun",
+ "gfx/2d/crosshairb", 48,
CHAINGUN_BULLETS, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2135,6 +2138,7 @@ weaponAttributes_t bg_weapons[ ] =
"Mass Driver", //char *weaponHumanName;
{ "models/weapons2/bfg/bfg.md3", 0, 0, 0 },
"icons/iconw_bfg",
+ "gfx/2d/crosshaira", 24,
MDRIVER_CLIPSIZE, //int quan;
MDRIVER_SPAWNCLIPS, //int clips;
MDRIVER_MAXCLIPS, //int maxClips;
@@ -2159,6 +2163,7 @@ weaponAttributes_t bg_weapons[ ] =
"Pulse Rifle", //char *weaponHumanName;
{ "models/weapons2/plasma/plasma.md3", 0, 0, 0 },
"icons/iconw_plasma",
+ "gfx/2d/crosshaira", 24,
PRIFLE_CLIPS, //int quan;
PRIFLE_SPAWNCLIPS, //int clips;
PRIFLE_MAXCLIPS, //int maxClips;
@@ -2183,6 +2188,7 @@ weaponAttributes_t bg_weapons[ ] =
"Lucifer Canon", //char *weaponHumanName;
{ "models/weapons2/bfg/bfg.md3", 0, 0, 0 },
"icons/iconw_bfg",
+ "gfx/2d/crosshaira", 24,
LCANON_AMMO, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2207,6 +2213,7 @@ weaponAttributes_t bg_weapons[ ] =
"Las Gun", //char *weaponHumanName;
{ "models/weapons2/grenadel/grenadel.md3", 0, 0, 0 },
"icons/iconw_plasma",
+ "gfx/2d/crosshaira", 24,
LASGUN_AMMO, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2231,6 +2238,7 @@ weaponAttributes_t bg_weapons[ ] =
"Pain Saw", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2255,6 +2263,7 @@ weaponAttributes_t bg_weapons[ ] =
"Construction Kit", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2279,6 +2288,7 @@ weaponAttributes_t bg_weapons[ ] =
"Adv Construction Kit",//char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2303,6 +2313,7 @@ weaponAttributes_t bg_weapons[ ] =
"Alien build weapon", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2327,6 +2338,7 @@ weaponAttributes_t bg_weapons[ ] =
"Alien build weapon2",//char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2351,6 +2363,7 @@ weaponAttributes_t bg_weapons[ ] =
"Venom", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2375,6 +2388,7 @@ weaponAttributes_t bg_weapons[ ] =
"Claw and pounce", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2399,6 +2413,7 @@ weaponAttributes_t bg_weapons[ ] =
"Claw and pounce (upgrade)", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
3, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2423,6 +2438,7 @@ weaponAttributes_t bg_weapons[ ] =
"Claws", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2447,6 +2463,7 @@ weaponAttributes_t bg_weapons[ ] =
"Claws Upgrade", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2471,6 +2488,7 @@ weaponAttributes_t bg_weapons[ ] =
"Area Zap", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2495,6 +2513,7 @@ weaponAttributes_t bg_weapons[ ] =
"Directed Zap", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2519,6 +2538,7 @@ weaponAttributes_t bg_weapons[ ] =
"Ground Pound", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2543,6 +2563,7 @@ weaponAttributes_t bg_weapons[ ] =
"Lock Blob", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2567,6 +2588,7 @@ weaponAttributes_t bg_weapons[ ] =
"Tesla Generator", //char *weaponHumanName;
{ "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 },
"icons/iconw_gauntlet",
+ NULL, 0,
0, //int quan;
0, //int clips;
0, //int maxClips;
@@ -2746,6 +2768,43 @@ char *BG_FindIconForWeapon( int weapon )
/*
==============
+BG_FindCrosshairForWeapon
+==============
+*/
+char *BG_FindCrosshairForWeapon( int weapon )
+{
+ int i;
+
+ for( i = 0; i < bg_numWeapons; i++ )
+ {
+ if( bg_weapons[ i ].weaponNum == weapon )
+ return bg_weapons[ i ].crosshair;
+ }
+
+ //wimp out
+ return 0;
+}
+
+/*
+==============
+BG_FindCrosshairSizeForWeapon
+==============
+*/
+int BG_FindCrosshairSizeForWeapon( int weapon )
+{
+ int i;
+
+ for( i = 0; i < bg_numWeapons; i++ )
+ {
+ if( bg_weapons[ i ].weaponNum == weapon )
+ return bg_weapons[ i ].crosshairSize;
+ }
+
+ return 24;
+}
+
+/*
+==============
BG_FindAmmoForWeapon
==============
*/
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index f445945b..76115f18 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -911,6 +911,8 @@ typedef struct
char *models[ MAX_ITEM_MODELS ];
char *icon;
+ char *crosshair;
+ int crosshairSize;
int quan;
int clips;
@@ -1033,6 +1035,8 @@ int BG_FindWeaponNumForName( char *name );
char *BG_FindHumanNameForWeapon( int weapon );
char *BG_FindModelsForWeapon( int weapon, int modelNum );
char *BG_FindIconForWeapon( int weapon );
+char *BG_FindCrosshairForWeapon( int weapon );
+int BG_FindCrosshairSizeForWeapon( int weapon );
void BG_FindAmmoForWeapon( int weapon, int *quan, int *clips, int *maxClips );
qboolean BG_FindInfinteAmmoForWeapon( int weapon );
qboolean BG_FindUsesEnergyForWeapon( int weapon );
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index b6e2d02d..059cff1f 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -2095,7 +2095,7 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin
G_ValidateBuild
=================
*/
-void G_ValidateBuild( gentity_t *ent, buildable_t buildable )
+qboolean G_ValidateBuild( gentity_t *ent, buildable_t buildable )
{
weapon_t weapon;
float dist;
@@ -2107,61 +2107,61 @@ void G_ValidateBuild( gentity_t *ent, buildable_t buildable )
{
case IBE_NONE:
G_buildItem( ent, buildable, origin, ent->s.apos.trBase );
- break;
+ return qtrue;
case IBE_NOASSERT:
G_AddPredictableEvent( ent, EV_MENU, MN_A_NOASSERT );
- break;
+ return qfalse;
case IBE_NOHIVEMIND:
G_AddPredictableEvent( ent, EV_MENU, MN_A_NOHVMND );
- break;
+ return qfalse;
case IBE_HIVEMIND:
G_AddPredictableEvent( ent, EV_MENU, MN_A_HIVEMIND );
- break;
+ return qfalse;
case IBE_NORMAL:
G_AddPredictableEvent( ent, EV_MENU, MN_A_NORMAL );
- break;
+ return qfalse;
case IBE_REACTOR:
G_AddPredictableEvent( ent, EV_MENU, MN_H_REACTOR );
- break;
+ return qfalse;
case IBE_REPEATER:
G_AddPredictableEvent( ent, EV_MENU, MN_H_REPEATER );
- break;
+ return qfalse;
case IBE_NOROOM:
if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
G_AddPredictableEvent( ent, EV_MENU, MN_H_NOROOM );
else
G_AddPredictableEvent( ent, EV_MENU, MN_A_NOROOM );
- break;
+ return qfalse;
case IBE_NOPOWER:
G_AddPredictableEvent( ent, EV_MENU, MN_H_NOPOWER );
- break;
+ return qfalse;
case IBE_NODCC:
G_AddPredictableEvent( ent, EV_MENU, MN_H_NODCC );
- break;
+ return qfalse;
case IBE_SPWNWARN:
G_AddPredictableEvent( ent, EV_MENU, MN_A_SPWNWARN );
G_buildItem( ent, buildable, origin, ent->s.apos.trBase );
- break;
+ return qtrue;
case IBE_RPLWARN:
G_AddPredictableEvent( ent, EV_MENU, MN_H_RPLWARN );
G_buildItem( ent, buildable, origin, ent->s.apos.trBase );
- break;
+ return qtrue;
case IBE_RPTWARN:
G_AddPredictableEvent( ent, EV_MENU, MN_H_RPTWARN );
G_buildItem( ent, buildable, origin, ent->s.apos.trBase );
- break;
+ return qtrue;
}
}
diff --git a/src/game/g_local.h b/src/game/g_local.h
index ebe18d2e..d614fb28 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -547,7 +547,7 @@ typedef enum
itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance, vec3_t origin );
gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin, vec3_t angles );
-void G_ValidateBuild( gentity_t *ent, buildable_t buildable );
+qboolean G_ValidateBuild( gentity_t *ent, buildable_t buildable );
void G_setBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim, qboolean force );
void G_setIdleBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim );
void G_SpawnBuildable(gentity_t *ent, buildable_t buildable);
diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c
index 0837d7e2..e2d37d57 100644
--- a/src/game/g_weapon.c
+++ b/src/game/g_weapon.c
@@ -474,9 +474,11 @@ void buildFire( gentity_t *ent, dynMenu_t menu )
return;
}
- G_ValidateBuild( ent, ent->client->ps.stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT );
- ent->client->ps.stats[ STAT_BUILDABLE ] = BA_NONE;
- ent->client->ps.stats[ STAT_MISC ] += BG_FindBuildDelayForWeapon( ent->s.weapon );
+ if( G_ValidateBuild( ent, ent->client->ps.stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) )
+ {
+ ent->client->ps.stats[ STAT_BUILDABLE ] = BA_NONE;
+ ent->client->ps.stats[ STAT_MISC ] += BG_FindBuildDelayForWeapon( ent->s.weapon );
+ }
return;
}
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index 6d25456e..3af26fb5 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -285,9 +285,9 @@
#define CHAINGUN_DMG HDM(14)
#define FLAMER_GAS 400
-#define FLAMER_REPEAT 150
+#define FLAMER_REPEAT 300
#define FLAMER_PRICE 300
-#define FLAMER_DMG HDM(25)
+#define FLAMER_DMG HDM(30)
#define FLAMER_RADIUS 50
#define FLAMER_LIFETIME 1000.0f
#define FLAMER_SPEED 200.0f