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_DAMAGE enchantment #75300

Merged
merged 1 commit into from
Jul 29, 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 @@ -904,6 +904,7 @@ Character status value | Description
`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
`THROW_DAMAGE` | Increases the damage of any thrown projectile. `add` adds this amount of damage to the projectile as bash damage, `multiply` would increase all projectile damage, not only bash type.
`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
1 change: 1 addition & 0 deletions src/magic_enchantment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ namespace io
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::THROW_DAMAGE: return "THROW_DAMAGE";
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 @@ -171,6 +171,7 @@ enum class mod : int {
SCENT_MASK,
CONSUME_TIME_MOD,
THROW_STR,
THROW_DAMAGE,
SWEAT_MULTIPLIER,
STAMINA_REGEN_MOD,
MOVEMENT_EXERTION_MODIFIER,
Expand Down
3 changes: 3 additions & 0 deletions src/ranged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,9 @@ dealt_projectile_attack Character::throw_item( const tripoint &target, const ite
impact.add_damage( damage_bash, std::min( weight / 100.0_gram,
static_cast<double>( thrown_item_adjusted_damage( thrown ) ) ) );

impact.add_damage( damage_bash,
enchantment_cache->get_value_add( enchant_vals::mod::THROW_DAMAGE ) );
impact.mult_damage( 1 + enchantment_cache->get_value_multiply( enchant_vals::mod::THROW_DAMAGE ) );
if( thrown.has_flag( flag_ACT_ON_RANGED_HIT ) ) {
proj_effects.insert( ammo_effect_ACT_ON_RANGED_HIT );
thrown.active = true;
Expand Down
Loading