From 8c95e760bf0df6056a3cd8bf3af9284f14a76cc7 Mon Sep 17 00:00:00 2001 From: Vortex-Quake2 Date: Fri, 20 Sep 2024 21:36:42 -0400 Subject: [PATCH] Dim Vision curse duration now matches the ability. --- src/combat/abilities/curses.c | 23 ++++++++++++++--------- src/combat/common/g_combat.c | 8 ++------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/combat/abilities/curses.c b/src/combat/abilities/curses.c index 379b83a3..7916649b 100644 --- a/src/combat/abilities/curses.c +++ b/src/combat/abilities/curses.c @@ -600,6 +600,19 @@ void Cmd_AmpDamage(edict_t *ent) // Curse //************************************************************************************************ +float vrx_get_curse_duration(edict_t* ent) +{ + float talentLevel, duration = CURSE_DURATION_BASE + (CURSE_DURATION_BONUS * ent->myskills.abilities[CURSE].current_level); + //Talent: Evil curse + talentLevel = vrx_get_talent_level(ent, TALENT_EVIL_CURSE); + if (talentLevel > 0) + duration *= 1.0 + 0.25 * talentLevel; + + if (duration < 1) + duration = 1; + return duration; +} + void Cmd_Curse(edict_t *ent) { int range, radius, talentLevel, cost=CURSE_COST; @@ -618,15 +631,7 @@ void Cmd_Curse(edict_t *ent) range = CURSE_DEFAULT_INITIAL_RANGE + CURSE_DEFAULT_ADDON_RANGE * ent->myskills.abilities[CURSE].current_level; radius = CURSE_DEFAULT_INITIAL_RADIUS + CURSE_DEFAULT_ADDON_RADIUS * ent->myskills.abilities[CURSE].current_level; - duration = CURSE_DURATION_BASE + (CURSE_DURATION_BONUS * ent->myskills.abilities[CURSE].current_level); - - //Talent: Evil curse - talentLevel = vrx_get_talent_level(ent, TALENT_EVIL_CURSE); - if(talentLevel > 0) - duration *= 1.0 + 0.25 * talentLevel; - - if (duration < 1) - duration = 1; + duration = vrx_get_curse_duration(ent); CurseRadiusAttack(ent, CURSE, range, radius, duration, true); diff --git a/src/combat/common/g_combat.c b/src/combat/common/g_combat.c index fe8369f4..6f38582f 100644 --- a/src/combat/common/g_combat.c +++ b/src/combat/common/g_combat.c @@ -48,7 +48,7 @@ float location_scaling(edict_t *targ, vec3_t point, int damage) { */ void TossClientWeapon (edict_t *self); - +float vrx_get_curse_duration(edict_t* ent); qboolean HitTheWeapon (edict_t *targ, edict_t *attacker, const vec3_t point, int take, int dflags) { @@ -1117,23 +1117,19 @@ int T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, { int curse_level; - //gi.dprintf("attempt to activate dim vision\n"); temp = 0.1 * talentLevel; if (temp > random()) { curse_level = targ_player->myskills.abilities[CURSE].current_level; - if (curse_level < 1) curse_level = 1; - //gi.dprintf("activated level %d dim vision!\n", curse_level); // add the curse - curse_add(attacker, targ_player, CURSE, curse_level, curse_level/2.0f); + curse_add(attacker, targ_player, CURSE, curse_level, vrx_get_curse_duration(targ_player)); CurseMessage(targ_player, attacker, CURSE, curse_level, true); //Play the spell sound! gi.sound(targ, CHAN_ITEM, gi.soundindex("curses/curse.wav"), 1, ATTN_NORM, 0); } - // modify delay targ->dim_vision_delay = level.framenum + (int)(1 / FRAMETIME); // roll again in 1 second }