mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Merge branch 'kuririn' into NewAbilities
This commit is contained in:
@@ -437,4 +437,10 @@
|
|||||||
"name": "Water immunity",
|
"name": "Water immunity",
|
||||||
"description": "Immune to all Water school spells"
|
"description": "Immune to all Water school spells"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"WIDE_BREATH":
|
||||||
|
{
|
||||||
|
"name": "Szerokie Zionięcie",
|
||||||
|
"description": "Stożek ognia obejmuje znacznie większy obszar"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ private:
|
|||||||
BONUS_NAME(CATAPULT_EXTRA_SHOTS) /*val - number of additional shots, requires CATAPULT bonus to work*/\
|
BONUS_NAME(CATAPULT_EXTRA_SHOTS) /*val - number of additional shots, requires CATAPULT bonus to work*/\
|
||||||
BONUS_NAME(RANGED_RETALIATION) /*allows shooters to perform ranged retaliation*/\
|
BONUS_NAME(RANGED_RETALIATION) /*allows shooters to perform ranged retaliation*/\
|
||||||
BONUS_NAME(BLOCKS_RANGED_RETALIATION) /*disallows ranged retaliation for shooter unit, BLOCKS_RETALIATION bonus is for melee retaliation only*/\
|
BONUS_NAME(BLOCKS_RANGED_RETALIATION) /*disallows ranged retaliation for shooter unit, BLOCKS_RETALIATION bonus is for melee retaliation only*/\
|
||||||
|
BONUS_NAME(WIDE_BREATH) /* Kuririn skill */\
|
||||||
/* end of list */
|
/* end of list */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1157,7 +1157,148 @@ AttackableTiles CBattleInfoCallback::getPotentiallyAttackableHexes (const CStack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (attacker->hasBonusOfType(Bonus::TWO_HEX_ATTACK_BREATH) && BattleHex::mutualPosition (destinationTile.hex, hex) > -1) //only adjacent hexes are subject of dragon breath calculation
|
if (attacker->hasBonusOfType(Bonus::WIDE_BREATH))
|
||||||
|
{
|
||||||
|
std::vector<BattleHex> hexes;
|
||||||
|
const int WN = GameConstants::BFIELD_WIDTH;
|
||||||
|
logGlobal->infoStream() << hex;
|
||||||
|
logGlobal->infoStream() << destinationTile;
|
||||||
|
|
||||||
|
// atack stand
|
||||||
|
if (hex == destinationTile.movedInDir(BattleHex::EDir::LEFT, false)) {
|
||||||
|
if (destinationTile.getY() % 2 == 0)
|
||||||
|
{
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + (2 * WN) - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + (2 * WN), hexes);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + (2 * WN) - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + (2 * WN), hexes);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (hex == destinationTile.movedInDir(BattleHex::EDir::RIGHT, false)) {
|
||||||
|
if (destinationTile.getY() % 2 == 0)
|
||||||
|
{
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + (2 * WN), hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + (2 * WN) + 1, hexes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + (2 * WN), hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + (2 * WN) + 1, hexes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// atack down
|
||||||
|
if (hex == destinationTile.movedInDir(BattleHex::EDir::TOP_LEFT, false)) {
|
||||||
|
if (destinationTile.getY() % 2 == 1)
|
||||||
|
{
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - 2, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN - 2, hexes);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - 2, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN - 1, hexes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hex == destinationTile.movedInDir(BattleHex::EDir::TOP_RIGHT, false)) {
|
||||||
|
|
||||||
|
if (destinationTile.getY() % 2 == 1)
|
||||||
|
{
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + 2, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN + 1, hexes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + 2, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN + 2, hexes);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// attack up
|
||||||
|
if (hex == destinationTile.movedInDir(BattleHex::EDir::BOTTOM_LEFT, false)) {
|
||||||
|
if (destinationTile.getY() % 2 == 1)
|
||||||
|
{
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - WN - 1, hexes);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN + 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN + 2, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - WN + 1, hexes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hex == destinationTile.movedInDir(BattleHex::EDir::BOTTOM_RIGHT, false)) {
|
||||||
|
|
||||||
|
if (destinationTile.getY() % 2 == 1)
|
||||||
|
{
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN - 2, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - WN - 1, hexes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BattleHex::checkAndPush(destinationTile, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile + WN - 1, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - WN, hexes);
|
||||||
|
BattleHex::checkAndPush(destinationTile - WN + 1, hexes);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (BattleHex tile : hexes)
|
||||||
|
{
|
||||||
|
//friendly stacks can also be damaged by Dragon Breath
|
||||||
|
if (battleGetStackByPos(tile, true))
|
||||||
|
at.friendlyCreaturePositions.insert(tile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (attacker->hasBonusOfType(Bonus::TWO_HEX_ATTACK_BREATH) && BattleHex::mutualPosition(destinationTile.hex, hex) > -1) //only adjacent hexes are subject of dragon breath calculation
|
||||||
{
|
{
|
||||||
std::vector<BattleHex> hexes; //only one, in fact
|
std::vector<BattleHex> hexes; //only one, in fact
|
||||||
int pseudoVector = destinationTile.hex - hex;
|
int pseudoVector = destinationTile.hex - hex;
|
||||||
@@ -1165,24 +1306,24 @@ AttackableTiles CBattleInfoCallback::getPotentiallyAttackableHexes (const CStack
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
case -1:
|
case -1:
|
||||||
BattleHex::checkAndPush (destinationTile.hex + pseudoVector, hexes);
|
BattleHex::checkAndPush(destinationTile.hex + pseudoVector, hexes);
|
||||||
break;
|
break;
|
||||||
case WN: //17 //left-down or right-down
|
case WN: //17 //left-down or right-down
|
||||||
case -WN: //-17 //left-up or right-up
|
case -WN: //-17 //left-up or right-up
|
||||||
case WN + 1: //18 //right-down
|
case WN + 1: //18 //right-down
|
||||||
case -WN + 1: //-16 //right-up
|
case -WN + 1: //-16 //right-up
|
||||||
BattleHex::checkAndPush (destinationTile.hex + pseudoVector + (((hex/WN)%2) ? 1 : -1), hexes);
|
BattleHex::checkAndPush(destinationTile.hex + pseudoVector + (((hex / WN) % 2) ? 1 : -1), hexes);
|
||||||
break;
|
break;
|
||||||
case WN-1: //16 //left-down
|
case WN - 1: //16 //left-down
|
||||||
case -WN-1: //-18 //left-up
|
case -WN - 1: //-18 //left-up
|
||||||
BattleHex::checkAndPush (destinationTile.hex + pseudoVector + (((hex/WN)%2) ? 1 : 0), hexes);
|
BattleHex::checkAndPush(destinationTile.hex + pseudoVector + (((hex / WN) % 2) ? 1 : 0), hexes);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (BattleHex tile : hexes)
|
for (BattleHex tile : hexes)
|
||||||
{
|
{
|
||||||
//friendly stacks can also be damaged by Dragon Breath
|
//friendly stacks can also be damaged by Dragon Breath
|
||||||
if (battleGetStackByPos (tile, true))
|
if (battleGetStackByPos(tile, true))
|
||||||
at.friendlyCreaturePositions.insert (tile);
|
at.friendlyCreaturePositions.insert(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user