Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add THROW_STR enchantment #75230

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/MAGIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ Character status value | Description
`STRENGTH` | Affects the strength stat. Formula for all stat affecting enchantments are `(base_stat + enchantment_addition) * (enchantment_multiplier + 1)`. Str 8 with enchantment `add 2, multiply 1` result in `(8+2) * (1+1) = 10 * 2 =` 20 str
`SWEAT_MULTIPLIER` | Affects how much your body can sweat. Affects all bodyparts at once. Since it's a percent, using `multiply` is recommended.
`THIRST` |
`THROW_STR` | Increases your strength for throwing purposes. Not limited by your throwing skill (you still throw it as precise as your skill allows you, just further). Only additive. Rule of thumb: one additional point of strength allow you to throw 113 g object 10 tiles further, or 1130 g object 1 tile further, limited by [ str * 3 + skill ]. Full calculations are in Character::throw_range
`UGLINESS` | Affects your `ugliness` stat, which affects NPCs' initial opinion of you.
`VITAMIN_ABSORB_MOD` | Increases amount of vitamins obtained from the food
`VOMIT_MUL` | Affects your chances to vomit.
Expand Down
11 changes: 5 additions & 6 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5997,7 +5997,8 @@ int Character::throw_range( const item &it ) const
tmp.charges = 1;
}

int str = get_arm_str();
int ench_bonus = enchantment_cache->get_value_add( enchant_vals::mod::THROW_STR );
int str = get_arm_str() + ench_bonus;

/** @ARM_STR determines maximum weight that can be thrown */
if( ( tmp.weight() / 113_gram ) > str * 15 ) {
Expand All @@ -6019,12 +6020,10 @@ int Character::throw_range( const item &it ) const
if( ret < 1 ) {
return 1;
}
// Cap at double our strength + skill
/** @EFFECT_STR caps throwing range */

/** @EFFECT_THROW caps throwing range */
if( ret > round( str * 3 + get_skill_level( skill_throw ) ) ) {
return round( str * 3 + get_skill_level( skill_throw ) );
// Cap at triple of our strength + skill
if( ret > round( str * 3 + get_skill_level( skill_throw ) + ench_bonus ) ) {
return round( str * 3 + get_skill_level( skill_throw ) + ench_bonus );
}

return ret;
Expand Down
1 change: 1 addition & 0 deletions src/magic_enchantment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ namespace io
case enchant_vals::mod::VOMIT_MUL: return "VOMIT_MUL";
case enchant_vals::mod::SCENT_MASK: return "SCENT_MASK";
case enchant_vals::mod::CONSUME_TIME_MOD: return "CONSUME_TIME_MOD";
case enchant_vals::mod::THROW_STR: return "THROW_STR";
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";
Expand Down
1 change: 1 addition & 0 deletions src/magic_enchantment.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ enum class mod : int {
VOMIT_MUL,
SCENT_MASK,
CONSUME_TIME_MOD,
THROW_STR,
SWEAT_MULTIPLIER,
STAMINA_REGEN_MOD,
MOVEMENT_EXERTION_MODIFIER,
Expand Down
Loading