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

Function ClampStatMod

src/game_actor.cpp:1123–1126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1121}
1122
1123static int ClampStatMod(int value, const Game_Actor* actor) {
1124 auto limit = actor->MaxStatBaseValue();
1125 return Utils::Clamp(value, -limit, limit);
1126}
1127
1128void Game_Actor::SetBaseMaxHp(int maxhp) {
1129 int new_hp_mod = data.hp_mod + (maxhp - GetBaseMaxHp());

Callers 4

SetBaseAtkMethod · 0.85
SetBaseDefMethod · 0.85
SetBaseSpiMethod · 0.85
SetBaseAgiMethod · 0.85

Calls 1

MaxStatBaseValueMethod · 0.45

Tested by

no test coverage detected