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

Function VarianceAdjustEffect

src/algo.cpp:164–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164int VarianceAdjustEffect(int base, int var) {
165 // FIXME: RPG_RT 2k3 doesn't apply variance if negative attribute flips damage
166 if (var > 0 && (base > 0 || Player::IsLegacy())) {
167 int adj = std::max(1, var * base / 10);
168 return base + Rand::GetRandomNumber(0, adj) - adj / 2;
169 }
170 return base;
171}
172
173int AdjustDamageForDefend(int dmg, const Game_Battler& target) {
174 if (target.IsDefending()) {

Callers 5

CalcNormalAttackEffectFunction · 0.85
CalcSkillEffectFunction · 0.85
CalcSelfDestructEffectFunction · 0.85
algo.cppFile · 0.85

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected