Code: Select all
{
"asteroid_storm" = (
{
conditions = ("mission_asteroids equal asteroids_FINISHED");
do = ();
else = (
{
conditions = ("dockedAtMainStation_bool equal YES");
do = (
{
conditions = (
"gui_screen_string oneof GUI_SCREEN_STATUS, GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_SHORT_RANGE_CHART",
"mission_asteroids undefined",
"galaxy_number equal 0",
"planet_number equal 55",
"score_number greaterthan 63"
);
do = (
"setMissionImage: GalCop.png",
setGuiToMissionScreen,
"setMissionMusic: warning.ogg",
"addMissionText: asteroidsbrief_1",
"set: mission_asteroids asteroids_BRIEFED",
"set: mission_asteroids_statdead 0",
"set: mission_asteroids_rockdead 0",
"set: mission_asteroids_toldoff 0",
"set: mission_asteroids_final 0"
);
},
{
conditions = (
"mission_asteroids equal asteroids_RUNNING",
"mission_asteroids_toldoff equal 0",
"gui_screen_string oneof GUI_SCREEN_STATUS, GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_SHORT_RANGE_CHART",
"galaxy_number equal 0",
"planet_number equal 55"
);
do = (
"setMissionImage: GalCop.png",
setGuiToMissionScreen,
"setMissionMusic: warning.ogg",
"addMissionText: asteroidsbrief_2",
"set: mission_asteroids_toldoff 1"
);
},
{
conditions = (
"mission_asteroids equal asteroids_COWARD",
"mission_asteroids_final equal 0",
"gui_screen_string oneof GUI_SCREEN_STATUS, GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_SHORT_RANGE_CHART"
);
do = (
"setMissionImage: GalCop.png",
setGuiToMissionScreen,
"addMissionText: asteroidsbrief_3",
"awardCredits: -200",
"setLegalStatus: 25",
"set: mission_asteroids asteroids_FINISHED",
"set: mission_asteroids_final 1"
);
},
{
conditions = (
"mission_asteroids equal asteroids_OVER",
"mission_asteroids_statdead equal 1",
"mission_asteroids_final equal 0",
"gui_screen_string oneof GUI_SCREEN_STATUS, GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_SHORT_RANGE_CHART"
);
do = (
"setMissionImage: GalCop.png",
setGuiToMissionScreen,
"addMissionText: asteroidsbrief_4",
"awardCredits: 200",
"set: mission_asteroids asteroids_FINISHED"
);
},
{
conditions = (
"mission_asteroids equal asteroids_OVER",
"mission_asteroids_statdead equal 0",
"mission_asteroids_rockdead equal 1",
"mission_asteroids_final equal 0",
"gui_screen_string oneof GUI_SCREEN_STATUS, GUI_SCREEN_EQUIP_SHIP, GUI_SCREEN_SHORT_RANGE_CHART"
);
do = (
"setMissionImage: GalCop.png",
setGuiToMissionScreen,
"addMissionText: asteroidsbrief_5",
"awardCredits: 1000",
"setLegalStatus: 0",
"awardEquipment: EQ_ENERGY_BOMB",
"set: mission_asteroids asteroids_FINISHED",
"set: mission_asteroids_final 1"
);
}
);
},
{
conditions = ("status_string equal STATUS_LAUNCHING");
do = (
{
conditions = (
"mission_asteroids equal asteroids_BRIEFED"
);
do = (
"removeEquipment: EQ_ENERGY_BOMB",
"addSystemShips: ast1 27 1.0",
"addSystemShips: badrock 1 1.0",
"set: mission_asteroids asteroids_RUNNING",
"set: mission_asteroids_toldoff 0"
);
},
{
conditions = (
"galaxy_number equal 0",
"planet_number equal 55"
);
do = ("addSystemShips: ast1 3 1.0");
},
{
conditions = (
"mission_asteroids equal asteroids_RUNNING"
);
do = ("set: mission_asteroids_toldoff 0", "removeEquipment: EQ_ENERGY_BOMB");
}
);
},
{
conditions = ("status_string equal STATUS_EXITING_WITCHSPACE");
do = (
{
conditions = (
"galaxy_number equal 0",
"planet_number equal 55"
);
do = (
"addSystemShips: ast1 3 1.0",
"addSystemShips: ast1 2 0.0",
"addSystemShips: asteroid 6 0.0",
"addSystemShips: asteroid 4 0.6"
);
},
{
conditions = (
"mission_asteroids equal asteroids_RUNNING"
);
do = (
"set: mission_asteroids asteroids_COWARD",
"set: mission_asteroids_statdead 1",
"setSpecificPlanetInfo: 0=55=station=none",
"setSpecificPlanetInfo: 0=55=description=The planet Leesti is reasonably fabled for Zero-G cricket and Leestiian evil juice, but cursed by deadly asteroid storms. Leesti's orbital station was recently destroyed by a large asteroid strike. Ships without planet landing capabilities are therefore advised to avoid this system."
);
},
{
conditions = (
"mission_asteroids_statdead equal 1",
"galaxy_number equal 0",
"planet_number equal 55"
);
do = (
"setSpecificPlanetInfo: 0=55=station=none",
"set: mission_asteroids asteroids_FINISHED"
);
}
);
}
);
}
);
}
This way all the code is skipped after mission completion. But although it just needs not to evaluate anything, after completion, it still has to read in the structure every update to see there is nothing to be done. But written in the above way the code will use only a few percent of the time after mission completion as it is using now.
With javascript the code can delete itself from execution. That would still be the best.