MCPcopy Create free account
hub / github.com/EasyRPG/Player / GetBaseAttributeRate

Method GetBaseAttributeRate

src/game_actor.cpp:701–716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699}
700
701int 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
718bool Game_Actor::IsImmuneToAttributeDownshifts() const {
719 return dbActor->easyrpg_immune_to_attribute_downshifts;

Callers 2

game_actor.cppFile · 0.45
game_enemy.cppFile · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected