1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

vcmi: allow to configure army movement counter

It is not hardcoded now. MOVEMENT.TXT is still not read,
but ARMY_MOVEMENT updater parameters can be specified in json.
There is a 4 parameters:
1. Base - base value (firstly lowest speed is multiplied by it)
2. Divider - base value is integrally divided by it
3. Multiplier - result value will be multiplied by it
4. Max - maximum allowed movement from army.

Vanilla values is in defaultMods.json

Fixes: https://bugs.vcmi.eu/view.php?id=3209
This commit is contained in:
Konstantin
2023-03-11 23:09:16 +03:00
parent b91d7418dd
commit 0adffc824f
6 changed files with 70 additions and 16 deletions

View File

@@ -49,7 +49,7 @@ class DLL_LINKAGE CGHeroInstance : public CArmedInstance, public IBoatGenerator,
private:
std::set<SpellID> spells; //known spells (spell IDs)
mutable int armyMovementVal;
mutable int lowestCreatureSpeed;
public:
@@ -171,7 +171,7 @@ public:
ui32 getTileCost(const TerrainTile & dest, const TerrainTile & from, const TurnInfo * ti) const; //move cost - applying pathfinding skill, road and terrain modifiers. NOT includes diagonal move penalty, last move levelling
TerrainId getNativeTerrain() const;
ui32 getLowestCreatureSpeed() const;
int getLowestCreatureSpeed() const;
si32 manaRegain() const; //how many points of mana can hero regain "naturally" in one day
si32 getManaNewTurn() const; //calculate how much mana this hero is going to have the next day
int getCurrentLuck(int stack=-1, bool town=false) const;
@@ -213,7 +213,6 @@ public:
int maxMovePointsCached(bool onLand, const TurnInfo * ti) const;
//update army movement bonus
void updateArmyMovementBonus(bool onLand, const TurnInfo * ti) const;
int getArmyMovementBonus() const;
int movementPointsAfterEmbark(int MPsBefore, int basicCost, bool disembark = false, const TurnInfo * ti = nullptr) const;