Skip to content

Commit

Permalink
fix: make scent_modifier affect your scent equilibrium. (#5323)
Browse files Browse the repository at this point in the history
Update character_turn.cpp

`scent_modifier` was multiplying the scent value after addition/subtraction. Meaning that if you had a value less than 0 and just created the character/loaded it, the scent map would be 0 and increased to 1, then multiplied by 0.x which is then truncated to 0.

Fixes it so it actually multplies your `norm_scent` value.
  • Loading branch information
KheirFerrum authored Sep 7, 2024
1 parent 6653fcc commit 4374df7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/character_turn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,14 @@ void Character::process_turn()
}
}

//mask from scent altering items;
// Mask from scent altering items;
norm_scent += mask_intensity;

// Now that all the additions are done, multiply norm_scent by any scent modifiers.
for( const trait_id &mut : get_mutations() ) {
norm_scent *= mut.obj().scent_modifier;
}

// Scent increases fast at first, and slows down as it approaches normal levels.
// Estimate it will take about norm_scent * 2 turns to go from 0 - norm_scent / 2
// Without smelly trait this is about 1.5 hrs. Slows down significantly after that.
Expand All @@ -253,10 +258,6 @@ void Character::process_turn()
if( scent > norm_scent ) {
scent--;
}

for( const trait_id &mut : get_mutations() ) {
scent *= mut.obj().scent_modifier;
}
}

// We can dodge again! Assuming we can actually move...
Expand Down

0 comments on commit 4374df7

Please sign in to comment.