oolite/Resources/AIs/route1traderAI.plist
Chris Morris ae84915d19 Some AI changes and related tidying:
1) Make pirates with full holds (and other offenders using route1traderAI) less likely to go to main station, especially not fugitives. (Expansion of changes from r4770)
2) Experimentally ensure always at least one rock hermit in all non-nova systems. If normal generation does not place a hermit, one is added well away from all spacelanes.
3) New "ATTACKER_MISSED" AI event for when a ship tried to shoot a laser at its target but narrowly missed. Many stock AIs modified to treat this as a hostile action.
4) Tidy function/property names in docking code
5) Add checks for cloaking in some AI routines
6) Use weak refs rather than universal ID for targeting, and clean up


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5144 127b21dd-08f5-0310-b4b7-95ae10353056
2012-07-29 20:21:11 +00:00

119 lines
5.8 KiB
Plaintext

{
GLOBAL =
{
ENTER = ("setStateTo: CHECK_STATUS");
};
"CHECK_STATUS" = {
ENTER = (checkOwnLegalStatus, "setDesiredRangeTo: 1000000.0");
"SELF_CLEAN" = ("setStateTo: HEAD_FOR_PLANET");
"SELF_MINOR_OFFENDER" = ("rollD: 2"); // head for main station 50%
"SELF_OFFENDER" = ("rollD: 4"); // head for main station 25%
"SELF_FUGITIVE" = (setTargetToRandomStation);
"SELF_THARGOID" = ("switchAITo: thargoidAI.plist");
"ROLL_1" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_2" = (setTargetToRandomStation);
"ROLL_3" = (setTargetToRandomStation);
"ROLL_4" = (setTargetToRandomStation);
"NO_STATION_IN_RANGE" = ("setStateTo: HEAD_FOR_PLANET");
"STATION_FOUND" = ("setStateTo: GO_TO_RANDOM_STATION");
};
"HEAD_FOR_PLANET" =
{
ENTER = (setCourseToPlanet, "setDesiredRangeTo: 30000.0", "setSpeedFactorTo: 0.35", checkCourseToDestination);
"COURSE_OK" = ("setSpeedFactorTo: 0.65", performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
"AEGIS_CLOSE_TO_MAIN_PLANET" = ("setStateTo: GO_TO_STATION");
"CLOSE_TO_SECONDARY_PLANET" = ("setStateTo: GO_TO_SUB_STATION");
"AEGIS_IN_DOCKING_RANGE" = (dockEscorts, "setStateTo: GO_TO_STATION");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: GO_TO_STATION");
"TARGET_FOUND" = (setTargetToFoundTarget, "setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
"INCOMING_MISSILE" = ("setAITo: traderInterceptAI.plist", "setStateTo: INCOMING_MISSILE", "randomPauseAI: 0.5 2.0");
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
"ATTACKER_MISSED" = ("setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
ATTACKED = ("setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
"ATTACKED_BY_CLOAKED" = ("setAITo: traderInterceptAI.plist", "setStateTo: FLEE_FOR_CLOAKED");
RESTARTED = (checkAegis);
UPDATE =
(
setCourseToPlanet,
"setDesiredRangeTo: 30000.0",
checkCourseToDestination,
scanForHostiles,
"pauseAI: 10.0"
);
};
"GO_TO_STATION" =
{
ENTER = ("dropMessages: WAYPOINT_SET", setTargetToSystemStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination);
"COURSE_OK" = ("setSpeedFactorTo: 0.5", performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
"DESIRED_RANGE_ACHIEVED" = (dockEscorts, setTargetToSystemStation, "setAITo: dockingAI.plist");
"AEGIS_IN_DOCKING_RANGE" = (dockEscorts, setTargetToSystemStation, "setAITo: dockingAI.plist");
"DOCKING_REFUSED" = ("switchAITo: route2sunskimAI.plist");
"NO_STATION_FOUND" = ("switchAITo: exitingTraderAI.plist");
"TARGET_FOUND" = (setTargetToFoundTarget, "setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
"INCOMING_MISSILE" = ("setAITo: traderInterceptAI.plist", "setStateTo: INCOMING_MISSILE", "randomPauseAI: 0.25 1.5");
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
"ATTACKER_MISSED" = ("setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
ATTACKED = ("setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
"ATTACKED_BY_CLOAKED" = ("setAITo: traderInterceptAI.plist", "setStateTo: FLEE_FOR_CLOAKED");
UPDATE =
(
setTargetToSystemStation,
"setDesiredRangeTo: 5000.0",
setDestinationToTarget,
checkCourseToDestination,
scanForHostiles,
"pauseAI: 10.0"
);
};
"GO_TO_SUB_STATION" =
{
ENTER = ("dropMessages: WAYPOINT_SET", setTargetToNearestFriendlyStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination);
"COURSE_OK" = ("setSpeedFactorTo: 0.5", performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
"DESIRED_RANGE_ACHIEVED" = (dockEscorts, setTargetToNearestFriendlyStation, "setAITo: dockingAI.plist");
"AEGIS_IN_DOCKING_RANGE" = (dockEscorts, setTargetToSystemStation, "setAITo: dockingAI.plist");
"DOCKING_REFUSED" = ("switchAITo: route2sunskimAI.plist");
"NO_STATION_FOUND" = ("switchAITo: exitingTraderAI.plist");
"TARGET_FOUND" = (setTargetToFoundTarget, "setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
"INCOMING_MISSILE" = ("setAITo: traderInterceptAI.plist", "setStateTo: INCOMING_MISSILE", "randomPauseAI: 0.25 1.5");
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
"ATTACKER_MISSED" = ("setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
ATTACKED = ("setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
"ATTACKED_BY_CLOAKED" = ("setAITo: traderInterceptAI.plist", "setStateTo: FLEE_FOR_CLOAKED");
UPDATE =
(
setTargetToNearestFriendlyStation,
"setDesiredRangeTo: 5000.0",
setDestinationToTarget,
checkCourseToDestination,
scanForHostiles,
"pauseAI: 10.0"
);
};
"GO_TO_RANDOM_STATION" =
{
ENTER = ("dropMessages: WAYPOINT_SET", "setDesiredRangeTo: 15000.0", setDestinationToTarget, checkCourseToDestination);
"COURSE_OK" = ("setSpeedFactorTo: 0.5", performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setAITo: gotoWaypointAI.plist");
"DESIRED_RANGE_ACHIEVED" = (dockEscorts, setTargetToNearestStation, "setAITo: dockingAI.plist");
"DOCKING_REFUSED" = ("switchAITo: route2sunskimAI.plist");
"NO_STATION_FOUND" = ("switchAITo: exitingTraderAI.plist");
"TARGET_FOUND" = (setTargetToFoundTarget, "setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
"INCOMING_MISSILE" = ("setAITo: traderInterceptAI.plist", "setStateTo: INCOMING_MISSILE", "randomPauseAI: 0.25 1.5");
"CASCADE_WEAPON_DETECTED" = ("setAITo: fleeQMineAI.plist");
"ATTACKER_MISSED" = ("setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
ATTACKED = ("setAITo: traderInterceptAI.plist", fightOrFleeHostiles);
"ATTACKED_BY_CLOAKED" = ("setAITo: traderInterceptAI.plist", "setStateTo: FLEE_FOR_CLOAKED");
UPDATE =
(
setTargetToLastStation,
"setDesiredRangeTo: 15000.0",
setDestinationToTarget,
checkCourseToDestination,
scanForHostiles,
"pauseAI: 10.0"
);
};
}