oolite/Resources/AIs/sunSkimExitAI.plist
Eric Walch 86bc4b2c36 - Added RESTARTED messages to some of the AIs that use the new fleeQMineAI to prevent leaving the ships idle.
- also added the q-mine warning inside becomeEnergyBlast so that custom q-mines also give a warning, albeit later.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4903 127b21dd-08f5-0310-b4b7-95ae10353056
2012-05-03 20:34:19 +00:00

114 lines
4.3 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"
);
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
"TARGET_DESTROYED" = ("setStateTo: CONSIDER_RESUMING");
"TARGET_LOST" = ("setStateTo: CONSIDER_RESUMING");
RESTARTED = (performIdle, "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);
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
"REACHED_SAFETY" = (performIdle, "setStateTo: CONSIDER_RESUMING");
"TARGET_DESTROYED" = (performIdle, "setStateTo: CONSIDER_RESUMING");
"TARGET_LOST" = (performIdle, "setStateTo: CONSIDER_RESUMING");
RESTARTED = (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");
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
"WAYPOINT_SET" = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
RESTARTED = ("setStateTo: HEAD_FOR_SUN");
};
"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");
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT1");
RESTARTED = ("setStateTo: HEAD_FOR_SUN");
};
"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");
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
RESTARTED = ("setStateTo: HEAD_FOR_SUN");
};
"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");
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
RESTARTED = ("setStateTo: HEAD_FOR_SUN");
};
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");
};
}