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

refactor shield calculations #2

Closed
wants to merge 24 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Update character.cpp
  • Loading branch information
chaosvolt committed May 20, 2023
commit 8a9ec71f0324f0100e78be77a60b2e5a73c6b2e3
6 changes: 0 additions & 6 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10691,27 +10691,21 @@ bool Character::block_ranged_hit( Creature *source, bodypart_id &bp_hit, damage_
for( auto &elem : dam.damage_units ) {
// Go through all relevant damage types and reduce by armor value if one exists.
if( elem.type == DT_BASH ) {
float previous_amount = elem.amount;
float block_amount = shield.bash_resist();
elem.amount -= block_amount;
} else if( elem.type == DT_CUT ) {
float previous_amount = elem.amount;
float block_amount = shield.cut_resist();
elem.amount -= block_amount;
} else if( elem.type == DT_STAB ) {
float previous_amount = elem.amount;
float block_amount = shield.stab_resist();
elem.amount -= block_amount;
} else if( elem.type == DT_BULLET ) {
float previous_amount = elem.amount;
float block_amount = shield.bullet_resist();
elem.amount -= block_amount;
} else if( elem.type == DT_HEAT ) {
float previous_amount = elem.amount;
float block_amount = shield.fire_resist();
elem.amount -= block_amount;
} else if( elem.type == DT_ACID ) {
float previous_amount = elem.amount;
float block_amount = shield.acid_resist();
elem.amount -= block_amount;
}
Expand Down