diff options
author | enneract <trem.redman@gmail.com> | 2014-12-20 20:07:54 +0100 |
---|---|---|
committer | enneract <trem.redman@gmail.com> | 2014-12-20 20:07:54 +0100 |
commit | 74be23bb4d9e5fe441ce25008281e4cfc387185e (patch) | |
tree | 5af9e0f2016f9cf81948224108934ea1ae4abbfe /src/game/g_combat.c | |
parent | f5c4bc00cf6307c14a6037a1f0a68259e4fe2ac8 (diff) |
Add logging of weapon settings at game init.
Also adds a few missing weapons and hardcodes Lightning Gun's settings.
Diffstat (limited to 'src/game/g_combat.c')
-rw-r--r-- | src/game/g_combat.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 7713d2a..337ebf1 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -1138,6 +1138,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod ) { gclient_t *client; + int damage_orig = damage; int take; int asave = 0; int knockback; @@ -1432,7 +1433,14 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, targ->credits[ attacker->client->ps.clientNum ] += take; } - G_CombatStats_HitMOD( attacker, targ, mod, take ); + // special cases... + if( mod == MOD_LEVEL2_CLAW && damage_orig == LEVEL2_CLAW_UPG_DMG ) + G_CombatStats_Hit( attacker, targ, CSW_LEVEL2_UPG, take ); + else if( ( mod == MOD_LCANNON || mod == MOD_LCANNON_SPLASH ) && + inflictor->s.generic1 == WPM_SECONDARY ) + G_CombatStats_Hit( attacker, targ, CSW_LCANNON_ALT, take ); + else + G_CombatStats_HitMOD( attacker, targ, mod, take ); if( targ->health <= 0 ) { @@ -1782,7 +1790,7 @@ const static combatStatsWeapon_t modToCsw[ ] = const static char *cswStrings[ ] = { -#define CSW(a,b) #a +#define CSW(a,b,c) #a #include "g_csw.h" #undef CSW }; @@ -1970,6 +1978,33 @@ void G_CalculateCombatRanks( void ) /* ================ +G_LogCombatSettings + +Log settings of all combat stats weapons +================ +*/ +void G_LogCombatSettings( void ) +{ + int i; + char buffer[ 4096 ], *p = buffer; + static const int cswDamages[ ] = + { +#define CSW(a,b,c) (c) +#include "g_csw.h" +#undef CSW + }; + + for( i = 0; i < CSW_MAX; i++ ) + { + Com_sprintf( p, 4096 - ( p - buffer ), " %s %i", cswStrings[ i ], cswDamages[ i ] ); + while( *p ) p++; + } + + G_LogPrintf( "CombatSettings:%s\n", buffer ); +} + +/* +================ G_LogCombatStats Write combat stats of a player to the game log |