{ GLOBAL = { ENTER = ("setStateTo: IDLE"); }; "DEFENSE_MODE" = { ATTACKED = (setTargetToPrimaryAggressor, increaseAlertLevel); "RED_ALERT" = (launchDefenseShip); "YELLOW_ALERT" = ("setStateTo: IDLE"); "CONDITION_YELLOW" = ("setStateTo: IDLE"); "CONDITION_GREEN" = ("setStateTo: CHECK_FOR_DEBRIS"); "INCOMING_MISSILE" = (increaseAlertLevel); "ENERGY_FULL" = ("pauseAI: 20.0", "setStateTo: IDLE"); "TARGET_DESTROYED" = ("pauseAI: 20.0", "setStateTo: IDLE"); "TARGET_LOST" = ("pauseAI: 20.0", "setStateTo: IDLE"); "NO_TARGET" = ("pauseAI: 20.0", "setStateTo: IDLE"); }; "CHECK_FOR_DEBRIS" = { "TARGET_FOUND" = (launchScavenger, "setStateTo: IDLE"); "NOTHING_FOUND" = ("setStateTo: CHECK_FOR_ROCKS", "pauseAI: 20.0"); ATTACKED = (setTargetToPrimaryAggressor, increaseAlertLevel, "setStateTo: DEFENSE_MODE"); "INCOMING_MISSILE" = (fireECM, increaseAlertLevel); UPDATE = (scanForLoot, "pauseAI: 20.0"); }; "CHECK_FOR_ROCKS" = { "TARGET_FOUND" = (launchMiner, "setStateTo: IDLE"); "NOTHING_FOUND" = ("setStateTo: IDLE", "pauseAI: 20.0"); ATTACKED = (setTargetToPrimaryAggressor, increaseAlertLevel, "setStateTo: DEFENSE_MODE"); "INCOMING_MISSILE" = (fireECM, increaseAlertLevel); UPDATE = (scanForRocks, "pauseAI: 20.0"); }; IDLE = { ATTACKED = (setTargetToPrimaryAggressor, increaseAlertLevel, "setStateTo: DEFENSE_MODE"); "INCOMING_MISSILE" = (increaseAlertLevel); UPDATE = (decreaseAlertLevel, "setStateTo: CHECK_FOR_DEBRIS"); }; }