Moved rpg_<weapon>dmg cvars into rpg_dmgFlags

* default value is 63
* flags are: Phaser = 1, Crifle = 2, TR116 = 4, Grenade Launcher = 8,
Quantum Burst = 16, Disruptor = 32
This commit is contained in:
Walter Julius Hennecke 2012-11-11 16:33:28 +01:00
parent 8632e3b72d
commit babaeeb805
3 changed files with 69 additions and 35 deletions

View file

@ -1377,19 +1377,19 @@ extern vmCvar_t rpg_non00b;
extern vmCvar_t rpg_nocloak;
extern vmCvar_t rpg_noflight;
/*
* TODO: move damage switching into a singe var with flags just similar to how spawnflags work?
* 1 = phaser, 2 = rifle, ...
* Which weapons do damage?
* Phaser = 1
* Crifle = 2
* TR116 = 4
* Grenade Laucher = 8
* Quantum Burst = 16
* Disruptor = 32
* Default value: 63
*/
extern vmCvar_t rpg_phaserdmg;
extern vmCvar_t rpg_rifledmg;
extern vmCvar_t rpg_stasisdmg;
extern vmCvar_t rpg_imoddmg;
extern vmCvar_t rpg_dmgFlags;
extern vmCvar_t rpg_noweapons;
extern vmCvar_t rpg_welcomemessage;
extern vmCvar_t rpg_timedmessagetime;
/*
* TODO: save cvars by storing timed messages in a list?
*/
extern vmCvar_t rpg_forcekillradius;
extern vmCvar_t rpg_forcekillradiuswaittime;

View file

@ -105,10 +105,18 @@ vmCvar_t rpg_nomaker;
vmCvar_t rpg_non00b;
vmCvar_t rpg_nocloak; //!< Can be used to disable the admin cloaking device.
vmCvar_t rpg_noflight; //!< Can be used to disable the admin flight mode.
vmCvar_t rpg_phaserdmg; //!< Specifies whether the phaser damges players.
vmCvar_t rpg_rifledmg; //!< Specifies whether the phaser rifle damages players.
vmCvar_t rpg_stasisdmg; //!< Specifies whether the disruptor damages rifles.
vmCvar_t rpg_imoddmg;
/*
* Which weapons do damage?
* Phaser = 1
* Crifle = 2
* TR116 = 4
* Grenade Laucher = 8
* Quantum Burst = 16
* Disruptor = 32
* Default value: 63
*/
vmCvar_t rpg_dmgFlags;
vmCvar_t rpg_noweapons; //!< Can be used to disable all weapons.
vmCvar_t rpg_welcomemessage; //!< Welcome message displayed when a player joins the server.
vmCvar_t rpg_timedmessagetime; //!< Delay between timed mesagges
@ -405,10 +413,7 @@ static cvarTable_t gameCvarTable[] = {
{ &rpg_nomaker, "rpg_noMaker", "0", CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse},
{ &rpg_nocloak, "rpg_noCloak", "0", CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse},
{ &rpg_noflight, "rpg_noFlight", "0", CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse},
{ &rpg_phaserdmg, "rpg_phaserDmg", "1", CVAR_ARCHIVE, 0, qfalse},
{ &rpg_rifledmg, "rpg_rifleDmg", "1", CVAR_ARCHIVE, 0, qfalse},
{ &rpg_stasisdmg, "rpg_stasisDmg", "1", CVAR_ARCHIVE, 0, qfalse},
{ &rpg_imoddmg, "rpg_imodDmg", "1", CVAR_ARCHIVE, 0, qfalse},
{ &rpg_dmgFlags, "rpg_dmgFlags", "63", CVAR_ARCHIVE, 0, qfalse},
{ &rpg_noweapons, "rpg_noWeapons", "0", CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse},
{ &rpg_welcomemessage, "rpg_welcomeMessage", "Welcome to the RPG-X Mod", CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse },
{ &rpg_timedmessagetime, "rpg_timedMessageTime", "5", CVAR_ARCHIVE, 0, qfalse }, //TiM : LATCH Not necessary here.

View file

@ -244,7 +244,7 @@ static void WP_FirePhaser( gentity_t *ent, qboolean alt_fire )
}
traceEnt = &g_entities[ trEnts[i] ];
if ( traceEnt->takedamage && rpg_phaserdmg.integer != 0 )
if ( traceEnt->takedamage && (rpg_dmgFlags.integer & 1) )
{
/*damage = (float)PHASER_DAMAGE*DMG_VAR*s_quadFactor;*/ /* No variance on phaser */
damage = (float)PHASER_DAMAGE;
@ -393,7 +393,7 @@ static void WP_FireCompressionRifle ( gentity_t *ent, qboolean alt_fire )
traceEnt = &g_entities[ tr.entityNum ];
if ( traceEnt->takedamage && rpg_phaserdmg.integer != 0 )
if ( traceEnt->takedamage && (rpg_dmgFlags.integer & 2) )
{
damage = (float)PHASER_DAMAGE;
@ -536,7 +536,7 @@ static void WP_FireDisruptor( gentity_t *ent, qboolean alt_fire )
traceEnt = &g_entities[ tr.entityNum ];
if ( traceEnt->takedamage && rpg_phaserdmg.integer != 0 )
if ( traceEnt->takedamage && (rpg_dmgFlags.integer & 32) )
{
damage = (float)PHASER_DAMAGE;
@ -718,8 +718,14 @@ static void WP_FireGrenade( gentity_t *ent, qboolean alt_fire )
}
/* now make the new one */
grenade->classname = "tripwire";
grenade->splashDamage = GRENADE_SPLASH_DAM*2;
grenade->splashRadius = GRENADE_SPLASH_RAD*2;
if(rpg_dmgFlags.integer & 8) {
grenade->splashDamage = GRENADE_SPLASH_DAM*2;
grenade->splashRadius = GRENADE_SPLASH_RAD*2;
} else {
grenade->splashDamage = 0;
grenade->splashRadius = 0;
}
grenade->s.pos.trType = TR_LINEAR;
grenade->nextthink = level.time + 1000; /* How long 'til she blows */
grenade->count = 1; /* tell it it's a tripwire for when it sticks */
@ -729,8 +735,13 @@ static void WP_FireGrenade( gentity_t *ent, qboolean alt_fire )
else
{
grenade->classname = "grenade_alt_projectile";
grenade->splashDamage = GRENADE_SPLASH_DAM;
grenade->splashRadius = GRENADE_SPLASH_RAD;
if(rpg_dmgFlags.integer & 8) {
grenade->splashDamage = GRENADE_SPLASH_DAM;
grenade->splashRadius = GRENADE_SPLASH_RAD;
} else {
grenade->splashDamage = 0;
grenade->splashRadius = 0;
}
grenade->s.pos.trType = TR_GRAVITY;
grenade->nextthink = level.time + GRENADE_ALT_TIME; /* How long 'til she blows */
}
@ -738,7 +749,7 @@ static void WP_FireGrenade( gentity_t *ent, qboolean alt_fire )
grenade->s.eFlags |= EF_MISSILE_STICK;
VectorScale( dir, 1000, grenade->s.pos.trDelta );
grenade->damage = GRENADE_ALT_DAMAGE*DMG_VAR;
(rpg_dmgFlags.integer & 8) ? grenade->damage = GRENADE_ALT_DAMAGE*DMG_VAR : grenade->damage = 0;
grenade->methodOfDeath = MOD_GRENADE_ALT;
grenade->splashMethodOfDeath = MOD_GRENADE_ALT_SPLASH;
grenade->s.eType = ET_ALT_MISSILE;
@ -894,9 +905,15 @@ static void WP_FireGrenade( gentity_t *ent, qboolean alt_fire )
VectorScale( dir, GRENADE_VELOCITY, grenade->s.pos.trDelta );
grenade->s.pos.trType = TR_GRAVITY;
grenade->damage = GRENADE_DAMAGE*DMG_VAR;
grenade->splashDamage = GRENADE_SPLASH_DAM;
grenade->splashRadius = GRENADE_SPLASH_RAD;
if(rpg_dmgFlags.integer & 8) {
grenade->damage = GRENADE_DAMAGE*DMG_VAR;
grenade->splashDamage = GRENADE_SPLASH_DAM;
grenade->splashRadius = GRENADE_SPLASH_RAD;
} else {
grenade->damage = 0;
grenade->splashDamage = 0;
grenade->splashRadius = 0;
}
grenade->methodOfDeath = MOD_GRENADE;
grenade->splashMethodOfDeath = MOD_GRENADE_SPLASH;
grenade->s.eType = ET_MISSILE;
@ -965,7 +982,7 @@ static void WP_FireTR116Bullet( gentity_t *ent, vec3_t start, vec3_t dir ) {
traceEnt = &g_entities[ tr.entityNum ];
if ( traceEnt->takedamage ) {
if ( traceEnt->takedamage && (rpg_dmgFlags.integer & 4)) {
G_Damage( traceEnt, ent, ent, dir, tr.endpos, TETRION_DAMAGE, 0, MOD_TETRION_ALT );
}
}
@ -1033,9 +1050,15 @@ static void FireQuantumBurst( gentity_t *ent, vec3_t start, vec3_t dir )
bolt->r.ownerNum = ent->s.number;
bolt->parent = ent;
bolt->damage = QUANTUM_DAMAGE*DMG_VAR;
bolt->splashDamage = QUANTUM_SPLASH_DAM;
bolt->splashRadius = QUANTUM_SPLASH_RAD;
if(rpg_dmgFlags.integer & 16) {
bolt->damage = QUANTUM_DAMAGE*DMG_VAR;
bolt->splashDamage = QUANTUM_SPLASH_DAM;
bolt->splashRadius = QUANTUM_SPLASH_RAD;
} else {
bolt->damage = 0;
bolt->splashDamage = 0;
bolt->splashRadius = 0;
}
bolt->methodOfDeath = MOD_QUANTUM;
bolt->splashMethodOfDeath = MOD_QUANTUM_SPLASH;
@ -1219,9 +1242,15 @@ static void FireQuantumBurstAlt( gentity_t *ent, vec3_t start, vec3_t dir )
bolt->parent = ent;
bolt->s.eFlags |= EF_ALT_FIRING;
bolt->damage = QUANTUM_ALT_DAMAGE*DMG_VAR;
bolt->splashDamage = QUANTUM_ALT_SPLASH_DAM;
bolt->splashRadius = QUANTUM_ALT_SPLASH_RAD;
if(rpg_dmgFlags.integer & 16) {
bolt->damage = QUANTUM_ALT_DAMAGE*DMG_VAR;
bolt->splashDamage = QUANTUM_ALT_SPLASH_DAM;
bolt->splashRadius = QUANTUM_ALT_SPLASH_RAD;
} else {
bolt->damage = 0;
bolt->splashDamage = 0;
bolt->splashRadius = 0;
}
bolt->methodOfDeath = MOD_QUANTUM_ALT;
bolt->splashMethodOfDeath = MOD_QUANTUM_ALT_SPLASH;