window.calculateFinalScore = function (hiscore) {

\t/* hiscore is a partly-completed hiscore object */

\t/* Function returns the hiscore object with all the scores filled in */



\tif (hiscore.planet)

\t{

\t\t/* Add score for planet attributes */

\t\tswitch (hiscore.planet.atmosphere)

\t\t{

\t\t\tcase "Marginal":\t\thiscore.score_atmosphere = constants.max_score_per_planet_attribute/2; break;

\t\t\tcase "Breathable":\thiscore.score_atmosphere = constants.max_score_per_planet_attribute; break;

\t\t\tdefault:\t\t\t\t\t\thiscore.score_atmosphere = 0;

\t\t}



\t\tswitch (hiscore.planet.gravity)

\t\t{

\t\t\tcase "Low": case "High":\thiscore.score_gravity = constants.max_score_per_planet_attribute/2; break;

\t\t\tcase "Moderate":\t\t\t\t\thiscore.score_gravity = constants.max_score_per_planet_attribute; break;

\t\t\tdefault:\t\t\t\t\t\t\t\t\thiscore.score_gravity = 0;

\t\t}



\t\tswitch (hiscore.planet.temperature)

\t\t{

\t\t\tcase "Hot": case "Cold":\thiscore.score_temperature = constants.max_score_per_planet_attribute/2; break;

\t\t\tcase "Moderate":\t\t\t\t\thiscore.score_temperature = constants.max_score_per_planet_attribute; break;

\t\t\tdefault:\t\t\t\t\t\t\t\t\thiscore.score_temperature = 0;

\t\t}



\t\tswitch (hiscore.planet.water)

\t\t{

\t\t\tcase "Ice-covered surface":

\t\t\tcase "Planet-wide ocean":

\t\t\t\thiscore.score_water = constants.max_score_per_planet_attribute/2; break;

\t\t\tcase "Ice caps":

\t\t\tcase "Oceans":

\t\t\t\thiscore.score_water = constants.max_score_per_planet_attribute; break;

\t\t\tdefault:

\t\t\t\thiscore.score_water = 0;

\t\t}



\t\tswitch (hiscore.planet.resources)

\t\t{

\t\t\tcase "Poor":\t\t\t\thiscore.score_resources = constants.max_score_per_planet_attribute/2; break;

\t\t\tcase "Rich":\t\t\t\thiscore.score_resources = constants.max_score_per_planet_attribute; break;

\t\t\tdefault:\t\t\t\t\t\thiscore.score_resources = 0;

\t\t}





\t\t/* Add score for tech and culture levels */

\t\tswitch (hiscore.final_tech_level)

\t\t{

\t\t\tcase 10:\thiscore.score_technology = 3000; break;

\t\t\tcase 9:\t\thiscore.score_technology = 2000; break;

\t\t\tcase 8:\t\thiscore.score_technology = 1750; break;

\t\t\tcase 7:\t\thiscore.score_technology = 1500; break;

\t\t\tcase 6:\t\thiscore.score_technology = 1250; break;

\t\t\tcase 5:\t\thiscore.score_technology = 1000; break;

\t\t\tcase 4:\t\thiscore.score_technology = 800; break;

\t\t\tcase 3:\t\thiscore.score_technology = 600; break;

\t\t\tcase 2:\t\thiscore.score_technology = 400; break;

\t\t\tcase 1:\t\thiscore.score_technology = 200; break;

\t\t\tdefault:\thiscore.score_technology = 0; break;

\t\t}



\t\tswitch (hiscore.final_culture)

\t\t{

\t\t\tcase 17:\thiscore.score_culture = 3000; break;

\t\t\tcase 16:\thiscore.score_culture = 2500; break;

\t\t\tcase 15:\thiscore.score_culture = 2000; break;

\t\t\tcase 14:\thiscore.score_culture = 1500; break;

\t\t\tcase 13:\thiscore.score_culture = 1000; break;

\t\t\tcase 12:\thiscore.score_culture = 500; break

\t\t\tcase 11:\thiscore.score_culture = 250; break;

\t\t\tcase 10:\thiscore.score_culture = 0; break;

\t\t\tcase 9:\t\thiscore.score_culture = 2000; break;

\t\t\tcase 8:\t\thiscore.score_culture = 1500; break;

\t\t\tcase 7:\t\thiscore.score_culture = 1000; break;

\t\t\tcase 6:\t\thiscore.score_culture = 500; break;

\t\t\tcase 5:\t\thiscore.score_culture = 0; break;

\t\t\tcase 4:\t\thiscore.score_culture = 2000; break;

\t\t\tcase 3:\t\thiscore.score_culture = 1500; break;

\t\t\tcase 2:\t\thiscore.score_culture = 1000; break;

\t\t\tcase 1:\t\thiscore.score_culture = 500; break;

\t\t\tdefault:\thiscore.score_culture = 0; break;

\t\t}



\t\tswitch (hiscore.native_relations)

\t\t{

\t\t\tcase 9:\t\thiscore.score_native_relations = 1000; break;

\t\t\tcase 8:\t\thiscore.score_native_relations = 0; break;

\t\t\tcase 7:\t\thiscore.score_native_relations = -1000; break;

\t\t\tcase 6:\t\thiscore.score_native_relations = 2000; break;

\t\t\tcase 5:\t\thiscore.score_native_relations = 1000; break;

\t\t\tcase 4:\t\thiscore.score_native_relations = 0; break;

\t\t\tcase 3:\t\thiscore.score_native_relations = -1000; break;

\t\t\tcase 2:\t\thiscore.score_native_relations = -1000; break;

\t\t\tcase 1:\t\thiscore.score_native_relations = -2000; break;

\t\t\tcase 0:\t\thiscore.score_native_relations = -2000; break;

\t\t\tcase -1:\thiscore.score_native_relations = 0; break;

\t\t\tdefault: hiscore.score_native_relations = 0; break;

\t\t}

\t}



\t/* Add up final score */

\thiscore.final_score =

\t\thiscore.score_landing +

\t\thiscore.score_construction +

\t\thiscore.score_native_relations +

\t\thiscore.score_culture +

\t\thiscore.score_technology +

\t\thiscore.score_scientific_database +

\t\thiscore.score_cultural_database +

\t\thiscore.score_atmosphere +

\t\thiscore.score_gravity +

\t\thiscore.score_temperature +

\t\thiscore.score_water +

\t\thiscore.score_resources;

\t

\treturn hiscore;

}

/* Display planet attribute, as if in the planet diplay table */

/* In all cases $args[0] is whether we should display as if the scan succeeded or a surface probe was used. */



<<widget displayPlanetAtmosphere>>

\t<<if $args[0]>>

\t\t<<switch $planet.atmosphere>>

\t\t\t<<case "Corrosive" "Toxic" "None" "Non-breathable">>@@.bad;$planet.atmosphere@@

\t\t\t<<case "Marginal">>@@.mediocre;$planet.atmosphere@@

\t\t\t<<case "Breathable">>@@.good;$planet.atmosphere@@

\t\t\t<<default>>@@.error;$planet.atmosphere@@

\t\t<</switch>>

\t<<else>>

\t\t@@.destroyed;Scan failed@@

\t<</if>>

<</widget>>



<<widget displayPlanetTemperature>>

\t<<if $args[0]>>

\t\t<<switch $planet.temperature>>

\t\t\t<<case "Very hot" "Very cold">>@@.bad;$planet.temperature@@

\t\t\t<<case "Cold" "Hot">>@@.mediocre;$planet.temperature@@

\t\t\t<<case "Moderate">>@@.good;$planet.temperature@@

\t\t\t<<default>>@@.error;$planet.temperature@@

\t\t<</switch>>

\t<<else>>

\t\t@@.destroyed;Scan failed@@

\t<</if>>

<</widget>>



<<widget displayPlanetGravity>>

\t<<if $args[0]>>

\t\t<<switch $planet.gravity>>

\t\t\t<<case "Very high" "Very low">>@@.bad;$planet.gravity@@

\t\t\t<<case "Low" "High">>@@.mediocre;$planet.gravity@@

\t\t\t<<case "Moderate">>@@.good;$planet.gravity@@

\t\t\t<<default>>@@.error;$planet.gravity@@

\t\t<</switch>>

\t<<else>>

\t\t@@.destroyed;Scan failed@@

\t<</if>>

<</widget>>



<<widget displayPlanetWater>>

\t<<if $args[0]>>

\t\t<<switch $planet.water>>

\t\t\t<<case "None" "Trace">>@@.bad;$planet.water@@

\t\t\t<<case "Ice-covered surface" "Planet-wide ocean">>@@.mediocre;$planet.water@@

\t\t\t<<case "Ice caps" "Oceans">>@@.good;$planet.water@@

\t\t\t<<default>>@@.error;$planet.water@@

\t\t<</switch>>

\t<<else>>

\t\t@@.destroyed;Scan failed@@

\t<</if>>

<</widget>>



<<widget displayPlanetResources>>

\t<<if $args[0]>>

\t\t<<switch $planet.resources>>

\t\t\t<<case "None">>@@.bad;$planet.resources@@

\t\t\t<<case "Poor">>@@.mediocre;$planet.resources@@

\t\t\t<<case "Rich">>@@.good;$planet.resources@@

\t\t\t<<default>>@@.error;$planet.resources@@

\t\t<</switch>>

\t<<else>>

\t\t@@.destroyed;Scan failed@@

\t<</if>>

<</widget>>





<<widget displayPlanetFeatures>>

\t<<if !$args[0]>>

\t\t<<if $planet.anomalies.length == 0>>

\t\t\tNone

\t\t<<else>>

\t\t\t<<for _n = 0; _n < $planet.anomalies.length; _n++>>

\t\t\t\t$planet.anomalies[_n]<br>

\t\t\t<</for>>

\t\t<</if>>

\t<<else>>

\t\t<<if $planet.surface_features.length == 0>>

\t\t\tNone

\t\t<<else>>

\t\t\t<<for _n = 0; _n < $planet.surface_features.length; _n++>>

\t\t\t\t<<displayPlanetFeature $planet.surface_features[_n]>><br>

\t\t\t\t/*$planet.surface_features[_n]<br>*/

\t\t\t<</for>>

\t\t<</if>>

\t<</if>>

<</widget>>





<<widget displayPlanetFeature>>

\t/* args[0] is a string containing the name of a surface feature */

\t/* This macro prints it in the appropriate colour */

\t<<set _quality = "error">>

\t<<switch $args[0]>>

\t\t\t\t/* Moon */

\t\t<<case "Barren moon">>\t\t\t\t<<set _quality = "mediocre">>

\t\t<<case "Metal-rich moon">>\t\t\t<<set _quality = "good">>

\t\t<<case "Unstable moon">>\t\t\t<<set _quality = "bad">>



\t\t\t\t/* Beauty/ugliness */

\t\t<<case "Outstanding beauty">>\t\t<<set _quality = "good">>

\t\t<<case "Outstanding ugliness">>\t\t<<set _quality = "bad">>



\t\t\t\t/* Caves */

\t\t<<case "Airtight caves">>\t\t\t<<set _quality = "good">>

\t\t<<case "Insulated caves">>\t\t\t<<set _quality = "good">>

\t\t<<case "Unstable geology">>\t\t\t<<set _quality = "bad">>



\t\t\t\t/* Plants */

\t\t<<case "Plant life">>\t\t\t\t<<set _quality = "mediocre">>

\t\t<<case "Edible plants">>\t\t\t<<set _quality = "good">>

\t\t<<case "Poisonous plants">>\t\t\t<<set _quality = "bad">>

\t\t<<case "Quasi-organic crystals">>\t<<set _quality = "mediocre">>



\t\t\t\t/* Animals */

\t\t<<case "Animal life">>\t\t\t\t<<set _quality = "mediocre">>

\t\t<<case "Useful animals">>\t\t\t<<set _quality = "good">>

\t\t<<case "Dangerous animals">>\t\t<<set _quality = "bad">>



\t\t\t\t/* Intelligent life */

\t\t<<case "Intelligent life">>\t\t\t\t\t<<set _quality = "mediocre">>

\t\t<<case "Planet-spanning civilisation">>\t\t<<set _quality = "mediocre">>



\t\t\t\t/* Ruins */

\t\t<<case "Monumental ruins">>\t\t\t\t\t<<set _quality = "good">>

\t\t<<case "High-tech ruins">>\t\t\t\t\t<<set _quality = "good">>

\t\t<<case "Dangerous ruins">>\t\t\t\t\t<<set _quality = "bad">>

\t\t<<case "Regular geological formations">>\t<<set _quality = "mediocre">>



\t\t\t\t/* Special features from events */

\t\t<<case "Welcoming">>\t\t\t\t<<set _quality = "good">>

\t\t<<case "Unwelcoming">>\t\t\t\t<<set _quality = "bad">>

\t\t<<case "Simulation">>\t\t\t\t<<set _quality = "mediocre">>

\t\t<<case "Alien observers">>\t\t\t<<set _quality = "mediocre">>



\t\t<<default>>

\t\t\t@@.error;Unexpected surface feature <<print $args[0]>>.@@

\t<</switch>>



\t/* Special case for intelligent life: output tech level too */

\t<<if $args[0] == "Intelligent life">>

\t\t<<if $planet.native_culture == -1>>

\t\t\t\t/% Legacy code for games saves before version 1.3.0 %/

\t\t\t<<print "@@.mediocre;" + constants.tech_level_names[$planet.native_tech_level].toUpperFirst() + " civilisation@@">>

\t\t<<else>>

\t\t\t<<print "@@.mediocre;Civilisation: " + constants.tech_level_names[$planet.native_tech_level].toUpperFirst() + " " + constants.culture_names[$planet.native_culture] + "@@">>

\t\t<</if>>

\t<<else>>

\t\t<<print "@@." + _quality + ";" + $args[0] + "@@">>

\t<</if>>

<</widget>>





<<widget displayPlanet>>

\t\t/* $args[0] is whether to ignore scanner success/failure and show everything anyway */

\t\t/* $args[1] is whether to have things pop up on a timer rather than all display at once */

\t\t/* $args[2] is whether to allow launching of a surface probe (assuming we have one and haven't already used one) */



\t<<set _show_atmosphere = $scanner_atmosphere_success | $args[0]>>

\t<<set _show_temperature = $scanner_temperature_success | $args[0]>>

\t<<set _show_gravity = $scanner_gravity_success | $args[0]>>

\t<<set _show_water = $scanner_water_success | $args[0]>>

\t<<set _show_resources = $scanner_resources_success | $args[0]>>

\t<<set _show_features = $scanner_features_success | $args[0]>>



\t<<if $planet.name>>Planet ''$planet.name''<br><</if>>



\t<div class="planet-display-table-area">



\t\t<div class="planet-display-table-section">

\t\t\t<table>

\t\t\t\t<colgroup>

\t\t\t\t\t<col style="width:50%">

\t\t\t\t\t<col style="width:50%">

\t\t\t\t</colgroup>

\t\t\t\t<tr style="height:1em"><td>Atmosphere:</td><td><span id="atmosphere_text">

\t\t\t\t\t<<displayPlanetAtmosphere _show_atmosphere>>

\t\t\t\t</span></td></tr>



\t\t\t\t<tr style="height:1em"><td>Gravity:</td><td><span id="gravity_text">

\t\t\t\t\t<<displayPlanetGravity _show_gravity>>

\t\t\t\t</span></td></tr>

\t\t\t\t<tr style="height:1em"><td>Temperature:</td><td><span id="temperature_text">

\t\t\t\t\t<<displayPlanetTemperature _show_temperature>>

\t\t\t\t</span></td></tr>

\t\t\t\t<tr style="height:1em"><td>Water:</td><td><span id="water_text">

\t\t\t\t\t<<displayPlanetWater _show_water>>

\t\t\t\t</span></td></tr>

\t\t\t\t<tr style="min-height:1em"><td>Resources:</td><td><span id="resources_text">

\t\t\t\t\t<<displayPlanetResources _show_resources>>

\t\t\t\t</span></td></tr>

\t\t\t</table>

\t\t</div>



\t\t<div class="planet-display-table-section">

\t\t\t<table>

\t\t\t\t<colgroup>

\t\t\t\t\t<col style="width:50%">

\t\t\t\t\t<col style="width:50%">

\t\t\t\t</colgroup>

\t\t\t\t<tr><td><span id="anomalies_title_text">

\t\t\t\t\t<<if _show_features>>Features:<<else>>Anomalies:<</if>>

\t\t\t\t\t<br>



\t\t\t\t</span></td>

\t\t\t\t<td><span id="anomalies_text">

\t\t\t\t\t<<displayPlanetFeatures _show_features>>

\t\t\t\t</span></td></tr>

\t\t\t</table>

\t\t</div>



\t</div>



\t<<if $args[1]>>

\t\t<<set _t1 = (1000 + (3000-$scanner_atmosphere*30) + random(2000)) + "ms">>

\t\t<<timed _t1>>

\t\t\t<<if !$surface_probe_used>><<replace '#atmosphere_text'>><<displayPlanetAtmosphere _show_atmosphere>><</replace>><</if>>

\t\t<</timed>>

\t\t<<set _t2 = (1000 + (3000-$scanner_gravity*30) + random(2000)) + "ms">>

\t\t<<timed _t2>>

\t\t\t<<if !$surface_probe_used>><<replace '#gravity_text'>><<displayPlanetGravity _show_gravity>><</replace>><</if>>

\t\t<</timed>>

\t\t<<set _t3 = (1000 + (3000-$scanner_temperature*30) + random(2000)) + "ms">>

\t\t<<timed _t3>>

\t\t\t<<if !$surface_probe_used>><<replace '#temperature_text'>><<displayPlanetTemperature _show_temperature>><</replace>><</if>>

\t\t<</timed>>

\t\t<<set _t4 = (1000 + (3000-$scanner_water*30) + random(2000)) + "ms">>

\t\t<<timed _t4>>

\t\t\t<<if !$surface_probe_used>><<replace '#water_text'>><<displayPlanetWater _show_water>><</replace>><</if>>

\t\t<</timed>>

\t\t<<set _t5 = (1000 + (3000-$scanner_resources*30) + random(2000)) + "ms">>

\t\t<<timed _t5>>

\t\t\t<<if !$surface_probe_used>><<replace '#resources_text'>><<displayPlanetResources _show_resources>><</replace>><</if>>

\t\t<</timed>>

\t\t<<set _t6 = (1000 + random(2000)) + "ms">>

\t\t<<timed _t6>>

\t\t\t<<if !$surface_probe_used>>

\t\t\t\t<<replace '#anomalies_text'>><<displayPlanetFeatures _show_features>><</replace>>

\t\t\t\t<<if _show_features>>

\t\t\t\t\t<<replace '#anomalies_title_text'>>Surface features:<</replace>>

\t\t\t\t<</if>>

\t\t\t<</if>>

\t\t<</timed>>

\t<</if>>



<</widget>>



window.decodeHiscore = function (hiscoreString) {

\t/* Takes an encoded hiscore string */

\t/* Returns a hiscore object */

\t

\t/* Set up score variables */

\tvar hiscore = {

\t\tfinal_tech_level: -1,

\t\tfinal_culture: -1,

\t\tnative_relations: -1,

\t\tfinal_score: 0,

\t\tscore_landing: 0,

\t\tscore_construction: 0,

\t\tscore_native_relations: 0,

\t\tscore_technology: 0,

\t\tscore_culture: 0,

\t\tscore_scientific_database: 0,

\t\tscore_cultural_database: 0,

\t\tscore_atmosphere: 0,

\t\tscore_gravity: 0,

\t\tscore_temperature: 0,

\t\tscore_water: 0,

\t\tscore_resources: 0,

\t\tsummary: "" };



\tvar strings = hiscoreString.split(".");



\t/* Planet string */

\tvar planet_string = strings[0];



\t/* _planet_string[0] is always "?" so ignore and start with _planet_string[1] */



\tif (planet_string[1] == "X")

\t{

\t\t/* No planet - destroyed in space */

\t}

\telse

\t{

\t\t/* Set up planet variable */

\t\tvar planet = {

\t\t\ttemperature: "",

\t\t\tgravity: "",

\t\t\tresources: "",

\t\t\tatmosphere: "",

\t\t\twater: "",

\t\t\tsurface_features: [],

\t\t\tanomalies: [],

\t\t\tnative_tech_level: 0

\t\t};



\t\t\t/* PLANET ATTRIBUTES */

\t\tswitch (planet_string[1])

\t\t{

\t\t\tcase "b":\t\tplanet.atmosphere = "Breathable"; break;

\t\t\tcase "m":\t\tplanet.atmosphere = "Marginal"; break;

\t\t\tcase "v":\t\tplanet.atmosphere = "None"; break;

\t\t\tcase "n":\t\tplanet.atmosphere = "Non-breathable"; break;

\t\t\tcase "t":\t\tplanet.atmosphere = "Toxic"; break;

\t\t\tcase "c":\t\tplanet.atmosphere = "Corrosive"; break;

\t\t\tdefault:\t\tplanet.atmosphere = "ERROR: " + planet_string[1];

\t\t}



\t\tswitch (planet_string[2])

\t\t{

\t\t\tcase "H":\t\tplanet.gravity = "Very high"; break;

\t\t\tcase "h":\t\tplanet.gravity = "High"; break;

\t\t\tcase "m":\t\tplanet.gravity = "Moderate"; break;

\t\t\tcase "l":\t\tplanet.gravity = "Low"; break;

\t\t\tcase "L":\t\tplanet.gravity = "Very low"; break;

\t\t\tdefault:\t\tplanet.gravity = "ERROR: " + planet_string[2];

\t\t}



\t\tswitch (planet_string[3])

\t\t{

\t\t\tcase "H":\t\tplanet.temperature = "Very hot"; break;

\t\t\tcase "h":\t\tplanet.temperature = "Hot"; break;

\t\t\tcase "m":\t\tplanet.temperature = "Moderate"; break;

\t\t\tcase "c":\t\tplanet.temperature = "Cold"; break;

\t\t\tcase "C":\t\tplanet.temperature = "Very cold"; break;

\t\t\tdefault:\t\tplanet.temperature = "ERROR: " + planet_string[3];

\t\t}



\t\tswitch (planet_string[4])

\t\t{

\t\t\tcase "o":\t\tplanet.water = "Oceans"; break;

\t\t\tcase "O":\t\tplanet.water = "Planet-wide ocean"; break;

\t\t\tcase "i":\t\tplanet.water = "Ice caps"; break;

\t\t\tcase "I":\t\tplanet.water = "Ice-covered surface"; break;

\t\t\tcase "t":\t\tplanet.water = "Trace"; break;

\t\t\tcase "n":\t\tplanet.water = "None"; break;

\t\t\tdefault:\t\tplanet.water = "ERROR: " + planet_string[4];

\t\t}



\t\tswitch (planet_string[5])

\t\t{

\t\t\tcase "r":\t\tplanet.resources = "Rich"; break;

\t\t\tcase "p":\t\tplanet.resources = "Poor"; break;

\t\t\tcase "n":\t\tplanet.resources = "None"; break;

\t\t\tdefault:\t\tplanet.resources = "ERROR: " + planet_string[5];

\t\t}



\t\t/* Any remaining characters are planet features */

\t\tfor (var n = 6; n < planet_string.length; n++)

\t\t{

\t\t\tswitch (planet_string[n])

\t\t\t{

\t\t\t\t\t\t/* Moon */

\t\t\t\tcase "a":\tplanet.surface_features.push("Barren moon"); break;

\t\t\t\tcase "b":\tplanet.surface_features.push("Metal-rich moon"); break;

\t\t\t\tcase "c":\tplanet.surface_features.push("Unstable moon"); break;



\t\t\t\t\t\t/* Beauty/ugliness */

\t\t\t\tcase "d":\tplanet.surface_features.push("Outstanding beauty"); break;

\t\t\t\tcase "e":\tplanet.surface_features.push("Outstanding ugliness"); break;



\t\t\t\t\t\t/* Caves */

\t\t\t\tcase "f":\tplanet.surface_features.push("Airtight caves"); break;

\t\t\t\tcase "g":\tplanet.surface_features.push("Insulated caves"); break;

\t\t\t\tcase "h":\tplanet.surface_features.push("Unstable geology"); break;



\t\t\t\t\t\t/* Plants */

\t\t\t\tcase "i":\tplanet.surface_features.push("Plant life"); break;

\t\t\t\tcase "j":\tplanet.surface_features.push("Edible plants"); break;

\t\t\t\tcase "k":\tplanet.surface_features.push("Poisonous plants"); break;

\t\t\t\tcase "l":\tplanet.surface_features.push("Quasi-organic crystals"); break;



\t\t\t\t\t\t/* Animals */

\t\t\t\tcase "m":\tplanet.surface_features.push("Animal life"); break;

\t\t\t\tcase "n":\tplanet.surface_features.push("Useful animals"); break;

\t\t\t\tcase "o":\tplanet.surface_features.push("Dangerous animals"); break;



\t\t\t\t\t\t/* Intelligent life */

\t\t\t\tcase "p":\tplanet.surface_features.push("Intelligent life"); break;



\t\t\t\t\t\t/* Ruins */

\t\t\t\tcase "q":\tplanet.surface_features.push("Monumental ruins"); break;

\t\t\t\tcase "r":\tplanet.surface_features.push("High-tech ruins"); break;

\t\t\t\tcase "s":\tplanet.surface_features.push("Dangerous ruins"); break;

\t\t\t\tcase "t":\tplanet.surface_features.push("Regular geological formations"); break;



\t\t\t\t\t\t/* Special event features */

\t\t\t\tcase "u":\tplanet.surface_features.push("Welcoming"); break;

\t\t\t\tcase "v":\tplanet.surface_features.push("Unwelcoming"); break;

\t\t\t\tcase "w":\tplanet.surface_features.push("Simulation"); break;

\t\t\t\tcase "x":\tplanet.surface_features.push("Alien observers"); break;



\t\t\t\t\t\t/* Planet-spanning civilisation */

\t\t\t\tcase "y":\tplanet.surface_features.push("Planet-spanning civilisation"); break;



\t\t\t\tdefault:\tplanet.surface_features.push("ERROR: " + planet_string[n]);

\t\t\t}

\t\t}



\t\t/* Native tech level */

\t\tvar nativeProperties = strings[1].split("-");

\t\tplanet.native_tech_level = Number(nativeProperties[0]);

\t\tif (nativeProperties.length > 1) {

\t\t\tplanet.native_culture = Number(nativeProperties[1]);

\t\t} else {

\t\t\tplanet.native_culture = -1;

\t\t}





\t\t/* Planet name */

\t\tplanet.name = decodeURIComponent(strings[2]);

\t\tplanet.name = planet.name.replace("%2E",".");

\t\tplanet.name = planet.name.replace("%27","'");



\t\thiscore.planet = planet;

\t}



\t/* Landing score */

\thiscore.score_landing = Number(strings[3]);



\t/* Construction score */

\thiscore.score_construction = Number(strings[4]);



\t/* Natives result */

\thiscore.native_relations = Number(strings[5]);



\t/* Technology result */

\thiscore.final_tech_level = Number(strings[6]);



\t/* Culture result */

\thiscore.final_culture = Number(strings[7]);



\t/* Scientific database */

\thiscore.score_scientific_database = Number(strings[8]);



\t/* Cultural database */

\thiscore.score_cultural_database = Number(strings[9]);



\t/* Number of planets visited -- will only be part of string for games played in version 1.2.0+ */

\tif (strings[10])

\t{

\t\thiscore.planets_visited = Number(strings[10]);

\t}



\t/* Date -- will only be part of string for games played in version 1.2.2+ */

\tif (strings[11])

\t{

\t\tvar dateString = strings[11].split("-");

\t\tvar year = Number(dateString[0]);

\t\tvar month = Number(dateString[1]) - 1;\t/* January is zero etc. */

\t\tvar day = Number(dateString[2]);

\t\thiscore.date = new Date(year, month, day, 0, 0, 0, 0);

\t}



\t/* Extra colonists -- will only be part of string for games played in version 1.3.0+ */

\tif (strings[12])

\t{

\t\thiscore.score_extra_colonists = Number(strings[12]);

\t}



\thiscore = calculateFinalScore(hiscore);

\t

\treturn hiscore;

}



/* args[0] should be a hiscore object */

/* If args[1] is true, display the date, otherwise don't */

<<widget displayScore>>

\t<<if $args[0].planets_visited>>

\t\t/% planets_visited property will only exist in scores saved with version 1.2.0 or higher %/

\t\tPlanets visited: <<print $args[0].planets_visited>>

\t\t<br><br>

\t<</if>>



\t<table class="score-table">

\t\t<colgroup>

\t\t\t<col>

\t\t\t<col style="width:4em">

\t\t</colgroup>



\t\t<tr><td colspan=2>''Score''</td></tr>



<<if $args[0].planet>>

\t\t<tr><td>Planet atmosphere:</td><td style="text-align:right"><<displayColouredScore $args[0].score_atmosphere 1000>></td></tr>

\t\t<tr><td>Planet gravity:</td><td style="text-align:right"><<displayColouredScore $args[0].score_gravity 1000>></td></tr>

\t\t<tr><td>Planet temperature:</td><td style="text-align:right"><<displayColouredScore $args[0].score_temperature 1000>></td></tr>

\t\t<tr><td>Planet water:</td><td style="text-align:right"><<displayColouredScore $args[0].score_water 1000>></td></tr>

\t\t<tr><td>Planet resources:</td><td style="text-align:right"><<displayColouredScore $args[0].score_resources 1000>></td></tr>

<</if>>

\t\t<<if $args[0].score_landing != 0>><tr><td>Survivors after landing:</td><td style="text-align:right"><<displayColouredScore $args[0].score_landing 1000>></td></tr><</if>>

\t\t<<if $args[0].score_construction != 0>><tr><td>Survivors after settlement construction:</td><td style="text-align:right"><<displayColouredScore $args[0].score_construction 1000>></td></tr><</if>>

\t\t<<if $args[0].final_tech_level != -1>><tr><td>Final technology level (<<print constants.tech_level_names[$args[0].final_tech_level].toUpperFirst()>>):</td><td style="text-align:right"><<displayColouredScore $args[0].score_technology 2000>></td></tr><</if>>

\t\t<<if $args[0].native_relations != -1>><tr><td>Native relations (<<print constants.native_relations_names[$args[0].native_relations]>>):</td><td style="text-align:right"><<displayColouredScore $args[0].score_native_relations 2000>></td></tr><</if>>

\t\t<<if $args[0].final_culture != -1>><tr><td>Final culture (<<print constants.culture_names[$args[0].final_culture]>>):</td><td style="text-align:right"><<displayColouredScore $args[0].score_culture 2000>></td></tr><</if>>

\t\t<<if $args[0].score_scientific_database != 0>><tr><td>Surviving scientific database × 10:</td><td style="text-align:right"><<displayColouredScore $args[0].score_scientific_database 1000>></td></tr><</if>>

\t\t<<if $args[0].score_cultural_database != 0>><tr><td>Surviving cultural database × 10:</td><td style="text-align:right"><<displayColouredScore $args[0].score_cultural_database 1000>></td></tr><</if>>

\t\t<tr><td>Total:</td><td style="text-align:right">''$args[0].final_score''</td></tr>

\t</table>



<</widget>>



/* args[0] should be a hiscore object */

<<widget displayHiscoreDate>>

\t<<set _dateString = "">>

\t<<script>>

\t\tvar d = new Date(State.variables.args[0].date);

\t\tTempVariables.dateString = d.toDateString();

\t<</script>>

\t<<print _dateString>>

<</widget>>



<<widget displayColouredScore>>

\t/* Display $args[0] in an appropriate colour. */

\t/* $args[0] is the number to display. */

\t/* $args[1] is the max value for the colour scheme. */

\t/* <<if $args[0] >= $args[1]>>

\t\t@@.good;$args[0]@@

\t<<elseif $args[0] > 0>>

\t\t@@.mediocre;$args[0]@@

\t<<else>>

\t\t@@.bad;$args[0]@@

\t<</if>> */



\t$args[0]



<</widget>>

<div id="starfield"></div>

<div id="passages"></div>



/* $query_string has already been set to the string */



/* Example string: ?nHHtnd.0.Arid.1000.490.-1.3.8.300.1000.1.2018-3-26 */



<<set $hiscore = decodeHiscore($query_string)>>

<<set $planet = $hiscore.planet>>





<br><br>



/* Display */

<h1 style="text-align:center">Seedship Mission Report</h1>

<<if $planet>>

\t<<displayPlanet true false>><br>

<</if>>

<<display "Endgame Summary">><br><br>

<<displayScore $hiscore true>>



<div style="text-align:center; font-size:150%; font-weight:bold">

<a href="https://johnayliff.itch.io/seedship">Play Seedship</a>

</div>



/% Set up background stars %/

<<script>>

\tfor (var n = 0; n < 200; n++)

\t{

\t\tvar x = randomFloat(0.0,100.0);

\t\tvar y = randomFloat(0.0,100.0);

\t\tvar c = random(50,200);

\t\tvar s = random(25, 75) + "%";

\t\tvar string = "<div style='font-size: " + s + "; position: fixed; top: " + y + "%; left: " + x + "%; color: rgb(" + c + ", " + c + ", " + c + "); text-shadow: 0px 0px 2px rgb(" + c + ", " + c + ", " + c + "); z-index:-10;'>•</div>";

\t\tdocument.getElementById("starfield").innerHTML += string;

\t}

<</script>>

window.constants =

{

\tmobileVersion: false,\t/* Change when compiling, and also change StoryInterface */

\tiOSVersion : false,\t\t

\tversion: "1.3.3",



\tmax_hiscores: 100,



\tcontinue_text: "Continue",



\tsystem_names:

\t\t[ \t"atmosphere scanner",

\t\t\t"gravity scanner",

\t\t\t"temperature scanner",

\t\t\t"resources scanner",

\t\t\t"water scanner",

\t\t\t"landing system",

\t\t\t"construction system",

\t\t\t"scientific database",

\t\t\t"cultural database",

\t\t\t"surface probes",

\t\t\t"sleep chambers" ] ,



\tMO_encounters_first_two:

\t\t[\t"MO Impact Choice",

\t\t\t"MO Comet Choice",

\t\t\t"MO Micrometeorite",

\t\t\t"MO Radiation Burst",

\t\t\t"MO Overheating",

\t\t\t"MO Black Hole",

\t\t\t"MO Stellar Nursery"] ,



\tMO_encounters_uneventful:

\t\t[\t"MO Uneventful 1",

\t\t\t"MO Uneventful 2",

\t\t\t"MO Uneventful 3",

\t\t\t"MO Uneventful 4",

\t\t\t"MO Uneventful 5" ] ,



\tMO_encounters_common:

\t\t[\t"MO Impact Choice",

\t\t\t"MO Comet Choice",

\t\t\t"MO Micrometeorite",

\t\t\t"MO Protoplanetary Disc",

\t\t\t"MO Avoid Dust",

\t\t\t"MO Radiation Burst",

\t\t\t"MO Sensor Anomaly",

\t\t\t"MO Overheating",

\t\t\t"MO Black Hole",

\t\t\t"MO Stellar Nursery"] ,



\tMO_encounters_rare:

\t\t[\t"MO Racist Program",

\t\t\t"MO Trailing Drone",

\t\t\t"MO Alien Signal",

\t\t\t"MO Alien Derelict",

\t\t\t"MO Alien Probe",

\t\t\t"MO Read Databases",

\t\t\t"MO Alien Miners",

\t\t\t"MO Nanotech Plague",

\t\t\t"MO Stowaways",

\t\t\t"MO Revisionist Program",

\t\t\t"MO Ruined Planet",

\t\t\t"MO Crewed Ship",

\t\t\t"MO Destination Signal",

\t\t\t"MO Dictator",

\t\t\t"MO Dyson Sphere",

\t\t\t"MO Premature Awakening",

\t\t\t"MO Reservation"],



\tMO_encounters_malfunction:

\t\t[\t"MO Probe Malfunction",

\t\t\t"MO Computer Failure",

\t\t\t"MO Stasis Failure",

\t\t\t"MO System Failure",

\t\t\t"MO Scanner Failure",

\t\t\t"MO Power Failure",

\t\t\t"MO Structural Weakness"] ,

\t\t





\ttech_level_names:

\t\t[\t"Pre-Stone Age",

\t\t\t"Paleolithic",

\t\t\t"Mesolithic",

\t\t\t"Neolithic",

\t\t\t"Bronze Age",

\t\t\t"Iron Age",

\t\t\t"Medieval",

\t\t\t"Industrial",

\t\t\t"Atomic Age",

\t\t\t"Information Age",

\t\t\t"Post-Singularity"],



\tculture_names:

\t\t[\t"Savagery",

\t\t\t"Warring Tribes",

\t\t\t"Brutal Chieftains",

\t\t\t"Benevolent Chieftains",

\t\t\t"Collective Rule",

\t\t\t"Warring States",

\t\t\t"Slave-Based Empire",

\t\t\t"Oppressive Theocracy",

\t\t\t"Benevolent Monarchy",

\t\t\t"Egalitarian Republic",

\t\t\t"Post-Nuclear Wasteland",

\t\t\t"Warring Superpowers",

\t\t\t"Dystopian Police State",

\t\t\t"Rule by Corporations",

\t\t\t"Corrupt Democracy",

\t\t\t"Engaged Democracy",

\t\t\t"Post-Scarcity Utopia",

\t\t\t"Cosmic Enlightenment"],



\tnative_relations_names:

\t\t[\t"Genocide of Colonists",

\t\t\t"Genocide of Natives",

\t\t\t"Colonists Enslaved",

\t\t\t"Natives Enslaved",

\t\t\t"Isolationism",

\t\t\t"Friendly",

\t\t\t"Integrated Societies",

\t\t\t"Immigrants, Earth forgotten",

\t\t\t"Immigrants, Earth remembered",

\t\t\t"Immigrants, rich hybrid culture"],



\talien_planet_names:

\t\t[\t"Bartan",

\t\t\t"Cenron",

\t\t\t"Nalarar",

\t\t\t"Bondal",

\t\t\t"Ballor",

\t\t\t"Van-Karal",

\t\t\t"Valtane",

\t\t\t"Vantos",

\t\t\t"Malalas",

\t\t\t"Mateot",

\t\t\t"Tiris",

\t\t\t"Kanan",

\t\t\t"Montaan",

\t\t\t"Tardor",

\t\t\t"Nananon",

\t\t\t"Moridia",

\t\t\t"Tatloor",

\t\t\t"La Vok",

\t\t\t"Slorrug",

\t\t\t"Sakani",

\t\t\t"Vaszalu",

\t\t\t"Varkena",

\t\t\t"Baro",

\t\t\t"Toran",

\t\t\t"Hatnlant",

\t\t\t"Uluunna",

\t\t\t"Baroa",

\t\t\t"Duperda",

\t\t\t"Bantak",

\t\t\t"Barkaan",

\t\t\t"Ban Beraou",

\t\t\t"Baxuor",

\t\t\t"Rrarar",

\t\t\t"Tina",

\t\t\t"Zo"

],





\tmax_colonists: 1000,

\tmax_probes: 10,



\tplanets_visited: 0,



\tscanner_atmosphere: 100,

\tscanner_gravity: 100,

\tscanner_temperature: 100,

\tscanner_resources: 100,

\tscanner_water: 100,



\tsystem_landing: 100,

\tsystem_constructors: 100,

\tsystem_scientific_database: 100,

\tsystem_cultural_database: 100,

\tcolonists: 1000,

\tsurface_probes: 10,



\tscanner_atmosphere_level: 0,

\tscanner_gravity_level: 0,

\tscanner_temperature_level: 0,

\tscanner_resources_level: 0,

\tscanner_water_level: 0,



\tmax_score_per_planet_attribute: 500

}



Setting.addList("stylesheet", {

\tlabel : "Colour scheme:",

\tlist : [0, 1, 2],

\tdefault : 0

});

<<set $query_string = location.search>>



<<if $query_string.length == 0>>

\t/%<<set $query_string = "?bmmorajn.9-14.Earth.1000.1000.-1.9.14.1000.1000.1.2019-6-30.0">>%/

\t<<run window.location.replace("https://johnayliff.itch.io/seedship")>>

<<else>>

\t<<include [[Sharer]]>>

<</if>>

/* Small-screen (mobile) formatting is default. Then changed for big screens. */



.debug-text {

\t/* Un-comment display:none for release */

\tdisplay: none;

\tpadding: 0.25em;

\tbackground-color: #003300;

\tborder-left: 0.5em solid #00FF00;

}





/* Small screens: status bar at the top with 80% text size, planet scan in one vertical table */

#status-display {

\tbox-sizing: border-box;

\tbackground-color: #111;

\tborder: solid 1px #333;

\tposition: fixed;

\tleft: 0;

\ttop: 0;

\twidth: 100%;

\theight: 8em;

\tpadding: 0.5em 0.5em 0em 0.5em;\t/* Top, right, bottom, left */

\tdisplay: none;\t/* Initially hidden */

}



.status-display-colonists {

\tdisplay: block;

\tbox-sizing: border-box;

\twidth: 98%;

\tmargin-bottom: 0.5em;

}



.status-display-block {

\tdisplay: inline-block;

\tvertical-align: top;

\tbox-sizing: border-box;

\twidth: 49%;

}



#status-display table {

\tfont-size: 0.7em;

\twidth: 100%;

}



#status-display td {

\tpadding-bottom: 0.2em;

\ttext-align: left;

}



.status-display-number-column {

\twidth: 2em;

}



.status-display-change-column {

\twidth: 2em;

}



#passages {

\tmargin: 8em 0em 0em 0em;\t/* Top, right, bottom, left */

\tpadding: 1em 0.5em;

\tfont-size: 0.9em;

}



.front-matter #passages {

\tmargin: 0em 0em 0em 0em;\t/* Top, right, bottom, left */

}



.skip-intro-link {

\tposition:fixed;

\tbottom: 20px;

\tright: 30px;

\tfont-size: 75%;

\tbackground-color: #000;

}



.skip-intro-link a {

\tfont-size: 1.0em !important;

}



#sidebar-status-display td {

\tpadding: 0.3em 0;

}



.planet-display-table-area {

\tdisplay: block;

\twidth: 100%;

\ttext-align: center;

}



.planet-display-table-section {

\tdisplay: block;

\tvertical-align: top;

\twidth: 100%;

\tmargin: 0em;

\ttext-align: left;

\t/*min-width: 12em;*/

}



.planet-display-table-section table {

\twidth: 100%;

}



.main-loop-links {

\twidth: 100%;

\ttext-align: center;

}



.main-loop-links a {

\tfont-size: initial;\t/* Full size font regardless of screen size, to make links easily clickable */

\tdisplay: inline-block;

\twidth: 40%;

\tpadding: 0.1em 0.2em;

\tmargin-bottom: 0.5em;

}



a {

\tdisplay: inline-block;

\tborder: solid 1px #8af;

\tbackground-color: #001;

\tpadding: 0.1em 0.2em;

\tmargin-bottom: 0.5em;

}



.disabled-hiscore-link {

\tdisplay: inline-block;

\tborder: solid 1px grey;

\tcolor: grey;

\tbackground-color: #050505;

\tpadding: 0.1em 0.2em;

\tmargin-bottom: 0.5em;

}



.surface-probe-link {

\tfont-size: 0.8em;

}



.main-loop-link-spacer {

\tdisplay: none;

}



.inline-link {

\tpadding: initial;

\tmargin-bottom: initial;

}



.inline-link a {

\tpadding: initial;

\tmargin-bottom: initial;

}



.score-table {

\twidth: 100%;

}



.score-table td {

\tfont-size: 0.8em;

}



.hiscore-table {

\twidth: 100%;

}



.hiscore-table td {

\tfont-size: 0.8em;

}



#title-screen-block {

\ttext-align:center;

\tposition: absolute;

\ttop: 50%;

\tleft: 50%;

\ttransform: translate(-50%, -50%);

}





/* Medium screens: status bar at the left with 80% text size, planet scan in one vertical table */

@media screen and (min-width: 30em) {

\t#status-display {

\t\twidth: 12em;

\t\theight: 100%;

\t\tpadding-top: 0.5em;

\t\tpadding-bottom: 0em;

\t\tpadding-left: 0.5em;

\t\tpadding-right: 0.5em;

\t}



\t#status-display table {

\t\tfont-size: 0.8em;

\t}



\t.status-display-block {

\t\tdisplay: block;

\t\twidth: 100%;

\t\tmargin-bottom: 1em;

\t}



\t.status-display-colonists {

\t\tdisplay: block;

\t\twidth: 100%;

\t\tmargin-bottom: 1em;

\t}



\t#passages {

\t\tmargin: 0em 0em 0em 12em;\t/* Top, right, bottom, left. */

\t\tpadding-top: 1em;

\t\tpadding-bottom: 1em;

\t\tpadding-left: 4em;

\t\tpadding-right: 4em;

\t}





\t.score-table {

\t\twidth: 90%;

\t}



\t/* Big screens: status bar at the left with 100% text size, planet scan in two side-by-side tables */

\t@media screen and (min-width: 50em) {

\t\t#status-display {

\t\t\twidth: 17.5em;

\t\t\theight: 100%;

\t\t\tpadding-left: 1.5em;

\t\t}



\t\t#passages {

\t\t\tmargin: 0em 0em 0em 17.5em;\t/* Top, right, bottom, left. */

\t\t\tfont-size: 1.0em;

\t\t}



\t\t.planet-display-table-section {

\t\t\tdisplay: inline-block;

\t\t\tvertical-align: top;

\t\t\twidth: 48%;

\t\t\tbox-sizing: border-box;

\t\t}



\t\t/* Normal link appearance, not buttons */

\t\t.main-loop-links {

\t\t\twidth: auto;

\t\t\ttext-align: left;

\t\t}



\t\t.main-loop-links a {

\t\t\twidth: auto;

\t\t}



\t\t.score-table td {

\t\t\tfont-size: initial;

\t\t}



\t\t.hiscore-table td {

\t\t\tfont-size: initial;

\t\t}



\t\t/* In the app version, links are always buttons, do not become text on larger screens. Link spacer is always hidden. */

\t\t/* If this is _not_ the app version, the html element will have the web-version class */

\t\t.web-version a {

\t\t\tfont-size: initial;\t/* Full size font regardless of screen size, to make links easily clickable */

\t\t\tdisplay: initial;

\t\t\tborder: initial;

\t\t\tpadding: initial;

\t\t\tmargin-bottom: initial;

\t\t\tbackground-color: initial;

\t\t}



\t\t.web-version .disabled-hiscore-link {

\t\t\tfont-size: initial;\t/* Full size font regardless of screen size, to make links easily clickable */

\t\t\tdisplay: initial;

\t\t\tborder: initial;

\t\t\tpadding: initial;

\t\t\tmargin-bottom: initial;

\t\t\tbackground-color: initial;

\t\t\tcolor: grey;

\t\t}



\t\t.web-version .main-loop-link-spacer {

\t\t\tdisplay: initial;

\t\t}

\t}



\t/* Tall enough screens: add padding to passages and status display. */

\t@media screen and (min-height: 20em) {

\t\t#status-display {

\t\t\tpadding-top: 4em;

\t\t}



\t\t#passages {

\t\t\tpadding-top: 4em;

\t\t\tpadding-bottom: 4em;

\t\t}



\t}



\t/* Tall screens: space out lines in status display if there's enough space for it. */

\t@media screen and (min-height: 30em) {

\t\t#status-display td {

\t\t\tpadding-bottom: 0.5em;

\t\t}



\t\t/* Status bar has full size text only if screen is wide and tall. */

\t\t@media screen and (min-width: 50em) {

\t\t\t#status-display table {

\t\t\t\tfont-size: 1.0em;

\t\t\t}

\t\t}

\t}

}







body {

\tbackground-color: #000;

}





.credits-small-text {

\tfont-size: 0.75em;

}



.credits-small-text a {

\tfont-size: 1.0em;

}





#title, #menu, #ui-bar-tray {

\tdisplay: none;

}



.passage table {

\tmargin: 0em 0;

\tborder-collapse: collapse;

\tfont-size: 100%;

}

.passage tr, .passage th, .passage td, .passage caption {

\tpadding: 0px 5px;

\tvertical-align: top;

}



a:hover {

\tcolor: #8af;

\ttext-decoration: none;

\ttext-shadow: 0px 0px 5px #8af;

}



h1 {

\ttext-shadow: 0px 0px 50px #8af;

}



.scanning {

\tcolor: grey;

}



.good {

\tcolor: lime;

}



.mediocre {

\tcolor: yellow;

}



.bad {

\tcolor: red;

}



.destroyed {

\tcolor: darkred;

}



.continue-text {

\tfont-weight: bold;

}



.placeholder {

\tpadding: 0.25em;

\tbackground-color: #003333;

\tborder-left: 0.5em solid #00FF00;

}



.fade-in {

\ttransition: opacity 400ms ease-in;

}



#passages a.link-external:after {

\tcontent: normal;

}







/* Style all font awesome icons */

.fa a {

\tdisplay: inline-block;

\tpadding: 0.55em 0.5em 0.45em;

\twidth: 1em;

\theight: 1em;

\ttext-align: center;

\ttext-decoration: none;

\tmargin: 5px 2px;

\tborder-radius: 50%;

color: white;

\tbackground: #404040;

\tborder: none;

}



/* Add a hover effect */

.fa a:hover {

\tcolor: white;

\ttext-decoration: none;

}



/* Not using font awesome stylesheet to style these: putting the character code in the page explicitly */

.icon-facebook a:hover {

background: #3B5998;

}



.icon-facebook a:before {

content: "\sf09a";

}



.icon-twitter a:hover {

background: #55ACEE;

}



.icon-twitter a:before {

content: "\sf099";

}



.icon-home a:hover {

background: green;

}



.icon-home a:before {

content: "\sf015";

}



.icon-chain a:hover {

background: green;

}



.icon-chain a:before {

content: "\sf0c1";

}





#starfield {

-webkit-user-select: none; /* Chrome, Opera, Safari */

-moz-user-select: none; /* Firefox 2+ */

-ms-user-select: none; /* IE 10+ */

user-select: none; /* Standard syntax */

\toverflow:hidden;

\tcursor:default;

\tz-index:-10;

}



.title-screen-patreon-button {

\tposition: absolute;

\tbottom: 20px;

\tleft: 20px;

\topacity: 0.15;

\twidth: 100px;

\tmax-width: 25%;

\theight: auto;

}



.title-screen-patreon-button img {

\twidth: 100%;

\theight: auto;

}



.title-screen-patreon-button:hover {

\topacity: 0.3;

}



.title-screen-patreon-button a {

\tborder: 0px none transparent;

}





.title-screen-support-area {

\tposition: absolute;

\tbottom: 20px;

\tleft: 20px;

\theight: auto;

\tmargin-bottom: 0.5em;

\topacity: 0.8;

}



.title-screen-version-number {

\ttext-align:center;

\tposition: absolute;

\ttop: 5px;

\tright: 5px;

\tfont-size: 60%;

\topacity: 0.8;

}



.title-screen-app-store-area {

\tposition: absolute;

\tbottom: 20px;

\tright: 20px;

\twidth: 150px;

\tmax-width: 25%;

\theight: auto;

\ttext-align: center;

}



/* Google play image has padding in the image, whereas the app store one has to have it added in css */

#google-play-image {

\twidth: 150px;

\tmax-width: 100%;

\theight: auto;

\tbox-sizing: border-box;

}



#app-store-image {

\twidth: 150px;

\tmax-width: 100%;

\theight: auto;

\tbox-sizing: border-box;

\tpadding: 0% 6.5%;

}



.title-screen-app-store-area a {

\tborder: none;

\tbackground-color: transparent;

\tpadding: 0em;

\tmargin-bottom: 0em;

}



.title-screen-lod-toggle-area {

\tposition: absolute;

\tbottom: 20px;

\tleft: 50%;

\ttransform: translate(-50%, 0);

\theight: auto;

\tmargin-bottom: 0.5em;

}



.title-screen-toggle-dol {

\tdisplay: none;

}



.dark-on-light .title-screen-toggle-dol {

\tdisplay: initial;

}



.title-screen-toggle-lod {

\tdisplay: initial;

}



.dark-on-light .title-screen-toggle-lod {

\tdisplay: none;

}





.end-game-patreon-button {

\tdisplay: inline-block;

\tvertical-align: -32%;

\topacity: 0.5;

\twidth: 80px;

\theight: auto;

}



.end-game-patreon-button img {

\twidth: 100%;

\theight: auto;

}



.end-game-patreon-button a {

\tborder: 0px none transparent;

}



.end-game-patreon-button:hover {

\topacity: 1.0;

}







/* Dark-on-light style -- toggleable from options */

.dark-on-light {

\tcolor: #000000;

}



.dark-on-light body {

\tbackground: #FFFFFF;

}



.dark-on-light #status-display {

\tbackground-color: #CCC;

\tborder: solid 1px #333;

}



.dark-on-light a {

\tcolor: #000099;

\tbackground: none;

}



.dark-on-light .disabled-hiscore-link {

\tbackground: none;

}



.dark-on-light .scanning {

\tcolor: grey;

}



.dark-on-light .good {

\tcolor: #009900;

}



.dark-on-light .mediocre {

\tcolor: #333300;

}



.dark-on-light .bad {

\tcolor: #990000;

}



.dark-on-light .destroyed {

\tcolor: #993333;

}



.dark-on-light .fa a {

color: white;

\tbackground: #404040;

}





.dark-on-light .icon-facebook a:hover {

background: #3B5998;

}



.dark-on-light .icon-twitter a:hover {

background: #55ACEE;

}



.dark-on-light .icon-home a:hover {

background: green;

}





.dark-on-light .skip-intro-link {

\tbackground-color: #FFF;

}



.dark-on-light .title-screen-patreon-button img {

\tbackground: #000;

\tpadding: 0.1em;

}



.dark-on-light .title-screen-patreon-button {

\topacity: 0.75;

}



.dark-on-light .title-screen-patreon-button:hover {

\topacity: 1.0;

}



.dark-on-light .end-game-patreon-button img {

\tbackground: #000;

\tpadding: 0.1em;

}



.dark-on-light .end-game-patreon-button {

\topacity: 0.75;

}



.dark-on-light .end-game-patreon-button:hover {

\topacity: 1.0;

}





.dark-on-light h1 {

\ttext-shadow: 0px 0px 50px #000;

}







.colourblind .good {

\tcolor: cyan;

}

<<if !$planet>>

\tThe wreck of the seedship drifts dead and inert in interstellar space.



<<else>>

\t<<if $hiscore.score_landing > 0>>

\t\t<<set _planet_name = $planet.name>>

\t<<else>>

\t\t<<set _planet_name = "The unnamed planet">>

\t<</if>>

\t/* Landscape */

\t<<if $planet.water == "Planet-wide ocean">>

\t\t<<switch $planet.gravity>>

\t\t\t<<case "Very low">>_planet_name's ocean tosses with slow, kilometres-high waves, beneath

\t\t\t<<case "Low">>_planet_name's ocean tosses with slow, tall waves, beneath

\t\t\t<<case "Moderate">>_planet_name's ocean stretches to the horizon

\t\t\t<<case "High">>_planet_name's calm ocean stretches to the horizon

\t\t\t<<case "Very high">>_planet_name's mirror-flat ocean beneath

\t\t\t<<default>>@@.error;Unexpected gravity value $gravity.@@

\t\t<</switch>>

\t<<elseif $planet.surface_features.includes("Plant life")

\t\t\t| $planet.surface_features.includes("Edible plants")

\t\t\t| $planet.surface_features.includes("Poisonous plants")>>

\t\t<<switch $planet.gravity>>

\t\t\t<<case "Very low">>_planet_name's impossibly slender alien plants reach kilometres into

\t\t\t<<case "Low">>_planet_name's tall alien plants reach hundreds of metres into

\t\t\t<<case "Moderate">>_planet_name's alien forests stretch away beneath

\t\t\t<<case "High">>_planet_name's squat, thick-limbed alien plants stretch away beneath

\t\t\t<<case "Very high">>_planet_name's level fields of alien moss stretch away beneath

\t\t\t<<default>>@@.error;Unexpected gravity value $gravity.@@

\t\t<</switch>>

\t<<elseif $planet.water == "Ice-covered surface">>

\t\t<<switch $planet.gravity>>

\t\t\t<<case "Very low">>

\t\t\t\t<<if $planet.name>>

\t\t\t\t\tKilometres-high spires of ice reach from _planet_name's ice sheet into

\t\t\t\t<<else>>

\t\t\t\t\tKilometres-high spires of ice reach from the unnamed planet's ice sheet into

\t\t\t\t<</if>>

\t\t\t<<case "Low">>

\t\t\t\t<<if $planet.name>>

\t\t\t\t\tTall, jagged spires of ice reach from _planet_name's ice sheet into

\t\t\t\t<<else>>

\t\t\t\t\tTall, jagged spires of ice reach from the unnamed planet's ice sheet into

\t\t\t\t<</if>>

\t\t\t<<case "Moderate">>_planet_name's landscape of jagged shards of ice stretches away beneath

\t\t\t<<case "High">>_planet_name's crumpled plain of ice stretches away beneath

\t\t\t<<case "Very high">>_planet_name's perfectly flat ice sheet stretches away beneath

\t\t\t<<default>>@@.error;Unexpected gravity value $gravity.@@

\t\t<</switch>>

\t<<elseif $planet.atmosphere == "None">>

\t\t<<switch $planet.gravity>>

\t\t\t<<case "Very low">>_planet_name's jagged landscape of high crater walls and towering shards of rock stretches away beneath

\t\t\t<<case "Low">>_planet_name's jagged, cratered landscape stretches away beneath

\t\t\t<<case "Moderate">>_planet_name's perfectly still, cratered landscape stretches away beneath

\t\t\t<<case "High">>_planet_name's perfectly still landscape, flat except for a few shallow craters, stretches away beneath

\t\t\t<<case "Very high">>_planet_name's perfectly still, flat landscape stretches away beneath

\t\t\t<<default>>@@.error;Unexpected gravity value $gravity.@@

\t\t<</switch>>

\t<<else>>

\t\t<<switch $planet.gravity>>

\t\t\t<<case "Very low">>_planet_name's landscape of spindly rock outcroppings and impossibly tall mountains stretches away beneath

\t\t\t<<case "Low">>_planet_name's landscape of huge boulders and towering mountains stretches away beneath

\t\t\t<<case "Moderate">>_planet_name's barren, rocky landscape stretches away beneath

\t\t\t<<case "High">>_planet_name's flat, rocky landscape stretches away beneath

\t\t\t<<case "Very high">>_planet_name's perfectly flat, barren landscape stretches away beneath

\t\t\t<<default>>@@.error;Unexpected gravity value $gravity.@@

\t\t<</switch>>

\t<</if>>



\t/* Sky */

\t<<switch $planet.atmosphere>>

\t\t<<case "Breathable">>

\t\t\ta blue sky.

\t\t<<case "Marginal">>

\t\t\ta pale blue sky.

\t\t<<case "None">>

\t\t\ta black, star-studded sky.

\t\t<<case "Non-breathable">>

\t\t\tan alien sky.

\t\t<<case "Toxic">>

\t\t\ta poisonous sky.

\t\t<<case "Corrosive">>

\t\t\ta sky filled with corrosive clouds.

\t\t<<default>>

\t\t\t@@.error;Unexpected atmosphere $planet.atmosphere@@

\t<</switch>>



\t/% Alien observation posts for the Reservation feature %/

\t<<if $planet.surface_features.includes("Alien observers")>>

\t\tAt night, the orbiting alien structures are visible as a glittering band across the stars.

\t<</if>>



\t<<if $hiscore.final_culture == -1>>

\t\t<<if $hiscore.summary == "Crash">>

\t\t\tThe fragments of the crashed seedship

\t\t<<else>>

\t\t\tThe ruins of the colony

\t\t<</if>>

\t\t

\t\t<<if $planet.water == "Planet-wide ocean">>

\t\t\tdecay at the bottom of the planet-wide ocean.

\t\t<<elseif $planet.water == "Ice-covered surface">>

\t\t\tlie embedded in the planet-wide ice sheet.

\t\t<<elseif $planet.surface_features.includes("Animal life")

\t\t\t\t| $planet.surface_features.includes("Useful animals")

\t\t\t\t| $planet.surface_features.includes("Dangerous animals")>>

\t\t\tare overgrown with alien plants and overrun by alien animals.

\t\t<<elseif $planet.surface_features.includes("Plant life")

\t\t\t\t| $planet.surface_features.includes("Edible plants")

\t\t\t\t| $planet.surface_features.includes("Poisonous plants")>>

\t\t\tare overgrown with alien plants.

\t\t<<else>>

\t\t\tlie on the rocky surface.

\t\t<</if>>

\t\t

\t\t<<if $hiscore.native_relations == 2>>

\t\t\tThe colonists' descendants live on as slaves to the intelligent natives, but they have lost all knowledge of Earth.

\t\t<<elseif $hiscore.native_relations == 0>>

\t\t\tNearby stand monuments built by the planet's native inhabitants to celebrate their victory over the invaders.

\t\t<<elseif $planet.surface_features.includes("Intelligent life")>>

\t\t\tThe planet's intelligent natives explore the ruins, but not enough remains for them to learn anything about the extinct human race.

\t\t<</if>>

\t\t

\t<<else>>

\t\tThe colonists live in

\t\t<<if $planet.surface_features.includes("Planet-spanning civilisation")>>

\t\t\ttheir own communities within the natives'

\t\t<</if>>





\t\t<<if $hiscore.final_tech_level > 2>>

\t\t\t<<switch $planet.gravity>>

\t\t\t\t<<case "Very low">>towering

\t\t\t\t<<case "Low">>tall

\t\t\t\t<<case "High">>squat

\t\t\t\t<<case "Very high">>low, sprawling

\t\t\t<</switch>>

\t\t<</if>>



\t\t<<switch $hiscore.final_tech_level>>

\t\t\t<<case 10>>\thigh-tech cities

\t\t\t<<case 9>>\tcities of steel and glass

\t\t\t<<case 8>>\tcities of steel and concrete

\t\t\t<<case 7>>\tsmog-filled Industrial cities

\t\t\t<<case 6 5 4 3>>stone-walled cities

\t\t\t<<case 2>>\tfarming villages

\t\t\t<<case 1 0>>wandering hunter-gatherer tribes

\t\t\t<<default>>@@.error;Unexpected final tech level $hiscore.final_tech_level@@

\t\t<</switch>>



\t\t<<if $planet.atmosphere == "Breathable"

\t\t\t\t& $planet.temperature == "Moderate">>

\t\t\tbeneath the planet's open sky,

\t\t<<elseif ($planet.atmosphere == "Breathable" | $planet.atmosphere == "Marginal")

\t\t\t\t& ($planet.temperature == "Cold" | $planet.temperature == "Moderate" | $planet.temperature == "Hot")>>

\t\t\twith buildings sealed against the planet's harsh environment,

\t\t<<elseif $planet.surface_features.includes("Airtight caves") | $planet.surface_features.includes("Insulated caves") >>

\t\t\tinside airtight caves,

\t\t<<else>>

\t\t\tunder airtight domes,

\t\t<</if>>



\t\t<<switch $planet.water>>

\t\t\t<<case "Planet-wide ocean">>

\t\t\t\ton platforms floating on the planet-wide ocean.

\t\t\t<<case "Ice-covered surface">>

\t\t\t\ton top of the planet-wide ice sheet.

\t\t\t<<case "None" "Trace">>

\t\t\t\tgathered around water production plants.

\t\t\t<<case "Ice caps">>

\t\t\t\tby lakes of water melted from the planet's ice caps.

\t\t\t<<case "Oceans">>

\t\t\t\tbeside rivers that flow into the planet's oceans.

\t\t\t<<default>>

\t\t\t\t@@.error;Unexpected water value $planet.water@@

\t\t<</switch>>



\t\t<<switch constants.culture_names[$hiscore.final_culture]>>

\t\t\t<<case "Cosmic Enlightenment">>

\t\t\t\tThey live lives of peace and spiritual fulfilment beyond the dreams of their ancestors on Earth, guided by a combination of human and alien philosophy.



\t\t\t<<case "Post-Scarcity Utopia">>

\t\t\t\tThey spend their time pursuing art, leisure, and spiritual fulfilment, while automatic machines take care of their material needs.

\t\t\t<<case "Engaged Democracy">>

\t\t\t\tThey live happy and fulfilled lives under the guidance of selfless elected officials.

\t\t\t<<case "Corrupt Democracy">>

\t\t\t\tPoverty, exploitation and crime are rife, and the corrupt elected government does little to alleviate them.

\t\t\t<<case "Rule by Corporations">>

\t\t\t\tThe cities are dominated by the headquarters of wealthy corporations that rule the population for their owners' enrichment.

\t\t\t<<case "Dystopian Police State">>

\t\t\t\tThe streets are filled with security cameras and patrolled by armed police who violently put down any hint of dissent.

\t\t\t<<case "Warring Superpowers">>

\t\t\t\tThe cities are surrounded by military bases and nuclear missile silos, and the population lives in fear of both the other nations' armies and their own nation's secret police.

\t\t\t<<case "Post-Nuclear Wasteland">>

\t\t\t\tThe cities are in ruins, and the survivors of the nuclear war survive as best they can in the wreckage of human civilisation.



\t\t\t<<case "Egalitarian Republic">>

\t\t\t\tThe cities are built around parliament buildings, where assemblies of citizens rule for the good of all.

\t\t\t<<case "Benevolent Monarchy">>

\t\t\t\tThe cities are built around royal palaces, from which beloved monarchs rule the population wisely.

\t\t\t<<case "Oppressive Theocracy">>

\t\t\t\tThe cities are dominated by temples to the state religion which controls every aspect of people's lives.

\t\t\t<<case "Slave-Based Empire">>

\t\t\t\tThe cities are dominated by the palaces of the emperors, who live in luxury while the population toils to support them.

\t\t\t<<case "Warring States">>

\t\t\t\tThe cities are dominated by barracks housing their vast armies, which regularly attack other cities.



\t\t\t<<case "Collective Rule">>

\t\t\t\tThe tribes are ruled collectively by their members, and each member is afforded equal status.

\t\t\t<<case "Benevolent Chieftains">>

\t\t\t\tEach tribe is ruled by a chieftain, who guides the people as wisely as he or she is able.

\t\t\t<<case "Brutal Chieftains">>

\t\t\t\tEach tribe lives in fear of its brutal chieftain.

\t\t\t<<case "Warring Tribes">>

\t\t\t\tMuch of the tribes' resources are devoted to fighting continual wars with one another.

\t\t\t<<case "Savagery">>

\t\t\t\tThe people live like animals, having forgotten almost all of their language and culture.

\t\t\t<<default>>

\t\t\t\t@@.error;Unexpected final culture $hiscore.final_culture@@

\t\t<</switch>>



\t\t<<switch constants.native_relations_names[$hiscore.native_relations]>>

\t\t\t<<case "Immigrants, Earth remembered">>

\t\t\t\tThe humans live as immigrants inside the alien society, with a strong memory of Earth's cultural heritage that enhances the native culture.

\t\t\t<<case "Immigrants, Earth forgotten">>

\t\t\t\tThe humans live as immigrants inside the alien society, and have forgotten most of the cultural heritage of Earth.

\t\t\t\t

\t\t\t<<case "Integrated Societies">>

\t\t\t\tMany of the planet's native inhabitants live in the human communities, and the colonists' culture has been enriched by alien influences.

\t\t\t<<case "Friendly">>

\t\t\t\tTraders and diplomats from the planet's native nations are occasionally seen in the colonists' communities.

\t\t\t<<case "Isolationism">>

\t\t\t\tThe colonists' culture mostly ignores the native inhabitants, who live in their own communities in other parts of the planet.

\t\t\t<<case "Natives Enslaved">>

\t\t\t\tMuch of the labour in human communities is performed by a downtrodden alien slave caste that is all that remains of the planet's native civilisation.

\t\t\t<<case "Genocide of Natives">>

\t\t\t\tRuins and mass graves are all that remains of the planet's native civilisation.

\t\t<</switch>>



\t\t

\t\t<<if $planet.surface_features.includes("Planet-spanning civilisation")>>

\t\t\tAt the seedship's landing site

\t\t<<else>>

\t\t\tIn the

\t\t\t<<if constants.culture_names[$hiscore.final_culture] == "Post-Nuclear Wasteland" | $hiscore.final_tech_level < 2>>

\t\t\t\truins of the

\t\t\t<</if>>

\t\t\tfirst city

\t\t<</if>>

\t\t<<set _journey_deaths = (constants.max_colonists+$hiscore.score_extra_colonists)-$hiscore.score_landing>>

\t\t<<set _construction_deaths = $hiscore.score_landing-$hiscore.score_construction>>

\t\t<<if _journey_deaths > 0 & _construction_deaths > 0>>

\t\t\tstand monuments to the _journey_deaths colonists who did not survive the journey,

\t\t\tthe _construction_deaths more who died building the first settlement, and

\t\t<<elseif _journey_deaths > 0>>

\t\t\tstand monuments to the _journey_deaths colonists who did not survive the journey and

\t\t<<elseif _construction_deaths > 0>>

\t\t\tstand monuments to the _construction_deaths colonists who died building the first settlement and

\t\t<<else>>

\t\t\tstands a monument to

\t\t<</if>>

\t\tthe seedship AI that guided humanity to its new home.

\t<</if>>

<</if>>









John Ayliff

window.getHiscoreShareText = function(hiscore) {

\tvar planet = hiscore.planet;



\tif ( !planet) {

\t\treturn "Destroyed in space.";

\t} else if ( hiscore.score_landing <= 0) {

\t\treturn "Crash!";

\t} else if ( hiscore.score_construction <= 0) {

\t\treturn "Construction failure on planet " + planet.name + ".";

\t} else if ( hiscore.final_tech_level == -1) {

\t\treturn "Long-term technological failure on planet " + planet.name + ".";

\t} else if ( hiscore.native_relations == 2) {

\t\treturn "Enslaved by the natives of planet " + planet.name + ".";

\t} else if ( hiscore.native_relations == 0) {

\t\treturn "Wiped out by the natives of planet " + planet.name + ".";

\t} else {

\t\tswitch ( constants.culture_names[hiscore.final_culture])

\t\t{

\t\t\tcase "Cosmic Enlightenment":

\t\t\t\treturn "Cosmically enlightened " + constants.tech_level_names[hiscore.final_tech_level] + " civilisation on planet " + planet.name + "."; break;



\t\t\tcase "Post-Scarcity Utopia":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " post-scarcity utopia on planet " + planet.name + "."; break;

\t\t\tcase "Engaged Democracy":

\t\t\t\treturn "Engaged " + constants.tech_level_names[hiscore.final_tech_level] + " democracy on planet " + planet.name + "."; break;

\t\t\tcase "Corrupt Democracy":

\t\t\t\treturn "Corrupt " + constants.tech_level_names[hiscore.final_tech_level] + " democracy on planet " + planet.name + "."; break;; break;

\t\t\tcase "Rule by Corporations":

\t\t\t\treturn "Ruled by " + constants.tech_level_names[hiscore.final_tech_level] + " corporations on planet " + planet.name + "."; break;

\t\t\tcase "Dystopian Police State":

\t\t\t\treturn "Dystopian " + constants.tech_level_names[hiscore.final_tech_level] + " police state on planet " + planet.name + "."; break;

\t\t\tcase "Warring Superpowers":

\t\t\t\treturn "Warring " + constants.tech_level_names[hiscore.final_tech_level] + " superpowers on planet " + planet.name + "."; break;

\t\t\tcase "Post-Nuclear Wasteland":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " civilisation destroyed by nuclear war on planet " + planet.name + "."; break;



\t\t\tcase "Egalitarian Republic":

\t\t\t\treturn "Egalitarian " + constants.tech_level_names[hiscore.final_tech_level] + " republic on planet " + planet.name + "."; break;

\t\t\tcase "Benevolent Monarchy":

\t\t\t\treturn "Benevolent " + constants.tech_level_names[hiscore.final_tech_level] + " monarchy on planet " + planet.name + "."; break;

\t\t\tcase "Oppressive Theocracy":

\t\t\t\treturn "Oppressive " + constants.tech_level_names[hiscore.final_tech_level] + " theocracy on planet " + planet.name + "."; break;

\t\t\tcase "Slave-Based Empire":

\t\t\t\treturn "Slave-based " + constants.tech_level_names[hiscore.final_tech_level] + " empire on planet " + planet.name + "."; break;

\t\t\tcase "Warring States":

\t\t\t\treturn "Warring " + constants.tech_level_names[hiscore.final_tech_level] + " states on planet " + planet.name + "."; break;



\t\t\tcase "Collective Rule":

\t\t\t\treturn "Communal " + constants.tech_level_names[hiscore.final_tech_level] + " tribes on planet " + planet.name + "."; break;

\t\t\tcase "Benevolent Chieftains":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " tribes ruled by benevolent chieftains on planet " + planet.name + "."; break;

\t\t\tcase "Brutal Chieftains":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " tribes ruled by brutal chieftains on planet " + planet.name + "."; break;

\t\t\tcase "Warring Tribes":

\t\t\t\treturn "Warring " + constants.tech_level_names[hiscore.final_tech_level] + " tribes on planet " + planet.name + "."; break;

\t\t\tcase "Savagery":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst + " savagery on planet " + planet.name + "."; break;

\t\t\tdefault:

\t\t\t\treturn "ERROR: Unexpected values culture:" + hiscore.final_culture + ", tech: " + hiscore.final_tech_level;

\t\t}

\t}



}



Seedship Mission Report

window.getHiscoreSummary = function(hiscore) {

\tvar planet = hiscore.planet;



\tif ( !planet) {

\t\treturn "Destroyed in space";

\t} else if ( hiscore.score_landing <= 0) {

\t\treturn "Crash";

\t} else if ( hiscore.score_construction <= 0) {

\t\treturn "Construction Failure";

\t} else if ( hiscore.final_tech_level == -1) {

\t\treturn "Long-term Technological Failure";

\t} else if ( hiscore.native_relations == 2) {

\t\treturn "Enslaved by Natives";

\t} else if ( hiscore.native_relations == 0) {

\t\treturn "Killed by Natives";

\t} else {

\t\tswitch ( constants.culture_names[hiscore.final_culture])

\t\t{

\t\t\tcase "Cosmic Enlightenment":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " Cosmic Enlightenment"; break;



\t\t\tcase "Post-Scarcity Utopia":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " Post-Scarcity Utopia"; break;

\t\t\tcase "Engaged Democracy":

\t\t\t\treturn "Engaged " + constants.tech_level_names[hiscore.final_tech_level] + " Democracy"; break;

\t\t\tcase "Corrupt Democracy":

\t\t\t\treturn "Corrupt " + constants.tech_level_names[hiscore.final_tech_level] + " Democracy"; break;

\t\t\tcase "Rule by Corporations":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " Corporate Rule"; break;

\t\t\tcase "Dystopian Police State":

\t\t\t\treturn "Dystopian " + constants.tech_level_names[hiscore.final_tech_level] + " Police State"; break;

\t\t\tcase "Warring Superpowers":

\t\t\t\treturn "Warring " + constants.tech_level_names[hiscore.final_tech_level] + " Superpowers"; break;

\t\t\tcase "Post-Nuclear Wasteland":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " Post-Nuclear Wasteland"; break;



\t\t\tcase "Egalitarian Republic":

\t\t\t\treturn "Egalitarian " + constants.tech_level_names[hiscore.final_tech_level] + " Republic"; break;

\t\t\tcase "Benevolent Monarchy":

\t\t\t\treturn "Benevolent " + constants.tech_level_names[hiscore.final_tech_level] + " Monarchy"; break;

\t\t\tcase "Oppressive Theocracy":

\t\t\t\treturn "Oppressive " + constants.tech_level_names[hiscore.final_tech_level] + " Theocracy"; break;

\t\t\tcase "Slave-Based Empire":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " Slave Empire"; break;

\t\t\tcase "Warring States":

\t\t\t\treturn "Warring " + constants.tech_level_names[hiscore.final_tech_level] + " States"; break;



\t\t\tcase "Collective Rule":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " Collective Rule"; break;

\t\t\tcase "Benevolent Chieftains":

\t\t\t\treturn "Benevolent " + constants.tech_level_names[hiscore.final_tech_level] + " Chieftains"; break;

\t\t\tcase "Brutal Chieftains":

\t\t\t\treturn "Brutal " + constants.tech_level_names[hiscore.final_tech_level] + " Chieftains"; break;

\t\t\tcase "Warring Tribes":

\t\t\t\treturn "Warring " + constants.tech_level_names[hiscore.final_tech_level] + " Tribes"; break;

\t\t\tcase "Savagery":

\t\t\t\treturn constants.tech_level_names[hiscore.final_tech_level].toUpperFirst() + " Savagery"; break;

\t\t\tdefault:

\t\t\t\treturn "ERROR: Unexpected values culture:" + hiscore.final_culture + ", tech: " + hiscore.final_tech_level;

\t\t}

\t}



}

