-
-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add description about 50% retaliation damage to the Blind spell (#9482)
- Loading branch information
Showing
2 changed files
with
18 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*************************************************************************** | ||
* fheroes2: https://github.com/ihhub/fheroes2 * | ||
* Copyright (C) 2019 - 2024 * | ||
* Copyright (C) 2019 - 2025 * | ||
* * | ||
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 * | ||
* Copyright (C) 2010 by Andrey Afletdinov <[email protected]> * | ||
|
@@ -516,8 +516,15 @@ uint32_t Battle::Unit::EstimateRetaliatoryDamage( const uint32_t damageTaken ) c | |
|
||
const uint32_t retaliatoryDamage = unitsLeft * damagePerUnit; | ||
|
||
// The retaliatory damage of a blinded unit is halved | ||
return ( Modes( SP_BLIND ) ? retaliatoryDamage / 2 : retaliatoryDamage ); | ||
if ( !Modes( SP_BLIND ) ) { | ||
return retaliatoryDamage; | ||
} | ||
|
||
// The retaliatory damage of a blinded unit is reduced | ||
const uint32_t reductionPercent = Spell( Spell::BLIND ).ExtraValue(); | ||
assert( reductionPercent <= 100 ); | ||
|
||
return retaliatoryDamage * ( 100 - reductionPercent ) / 100; | ||
} | ||
|
||
uint32_t Battle::Unit::CalculateMinDamage( const Unit & enemy ) const | ||
|
@@ -560,12 +567,15 @@ uint32_t Battle::Unit::CalculateDamageUnit( const Unit & enemy, double dmg ) con | |
} | ||
} | ||
|
||
// The retaliatory damage of a blinded unit is halved | ||
// The retaliatory damage of a blinded unit is reduced | ||
if ( _blindRetaliation ) { | ||
// Petrified units cannot attack, respectively, there should be no retaliation | ||
assert( !enemy.Modes( SP_STONE ) ); | ||
|
||
dmg /= 2; | ||
const uint32_t reductionPercent = Spell( Spell::BLIND ).ExtraValue(); | ||
assert( reductionPercent <= 100 ); | ||
|
||
dmg = dmg * ( 100 - reductionPercent ) / 100; | ||
} | ||
|
||
// A petrified unit takes only half of the damage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*************************************************************************** | ||
* fheroes2: https://github.com/ihhub/fheroes2 * | ||
* Copyright (C) 2019 - 2024 * | ||
* Copyright (C) 2019 - 2025 * | ||
* * | ||
* Free Heroes2 Engine: http://sourceforge.net/projects/fheroes2 * | ||
* Copyright (C) 2009 by Andrey Afletdinov <[email protected]> * | ||
|
@@ -73,7 +73,8 @@ namespace | |
{ gettext_noop( "Mass Haste" ), 10, 0, 0, 61, 2, gettext_noop( "Increases the speed of all of your creatures by %{count}." ) }, | ||
{ gettext_noop( "spell|Slow" ), 3, 0, 0, 1, 0, gettext_noop( "Slows target to half movement rate." ) }, | ||
{ gettext_noop( "Mass Slow" ), 15, 0, 0, 62, 0, gettext_noop( "Slows all enemies to half movement rate." ) }, | ||
{ gettext_noop( "spell|Blind" ), 6, 0, 0, 21, 0, gettext_noop( "Clouds the affected creatures' eyes, preventing them from moving." ) }, | ||
{ gettext_noop( "spell|Blind" ), 6, 0, 0, 21, 50, | ||
gettext_noop( "Clouds the affected creatures' eyes, preventing them from moving and reduces the damage when retaliating by %{count} percent." ) }, | ||
{ gettext_noop( "Bless" ), 3, 0, 0, 7, 0, gettext_noop( "Causes the selected creatures to inflict maximum damage." ) }, | ||
{ gettext_noop( "Mass Bless" ), 12, 0, 0, 63, 0, gettext_noop( "Causes all of your units to inflict maximum damage." ) }, | ||
{ gettext_noop( "Stoneskin" ), 3, 0, 0, 31, 3, gettext_noop( "Magically increases the defense skill of the selected creatures." ) }, | ||
|