Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Anton Burmistrov <[email protected]>
  • Loading branch information
John-Candlebury and Night-Pryanik committed Nov 9, 2024
1 parent 654ea49 commit 405f6f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/JSON_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Some armor flags, such as `WATCH` and `ALARMCLOCK` are compatible with other ite
- ```DEAF``` Makes the player deaf.
- ```DECAY_EXPOSED_ATMOSPHERE``` Consumable will go bad once exposed to the atmosphere (such as MREs).
- ```ELECTRIC_IMMUNE``` This gear completely protects you from electric discharges.
- ```ENERGY_SHIELD``` Marks a piece of armor as an energy shield. Energy shields do not suffer degradation from attacks and instead have an hp pool defined by the dialogue variable `ENERGY_SHIELD_HP`that is depleted by blocked attacks and a second variable `ENERGY_SHIELD_MAX_HP` which just stores the max hp of the shield in case its needed for EOC manipulation. When the hp pool is depleted, the shield is destroyed. The fields `ENERGY SHIELD_HP` and `ENERGY_SHIELD_MAX_HP` are dialogue variables stored in the item, and can be modified through effects on condition.
- ```ENERGY_SHIELD``` Marks a piece of armor as an energy shield. Energy shields do not suffer degradation from attacks and instead have an hp pool defined by the dialogue variable `ENERGY_SHIELD_HP` that is depleted by blocked attacks and a second variable `ENERGY_SHIELD_MAX_HP` which just stores the max hp of the shield in case it's needed for EOC manipulation. When the hp pool is depleted, the shield is destroyed. The fields `ENERGY SHIELD_HP` and `ENERGY_SHIELD_MAX_HP` are dialogue variables stored in the item, and can be modified through effects on condition.
- ```EXTRA_PLATING``` Item can be worn over some armors, as additional layer of protection (like armor above brigandine); specifically can be put in pocket for armor with this flag restriction.
- ```FANCY``` Wearing this clothing gives a morale bonus if the player has the `Stylish` trait.
- ```FIN``` This item is swim fins aka diving fins aka flippets, and provide speed boost when you swim.
Expand Down
4 changes: 2 additions & 2 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9062,7 +9062,7 @@ item::armor_status item::damage_armor_durability( damage_unit &du, damage_unit &
if( shield_hp > 0 ) {
return armor_status::UNDAMAGED;
} else {
//Shields deliberatedly ignore the enchatment multiplier, as the health mechanic wouln't make sense otherwise.
//Shields deliberately ignore the enchantment multiplier, as the health mechanic wouldn't make sense otherwise.
mod_damage( itype::damage_scale * 6 );
return armor_status::DESTROYED;
}
Expand All @@ -9078,7 +9078,7 @@ item::armor_status item::damage_armor_durability( damage_unit &du, damage_unit &
// This is some weird type that doesn't damage armors
return armor_status::UNDAMAGED;
}
// Fragile items take damage if the block more than 15% of their armor value this uses the pre-mitigated damage.
// Fragile items take damage if they block more than 15% of their armor value, this uses the pre-mitigated damage.
if( has_flag( flag_FRAGILE ) &&
premitigated.amount / armors_own_resist > ( 0.15f / enchant_multiplier ) ) {
return mod_damage( itype::damage_scale * enchant_multiplier ) ? armor_status::DESTROYED :
Expand Down

0 comments on commit 405f6f2

Please sign in to comment.