Skip to content

Commit

Permalink
Update UnitScrollerModel.java
Browse files Browse the repository at this point in the history
This update improves the Active Unit Scroller ability to locate units that are capable to move.
  • Loading branch information
WCSumpton committed Sep 17, 2024
1 parent c2aba1e commit 0b2e13d
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,18 @@ static List<Unit> getMoveableUnits(

final Predicate<Unit> moveableUnitOwnedByMe =
PredicateBuilder.of(Matches.unitIsOwnedBy(player))
.and(Matches.unitHasMovementLeft())
.and((Matches.unitHasMovementLeft())
// add transported units that have not landed
.or(Matches.unitIsBeingTransported()
.and(Matches.unitWasUnloadedThisTurn().negate()))
// including units that cannot move, that have not moved
// that can be transported or that can receive movement bonus
.or(Matches.unitCanMove().negate()
.and(Matches.unitHasMoved().negate())
.and((Matches.unitCanBeTransported()
.or(Matches.unitIsAirTransportable()
.or(Matches.unitIsLandTransportable()
.or(Matches.unitCanBeGivenBonusMovementByFacilitiesInItsTerritory(t, player))))))))
// if not non combat, cannot move aa units
.andIf(
movePhase == UnitScroller.MovePhase.COMBAT, Matches.unitCanMoveDuringCombatMove())
Expand Down

0 comments on commit 0b2e13d

Please sign in to comment.