Skip to content

Commit

Permalink
"3.12: RM2000 + RM2003: Protection equipment against an element shoul…
Browse files Browse the repository at this point in the history
…d increase the rate for 1 (at most). This can be combined with Shift attribute."

Solution: Add in Game_Actor::GetAttributeModifier a check for all the protections. If it protects against that element, increase rate (only once).
  • Loading branch information
Albeleon authored and mateofio committed Nov 6, 2018
1 parent cbd34e9 commit 6c3a01c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/game_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,16 @@ int Game_Actor::GetAttributeModifier(int attribute_id) const {
}

rate += *shift;
for (auto id_object : GetWholeEquipment()) {
RPG::Item *object = ReaderUtil::GetElement(Data::items, id_object);
if (object != nullptr && (object->type == RPG::Item::Type_shield || object->type == RPG::Item::Type_armor
|| object->type == RPG::Item::Type_helmet || object->type == RPG::Item::Type_accessory)
&& object->attribute_set.size() >= attribute_id && object->attribute_set[attribute_id - 1]) {
rate++;
break;
}
}

if (rate < 0) {
rate = 0;
} else if (rate > 4) {
Expand Down

0 comments on commit 6c3a01c

Please sign in to comment.