Skip to content

Commit

Permalink
Adding MOVEMENT_EXERTION_MODIFIER as enchantment (#72580)
Browse files Browse the repository at this point in the history
* First commit, praise Clang

* Update src/avatar_action.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Added documentation

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
DPavonis and github-actions[bot] committed Mar 29, 2024
1 parent 2ff149f commit 6004f7b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/MAGIC.md
Expand Up @@ -859,6 +859,7 @@ Character status value | Description
`MOVECOST_FLATGROUND_MOD`| How many moves you spend to move 1 tile on flat ground; shown in UI
`MOVECOST_OBSTACLE_MOD` | How many moves you spend to move 1 tile, if this tile has a movecost more than 105 moves; not shown in UI
`MOVECOST_SWIM_MOD` | How many moves you spend to move 1 tile in water; not shown in UI
`MOVEMENT_EXERTION_MODIFIER` | Affects how much physical exertion (activity_level) is required for the player to move a single tile. The value this affects is technically a float, so addition and multiplication operations can be performed on it, but player-facing effects only happen at specific whole-integer breakpoints. This can most easily be seen in `\data\json\ui\activity.json`.
`NIGHT_VIS` | How well you can see in darkness. `ADD` adds tiles, so `"ADD": 3` increases night vision distance by 3 tiles.
`OBTAIN_COST_MULTIPLIER`| Modifier for pulling an item from a container, as a handling penalty or bonus. `"add": 100` add 100 additional moves to item wield (1 second)
`OVERKILL_DAMAGE` | multiplies or contributes to the damage to an enemy corpse after death. The lower the number, the more damage caused.
Expand Down
3 changes: 2 additions & 1 deletion src/avatar_action.cpp
Expand Up @@ -222,7 +222,8 @@ bool avatar_action::move( avatar &you, map &m, const tripoint &d )

// by this point we're either walking, running, crouching, or attacking, so update the activity level to match
if( !is_riding ) {
you.set_activity_level( you.current_movement_mode()->exertion_level() );
you.set_activity_level( you.enchantment_cache->modify_value(
enchant_vals::mod::MOVEMENT_EXERTION_MODIFIER, you.current_movement_mode()->exertion_level() ) );
}

// If the player is *attempting to* move on the X axis, update facing direction of their sprite to match.
Expand Down
1 change: 1 addition & 0 deletions src/magic_enchantment.cpp
Expand Up @@ -192,6 +192,7 @@ namespace io
case enchant_vals::mod::CONSUME_TIME_MOD: return "CONSUME_TIME_MOD";
case enchant_vals::mod::SWEAT_MULTIPLIER: return "SWEAT_MULTIPLIER";
case enchant_vals::mod::STAMINA_REGEN_MOD: return "STAMINA_REGEN_MOD";
case enchant_vals::mod::MOVEMENT_EXERTION_MODIFIER: return "MOVEMENT_EXERTION_MODIFIER";
case enchant_vals::mod::NUM_MOD: break;
}
cata_fatal( "Invalid enchant_vals::mod" );
Expand Down
1 change: 1 addition & 0 deletions src/magic_enchantment.h
Expand Up @@ -170,6 +170,7 @@ enum class mod : int {
CONSUME_TIME_MOD,
SWEAT_MULTIPLIER,
STAMINA_REGEN_MOD,
MOVEMENT_EXERTION_MODIFIER,
NUM_MOD
};
} // namespace enchant_vals
Expand Down

0 comments on commit 6004f7b

Please sign in to comment.