oolite/Resources/AIs/sunSkimExitAI.plist

102 lines
3.7 KiB
Plaintext

{
GLOBAL =
{
ENTER = ("setStateTo: HEAD_FOR_SUN");
};
"ATTACK_SHIP" =
{
ENTER = (performAttack);
"ENERGY_LOW" = ("setSpeedFactorTo: 1.0", "pauseAI: 15.0", "setStateTo: EXIT_SYSTEM");
"INCOMING_MISSILE" = (
fightOrFleeMissile,
"setSpeedFactorTo: 1.0",
"pauseAI: 15.0",
"setStateTo: EXIT_SYSTEM"
);
"TARGET_DESTROYED" = ("setStateTo: CONSIDER_RESUMING");
"TARGET_LOST" = ("setStateTo: CONSIDER_RESUMING");
};
"EXIT_SYSTEM" =
{
"WITCHSPACE OKAY" = (wormholeEscorts);
"WITCHSPACE BLOCKED" = (setTargetToFoundTarget, setDestinationWithinTarget, "setDesiredRangeTo: 10000.0", performFlyToRangeFromDestination);
"WITCHSPACE UNAVAILABLE" = ("setAITo: route1traderAI.plist");
UPDATE = (performHyperSpaceExit);
};
FLEE =
{
ENTER = ("setDesiredRangeTo: 25600", performFlee);
ATTACKED = (fightOrFleeHostiles);
FIGHTING = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
FLEEING = (setTargetToPrimaryAggressor, "setStateTo: FLEE");
"INCOMING_MISSILE" = (setTargetToPrimaryAggressor, broadcastDistressMessage, fightOrFleeMissile);
"REACHED_SAFETY" = (performIdle, "setStateTo: CONSIDER_RESUMING");
"TARGET_DESTROYED" = (performIdle, "setStateTo: CONSIDER_RESUMING");
"TARGET_LOST" = (performIdle, "setStateTo: CONSIDER_RESUMING");
};
"GO_TO_WAYPOINT1" =
{
ENTER = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
ATTACKED = (fightOrFleeHostiles);
"COURSE_OK" = ("setSpeedFactorTo: 0.75", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_SUN");
FIGHTING = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
FLEEING = (setTargetToPrimaryAggressor, "setStateTo: FLEE");
"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE");
"WAYPOINT_SET" = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
};
"HEAD_FOR_SUN" =
{
ENTER = ( setSunSkimStartCoordinates, setDestinationFromCoordinates, checkCourseToDestination );
"EXITED WITCHSPACE" = ("setAITo: route1traderAI.plist");
ATTACKED = (fightOrFleeHostiles);
"COURSE_OK" = ( "setDesiredRangeTo: 500.0", "setSpeedFactorTo: 0.75", performFlyToRangeFromDestination );
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: SKIM_SUN");
FIGHTING = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
FLEEING = (setTargetToPrimaryAggressor, "setStateTo: FLEE");
"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE");
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT1");
};
"LEAVE_SUN" =
{
ENTER = (
setSunSkimExitCoordinates,
setDestinationFromCoordinates,
"setDesiredRangeTo: 250.0",
"setSpeedFactorTo: 1.0",
performFlyToRangeFromDestination
);
ATTACKED = (fightOrFleeHostiles);
"DESIRED_RANGE_ACHIEVED" = ("addFuel: 70", "setStateTo: EXIT_SYSTEM");
FIGHTING = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
FLEEING = (setTargetToPrimaryAggressor, "setStateTo: FLEE");
"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE");
};
"SKIM_SUN" =
{
ENTER = (
setSunSkimEndCoordinates,
setDestinationFromCoordinates,
"setDesiredRangeTo: 100.0",
"setSpeedFactorTo: 1.0",
performFlyToRangeFromDestination
);
ATTACKED = (fightOrFleeHostiles);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: LEAVE_SUN");
FIGHTING = (setTargetToPrimaryAggressor, "setStateTo: ATTACK_SHIP");
FLEEING = (setTargetToPrimaryAggressor, "setStateTo: FLEE");
"INCOMING_MISSILE" = (fightOrFleeMissile, "setStateTo: FLEE");
};
CONSIDER_RESUMING =
{
ENTER = (checkEnergy, "pauseAI: 0");
// If energy < 75 %, go back to trying to sun skim.
ENERGY_LOW = ("setStateTo: GLOBAL");
ENERGY_MEDIUM = ("setStateTo: GLOBAL");
// Otherwise, try to leave.
UPDATE = ("pauseAI: 15.0", "setStateTo: EXIT_SYSTEM");
};
}