diff options
-rw-r--r-- | src/cgame/cg_draw.c | 12 | ||||
-rw-r--r-- | src/game/bg_misc.c | 1315 | ||||
-rw-r--r-- | src/game/g_buildable.c | 2 | ||||
-rw-r--r-- | src/game/g_combat.c | 150 | ||||
-rw-r--r-- | src/game/g_weapon.c | 2 |
5 files changed, 746 insertions, 735 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 813a2c50..6f82deb0 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -604,10 +604,10 @@ static void CG_DrawStatusBar( void ) { CG_DrawFadePic( 20, 0, 30, 440, fcolor, tcolor, value, cgs.media.droidHealth ); - value = (int)( (float)( (float)ps->stats[STAT_ARMOR] / ps->stats[STAT_MAX_HEALTH] ) * 100 ); +/* value = (int)( (float)( (float)ps->stats[STAT_ARMOR] / ps->stats[STAT_MAX_HEALTH] ) * 100 ); if( value > 0 ) - CG_DrawFadePic( 580, 0, 30, 440, fcolor, tcolor, value, cgs.media.droidHealth ); + CG_DrawFadePic( 580, 0, 30, 440, fcolor, tcolor, value, cgs.media.droidHealth );*/ } else { @@ -628,17 +628,17 @@ static void CG_DrawStatusBar( void ) { CG_ColorForHealth( hcolor ); trap_R_SetColor( hcolor ); - value = ps->stats[STAT_ARMOR]; +/* value = ps->stats[STAT_ARMOR]; if (value > 0 ) { trap_R_SetColor( colors[0] ); CG_DrawField (541, 432, 3, value); trap_R_SetColor( NULL ); // if we didn't draw a 3D icon, draw a 2D icon for armor - /*if ( !cg_draw3dIcons.integer && cg_drawIcons.integer ) { + if ( !cg_draw3dIcons.integer && cg_drawIcons.integer ) { CG_DrawPic( 370 + CHAR_WIDTH*3 + TEXT_ICON_SPACE, 432, ICON_SIZE, ICON_SIZE, cgs.media.armorIcon ); - }*/ - } + } + }*/ } } diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 034504d4..e12c315a 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -489,7 +489,6 @@ gitem_t bg_itemlist[] = "sound/misc/w_pkup.wav", { "models/weapons2/grapple/grapple.md3", 0, 0, 0}, - "icons/iconw_grapple", "Grappling Hook", 0, IT_WEAPON, @@ -1670,510 +1669,510 @@ int BG_FindUniqueTestForBuildable( int bclass ) classAttributes_t bg_classList[ ] = { { - PCL_D_B_BASE, - "Builder", - "lucy", - "default", - { -15, -15, -20 }, - { 15, 15, 20 }, - { 15, 15, 20 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 12, 12, - 50, - 50, - SCA_TAKESFALLDAMAGE|SCA_FOVWARPS, - 80, - 0.015f, - 350, - 0.5f, - 1.0f, - { PCL_D_B_LEV1, PCL_NONE, PCL_NONE }, - 2000, - 100 + PCL_D_B_BASE, //int classnum; + "Builder", //char *classname; + "lucy", //char *modelname; + "default", //char *skinname; + { -15, -15, -20 }, //vec3_t mins; + { 15, 15, 20 }, //vec3_t maxs; + { 15, 15, 20 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 12, 12, //int viewheight, crouchviewheight; + 50, //int health; + 0, //int armor; + SCA_TAKESFALLDAMAGE|SCA_FOVWARPS, //int abilities; + 80, //int fov; + 0.015f, //float bob; + 350, //int steptime; + 0.5f, //float speed; + 1.0f, //float sticky; + { PCL_D_B_LEV1, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 2000, //int timetoevolve; + 100 //int value; }, { - PCL_D_B_LEV1, - "BuilderLevel1", - "lucy", - "default", - { -15, -15, -20 }, - { 15, 15, 20 }, - { 15, 15, 20 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 12, 12, - 75, - 75, - SCA_CANJUMP|SCA_FOVWARPS, - 110, - 0.005f, - 200, - 1.0f, - 1.0f, - { PCL_D_B_LEV21, PCL_D_B_LEV22, PCL_D_B_LEV23 }, - 2000, - 100 + PCL_D_B_LEV1, //int classnum; + "BuilderLevel1", //char *classname; + "lucy", //char *modelname; + "default", //char *skinname; + { -15, -15, -20 }, //vec3_t mins; + { 15, 15, 20 }, //vec3_t maxs; + { 15, 15, 20 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 12, 12, //int viewheight, crouchviewheight; + 75, //int health; + 10, //int armor; + SCA_CANJUMP|SCA_FOVWARPS, //int abilities; + 110, //int fov; + 0.005f, //float bob; + 200, //int steptime; + 1.0f, //float speed; + 1.0f, //float sticky; + { PCL_D_B_LEV21, PCL_D_B_LEV22, PCL_D_B_LEV23 },//int children[ 3 ]; + 2000, //int timetoevolve; + 100 //int value; }, { - PCL_D_B_LEV21, - "BuilderLevel2-1", - "lucy", - "default", - { -15, -15, -20 }, - { 15, 15, 20 }, - { 15, 15, 20 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 12, 12, - 100, - 200, - SCA_TAKESFALLDAMAGE|SCA_FOVWARPS, - 90, - 0.015f, - 350, - 1.2f, - 1.0f, - { PCL_NONE, PCL_NONE, PCL_NONE }, - 2000, - 100 + PCL_D_B_LEV21, //int classnum; + "BuilderLevel2-1", //char *classname; + "lucy", //char *modelname; + "default", //char *skinname; + { -15, -15, -20 }, //vec3_t mins; + { 15, 15, 20 }, //vec3_t maxs; + { 15, 15, 20 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 12, 12, //int viewheight, crouchviewheight; + 100, //int health; + 40, //int armor; + SCA_TAKESFALLDAMAGE|SCA_FOVWARPS, //int abilities; + 90, //int fov; + 0.015f, //float bob; + 350, //int steptime; + 1.2f, //float speed; + 1.0f, //float sticky; + { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 2000, //int timetoevolve; + 100 //int value; }, { - PCL_D_B_LEV22, - "BuilderLevel2-2", - "lucy", - "default", - { -15, -15, -20 }, - { 15, 15, 20 }, - { 15, 15, 20 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 12, 12, - 120, - 100, - SCA_CANJUMP|SCA_FOVWARPS, - 120, - 0.002f, - 350, - 1.5f, - 1.0f, - { PCL_NONE, PCL_NONE, PCL_NONE }, - 2000, - 100 + PCL_D_B_LEV22, //int classnum; + "BuilderLevel2-2", //char *classname; + "lucy", //char *modelname; + "default", //char *skinname; + { -15, -15, -20 }, //vec3_t mins; + { 15, 15, 20 }, //vec3_t maxs; + { 15, 15, 20 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 12, 12, //int viewheight, crouchviewheight; + 120, //int health; + 40, //int armor; + SCA_CANJUMP|SCA_FOVWARPS, //int abilities; + 120, //int fov; + 0.002f, //float bob; + 350, //int steptime; + 1.5f, //float speed; + 1.0f, //float sticky; + { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 2000, //int timetoevolve; + 100 //int value; }, { - PCL_D_B_LEV23, - "BuilderLevel2-3", - "lucy", - "default", - { -15, -15, -20 }, - { 15, 15, 20 }, - { 15, 15, 20 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 12, 12, - 100, - 100, - SCA_CANJUMP|SCA_FOVWARPS, - 100, - 0.015f, - 350, - 1.7f, - 1.0f, - { PCL_NONE, PCL_NONE, PCL_NONE }, - 2000, - 100 - }, - { - PCL_D_O_BASE, - "Offensive", - "klesk", - "default", - { -15, -15, -15 }, - { 15, 15, 15 }, - { 15, 15, 15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 25, - 0, - SCA_WALLCLIMBER|SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 140, - 0.0f, - 25, - 1.8f, - 5.0f, - { PCL_D_O_LEV11, PCL_D_O_LEV12, PCL_NONE }, - 3000, - 100 - }, - { - PCL_D_O_LEV11, - "OffensiveLevel1-1", - "klesk", - "default", - { -24, -24, -24 }, - { 24, 24, 24 }, - { 24, 24, 24 }, - { -24, -24, -4 }, - { 24, 24, 4 }, - 12, 12, - 50, - 50, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 120, - 0.001f, - 25, - 1.6f, - 4.0f, - { PCL_D_O_LEV21, PCL_D_O_LEV22, PCL_NONE }, - 3000, - 100 - }, - { - PCL_D_O_LEV12, - "OffensiveLevel1-2", - "klesk", - "default", - { -24, -24, -24 }, - { 24, 24, 24 }, - { 24, 24, 24 }, - { -24, -24, -4 }, - { 24, 24, 4 }, - 12, 12, - 50, - 50, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 120, - 0.002f, - 25, - 1.5f, - 3.0f, - { PCL_D_O_LEV21, PCL_D_O_LEV22, PCL_NONE }, - 3000, - 100 - }, - { - PCL_D_O_LEV21, - "OffensiveLevel2-1", - "klesk", - "default", - { -15, -15, -15 }, - { 15, 15, 15 }, - { 15, 15, 15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 100, - 100, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 130, - 0.0f, - 60, - 1.3f, - 5.0f, - { PCL_D_O_LEV31, PCL_D_O_LEV32, PCL_NONE }, - 3000, - 100 - }, - { - PCL_D_O_LEV22, - "OffensiveLevel2-2", - "klesk", - "default", - { -15, -15, -15 }, - { 15, 15, 15 }, - { 15, 15, 15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 100, - 100, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 130, - 0.0f, - 60, - 1.3f, - 5.0f, - { PCL_D_O_LEV32, PCL_D_O_LEV33, PCL_NONE }, - 3000, - 100 - }, - { - PCL_D_O_LEV31, - "OffensiveLevel3-1", - "klesk", - "default", - { -15, -15, -15 }, - { 15, 15, 15 }, - { 15, 15, 15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 200, - 200, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 120, - 0.0f, - 200, - 1.0f, - 5.0f, - { PCL_NONE, PCL_NONE, PCL_NONE }, - 3000, - 100 - }, - { - PCL_D_O_LEV32, - "OffensiveLevel3-2", - "klesk", - "default", - { -15, -15, -15 }, - { 15, 15, 15 }, - { 15, 15, 15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 200, - 200, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 120, - 0.0f, - 200, - 1.0f, - 5.0f, - { PCL_NONE, PCL_NONE, PCL_NONE }, - 3000, - 100 - }, - { - PCL_D_O_LEV33, - "OffensiveLevel3-3", - "klesk", - "default", - { -15, -15, -15 }, - { 15, 15, 15 }, - { 15, 15, 15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 200, - 200, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 120, - 0.0f, - 200, - 1.0f, - 5.0f, - { PCL_NONE, PCL_NONE, PCL_NONE }, - 3000, - 100 - }, - { - PCL_D_D_BASE, - "Defensive", - "orbb", - "default", - { -15, -15, -15 }, - { 15, 15 ,15 }, - { 15, 15 ,15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 50, - 0, - SCA_WALLCLIMBER|SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 90, - 0.0f, - 25, - 1.5f, - 3.0f, - { PCL_D_D_LEV11, PCL_D_D_LEV12, PCL_NONE }, - 1000, - 100 - }, - { - PCL_D_D_LEV11, - "DefensiveLevel1-1", - "orbb", - "default", - { -15, -15, -15 }, - { 15, 15 ,15 }, - { 15, 15 ,15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 50, - 50, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 100, - 0.0f, - 25, - 1.4f, - 3.0f, - { PCL_D_D_LEV21, PCL_D_D_LEV22, PCL_NONE }, - 1000, - 100 - }, - { - PCL_D_D_LEV12, - "DefensiveLevel1-2", - "orbb", - "default", - { -15, -15, -15 }, - { 15, 15 ,15 }, - { 15, 15 ,15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 50, - 50, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 100, - 0.0f, - 25, - 1.4f, - 3.0f, - { PCL_D_D_LEV21, PCL_D_D_LEV22, PCL_NONE }, - 1000, - 100 - }, - { - PCL_D_D_LEV21, - "DefensiveLevel2-1", - "orbb", - "default", - { -15, -15, -15 }, - { 15, 15 ,15 }, - { 15, 15 ,15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 150, - 150, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 110, - 0.0f, - 25, - 1.3f, - 3.0f, - { PCL_D_D_LEV31, PCL_D_D_LEV32, PCL_NONE }, - 1000, - 100 - }, - { - PCL_D_D_LEV22, - "DefensiveLevel2-2", - "orbb", - "default", - { -15, -15, -15 }, - { 15, 15 ,15 }, - { 15, 15 ,15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 150, - 150, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 110, - 0.0f, - 25, - 1.3f, - 3.0f, - { PCL_D_D_LEV32, PCL_D_D_LEV33, PCL_NONE }, - 1000, - 100 - }, - { - PCL_D_D_LEV31, - "DefensiveLevel3-1", - "orbb", - "default", - { -15, -15, -15 }, - { 15, 15 ,15 }, - { 15, 15 ,15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 250, - 250, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 130, - 0.0f, - 25, - 1.2f, - 3.0f, - { PCL_NONE, PCL_NONE, PCL_NONE }, - 1000, - 100 - }, - { - PCL_D_D_LEV32, - "DefensiveLevel3-2", - "orbb", - "default", - { -15, -15, -15 }, - { 15, 15 ,15 }, - { 15, 15 ,15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 250, - 250, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 130, - 0.0f, - 25, - 1.2f, - 3.0f, - { PCL_NONE, PCL_NONE, PCL_NONE }, - 1000, - 100 - }, - { - PCL_D_D_LEV33, - "DefensiveLevel3-3", - "orbb", - "default", - { -15, -15, -15 }, - { 15, 15 ,15 }, - { 15, 15 ,15 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 4, 4, - 250, - 250, - SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, - 130, - 0.0f, - 25, - 1.2f, - 3.0f, - { PCL_NONE, PCL_NONE, PCL_NONE }, - 1000, - 100 - }, - { - PCL_H_BASE, - "Human", - "sarge", - "default", - { -15, -15, -24 }, - { 15, 15, 32 }, - { 15, 15, 16 }, - { -15, -15, -4 }, - { 15, 15, 4 }, - 26, 12, - 100, - 0, - SCA_TAKESFALLDAMAGE|SCA_CANJUMP, - 90, - 0.002f, - 200, - 1.0f, - 1.0f, - { PCL_NONE, PCL_NONE, PCL_NONE }, - 0, - 0 + PCL_D_B_LEV23, //int classnum; + "BuilderLevel2-3", //char *classname; + "lucy", //char *modelname; + "default", //char *skinname; + { -15, -15, -20 }, //vec3_t mins; + { 15, 15, 20 }, //vec3_t maxs; + { 15, 15, 20 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 12, 12, //int viewheight, crouchviewheight; + 100, //int health; + 40, //int armor; + SCA_CANJUMP|SCA_FOVWARPS, //int abilities; + 100, //int fov; + 0.015f, //float bob; + 350, //int steptime; + 1.7f, //float speed; + 1.0f, //float sticky; + { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 2000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_O_BASE, //int classnum; + "Offensive", //char *classname; + "klesk", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15, 15 }, //vec3_t maxs; + { 15, 15, 15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 25, //int health; + 0, //int armor; + SCA_WALLCLIMBER|SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 140, //int fov; + 0.0f, //float bob; + 25, //int steptime; + 1.8f, //float speed; + 5.0f, //float sticky; + { PCL_D_O_LEV11, PCL_D_O_LEV12, PCL_NONE }, //int children[ 3 ]; + 3000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_O_LEV11, //int classnum; + "OffensiveLevel1-1", //char *classname; + "klesk", //char *modelname; + "default", //char *skinname; + { -24, -24, -24 }, //vec3_t mins; + { 24, 24, 24 }, //vec3_t maxs; + { 24, 24, 24 }, //vec3_t crouchmaxs; + { -24, -24, -4 }, //vec3_t deadmins; + { 24, 24, 4 }, //vec3_t deadmaxs; + 6, 6, //int viewheight, crouchviewheight; + 50, //int health; + 5, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 120, //int fov; + 0.001f, //float bob; + 25, //int steptime; + 1.6f, //float speed; + 4.0f, //float sticky; + { PCL_D_O_LEV21, PCL_D_O_LEV22, PCL_NONE }, //int children[ 3 ]; + 3000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_O_LEV12, //int classnum; + "OffensiveLevel1-2", //char *classname; + "klesk", //char *modelname; + "default", //char *skinname; + { -24, -24, -24 }, //vec3_t mins; + { 24, 24, 24 }, //vec3_t maxs; + { 24, 24, 24 }, //vec3_t crouchmaxs; + { -24, -24, -4 }, //vec3_t deadmins; + { 24, 24, 4 }, //vec3_t deadmaxs; + 6, 6, //int viewheight, crouchviewheight; + 50, //int health; + 10, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 120, //int fov; + 0.0005f, //float bob; + 25, //int steptime; + 1.5f, //float speed; + 3.0f, //float sticky; + { PCL_D_O_LEV21, PCL_D_O_LEV22, PCL_NONE }, //int children[ 3 ]; + 3000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_O_LEV21, //int classnum; + "OffensiveLevel2-1", //char *classname; + "klesk", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15, 15 }, //vec3_t maxs; + { 15, 15, 15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 100, //int health; + 20, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 130, //int fov; + 0.0f, //float bob; + 60, //int steptime; + 1.3f, //float speed; + 5.0f, //float sticky; + { PCL_D_O_LEV31, PCL_D_O_LEV32, PCL_NONE }, //int children[ 3 ]; + 3000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_O_LEV22, //int classnum; + "OffensiveLevel2-2", //char *classname; + "klesk", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15, 15 }, //vec3_t maxs; + { 15, 15, 15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 100, //int health; + 30, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 130, //int fov; + 0.0f, //float bob; + 60, //int steptime; + 1.3f, //float speed; + 5.0f, //float sticky; + { PCL_D_O_LEV32, PCL_D_O_LEV33, PCL_NONE }, //int children[ 3 ]; + 3000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_O_LEV31, //int classnum; + "OffensiveLevel3-1", //char *classname; + "klesk", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15, 15 }, //vec3_t maxs; + { 15, 15, 15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 200, //int health; + 40, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 120, //int fov; + 0.0f, //float bob; + 200, //int steptime; + 1.0f, //float speed; + 5.0f, //float sticky; + { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 3000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_O_LEV32, //int classnum; + "OffensiveLevel3-2", //char *classname; + "klesk", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15, 15 }, //vec3_t maxs; + { 15, 15, 15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 200, //int health; + 50, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 120, //int fov; + 0.0f, //float bob; + 200, //int steptime; + 1.0f, //float speed; + 5.0f, //float sticky; + { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 3000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_O_LEV33, //int classnum; + "OffensiveLevel3-3", //char *classname; + "klesk", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15, 15 }, //vec3_t maxs; + { 15, 15, 15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 200, //int health; + 60, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 120, //int fov; + 0.0f, //float bob; + 200, //int steptime; + 1.0f, //float speed; + 5.0f, //float sticky; + { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 3000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_D_BASE, //int classnum; + "Defensive", //char *classname; + "orbb", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15 ,15 }, //vec3_t maxs; + { 15, 15 ,15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 50, //int health; + 0, //int armor; + SCA_WALLCLIMBER|SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 90, //int fov; + 0.0f, //float bob; + 25, //int steptime; + 1.5f, //float speed; + 3.0f, //float sticky; + { PCL_D_D_LEV11, PCL_D_D_LEV12, PCL_NONE }, //int children[ 3 ]; + 1000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_D_LEV11, //int classnum; + "DefensiveLevel1-1", //char *classname; + "orbb", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15 ,15 }, //vec3_t maxs; + { 15, 15 ,15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 50, //int health; + 50, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 100, //int fov; + 0.0f, //float bob; + 25, //int steptime; + 1.4f, //float speed; + 3.0f, //float sticky; + { PCL_D_D_LEV21, PCL_D_D_LEV22, PCL_NONE }, //int children[ 3 ]; + 1000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_D_LEV12, //int classnum; + "DefensiveLevel1-2", //char *classname; + "orbb", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15 ,15 }, //vec3_t maxs; + { 15, 15 ,15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 50, //int health; + 50, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 100, //int fov; + 0.0f, //float bob; + 25, //int steptime; + 1.4f, //float speed; + 3.0f, //float sticky; + { PCL_D_D_LEV21, PCL_D_D_LEV22, PCL_NONE }, //int children[ 3 ]; + 1000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_D_LEV21, //int classnum; + "DefensiveLevel2-1", //char *classname; + "orbb", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15 ,15 }, //vec3_t maxs; + { 15, 15 ,15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 150, //int health; + 50, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 110, //int fov; + 0.0f, //float bob; + 25, //int steptime; + 1.3f, //float speed; + 3.0f, //float sticky; + { PCL_D_D_LEV31, PCL_D_D_LEV32, PCL_NONE }, //int children[ 3 ]; + 1000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_D_LEV22, //int classnum; + "DefensiveLevel2-2", //char *classname; + "orbb", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15 ,15 }, //vec3_t maxs; + { 15, 15 ,15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 150, //int health; + 50, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 110, //int fov; + 0.0f, //float bob; + 25, //int steptime; + 1.3f, //float speed; + 3.0f, //float sticky; + { PCL_D_D_LEV32, PCL_D_D_LEV33, PCL_NONE }, //int children[ 3 ]; + 1000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_D_LEV31, //int classnum; + "DefensiveLevel3-1", //char *classname; + "orbb", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15 ,15 }, //vec3_t maxs; + { 15, 15 ,15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 250, //int health; + 50, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 130, //int fov; + 0.0f, //float bob; + 25, //int steptime; + 1.2f, //float speed; + 3.0f, //float sticky; + { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 1000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_D_LEV32, //int classnum; + "DefensiveLevel3-2", //char *classname; + "orbb", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15 ,15 }, //vec3_t maxs; + { 15, 15 ,15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 250, //int health; + 50, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 130, //int fov; + 0.0f, //float bob; + 25, //int steptime; + 1.2f, //float speed; + 3.0f, //float sticky; + { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 1000, //int timetoevolve; + 100 //int value; + }, + { + PCL_D_D_LEV33, //int classnum; + "DefensiveLevel3-3", //char *classname; + "orbb", //char *modelname; + "default", //char *skinname; + { -15, -15, -15 }, //vec3_t mins; + { 15, 15 ,15 }, //vec3_t maxs; + { 15, 15 ,15 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 4, 4, //int viewheight, crouchviewheight; + 250, //int health; + 50, //int armor; + SCA_CANJUMP|SCA_NOWEAPONDRIFT|SCA_FOVWARPS, //int abilities; + 130, //int fov; + 0.0f, //float bob; + 25, //int steptime; + 1.2f, //float speed; + 3.0f, //float sticky; + { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 1000, //int timetoevolve; + 100 //int value; + }, + { + PCL_H_BASE, //int classnum; + "Human", //char *classname; + "sarge", //char *modelname; + "default", //char *skinname; + { -15, -15, -24 }, //vec3_t mins; + { 15, 15, 32 }, //vec3_t maxs; + { 15, 15, 16 }, //vec3_t crouchmaxs; + { -15, -15, -4 }, //vec3_t deadmins; + { 15, 15, 4 }, //vec3_t deadmaxs; + 26, 12, //int viewheight, crouchviewheight; + 100, //int health; + 0, //int armor; + SCA_TAKESFALLDAMAGE|SCA_CANJUMP, //int abilities; + 90, //int fov; + 0.002f, //float bob; + 200, //int steptime; + 1.0f, //float speed; + 1.0f, //float sticky; + { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; + 0, //int timetoevolve; + 0 //int value; } }; @@ -2549,112 +2548,112 @@ int BG_FindValueOfClass( int pclass ) weaponAttributes_t bg_weapons[ ] = { { - WP_MACHINEGUN, - 100, - SLOT_WEAPON, - "rifle", - "Rifle", - 30, - 3, - 3, - qfalse, - qfalse - }, - { - WP_FLAMER, - 100, - SLOT_WEAPON, - "flamer", - "Flame Thrower", - 400, - 0, - 0, - qfalse, - qfalse - }, - { - WP_CHAINGUN, - 100, - SLOT_WEAPON, - "chaingun", - "Chaingun", - 300, - 0, - 0, - qfalse, - qfalse - }, - { - WP_HBUILD, - 100, - SLOT_WEAPON, - "ckit", - "Construction Kit", - 0, - 0, - 0, - qfalse, - qfalse - }, - { - WP_DBUILD, - 100, - SLOT_WEAPON, - "dbuild", - "Droid build weapon", - 0, - 0, - 0, - qfalse, - qfalse - }, - { - WP_VENOM, - 100, - SLOT_WEAPON, - "venom", - "Venom", - 0, - 0, - 0, - qfalse, - qfalse - }, - { - WP_GRABANDCSAW, - 100, - SLOT_WEAPON, - "grabandcsaw", - "Circular Saw", - 0, - 0, - 0, - qtrue, - qtrue - }, - { - WP_POUNCE, - 100, - SLOT_WEAPON, - "pounce", - "Claw and pounce", - 0, - 0, - 0, - qfalse, - qfalse - }, - { - WP_SCANNER, - 100, - SLOT_WEAPON, - "scanner", - "Scanner", - 0, - 0, - 0, - qfalse, - qfalse + WP_MACHINEGUN, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "rifle", //char *weaponName; + "Rifle", //char *weaponHumanName; + 30, //int quan; + 3, //int clips; + 3, //int maxClips; + qfalse, //qboolean hasAltMode; + qfalse //qboolean synced; + }, + { + WP_FLAMER, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "flamer", //char *weaponName; + "Flame Thrower", //char *weaponHumanName; + 400, //int quan; + 0, //int clips; + 0, //int maxClips; + qfalse, //qboolean hasAltMode; + qfalse //qboolean synced; + }, + { + WP_CHAINGUN, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "chaingun", //char *weaponName; + "Chaingun", //char *weaponHumanName; + 300, //int quan; + 0, //int clips; + 0, //int maxClips; + qfalse, //qboolean hasAltMode; + qfalse //qboolean synced; + }, + { + WP_HBUILD, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "ckit", //char *weaponName; + "Construction Kit", //char *weaponHumanName; + 0, //int quan; + 0, //int clips; + 0, //int maxClips; + qfalse, //qboolean hasAltMode; + qfalse //qboolean synced; + }, + { + WP_DBUILD, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "dbuild", //char *weaponName; + "Droid build weapon", //char *weaponHumanName; + 0, //int quan; + 0, //int clips; + 0, //int maxClips; + qfalse, //qboolean hasAltMode; + qfalse //qboolean synced; + }, + { + WP_VENOM, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "venom", //char *weaponName; + "Venom", //char *weaponHumanName; + 0, //int quan; + 0, //int clips; + 0, //int maxClips; + qfalse, //qboolean hasAltMode; + qfalse //qboolean synced; + }, + { + WP_GRABANDCSAW, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "grabandcsaw", //char *weaponName; + "Circular Saw", //char *weaponHumanName; + 0, //int quan; + 0, //int clips; + 0, //int maxClips; + qtrue, //qboolean hasAltMode; + qtrue //qboolean synced; + }, + { + WP_POUNCE, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "pounce", //char *weaponName; + "Claw and pounce", //char *weaponHumanName; + 0, //int quan; + 0, //int clips; + 0, //int maxClips; + qfalse, //qboolean hasAltMode; + qfalse //qboolean synced; + }, + { + WP_SCANNER, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "scanner", //char *weaponName; + "Scanner", //char *weaponHumanName; + 0, //int quan; + 0, //int clips; + 0, //int maxClips; + qfalse, //qboolean hasAltMode; + qfalse //qboolean synced; } }; @@ -2828,81 +2827,81 @@ qboolean BG_WeaponModesAreSynced( int weapon ) upgradeAttributes_t bg_upgrades[ ] = { { - UP_TORCH, - 100, - SLOT_NONE, - "torch", - "Torch" + UP_TORCH, //int upgradeNum; + 100, //int price; + SLOT_NONE, //int slots; + "torch", //char *upgradeName; + "Torch" //char *upgradeHumanName; }, { - UP_NVG, - 100, - SLOT_HEAD, - "nvg", - "NVG" + UP_NVG, //int upgradeNum; + 100, //int price; + SLOT_HEAD, //int slots; + "nvg", //char *upgradeName; + "NVG" //char *upgradeHumanName; }, { - UP_CHESTARMOUR, - 100, - SLOT_TORSO, - "carmour", - "Chest Armour" + UP_CHESTARMOUR, //int upgradeNum; + 100, //int price; + SLOT_TORSO, //int slots; + "carmour", //char *upgradeName; + "Chest Armour" //char *upgradeHumanName; }, { - UP_LIMBARMOUR, - 100, - SLOT_ARMS|SLOT_LEGS, - "larmour", - "Limb Armour" + UP_LIMBARMOUR, //int upgradeNum; + 100, //int price; + SLOT_ARMS|SLOT_LEGS, //int slots; + "larmour", //char *upgradeName; + "Limb Armour" //char *upgradeHumanName; }, { - UP_HELMET, - 100, - SLOT_HEAD, - "helmet", - "Helmet" + UP_HELMET, //int upgradeNum; + 100, //int price; + SLOT_HEAD, //int slots; + "helmet", //char *upgradeName; + "Helmet" //char *upgradeHumanName; }, { - UP_ANTITOXIN, - 100, - SLOT_NONE, - "atoxin", - "Anti-toxin" + UP_ANTITOXIN, //int upgradeNum; + 100, //int price; + SLOT_NONE, //int slots; + "atoxin", //char *upgradeName; + "Anti-toxin" //char *upgradeHumanName; }, { - UP_BATTPACK, - 100, - SLOT_BACKPACK, - "battpack", - "Battery Pack" + UP_BATTPACK, //int upgradeNum; + 100, //int price; + SLOT_BACKPACK, //int slots; + "battpack", //char *upgradeName; + "Battery Pack" //char *upgradeHumanName; }, { - UP_JETPACK, - 100, - SLOT_BACKPACK, - "jetpack", - "Jet Pack" + UP_JETPACK, //int upgradeNum; + 100, //int price; + SLOT_BACKPACK, //int slots; + "jetpack", //char *upgradeName; + "Jet Pack" //char *upgradeHumanName; }, { - UP_THREATHELMET, - 100, - SLOT_HEAD, - "thelmet", - "Threat Helmet" + UP_THREATHELMET, //int upgradeNum; + 100, //int price; + SLOT_HEAD, //int slots; + "thelmet", //char *upgradeName; + "Threat Helmet" //char *upgradeHumanName; }, { - UP_BATTLESUIT, - 100, - SLOT_HEAD|SLOT_TORSO|SLOT_ARMS|SLOT_LEGS, - "bsuit", - "Battlesuit" + UP_BATTLESUIT, //int upgradeNum; + 100, //int price; + SLOT_HEAD|SLOT_TORSO|SLOT_ARMS|SLOT_LEGS, //int slots; + "bsuit", //char *upgradeName; + "Battlesuit" //char *upgradeHumanName; }, { - UP_IMPANTKIT, - 100, - SLOT_HEAD|SLOT_TORSO|SLOT_ARMS|SLOT_LEGS, - "ikit", - "Implant Kit" + UP_IMPANTKIT, //int upgradeNum; + 100, //int price; + SLOT_HEAD|SLOT_TORSO|SLOT_ARMS|SLOT_LEGS, //int slots; + "ikit", //char *upgradeName; + "Implant Kit" //char *upgradeHumanName; } }; diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index df85b49f..d51465f6 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -606,7 +606,7 @@ Used by HDef_Think to fire at enemy void hdef_fireonenemy( gentity_t *self, int firespeed ) { //fire at target - G_AddEvent( self, EV_FIRE_WEAPON, 0 ); + FireWeapon( self ); self->count = level.time + firespeed; } diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 7788d2e5..34ab8e16 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -562,7 +562,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int CheckArmor ================ */ -int CheckArmor (gentity_t *ent, int damage, int dflags) +int CheckArmor( gentity_t *ent, int damage, int dflags ) { gclient_t *client; int save; @@ -1059,7 +1059,8 @@ void G_SelectiveDamage( gentity_t *targ, gentity_t *inflictor, gentity_t *attack } void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, - vec3_t dir, vec3_t point, int damage, int dflags, int mod ) { + vec3_t dir, vec3_t point, int damage, int dflags, int mod ) +{ gclient_t *client; int take; int save; @@ -1067,28 +1068,26 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, int knockback; int max; - if (!targ->takedamage) { + if(!targ->takedamage) return; - } // the intermission has allready been qualified for, so don't // allow any extra scoring - if ( level.intermissionQueued ) { + if ( level.intermissionQueued ) return; - } - if ( !inflictor ) { + if( !inflictor ) inflictor = &g_entities[ENTITYNUM_WORLD]; - } - if ( !attacker ) { + + if( !attacker ) attacker = &g_entities[ENTITYNUM_WORLD]; - } // shootable doors / buttons don't actually have any health - if ( targ->s.eType == ET_MOVER ) { - if ( targ->use && targ->moverState == MOVER_POS1 ) { + if( targ->s.eType == ET_MOVER ) + { + if( targ->use && targ->moverState == MOVER_POS1 ) targ->use( targ, inflictor, attacker ); - } + return; } @@ -1101,71 +1100,71 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, client = targ->client; - if ( client ) { - if ( client->noclip ) { + if( client ) + { + if( client->noclip ) return; - } } - if ( !dir ) { + if( !dir ) dflags |= DAMAGE_NO_KNOCKBACK; - } else { + else VectorNormalize(dir); - } knockback = damage; - if ( knockback > 200 ) { + if( knockback > 200 ) knockback = 200; - } - if ( targ->flags & FL_NO_KNOCKBACK ) { + + if( targ->flags & FL_NO_KNOCKBACK ) knockback = 0; - } - if ( dflags & DAMAGE_NO_KNOCKBACK ) { + + if( dflags & DAMAGE_NO_KNOCKBACK ) knockback = 0; - } // figure momentum add, even if the damage won't be taken - if ( knockback && targ->client ) { + if( knockback && targ->client ) + { vec3_t kvel; float mass; mass = 200; - VectorScale (dir, g_knockback.value * (float)knockback / mass, kvel); - VectorAdd (targ->client->ps.velocity, kvel, targ->client->ps.velocity); + VectorScale( dir, g_knockback.value * (float)knockback / mass, kvel ); + VectorAdd( targ->client->ps.velocity, kvel, targ->client->ps.velocity ); // set the timer so that the other client can't cancel // out the movement immediately - if ( !targ->client->ps.pm_time ) { + if( !targ->client->ps.pm_time ) + { int t; t = knockback * 2; - if ( t < 50 ) { + if( t < 50 ) t = 50; - } - if ( t > 200 ) { + + if( t > 200 ) t = 200; - } + targ->client->ps.pm_time = t; targ->client->ps.pm_flags |= PMF_TIME_KNOCKBACK; } } // check for completely getting out of the damage - if ( !(dflags & DAMAGE_NO_PROTECTION) ) { + if( !(dflags & DAMAGE_NO_PROTECTION) ) + { // if TF_NO_FRIENDLY_FIRE is set, don't do damage to the target // if the attacker was on the same team - if ( targ != attacker && OnSameTeam (targ, attacker) ) { - if ( !g_friendlyFire.integer ) { + if( targ != attacker && OnSameTeam (targ, attacker) ) + { + if( !g_friendlyFire.integer ) return; - } } // check for godmode - if ( targ->flags & FL_GODMODE ) { + if ( targ->flags & FL_GODMODE ) return; - } } // battlesuit protects from all radius damage (but takes knockback) @@ -1181,31 +1180,40 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, // add to the attacker's hit counter if ( attacker->client && targ != attacker && targ->health > 0 && targ->s.eType != ET_MISSILE - && targ->s.eType != ET_GENERAL) { - if ( OnSameTeam( targ, attacker ) ) { - attacker->client->ps.persistant[PERS_HITS] --; - } else { - attacker->client->ps.persistant[PERS_HITS] ++; - } + && targ->s.eType != ET_GENERAL) + { + if( OnSameTeam( targ, attacker ) ) + attacker->client->ps.persistant[ PERS_HITS ]--; + else + attacker->client->ps.persistant[ PERS_HITS ]++; } // always give half damage if hurting self // calculated after knockback, so rocket jumping works - if ( targ == attacker) { + if( targ == attacker) damage *= 0.5; - } - if ( damage < 1 ) { + if( damage < 1 ) damage = 1; - } + take = damage; save = 0; // save some from armor - asave = CheckArmor (targ, take, dflags); - take -= asave; +/* asave = CheckArmor (targ, take, dflags); + take -= asave;*/ + //TA: armour is the chance of deflecting an attack (out of 100) + if( targ->client && targ->client->ps.stats[ STAT_ARMOR ] > 0 ) + { + //TA: this whole thing is probably a bad idea. Worth a try I guess. + float chance = (float)targ->client->ps.stats[ STAT_ARMOR ] / 100.0f; - if ( g_debugDamage.integer ) { + if( crandom( ) > chance ) + take /= ( 1.0f / chance ); + } + + if( g_debugDamage.integer ) + { G_Printf( "%i: client:%i health:%i damage:%i armor:%i\n", level.time, targ->s.number, targ->health, take, asave ); } @@ -1213,30 +1221,34 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, // add to the damage inflicted on a player this frame // the total will be turned into screen blends and view angle kicks // at the end of the frame - if ( client ) { - if ( attacker ) { + if( client ) + { + if( attacker ) client->ps.persistant[PERS_ATTACKER] = attacker->s.number; - } else { + else client->ps.persistant[PERS_ATTACKER] = ENTITYNUM_WORLD; - } + client->damage_armor += asave; client->damage_blood += take; client->damage_knockback += knockback; - if ( dir ) { + if( dir ) + { VectorCopy ( dir, client->damage_from ); client->damage_fromWorld = qfalse; - } else { + } + else + { VectorCopy ( targ->r.currentOrigin, client->damage_from ); client->damage_fromWorld = qtrue; } } // See if it's the player hurting the emeny flag carrier - if( g_gametype.integer == GT_CTF) { + if( g_gametype.integer == GT_CTF) Team_CheckHurtCarrier(targ, attacker); - } - if (targ->client) { + if(targ->client) + { // set the last client who damaged the target targ->client->lasthurt_client = attacker->s.number; targ->client->lasthurt_mod = mod; @@ -1244,11 +1256,11 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, } // do the damage - if (take) { + if(take) + { targ->health = targ->health - take; - if ( targ->client ) { + if( targ->client ) targ->client->ps.stats[STAT_HEALTH] = targ->health; - } //TA: add to the attackers "account" on the target if( targ->client && attacker->client && @@ -1256,8 +1268,9 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) targ->credits[ attacker->client->ps.clientNum ] += take; - if ( targ->health <= 0 ) { - if ( client ) + if( targ->health <= 0 ) + { + if( client ) targ->flags |= FL_NO_KNOCKBACK; if (targ->health < -999) @@ -1266,11 +1279,10 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, targ->enemy = attacker; targ->die (targ, inflictor, attacker, take, mod); return; - } else if ( targ->pain ) { - targ->pain (targ, attacker, take); } + else if( targ->pain ) + targ->pain (targ, attacker, take); } - } diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 93e98e01..15beb4dc 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -866,7 +866,7 @@ qboolean CheckPounceAttack( gentity_t *ent ) CalcMuzzlePoint( ent, forward, right, up, muzzle ); - VectorMA (muzzle, 32, forward, end); + VectorMA (muzzle, 48, forward, end); trap_Trace (&tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT); |