mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Make any hex shooting possibility configurable
This commit is contained in:
		| @@ -335,6 +335,8 @@ | ||||
| 			"defensePointDamageFactorCap": 0.7, | ||||
| 			// If set to true, double-wide creatures will trigger obstacle effect when moving one tile forward or backwards | ||||
| 			"oneHexTriggersObstacles": false, | ||||
| 			// Allow area shooters with SPELL_LIKE_ATTACK bonus such as liches or magogs to target empty hexes | ||||
| 			"areaShotCanTargetEmptyHex" : false, | ||||
| 			 | ||||
| 			// Positions of units on start of the combat | ||||
| 			// If battle does not defines specific configuration, 'default' configuration will be used | ||||
|   | ||||
| @@ -40,6 +40,7 @@ const std::vector<GameSettings::SettingOption> GameSettings::settingProperties = | ||||
| 		{EGameSettings::BANKS_SHOW_GUARDS_COMPOSITION,          "banks",     "showGuardsComposition"            }, | ||||
| 		{EGameSettings::BONUSES_GLOBAL,                         "bonuses",   "global"                           }, | ||||
| 		{EGameSettings::BONUSES_PER_HERO,                       "bonuses",   "perHero"                          }, | ||||
| 		{EGameSettings::COMBAT_AREA_SHOT_CAN_TARGET_EMPTY_HEX,  "combat",    "areaShotCanTargetEmptyHex"        }, | ||||
| 		{EGameSettings::COMBAT_ATTACK_POINT_DAMAGE_FACTOR,      "combat",    "attackPointDamageFactor"          }, | ||||
| 		{EGameSettings::COMBAT_ATTACK_POINT_DAMAGE_FACTOR_CAP,  "combat",    "attackPointDamageFactorCap"       }, | ||||
| 		{EGameSettings::COMBAT_BAD_LUCK_DICE,                   "combat",    "badLuckDice"                      }, | ||||
|   | ||||
| @@ -18,6 +18,7 @@ enum class EGameSettings | ||||
| 	BANKS_SHOW_GUARDS_COMPOSITION, | ||||
| 	BONUSES_GLOBAL, | ||||
| 	BONUSES_PER_HERO, | ||||
| 	COMBAT_AREA_SHOT_CAN_TARGET_EMPTY_HEX, | ||||
| 	COMBAT_ATTACK_POINT_DAMAGE_FACTOR, | ||||
| 	COMBAT_ATTACK_POINT_DAMAGE_FACTOR_CAP, | ||||
| 	COMBAT_BAD_LUCK_DICE, | ||||
|   | ||||
| @@ -17,6 +17,7 @@ | ||||
| #include "BattleInfo.h" | ||||
| #include "CObstacleInstance.h" | ||||
| #include "DamageCalculator.h" | ||||
| #include "IGameSettings.h" | ||||
| #include "PossiblePlayerBattleAction.h" | ||||
| #include "../entities/building/TownFortifications.h" | ||||
| #include "../spells/ObstacleCasterProxy.h" | ||||
| @@ -729,6 +730,9 @@ bool CBattleInfoCallback::battleCanTargetEmptyHex(const battle::Unit * attacker) | ||||
| { | ||||
| 	RETURN_IF_NOT_BATTLE(false); | ||||
|  | ||||
| 	if(!VLC->engineSettings()->getBoolean(EGameSettings::COMBAT_AREA_SHOT_CAN_TARGET_EMPTY_HEX)) | ||||
| 		return false; | ||||
|  | ||||
| 	if(attacker->hasBonusOfType(BonusType::SPELL_LIKE_ATTACK)) | ||||
| 	{ | ||||
| 		auto bonus = attacker->getBonus(Selector::type()(BonusType::SPELL_LIKE_ATTACK)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user