Thats what is puzzeling me. Although I haven't added any friendly fire code to the Mark's AI (so it will return fire on an escort that hits it by mistake), I had (I thought) added it to the escorts's AI, so escorts shouldn't fire on the mark they are escorting as they have no reaction to ATTACKED =, even though the Mark could fire on an escort that hit it by mistake. This is the AI the escorts should be using :-
I'd deliberatley missed out any response to "ATTACKED =", so the escorts should only react to a script message of "ENEMY_ATTACK =". Odd. I suspect that they can still be switched into one of the random hits AIs that doesn't yet have friendly fire code implemented.
If they lose their mother, then they should switch to this patrol AI, but this AI does not respond to a normal "ATTACKED =" either.
Code: Select all
{
GLOBAL = {
ENTER = ("setSpeedFactorTo: 0.75", "setStateTo: HEAD_FOR_PLANET");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
UPDATE = ();
EXIT = ();
};
"ATTACK_SHIP" = {
ENTER = (performIdle, performAttack);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToPrimaryAggressor);
"ENERGY_LOW" = (performIdle, performAttack);
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile);
"TARGET_DESTROYED" = ("setStateTo: DECIDE_PATROL");
"TARGET_LOST" = ("setStateTo: DECIDE_PATROL");
"NO_TARGET" = ("setStateTo: DECIDE_PATROL");
"FRUSTRATED" = (performIdle, performAttack);
UPDATE = ();
EXIT = (); };
"ATTACK_SELECTED_TARGET" = {
ENTER = (performIdle, performAttack);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToPrimaryAggressor);
"ENERGY_LOW" = (performIdle, performAttack);
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile);
"TARGET_DESTROYED" = ("switchAITo: randomhitsmarkrevenge2AI.plist");
"TARGET_LOST" = ("switchAITo: randomhitsmarkrevenge2AI.plist");
"NO_TARGET" = ("setStateTo: DECIDE_PATROL");
"FRUSTRATED" = (performIdle, performAttack);
UPDATE = ();
EXIT = (); };
"FRIENDLY_FIRE_INCIDENT" = {
ENTER = (setTargetToSystemStation, performIdle, "setStateTo: DECIDE_PATROL");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);
UPDATE = ("setStateTo: DECIDE_PATROL");
EXIT = ("setStateTo: DECIDE_PATROL"); };
"DECIDE_PATROL" = {
ENTER = ("rollD: 2");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"ROLL_1" = (performIdle, "setStateTo: HEAD_FOR_PLANET");
"ROLL_2" = (performIdle, "setStateTo: HEAD_FOR_WITCHPOINT");
UPDATE = ();
EXIT = ();
};
"HEAD_FOR_PLANET" = {
ENTER = ("setSpeedFactorTo: 0.75", setCourseToPlanet, "setDesiredRangeTo: 115000.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = (performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT_PLANET");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: ARRIVED_AT_PLANET");
"AEGIS_CLOSE_TO_PLANET" = ("setStateTo: ARRIVED_AT_PLANET");
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_PLANET");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (setCourseToPlanet, "setDesiredRangeTo: 115000.0", checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
};
"GO_TO_WAYPOINT_PLANET" = {
ENTER = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = ("setSpeedFactorTo: 0.75", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_PLANET");
"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_PLANET");
"AEGIS_CLOSE_TO_PLANET" = ("setStateTo: ARRIVED_AT_PLANET");
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_PLANET");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
};
"NEW_WAYPOINT_PLANET" =
{
ENTER = ("setSpeedFactorTo: 0.1", "setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_PLANET");
"COURSE_OK" = ("setStateTo: GO_TO_WAYPOINT_PLANET");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_PLANET");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"AEGIS_CLOSE_TO_PLANET" = ("setStateTo: ARRIVED_AT_PLANET");
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_PLANET");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
};
"ARRIVED_AT_PLANET" = {
ENTER = (setTargetToSystemStation, performIdle, "rollD: 2");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"ROLL_1" = (performIdle, "setStateTo: FACE_STATION");
"ROLL_2" = (performIdle, "setStateTo: HEAD_FOR_WITCHPOINT");
UPDATE = ();
EXIT = ();
};
"FACE_STATION" = {
ENTER = ("setSpeedFactorTo: 0.1", setTargetToSystemStation, performIdle, "setDesiredRangeTo: 5000.0", setDestinationToTarget, performFaceDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FACING_DESTINATION" = ("setSpeedFactorTo: 0.5", "setStateTo: HEAD_FOR_STATION");
UPDATE = ("pauseAI: 3.0", "setSpeedFactorTo: 0.5", "setStateTo: HEAD_FOR_STATION");
EXIT = ();
};
"HEAD_FOR_STATION" = {
ENTER = ("setSpeedFactorTo: 0.75", setTargetToSystemStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = (performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT_STATION");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: ARRIVED_AT_STATION");
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_STATION");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
"NOTHING_FOUND" = ("setStateTo: RANGE_CHECK_STATION");
UPDATE = (setTargetToSystemStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination, checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
};
"GO_TO_WAYPOINT_STATION" = {
ENTER = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = ("setSpeedFactorTo: 0.75", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_STATION");
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_STATION");
"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_STATION");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
};
"NEW_WAYPOINT_STATION" =
{
ENTER = ("setSpeedFactorTo: 0.1", "setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_STATION");
"COURSE_OK" = ("setStateTo: GO_TO_WAYPOINT_STATION");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_STATION");
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_STATION");
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
};
"RANGE_CHECK_STATION" = {
ENTER = ("setSpeedFactorTo: 0.75", setTargetToSystemStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination, "pauseAI: 2.0");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = (performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT_STATION");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: ARRIVED_AT_STATION");
"APPROACHING_SURFACE" = (landOnPlanet);
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_STATION");
UPDATE = (setTargetToSystemStation, "setDesiredRangeTo: 5000.0", setDestinationToTarget, checkCourseToDestination, "setStateTo: STATION_CHECK");
EXIT = ();
};
"STATION_CHECK" = {
"ENTER" = (setTargetToSystemStation, performIdle, "scanForNearestShipHavingAnyRole: station coriolis oolite-coriolis-station dodo dodec dodecahedron oolite-dodecahedron-station ico icosa icosahedron oolite-icosahedron-station");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"AEGIS_IN_DOCKING_RANGE" = ("setStateTo: ARRIVED_AT_STATION");
"APPROACHING_SURFACE" = (landOnPlanet);
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"EXIT" = ();
"NOTHING_FOUND" = (setTargetToSystemStation, performIdle, "setStateTo: HEAD_FOR_STATION");
"TARGET_FOUND" = ("setStateTo: ARRIVED_AT_STATION");
"UPDATE" = ("scanForNearestShipHavingAnyRole: station coriolis oolite-coriolis-station dodo dodec dodecahedron oolite-dodecahedron-station ico icosa icosahedron oolite-icosahedron-station");
};
"ARRIVED_AT_STATION" = {
ENTER = (setTargetToSystemStation, performIdle, "setStateTo: HEAD_FOR_WITCHPOINT");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
UPDATE = ();
EXIT = ();
};
"HEAD_FOR_WITCHPOINT" = {
ENTER = ("setSpeedFactorTo: 0.75", setCourseToWitchpoint, checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = (performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT_WITCHPOINT");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: ARRIVED_AT_WITCHPOINT");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
"NOTHING_FOUND" = ("setStateTo: RANGE_CHECK_WITCHPOINT");
UPDATE = (setCourseToWitchpoint, checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
};
"GO_TO_WAYPOINT_WITCHPOINT" = {
ENTER = ("setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = ("setSpeedFactorTo: 0.75", performFlyToRangeFromDestination);
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_WITCHPOINT");
"APPROACHING_SURFACE" = (landOnPlanet);
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
};
"NEW_WAYPOINT_WITCHPOINT" =
{
ENTER = ("setSpeedFactorTo: 0.1", "setDesiredRangeTo: 50.0", checkCourseToDestination);
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"WAYPOINT_SET" = ("setStateTo: NEW_WAYPOINT_WITCHPOINT");
"COURSE_OK" = ("setStateTo: GO_TO_WAYPOINT_WITCHPOINT");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"TARGET_FOUND" = (setTargetToFoundTarget, "setStateTo: ATTACK_SELECTED_TARGET");
UPDATE = (checkCourseToDestination, "scanForNearestShipWithPrimaryRole: player", "pauseAI: 1.0");
EXIT = ();
};
"RANGE_CHECK_WITCHPOINT" = {
"ENTER" = (setTargetToSystemStation, performIdle, "scanForNearestShipHavingAnyRole: buoy-witchpoint oolite-buoy-witchpoint repaired-buoy-witchpoint");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"EXIT" = ();
"NOTHING_FOUND" = (setTargetToSystemStation, performIdle, "setStateTo: COURSE_CHECK_WITCHPOINT");
"TARGET_FOUND" = ("setStateTo: ARRIVED_AT_WITCHPOINT");
"UPDATE" = ("scanForNearestShipHavingAnyRole: buoy-witchpoint oolite-buoy-witchpoint repaired-buoy-witchpoint"); };
"COURSE_CHECK_WITCHPOINT" = {
ENTER = ("setSpeedFactorTo: 0.75", setCourseToWitchpoint, checkCourseToDestination, "pauseAI: 2.0");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"COURSE_OK" = (performFlyToRangeFromDestination);
"WAYPOINT_SET" = ("setStateTo: GO_TO_WAYPOINT_WITCHPOINT");
"DESIRED_RANGE_ACHIEVED" = ("setStateTo: ARRIVED_AT_WITCHPOINT");
"APPROACHING_SURFACE" = (landOnPlanet);
UPDATE = (setCourseToWitchpoint, checkCourseToDestination, "setStateTo: HEAD_FOR_WITCHPOINT");
EXIT = ();
};
"ARRIVED_AT_WITCHPOINT" = {
ENTER = (setTargetToSystemStation, performIdle, "setStateTo: HEAD_FOR_PLANET");
"SPACEBAR_ATTACK" = ("setStateTo: DEAL_WITH_TURRET_ATTACK");
"APPROACHING_SURFACE" = (landOnPlanet);
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
UPDATE = ();
EXIT = ();
};
"DEAL_WITH_TURRET_ATTACK" = {
ENTER = ("rollD: 2");
"APPROACHING_SURFACE" = (landOnPlanet);
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"ROLL_1" = ("setStateTo: ATTACK_SPACEBAR");
"ROLL_2" = ("setAITo: randomhitsbreakoff3AI.plist");
"ROLL_3" = ("setAITo: randomhitsbreakoff3AI.plist");
UPDATE = ("setStateTo: DECIDE_PATROL");
EXIT = ("setStateTo: DECIDE_PATROL");
};
"ATTACK_SPACEBAR" = {
ENTER = (performIdle, performAttack);
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"ENERGY_LOW" = ("setStateTo: CRIMINAL_HURT");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"TARGET_DESTROYED" = ("setStateTo: DECIDE_PATROL");
"TARGET_LOST" = ("setStateTo: DECIDE_PATROL");
"FRUSTRATED" = (performIdle, performAttack);
UPDATE = ();
EXIT = (); };
"CRIMINAL_HURT" = {
ENTER = ("rollD: 2");
"APPROACHING_SURFACE" = (landOnPlanet);
"FRIENDLY_FIRE" = ("setStateTo: FRIENDLY_FIRE_INCIDENT");
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"ROLL_1" = ("setStateTo: FLEE_BAR");
"ROLL_2" = ("setStateTo: FIGHT_BAR");
UPDATE = ("setStateTo: DECIDE_PATROL");
EXIT = ("setStateTo: DECIDE_PATROL");
};
"FLEE_BAR" = {
ENTER = ("addFuel: 3", "setSpeedFactorTo: 2.0", "setDesiredRangeTo: 5500", performFlee);
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"TARGET_LOST" = (performIdle, "addFuel: -3", setTargetToSystemStation, "setStateTo: DECIDE_PATROL");
"TARGET_DESTROYED" = (performIdle, "addFuel: -3", setTargetToSystemStation, "setStateTo: DECIDE_PATROL");
"NO_TARGET" = (performIdle, "addFuel: -3", setTargetToSystemStation, "setStateTo: DECIDE_PATROL");
EXIT = ();
"REACHED_SAFETY" = (performIdle, "addFuel: -3", setTargetToSystemStation, "setStateTo: DECIDE_PATROL");
"DESIRED_RANGE_ACHIEVED" = (performIdle, "addFuel: -3", setTargetToSystemStation, "setStateTo: DECIDE_PATROL");
UPDATE = (); };
"FIGHT_BAR" = {
ENTER = (performIdle, performAttack);
"APPROACHING_SURFACE" = (landOnPlanet);
"ENEMY_ATTACK" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP");
"INCOMING_MISSILE" = (setTargetToFoundTarget, fightOrFleeMissile, "setStateTo: ATTACK_SHIP");
"TARGET_DESTROYED" = ("setStateTo: DECIDE_PATROL");
"TARGET_LOST" = ("setStateTo: DECIDE_PATROL");
"NO_TARGET" = ("setStateTo: DECIDE_PATROL");
"FRUSTRATED" = (performIdle, performAttack);
UPDATE = ();
EXIT = (); };
}