| 699 | } |
| 700 | |
| 701 | int Game_Actor::GetBaseAttributeRate(int attribute_id) const { |
| 702 | int rate = 2; // C - default |
| 703 | |
| 704 | const auto* r = lcf::ReaderUtil::GetElement(dbActor->attribute_ranks, attribute_id); |
| 705 | if (r) { |
| 706 | rate = *r; |
| 707 | } |
| 708 | |
| 709 | bool boost = false; |
| 710 | ForEachEquipment<false,true>(GetWholeEquipment(), [&](auto& item) { |
| 711 | boost |= attribute_id >= 1 && attribute_id <= static_cast<int>(item.attribute_set.size()) && item.attribute_set[attribute_id - 1]; |
| 712 | }); |
| 713 | rate += boost; |
| 714 | |
| 715 | return Utils::Clamp(rate, 0, 4); |
| 716 | } |
| 717 | |
| 718 | bool Game_Actor::IsImmuneToAttributeDownshifts() const { |
| 719 | return dbActor->easyrpg_immune_to_attribute_downshifts; |
no test coverage detected