summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2001-09-23 04:22:29 +0000
committerTim Angus <tim@ngus.net>2001-09-23 04:22:29 +0000
commitd511ec1caee3717f9652c8366a054c3046f6e2f6 (patch)
treebd4cbd9bba21cf94942e9d851954ce819a998888
parent34cf532f87cff433dd7fdca28ae2eaa3eb7e123d (diff)
Random tweaks
-rw-r--r--Makefile4
-rw-r--r--src/cgame/cg_scanner.c103
-rw-r--r--src/game/bg_misc.c42
-rw-r--r--src/game/bg_public.h1
-rw-r--r--src/game/g_active.c6
-rw-r--r--src/game/g_buildable.c26
6 files changed, 129 insertions, 53 deletions
diff --git a/Makefile b/Makefile
index 6245e089..36d93521 100644
--- a/Makefile
+++ b/Makefile
@@ -187,7 +187,9 @@ makedirs:
@if [ ! -d $(BQ)/$(UIDIRNAME) ];then mkdir $(BQ)/$(UIDIRNAME);fi
ctags:
- ctags -f src/tags -R src/*
+ cd src
+ ctags -f tags -R *
+ cd ..
# --object lists for each build type--
GQVMOBJ = $(GOBJ:%.o=$(BQ)/%.asm)
diff --git a/src/cgame/cg_scanner.c b/src/cgame/cg_scanner.c
index e8ba439c..75b7eefa 100644
--- a/src/cgame/cg_scanner.c
+++ b/src/cgame/cg_scanner.c
@@ -24,13 +24,49 @@
#include "cg_local.h"
+#define RANGE 1000.0f
+
+/*#define XPOS 140.0f
+#define YPOS 320.0f
+#define WIDTH 360.0f
+#define HEIGHT 80.0f*/
+#define XPOS 0.0f
+#define YPOS 0.0f
+#define WIDTH 640.0f
+#define HEIGHT 480.0f
+
+#define STALKWIDTH 2.0f
+#define BLIPX 16.0f
+#define BLIPY 8.0f
+
+static void CG_DrawBlips( vec3_t origin, vec4_t colour )
+{
+ vec3_t drawOrigin;
+ vec3_t up = { 0, 0, 1 };
+
+ RotatePointAroundVector( drawOrigin, up, origin, -cg.refdefViewAngles[ 1 ] - 90 );
+ drawOrigin[ 0 ] /= ( 2 * RANGE / WIDTH );
+ drawOrigin[ 1 ] /= ( 2 * RANGE / HEIGHT );
+ drawOrigin[ 2 ] /= ( 2 * RANGE / WIDTH );
+
+ trap_R_SetColor( colour );
+ CG_DrawPic( XPOS + ( WIDTH / 2 ) - ( STALKWIDTH / 2 ) - drawOrigin[ 0 ],
+ YPOS + ( HEIGHT / 2 ) + drawOrigin[ 1 ],
+ STALKWIDTH, -drawOrigin[ 2 ], cgs.media.scannerLineShader );
+ CG_DrawPic( XPOS + ( WIDTH / 2 ) - ( BLIPX / 2 ) - drawOrigin[ 0 ],
+ YPOS + ( HEIGHT / 2 ) - ( BLIPY / 2 ) + drawOrigin[ 1 ] - drawOrigin[ 2 ],
+ BLIPX, BLIPY, cgs.media.scannerBlipShader );
+ trap_R_SetColor( NULL );
+}
+
+/*
+Global Scanner draw
+*/
void CG_Scanner( )
{
int i;
vec3_t origin;
vec3_t relOrigin;
- vec3_t drawOrigin;
- vec3_t up = { 0, 0, 1 };
vec4_t hIabove = { 0, 1, 0, 1 };
vec4_t hIbelow = { 0, 0.5, 0, 1 };
vec4_t aIabove = { 1, 0, 0, 1 };
@@ -38,80 +74,45 @@ void CG_Scanner( )
VectorCopy( cg.refdef.vieworg, origin );
+ //draw human items below scanner plane
for( i = 0; i < cgIP.numHumanItems; i++ )
{
VectorClear( relOrigin );
VectorSubtract( cgIP.humanItemPositions[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < 1000 && ( relOrigin[ 2 ] < 0 ) )
- {
- RotatePointAroundVector( drawOrigin, up, relOrigin, -cg.refdefViewAngles[ 1 ]-90 );
- drawOrigin[ 0 ] /= ( 1000 / 180 );
- drawOrigin[ 1 ] /= ( 1000 / 40 );
- drawOrigin[ 2 ] /= ( 1000 / 180 );
-
- trap_R_SetColor( hIbelow );
- CG_DrawPic( 319 - drawOrigin[ 0 ], 360 + drawOrigin[ 1 ], 2, -drawOrigin[ 2 ], cgs.media.scannerLineShader );
- CG_DrawPic( 312 - drawOrigin[ 0 ], 356 + drawOrigin[ 1 ] - drawOrigin[ 2 ], 16, 8, cgs.media.scannerBlipShader );
- trap_R_SetColor( NULL );
- }
+ if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] < 0 ) )
+ CG_DrawBlips( relOrigin, hIbelow );
}
+ //draw alien items below scanner plane
for( i = 0; i < cgIP.numDroidItems; i++ )
{
VectorClear( relOrigin );
VectorSubtract( cgIP.droidItemPositions[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < 1000 && ( relOrigin[ 2 ] < 0 ) )
- {
- RotatePointAroundVector( drawOrigin, up, relOrigin, -cg.refdefViewAngles[ 1 ]-90 );
- drawOrigin[ 0 ] /= ( 1000 / 180 );
- drawOrigin[ 1 ] /= ( 1000 / 40 );
- drawOrigin[ 2 ] /= ( 1000 / 180 );
-
- trap_R_SetColor( aIbelow );
- CG_DrawPic( 319 - drawOrigin[ 0 ], 360 + drawOrigin[ 1 ], 2, -drawOrigin[ 2 ], cgs.media.scannerLineShader );
- CG_DrawPic( 312 - drawOrigin[ 0 ], 356 + drawOrigin[ 1 ] - drawOrigin[ 2 ], 16, 8, cgs.media.scannerBlipShader );
- trap_R_SetColor( NULL );
- }
+ if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] < 0 ) )
+ CG_DrawBlips( relOrigin, aIbelow );
}
- CG_DrawPic( 140, 320, 360, 80, cgs.media.scannerShader );
+ /*CG_DrawPic( XPOS, YPOS, WIDTH, HEIGHT, cgs.media.scannerShader );*/
+ //draw human items above scanner plane
for( i = 0; i < cgIP.numHumanItems; i++ )
{
VectorClear( relOrigin );
VectorSubtract( cgIP.humanItemPositions[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < 1000 && ( relOrigin[ 2 ] > 0 ) )
- {
- RotatePointAroundVector( drawOrigin, up, relOrigin, -cg.refdefViewAngles[ 1 ]-90 );
- drawOrigin[ 0 ] /= ( 1000 / 180 );
- drawOrigin[ 1 ] /= ( 1000 / 40 );
- drawOrigin[ 2 ] /= ( 1000 / 180 );
-
- trap_R_SetColor( hIabove );
- CG_DrawPic( 319 - drawOrigin[ 0 ], 360 + drawOrigin[ 1 ], 2, -drawOrigin[ 2 ], cgs.media.scannerLineShader );
- CG_DrawPic( 312 - drawOrigin[ 0 ], 356 + drawOrigin[ 1 ] - drawOrigin[ 2 ], 16, 8, cgs.media.scannerBlipShader );
- trap_R_SetColor( NULL );
- }
+ if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] > 0 ) )
+ CG_DrawBlips( relOrigin, hIabove );
}
+
+ //draw alien items above scanner plane
for( i = 0; i < cgIP.numDroidItems; i++ )
{
VectorClear( relOrigin );
VectorSubtract( cgIP.droidItemPositions[ i ], origin, relOrigin );
- if( VectorLength( relOrigin ) < 1000 && ( relOrigin[ 2 ] > 0 ) )
- {
- RotatePointAroundVector( drawOrigin, up, relOrigin, -cg.refdefViewAngles[ 1 ]-90 );
- drawOrigin[ 0 ] /= ( 1000 / 180 );
- drawOrigin[ 1 ] /= ( 1000 / 40 );
- drawOrigin[ 2 ] /= ( 1000 / 180 );
-
- trap_R_SetColor( aIabove );
- CG_DrawPic( 319 - drawOrigin[ 0 ], 360 + drawOrigin[ 1 ], 2, -drawOrigin[ 2 ], cgs.media.scannerLineShader );
- CG_DrawPic( 312 - drawOrigin[ 0 ], 356 + drawOrigin[ 1 ] - drawOrigin[ 2 ], 16, 8, cgs.media.scannerBlipShader );
- trap_R_SetColor( NULL );
- }
+ if( VectorLength( relOrigin ) < RANGE && ( relOrigin[ 2 ] > 0 ) )
+ CG_DrawBlips( relOrigin, aIabove );
}
}
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 431f433f..32c20566 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -881,6 +881,22 @@ TA: droid defense item
"" //sounds
},
+/*QUAKED team_droid_trapper (0 0 1) (-16 -16 -16) (16 16 16)
+TA: droid defense item
+*/
+ {
+ "team_droid_booster",
+ "sound/items/holdable.wav",
+ { "models/buildables/booster/booster.md3", 0, 0, 0 },
+ "icons/teleporter", //icon
+ "Booster", //pickup
+ 0,
+ IT_BUILDABLE,
+ BA_D_BOOSTER,
+ "", //precache
+ "" //sounds
+ },
+
/*QUAKED team_droid_hivemind (0 0 1) (-16 -16 -16) (16 16 16)
TA: droid build limitation item
*/
@@ -1260,6 +1276,32 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse //qboolean reactorTest;
},
{
+ BA_D_BOOSTER, //int buildNum;
+ "booster", //char *buildName;
+ "team_droid_booster", //char *entityName;
+ { -15, -15, -15 }, //vec3_t mins;
+ { 15, 15, 15 }, //vec3_t maxs;
+ TR_GRAVITY, //trType_t traj;
+ 0.0, //float bounce;
+ 80, //int buildPoints;
+ 1000, //int health;
+ 50, //int damage;
+ 20, //int splashDamage;
+ 50, //int splashRadius;
+ MOD_DSPAWN, //int meansOfDeath;
+ BIT_DROIDS, //int team;
+ ( 1 << WP_DBUILD )|( 1 << WP_DBUILD2 ), //weapon_t buildWeapon;
+ BANIM_IDLE1, //int idleAnim;
+ 100, //int nextthink;
+ 0, //int turretFireSpeed;
+ 0, //int turretRange;
+ WP_NONE, //weapon_t turretProjType;
+ 0.707f, //float minNormal;
+ qfalse, //qboolean invertNormal;
+ qtrue, //qboolean creepTest;
+ qfalse //qboolean reactorTest;
+ },
+ {
BA_D_ACIDTUBE, //int buildNum;
"acid_tube", //char *buildName;
"team_droid_acid_tube",//char *entityName;
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index e03ef4bd..b0acd7a7 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -403,6 +403,7 @@ typedef enum
BA_D_BARRICADE,
BA_D_ACIDTUBE,
BA_D_TRAPPER,
+ BA_D_BOOSTER,
BA_H_SPAWN,
diff --git a/src/game/g_active.c b/src/game/g_active.c
index 95b638b3..5abeeaf8 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -848,7 +848,11 @@ void ClientThink_real( gentity_t *ent ) {
( temp_v[ 2 ] <= 21 ) && //assumes mins of player is (x, x, -24)
( client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) )
{
- client->ps.speed *= 0.5;
+ if( BG_gotItem( UP_LIMBARMOUR, client->ps.stats ) )
+ client->ps.speed *= 0.75;
+ else
+ client->ps.speed *= 0.5;
+
client->ps.stats[ STAT_STATE ] |= SS_CREEPSLOWED;
cSlowed = qtrue;
break;
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 09630f5b..013a7e93 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -590,6 +590,25 @@ void DAcidTube_Think( gentity_t *self )
//==================================================================================
+
+/*
+================
+DBooster_Touch
+
+Called when an alien touches a booster
+================
+*/
+void DBooster_Touch( gentity_t *self, gentity_t *other, trace_t *trace )
+{
+ G_Printf( "%d is touching me\n", other->s.number );
+}
+
+
+
+
+//==================================================================================
+
+
#define BLOB_PROJSPEED 500
/*
@@ -1736,6 +1755,13 @@ gentity_t *G_buildItem( gentity_t *ent, buildable_t buildable, int distance, flo
built->pain = DBarricade_Pain;
break;
+ case BA_D_BOOSTER:
+ built->die = DBarricade_Die;
+ built->think = DBarricade_Think;
+ built->pain = DBarricade_Pain;
+ built->touch = DBooster_Touch;
+ break;
+
case BA_D_ACIDTUBE:
built->die = DBarricade_Die;
built->think = DAcidTube_Think;