diff --git a/lib/GameConstants.h b/lib/GameConstants.h index 3be98905e..2c11cb431 100644 --- a/lib/GameConstants.h +++ b/lib/GameConstants.h @@ -56,7 +56,8 @@ namespace GameConstants constexpr int HERO_GOLD_COST = 2500; constexpr int SPELLBOOK_GOLD_COST = 500; constexpr int SKILL_GOLD_COST = 2000; - constexpr int BATTLE_PENALTY_DISTANCE = 10; //if the distance is > than this, then shooting stack has distance penalty + constexpr int BATTLE_SHOOTING_PENALTY_DISTANCE = 10; //if the distance is > than this, then shooting stack has distance penalty + constexpr int BATTLE_SHOOTING_RANGE_DISTANCE = std::numeric_limits::max(); // used when shooting stack has no shooting range limit constexpr int ARMY_SIZE = 7; constexpr int SKILL_PER_HERO = 8; constexpr ui32 HERO_HIGH_LEVEL = 10; // affects primary skill upgrade order diff --git a/lib/battle/CBattleInfoCallback.cpp b/lib/battle/CBattleInfoCallback.cpp index e47097d00..f207c7170 100644 --- a/lib/battle/CBattleInfoCallback.cpp +++ b/lib/battle/CBattleInfoCallback.cpp @@ -1456,7 +1456,7 @@ bool CBattleInfoCallback::battleHasDistancePenalty(const IBonusBearer * shooter, if(const auto * target = battleGetUnitByPos(destHex, true)) { //If any hex of target creature is within range, there is no penalty - int range = GameConstants::BATTLE_PENALTY_DISTANCE; + int range = GameConstants::BATTLE_SHOOTING_PENALTY_DISTANCE; auto bonus = shooter->getBonus(Selector::type()(BonusType::LIMITED_SHOOTING_RANGE)); if(bonus != nullptr && bonus->additionalInfo != CAddInfo::NONE) @@ -1467,7 +1467,7 @@ bool CBattleInfoCallback::battleHasDistancePenalty(const IBonusBearer * shooter, } else { - if(BattleHex::getDistance(shooterPosition, destHex) <= GameConstants::BATTLE_PENALTY_DISTANCE) + if(BattleHex::getDistance(shooterPosition, destHex) <= GameConstants::BATTLE_SHOOTING_PENALTY_DISTANCE) return false; } diff --git a/lib/battle/CUnitState.cpp b/lib/battle/CUnitState.cpp index 36f482a34..0c2ff8abc 100644 --- a/lib/battle/CUnitState.cpp +++ b/lib/battle/CUnitState.cpp @@ -596,7 +596,7 @@ uint8_t CUnitState::getRangedFullDamageDistance() const if(!isShooter()) return 0; - uint8_t rangedFullDamageDistance = GameConstants::BATTLE_PENALTY_DISTANCE; + uint8_t rangedFullDamageDistance = GameConstants::BATTLE_SHOOTING_PENALTY_DISTANCE; // overwrite full ranged damage distance with the value set in Additional info field of LIMITED_SHOOTING_RANGE bonus if(this->hasBonus(Selector::type()(BonusType::LIMITED_SHOOTING_RANGE))) @@ -614,7 +614,7 @@ uint8_t CUnitState::getSootingRangeDistance() const if(!isShooter()) return 0; - uint8_t shootingRangeDistance = 255; // no range limit for shooters + uint8_t shootingRangeDistance = GameConstants::BATTLE_SHOOTING_RANGE_DISTANCE; // overwrite full ranged damage distance with the value set in Additional info field of LIMITED_SHOOTING_RANGE bonus if(this->hasBonus(Selector::type()(BonusType::LIMITED_SHOOTING_RANGE)))