AI_ATMOSPHERE_TYPE_NONE: string := "None" AI_ATMOSPHERE_TYPE_OXYGEN: string := "Oxygen" AI_ATMOSPHERE_TYPE_METHANE: string := "Methane" AI_ATMOSPHERE_TYPE_HYDROGEN: string := "Hydrogen" AI_ATMOSPHERE_TYPE_CARBON_DIOXIDE: string := "Carbon Dioxide" AI_ATMOSPHERE_NUMBER_NONE: long := 1 AI_ATMOSPHERE_NUMBER_OXYGEN: long := 2 AI_ATMOSPHERE_NUMBER_METHANE: long := 3 AI_ATMOSPHERE_NUMBER_HYDROGEN: long := 4 AI_ATMOSPHERE_NUMBER_CARBON_DIOXIDE: long := 5 //------------------------------------------------------------------------ // Is_Colony_Domed //------------------------------------------------------------------------ function Is_Colony_Domed returns boolean params planet_id: long vars is_domed: boolean cargo_item_count: long cargo_index: long cargo_item_id: long cargo_item_type: long planet_atmosphere: long population_atmo: string atmosphere_number: long begin set is_domed := FALSE set cargo_item_count := Sys_Get_Space_Object_Cargo_Item_Count(planet_id) set planet_atmosphere := Sys_Get_Planet_Atmosphere_Type(planet_id) if (cargo_item_count > 0) and (Sys_Get_Space_Object_Cargo_Item_Type_Count(planet_id, CARGO_ITEM_TYPE_POPULATION, "") > 0) then set cargo_index := 0 loop set cargo_index := cargo_index + 1 set cargo_item_id := Sys_Get_Space_Object_Cargo_Item_ID(planet_id, cargo_index) set cargo_item_type := Sys_Get_Space_Object_Cargo_Item_Type(planet_id, cargo_item_id) if (cargo_item_type = CARGO_ITEM_TYPE_POPULATION) then set population_atmo := Sys_Get_Space_Object_Cargo_Item_Population_Atmosphere_Breathed(planet_id,cargo_item_id) case population_atmo AI_ATMOSPHERE_TYPE_NONE: set atmosphere_number := AI_ATMOSPHERE_NUMBER_NONE AI_ATMOSPHERE_TYPE_OXYGEN: set atmosphere_number := AI_ATMOSPHERE_NUMBER_OXYGEN AI_ATMOSPHERE_TYPE_METHANE: set atmosphere_number := AI_ATMOSPHERE_NUMBER_METHANE AI_ATMOSPHERE_TYPE_HYDROGEN: set atmosphere_number := AI_ATMOSPHERE_NUMBER_HYDROGEN AI_ATMOSPHERE_TYPE_CARBON_DIOXIDE: set atmosphere_number := AI_ATMOSPHERE_NUMBER_CARBON_DIOXIDE endcase else set atmosphere_number := 0 endif if (atmosphere_number <> planet_atmosphere) and (atmosphere_number > 0) then set is_domed := TRUE endif exitwhen (cargo_index >= cargo_item_count) or is_domed endloop endif return is_domed end