/** * @brief Supply mission begins: UFO arrive on earth. * @note Supply mission -- Stage 0 */ static void CP_SupplyMissionCreate (mission_t *mission) { ufoType_t ufoType; mission->stage = STAGE_COME_FROM_ORBIT; /* Maybe base has been destroyed since mission creation ? */ if (!AB_CheckSupplyMissionPossible()) { Com_DPrintf(DEBUG_CLIENT, "No base in game: removing supply mission.\n"); CP_MissionRemove(mission); return; } ufoType = CP_MissionChooseUFO(mission); if (ufoType == UFO_MAX) { Com_DPrintf(DEBUG_CLIENT, "Supply mission can't be spawned without UFO: removing supply mission.\n"); CP_MissionRemove(mission); } else { CP_MissionDisableTimeLimit(mission); mission->ufo = UFO_AddToGeoscape(ufoType, NULL, mission); if (!mission->ufo) { Com_Printf("CP_SupplyMissionCreate: Could not add UFO '%s', remove mission\n", Com_UFOTypeToShortName(ufoType)); CP_MissionRemove(mission); } } }
static void GAME_InitMenuOptions (void) { int i; uiNode_t* ufoOptions = NULL; uiNode_t* aircraftOptions = NULL; for (i = 0; i < UFO_MAX; i++) { const char *shortName = Com_UFOTypeToShortName(i); UI_AddOption(&ufoOptions, shortName, shortName, Com_GetRandomMapAssemblyNameForCraft(shortName)); } for (i = 0; i < UFO_MAX; i++) { const char *shortName = Com_UFOCrashedTypeToShortName(i); UI_AddOption(&ufoOptions, shortName, shortName, Com_GetRandomMapAssemblyNameForCraft(shortName)); } UI_RegisterOption(OPTION_UFOS, ufoOptions); for (i = 0; i < DROPSHIP_MAX; i++) { const char *shortName = Com_DropShipTypeToShortName(i); UI_AddOption(&aircraftOptions, shortName, shortName, Com_GetRandomMapAssemblyNameForCraft(shortName)); } UI_RegisterOption(OPTION_DROPSHIPS, aircraftOptions); }
/** * @brief Get the technology for a given UFO type * @param type UFO type to get the technology for * @return The technology for the given UFO. If no technology was found for the UFO * id this might return @c NULL. */ const technology_t* UFO_GetTechnologyFromType (const ufoType_t type) { const char *id = Com_UFOTypeToShortName(type); const technology_t *tech = RS_GetTechByProvided(id); return tech; }