mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Merge pull request #5729 from dydzio0614/gameplay-improvements
Gameplay improvements
This commit is contained in:
@@ -855,7 +855,7 @@ void BattleWindow::blockUI(bool on)
|
|||||||
setShortcutBlocked(EShortcut::BATTLE_DEFEND, on || owner.tacticsMode);
|
setShortcutBlocked(EShortcut::BATTLE_DEFEND, on || owner.tacticsMode);
|
||||||
setShortcutBlocked(EShortcut::BATTLE_SELECT_ACTION, on || owner.tacticsMode);
|
setShortcutBlocked(EShortcut::BATTLE_SELECT_ACTION, on || owner.tacticsMode);
|
||||||
setShortcutBlocked(EShortcut::BATTLE_AUTOCOMBAT, (settings["battle"]["endWithAutocombat"].Bool() && onlyOnePlayerHuman) ? on || owner.tacticsMode || owner.actionsController->heroSpellcastingModeActive() : owner.actionsController->heroSpellcastingModeActive());
|
setShortcutBlocked(EShortcut::BATTLE_AUTOCOMBAT, (settings["battle"]["endWithAutocombat"].Bool() && onlyOnePlayerHuman) ? on || owner.tacticsMode || owner.actionsController->heroSpellcastingModeActive() : owner.actionsController->heroSpellcastingModeActive());
|
||||||
setShortcutBlocked(EShortcut::BATTLE_END_WITH_AUTOCOMBAT, on || owner.tacticsMode || !onlyOnePlayerHuman || owner.actionsController->heroSpellcastingModeActive());
|
setShortcutBlocked(EShortcut::BATTLE_END_WITH_AUTOCOMBAT, on || !onlyOnePlayerHuman || owner.actionsController->heroSpellcastingModeActive());
|
||||||
setShortcutBlocked(EShortcut::BATTLE_TACTICS_END, on || !owner.tacticsMode);
|
setShortcutBlocked(EShortcut::BATTLE_TACTICS_END, on || !owner.tacticsMode);
|
||||||
setShortcutBlocked(EShortcut::BATTLE_TACTICS_NEXT, on || !owner.tacticsMode);
|
setShortcutBlocked(EShortcut::BATTLE_TACTICS_NEXT, on || !owner.tacticsMode);
|
||||||
setShortcutBlocked(EShortcut::BATTLE_CONSOLE_DOWN, on && !owner.tacticsMode);
|
setShortcutBlocked(EShortcut::BATTLE_CONSOLE_DOWN, on && !owner.tacticsMode);
|
||||||
@@ -891,7 +891,7 @@ std::optional<uint32_t> BattleWindow::getQueueHoveredUnitId()
|
|||||||
|
|
||||||
void BattleWindow::endWithAutocombat()
|
void BattleWindow::endWithAutocombat()
|
||||||
{
|
{
|
||||||
if(!owner.makingTurn() || owner.tacticsMode)
|
if(!owner.makingTurn())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GAME->interface()->showYesNoDialog(
|
GAME->interface()->showYesNoDialog(
|
||||||
|
|||||||
@@ -27,10 +27,7 @@ void Scrollable::gesture(bool on, const Point & initialPosition, const Point & f
|
|||||||
|
|
||||||
void Scrollable::wheelScrolled(int distance)
|
void Scrollable::wheelScrolled(int distance)
|
||||||
{
|
{
|
||||||
if (orientation == Orientation::HORIZONTAL)
|
scrollBy(-distance * scrollStep);
|
||||||
scrollBy(distance * scrollStep);
|
|
||||||
else
|
|
||||||
scrollBy(-distance * scrollStep);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scrollable::gesturePanning(const Point & initialPosition, const Point & currentPosition, const Point & lastUpdateDistance)
|
void Scrollable::gesturePanning(const Point & initialPosition, const Point & currentPosition, const Point & lastUpdateDistance)
|
||||||
|
|||||||
@@ -295,7 +295,7 @@
|
|||||||
// number of heroes that player can have active on map at the same time
|
// number of heroes that player can have active on map at the same time
|
||||||
"perPlayerOnMapCap" : 8,
|
"perPlayerOnMapCap" : 8,
|
||||||
// number of heroes that player can have in total, including garrisoned
|
// number of heroes that player can have in total, including garrisoned
|
||||||
"perPlayerTotalCap" : 16,
|
"perPlayerTotalCap" : 9999,
|
||||||
// if enabled, hero that wins a battle without any non-summoned troops left will retreat and become available in tavern instead of being lost
|
// if enabled, hero that wins a battle without any non-summoned troops left will retreat and become available in tavern instead of being lost
|
||||||
"retreatOnWinWithoutTroops" : true,
|
"retreatOnWinWithoutTroops" : true,
|
||||||
// Chances for a hero with default army to receive corresponding stack out of his predefined starting troops
|
// Chances for a hero with default army to receive corresponding stack out of his predefined starting troops
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ const IBonusBearer * CBattleInfoEssentials::getBonusBearer() const
|
|||||||
bool CBattleInfoEssentials::battleCanFlee(const PlayerColor & player) const
|
bool CBattleInfoEssentials::battleCanFlee(const PlayerColor & player) const
|
||||||
{
|
{
|
||||||
RETURN_IF_NOT_BATTLE(false);
|
RETURN_IF_NOT_BATTLE(false);
|
||||||
const auto side = playerToSide(player);
|
const BattleSide side = playerToSide(player);
|
||||||
if(side == BattleSide::NONE)
|
if(side == BattleSide::NONE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -281,7 +281,7 @@ bool CBattleInfoEssentials::battleCanFlee(const PlayerColor & player) const
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
//eg. one of heroes is wearing shakles of war
|
//eg. one of heroes is wearing shakles of war
|
||||||
if(myHero->hasBonusOfType(BonusType::BATTLE_NO_FLEEING))
|
if(myHero->hasBonusOfType(BonusType::BATTLE_NO_FLEEING) && battleHasHero(otherSide(side)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//we are besieged defender
|
//we are besieged defender
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ bool HeroPoolProcessor::hireHero(const ObjectInstanceID & objectID, const HeroTy
|
|||||||
if (gameHandler->getHeroCount(player, false) >= gameHandler->getSettings().getInteger(EGameSettings::HEROES_PER_PLAYER_ON_MAP_CAP) && gameHandler->complain("Cannot hire hero, too many wandering heroes already!"))
|
if (gameHandler->getHeroCount(player, false) >= gameHandler->getSettings().getInteger(EGameSettings::HEROES_PER_PLAYER_ON_MAP_CAP) && gameHandler->complain("Cannot hire hero, too many wandering heroes already!"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (gameHandler->getHeroCount(player, true) >= gameHandler->getSettings().getInteger(EGameSettings::HEROES_PER_PLAYER_TOTAL_CAP) && gameHandler->complain("Cannot hire hero, too many heroes garrizoned and wandering already!"))
|
if (gameHandler->getHeroCount(player, true) >= gameHandler->getSettings().getInteger(EGameSettings::HEROES_PER_PLAYER_TOTAL_CAP) && gameHandler->complain("Cannot hire hero, too many heroes garrisoned and wandering heroes present!"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (nextHero != HeroTypeID::NONE) // player attempts to invite next hero
|
if (nextHero != HeroTypeID::NONE) // player attempts to invite next hero
|
||||||
|
|||||||
Reference in New Issue
Block a user