1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

vcmi: camelCase methods of new classes

Also use EGameSettings for clamping morale and luck
This commit is contained in:
Konstantin
2023-05-02 01:05:59 +03:00
committed by Konstantin P
parent a6de9097be
commit fbc05c70ac
14 changed files with 46 additions and 39 deletions

View File

@@ -926,7 +926,7 @@ void CGameHandler::makeAttack(const CStack * attacker, const CStack * defender,
if(counter)
bat.flags |= BattleAttack::COUNTER;
const int attackerLuck = attacker->LuckVal();
const int attackerLuck = attacker->luckVal();
if(attackerLuck > 0)
{
@@ -1334,7 +1334,7 @@ int CGameHandler::moveStack(int stack, BattleHex dest)
ret = path.second;
int creSpeed = curStack->Speed(0, true);
int creSpeed = curStack->speed(0, true);
if (gs->curB->tacticDistance > 0 && creSpeed > 0)
creSpeed = GameConstants::BFIELD_SIZE;
@@ -6518,7 +6518,7 @@ void CGameHandler::runBattle()
sendAndApply(&removeGhosts);
// check for bad morale => freeze
int nextStackMorale = next->MoraleVal();
int nextStackMorale = next->moraleVal();
if(!next->hadMorale && !next->waited() && nextStackMorale < 0)
{
auto diceSize = VLC->settings()->getVector(EGameSettings::COMBAT_BAD_MORALE_DICE);
@@ -6704,7 +6704,7 @@ void CGameHandler::runBattle()
if(next != nullptr)
{
//check for good morale
nextStackMorale = next->MoraleVal();
nextStackMorale = next->moraleVal();
if( !battleResult.get()
&& !next->hadMorale
&& !next->defending