Skip to content

Commit

Permalink
Dim Vision curse duration now matches the ability.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vortex-Quake2 committed Sep 21, 2024
1 parent aee3ec8 commit 8c95e76
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
23 changes: 14 additions & 9 deletions src/combat/abilities/curses.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down
8 changes: 2 additions & 6 deletions src/combat/common/g_combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 8c95e76

Please sign in to comment.