Package megamek.client.bot.princess
Class MoraleUtil
java.lang.Object
megamek.client.bot.princess.MoraleUtil
Method for handling morale with Princess.
- Since:
- 5/13/14 8:36 AM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddBrokenUnit(int unitId) voidcheckMorale(boolean forcedWithdrawal, int bravery, int selfPreservation, Player player, Game game) Triggers the morale check for all units controlled by the Princess bot player.booleanisUnitBroken(int unitId) Deprecated, for removal: This API element is subject to removal in a future version.protected voidremoveBrokenUnit(int unitId) protected introllDice()
-
Constructor Details
-
MoraleUtil
public MoraleUtil()
-
-
Method Details
-
isUnitBroken
Deprecated, for removal: This API element is subject to removal in a future version.If a unit's morale is broken, this method should return TRUE.- Parameters:
unitId- The ID of theEntitybeing checked (fromEntity.getId()).- Returns:
- TRUE if the unit is broken.
-
checkMorale
public void checkMorale(boolean forcedWithdrawal, int bravery, int selfPreservation, Player player, Game game) Triggers the morale check for all units controlled by the Princess bot player.- Parameters:
forcedWithdrawal- Set TRUE if Forced Withdrawal is in effect.bravery- The index of the bravery setting inBehaviorSettings.selfPreservation- The index of the selfPreservation setting inBehaviorSettings.player- ThePlayerof the Princess bot.game- The currentGame
-
addBrokenUnit
protected void addBrokenUnit(int unitId) - Parameters:
unitId- The ID of theEntityto be added to the broken units list.
-
removeBrokenUnit
protected void removeBrokenUnit(int unitId) - Parameters:
unitId- The ID of theEntityto be removed from the broken units list.
-
rollDice
protected int rollDice()- Returns:
- The result of a 2d6 roll from
Compute.d6(int)
-