Skip to content

Commit

Permalink
Merge da6bf3e into 678d851
Browse files Browse the repository at this point in the history
  • Loading branch information
stromblom committed Feb 10, 2019
2 parents 678d851 + da6bf3e commit 4a9057e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Services/Dominion/Actions/InvadeActionService.php
Expand Up @@ -301,6 +301,15 @@ public function invade(Dominion $dominion, Dominion $target, array $units): arra
// >= 75%+ size: reduce -5% self morale
// else < 75% size: reduce morale, linear scale from -5% morale at 75% size to -10% morale at 40% size
// if $invasionSuccessful: reduce target morale by -5%
$dominion->morale -= 5;
if($landRatio < 0.75) {
$additionalMoraleLoss = max(round(((($landRatio - 0.4) * 100) / 7) - 5), -5);
$dominion->morale += $additionalMoraleLoss;
}

if($isInvasionSuccessful) {
$target->morale -= 5;
}

// MISC

Expand Down

0 comments on commit 4a9057e

Please sign in to comment.