Back to Index Page generated: May 8, 2024, 6:16:03 AM

Expansion Life In The Frontier

Content

Warnings

  1. No version in dependency reference to oolite.oxp.Norby.HDBG:null
  2. Optional Expansions mismatch between OXP Manifest and Expansion Manager at character position 0055 (DIGIT ZERO vs LATIN SMALL LETTER N)

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Roleplaying environment on space stations: go for a walk and get a casual event, that could bring an advantage or a risk, a reward or a trouble. Roleplaying environment on space stations: go for a walk and get a casual event, that could bring an advantage or a risk, a reward or a trouble.
Identifier oolite.oxp.BeeTLeBeTHLeHeM.LifeInTheFrontier oolite.oxp.BeeTLeBeTHLeHeM.LifeInTheFrontier
Title Life In The Frontier Life In The Frontier
Category Activities Activities
Author BeeTLe BeTHLeHeM, Norby BeeTLe BeTHLeHeM, Norby
Version 0.7.3 0.7.3
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
  • oolite.oxp.Norby.HDBG:0
  • oolite.oxp.Norby.HDBG:
  • Conflict Expansions
    Information URL http://wiki.alioth.net/index.php/Life_in_the_Frontier n/a
    Download URL https://wiki.alioth.net/img_auth.php/8/89/Life_In_The_Frontier_0.7.3.oxz n/a
    License CC BY-NC-SA 4 CC BY-NC-SA 4
    File Size n/a
    Upload date 1610873355

    Documentation

    Also read http://wiki.alioth.net/index.php/Life%20In%20The%20Frontier

    LifeInTheFrontier_readme.txt

    DESCRIPTION:
    
    Players roleplay their game session, depending on the career they choose, and the events in-flight. Space station, on the contrary, are still rather static (without considering OXP) and act more like a transition between two flights.
    So I thought to help stations offering more variety, giving the player the chance to fire a random event while he is docked, an event that could requires a player choice and that can have effects (good and bad) on the player properties.
    
    HOW IT WORKS:
    
    When the player is docked to a station, he will find in the F4 screen a new item, "Take a look around on the station" (mainly placeholder text). If he select this item, the OXP will choose a random event from a list, and the player will have to confront it. Some events will be only description of something that happens in the vicinity of the player, while others will require choices and decisions, and usually they will have multiple resolutions.
    The events are categorized depending on various factors: the system government, economy and TL, plus one "generic" category for events that can happen anywhere. Instead the specific categories are intended to create a precise atmosphere, so in dictatorial systems there will be a more oppressive feeling, and in low tech worlds it will possible to see more malfunctioning in systems.
    Every category has a defined background - I have taken shots from corridors in old sci-fi movies but I don't know if I can use them, so in case I will remove them. For now consider them as placeholders.
    The resolution of an event can include: variation in money, in bounty level, in ship fuel or cargo goods. In these case will be displayed a report screen showing what is changed.
    Sometimes an event to happen will require a check on one of that properties, for example to avoid that the player loses more money than he actually has.
    The player can fire an event for docking, to fire another event he will need to leave and dock to another (or the same) station - in this way the mechanic shouldn't be abused.
    
    CHANGELOG:
    
    0.7.3
    -Disembark is possible after load game in additional stations.
    -Fixed step back from life status screen in non-galcop stations.
    -Fixed mission.screenID error message in non-galcop stations.
    
    0.7.2
    - Fixed bounty clearing at galcop terminal (by Norby).
    - Non-galcop stations are limited to the hangar.
    - HD Backgrounds OXP is used in life status screen and non-galcop hangar.
    - Able to use hd background images made in any resolution (fit to height).
    
    0.7.1
    - Fixed action on Museum exit.
    
    0.7
    - Completed STORAGE, special location on Docks with restricted access: 25 credits or legal stance <= -25 (friendly with criminals)
    - Placed PASSENGERS LOUNGE, special location on Concourse-A
    - Placed CHURCH OF THE COSMIC WANDERER, special location on Concourse-B
    - Placed BOOKSHOP, special location on Concourse-B
    - Placed MUSEUM, special location on Delight Avenue
    - Placed FIT CENTER, special location on Olympian Square
    - Implemented Station Map, visible from every lobby
    - Commander stats and OXP flags are stored as a map (string with format name1=value1,name2=value2,name3=value3...) instead of an array. This should definitely fix every issue with loading and saving data.
    - Placed BRIEFING ROOM, special location on Galcop Precinct.
    - Placed DETAINMENT ZONE, special location on Galcop Precinct.
    - Placed SOCIAL SERVICES, special location on Galcop Precinct.
    - Placed PILOT COURSE ROOM, special location on Galcop Precinct.
    
    - Implemented SOCIAL SERVICES mechanics:
    	* Player can spend 4 hours doing social services. His reputation will increase of a small amount. His bounty will decrease of an amount. There's a chance of getting hurt during the work. In this case the time spent and bounty decrease are reduced.
    
    - Implemented FIT CENTER mechanics:
    	* The first time the commander visits a Fit Center, he must buy an Universal Fitness Badge for 15cr. This purchase include a month subscription.
    	* The subscription can be renewed monthly for 10cr.
    	* Commander mustn't be wounded or sick to enter the gym.
    	* Every gym session increase commander strength.
    	* If commander exercise more than once in two days, a chance of getting wounded while exercising increase.
    	* If the commander get wounded, he'll must get healed before starting a new gym session.
    	* If the commander get wounded, the maximum strength cap get lowered of a small amount. If this amount get very low (it requires a lot of accidents, though...) the commander can't access the gym anymore until he get a recovering therapy from an hi-tech Medical Center.
    	* If the commander doesn't go to the gym for more than a week, strength will lower of a small amount after every dock.
    	* If commander can't access the gym because he has endured too much damage, he can go to a hi-tech system Medical Center and get into a Recovery Therapy for 400cr. This therapy is available only when the player has sustained a lot of damage (only in the gym for now).
    	* The status screen (access from the hangar) report the Universal Fitness expiration status, when the player buys it.
    
    0.6.1
    - Fixed corridor background name - this should avoid log warning messages about texture files not found.
    - Fixed paytreatment action, MedCenter treatment should give no exception now.
    - Deleted useless number from OXP versioning - better late then never. (Current model: MajorVersion.MinorVersion.Fix)
    
    0.1.6 (0.6)
    - When accessing the OXP from the F4 screen, the player goes directly to the Hangar.
    - The player can display the Commander Status screen from the Hangar.
    - Station layout updated following forum discussion on the current design.
    - Changed some definitions for station locations.
    - Lobby indications are more schematic.
    - The Storage location has been promoted to special location.
    - Implemented Hotel, moved location to Main Concourse-A because Delight Avenue has already 3 planned locations.
    - Implemented the Wild Worlds Virtual Tour, on the Delight Avenue (Recreation Bridge).
    
    0.1.5.1 (0.5.1)
    - Fixed check on the variables introduced in 0.1.5.
    - Fixed check on varStore array items before setting values.
    
    0.1.5 (0.5)
    - Added background to Docks Area;
    - Add text snippet for drunken status (along with wounds and sickness);
    - Implemented event-checks for "government", "tech" and "economy". The government check can take a list of governments, separated by "-" character. If the system government is in the list, the check is valid;
    - Added events: ROBO-BARD, HUNTERS, DELIRIOUS DROID, COMMERCIAL DROID, SUPERCELEBRITY, LIGHTS MALFUNCTION, WATER MALFUNCTION, AIR MALFUNCTION, DEFACING KIDS
    - "her/him/his" not capitalized anymore;
    - Commander stats are saved as a string with comma-separated values rather than 5 missionVariables.
    - Game flags are saved as a string with comma-separated values rather than 8 missionVariables.
    - Variables still not used aren't loaded anymore from the savegame, and are saved with null values to purge them from the file.
    - Refactored method for checks on event/choice requirements: it's now possible to interrogate a parameter with operators =, !=, <, <=, >, >=. The requirement syntax changes. E.g.: no more credits:500, but credits=500, or credits<500 etc.
    - Event text can be present as parameter "text" (static text, always displayed) *OR* as indexed parameters (text0, text1, text2): in the latter case, it's possible to specify display conditions, with syntax "condition|text to display". If an indexed text has no condition is considered static (always displayed). The validated indexed text are concatenated.
    - Event property "choiceRequires" has been removed. It has been replaced by "r"(+ choice index), that contains the facultative requirements for the single choice. If a choice has no requirements (no "r" property), the choice is always displayed.
    - I believe I have removed the end-event resume screen at least one release ago, forgot to write it down.
    - To avoid confusion, in the event properties requires and r I don't use the ':' char as separator anymore, but the equal sign '='.
    - Refactored action executions when player select an event or a location choice. There are some differences in some actions, so I had to differentitate: go (random event) and goNav (navigation), end (random event) and endNav (navigation).
    - Implemented condition if to the events action. Now it's possible to define a condition (or multiple conditions, comma-separated), and to link it to two results: the "valid condition" and the "else". I'm going to read again the various random events to introduce conditions when necessary, to streamline the event flow. Syntax is: if:<conditions>?<actions>;<elseActions>
    - I've lost some features (the hotel, the wild world virtual tour and the new Medical Center text), so I'll have to rethink them in the next days. Actually I have changed the Medicla Center concept, so the options are always displayed but if the player isn't sick or wounded or drunk the receptionist will refuse to start the treatment.
    - Fixed: the Galcop terminal didn't show the price for cleaning the criminal record.
    - The DEFACING KIDS event can enable a flag - eventually the consequence will be shown when the player reach the docks area.
    
    0.1.4 (0.4)
    - Code optimization and refactoring. Creation of new js files for common methods, for mission-related methods, and for inside-station navigation methods.
    - Restarted from scratch (taking the old code piece for piece).
    - The F4 link shows a literal resume of the player. From this screen, the player can "disembark" from the ship and wander into the space station.
    - "Tubes Stop" locations allow player to move across five different levels. Every level has a theme and several inner locations. The levels are to be intended as concentric.
    - Events are not fired by player anymore. But moving into the station there is a 20% chance (not definitive) of firing a random event. They act like an intermission, basically.
    - Added random snippet (from a list of 20) of texts when at a Tube Stop.
    
    - Added all the events already implemented in 0.1.3 (beside the bar ones)
    - Added the bar events: the gossip option has been moved to the "talk with bartender one". Bartender doesn't give hints about contractors anymore.
    - It's possible to clean own criminal record at the Galcop termminal (in the Galcop precinct) paying a fine of (500cr x current bounty).
    - Added the Art Gallery and the art genre random generator.
    - Added the Opera House and the music genre random generator.
    - Added the Cinema Hall and the movie genre random generator.
    - If player is wounded or sick, randomly add short descriptive snippet of text while moving around the station.
    - Added a short single-row-status text to show on top of the locations screens.
    - Added two backgrounds for the "Tubes".
    - Changed "Tube Stop" to "Lift Station", and "Tubes" to "Lift". The direction is relative, it's not necessary an up-down transport.
    
    - The property background can contain more background file names separated by comma: the OXP will choose a random background between those specified.
    - Added some more backgrounds, I'm trying to add variety and get an "identity" for the various levels.
    - Added medical center location: here the player can cure wounds and sickness for a price. Price and amount of cure changes in relation to system tech level. The medical center can also rid of drunken status for free, but with a chance for a slight sickness.
    
    - Added health/sickness management, with the following rules being checked every time the player docks to a station:
    1) if sickness > 1, chance 10% of worsening (sickness +1);
    2) if sickness = 1, chance 10% of healing (sickness = 0);
    3) if health > 1, chance 10% of worsening (health + 1);
    4) if health = 1, chance 10% of healing (health = 0);
    5) if health > 2 and sickness < 2, chance 10% of infection (sickness +1);
    6) if health > 2 or sickness > 2, chance 10% of physical shape reduction
    - If player has health or sickness in critical conditions (>= 5), has a 50% of pass-out. In this case he will be automatically transported to the station Medical Center and cured (with system TL limitations). Player will receive a decrease in reputation (for careless behaviour) and the price of the opeation will be automatically withdrawn from his account - if he has't enough money his bounty will be slightly increased (for debt insolvency).
    
    0.1.3 (0.3)
    - implemented a time variable for events. It's now possible to define how much time will be spent when executing an event. Instead of creating a separate property, the variabile is set in the "end:x" command, where x is the time spent in seconds. So "end:600" means "terminate the event and go forward 10 minutes in time". Use "end:0" to avoid spending game-time;
    - As a general rule for numeric command parameters, two values comma-separated will be interpreted as a range, and a random number between the specified values will be extracted. This applies even to the time variable above;
    - Added a new resolution to the "elixir peddler" event, that use the time variable above;
    
    - implemented the constants $SPECIES_S$ (singular) and $SPECIES_P$ (plural), that set a random species if requested by the event text. The species value remain fixed until the end of the event;
    - implemented the constants $GENDERSUBJ$ (he/she), $GENDEROBJ$ (him/her), $GENDERPOSS$ (his/her). The random chosen gender remain fixed untile the end of the event. The gender-values are correlated to maintain coherence throughout the text;
    - fixed the text of all the events implemented until now;
    - added five "no-events";
    
    - added a new script file (LITF_RPGElements.js) to keep together the RPG-lite functions;
    - changed the F4 link in "Visit the station hub": it show a main screen with player current RPG-lite status (reputation, health, sickness, strength), the link to the random event and something more...;
    - added description for all the status variables;
    - added arrays of "minor" cargo types to be inserted in missions text: these aren't new cargo types, they will only be treated as random labels to differentiate the text depending on player reputation;
    
    - The link on the F4 page has been changed to "Visit the station hub" and if selected shows the "main screen";
    - The "main screen" displays the player status (a literal description for the LITF variables);
    - Added variables: reputation, health (wounds, bruises etc.), sickness, strength (physical shape);
    - Added variable: stance. Positive stance = the law; negative stance = the criminals. Similar to reputation, but to be considered more like "word on the street is"; 
    - Available choices for the "main screen";
    	* "Take a walk to the Main Concourse". This fire a random event, as before;
    
    - The player won't find the locations (bar, fit center, church, med center) on every system. I wrote a basic rule to distribute their presence in the galaxy. The rule is mathematical and based on the system ID, so the final results are fixed - for now only the bar is enabled;
    - Re-edited the implemented events to use the variables in effects and requirements;
    - Added constant $LIQUORS$ (with an array of 20 liquor random names), $SYSTEM$ (get random system name), $COMMODITY$ (get random vanilla commodity name), $GOSSIP$ (get a random gossip), $NAME$ (for random NPC name), $MINORCARGO$ (for transport missions);
    - Added flag management (not mission flags), checks and manipulation;
    - Added command "time:x", if you don't want to end the events but only to spend time;
    
    - Implemented first version mission generation. It works in two steps. First step: an NPC (in this case, the bartender) tells the player that another NPC has a job available: I store data about the NPC name, the system where he is, the type of mission and a generous time limite to reach him. When the player docks to a station I check if it's the right station and if the NPC hasn't expired: if everything's good, when the player enter the main concourse I switch to an alternate event: meeting the NPC, that introduce the job (a cargo transport), with a destination, a time limit and a type of "minor cargo" (see above). If the player accepts, I use this data to generate a real mission.
    - Removed sickness effect when getting drunk, it's counter-productive. When I'll implement medical centers, player have the chance to pay to get sober.For now he can leave the station and dock to another station to rid of the drunkenness.
    
    - Modified the cargo mission management: I don't use specialCargo or awardContract, but the OXP do the checks and display the page for completing a contract (always from the Main Concourse). It's not definitive, but it seems to work.
    - Added events: CHARMING PARTNER, MUGGING, THE LOST DRUNKARD, MEDICAL CAMP
    
    0.1.2 (0.2)
    - enabled the one-event-for-dock flag (it was disabled for showing various events without leaving a station).
    - changed the event management, I moved the events data from missionscript.plist to LITF_ActionsCatalog.js (renamed in LITF_EventsCatalog.js). In this way I can group everything related to an event in one object (text, requirements, choices and actions), and eventually I can make them more dynamic;
    - renamed property "check" (property-checks that allow the event to happens) in "requires";
    - added property "choiceRequires", contains pipe-concatenated string with checks for every event choice (see check property list) for selecting choices to display under particular circumstances; use "valid:1" for always display a choice, and "valid:0" to always hide it;
    - added events:
    	GENERIC: charity
    	GENERIC: alien discussion
    - implemented code for replace constants in event/choice text with a random element from a related array: actually used in the charity event, constant $CHARITY$.
    
    0.1.1 (0.1)
    - events category list:
    	"generic" category
    	station allegiance (disabled)
    	system government (gov_0 - gov_7)
    	system tech level (ltech, htech), values 5-9 are converted to "generic"
    	system economy (ind, agri), values 3-4 are converted to "generic"
    	OXP choose a value from an array with the values [ generic, gov_x, tl_x, eco_x]
    	Maybe in the future I could add as new categories ranges for player rank or player bounty
    - specific background picture depending on event category: system government, tech level (low tech, high tech) and economy (industrial, agricolture). "Generic" events will show the related system government background;
    - event one-click for docking disabled for testing and showing OXP workings;
    - passing time for events temporarily disabled: to be reintroduced it as an event property;
    - event effects list:
    	mt_[name]:[value] add [value] to the player ship manifest good identified by [name]. 
    	bounty:[value] add [value] to the current player bounty.
    	fuel:[value] add [value] to the current player ship fuel amount.
    	credits[value] add [value] to the current player credits.
    	go:[label] fire the event identified by [label]
    	end:0 end the event
    	[value] can be positive or negative. There are checks to avoid negative results or values exceeding cargo space.
    - check property list:
    	mt[name]:[value] check for player ship manifest good identified by [name] >= [value]
    	mt<[name]:[value] check for player ship manifest good identified by [name] < [value]
    	fuel:[value] check for player ship fuel amount >= [value]
    	fuel<:[value] check for player ship fuel amount < [value]
    	bounty:[value] check for current player bounty >= [value]
    	bounty<:[value] check for current player bounty < [value]
    	credits:[value] check for current player credits >= [value]
    	credits<:[value] check for current player credits < [value]
    - added events:
    	GENERIC: beggar
    	GENERIC: weird password guy
    	GENERIC: fire
    	GENERIC: fire + gossip
    	GENERIC: shady seller
    	GENERIC: partygoers
    	GENERIC: running fugitive
    	GENERIC: thief
    	GENERIC: stranded crew (2 variants)
    
    LICENSE:
    This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License version 4.0.
    If you are re-using any piece of this OXP, please let me know by sending an e-mail to norbylite@gmail.com.
    Author: BeeTLe BeTHLeHeM
    

    Equipment

    This expansion declares no equipment. This may be related to warnings.

    Ships

    This expansion declares no ships. This may be related to warnings.

    Models

    This expansion declares no models. This may be related to warnings.

    Scripts

    Path
    Scripts/LITF_Common.js
    "use strict";
    
    this.name	= "LITF_Common";
    this.author	= "BeeTLe BeTHLeHeM";
    this.copyright	= "2015 BeeTLe BeTHLeHeM";
    this.description= "Life in the Frontier - Common";
    this.licence	= "CC BY-NC-SA 4.0";
    
    ///////////////////////////////////////
    
    this.$bountyFine = function() {
    	return( player.bounty * 500 );
    };
    
    
    this.$log = function(msg) {
    	if (worldScripts.LITF.LITF_logger == 1) {
    		log(this.name, msg);
    	}
    };
    
    
    this.$formatNumber = function(number) {
    	var numStr = number.toString();
    	var numFormat = "";
    
    	if (numStr.indexOf('.') > -1) {
    		var length = numStr.length;
    		var dot = numStr.indexOf('.');
    
    		if (length - dot > 3) {
    			numFormat = numStr.substring(0, dot + 3);
    		} else {
    			numFormat = numStr;
    		}
    	} else {
    		numFormat = numStr;
    	}
    
    	return numFormat;
    };
    
    
    this.$replaceAll = function(find, replace, str) {
      return str.split(find).join(replace);
    };
    
    
    this.$extractChoices = function(pData) {
    	var choiceCounter = 1;
    	var valid = 1;
    
    	var placeChoiceList = {};
    
    	//var choiceRequirements = pData.choiceRequires;
    	//this.$log("[extractChoices] choiceRequirements = " + choiceRequirements);
    
    	while (valid == 1) {
    		//var cl = "c" + choiceCounter;
    		var placeChoice = eval("pData.c" + choiceCounter + ";");
    
    		if (placeChoice) {
    			placeChoice = this.$replaceConstants(placeChoice);
    
                var vChoice = 0;
                var choiceReq = eval("pData.r" + choiceCounter + ";");
                if (choiceReq) {
                    //var vChoice = this.$validateRequirements(choiceRequirements, choiceCounter - 1);
                    vChoice = this.$validateRequirements(choiceReq);
                } else {
                    // No requirements - always valid
                    vChoice = 1;
                }
    
    			this.$log("[extractChoices] c" + choiceCounter + " = " + placeChoice + " :: vChoice = " + vChoice);
    
    			if (vChoice == 1) {
    				eval("placeChoiceList[\"c" + choiceCounter + "\"] = \"" + placeChoice + "\";");
    			}
    			choiceCounter++;
    		} else {
    			valid = 0;
    		}
    	}
    
    	return placeChoiceList;
    };
    
    
    //this.$validateRequirements = function(requirements, choiceIdx) {
    this.$validateRequirements = function(choiceReq) {
    	//if (requirements) {
    		//var reqSplit = requirements.split("|");
    		//this.$log("[validateChoice] require = " + reqSplit[choiceIdx]);
    
    		//var LITF_items = reqSplit[choiceIdx].split(",");
            var LITF_items = choiceReq.split(",");
    
    		for (var i = 0; i < LITF_items.length; i++) {
    			//var reqChoice = LITF_items[i].split(":");
    			//var validate = this.$checkRequirements(reqChoice);
                var validate = this.$checkRequirements(LITF_items[i]);
    
    			//this.$log("[validateChoice] " + reqChoice[0] + " : " + reqChoice[1] + " = " + validate);
                this.$log("[validateChoice] " + LITF_items[i] + " = " + validate);
    
    			if (validate == 0) { 
    				return 0; 
    			}
    		}
    	//}
    	
    	return 1;
    };
    
    
    this.$readNumericParameter = function(param) {
    	var value = 0;
    					
    	if (param.indexOf(",") == -1) {
    		value = parseInt(param);
    	} else {
    		var _paramSplit = param.split(",");
    
    		var minValue = parseInt(_paramSplit[0]);
    		var maxValue = parseInt(_paramSplit[1]);
    
    		value = this.$randomValue(minValue, maxValue);
    	}
    	
    	return value;
    };
    
    
    this.$randomValue = function(min, max) {
    	if (min > max) {
    		var buf = min;
    		min = max;
    		max = buf;
    	}
    
    	var rv = Math.floor(Math.random() * (max - min + 1)) + min;
    	
    	//this.$log("[randomValue] (" + min + ", " + max + ") = " + rv);
    	
    	return rv;
    };
    
    this.$checkValue = function(val1, val2, oper) {
        var result = 1;
        
        if (oper == "!=" && val1 == val2) { result = 0; }
        if (oper == "=" && val1 != val2) { result = 0; }
        
        if (oper == "<=" && val1 > val2) { result = 0; }
        if (oper == "<" && val1 >= val2) { result = 0; }
        
        if (oper == ">=" && val1 < val2) { result = 0; }
        if (oper == ">" && val1 <= val2) { result = 0; }
        
        if (oper == ":") {
            result = 1;
            this.$log("[checkValue] ERROR!!! Wrong operator ':' !");
        }
        
        return result;
    };
    
    
    this.$checkRequirements = function(req) {
    	var _litf = worldScripts.LITF;
    
        var oper = "";
        
        if (req.indexOf("!=") > -1) {
            oper = "!=";
        } else if (req.indexOf("<=") > -1) {
            oper = "<=";
        } else if (req.indexOf(">=") > -1) {
            oper = ">=";
        } else if (req.indexOf("=") > -1) {
            oper = "=";
        } else if (req.indexOf("<") > -1) {
            oper = "<";
        } else if (req.indexOf(">") > -1) {
            oper = ">";
        // Cannot use ':', ambiguous character for conditions
        //} else if (req.indexOf(":") > -1) {
            //oper = ":";
        }
        
        var reqSplit = req.split(oper);
    
    	if (reqSplit[0].indexOf("flag_") == 0) {
            // flag_ management
            
    		var flagName = reqSplit[0].substring(5);
    		var validVal = parseInt(reqSplit[1]);
    
    		var flagValue = eval("_litf.LITF_flags." + flagName + ";");
    		if (validVal != flagValue) { return 0; }
        
        } else if (reqSplit[0].indexOf("mt_") == 0) {
            // cargo commodities management
             
            var mtLabel = reqSplit[0].substring(3);
            eval("var mtValue = player.ship.manifest." + mtLabel + ";");
    
            var mtCheck = parseInt(reqSplit[1]);
    
            var result = this.$checkValue(mtValue, mtCheck, oper);
            if (result == 0) { return 0; }	
    	} else {
    		// other checks
    
    		switch (reqSplit[0]) {
                case "bountyfine":
                    var bFine = this.$bountyFine();
                    var cfbVal = parseInt(reqSplit[1]); // 0 - not enough money, 1 - can pay
                    if (player.credits < bFine && cfbVal == 1 ) return 0;
                    if (player.credits >= bFine && cfbVal == 0 ) return 0;
                    break;
    
                case "checkFitBadge":
                    var fitBadge = _litf.LITF_flags.fitBadge;
    
                    var cfbVal = parseInt(reqSplit[1]); // 0 - no badge, 1 - expired badge, 2 - valid badge
        
                    if (cfbVal == 0) {
                        if (fitBadge != -1) { return 0; }
                        
                    } else {
                        if (fitBadge == -1) {
                            return 0;
                        } else {
                            var expired = this.$checkTimeForExpiration(fitBadge);
                            this.$log("[checkRequirements] expired(" + fitBadge + ") = " + expired);
                            
                            if (cfbVal == 1 && expired == 0) {
                                return 0;
                            } else if (cfbVal == 2 && expired == 1) {
                                return 0;
                            }
                        }
                    } 
                    break;
                    
                case "economy":
                    var syseco = this.$systemEconomy();
                    if (syseco != reqSplit[1]) {
                        return 0;
                    }
                    break;
    
                case "gov":
                    var sysgov = system.government;
                    var govSplit = reqSplit[1].split("-");
                    var valid = 0;
                    for (var i = 0; i < govSplit.length; i++) {
                        if (this.$decodeGovernment(sysgov) == govSplit[i]) {
                            valid = 1;
                        }
                    }
                    if (valid == 0) { return 0; }
                    break;
    
                case "paytreatment":
                    var heal = 0;
    
                    var tl = this.$systemTechLevel();
                    switch (tl) {
                        case "lowtech":
                            heal = 2;
                            break;
                        case "avgtech":
                            heal = 3;
                            break;
                        case "hitech":
                            heal = 5;
                            break;
                    }
    
                    var price = heal * 50;
    
                    if (player.credits < price) {
                        return 0;
                    }
                    break;
                    
                case "tech":
                    var systech = this.$systemTechLevel();
                    if (systech != reqSplit[1]) {
                        return 0;
                    }
                    break;
    			
    			case "valid":
    				var validVal = parseInt(reqSplit[1]);
    				if (validVal == 0) { return 0; }
    				break;
    
    
                // Value-comparing checks
    
                
                case "bounty":
                    var checkVal = parseInt(reqSplit[1]);
                    var result = this.$checkValue(player.bounty, checkVal, oper);
                    if (result == 0) { return 0; }
                    break;
    
                case "credits":
                    var checkVal = parseInt(reqSplit[1]);
                    var result = this.$checkValue(player.credits, checkVal, oper);
                    if (result == 0) { return 0; }
                    break;
    
                case "fuel":
                    var checkVal = parseInt(reqSplit[1]);
                    var result = this.$checkValue(player.ship.fuel, checkVal, oper);
                    if (result == 0) { return 0; }
                    break;
    
                case "health":
                    var checkVal = parseInt(reqSplit[1]);
                    var result = this.$checkValue(_litf.LITF_cmdStats.health, checkVal, oper);
                    if (result == 0) { return 0; }
                    break;
    
                case "maxstrength":
                    var checkVal = parseInt(reqSplit[1]);
                    var result = this.$checkValue(_litf.LITF_flags.maxStrength, checkVal, oper);
                    if (result == 0) { return 0; }
                    break;
    
                case "reputation":
                    var checkVal = parseInt(reqSplit[1]);
                    var result = this.$checkValue(_litf.LITF_cmdStats.reputation, checkVal, oper);
                    if (result == 0) { return 0; }
                    break;
    
                case "sickness":
                    var checkVal = parseInt(reqSplit[1]);
                    var result = this.$checkValue(_litf.LITF_cmdStats.sickness, checkVal, oper);
                    if (result == 0) { return 0; }
                    break;
    
                case "stance":
                    var checkVal = parseInt(reqSplit[1]);
                    var result = this.$checkValue(_litf.LITF_cmdStats.stance, checkVal, oper);
                    if (result == 0) { return 0; }
                    break;
    
                case "strength":
                    var checkVal = parseInt(reqSplit[1]);
                    var result = this.$checkValue(_litf.LITF_cmdStats.strength, checkVal, oper);
                    if (result == 0) { return 0; }
                    break;
    
    			// XXX Contractordata?
    			/*
    			case "hintData":
    				var value = parseInt(reqSplit[1]);
    				var hint = worldScripts.LITF.LITF_hintData;
    				if (value == 0) {
    					if (hint != undefined && hint != "") { return 0; }
    				} else if (value == 1) {
    					if (hint == undefined || hint == "") { return 0; }
    				}
    				break;
    			*/
    		}
    	}
    
    	return 1;
    };
    
    
    this.$systemEconomy = function() {
    	var ecoType = "balanced";
    
    	var economy = system.economy;
    	if (economy < 3) {
    		ecoType = "industrial";	
    	} else if (economy > 4) {
    		ecoType = "agriculture";
    	}
    
    	//this.$log("[stationCategories] System Economy = " + ecoType);
    
    	return ecoType;
    };
    
    
    this.$systemTechLevel = function() {
    	var tech = "avgtech";
    	
    	var tl = system.techLevel;
    	if (tl < 5) {
    		tech = "lowtech";
    	} else if (tl > 9) {
    		tech = "hitech";
    	}
    
    	//this.$log("[stationCategories] System Technology = " + tech);
    
    	return tech;	
    };
    
    this.$decodeGovernment = function(gov) {
    	var govText = "";
    
    	switch (gov) {
    		case 0:
    			govText = "anarchy";
    			break;
    		case 1:
    			govText = "feudal";
    			break;
    		case 2:
    			govText = "multigovernmental";
    			break;
    		case 3:
    			govText = "dictatorship";
    			break;
    		case 4:
    			govText = "communist";
    			break;
    		case 5:
    			govText = "confederacy";
    			break;
    		case 6:
    			govText = "democracy";
    			break;
    		case 7:
    			govText = "corporate";
    			break;
    	}
    
    	return govText;
    };
    
    this.$stationCategories = function() {
    	/*
    		List of station.allegiance values:
    			hunter
    			galcop
    			neutral
    			pirate
    			chaotic
    			thargoid
    			private
    			restricted
    	*//*
    	var allegiance = player.ship.dockedStation.allegiance;
    	this.$log("[stationCategories] Space Station Allegiance = " + allegiance);
    	*/
    
    	/*
    		List of system.government values:
    			0: Anarchy
    			1: Feudal
    			2: Multi-Governmental
    			3: Dictatorship
    			4: Communist
    			5: Confederacy
    			6: Democracy
    			7: Corporate State
    	*/
    	var government = "gov_" + system.government;
    	//this.$log("[stationCategories] System Government = " + government);
    	
    	var tech = this.$systemTechLevel();
    
    	var ecoType = this.$systemEconomy();
    	
    	var sCategories = [ government, tech, ecoType ];
    
    	return sCategories;
    };
    
    
    this.$screenBackground = function(screenBgStr) {
    	var screenBg = "";
    
    	if (screenBgStr == undefined || screenBgStr == "") {
    		screenBg = this.$genericScreenBackground();
    	} else {
    		var screenBgSplit = screenBgStr.split(",");
    		var bgIdx = Math.floor(Math.random() * screenBgSplit.length);
    		screenBg = screenBgSplit[bgIdx];
    	}
    
    	if (screenBg != "") {
    		setScreenBackground({ name: screenBg, height: 480 });
    	}
    };
    
    
    this.$genericScreenBackground = function() {
    	var background = "";
    	
    	var sCategories = this.$stationCategories();
    	var catIdx = Math.floor(Math.random() * 3); 
    
    	var cat = sCategories[catIdx];
    
    	//if (cat == "gen") {
    	//	cat = "gov_" + system.government;
    	//}
    
    	// Set background depending on system government
    	switch (cat) {
    		case "gov_0": 
    			background = "litf_bg_anarchy.png";
    			break;
    		case "gov_1":
    			background = "litf_bg_feudal.png";
    			break;
    		case "gov_2":
    			background = "litf_bg_multigovernment.png";
    			break;
    		case "gov_3":
    			background = "litf_bg_dictatorship.png";
    			break;
    		case "gov_4":
    			background = "litf_bg_communist.png";
    			break;
    		case "gov_5":
    			background = "litf_bg_confederacy.png";
    			break;
    		case "gov_6":
    			background = "litf_bg_democracy.png";
    			break;
    		case "gov_7":
    			background = "litf_bg_corporate.png";
    			break;
    		case "hitech":
    			background = "litf_bg_hitech.png";
    			break;
    		case "lowtech":
    			background = "litf_bg_lowtech.png";
    			break;
    		case "industrial":
    			background = "litf_bg_industrial.png";
    			break;
    		case "agriculture":
    			background = "litf_bg_agricultural.png";
    			break;
    	}
    
    	// Random generic corridor
    	if (background == "") {
    		var corrIdx = Math.floor(Math.random() * 11) + 1;
    		background = "litf_bg_corridor" + corrIdx + ".png";
    	}
    
    	return background;
    };
    
    
    this.$replaceConstants = function(text) {
    	var _litf = worldScripts.LITF;
    	var _ec = worldScripts.LITF_EventsCatalog;
    
    	var constArr;
    	var length;
    	var rand;
    	var str;
    
        if (text.indexOf("$MUSEUMPIECE$") > -1) {
            constArr = _ec.arrMuseumPieces;
            length = constArr.length;
            rand = Math.floor(Math.random() * length);
            text = text.replace("$MUSEUMPIECE$", constArr[rand]);
        }
    
        if (text.indexOf("$LOBBYSNIPPET$") > -1) {
            constArr = _ec.arrLobbySnippet;
            length = constArr.length;
            rand = Math.floor(Math.random() * length);
            text = text.replace("$LOBBYSNIPPET$", constArr[rand]);
        }
    
    	if (text.indexOf("$HOTELROOM$") > -1) {
    		var hotelRoom = "";
    		rand = Math.floor(Math.random() * 5);
    		hotelRoom += rand;
    		rand = Math.floor(Math.random() * 4);
    		hotelRoom += rand;
    		rand = Math.floor(Math.random() * 4);
    		hotelRoom += rand;
    
    		text = text.replace("$HOTELROOM$", hotelRoom);
    	}
    
    	if (text.indexOf("$CHARITY$") > -1) {
    		constArr = _ec.arrCharity;
    		length = constArr.length;
    		rand = Math.floor(Math.random() * length);
    		text = text.replace("$CHARITY$", constArr[rand]);
    	} 
    
    	if (text.indexOf("$LIQUOR$") > -1) {
    		constArr = _ec.arrLiquors;
    		length = constArr.length;
    		rand = Math.floor(Math.random() * length);
    		text = text.replace("$LIQUOR$", constArr[rand]);
    	}
    
    	if (text.indexOf("$GOSSIP$") > -1) {
    		constArr = _ec.arrGossip;
    		length = constArr.length;
    		rand = Math.floor(Math.random() * length);
    		text = text.replace("$GOSSIP$", constArr[rand]);
    	}
    
    	if (text.indexOf("$NAME$") > -1) {
    		var name = randomName() + " " + randomName();
    		text = text.replace("$NAME$", name);
    
    		_litf.LITF_varStore["NAME"] = name;
    	}
    
    	if (text.indexOf("$SYSTEM$") > -1) {
    		var sName = this.$randomSystem(); // "Diso"; // "Leesti";
    		text = text.replace("$SYSTEM$", sName);
    		
    		_litf.LITF_varStore["SYSTEM"] = sName;
    	}
    
    	if (text.indexOf("$MINORCARGO$") > -1) {
    		var rmc = this.$randomMinorCargo();
    		text = text.replace("$MINORCARGO$", rmc);
    
    		//_litf.LITF_varStore["MINORCARGO"] = rmc;
    	}
    
    	if (text.indexOf("$COMMODITY$") > -1) {
    		constArr = _ec.arrCommodity;
    		length = constArr.length;
    		rand = Math.floor(Math.random() * length);
    		text = text.replace("$COMMODITY$", constArr[rand]);
    
    		_litf.LITF_varStore["COMMODITY"] = constArr[rand];
    	}
    
    	if (text.indexOf("$ARTGENRE$") > -1) {
    		var ag = "";
    
    		if (_litf.LITF_varStore["ARTGENRE"] == undefined || _litf.LITF_varStore["ARTGENRE"] == "") {
    			constArr = _ec.arrArt1;
    			length = constArr.length;
    			rand = Math.floor(Math.random() * length);
    
    			ag = constArr[rand];
    
    			constArr = _ec.arrArt2;
    			length = constArr.length;
    			rand = Math.floor(Math.random() * length);
    
    			ag += " " + constArr[rand];
    
    			_litf.LITF_varStore["ARTGENRE"] = ag;
    		} else {
    			ag = _litf.LITF_varStore["ARTGENRE"];
    		}
    
    		text = text.replace("$ARTGENRE$", ag);
    	}
    
    	if (text.indexOf("$MUSICGENRE$") > -1) {
    		var mug = "";
    
    		if (_litf.LITF_varStore["MUSICGENRE"] == undefined || _litf.LITF_varStore["MUSICGENRE"] == "") {
    			constArr = _ec.arrMusic1;
    			length = constArr.length;
    			rand = Math.floor(Math.random() * length);
    
    			mug = constArr[rand];
    
    			constArr = _ec.arrMusic2;
    			length = constArr.length;
    			rand = Math.floor(Math.random() * length);
    
    			mug += " " + constArr[rand];
    
    			constArr = _ec.arrMusic3;
    			length = constArr.length;
    			rand = Math.floor(Math.random() * length);
    
    			mug += " " + constArr[rand];
    
    			_litf.LITF_varStore["MUSICGENRE"] = mug;
    		} else {
    			mug = _litf.LITF_varStore["MUSICGENRE"];
    		}
    
    		text = text.replace("$MUSICGENRE$", mug);
    	}
    
    	if (text.indexOf("$MOVIEGENRE$") > -1) {
    		var mog = "";
    
    		if (_litf.LITF_varStore["MOVIEGENRE"] == undefined || _litf.LITF_varStore["MOVIEGENRE"] == "") {
    			constArr = _ec.arrMovie1;
    			length = constArr.length;
    			rand = Math.floor(Math.random() * length);
    
    			mog = constArr[rand];
    
    			constArr = _ec.arrMovie2;
    			length = constArr.length;
    			rand = Math.floor(Math.random() * length);
    
    			mog += " " + constArr[rand];
    
    			constArr = _ec.arrMovie3;
    			length = constArr.length;
    			rand = Math.floor(Math.random() * length);
    
    			mog += " " + constArr[rand];
    
    			_litf.LITF_varStore["MOVIEGENRE"] = mog;
    		} else {
    			mog = _litf.LITF_varStore["MOVIEGENRE"];
    		}
    
    		text = text.replace("$MOVIEGENRE$", mog);
    	}
    
    	if (text.indexOf("$SPECIES_S$") > -1) {
    		if (_litf.LITF_varStore["SPECIES_S"] == undefined || _litf.LITF_varStore["SPECIES_S"] == "") {
    			_litf.LITF_varStore["SPECIES_S"] = randomInhabitantsDescription(false);
    		}
    
    		text = text.replace("$SPECIES_S$", _litf.LITF_varStore["SPECIES_S"]);
    	}
    
    	if (text.indexOf("$SPECIES_P$") > -1) {
    		if (_litf.LITF_varStore["SPECIES_P"] == undefined || _litf.LITF_varStore["SPECIES_P"] == "") {
    			_litf.LITF_varStore["SPECIES_P"] = randomInhabitantsDescription(true);
    		}
    
    		text = text.replace("$SPECIES_P$", _litf.LITF_varStore["SPECIES_P"]);
    	}
    
    	if (text.indexOf("$GENDERSUBJ$") > -1) {
    		if (_litf.LITF_varStore["GENDER"] == undefined || _litf.LITF_varStore["GENDER"].length == 0) {
    			rand = Math.floor(Math.random() * 2);
    			_litf.LITF_varStore["GENDER"] = _ec.genderSyntax[rand].split('|');
    		}
    
    		text = this.$replaceAll("$GENDERSUBJ$", _litf.LITF_varStore["GENDER"][0], text);
    	}
    
    	if (text.indexOf("$GENDEROBJ$") > -1) {
    		if (_litf.LITF_varStore["GENDER"] == undefined || _litf.LITF_varStore["GENDER"].length == 0) {
    			rand = Math.floor(Math.random() * 2);
    			_litf.LITF_varStore["GENDER"] = _ec.genderSyntax[rand].split('|');
    		}
    
    		text = this.$replaceAll("$GENDEROBJ$", _litf.LITF_varStore["GENDER"][1], text);
    	}
    
    	if (text.indexOf("$GENDERPOSS$") > -1) {
    		if (_litf.LITF_varStore["GENDER"] == undefined || _litf.LITF_varStore["GENDER"].length == 0) {
    			rand = Math.floor(Math.random() * 2);
    			_litf.LITF_varStore["GENDER"] = _ec.genderSyntax[rand].split('|');
    		}
    
    		text = this.$replaceAll("$GENDERPOSS$", _litf.LITF_varStore["GENDER"][2], text);
    	}
    	
    	if (text.indexOf("$BOUNTYFINE$") > -1) {
            var bFine = this.$bountyFine() + "cr";
            text = this.$replaceAll("$BOUNTYFINE$", bFine, text);
    	}
    
    	return text;
    };
    
    
    this.$randomMinorCargo = function() {
    	var _ec = worldScripts.LITF_EventsCatalog;
    	var _rpge = worldScripts.LITF_RPGElements;
    
    	var reputation = worldScripts.LITF.LITF_cmdStats.reputation;
    	var repLev = _rpge.$getReputationLevel(reputation);
    
    	var constArr;
    
    	if (repLev < 3) {
    		constArr = _ec.minorCargo0;
    	} else if (repLev < 6) {
    		constArr = _ec.minorCargo1;
    	} else if (repLev < 9) {
    		constArr = _ec.minorCargo2;
    	} else {
    		constArr = _ec.minorCargo3;
    	}
    
    	var length = constArr.length;
    	var rand = Math.floor(Math.random() * length);
    
    	var randomMinorCargo = constArr[rand];
    
    	return randomMinorCargo;
    };
    
    
    this.$randomSystem = function() {
    	var valid = 0;
    	var sName = "";
    	while (valid == 0) {
    		var rand = Math.floor(Math.random() * 256);
    		sName = System.systemNameForID(rand);
    		if (sName != system.name) {
    			valid = 1;
    		}
    	}
    
    	return sName;
    };
    
    
    this.$executeActions = function(actionString) {
        var aSplit = actionString.split("|");
    
        for (var i = 0; i < aSplit.length; i++) {
            var action = aSplit[i];
            this.$executeSingleAction(action);
        }
    };
    
    
    this.$executeSingleAction = function(action) {
        var _co = worldScripts.LITF_Common;
        var _re = worldScripts.LITF_RandomEvents;
        var _litf = worldScripts.LITF;
        var _nav = worldScripts.LITF_Navigation;
    
        // split only at the first (main) colon
        var colonPos = action.indexOf(":");
        
        //var items = action.split(":");
        var command = action.substring(0, colonPos); // items[0]
        var param = action.substring(colonPos + 1); // items[1]
    
        //
        
        this.$log("[executeSingleAction] action = " + action);
    
        if (command.indexOf("flag_") == 0) {
            // Flag management
            var flagName = command.substring(5);
            var flagValue = parseInt(param);
            
            eval("worldScripts.LITF.LITF_flags." + flagName + " = " + flagValue + ";");
    
        } else if (command.indexOf("mt_") == 0) {
            // Cargo commodities management
            var mtMod = this.$readNumericParameter(param);
            var mtLabel = command.substring(3);
            var mtValue = eval("player.ship.manifest." + mtLabel);
    
            if (mtValue + mtMod < 0) {
                mtMod = -mtValue;
            } else if (mtMod > 0 && mtMod > player.ship.cargoSpaceAvailable) {
                mtMod = player.ship.cargoSpaceAvailable;
            }
    
            if (mtMod < 0) {
                eval("player.ship.manifest." + mtLabel + " -= " + Math.abs(mtMod));
            } else {
                eval("player.ship.manifest." + mtLabel + " += " + mtMod);
            }
    
            //var mtUnit = player.ship.manifest.list[mtLabel].unit;
    
        } else {
            switch (command) {
    
                case "bounty":
                    var boMod = this.$readNumericParameter(param);
                    if (player.bounty + boMod < 0) { boMod = -player.bounty; }
                    player.bounty += boMod;
                    break;
    
                case "chancesick":
                    var cSick = this.$readNumericParameter(param);
                    if (_litf.LITF_cmdStats.sickness == 0) {
                        var chance = Math.floor(Math.random() * 100);
                        if (chance < cSick) { _litf.LITF_cmdStats.sickness = 1; }
                    }
                    break;
    
                case "checkFitDamage":
                    var lfs = _litf.LITF_flags.lastFitSession;
    
                    if (lfs > -1) {
                        var diff = clock.seconds - lfs;
                        if (diff < 172800) {
                            _litf.LITF_flags.fitDamageChance += this.$randomValue(5, 10);   
                        }
                    }
                    break;
                    
                case "credits":
                    var crMod = this.$readNumericParameter(param);
                    if (player.credits + crMod < 0) { crMod = -player.credits; }
                    player.credits += crMod;
                    break;
    
                case "end":
                    var tiMod = this.$readNumericParameter(param);
                    clock.addSeconds(tiMod);
                    _re.$resetVars(); 
                   
                    // Return to place screen (destination)
                    _nav.$goPlace(_re.LITF_destPlace);
                    break;
    
                case "fitdamage":
                    if (_litf.LITF_cmdStats.health < 3) {
                        _litf.LITF_cmdStats.health = this.$randomValue(2, 3);
                    }
                    
                    if (_litf.LITF_flags.maxStrength > 0) {
                        _litf.LITF_flags.maxStrength -= this.$randomValue(20, 100);
                    }
                     
                    break;
    
                case "showStatus":
                    _nav.$statusScreen();
                    break;
    
                case "endNav":
                    var tiMod = this.$readNumericParameter(param);
                    clock.addSeconds(tiMod);
                    //_litf.$hangarScreen();
                    break;
    
                case "fuel":
                    var fuMod = this.$readNumericParameter(param);
                    if (player.ship.fuel + fuMod < 0) {
                        fuMod = -player.ship.fuel;
                    } else if (fuMod > 0 && fuMod > player.ship.cargoSpaceAvailable) {
                        fuMod = player.ship.cargoSpaceAvailable;
                    }
                    player.ship.fuel += fuMod;
                    break;
    
                case "health":
                    var heaMod = this.$readNumericParameter(param);
                    _litf.LITF_cmdStats.health += heaMod;
                    if (_litf.LITF_cmdStats.health < 0) { _litf.LITF_cmdStats.health = 0; }
                    if (_litf.LITF_cmdStats.health > 5) { _litf.LITF_cmdStats.health = 5; }
                    break;
    
                case "if":
                    // XXX Condition management
                    // param = <condition>?<ifActions>;<elseActions>
                    // e.g.: if:credits<100,bounty=0?go:event1;go:event2
    
                    // Notes:
                    // - more conditions are possible, comma-separated
                    // - more actions aren't possible (cannot use pipe character), execute them in follow-ups events
    
                    var condItems = param.split("?"); // condItems[0] = <condition>
                    var resItems = condItems[1].split(";"); // resItems[0] = <ifActions>; resItems[1] = <elseActions>
    
                    var validate = this.$validateRequirements(condItems[0]);
    
                    // A little bit of recursion
                    if (validate == 1) {
                        // ifActions
                        //this.$executeSingleAction(resItems[0]);    
                        var ifcmds = this.$replaceAll("§", "|", resItems[0]);
                        this.$log("[executeActions] if = " + ifcmds);
                        this.$executeActions(ifcmds);    
                    } else if (validate == 0) {
                        // elseActions
                        //this.$executeSingleAction(resItems[1]);    
                        var elsecmds = this.$replaceAll("§", "|", resItems[1]);
                        this.$log("[executeActions] else = " + elsecmds);
                        this.$executeActions(elsecmds);    
                    }
                    break;
    
                // XXX Generate contractor mission
                /*
                case "contractorMission":
                    var mType = param;
    
                    // Mandatory parameters (from mission text): SYSTEM, NAME
                    // Plus MISSION TYPE, TIME NOW, HOURS VALID
                    var hData = this.LITF_store["SYSTEM"] + "|" + this.LITF_store["NAME"] + "|" + mType + "|" + clock.hours;
    
                    var timelimit = this.$getTravelTime(this.LITF_store["SYSTEM"]) * 2;
                    var hTime = this.$formatNumber(timelimit);
                    hData += "|" + hTime;
    
                    _litf.LITF_contractorData = hData;
                    this.$log("[selectChoice] contractor data = " + _litf.LITF_contractorData);
    
                    // Clear temporary data, leaves only "contractor" for future checks
                    delete _litf.LITF_store["SYSTEM"];
                    delete _litf.LITF_store["NAME"];
                    break;
                */
    
                case "go":
                    var goSplit = param.split(",");
                    var rndIdx = Math.floor(Math.random() * goSplit.length);
                    _re.$fireEvent(goSplit[rndIdx]);
                    break;
    
                case "goNav":
                    var goSplit = param.split(",");
                    var rndIdx = Math.floor(Math.random() * goSplit.length);
                    var newPlace = goSplit[rndIdx];
    
                    this.$log("[executeSingleAction] newPlace = (" + rndIdx + ") " + newPlace);
    
                    if (newPlace == "back") {
                        newPlace = _nav.LITF_lastPlaceLabel;
                        this.$log("[executeSingleAction] going back to last place: " + newPlace);
                    }
    
                    _nav.$goPlace(newPlace);
                    break;
    
                case "paybountyfine":
                    var bFine = this.$bountyFine();
                    if (player.credits >= bFine) {
    	                player.credits -= bFine;
    			player.bounty = 0;
    		}
                    break;
    
                case "paytreatment":
                    // Healing amount (depends on system TL)
                    var heal = 0;
                    var tl = this.$systemTechLevel();
                    switch (tl) {
                        case "lowtech": heal = 2; break;
                        case "avgtech": heal = 3; break;
                        case "hitech": heal = 5; break;
                    }
                    
                    // Pay the price
                    var price = heal * 50;
                    player.credits -= price;
    
                    // In case of debt insolvency, raise the bounty
                    if (player.credits < 0) {
                        var debt = Math.abs(player.credits);
                        player.credits = 0;
                        player.bounty += (debt / 10);
                    }
    
                    // Healing effects
                    if (param == "health") {
                        _litf.LITF_cmdStats.health -= heal;
                        if (_litf.LITF_cmdStats.health < 0) { _litf.LITF_cmdStats.health = 0; }
                    } else if (param == "sickness") {
                        _litf.LITF_cmdStats.sickness -= heal;
                        if (_litf.LITF_cmdStats.sickness < 0) { _litf.LITF_cmdStats.sickness = 0; }
                    }
                    break;
    
                case "randomAndGo":
                    var goSplit = param.split(",");
                    var rndIdx = Math.floor(Math.random() * goSplit.length);
                    var dPlace = goSplit[rndIdx];
                    var chance = Math.floor(Math.random() * 101); // 1-100
    
                    this.$log("[executeSingleAction] randomAndGO :: chance = " + chance + " dPlace = " + dPlace);
    
                    if (chance < 20) {
                        // random event intermission
                        _re.$randomEvent(dPlace);
                    } else {
                        // proceed as usual
                        _nav.$goPlace(dPlace);
                    }
                    break;
    
                case "reputation":
                    var repMod = this.$readNumericParameter(param);
                    _litf.LITF_cmdStats.reputation += repMod;
                    if (_litf.LITF_cmdStats.reputation < 0) { _litf.LITF_cmdStats.reputation = 0; }
                    break;
    
                case "sickness":
                    var sicMod = this.$readNumericParameter(param);
                    _litf.LITF_cmdStats.sickness += sicMod;
                    if (_litf.LITF_cmdStats.sickness < 0) { _litf.LITF_cmdStats.sickness = 0; }
                    if (_litf.LITF_cmdStats.sickness > 5) { _litf.LITF_cmdStats.sickness = 5; }
                    break;
    
                case "stance":
                    var staMod = this.$readNumericParameter(param);
                    _litf.LITF_cmdStats.stance += staMod;
                    break;
    
                case "strength":
                    var strMod = this.$readNumericParameter(param);
                    _litf.LITF_cmdStats.strength += strMod;
                    if (_litf.LITF_cmdStats.strength < 0) { _litf.LITF_cmdStats.strength = 0; }
                    if (_litf.LITF_cmdStats.strength > _litf.LITF_flags.maxStrength) { _litf.LITF_cmdStats.strength = _litf.LITF_flags.maxStrength; }
                    break;
    
                case "time":
                    var tiMod = this.$readNumericParameter(param);
                    clock.addSeconds(tiMod);
                    break;
                    
                case "writeTime":
                    var wtData = param.split("_"); // flag name, time to write (in seconds) starting from now
                    
                    var secondsFromNow = parseInt(wtData[1]);
                    var storeTime = clock.seconds + secondsFromNow;
                    
                    this.$log("[executeSingleAction] writeTime: " + wtData[0] + " = " + storeTime);
                    
                    eval("_litf.LITF_flags." + wtData[0] + "=" + storeTime);
                    break;
            }
        }
    };
    
    
    this.$checkTimeForExpiration = function(maxTime) {
        var result = -1; // 0 - not expired, 1 - expired
        if (clock.seconds > maxTime) {
            result = 1;
        } else {
            result = 0;
        } 
            
        return result;
    };
    
    
    this.$formatRemainingTime = function(maxTime) {
        var rtText = "";
    
        var remainTime = maxTime - clock.seconds;
        var formattedTime = this.$formatTime(remainTime);
        
        return formattedTime;
    };
    
    
    this.$formatTime = function(secondsTime) {
        var minute = 60;
        var hour = 60 * minute;
        var day = 24 * hour;
    
        var dd = 0;
        var hh = 0;
        var mm = 0;
    
        while (secondsTime > day) {
            dd++;
            secondsTime -= day;
        }
    
        while (secondsTime > hour) {
            hh++;
            secondsTime -= hour;
        }
    
        while (secondsTime > minute) {
            mm++;
            secondsTime -= minute;
        }
    
        var fTime = "" + dd + " days, " + hh + " hours, " + mm + " minutes";
    
        return fTime;
    };
    
    
    
    
    Scripts/LITF_EventsCatalog.js
    "use strict";
    
    this.name	= "LITF_EventsCatalog";
    this.author	= "BeeTLe BeTHLeHeM";
    this.copyright	= "2015 BeeTLe BeTHLeHeM";
    this.description= "Life In The Frontier - Events Catalog";
    this.licence	= "CC BY-NC-SA 4.0";
    
    /////////////////////////////////////// MINOR CARGO ARRAYS
    
    // low reputation (0-2)
    this.minorCargo0 = [ "Beryllium", "Cobalt", "Copper", "Oxygen", "Water", "High Temperature Alloy", "Scrap Metal", "Fertilizers", "Wood", "Tungsten" ];
    
    // average reputation (3-5)
    this.minorCargo1 = [ "Engine Components", "Ship Hull Panels", "Superconductors", "Polymers", "Construction Machinery", "Mining Machinery", "Robot Workers", "Factory Equipment", "Plant Seeds", "Pesticides", "Reciclying Tanks", "Atmospheric Scrubbers", "Laser Drills", "Waste Recyclers" ];
    
    // high reputation (6-8)
    this.minorCargo2 = [ "Pets", "Artwork", "Games", "Movies", "Holographics", "Home Appliances", "Home Entertainment", "Robot Servants", "Books", "Recycled Goods", "Musical Instruments", "Clothing" ];
    
    // very high reputation (9-11)
    this.minorCargo3 = [ "Hydroponics", "Optronics", "Pharmaceuticals", "Robosurgeons", "Classical Instruments", "Museum Exhibits", "Rare artwork" ];
    
    /////////////////////////////////////// CONSTANTS ARRAYS
    
    this.arrCommodity = [ "food", "textiles", "radioactives", "slaves", "liquor_wines", "luxuries", "narcotics", "computers", "alloys", "firearms", "furs", "minerals","gold", "platinum", "gem stones", "alien items" ];
    
    this.genderSyntax = [ "He|him|his", "She|her|her" ];
    
    this.arrLiquors = [ "Trumble Bubble", "Thargoid Slingshot", "Witch Red Wine", "Injector Thunder", "Shadow Rum", "Thyme Hopper", "Double Halo Talon", "Ginger Blitzer", "Cosmic Fluff", "Perfect Storm", "Radioactive Phantom", "Perfect Scooper", "Vodka Square Wave", "Milky Engine Twister", "Imaginary Alien", "Gin Octopoid Walk", "Sherry Robo Punch", "Shield Light Ale", "Glowing Asteroid", "Gleaming Q-Whiskey" ];
    
    this.arrCharity = [ "Cosmic Cosmo Peace", "Piracy Rehabilitation Program", "Save the Usleian Tree Ant", "Trumble Protection League", "Save the Star-Jellies - Ban Astromining!", "Historical Buildings Fund", "Save Our Species" ];
    
    this.arrGossip = [ 
    	"'You shouldn't talk with those dirty beggars. I've heard they're all undercover government agents. Don't let them touch you!'",
    	"'My mother said me that if you point your ship far from any star, to the darker area of space, look at your reflection on the windscreen and say 'Witchspace' three times, something horrible will happen...'",
    	"'You should be careful what you drink. I've heard of a new liquor that they are selling now. You put a finger in it, only the bones will remain.'",
    	"'Once I heard a pilot told me of an another pilot stranded in space after a collision with a luxury liner. The owner of the liner offered to pay damages, and gave 50Kcr to the pilot! It was some billionaire...'",
    	"'I know someone who has seen Thargoid ships many times. And he said me this: there's one ship, different from the others, near impossible to encounter, but still you can see, on certain transparent sections, thousands of people in cryopods... This story always makes me freak out...'",
    	"'You must remain on the upper sectors. Don't go down. Lower station sector are very dangerous. Chemical companies discharge every type of waste down there. You can't imagine what crazy type of mutants can live in that stuff...'",
    	"'He was carrying this guy for a business meeting, and when he arrived the berth was empty! Nothing! He never find him! How crazy is that!'",
    	"'It was in $SYSTEM$... so he was far from the planet, but it was so sleepy he decided to stop the ship behind some asteroid, sensors on, and take a nap. And while he sleeps, he feels something licking his hand. He awake but there was noone. Noone!'",
    	"'Oh yes I've seen it. It's a trumble snuff movie. Yeah I know the cousin of a trader that I met some time ago that had an entire collection of those.'",
    	"'Clown droids? I hate clown droids! They should be packed and thrown into the sun. Did you know who is responsible for the majority of droid murders? Clown droids!'",
    	"'You can't believe me, but I tell you that this station is haunted. I know it, because I know one that worked on its construction. And you know one thing? He says that under the main level there is a sort of gap, and it was filled with cemetery soil. Do you understand now?'",
    	"'I don't believe in ghosts. I think they're all holograms. Or maybe it's the contrary. Frankly I don't know. This is a little bit creepy, don't you think?'",
    	"'They say that you buy on odd day and sell on even day. And every fourth day you buy on organic, and every eighth day you buy on artificial. So do you have to get a software to define every date of launch and the length of every travel. They say you can become rich in two weeks with this method.'",
    	"'I received this mail yesterday, and it says I have to re-send it to other five persons in five days, or a virus will destroy every system on my ship. What I have to do? Alien and androids count?'",
    	"'Every time I look this strange human beings I remember the stories my grandmother told me when I was an egg. You know, the Gurzulla. Small and large, two eyes and two arms, all covered in hair. Do you remember? It was disgusting!'",
    	"'If someone with red clothes asks you for a passenger trip towards $SYSTEM$, go away as fast as you can. That person is dead. I tell you, it happened to me.'",
    	"'You can remove ice crystals with warm water and vinegar.'",
    	"'The friend of a friend told me that is going to be an economic change because of certain turmoils on the planet. I don't know for sure, but my friend told me to monitor $COMMODITY$ for a while.'",
    	"'The news are fake. Don't follow the news. When you listen to a broadcast, understand it as the exact contrary. Do you understand?'",
    	"'Remember, don't give your password to ANYBODY!'",
    	"'Going around the station you could find contractors that needs pilot to transport wares or people.'",
    	"'If you want to spend some time you could go to the Entertainment Area.'",
    	"'Recently Galcop has installed a terminal in its precinct to clean criminal records for a price.'"
    ];
    
    this.arrMuseumPieces = [
        "by a collection of near identical statuines coming from systems very far from each other, all representing some sort of wise creature giving knowledge.",
        "by a strange rock, worked and detailed with weird angle and perspectives that made you head hurt.",
        "by a metallic throne surrounded with curious appendages, that could be blades or tentacles, that you swear were moving when you don't looked directly at them.",
        "by a set of various spheres, probabily representing a solar system, moving without external influence in round patterns.",
        "by an ancient document inscripted in an exotic species of papyrus, documenting the epic history of a civilization disappeared eons ago.",
        "by a set of mechanical figurines roughly molded as fighters that repeatedly lead a charge against another set of opponents. The little play develops every time in a different manner.",
        "by a pile of bright gears, bars, knobs and levers, presumedly belonging to some strange machinery built by a race known as the 'Replicators'.",
        "by a collection of giant leaves where small colonies of insects draw shapes and pictograms.",
        "by a series of ancient weapons built from a volcanic formation that still preserve a slow and reddish glow.",
        "by a pair of dolls carved from animal bones, whose eyes seems to follow as you move in front of them."
    ];
    
    
    this.arrLobbySnippet = [ 
        "Strangely, there's no one in sight right now. Unusual and a bit eerie.",
    	"There are few $SPECIES_P$, they don't speak and look at the other visitors.",
    	"There is a family of $SPECIES_P$ with a pair of very noisy kid.",
    	"Not so far from you a couple of $SPECIES_P$ is bickering.",
    	"Little groups of people whisper to the others.",
    	"An engineering squad is fixing some circuits under a wall panel.",
    	"A group of college $SPECIES_P$ jokes and make stupid moves before going into exaggerated laughs. They're probably drunk.",
    	"The place is crowded. There's many people now.", 
    	"The place is crowded. Someone is complaining the station management for the delays.",
    	"A gently voice remind every visitor to spend as much as possible.",
    	"A gently voice remind every visitor to stay on the station as much as possible.",
        "A loud buzz interrupts a gently voice reminding something that nobody understand.",
    	"An annoying jingle plays in background.",
    	"A lonely $SPECIES_S$ walks away looking around suspiciously.",
    	"There are few groups of people, and everyone is talking loud for some reason."
    ];
    
    this.arrArt1 = [
    	"ASCII", "Abstract", "Baroque", "Computer", "Conceptual", "Dada", "Digital", "Fantastic", "Figurative", "Graffiti", "Gothic", "Humanistic", "Kinetic", "Magic", "Metaphysical", "Modular", "Objective", "Psychedelic", "Renaissance", "Shock", "Space", "Street", "Transgressive", "Underground", "Xenormorphic"	
    ];
    
    this.arrArt2 = [
    	"Expressionism", "Illusionism", "Aestheticism", "Realism", "Impressionism", "Anti-realism", "Art nouveau", "Blobism", "Modernism", "Post-modernism", "Cubism", "Deconstructivism", "Futurism", "Hypermodernism", "Hyperrealism", "Letterism", "Mannerism", "Maximalism", "Minimalism", "Neoclassicism", "Photoshoppism", "Primitivism", "Rococo", "Surrealism"
    ];
    
    this.arrMusic1 = [
    	"Proto", "Post", "Retro", "Classic", "Contemporary", "Alternative", "Neotraditional", "Traditional", "Elevator", "Futuristic", "Ancestral", "Commercial", "Anti", "Avant-garde", "Underground", "Acid", "Orchestral", "Mainstream", "Dance", "Indie", "Melodic"
    ];
    
    this.arrMusic2 = [
    	"Heavy", "Experimental", "Lo-fi", "Progressive", "Instrumental", "Gospel", "Piano", "Swamp", "Comedy", "Parody", "Religious", "Ambient", "Drone", "Dark", "Soft", "Space", "Trip", "Dream", "Cyber", "Robot", "Lyrical"
    ];
    
    this.arrMusic3 = [
    	"Metal", "Hip hop", "Jazz", "Rap", "Pop", "Noise", "Electronica", "Blues", "Rock", "Country", "Punk", "Calypso", "Reggae", "Ska", "Chiptune", "Disco", "Funk", "House", "Trance", "Industrial", "Poetry"
    ];
    
    this.arrMovie1 = [
    	"Animal", "Biker", "Comic-Book", "Conspiracy", "Erotic", "Martial Ar", "Political", "Surfing", "Techno", "Classic", "Family", "Procedural", "Diary", "Ehtnic", "Medical", "Ghost", "Gothic", "Vampire", "Werewolf", "Atomic", "Cyberpunk"
    ];
    
    this.arrMovie2 = [
    	"Action", "Noir", "Hard-boiled", "Crime", "Shakespearean", "Historical", "Horror", "Musical", "Science Fiction ", "War", "Western", "Slasher", "Terror", "Post-Apocalyptic", "Time Travel"
    ];
    
    this.arrMovie3 = [
    	"Thriller", "Epic", "Adventure", "Survival", "Comedy", "Mockumentary", "Drama", "Tragedy", "Ballet", "Concert"
    ];
    
    /////////////////////////////////////// RANDOM EVENTS
    
    this.rand1 = {
    	text: "A $SPECIES_S$ beggar approaches you asking for some credits. $GENDERSUBJ$ is covered in dirt, pale in the face, and $GENDERPOSS$ hands tremble. It could be an elaborate act, but it isn't easy to say. 'Credits for food! Five days no eat!', $GENDERSUBJ$ begs.",
        
        //r1: "credits>=5",
    	c1: "Give 5 credits to the beggar",
    	//a1: "credits:-5|reputation:5|go:rand1_1",
    	a1: "if:credits>=5?go:rand1_1;go:rand1_2",
    	
    	//r2: "credits>=1",
    	c2: "Give 1 credit to the beggar",
    	//a2: "credits:-1|reputation:1|go:rand1_1",
    	a2: "if:credits>=1?go:rand1_3;go:rand1_2",
    	
    	c3: "Move on and ignore the beggar",
    	a3: "go:rand1_4"
    };
     
    this.rand1_1 = {
    	text: "The beggar take the credits, displaying a gap-toothed smile. $GENDERSUBJ$ nods to you and walks away searching for another benefactor.",
    	c1: "Goodbye",
    	a1: "credits:-5|end:600"
    };
    	
    this.rand1_2 = {
        text: "'Your words are generous but your wallet isn't!'.\nThe beggar laughs out loud, while exiting through a side corridor. You can still hear echoes of $GENDERPOS$ laughter.",
        c1: "At least I have still something",
        a1: "end:600"
    };	
    
    this.rand1_3 = {
        text: "The beggar take the credit saying 'A credit a day!' and laughing out loud. $GENDERSUBJ$ nods to you and walks away searching for another benefactor.",
        c1: "Goodbye",
        a1: "credits:-1|end:600"
    };
    	
    this.rand1_4 = {
    	text: "The beggar angrily shouts and you, then walks away stuttering something unintelligible.",
    	c1: "You look at $GENDEROBJ$ for a while before going back to your business",
    	a1: "end:600"
    };
    
    //
    
    this.rand2 = {
    	text: "A $SPECIES_S$ pass beside you: before you have time to do anything $GENDERSUBJ$ points $GENDERPOSS$ finger at you and says: $GOSSIP$.\nThen $GENDERSUBJ$ disappears in the crowd, talking to $GENDEROBJ$self, leaving you baffled.",
    	c1: "The universe is full of weird people...", 
    	a1: "end:300"
    };
    
    //
    
    this.rand3 = {
    	text: "A deployment of guards blocks your way. Behind them, bulkheads are slowly closing, accompanied by flashing lights. Together with other people you try to look beyond the massive grey walls, but you manage to notice only a reddish flickering of flames.\n\nWalking away from the deployment, you overhear a couple of $SPECIES_P$ talking about the incident: 'Another fire. Frankly I don't know if they are really incident anymore...'",
    	c1: "Nothing to see here...", 
    	a1: "end:300"
    };
    
    //
    
    this.rand4 = {
    	text: "A deployment of guards blocks your way. Behind them, bulkheads are slowly closing, accompanied by flashing lights. Together with other people you try to look beyond the massive grey walls, but you manage to notice only the reddish flickering of flames.",
    	c1: "Luckily I wasn't inside there",
    	a1: "end:300"
    };
    
    //
    
    this.rand5 = {
    	text: "From the shadows of a tight alley an unknown $SPECIES_S$ introduce $GENDEROBJ$self as a renowned seller of prodigious elixirs. $GENDERSUBJ$ shows you an ampoule full of a dark liquid, to $GENDERPOSS$ extreme delight, while proclaming: 'Today there's an exceptional offer! The Water of Life, straight from the sacred temple in the huge swamps of the remote jungle planets! And is yours only for 50cr. You would be a fool not to buy it!'",
    	//requires: "credits>=50",
    	c1: "Awesome! But I think I will pass.",
    	a1: "go:rand5_1",
    	c2: "Mmh. I feel rather tired lately. Give me this Water of Life, let's try it!",
        a2: "if:credits>=50?go:rand5_2;go:rand5_3",
    	//a2: "credits:-50|go:rand5_2,rand5_2,rand5_3,rand5_4,rand5_5"
    };
    	
    this.rand5_1 = {
    	text: "The seller tries to convince you a little more, but seeing you're resolute, runs back to the shadows waiting for the next lucky acquirer.",
    	c1: "Never trust $SPECIES_S$ sellers in the shadows.", 
    	a1: "end:600"
    };
    
    this.rand5_2 = {
        text: "'Good! Good! Here's this awesome elixir, in change of a miserable amount of money!'\nThe seller gives you a little bottle filled with a cloudy and dense liquid, before quickly disappearing in the shadows.",
        c1: "Let's taste this stuff",
        a1: "credits:-50|go:rand5_4,rand5_5,rand5_6,rand5_7"
    };
    
    this.rand5_3 = {
        text: "'Aha! You haven't the money! And without money, no elixir! I'm sorry, I can't give this for free... See you another time!'\nThe seller moves away and disappears in the shadows before you can say anything.",
        c1: "Pretty evasive...",
        a1: "end:300"
    };
    
    this.rand5_4 = {
    	text: "You drink the dark liquid, feeling its fuzzy taste into the throat. Obviously it's a soft drink, nothing less, nothing more...",
    	c1: "Damned swindler!", 
    	a1: "end:600"
    };
    
    this.rand5_5 = {
    	text: "You drink the dark liquid, feeling its fuzzy taste into the throat. You don't recognize the flavour, but immediately start searching for water to wash your mouth.",
    	c1: "Damned swindler! It was disgusting!", 
    	a1: "sickness:1|end:600"
    };
    
    this.rand5_6 = {
    	text: "You drink the dark liquid, feeling its fuzzy taste into the throat. For a couple of minute your body is filled with a strange warmth that makes you dizzy and feverish. You have to rest against a wall to not fall down. When the feeling is vanished, you feel considerably better than before.",
    	c1: "Maybe it was a medicine... in a sense.", 
    	a1: "sickness:-1|end:800"
    };
    
    this.rand5_7 = {
    	text: "You drink the dark liquid, feeling its fuzzy taste into the throat. It tastes like a soft drink but after a moment the world start to go round and round, until everything become black...\n\nYou awake in the same place, and you feel better, but how many time is passed?",
    	c1: "Anyway, better running than walking!", 
    	a1: "sickness:-2|end:3600,18000"
    };
    
    //
    	
    this.rand6 = {
    	text: "A group of $SPECIES_S$ partygoers proceeds randomly through the amused crowd, laughing and drinking from a large number of bottles. Someone screams a name, someone else answer and laugh again, but you can't recognize the words. They walk and dance and zigzag without an intentional pattern. Their clothes flaps and swings around them in a swirl of vivid colours while they cross the concourse.",
    	c1: "Watch the group stagger along their drunken path", 
    	a1: "end:300"
    };
    
    //
    
    this.rand7 = {
    	text: "'Police! Stop right away!'\n\nYou see a $SPECIES_S$ running for $GENDERPOSS$ life, stumbling and jumping between walls and worried people. Behind $GENDEROBJ$, few meters away, a cop is on a relentless chase, weapon in hand - there's no line of sight to attempt a shot. Suddenly you notice that the fugitive is coming your way, $GENDERPOSS$ mind focused on escaping.",
    	c1: "You try jumping on the fugitive and stop $GENDEROBJ$ until the cop arrives",
    	a1: "go:rand7_1,rand7_2",
    	c2: "You don't disturb the fugitive, but with nonchalance try to delay the cop",
    	a2: "go:rand7_3,rand7_4",
    	c3: "You sidestep and don't intervene in the situation.",
    	a3: "go:rand7_5"
    };
    	
    this.rand7_1 = { 
    	text: "You quickly prepare to jump, but at the last moment the fugitive realizes your intentions and execute a sudden swerve. You grasp the air and fall down on the floor with an heavy thud. After a few seconds the cop passes and glance in your direction.",
    	c1: "You stand up massaging an elbow. At least you tried.", 
    	a1: "stance:2|reputation:-2|end:900"
    };
    	
    this.rand7_2 = { 
    	text: "You quickly prepare to jump on the unaware fugitive. You grasp $GENDEROBJ$ shoulder and fall down together on the floor. After a brief fight the cop arrives and stun $GENDEROBJ$, and the $SPECIES_S$ starts suffering an intense and disabilitating pain. The cop look at you and says: 'Excellent work. I think that for the help provided to the police forces you have full right to an adequate reward.' $GENDERSUBJ$ reaches for $GENDERPOSS$ communicator, discover your name from the station database and write something on a tiny keypad. 'Done. Good day sir.'",
    	c1: "You feel strangely proud of yourself", 
    	a1: "stance:5|reputation:15|credits:50|end:900"
    };
    	
    this.rand7_3 = { 
    	text: "Feigning a certain clumsiness you begin to apologize to the cop. $GENDERSUBJ$ finally manages to push you away to continue the pursuit, but has lost valuable time. The fugitive is nowhere to be seen.",
    	c1: "Before the cop start suspecting something, you discreetly walk away.",
    	a1: "stance:-2|end:900"
    };
    	
    this.rand7_4 = { 
    	text: "Feigning a certain clumsiness you begin to apologize to the cop. $GENDERSUBJ$ finally manages to push you away to continue the pursuit, but has lost valuable time. The fugitive is nowhere to be seen.\n\nBefore you can walk away, the cop blocks you - and $GENDERSUBJ$'s not happy. 'Visitor! You are guilty of voluntarily obstructing an officer in the course of $GENDERPOSS$ duty! This is not an offense tha will pass unobserved!",
    	c1: "There's no much you can do at this point. Go away as soon as you can.", 
    	a1: "stance:-10|bounty:5|end:1200"
    };
    	
    this.rand7_5 = {
    	text: "The duo continues running, the cop screaming again $GENDERPOSS$ warnings. $GENDERPOSS$ voice fade in the distance.",
    	c1: "Better leave to the cops this stuff.", 
    	a1: "end:600"
    };
    
    //
    
    this.rand8 = {
    	text: "You see a $SPECIES_S$ with dark clothes stealing the wallet of a tourist. In the meanwhile, the thief turns $GENDERPOSS$ head, looks at you and put a finger on $GENDERPOSS$ lips: 'Stay quiet.' Nobody else seems to have realised what is happening.",
    	c1: "Call the police!",
    	a1: "go:rand8_1",
    	c2: "Nothing of my business here...",
    	a2: "go:rand8_2,rand8_2,rand8_2,rand8_3"
    };
    
    this.rand8_1 = {
    	text: "You immediately start calling help to stop the thief, but the $SPECIES_S$ is too nimble to be stopped by the crowd. $GENDERSUBJ$ slide and run away, not before casting a glance of contempt towards you.",
    	c1: "I've done my good deed for today",
    	a1: "stance:3|reputation:2|end:600"
    };
    	
    this.rand8_2 = {
    	text: "You continue to look at the thief, as $GENDERSUBJ$ takes the wallet and put it in one of $GENDERPOSS$ various pockets. $GENDERSUBJ$ smiles at you and a second later you can't see $GENDEROBJ$ anymore.",
    	c1: "Money come, money go", 
    	a1: "stance:-2|end:600"
    };
    	
    this.rand8_3 = {
    	text: "You continue to look the thief, as $GENDERSUBJ$ take the wallet and hide it between the folds of $GENDERPOSS$ clothes. $GENDERSUBJ$ smiles and calmly walks to you as if nothing is happened. Passing beside you $GENDERSUBJ$ puts something in your pocket. But when you turn your head $GENDERSUBJ$'s not there anymore.",
    	c1: "I don't believe it's a good idea to return this money to its owner...", 
    	a1: "stance:-5|credits:10,80|end:900"
    };
    
    //
    
    this.rand9 = { 
    	text: "While you're resting the $SPECIES_S$ commander near you says: 'I beg your pardon, I am ashamed but I have another way to put it: me and my crew have docked on this station and we have no way to lift off again. You can hardly believe it, but we are stranded - and this is not exactly a lonely asteroid in the middle of space. I repeat, I am ashamed but I need to go away from here, it's a week and we need to go back home or we will have to start begging for food.' $GENDERSUBJ$ clears $GENDERPOSS$ throat: 'So I have to ask you: would you be so gentle to give us a few resources to save us from this discomfortable woe?'",
    	//requires: "fuel>=5",
    	
    	r1: "fuel>=5",
    	c1: "Fellow commanders have to help each other, isn't it?",
    	a1: "go:rand9_1",
    	
    	c2: "I'm sorry, but I'm in dire conditions too. Unfortunately I have nothing to spare",
    	a2: "go:rand9_2"
    };
    	
    this.rand9_1 = {
    	text: "The commander rejoice at your generosity. 'I won't ask too much! Only the strict necessary. 5t of fuel. Nothing more. And you will have my gratitude, and the gratitude of my crew and their families!'",
    	c1: "Don't say a word. I'll order the transfer now.",
    	a1: "reputation:50|fuel:-5|end:600",
    	c2: "Oh, 5t? Really? Mmm... really sorry... but I haven't so much!",
    	a2: "go:rand9_2"
    };
    	
    this.rand9_2 = {
    	text: "The commander face turns to a gloomy mask. 'I understand. I'm sorry, I was too much insolent. But you know, when one see a glimpse of hope in the dark... Forget it all about it. Good day, commander'. $GENDERSUBJ$ stands up and slowly walks away.",
    	c1: "I'm really sorry. Maybe another time...",
    	a1: "end:300",
    };
    
    //
    
    this.rand10 = { 
    	text: "While you're resting the $SPECIES_S$ commander near you says: 'I beg your pardon, I am ashamed but I have another way to put it: me and my crew have docked on this station and we have no way to lift off again. You can hardly believe it, but we are stranded - and this is not exactly a lonely asteroid in the middle of space. I repeat, I am ashamed but I need to go away from here, it's a week and we need to go back home or we will have to start begging for food.' $GENDERSUBJ$ clears $GENDERPOSS$ throat: 'So I have to ask you: would you be so gentle to give us a few resources to save us from this discomfortable woe?'",
    	//requires: "credits>=100",
    	
    	r1: "credits>=100",
    	c1: "Fellow commanders have to help each other, isn't it?",
    	a1: "go:rand10_1",
    	
    	c2: "I'm sorry, but I'm in dire conditions too. Unfortunately I have nothing to spare",
    	a2: "go:rand10_2"
    };
    	
    this.rand10_1 = { 
    	text: "The commander rejoice at your generosity. 'I won't ask too much! 100cr will be enough to depart from this place. Nothing more. And you will have my gratitude, of my crew and their families!'",
    	c1: "Don't say a word. I'll order the transfer now.",
    	a1: "reputation:50|credits:-100|end:600",
    	c2: "Oh, 100cr? Really? Mmm... really sorry... but I haven't so much!",
    	a2: "go:rand10_2"
    };
    	
    this.rand10_2 = { 
    	text: "The commander face turns to a gloomy mask. 'I understand. I'm sorry, I was too much insolent. But you know, when one see a glimpse of hope in the dark... Forget it all about it. Good day, commander'. $GENDERSUBJ$ stands up and slowly walks away.",
    	c1: "I'm really sorry. Maybe another time...",
    	a1: "end:300",
    };
    
    //
    
    this.rand11 = {
    	text: "A group of $SPECIES_P$ approaches you and ask for a donation to their '$CHARITY$' charity.",
    	requires: "credits>=1",
    	r1: "credits>=1",
    	c1: "Donate 1cr",
    	a1: "reputation:1|credits:-1|go:rand11_1",
        
        r2: "credits>=10",
    	c2: "Donate 10cr",
    	a2: "reputation:10|credits:-10|go:rand11_1",
        
        r3: "credits>=100",
    	c3: "Donate 100cr",
    	a3: "reputation:50|credits:-100|go:rand11_2",
        
        r4: "credits>=1000",
    	c4: "Donate 1000cr",
    	a4: "reputation:100|credits:-1000|go:rand11_2",
        
        r5: "credits>=10000",
    	c5: "Donate 10000cr",
    	a5: "reputation:1000|credits:-10000|go:rand11_3",
        
    	c6: "Sorry, I have nothing to give",
    	a6: "go:rand11_4"
    };
    
    this.rand11_1 = {
    	text: "They smile at you: 'Thanks for the donation!'",
    	c1: "It was nothing, really",
    	a1: "end:300"
    };
    
    this.rand11_2 = {
    	text: "They didn't expected it: 'Thanks! That's a big sum of money! Good day to you sir!'",
    	c1: "It was nothing, really",
    	a1: "end:300"
    };
    
    this.rand11_3 = {
    	text: "They stare at you, jaw dropped, petrified from astonishment: '...Really!? We almost can't believe it! You're fantastic!' Someone hugs you, and someone kisses you, but in the euphoric confusion you can't say who's who.",
    	c1: "It was... nothing... really",
    	a1: "end:300"
    };
    
    this.rand11_4 = {
    	text: "They smile at you. 'Remember our cause!'",
    	c1: "I'll remember (at least for a few minutes)",
    	a1: "end:180"
    };
    
    //
    
    this.rand12 = {
    	text: "Next to you, two bulky $SPECIES_P$ start fighting over a trivial matter. They seem willing to come to blows just to prove who is right. The place is pretty crowded so this could be a really bad thing.",
    	
    	c1: "If they're so stupid they want to handle their issues in this way, be it so, I'll leave them alone",
    	a1: "go:rand12_1",
    	
    	c2: "Better to stop them. Other people could get involved in the fight.",
    	a2: "go:rand12_2,rand12_3",
    };
    
    this.rand12_1 = {
    	text: "As you walk away you listen to the $SPECIES_P$ talking with louder voices, like thunders rumbling. After seconds a brawl quickly develops. People start screaming and running. As you approach an elevator, you can see the cops arriving to the scene to stop the fights.",
    	c1: "I couldn't possibly avoid all this chaos.",
    	a1: "end:600"
    };
    
    
    this.rand12_2 = {
    	text: "The $SPECIES_P$ look at you while you do your peacemaker speech, and after a glimpse of understanding between them, they decide to beat YOU.",
    
    	c1: "Hey I'm coming in peace...",
    	a1: "go:rand12_4",
    
        r2: "strength>=80",
    	c2: "I didn't want to resort to violence, but I see no choice...",
    	a2: "if:strength>=120?go:rand12_5;go:rand12_4"
    };
    
    this.rand12_3 = {
    	text: "The $SPECIES_P$ look at you while you do your peacemaker speech, and in minutes they calm down and start reasoning. The discussion ends with a handshake, and they give you a couple of strong pats on the back that leave you breathless.",
    	c1: "And fortunately they were in a good mood...",
    	a1: "reputation:10|end:900"
    };
    
    this.rand12_4 = {
    	text: "They are too strong for you. You try your best, but it's not enough. They left you lying on the floor and leave together trading compliments.",
    	c1: "We could say I win. But I need to lay down for a while...",
    	a1: "reputation:5|health:1,2|end:3600"
    };
    
    this.rand12_5 = {
    	text: "Surprised, the aliens can't coordinate their attacks. Your punch knocks out one of them, and other, suddenly panicked, runs away.",
    
    	c1: "I suppose I could call it a day.",
    	a1: "reputation:5|end:900",
    
        r2: "stance<0",
    	c2: "I suppose I deserve some sort of loot as prize...",
    	a2: "credits:10,200|stance:-8|end:1200"
    };
    
    //
    
    this.rand13 = {
    	text: "You walk for awhile but nothing seems to attract your interest. This place seems really boring.",
    	c1: "Even here, nothing to see",
    	a1: "end:600"
    };
    
    //
    
    this.rand14 = {
    	text: "The corridors you explore are empty. The feeling is pretty unsettling. Maybe you went in the wrong direction?",
    	c1: "I think I took a wrong turn, I'll backtrack",
    	a1: "end:1200"
    };
    
    //
    
    this.rand15 = {
    	text: "This part of the station is less populated. You see groups of $SPECIES_P$ chatting. They look at you when you pass near them. They're not smiling.",
    	c1: "Maybe I won't pass too close to them",
    	a1: "end:600"
    };
    
    //
    
    this.rand16 = {
    	text: "You had entered the wrong corridor, and now you must walk through conducts, alleys, crossroads, climb ladders and use secondary elevators. You can't understand precisely where you are. You're lost. After asking several people you manage to reach your destination. You sight with relief.",
    	c1: "What a nightmare!",
    	a1: "end:1800"
    };
    
    //
    
    this.rand17 = {
    	text: "The atmosphere is very relaxed, but also dull. People walk slowly, their chat has a distinct monotonous sound. There's also a strange smell in the air. You feel dizzy for a moment.",
    	c1: "I hope this will pass soon",
    	a1: "end:300"
    };
    
    //
    
    this.rand18 = {
    	text: "A sexy and suave $SPECIES_S$, from the corner of an alley, asks you with a mellow voice if you want some company. 'Are 80cr enough to pay for a little bit of relax, away from you stressful life?'",
    	requires: "credits>=80",
    
    	c1: "Thanks for the offer, but I'm not so stressed...",
    	a1: "end:300",
    
        //r2: "credits>=80",
    	c2: "Yes, maybe I need this right now",
    	//a2: "credits:-80|time:7200|go:rand18_1",
    	a2: "if:credits>=80?go:rand18_1;go:rand18_2",
    
        //r3: "credits>=160",
    	c3: "Let's make it 160cr and spend a little more time together",
    	//a3: "credits:-160|time:14400|go:rand18_2"
        a3: "if:credits>=160?go:rand18_3;go:rand18_2",
    };
    
    this.rand18_1 = {
    	text: "You spend time with your charming partner. A very relaxing experience, as promised.",
    	c1: "Time to go back on the street",
    	a1: "credits:-80|sickness:0,1|end:0"
    };
    
    this.rand18_2 = {
        text: "'Are you joking! You have no money for this! And I don't do work for charity!'\nThat said, the $SPECIES_S$ walks away swearing against you.",
        c1: "I think she likes me",
        a1: "end:300"
    };
    
    this.rand18_3 = {
    	text: "You spend so much time with your charming partner. A very fun and relaxing experience, maybe more than advertised.",
    	c1: "Unfortuntaley it's time to go back on the street...",
    	a1: "credits:-160|sickness:0,2|end:0"
    };
    
    //
    
    this.rand19 = {
    	text: "You're walking through a massive crowd, when you feel a rather strange movement around you. When you find a free corner you check your clothes, and discover that someone has mugged part of your credits...",
    	requires: "credits>=200",
    	c1: "Still they haven't taken all",
    	a1: "credits:-10,-100|end:600"
    };
    
    //
    
    this.rand20 = {
    	text: "A drunken $SPECIES_S$ asks you if you can bring $GENDEROBJ$ home. Problem is: you can't understand where $GENDERSUBJ$ lives. $GENDERSUBJ$ tries to give indication but it's more confusing than before.",
    	c1: "Let's try another time. Which way did you came?",
    	a1: "go:rand20_1",
    	c2: "I give up",
    	a2: "end:900"
    };
    
    this.rand20_1 = {
        text: "You accompany the $SPECIES_S$ from corridor to corridor, until you stop at the center of an intersection. Your companion looks around aimlessly. After a minute or two, he points a seemingly random direction.",
        c1: "I hope this is it",
        a1: "time:300|go:rand20_2,rand20_2,rand20_2,rand20_3",
        c2: "No, I can't stand it anymore",
        a2: "end:900"
    };
    
    this.rand20_2 = {
        text: "The $SPECIES_S$ seems more confident, but you continue walking without a coherent destination. This thing is going to last forever.",
        c1: "Ok, only another corridor and then I give up",
        a1: "time:300|go:rand20_2,rand20_2,rand20_2,rand20_4",
        c2: "I'm sorry but I have no more time... good luck and good bye",
        a2: "end:900"
    };
    
    this.rand20_3 = {
        text: "Finally you arrive to the door of a humble apartment. The $SPECIES_S$ is very happy and gives you a strong handshake. He thanks you for an entire minute before leaving.",
        c1: "Thanks...",
        a1: "end:300"
    };
    
    this.rand20_4 = {
        text: "Finally you arrive to the door of a humble apartment. The $SPECIES_S$ is very happy and gives you a strong handshake. He thanks you for an entire minute before leaving. Before entering the apartment, the drunkard throw in your hands some credits: 'I apologize for the hassle', mumbles.",
        c1: "Thanks...",
        a1: "credits:50,100|end:300"
    };
    
    //
    
    this.rand21 = {
    	text: "As you walk you encounter an emergency medical camp. A man in bio-suit is telling people that an alien flu is just arrived on the station. There are already some cases, they are treating it. There's no reason to panic, but everyone should be more careful from now on.",
    	requires: "sickness<2",
    	c1: "I'm already careful. I don't need any more hints",
    	a1: "sickness:0,1|end:300",
    	c2: "Oh yeah perfect, better to stay at large.",
    	a2: "sickness:0,1|end:300"
    };
    
    //
    
    this.rand22 = {
    	text: "You stop to listen, together with other persons, to a robo-bard at a corner of the street. It is telling	a story of brave pilots, daredevil bounty hounters, of fearful pioneers on desolate colonies, and greedy explorers on haunted derelicts, accompanied by an ancient and partially ruined song. The robo-bard moves and emit lights to underline the most dangerous moments of the story, and the audience is silent in awe.",
    	requires: "gov=feudal",
    
        r1: "credits>=5",
    	c1: "Aye bard, your stories are well worth 5cr",
    	a1: "credits:-5|end:1200",
    
        r2: "credits>=1",
    	c2: "Aye bard, your stories are well worth 1cr",
    	a2: "credits:-1|end:1200",
    
    	c3: "Aye bard, good story, I'll give you my approval",
    	a3: "end:1200"
    };
    
    this.rand23 = {
    	text: "A group of $SPECIES_S$ hunters cross through the station riding their mounts - not without some difficulty, but noone laughs or joke at them. Meanwhile, the hunters servants unkindly push the people away from the path of their masters.\n\nListening to the hunters chatting you understand that it's better for you if you don't understand the game they're searching for...",
    	requires: "gov=feudal",
    	c1: "I want to stay as far as possible from those creepies",
    	a1: "end:300"
    };
    
    this.rand24 = {
    	text: "You discover a semidestroyed droid among the trash. It is still functioning, endlessly repeating words that you barely understand. It could be a name, or anything else, really. You don't know why the droid is repeating these words.",
    	requires: "gov=anarchy-feudal-multigovernmental-dictatorship|tech=lowtech",
    	c1: "Probably it's only some glitch in the software",
    	a1: "end:120",
    };
    
    this.rand25 = {
    	text: "'Hello visitor!'\n\nA commercial droid waves to you and recommend to visit the station market, wishing you can do better purchases.\nAfter some seconds, and a lot of ticking and clicking, he suggest you to invest in $COMMODITY$.\n\nOn a side of the robot you notice the near-erased logo of a group of market brokers.",
    	requires: "gov=corporate",
    	c1: "I don't think it is completely unbiased in its opinions...",
    	a1: "end:180"
    };
    
    this.rand26 = {
    	text: "As you walk with other people, you're pushed away. You help a tourist that was falling over, and turn your head to see a $SPECIES_S$ supercelebrity, accompanied by $GENDERPOSS$ entourage and a little army of bodyguards. After them, another little army of reporters follows, photographs and photo-drones. There are flashes, there are questions, there is some scuffle. When the group is passed, you can resume your walk.",
    	requires: "gov=democracy-corporate",
    	c1: "I can't stand these VIPs",
    	a1: "end:300"
    };
    
    this.rand27 = {
    	text: "Suddenly the lights go out. The station switches to emergency lights. A voice in the intercomm starts repeating: 'THERE HAS BEEN A FAILURE ON THE ELECTRIC POWERGRID. WE SUGGEST VISITORS TO DO NOT PANIC. THE LIGHTS WILL BE RESTORED AS SOON AS POSSIBLE.'\n\nAfter a few minutes, the ligths go back.",
    	requires: "tech=lowtech",
    	c1: "Ok, everything's normal",
    	a1: "end:180"
    };
    
    this.rand28 = {
    	text: "Suddenly you notice a noise similar to a waterfall, and you see puddles of water on the floor. A voice in the intercomm starts repeating: 'THERE HAS BEEN A FAILURE IN THE WATER SYSTEM. WE SUGGEST VISITORS TO DO NOT PANIC. THE MALFUNCTIONING WILL BE FIXED AS SOON AS POSSIBLE.'\n\nAfter a few minutes, the waterfall noises stop.",
    	requires: "tech=lowtech",
    	c1: "Ok, everything's normal, I suppose",
    	a1: "end:180"
    };
    
    this.rand29 = {
    	text: "Suddenly you notice a strange smell in the air, and you see some people passing out. A voice in the intercomm starts repeating: 'THERE HAS BEEN A FAILURE IN THE VENTILATION SYSTEM. WE SUGGEST VISITORS TO DO NOT PANIC. THE MALFUNCTIONING WILL BE FIXED AS SOON AS POSSIBLE.'\n\nAfter a few minutes, the air return fresh.",
    	requires: "tech=lowtech",
    	c1: "Ok, everything is normal again... fortunately",
    	a1: "end:180"
    };
    
    this.rand30 = {
    	text: "As you walk in a quiet part of the area, you see some kids 'tagging' a corridor wall with colorful and luminescent spray paint. You can't recognize a precise shape or element, every color and line seems to mold and fuse into the others, like living creatures.",
    	requires: "flag_defacedShip=0",
    	c1: "This is a real mess. I'll call the security to stop this defacement!",
    	a1: "go:rand30_1,rand30_2",
    	c2: "It's none of my concern. And these corridors need a repaint, after all...",
    	a2: "stance:-2|end:120"
    };
    
    this.rand30_1 = {
    	text: "You call a Galsec official, that readily come to the place. The kids have run away, but you can point at the wall painted. The official nods gravely and thanks you for your report.",
    	c1: "It was my duty",
    	a1: "stance:2|end:240"
    };
    
    this.rand30_2 = {
    	text: "You call a Galsec official, that readily come to the place. The kids have run away, but you can point at the wall painted. The official nods gravely and thanks you for your report.",
    	c1: "It was my duty",
    	a1: "stance:2|flag_defacedShip:1|end:240"
    };
    
    Scripts/LITF_Navigation.js
    "use strict";
    
    this.name	= "LITF_Navigation";
    this.author	= "BeeTLe BeTHLeHeM";
    this.copyright	= "2015 BeeTLe BeTHLeHeM";
    this.description= "Life In The Frontier - Navigation";
    this.licence	= "CC BY-NC-SA 4.0";
    
    ///////////////////////////////////////
    
    var LITF_placeLabel = "";
    
    this.LITF_lastPlaceLabel = "";
    
    this.$startNavigation = function() {
    	var s = player.ship.dockedStation;
    	if( s && !s.allegiance || s.allegiance == "galcop" )
    		$goPlace("area1");
    	else $goPlace("area1_nongalcop");
    };
    
    
    this.$statusScreen = function() {
        var _co = worldScripts.LITF_Common;
    
        var sText = this.$setStatusText();
        var sChoices = this.$setStatusChoices();
    
        mission.runScreen(
            { 
                title:"COMMANDER STATUS", 
                message:sText,
    	    screenID:"hdbg-station", //for HD Backgrounds OXP
                choices:sChoices 
            }, 
            this.$statusScreenChoice
        );
    };
    
    this.$setStatusText = function() {
        var _rpge = worldScripts.LITF_RPGElements;
        var _co = worldScripts.LITF_Common;
        var _litf = worldScripts.LITF;
    
        var msText = "[COMMANDER RESUME]\n\n";
        
        msText += "Commander " + player.name + ", for the people on the station you're " + _rpge.$getReputationFromValue(_litf.LITF_cmdStats.reputation) + ". ";
        msText += "You consider yourself " + _rpge.$getStanceFromValue(_litf.LITF_cmdStats.stance) + ". ";
        msText += "Your physical shape is " + _rpge.$getStrengthFromValue(_litf.LITF_cmdStats.strength) + ". ";
        msText += "You currently have " + _co.$formatNumber(player.credits) + "cr. ";
        
        if (_litf.LITF_flags.getDrunk == 1) {
            msText += "\n* You're drunk. Hiccups, a bit of nausea and the world swinging left and right.";
        }
    
        var hDesc = _rpge.$getHealthFromValue(_litf.LITF_cmdStats.health);
        if (hDesc != "") { 
            msText += "\n* " + hDesc; 
        }
    
        var sDesc = _rpge.$getSicknessFromValue(_litf.LITF_cmdStats.sickness);
        if (sDesc != "") { 
            msText += "\n* " + sDesc; 
        }
        
        msText += "\n";
        
        // Universal Fitness Badge status
        
        var fitBadge = _litf.LITF_flags.fitBadge;
        if (fitBadge > -1) {
            var expired = _co.$checkTimeForExpiration(fitBadge);
            if (expired == 1) {
                msText += "\nYou own an expired Universal Fitness Badge.";
            } else {
                var remain = _co.$formatRemainingTime(fitBadge);
                
                msText += "\nYou own a Universal Fitness Badge: it will expire in " + remain + ".";
            }
        }
    
        msText += "\n";
    
        // XXX Contractors and missions
        /*
        if (this.LITF_contractorData != undefined && this.LITF_contractorData != "") {
            var cData = this.LITF_contractorData;
    
            // Destination system ID, NPC name, mission type, max time
            var cSplit = cData.split("|");
    
            var remainTime = parseInt(cSplit[3]) - clock.seconds;
            var formattedTime = this.$formatTime(remainTime);
    
            msText += "\nCONTRACTOR: Meet " + cSplit[1] + " at " + System.systemNameForID(parseInt(cSplit[0])) 
                + " for a job. (" + formattedTime + " before expiring).";
        }
    
        if (this.LITF_missionData != undefined && this.LITF_missionData != "") {
            var mData = this.LITF_missionData;
    
            // cargo, pay, systemDestId, maxTime, missionType, systemStartId    
            var mSplit = mData.split("|");
    
            var remainTime = parseInt(mSplit[3]) - clock.seconds;
            var formattedTime = this.$formatTime(remainTime);
    
            var cType = mSplit[4].toUpperCase() + " MISSION";
    
            msText += "\n" + cType + ": for " + mSplit[1] + "cr deliver " + mSplit[0] 
                + " to " + System.systemNameForID(parseInt(mSplit[2])) + " within " + formattedTime + ".";
        }
        */
    
        //msText += "\n";
    
        return msText;
    };
    
    
    this.$setStatusChoices = function() {
        var msChoiceList = {};
        msChoiceList["BACK"] = "Back to the Hangar";
        return msChoiceList;
    };
    
    
    this.$statusScreenChoice = function(choice) {
        switch (choice) {
            case "BACK":
                worldScripts.LITF_Navigation.$startNavigation();
    	break;
        }
    };
    
    
    this.$goPlace = function(pLabel) {
    	var _co = worldScripts.LITF_Common;
    	var _ec = worldScripts.LITF_EventsCatalog;
    	var _rpge = worldScripts.LITF_RPGElements;
    	var _litf = worldScripts.LITF;
    
    	// The commander is dying!
    	if (_litf.LITF_cmdStats.health >= 5 || _litf.LITF_cmdStats.sickness >= 5) {
    		if (pLabel.indexOf("area") == 0) {
    			var passoutchance = Math.floor(Math.random() * 100) + 1;
    			// The commander pass out!
    			if (passoutchance < 50) {
    				pLabel = "passout0";
    			}
    		}
    	}
    
    	if (pLabel == "area1" && _litf.LITF_flags.defacedShip == 1) {
    		pLabel = "area1_defacedShip";
    	}
    
        LITF_lastPlaceLabel = LITF_placeLabel;
    	LITF_placeLabel = pLabel;
    	_co.$log("[goPlace] " + LITF_placeLabel);
    
    	var pTitle = "AROUND THE SPACE STATION";
    
    	var LITF_place = eval("this." + pLabel + ";");
    	//_co.$log("[goPlace] text = " + LITF_place.text);
    
    	var placeText = "[ " + _rpge.$getReputationFromValue(_litf.LITF_cmdStats.reputation) + " " + player.name + "  |  " + _co.$formatNumber(player.credits) + "cr  |  Wounds: " + _rpge.LITF_healthShort[_litf.LITF_cmdStats.health] + "  |  Health: " + _rpge.LITF_sicknessShort[_litf.LITF_cmdStats.sickness] + " ]\n\n";
    
        placeText += this.buildLocationText(LITF_place);
    
    	placeText += this.$addRandomHealthSnippet();
    
    	placeText += this.$addRandomStatusSnippet();
    
    	placeText = _co.$replaceConstants(placeText);
    
        //_co.$log("[goPlace] placeText = " + placeText);
    
    	var placeChoices = _co.$extractChoices(LITF_place);
    
    	var sid = null;
    	if( pLabel == "area1_nongalcop" ) {  //for HD Backgrounds OXP
    		var w = worldScripts.hdbg;
    		if( w ) sid = "hdbg-station";
    	}
    
    	mission.runScreen(
    		{ 
    			title: pTitle,
    			message: placeText,
    			screenID: sid, //for HD Backgrounds OXP
    			choices: placeChoices
    		},
    		this.$selectChoice
    	);
    
    	_co.$screenBackground(LITF_place.background);
    	if( sid ) {
    		this.$Roles = w.$Roles;
    		this.$SetHDBG = w.$SetHDBG;
    		w.guiScreenChanged("GUI_SCREEN_MISSION"); //set HD Background
    	}
    	
    };
    
    this.buildLocationText = function(pData) {
        var _co = worldScripts.LITF_Common;
    
        var textCounter = 0;
        var valid = 1;
    
        var placeText = "";
    
        var staticText = pData.text;
        if (staticText) {
            // text - static text
            //_co.$log("[buildLocationText] staticText = " + staticText);
            placeText = staticText;
        } else {
            // text0, text1 ... - dynamic text
    
            while (valid == 1) {
                var t = "text" + textCounter;
                var text = eval("pData." + t + ";");
        
                if (text) {
                    _co.$log("[buildLocationText] indexed text " + t + " = " + text);
                    var tSplit = text.split("|");
                    if (tSplit.length == 1) {
                        // No conditions - always valid, always shown
                        placeText += text;
                    } else {
                        // Needs to validate condition
                        var validate = 1;
                        var LITF_items = tSplit[0].split(",");
                        for (var i = 0; i < LITF_items.length; i++) {
                        
                            if (_co.$checkRequirements(LITF_items[i]) == 0) { validate = 0; }
                            _co.$log("[validateChoice] " + LITF_items[i] + " = " + validate);
                        }
    
                        if (validate == 1) { placeText += tSplit[1]; }
                    }
                    
                    textCounter++;            
                } else {
                    valid = 0;
                }
            }
        }
        
        //_co.$log("[buildLocationText] placeText = " + placeText);
    
        return placeText;
    };
    
    this.$addRandomStatusSnippet = function() {
    	var _litf = worldScripts.LITF;
    
        var text = "";
    	var chance = Math.floor(Math.random() * 100);
    
    	if (_litf.LITF_flags.getDrunk == 1) {
    		if (chance < 10) {
    			text = "\n\nYou produce a undignified belch.";
    		} else if (chance < 20) {
    			text = "\n\nYou stumble on your feet.";
    		} else if (chance < 30) {
    			text = "\n\nYou hiccup.";
    		}
    	}
    
    	return text;
    };
    
    
    this.$addRandomHealthSnippet = function() {
    	var _litf = worldScripts.LITF;
    
        var text = "";
    	var chance = Math.floor(Math.random() * 100);
    
    	var health = _litf.LITF_cmdStats.health;
    	var sickness = _litf.LITF_cmdStats.sickness;
    
    	if (health > 0 && chance < 10) {
    		switch (health) {
    			case 1: 
    				text = "\n\nYou feel your skin slightly itching.";
    				break;
    			case 2:
    				text = "\n\nYou feel a bit of pain while you walk.";
    				break;
    			case 3:
    				text = "\n\nYou feel pain even standing still.";
    				break;
    			case 4:
    				text = "\n\nYou feel great pain, that makes you moan in anguish.";
    				break;
    			case 5: 
    				text = "\n\nYou can't walk straight, trying your best to not fall over. The pain is unbearable.";
    				break;
    		}
    	} else if (sickness > 0 && chance < 20) {
    		switch (sickness) {
    			case 1: 
    				text = "\n\nYou cough a couple of times.";
    				break;
    			case 2:
    				text = "\n\nYou sneeze and feel suddenly cold for a while.";
    				break;
    			case 3:
    				text = "\n\nYou feel nauseated.";
    				break;
    			case 4:
    				text = "\n\nYou feel incredibly tired.";
    				break;
    			case 5: 
    				text = "\n\nYour head spin, you can't walk straight.";
    				break;
    		}
    	}
    
    	return text;
    };
    
    
    this.$selectChoice = function(choice) {
    	var _co = worldScripts.LITF_Common;
    
    	_co.$log("[selectChoice] choice = " + choice);
    
    	if (choice == null || choice == "null") { return; }
    
    	var action = choice.replace('c', 'a');
    	_co.$log("[selectChoice] action = " + action);
    
    	// Retrieve the associate actions
    
    	var actionData = eval("worldScripts.LITF_Navigation." + LITF_placeLabel + "." + action);
    
        _co.$executeActions(actionData);
    
    	/*
        var actionsSplit = actionData.split("|");
    
    	// Iterate, parse and execute the actions
    	for (var i = 0; i < actionsSplit.length; i++) {
    		var action = actionsSplit[i];
    
            _co.$executeAction(action);
    	}
    	*/
    };
    
    
    ///////////////////////////////////////
    
    this.passout0 = {
    	text: "Suddenly you experience a strong vertigo, your legs become unstable and your body get permeated by a glacial coldness. You fall on the floor, uncapable to say anything, and faint while around you can still hear a far echo of worried voices that call for help... after that, darkness.",
    	c1: "...",
    	a1: "time:3600,14400|paytreatment:health|paytreatment:sickness|goNav:passout1"
    };
    
    this.passout1 = {
    	text: "Time passes... until you come round, starting to perceive the world around, chaotic and confuse... the lights blinds you, but you can barely move. Someone is near you, and you need to focus completely on $GENDERPOSS$ to understand the words...\n\n'...we managed to get back from the edge of death, basically. In these cases law force us to apply a complete healing process, and confusion aside, you should get well about in twenty minutes. When you feel you can walk again, come to the reception.'\n\nThat was a doctor, and you're in the Medical Center - now you recognize it. You take a deep breath and wait. The world is starting to stabilize...",
    	background: "litf_bg_medcenter.png",
    	c1: "...",
    	a1: "time:600,1200|goNav:passout2"
    };
    
    this.passout2 = {
    	text: "After a while, against your conjectures, you really feel you can stand up and walk. You're starting to feel better.\n\nYou wear your clothes, and exit the room to the Medical Center reception.",
    	background: "litf_bg_medcenter.png",
    	c1: "Let's hear the news...",
    	a1: "goNav:passout3"
    };
    
    this.passout3 = {
    	text: "The receptionist smiles as usual. She says that the healing process gone well, and that you are healthy enough again.\n\nAfter this, the receptionist reminds you that the cures weren't free. The price for the process has already been withdrawn from your account, and on top of this there is an additional 200cr for the emergency procedure. Don't worry if you haven't enough money: the station bank system will automatically adjust your bounty for debts insolvence. You can clean your bounty using the Galcop terminal at the precinct.\n\n'Good day, commander.'",
    	background: "litf_bg_medcenter.png",
    	c1: "Yes, really a good day...",
    	a1: "reputation:-15|goNav:area2_2"
    };
    
    ///////////////////////////////////////
    
    this.area1 = {
        text: "You're in the hangar where your ship is parked. There are other ships, in different conditions. You see a few of them being examined by the station droids, floating slowly around the hull searching for breaches.",
        background: "litf_bg_hangar.png",
        c1: "Go to the Docks",
        a1: "randomAndGo:lobby1",
        c2: "Embark your ship",
        a2: "endNav:0",
        c3: "See your status",
        a3: "showStatus:1"
    };
    
    this.area1_nongalcop = {
        text: "This station is considerably different than main GalCop stations. You're in the hangar where your ship is parked together with other ships. There are some closed doors around, looks like you should go back into your ship and do your orders via ship communication channels.",
        background: "litf_bg_hangar.png",
        c1: "Embark your ship",
        a1: "endNav:0",
        c2: "See your status",
        a2: "showStatus:1"
    };
    
    /*
    this.lobby1 = {
        text: "You're in the Docks.\n\nYou see droids moving crates and containers off and on ships. The activity is unrelenting.\n\nFrom here:\n- You can go to your ship in the Hangar\n- You can enter the Cargo Area\n- You can take the Lift and go to the Main Concourse, the Recreation Bridge or the Galcop Precinct.\n\n$LOBBYSNIPPET$",
        background: "litf_bg_docks.png",
        c1: "Enter the Hangar",
        a1: "randomAndGo:area1",
        c2: "Enter the Cargo Area",
        a2: "randomAndGo:area1_2",
        c3: "Lift >> Main Concourse",
        a3: "time:120|goNav:lobby2",
        c4: "Lift >> Recreation Bridge",
        a4: "time:240|goNav:lobby3",
        c5: "Lift >> Galcop Precinct",
        a5: "time:360|goNav:lobby4"
    };
    */
    
    this.lobby1 = {
        text: "You're in the Docks.\n\nYou see droids moving crates and containers off and on ships. The activity is unrelenting.\n\n$LOBBYSNIPPET$",
        background: "litf_bg_docks.png",
        c1: "Look at the station map",
        //a1: "goNav:map1",
        a1: "goNav:map",
        c2: "Enter the Hangar",
        a2: "randomAndGo:area1",
        c3: "Enter the Cargo Area",
        a3: "randomAndGo:area1_2",
        c4: "Lift >> Main Concourse",
        a4: "time:120|goNav:lobby2",
        c5: "Lift >> Recreation Bridge",
        a5: "time:240|goNav:lobby3",
        c6: "Lift >> Galcop Precinct",
        a6: "time:360|goNav:lobby4"
    };
    
    
    
    this.area1_defacedShip = {
        text: "You're in the Docks Area.\n\nThere's people going around, and droids moving crates and containers off and on ships. The activity is unrelenting.\n\nYou can see your ship from here, but it's not exactly like you remembered. It seems someone has painted over the hull a series of colorful insults and raunchy words. A worker suggests you use the Area droids to clean the ship before departing - those graffiti could grant you a fine for public indecence.\n\nYou're annoyed but take control of the droids and erase the insults - a task that takes you an hour...",
        c1: "Damn kids...",
        a1: "time:3600|flag_defacedShip:0|goNav:area1"
    };
    
    
    this.area1_2 = {
        text: "You're in the Cargo Area.\n\nDroids transports here all the cargo unloaded from ships, and get back to the ships the containers to load into them. There are dozen of containers of various colors, and the commodities are being put into or removed from them, waiting to be transferred to Storage.\n\nFrom here you can visit the Storage section, or return to the Docks.",
        background: "litf_bg_cargoarea.png",
        c1: "Go to the Docks",
        a1: "randomAndGo:lobby1",
        c2: "Visit the Storage section",
        a2: "goNav:storage0"
    };
    
    /*
    this.lobby2 = {
        text: "You're in the Main Concourse lobby.\n\nFrom here:\n- You can go to one of three sections of the Concourse:\n  Section A: Passengers Lounge, Hotel\n  Section B: Medical Center, Church of the Cosmic Wanderer, Bookshop\n  Section C: ## DATA NOT FOUND ##\n- You can take the Lift and go to the Docks, the Recreation Bridge or the Galcop Precinct.\n\n$LOBBYSNIPPET$",
        c1: "Enter the Concourse-A section",
        a1: "randomAndGo:area2_1",
        c2: "Enter the Concourse-B section",
        a2: "randomAndGo:area2_2",
        c3: "Enter the Concourse-C section",
        a3: "randomAndGo:area2_3",
        c4: "Lift >> Docks",
        a4: "time:120,goNav:lobby1",
        c5: "Lift >> Recreation Bridge",
        a5: "time:120|goNav:lobby3",
        c6: "Lift >> Galcop Precinct",
        a6: "time:240|goNav:lobby4"
    };
    */
    
    this.lobby2 = {
        text: "You're in the Main Concourse lobby.\n\n$LOBBYSNIPPET$",
        c1: "Look at the station map",
        //a1: "goNav:map2",
        a1: "goNav:map",
        c2: "Enter the Concourse-A section",
        a2: "randomAndGo:area2_1",
        c3: "Enter the Concourse-B section",
        a3: "randomAndGo:area2_2",
        c4: "Enter the Concourse-C section",
        a4: "randomAndGo:area2_3",
        c5: "Lift >> Docks",
        a5: "time:120|goNav:lobby1",
        c6: "Lift >> Recreation Bridge",
        a6: "time:120|goNav:lobby3",
        c7: "Lift >> Galcop Precinct",
        a7: "time:240|goNav:lobby4"
    };
    
    this.area2_1 = {
        text: "You're in the Concourse-A section.\n\nYou see groups of people walking between the shops and the large decorated plaza.\n\nFrom here you can visit the Passengers Lounge, the Hotel, go to the lobby or to the other Concourse sections.",
        background: "litf_bg_mainconcourse1.png",
        c1: "Exit the Main Concourse",
        a1: "randomAndGo:lobby2",
        c2: "Visit the Passengers Lounge",
        a2: "goNav:plounge0",
        c3: "Visit the Hotel",
        a3: "goNav:hotel0",
        c4: "Enter the Concourse-B section",
        a4: "randomAndGo:area2_2",
        c5: "Enter the Concourse-C section",
        a5: "randomAndGo:area2_3"
    };
    
    
    this.area2_2 = {
        text: "You're in the Concourse-B section.\n\nYou see many people talking to each other. There's a big fountain with benches around.\n\nFrom here you can visit the Church of the Cosmic Wanderer, the Bookshop or the Medical Center for your health-related issues, go to the lobby or to the other Concourse sections.",
        background: "litf_bg_mainconcourse2.png",
        c1: "Exit the Main Concourse",
        a1: "randomAndGo:lobby2",
        c2: "Sit on a bench near the fountain",
        a2: "goNav:area2_4",
        c3: "Visit the Church of the Cosmic Wanderer",
        a3: "goNav:church0",
        c4: "Visit the Bookshop",
        a4: "goNav:bookshop0",
        c5: "Visit the Medical Center",
        a5: "goNav:med0",
        c6: "Enter the Concourse-A section",
        a6: "randomAndGo:area2_1",
        c7: "Enter the Concourse-C section",
        a7: "randomAndGo:area2_3"
    };
    
    
    this.area2_3 = {
        text: "You're in the Concourse-C section.\n\nThere are people working in the gardens. The food processing is automated, and you smell a sweet mix of odours from the facilities.\n\nFrom here you can go to the lobby or to the other Concourse sections.",
        background: "litf_bg_hpgardens.png",
        c1: "Exit the Main Concourse",
        a1: "randomAndGo:lobby2",
        c2: "Enter the Concourse-A section",
        a2: "randomAndGo:area2_1",
        c3: "Enter the Concourse-B section",
        a3: "randomAndGo:area2_2"
    };
    
    
    this.area2_4 = {
        text: "You sit on a bench. The water noise behind you is relaxing, almost hypnotic. You start to zone out, your thoughts going astray... you should rest here for a while...",
        c1: "Better if I go, I don't want to fall asleep here",
        a1: "goNav:area2_2",
        c2: "Stay still. Let's wait some time here",
        a2: "time:1800|goNav:area2_4"
    };
    
    /*
    this.lobby3 = {
        text: "You're in the Recreation Bridge lobby.\n\nFrom here:\n- You can go to the level sections:\n  Delight Avenue: Local Bar, Wild Worlds Virtual Tour, Museum\n  Olympian Square: Fit Center\n  Mecenate Court: Art Gallery, Opera House, Cinema Hall\n- You can take the Lift and go to the Docks, the Main Concourse or the Galcop Precinct.\n\n$LOBBYSNIPPET$",
        c1: "Enter the Delight Avenue",
        a1: "randomAndGo:area3_1",
        c2: "Enter the Olympian Square",
        a2: "randomAndGo:area3_2",
        c3: "Enter the Mecenate Court",
        a3: "randomAndGo:area3_3",
        c4: "Lift >> Docks",
        a4: "time:240,goNav:lobby1",
        c5: "Lift >> Main Concourse",
        a5: "time:120|goNav:lobby2",
        c6: "Lift >> Galcop Precinct",
        a6: "time:240|goNav:lobby4"
    };
    */
    
    this.lobby3 = {
        text: "You're in the Recreation Bridge lobby.\n\n$LOBBYSNIPPET$",
        c1: "Look at the station map",
        //a1: "goNav:map3",
        a1: "goNav:map",
        c2: "Enter the Delight Avenue",
        a2: "randomAndGo:area3_1",
        c3: "Enter the Olympian Square",
        a3: "randomAndGo:area3_2",
        c4: "Enter the Mecenate Court",
        a4: "randomAndGo:area3_3",
        c5: "Lift >> Docks",
        a5: "time:240|goNav:lobby1",
        c6: "Lift >> Main Concourse",
        a6: "time:120|goNav:lobby2",
        c7: "Lift >> Galcop Precinct",
        a7: "time:240|goNav:lobby4"
    };
    
    this.area3_1 = {
        text: "You're in Delight Avenue.\n\nPeople joke and laugh, there are expensive clothes around here. You can hear music playing in background.\n\nFrom here you can visit the local Bar, the Museum or the Wild Worlds Virtual Tour, go to the lobby, to Olympian Square or to Mecenate Court.",
        background: "litf_bg_entcorridor.png",
        c1: "Exit the Recreation Bridge",
        a1: "randomAndGo:lobby3",
        //r2: "flag_getDrunk=0",
        c2: "Visit the local Bar",
        a2: "if:flag_getDrunk=0?goNav:bar0;goNav:bar0_1",
        c3: "Visit the museum",
        a3: "goNav:museum0",
        c4: "Visit the Wild Worlds Virtual Tour",
        a4: "goNav:wwvt0",
        c5: "Enter Olympian Square",
        a5: "randomAndGo:area3_2",
        c6: "Enter Mecenate Court",
        a6: "randomAndGo:area3_3"
    };
    
    
    this.area3_2 = {
        text: "You're in Olympian Square.\n\nYou see people with colourful tracksuit, ready to exercise or race against other competitors. The place is filled with different sports areas and with gleeful audiences. Various holograms shows different activities and disciplines.\n\nFrom here you can visit the Fit Center, go to the lobby, to Delight Avenue or to Mecenate Court.",
        background: "litf_bg_entcorridor.png",
        c1: "Exit the Recreation Bridge",
        a1: "randomAndGo:lobby3",
        c2: "Visit the Fit Center",
        a2: "goNav:fit0",
        c3: "Enter Delight Avenue",
        a3: "randomAndGo:area3_1",
        c4: "Enter Mecenate Court",
        a4: "randomAndGo:area3_3"
    };
    
    
    this.area3_3 = {
        text: "You're in Mecenate Court.\n\nThis place is decorated with columns and galleries sculpted in ancient styles. Exotic vines climb the walls in elaborated patterns. In the wide central court you see several people discussing and debating a variety of topics.\n\nFrom here you can visit the Art Gallery, the Opera House or the Cinema Hall, go to the lobby, to Delight Avenue or to Olympian Square.",
        background: "litf_bg_entcorridor.png",
        c1: "Exit the Recreation Bridge",
        a1: "randomAndGo:lobby3",
        r2: "flag_artGallery=0",
        c2: "Visit the Art Gallery",
        a2: "goNav:art0",
        r3: "flag_operaHouse=0",
        c3: "Visit the Opera House",
        a3: "goNav:opera01,opera02,opera03",
        r4: "flag_cinemaHall=0",
        c4: "Visit the Cinema Hall",
        a4: "goNav:cinema0",
        c5: "Enter Delight Avenue",
        a5: "randomAndGo:area3_1",
        c6: "Enter Olympian Square",
        a6: "randomAndGo:area3_2",
    };
    
    /*
    this.lobby4 = {
        text: "You're in the Galcop Precinct.\n\nFrom here:\n- You can go to the Galcop Facilities\n- You can take the Lift and go to the Docks, the Main Concourse or the Recreation Bridge.\n\n$LOBBYSNIPPET$",
        c1: "Enter the Galcop Facilities",
        a1: "randomAndGo:area4_1",
        c2: "Lift >> Docks",
        a2: "time:360|goNav:lobby1",
        c3: "Lift >> Main Concourse",
        a3: "time:240|goNav:lobby2",
        c4: "Lift >> Recreation Bridge",
        a4: "time:120|goNav:lobby3",
    };
    */
    
    this.lobby4 = {
        text: "You're in the Galcop Precinct.\n\n$LOBBYSNIPPET$",
        c1: "Look at the station map",
        //a1: "goNav:map4",
        a1: "goNav:map",
        c2: "Enter the Galcop Facilities",
        a2: "randomAndGo:area4_1",
        c3: "Lift >> Docks",
        a3: "time:360|goNav:lobby1",
        c4: "Lift >> Main Concourse",
        a4: "time:240|goNav:lobby2",
        c5: "Lift >> Recreation Bridge",
        a5: "time:120|goNav:lobby3",
    };
    
    
    this.area4_1 = {
        text: "You're in the Galcop Facilities.\n\nYou see agents responding to calls and going on patrols. A number of desks is busy with reports from station visitors.\n\nImmediately into the Facilities you see a row of Galcop terminals.\n\nFrom here you can enter the Mission Briefing Room, the Detainment Zone and the Pilot Course Room, or exit to the Precinct.",
    	c1: "Exit the Galcop Facilities",
    	a1: "goNav:lobby4",
    	c2: "Go to one of the Galcop terminals",
    	a2: "goNav:area4_2",
    	c3: "Enter the Mission Briefing Room",
    	a3: "goNav:area4_3",
    	c4: "Enter the Detainment Zone",
    	a4: "goNav:area4_4",
    	c5: "Enter the Social Services Zone",
    	a5: "goNav:area4_5",
    	c6: "Enter the Pilot Course Room",
    	a6: "goNav:area4_6"
    };
    
    this.area4_2 = {
    	text0: "WELCOME TO GALCOP ANONYMOUS REHABILITATION TERMINAL\n\nPUT YOU RIGHT PALM ON THE SENSOR\n\nVERIFICATION COMPLETE\n\nHELLO, COMMANDER,",
    	text1: "bounty<1|\n\nYOUR CRIMINAL RECORD IS CLEAN.",
    	text2: "bounty>0|\n\nYOU CAN CLEAN YOUR CRIMINAL RECORD FOR $BOUNTYFINE$.",
    	text3: "\n\nGOOD DAY COMMANDER",
    	background: "litf_bg_terminal.png",
    	c1: "Good day, terminal",
    	a1: "goNav:area4_1",
        r2: "bounty>0,bountyfine=1",
    	c2: "I want to pay and clean my criminal record.",
    	a2: "paybountyfine:1|goNav:area4_2",
        r3: "bounty>0,bountyfine=0",
    	c3: "I have not enough money to clean my criminal record.",
    	a3: "goNav:area4_1"
    };
    
    this.area4_3 = {
        text: "The door to the briefing room is closed. An officer tells you that only Galcop associates can join the mission briefings.",
        c1: "Go away",
        a1: "goNav:area4_1"
    };
    
    this.area4_4 = {
        text: "You go to the detainment zone gate, but an officer stops before you can enter: 'Sorry, but your legal status in currently under examination. Therefore you are interdicted to this area access, unless you can produce a legitimate and proper payment for this transgression. I believe 30cr should be enough.'",
        r1: "credits>=30",
        c1: "Pay the 'fee'",
        a1: "credits:-30|goNav:area4_41",
        c2: "Go away",
        a2: "goNav:area4_1"
    };
    
    this.area4_41 = {
        text: "You are inside a big hall, full of metallic cells in a grid scheme, on multiple floors. You can hear the prisoners complaining and swearing. Galcop drones patrol the area.",
        c1: "Exit",
        a1: "goNav:area4_1"
    };
    
    this.area4_5 = {
        text0: "You enter the room, and a galcop android scans your legal status.",
        text1: "bounty=0|'Your criminal record is clean, but you can contribute to the services if you want, as a volunteer.'",
        text2: "bounty>0|'If you want you can endure a session of work to decrease your bounty, as a volunteer.'",
        //r1: "bounty>0",
        c1: "Ok, I want to endure a session",
        a1: "time:14400|reputation:2|goNav:area4_51,area4_51,area4_51,area4_52",
        c2: "Go away",
        a2: "goNav:area4_1"
    };
    
    this.area4_51 = {
        text: "You spend the session working on the back alleys of the station, cleaning floors, fixing lights, repairing blocked doors, supervising little service droids. It isn't a fun job, and at the end of the session you're tired, but you have the feeling of doing something useful.",
        c1: "I'll stop for now",
        a1: "bounty:-20|goNav:area4_1"
    };
    
    this.area4_52 = {
        text: "During the session you feel tired and careless, and as a result you get into an accident and wound yourself. Nothing to worry, you get bandaged and treated readily. But your session end here, and the associated bonus will be reduced.",
        c1: "I should be more careful",
        a1: "bounty:-5|health:1,2",
    };
    
    this.area4_6 = {
        text: "The door to the pilot course hall is closed. An officer tells you the courses are suspended for an undefined time.",
        c1: "Go away",
        a1: "goNav:area4_1"
    };
    
    /////////////////// STATION MAP ///////////////////
    
    this.map = {
        text: " ",
        background: "litf_bg_stationmap.png",
        c1: "Back to the lobby",
        a1: "goNav:back"
    };
    
    /*
    this.map1 = {
        text: "\n>>",
        background: "litf_bg_stationmap.png",
        c1: "Back to the lobby",
        a1: "goNav:lobby1"
    };
    
    this.map2 = {
        text: "\n\n\n\n\n\n>>",
        background: "litf_bg_stationmap.png",
        c1: "Back to the lobby",
        a1: "goNav:lobby2"
    };
    
    this.map3 = {
        text: "\n\n\n\n\n\n\n\n\n\n>>",
        background: "litf_bg_stationmap.png",
        c1: "Back to the lobby",
        a1: "goNav:lobby3"
    };
    
    this.map4 = {
        text: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n>>",
        background: "litf_bg_stationmap.png",
        c1: "Back to the lobby",
        a1: "goNav:lobby4"
    };
    */
    
    /////////////////// SPECIAL LOCATION ///////////////////
    
    this.bar0 = {
    	text: "The place is full of pilots. You don't see free seats at the tables, so you decide to sit at the counter. Everyone is pretty chatty: you hear talks of all kinds, public or private, and the usual jokers who take the opportunity to have a nice drink with friends.",
    	background: "litf_bg_localbar.png",
        r1: "flag_drinkChallenge=0",
    	c1: "A group at a table repeat loud: 'CHALLENGE! CHALLENGE!' Maybe I could check?",
    	a1: "goNav:bar1",
        r2: "flag_chatBartender=0",
    	c2: "I could talk a bit with the bartender",
    	a2: "goNav:bar2",
        r3: "flag_offerToCounter=0,credits>=150",
    	c3: "I could offer a drink to everyone at the counter (should cost no more than 150cr)",
    	a3: "goNav:bar3",
    	c4: "Exit the Bar",
    	a4: "time:300|goNav:area3_1"
    };
    
    this.bar0_1 = {
        text: "Suddenly, a brawny bouncer blocks you right at the entrance of the Bar. He's staring right into your eyes. 'We don't like cheaters or drunkard here, and you don't seem a cheater to me. Get lost', he says to you with a deep, serious voice.",
        c1: "I think I'll follow your advice",
        a1: "goNav:area3_1"
    };
    
    //
    
    this.bar1 = {
    	text: "You sit in front of a $SPECIES_S$ that explains to you the rules of the challenge. 'A liquor is chosen. I drink a glass. You drink a glass. Again. Until one crashes. The bet is 50cr. You're in?",
    	background: "litf_bg_localbar.png",
        r1: "credits>=50",
    	c1: "Yes, you can count me in",
    	a1: "credits:-50|goNav:bar11",
    	c2: "Not tonight, thanks",
    	a2: "goNav:bar0"
    };
    
    this.bar11 = {
    	text: "Today the liquor is the $LIQUOR$. 'First glass is mine'. The $SPECIES_S$ raise the glass and drink the content in one gulp.",
    	background: "litf_bg_localbar.png",
    	c1: "It's my turn",
    	a1: "goNav:bar12"
    };
    
    this.bar12 = {
    	text: "You raise your glass and drink. It burns, but you can stand it.",
    	background: "litf_bg_localbar.png",
    	c1: "It's your turn",
    	a1: "goNav:bar111"
    };
    
    this.bar111 = {
    	text: "'NEXT ROUND! You're not a newbie, I see!'\nThe $SPECIES_S$ raise the glass and drink the content in one gulp.",
    	background: "litf_bg_localbar.png",
    	c1: "It's my turn",
    	a1: "goNav:bar112"
    };
    
    this.bar112 = {
    	text: "You raise your glass and drink...",
    	background: "litf_bg_localbar.png",
    	c1: "It's your turn",
    	a1: "goNav:bar1111"
    };
    
    this.bar1111 = {
    	text: "'NEXT ROUND!'\nThe $SPECIES_S$ raise the glass and drink the content in one gulp.",
    	background: "litf_bg_localbar.png",
    	c1: "It's my turn...",
    	a1: "goNav:bar1112,bar1112,bar1112,bar1112,bar1113,bar1113"
    };
    
    this.bar1112 = {
    	text: "You raise your glass and drink...",
    	background: "litf_bg_localbar.png",
    	c1: "It's your turn!",
    	a1: "goNav:bar1111,bar1111,bar1111,bar1111,bar1114,bar1114"
    };
    
    this.bar1113 = {
    	text: "You focus on the glass... but now you see two glasses on the table. No, three glasses... dancing glasses. You move your hand but you can't take them, they always slip away. Then table becomes bigger and someone turn off the lights.\n\nYou awake in the street, outside the bar. Your rival pats you on the shoulder: 'You're not bad. But I won. Thanks for the money.'",
    	c1: "...burp",
    	a1: "flag_drinkChallenge:1|flag_getDrunk:1|time:3600|goNav:area3_1"
    };
    
    this.bar1114 = {
    	text: "'NEXT ROUND!'\nThat said, the $SPECIES_S$ collapses on the table! You raise one arm for victory while the other pilots at the table applaud you. The bet is yours. Too bad you're drunk, after all, because you can not keep your balance. The owner goes with you to the exit and gently throw you out. 'You can go back when you learn how to walk alone!'. The door closes but you can hear the laughters from inside.",
    	c1: "It's ok. I won!",
    	a1: "flag_drinkChallenge:1|flag_getDrunk:1|credits:100|time:1800|goNav:area3_1"
    };
    
    //
    
    this.bar2 = {
    	text: "The $SPECIES_S$ bartender pours a glass of liquor, and you start chatting. After a bit, the bartender tells you: $GOSSIP$.",
    	background: "litf_bg_localbar.png",
    	c1: "Ok, I think it's enough for now",
    	a1: "time:300|goNav:bar0"
    };
    
    //
    
    this.bar3 = {
    	text: "The customers at the counter rejoice and take their drinks. Many begin to sing. After everyone has been drinking his glass, another commander stands up and offers another round. And you have to start over!",
    	background: "litf_bg_localbar.png",
    	c1: "Let's go, another round!",
    	a1: "credits:-50,-150|reputation:5|goNav:bar31",
    	c2: "Ok, I'm out, I don't want to go too far...",
    	a2: "flag_offerToCounter:0|time:600|goNav:bar0"
    };
    
    this.bar31 = {
    	text: "You have just finished your glass, when another commander stands up and offer another round! Screams of joy and new songs! The party goes on!",
    	background: "litf_bg_localbar.png",
    	c1: "Let's go, another round!",
    	a1: "reputation:3|goNav:bar311,bar313",
    	c2: "Ok, I'm out, I don't want to go too far...",
    	a2: "flag_offerToCounter:0|time:1200|goNav:bar0"
    };
    
    this.bar311 = {
    	text: "And this glass is empty too! You try to say something when someone offers a new round! The glasses go around the counter, and you find one in your hands. This things could never end...",
    	background: "litf_bg_localbar.png",
    	c1: "Let's go, another round...",
    	a1: "reputation:2|goNav:bar31,bar313",
    	c2: "Ok, I'm out, I don't want to go too far...",
    	a2: "flag_offerToCounter:0|time:2400|goNav:bar0"
    };
    
    this.bar313 = {
    	text: "You say: 'Another round!', but there isn't another round. And there isn't the counter anymore. You open your eyes and you're on the street. The bar is closed since an hour at least. You decide to keep sitting in your place for a while, just to clear your mind.",
    	c1: "Five minutes. Five minutes and then I go...",
    	a1: "reputation:-15|flag_getDrunk:1|time:14400|goNav:area3_1"
    };
    
    ////
    
    this.art0 = {
    	text: "The art gallery is open to the public, and there is a good attendance. You see people conversing about the present exhibit, comparing different painting schools. You go to the entrance and read the following announcement:\n\nTHE ART GALLERY IS PROUD TO PRESENT\n\n[[ The masters of $ARTGENRE$ ]]\n\nFOR AN INDEFINITE AND EXTREMELY VARIABLE AMOUNT OF TIME\n\nAdmission price: 10cr",
        r1: "credits>=10",
    	c1: "Let's take a look",
    	a1: "credits:-10|flag_artGallery:1|goNav:art11,art12,art13",
    	c2: "Exit the Art Gallery",
    	a2: "goNav:area3_3"
    };
    
    this.art11 = {
    	text: "The display was better than expected. You have been amazed by certain shapes and combinations of colors and light effects. Not bad. Really.",
    	c1: "Exit the Art Gallery",
    	a1: "time:3600|goNav:area3_3"
    };
    
    this.art12 = {
    	text: "At the end of the visit you understand that the only impression left on you is an irresistible boring one.",
    	c1: "Exit the Art Gallery",
    	a1: "time:1200|goNav:area3_3"
    };
    
    this.art13 = {
    	text: "'What's this vileness! This is an insult to Art in every form and conception!' You can't stand looking at these horrible monstrosity for another second!",
    	c1: "Exit the Art Gallery",
    	a1: "time:600|goNav:area3_3"
    };
    
    ////
    
    this.cinema0 = {
    	text: "A robo-clerk is showing the following announcement:\n\nTONIGHT AT THE CINEMA HALL\n\nAn extended retrospective on the $MOVIEGENRE$ genre\n\n\Three movies and a debate on the history and the importance of the genre in the review of the late artistic and technologic developments.\n\nPrice for admission: 30cr",
        r1: "credits>=30",
    	c1: "I'm curious to see what sort of movies are these",
    	a1: "credits:-30|flag_cinemaHall:1|goNav:cinema11,cinema12,cinema13",
    	c2: "Exit the Cinema Hall",
    	a2: "goNav:area3_3"
    };
    
    this.cinema11 = {
    	text: "The movies were great and the debate was interesting. All in all it was a good show.",
    	c1: "Exit the Cinema Hall",
    	a1: "time:7200,14400|reputation:1,2|chancesick:10|goNav:area3_3"
    };
    
    this.cinema12 = {
    	text: "You liked the movies but at the end you felt pretty tired, so you exited the building before the debate.",
    	c1: "Exit the Cinema Hall",
    	a1: "time:6000,13200|chancesick:10|goNav:area3_3"
    };
    
    this.cinema13 = {
    	text: "You don't know what were you expecting from this show, but it hasn't been a good idea. You decided to walk out, since nobody will ever give back to you the time you passed in the Hall...",
    	c1: "Exit the Cinema Hall",
    	a1: "time:3600,7200|chancesick:10|goNav:area3_3"
    };
    
    ////
    
    this.opera01 = {
    	text: "Near the entrance you read the following announcement:\n\nTONIGHT THE OPERA HOUSE PRESENTS\n\nThe exclusive $MUSICGENRE$ singer that will play a selection of $GENDERPOSS$ best hits.\n\nAdmission price: 20cr",
        r1: "credits>=20",
    	c1: "That's a genre of music that I didn't know existed",
    	a1: "credits:-20|flag_operaHouse:1|goNav:opera11,opera12,opera13",
    	c2: "Exit the Opera House",
    	a2: "goNav:area3_3"
    };
    
    this.opera02 = {
    	text: "Near the entrance you read the following announcement:\n\nTONIGHT THE OPERA HOUSE PRESENTS\n\nThe exclusive $MUSICGENRE$ musician that will play a selection of $GENDERPOSS$ best hits.\n\nAdmission price: 20cr",
    	
    	r1: "credits>=20",
    	c1: "That's a genre of music that I didn't know existed",
    	a1: "credits:-20|flag_operaHouse:1|goNav:opera11,opera12,opera13",
    	
    	c2: "Exit the Opera House",
    	a2: "goNav:area3_3"
    };
    
    this.opera03 = {
    	text: "Near the entrance you read the following announcement:\n\nTONIGHT THE OPERA HOUSE PRESENTS\n\nThe exclusive $MUSICGENRE$ band, ready to awe the audience with the tracks from their latest album\n\nAdmission price: 20cr",
    	
    	r1: "credits>=20",
    	c1: "That's a genre of music that I didn't know existed",
    	a1: "credits:-20|flag_operaHouse:1|goNav:opera11,opera12,opera13",
    	
    	c2: "Exit the Opera House",
    	a2: "goNav:area3_3"
    };
    
    this.opera11 = {
    	text: "The performance was a success. When you exit the show, your ears are still ringing. It was a riveting experience, that allowed you to explore unknown musical landscapes. You won't forget this concert for some time.",
    	c1: "Exit the Opera House",
    	a1: "time:3600,10800|reputation:1,2|chancesick:10|goNav:area3_3"
    };
    
    this.opera12 = {
    	text: "When you exit the show, you fail to grasp the appeal of the exhibition. You keep a vague memory of strange melodies and awkward composition, nothing worthy remembering.",
    	c1: "Exit the Opera House",
    	a1: "time:3600,10800|chancesick:10|goNav:area3_3"
    };
    
    this.opera13 = {
    	text: "'LET-ME-PASS WHAT-IS-THIS-AUDIO-TORTURE MY-EARS-ARE-BLEEDING I-HAVE-TO-GET-OUT-OF-HERE!'",
    	c1: "Exit the Opera House",
    	a1: "time:300,1200|chancesick:10|goNav:area3_3"
    };
    
    ////
    
    this.med0 = {
    	text: "The place is clean and illuminated. Everything is white. The receptionist scans you for a moment before talking: 'Hello Commander, we can provide you services to rid of your physiological annoyances.'",
    	background: "litf_bg_medcenter.png",
    
        //r1: "health>0",
    	c1: "Wounds Treatment and Tissue Repairing",
    	a1: "if:health>0?goNav:med1;goNav:med1_1",
    
        //r2: "sickness>0",
    	c2: "Virus and germs Nano disinfestation",
    	a2: "if:sickness>0?goNav:med2;goNav:med1_1",
    
        //r3: "flag_getDrunk=1",
    	c3: "Quick alcoholic purge (can generate allergic reactions)",
    	a3: "if:flag_getDrunk=1?goNav:med3;goNav:med3_1",
    
        r4: "tech=hitech,maxStrength<200",
        c4: "Recovering Therapy",
        a4: "goNav:med4",
    
    	c5: "Exit the Medical Center",
    	a5: "goNav:area2_2"
    };
    
    this.med1 = {
    	text0: "tech=lowtech|'Technology on this station allow us to heal only light wounds. Price for treatment is 100cr.'",
    	text1: "tech=avgtech|'Technology on this station allow us to heal serious wounds. Price for treatment is 150cr.'",
    	text2: "tech=hitech|'We can heal wounds of every type and severity. Price for treatment is 250cr.'",
    	background: "litf_bg_medcenter.png",
    
        r1: "paytreatment=1",
    	c1: "I need the treatment, now",
    	a1: "paytreatment:health|goNav:med0",
    
    	c2: "Thanks, I've changed my mind",
    	a2: "goNav:med0"
    };
    
    this.med1_1 = {
        text: "After a second the receptionist says: 'Our analysis confirms that you have no need for our treatment. You're already enough healthy. Please come back when your conditions will be more severe. We hope to see you soon. Goodbye.'",
        background: "litf_bg_medcenter.png",
        c1: "I don't know if I want to see you soon too...",
        a1: "goNav:med0"
    };
    
    this.med2 = {
    	text0: "tech=lowtech|'Technology on this station allow us to heal only light sickness. Price for treatment is 100cr.'",
    	text1: "tech=avgtech|'Technology on this station allow us to heal serious sickness. Price for treatment is 150cr.''",
    	text2: "tech=hitech|'We can heal sickness of every type and severity. Price for treatment is 250cr.'",
    	background: "litf_bg_medcenter.png",
    
        r1: "paytreatment=1",
    	c1: "I need the treatment, now",
    	a1: "paytreatment:sickness|goNav:med0",
    
    	c2: "Thanks, I've changed my mind",
    	a2: "goNav:med0"
    };
    
    this.med3 = {
    	text: "'The treatment is free. Please enter the purging machine and stay still untile the process is terminated.'\n\nYou enter the capsule and pass the worst three minutes of the day. But the results are worthy of the annoyance - you feel your mind clear and ready.",
    	background: "litf_bg_medcenter.png",
    	c1: "I really needed this",
    	a1: "flag_getDrunk:0|chancesick:10|goNav:med0"
    };
    
    this.med3_1 = {
        text: "After a second the receptionist says: 'I'm sorry to inform you that this treatment isn't applicable to sober people. You should come back when you're drunk to be allowed to endure the treatment. We hope to see you soon. Goodbye.'",
        c1: "I'll be back when I'll be drunk, then",
        a1: "goNav:med0"
    };
    
    this.med4 = {
        text: "'This treatment allow to recover the body from damage endured in time, following prolungated work or efforts of various nature. The price for treatment is 400cr. The process will last about two hours.'",
        background: "litf_bg_medcenter.png",
        r1: "credits>=400",
        c1: "Yes, you can proceed",
        a1: "maxStrength:250|time:7200|credits:-400|goNav:med0",
        c2: "I don't think this is the right time for this...",
        a2: "goNav:med0"
    };
    
    ////
    
    this.hotel0 = {
        text: "In the main hall you can see the robo-receptionist. Little three-wheeled droids pick and transport baggages to the guest rooms, crossing each other at high speed without crashing - it's almost a miracle.\n\nThe robo-receptionist says: 'Welcome, guest. I'm glad to announce that we have available rooms. You can spend 6 hours in a room for 60cr in advance. A modest price, in my opinion. Do you want to take a room?'",
        c1: "Yes, please, I want to get some rest",
        a1: "if:credits>=60?goNav:hotel2;goNav:hotel1",
        c2: "No, thanks",
        a2: "goNav:area2_1"
    };
    
    this.hotel1 = {
        text: "The robo-receptionist scans you. 'I'm sorry, but I have to cancel the booking process, as I see that you haven't the required money for the payment. Good day.' After this, it turns to another guest and continue working.",
        c1: "I guess they don't give credit",
        a1: "goNav:hotel0"
    };
    
    this.hotel2 = {
        text: "The robo-receptionist instructs a droid to take you to your room. The droid seems somewhat disappointed from your lack of baggages, but runs forward to the nearest elevator. After a brief walk, the droids stop at the door of the $ROOMNUM$, and emits a high-pitched sound before going away.\n\nYou enter the room. It's clean, of an average quality that doesn't impress you. But the bed is comfortable and the bathroom has hot water. A video terminal offers you a wide selection of movies or local transmissions.",
        c1: "These 6 hours won't be a problem",
        a1: "credits:-60|time:21600|goNav:hotel3"
    };
    
    this.hotel3 = {
        text: "You hear a buzzing sound. Your booking time is ended. You leave the room and get back outside. You feel relieved and relaxed.",
        c1: "It has been a nice distraction",
        a1: "goNav:area2_1"
    }; 
    
    ////
    
    this.wwvt0 = {
        text: "The WWVT bulding resemble an amusement park, filled with neon signs and holo-videos of strange planets with extreme climates. There are pictures of big fanged predators, and plants and trees of different variety and color. A guide guarantees an authentic immersive experience, a unique virtual 4 hour safari. All of this for only 5cr.",
        c1: "Let's try this virtual experience",
        a1: "if:credits>=5?goNav:wwvt2;goNav:wwvt1",
        c2: "I'm not in the mood for simulated dangerous situations",
        a2: "goNav:area3_1"
    };
    
    this.wwvt1 = {
        text: "The ticket-droid can't give you the ticket - you haven't the 5cr, as required. No money, no entry.",
        c1: "Maybe another time",
        a1: "goNav:area3_1"
    };
    
    this.wwvt2 = {
        text: "You join a group of people, and the guide leads you into a great empty hall. 'Some of you have already seen or visited an holographic ambient, but I assure you this is something more. Stay ready, let's begin this voyage.'\nThe lights go out, and you notice shapes and colours gradually appearing out of thin air.",
        c1: "It's like another place is becoming real... with us in it",
        a1: "credits:-5|goNav:wwvt2_1,wwvt2_2,wwvt2_3,wwvt2_4"
    };
    
    this.wwvt2_1 = {
        text: "The tour brings you on a glacial planet, covered with ice and wind-blown. You see enormous mountains and deep white abysses, furious blizzard filled of spiky ice shards, and slow armored creatures that walks without pause on the white plains. Around them other little quick creatures jump and run, sometime digging holes in the ice. The big-armored creature use a long and flexible tail to fish into the holes, and the little quick ones hide under it when the blizzard comes.",
        c1: "Really an unusual experience",
        a1: "time:14400|goNav:area3_1"
    };
    
    this.wwvt2_2 = {
        text: "The tour brings you on a desert planet. Everything still, there's no wind, no clouds in the sky, all you see is an endless sea of yellowish sand. Only after a while you notice little creatures running in the sand, almost perfectly concealed by their colors. You don't understand if they're fleeing from someone, until a huge horned head surface from the sand with a loud roar. The little runners change quickly directions and run away from the creature, picking little straws of a purple plant in the process.",
        c1: "It was like I was really there",  
        a1: "time:14400|goNav:area3_1"
    };
    
    this.wwvt2_3 = {
        text: "The tour brings you on a oceanic planet. You're in the middle of an endless sea. In the waters you see a school of thousand fishes that forms a rotating circle. Other fishes, of various size, shape another smaller circle. This strange and hypnotic ritual get interrupted by a couple of big predators that starts hunting the fishes.",
        c1: "Impressing...",
        a1: "time:14400|goNav:area3_1"
    };
    
    this.wwvt2_4 = {
        text: "The tour brings you on a jungle planet. Everything is covered in grass, with huge plants and the tallest tree you have ever seen. There are hundreds of animal calls, a symphony that walks, jump, crawl and climb the trees. The light of two suns shines over life and death circling each other, a complex and complete ecosystem untouched since thousand of years.",
        c1: "It was an awesome experience, I have to admit it",  
        a1: "time:14400|goNav:area3_1"
    };
    
    ////
    
    this.storage0 = {
        text0: "You walk towards the passage to the Storage section, where a group of workers is chatting. When they see you, they block the passage.\n",
        text1: "stance>-25|One of them makes a step forward and talk directly to you: 'Hey, this area is for authorized personnel only. This means you can't walk there, at least you get a permission, and we are the ones who can get you a one-time permission for 25cr.'",
        text2: "stance<=-25|One of them makes a step forward, but another worker stop $GENDEROBJ$, look at you and says: 'The boys told me this is a friend. This commander can pass.'",
        r1: "stance>-25",
        c1: "Pay and enter the Storage section",
        a1: "if:credits>=25?credits:-25§goNav:storage2;goNav:storage1",
        r2: "stance<=25",
        c2: "Visit the Storage section",
        a2: "goNav:storage2",
        c3: "Go back to the Cargo Area",
        a3: "goNav:area1_2"  
    };
    
    this.storage1 = {
        text: "Where is the money? This isn't enough! Get lost before we lock you in a crate of trumbles!",
        c1: "Ok ok there's no need to be so angry",
        a1: "goNav:area1_2"
    };
     
    this.storage2 = {
        text: "You're in the Storage section.\n\nThe cargo from ships come here once it is removed from containers. It's basically a huge warehouse filled of box and crates of various shapes and size, that creates walls and corridors and rooms.\n\nFrom here you can return to the Cargo Area.",
        background: "litf_bg_storagearea.png",
        c1: "Exit to the Cargo Area",
        a1: "goNav:area1_2"
    };
    
    ////
    
    this.plounge0 = {
        text: "In the lounge, dozens of persons are fiddling with terminals trying to get a passage out of the station. A number of monitors fixed to the walls display local and extra-system news. Other screens shows data about current departing and incoming passenger flights. You can use a terminal to see if there are available contracts.",
        c1: "Unfortunately there are no suitable offers",
        a1: "goNav:area2_1"
    };
    
    ////
    
    this.church0 = {
        text: "The hall has a strange configuration: you can't say for sure, but it seems that the walls change and slides modifying the shape of the building. On the walls you see pictures from several systems. The wall opposite to the entrance shows a hooded man in an embracing pose, surrounded by shining stars. In front of this sacred picture there's an altar, and a series of benches. A soothing melody plays in the background. Everything is silent.",
        c1: "This place is a little weird. Maybe I'll explore it another time",
        a1: "goNav:area2_2"
    };
    
    ////
    
    this.bookshop0 = {
        text: "You enter into an old-style shop built with some exotic type of wood. There are many shelves full of books, volumes, tomes of every size and colour: on the cover you read titles in various languages. You see piles of books on the ground and in the corner. It's impossible to estimate the exact size of the shop - this place is like a little maze.",
        c1: "There's too much dust here. I need a breath of fresh air",
        a1: "goNav:area2_2" 
    };
    
    ////
    
    this.museum0 = {
        text: "A number of slightly fluorescent signs guide you along the suggested path, allowing you to view and examine the collection of ancient and alien artifacts kept inside safe glasses box. Everyone whispers, fearing to disturb the tranquillity of the halls.",
        c1: "Visit the museum",
        a1: "time:1800|goNav:museum1"
    };
    
    this.museum1 = {
        text: "At the end of your visit, you notice you felt impressed $MUSEUMPIECE$.\n\nYou reach the exit, where a stand ask the visitors to contribute to the museum maintenance. You can make an offer, if you want.",
        c1: "Give nothing",
        a1: "go:",
        
        r2: "credits>=1",
        c2: "Give 1cr",
        a2: "reputation:1|credits:-1|goNav:area3_1",
        
        r3: "credits>=10",
        c3: "Give 10cr",
        a3: "reputation:5|credits:-10|goNav:area3_1",
        
        r4: "credits>=100",
        c4: "Give 100cr",
        a4: "reputation:50|credits:-100|goNav:area3_1",
        
        r5: "credits>=1000",
        c5: "Give 1000cr",
        a5: "reputation:500|credits:-1000|goNav:area3_1",
    };    
    
    ////
    
    /*
    this.fit0 = {
        text: "You walk to the reception, where a droid informs you that an unspecified malfunction prevents the Universal Fitness Badge validation. The center is closed until the situation will be fixed.",
        c1: "That's a pity. I'll try again in the future",
        a1: "goNav:area3_2"
    };
    */
    
    this.fit0 = {
        text0: "You walk to the reception, where a droids greets you.\n",
        text1: "checkFitBadge=0|The droid tries to scan something and then says: 'I see you aren't in possession of an Universal Fitness Badge. You need one to spend time in Fit Centers like this. You get a monthly subscription with it, for 15cr.'",
        //text2: "checkFitBadge=1|'I see that your subscription is expired. Do you want to renew it for 10cr?'",
        text2: "checkFitBadge=1|The droid scans the badge and then says: 'Sorry, it seems the expiration date is passed. You need to renew your subscription to continue using the Fit Center machinery. It will cost you 10cr for another month.'",
        text3: "checkFitBadge=2|The droid scans the badge and then says: 'Your subscription is still valid. You can proceed to the Health Validation Room. Good day",
        
        r1: "checkFitBadge=0",
        c1: "Ok, I'll subscribe",
        a1: "goNav:fit1_1",
    
        r2: "checkFitBadge=1",
        c2: "Ok, I'll renew the subscription",
        a2: "goNav:fit1_2",
    
        r3: "checkFitBadge=2",
        c3: "Enter the Health Validation Room",
        a3: "goNav:fit2",
    
        c4: "Maybe another time",
        a4: "goNav:area3_2"
    };
    
    this.fit1_1 = {
        text0: "credits>=15|'Here it is your new badge. You have free access to any Fit Center for an entire month. You can proceed to the Health Validation Room now. Good day.'",
        text1: "credits<15|'It seems that you don't own the required money for buying the Universal Fitness Badge. I suggest you to return with the required sum. Good day.'",
    
        r1: "credits>=15",
        c1: "Enter the Health Validation Room",
        a1: "credits:-15|writeTime:fitBadge_2592000|goNav:fit2",
        
        c2: "Thanks for the badge. See you later",
        a2: "credits:-15|writeTime:fitBadge_2592000|goNav:area3_2"
    };
    
    this.fit1_2 = {
        text0: "credits>=10|'I have just renewed you subscription for another month. You can proceed to the Health Validation Room now. Good day.'",
        text1: "credits<10|'It seems that you don't own the required money for buying the Universal Fitness Badge. I suggest you to return with the required sum. Good day.'",
    
        r1: "credits>=10",
        c1: "Enter the Health Validation Room",
        a1: "credits:-10|writeTime:fitBadge_2592000|goNav:fit2",
    
        c2: "Thanks for renewing my subscription. See you later",
        a2: "credits:-10|writeTime:fitBadge_2592000|goNav:area3_2"
    };
    
    this.fit2 = {
        text0: "A couple of robo-docs makes some examination while producing a series of bips in various tones. After a couple of minutes they give you their response:\n",
        text1: "health>0|'Negative: You're wounded. You can't access the gym in this conditions.'\n",
        text2: "sickness>0|'Negative: You're sick. You can't access the gym in this conditions.'\n",
        text3: "maxstrength<100|'Negative: Your body has endured too much damage.  You can't access the gym in this conditions. We suggest you get a recovering therapy from a Medical Center - this feature is available only on hi-tech systems.'",
        text4: "health=0,sickness=0,maxstrength>=100|'Positive: you can access the gym. Good day.'",
    
        r1: "health=0,sickness=0,maxstrength>=100",
        c1: "Enter the gym",
        a1: "goNav:fit3",
        
        c2: "I changed idea. Goodbye",
        a2: "goNav:area3_2"    
    };
    
    this.fit3 = {
        text: "This building is comprised of various floors, and is full of gym machinery for every type of exercise and every type of alien race.",
        c1: "Start exercising",
        a1: "if:fitDamageChance<=50?goNav:fit3_1;fit3_2",
    
        c2: "I changed idea. Maybe another time",
        a2: "goNav:area3_2"
    };
    
    this.fit3_1 = {    
        text: "At the end of your training period you have a shower. You feel tired but somewhat relaxed, and your body feels a little more tonic.",
        c1: "Exit the Fit Center",
        a1: "time:3600|strength:10,40|checkFitDamage:1|writeTime:lastFitSession_0|goNav:area3_2"
    };
    
    this.fit3_2 = {
        text: "While you're exercising, you feel an acute pain that makes you cringe and almost scream. Other people in the gym run to you, and call for help. Preliminary medical scans show that you hurt yourself: you can't continue exercising until you get healed.",
        c1: "Exit the Fit Center",
        a1: "time:1800|fitDamage:1|writeTime:lastFitSession_0|goNav:area3_2"
    };
    Scripts/LITF_RPGElements.js
    "use strict";
    
    this.name	= "LITF_RPGElements";
    this.author	= "BeeTLe BeTHLeHeM";
    this.copyright	= "2015 BeeTLe BeTHLeHeM";
    this.description= "Life In The Frontier - RPG Elements";
    this.licence	= "CC BY-NC-SA 4.0";
    
    ///////////////////////////////////////
    
    this.LITF_reputationDesc = [ "Unknown", "Barely Known", "Recognized", "Well-Known", "Largely Known", "Widely Known", "Prestigious", "Famous", "Popular", "Acclaimed", "Renowned", "Legendary" ];
    
    this.LITF_strengthDesc = [ "Very poor", "Poor", "Average", "Good", "Excellent" ];
    
    this.LITF_healthShort = [ "None", "Slight", "Medium", "Serious", "Severe", "Critical" ];
    this.LITF_sicknessShort = [ "Excellent", "Good", "Average", "Weak", "Severe", "Critical" ];
    
    ///////////////////////////////////////
    
    this.$getReputationLevel = function(rep) {
    	var repLev = 0;
    
    	while (rep > (Math.pow(2, repLev) * 200)) {
    		repLev++;
    	}
    
    	return repLev;
    };
    
    
    this.$getReputationFromValue = function(rep) {
    	var repLev = this.$getReputationLevel(rep);
    	return this.LITF_reputationDesc[repLev];
    };
    
    
    this.$getStrengthLevel = function(str) {
    	var strLev = 0;
    
    	while (str > (Math.pow(2, strLev) * 100)) {
    		strLev++;
    	}
    
    	return strLev;
    };
    
    
    this.$getStrengthFromValue = function(str) {
    	var strLev = this.$getStrengthLevel(str);
    	return this.LITF_strengthDesc[strLev];
    };
    
    
    this.$getStanceFromValue = function(sta) {
    	var desc = "";
    
    	if (sta == 0) { desc = "absolutely neutral"; }
    
    	if (sta < 5 && sta > -5) { desc = "generally neutral"; }
    
    	if (sta >= 5) { desc = "sympathetic with GalCop"; }
    	if (sta >= 25) { desc = "friendly with GalCop"; }
    	if (sta >= 75) { desc = "loyal with GalCop"; }
    	if (sta >= 200) { desc = "sworn to act along the rules of GalCop"; }
    
    	if (sta <= -5) { desc = "sympathetic with criminals"; }
    	if (sta <= -25) { desc = "friendly with criminals"; }
    	if (sta <= -75) { desc = "loyal with criminals"; }
    	if (sta <= -200) { desc = "respectful of the laws of the criminal underworld"; }
    
    	return desc;
    };
    
    
    this.$getHealthFromValue = function(hea) {
    	var heaDesc = "";
    
    	switch (hea) {
    		case 0: 
    			heaDesc = "";
    			break;
    		case 1: 
    			heaDesc = "You have some bruises and scratches.";
    			break;
    		case 2:
    			heaDesc = "You are slightly wounded.";
    			break;
    		case 3:
    			heaDesc = "You are wounded.";
    			break;
    		case 4:
    			heaDesc = "You are severely wounded.";
    			break;
    		case 5: 
    			heaDesc = "Your health condition is critical!";
    			break;
    	}
    
    	return heaDesc;
    };
    
    
    this.$getSicknessFromValue = function(sic) {
    	var sicDesc = "";
    
    	switch (sic) {
    		case 0: 
    			sicDesc = "";
    			break;
    		case 1: 
    			sicDesc = "You feel uneasy.";
    			break;
    		case 2:
    			sicDesc = "You cough, sneeze and feel chills all over your body.";
    			break;
    		case 3:
    			sicDesc = "You feel a strong nausea.";
    			break;
    		case 4:
    			sicDesc = "You feel tired and can't think straight.";
    			break;
    		case 5: 
    			sicDesc = "You feel burning inside. You're delirious.";
    			break;
    	}
    
    	return sicDesc;
    };
    
    Scripts/LITF_RandomEvents.js
    "use strict";
    
    this.name	= "LITF_RandomEvents";
    this.author	= "BeeTLe BeTHLeHeM";
    this.copyright	= "2015 BeeTLe BeTHLeHeM";
    this.description= "Life In The Frontier - RandomEvents";
    this.licence	= "CC BY-NC-SA 4.0";
    
    ///////////////////////////////////////
    
    var LITF_reLabel = "";
    
    this.LITF_destPlace = "";
    
    this.$randomEvent = function(dPlace) {
    	this.resumeLog = "";
    	this.$fireEvent();
    
    	this.LITF_destPlace = dPlace;
    };
    
    
    this.$fireEvent = function(eLabel) {
    	var _co = worldScripts.LITF_Common;
    
    	var eTitle = "SOMETHING HAPPENS";
    
    	var reLabel = this.$chooseRandomEvent(eLabel);
    	LITF_reLabel = reLabel;
    	_co.$log("[fireEvent] reLabel = " + LITF_reLabel);
    
    	var rEvent = eval("worldScripts.LITF_EventsCatalog." + reLabel + ";");
    	_co.$log("[fireEvent] event text = " + rEvent.text);
    
    	var reChoices = _co.$extractChoices(rEvent);
    
    	mission.runScreen(
    		{
    			title: eTitle, 
    			message: _co.$replaceConstants(rEvent.text),
    			choices: reChoices 
    		},
    		this.$selectChoice
    	);
    
    	_co.$screenBackground(rEvent.background);
    };
    
    
    this.$chooseRandomEvent = function(eLabel) {
    	var _co = worldScripts.LITF_Common;
    
    	var reLabel = "";
    
    	if (eLabel == undefined || eLabel == "") {
    		var totEvents = 30;
    
    		var validEvent = 0;
    		while (validEvent == 0) {
    			var eIdx = Math.floor(Math.random() * totEvents) + 1;
    			reLabel = "rand" + eIdx;			
    
    			// Validate the event
    			validEvent = this.$eventCheck(reLabel);
    		}
    	} else {
    		// Specific event
    		reLabel = eLabel;
    	}
    	
    	_co.$log("[chooseRandomEvent] reLabel = " + reLabel);
    
    	return reLabel;
    };
    
    
    this.$eventCheck = function(reLabel) {
    	var _co = worldScripts.LITF_Common;
    
    	var actionData = eval("worldScripts.LITF_EventsCatalog." + reLabel);
    	
    	if (actionData.requires) {
    		var checkSplit = actionData.requires.split("|");
    		for (var i = 0; i < checkSplit.length; i++) {
    			var check = checkSplit[i];
    
    			var items = check.split(",");
    			for (var i = 0; i < items.length; i++) {
    
    				_co.$log("[eventCheck] checking = " + items[i]);
    
    				var checkItems = items[i].split(":");
    				//var valid = _co.$checkRequirements(checkItems);
                    var valid = _co.$checkRequirements(items[i]);
    				if (valid == 0) { 
    					return 0; 
    				}
    			}
    		}
    	}
    		
    	return 1;
    };
    
    
    this.$selectChoice = function(choice) {
    	var _co = worldScripts.LITF_Common;
    
    	if (choice == null || choice == "null") { return; }
    	_co.$log("[selectChoice] choice = " + choice);
    
    	var action = choice.replace('c', 'a');
    	_co.$log("[selectChoice] action = " + action);
    
    	// Retrieve the associate actions
    
    	var actionData = eval("worldScripts.LITF_EventsCatalog." + LITF_reLabel + "." + action);
    
        _co.$executeActions(actionData);
    
        /*
    	var actionsSplit = actionData.split("|");
    	
    	// Iterate, parse and execute the actions
    
    	for (var i = 0; i < actionsSplit.length; i++) {
    		var action = actionsSplit[i];
    
            _co.$executeAction(action);
    	}
    	*/
    };
    
    this.$resetVars = function() {
    	var _litf = worldScripts.LITF;
    
    	//this.resumeLog = "";
    
    	_litf.LITF_varStore["SPECIES_S"] = "";
    	_litf.LITF_varStore["SPECIES_P"] = "";
    	_litf.LITF_varStore["GENDER"] = [];
    	_litf.LITF_varStore["COMMODITY"] = "";
    
    	//this.LITF_eventTitle = "";
    };
    
    Scripts/LifeInTheFrontier.js
    "use strict";
    
    this.name	= "LITF";
    this.author	= "BeeTLe BeTHLeHeM";
    this.copyright	= "2015 BeeTLe BeTHLeHeM";
    this.description= "An attempt to provide more roleplaying environment on space stations: the player can get a casual event, that could bring an advantage or a risk, a reward or a trouble.";
    this.licence	= "CC BY-NC-SA 4.0";
    
    ///////////////////////////////////////
    
    this.startUp = function() {
    	var _co = worldScripts.LITF_Common;
    
    	this.LITF_cmdStats = {};
    	this.LITF_flags = {};
    
        // Clean obsolete variables //
        
        if (missionVariables.LITF_init) { missionVariables.LITF_init = null; }
    
        // Clean inactive variables //
    
        if (missionVariables.LITF_lastGymDay) { missionVariables.LITF_lastGymDay = null; }
        if (missionVariables.LITF_enableContractor) { missionVariables.LITF_enableContractor = null; }
        if (missionVariables.LITF_enableMission) { missionVariables.LITF_enableMission = null; }
        if (missionVariables.LITF_contractorData) { missionVariables.LITF_contractorData = null; }
        if (missionVariables.LITF_missionData) { missionVariables.LITF_missionData = null; }
    
        // Init legit variables //
    
        // Commander Stats
        this.$loadCommanderStats();
    
        // Flags
        this.$loadOXPFlags();
        
        /*
        // Other commander related data
        if (missionVariables.LITF_lastGymDay) {
            this.LITF_lastGymDay = missionVariables.LITF_lastGymDay;
        } else {
            this.LITF_lastGymDay = "";
        }
    
        if (missionVariables.LITF_enableContractor) {
            this.LITF_enableContractor = missionVariables.LITF_enableContractor;
        } else {
            this.LITF_enableContractor = 0;
        }
    
        if (missionVariables.LITF_enableMission) {
            this.LITF_enableMission = missionVariables.LITF_enableMission;
        } else {
            this.LITF_enableMission = 0;
        }
    
        if (missionVariables.LITF_contractorData) {
            this.LITF_contractorData = missionVariables.LITF_contractorData;
        } else {
            this.LITF_contractorData = "";
        }
    
        if (missionVariables.LITF_missionData) {
            this.LITF_missionData = missionVariables.LITF_missionData;
        } else {
            this.LITF_missionData = "";
        }
        */
            
        ////////
    
    	// Store OXP inner variables
    	this.LITF_varStore = {};
    	
    	// Settings //
    	this.LITF_logger = 0;
    
        _co.$log("[startUp] [[[ LIFE IN THE FRONTIER v" + this.version + " ]]]");
    };
    
    this.startUpComplete = function() {
    	this.setInterface();
    }
    
    this.$loadOXPFlags = function() {
        var mvOXPFlagsArr = missionVariables.LITF_flagArr;
    
        if (!mvOXPFlagsArr || mvOXPFlagsArr.indexOf("map:") == -1) {
            this.LITF_flags = {
                getDrunk: 0,
                drinkChallenge: 0,
                chatBartender: 0,
                offerToCounter: 0,
                artGallery: 0,
                cinemaHall: 0,
                operaHouse: 0,
                defacedShip: 0,
                fitBadge: -1,
                lastFitSession: -1,
                fitDamageChance: 0,
                maxStrength: 2000
            };
        } else {
            mvOXPFlagsArr = mvOXPFlagsArr.substring(4);
            var OXPFlagsMap = mvOXPFlagsArr.split(","); // array of items
            for (var c = 0; c < OXPFlagsMap.length; c++) {
                var OXPFlagsItem = OXPFlagsMap[c].split("="); // param=value
                
                var vartype = OXPFlagsItem[0].substring(0, 1);
                var varname = OXPFlagsItem[0].substring(1);
    
                if (vartype = "S") {
                    this.LITF_flags[varname] = OXPFlagsItem[1];
                } else if (vartype = "N") {
                    this.LITF_flags[varname] = parseInt(OXPFlagsItem[1]);
                }
                
                /*
                if (OXPFlagsItem[0] == "fitBadge" || OXPFlagsItem[0] == "lastFitSession") {
                    this.LITF_flags[OXPFlagsItem[0]] = OXPFlagsItem[1];
                } else {
                    this.LITF_flags[OXPFlagsItem[0]] = parseInt(OXPFlagsItem[1]);
                }*/
            }
        }
    };
    
    this.$loadCommanderStats = function() {
        var mvCmdStatsArr = missionVariables.LITF_cmdStatsArr;
        
        if (!mvCmdStatsArr || mvCmdStatsArr.indexOf("map:") == -1) {
            this.LITF_cmdStats = {
                reputation: 0,
                health: 0,
                sickness: 0,
                strength: 200,
                stance: 0
            };
        } else {
            mvCmdStatsArr = mvCmdStatsArr.substring(4);
            var cmdStatsMap = mvCmdStatsArr.split(","); // array of items
            for (var c = 0; c < cmdStatsMap.length; c++) {
                var cmdStatsItem = cmdStatsMap[c].split("="); // param=value
                
                this.LITF_cmdStats[cmdStatsItem[0]] = parseInt(cmdStatsItem[1]);
            }
        }
    };
    
    this.$saveCommanderStats = function() {
        var cmdStats = "map:reputation=" + this.LITF_cmdStats.reputation 
            + ",health=" + this.LITF_cmdStats.health 
            + ",sickness=" + this.LITF_cmdStats.sickness 
            + ",strength=" + this.LITF_cmdStats.strength 
            + ",stance=" + this.LITF_cmdStats.stance;
            
        missionVariables.LITF_cmdStatsArr = cmdStats;
    };
    
    
    this.$saveOXPFlags = function() {
        var flags = "map:"
            +  "NgetDrunk=" + this.LITF_flags.getDrunk 
            + ",NdrinkChallenge=" + this.LITF_flags.drinkChallenge 
            + ",NchatBartender=" + this.LITF_flags.chatBartender 
            + ",NofferToCounter=" + this.LITF_flags.offerToCounter 
            + ",NartGallery=" + this.LITF_flags.artGallery 
            + ",NcinemaHall=" + this.LITF_flags.cinemaHall 
            + ",NoperaHouse=" + this.LITF_flags.operaHouse 
            + ",NdefacedShip=" + this.LITF_flags.defacedShip
            + ",NfitBadge=" + this.LITF_flags.fitBadge
            + ",NlastFitSession=" + this.LITF_flags.lastFitSession
            + ",NfitDamageChance=" + this.LITF_flags.fitDamageChance
            + ",NmaxStrength=" + this.LITF_flags.maxStrength;
            
        missionVariables.LITF_flagsArr = flags;
    };
    
    this.playerWillSaveGame = function() {
    	// Store variables in savegame
    
        //missionVariables.LITF_lastGymDay = this.LITF_lastGymDay;
        //missionVariables.LITF_enableContractor = this.LITF_enableContractor;
        //missionVariables.LITF_enableMission = this.LITF_enableMission;
        //missionVariables.LITF_contractorData = this.LITF_contractorData;
        //missionVariables.LITF_missionData = this.LITF_missionData;
    
    	// Commander stats
        this.$saveCommanderStats();
    
    	// Flags
    	this.$saveOXPFlags();
    };
    
    
    this.shipWillDockWithStation = function(station) {
    	//this.LITF_enableContractor = 0;
    
        if (this.LITF_varStore["ARTGENRE"]) { this.LITF_varStore["ARTGENRE"] = null; }
    	if (this.LITF_varStore["MUSICGENRE"]) { this.LITF_varStore["MUSICGENRE"] = null; }
    	if (this.LITF_varStore["MOVIEGENRE"]) { this.LITF_varStore["MOVIEGENRE"] = null; }
    
    	// Flags
    	this.LITF_flags.getDrunk = 0;
    	this.LITF_flags.drinkChallenge = 0;
    	this.LITF_flags.chatBartender = 0;
    	this.LITF_flags.offerToCounter = 0;
    	this.LITF_flags.artGallery = 0;
    	this.LITF_flags.cinemaHall = 0;
    	this.LITF_flags.operaHouse = 0;
    
        this.LITF_flags.defacedShip = 0;
    };
    
    
    this.shipDockedWithStation = function() {
    	//worldScripts.LITF_Mission.$checkForContractor();
    	//worldScripts.LITF_Mission.$checkForMission();
    
    	this.$healthManagement();
    	
    	this.$checkLastFitSession();
    
    	this.setInterface();
    };
    
    
    this.setInterface = function() {
    	player.ship.dockedStation.setInterface("LITF_hangarScreen", 
    		{
    			title: "Disembark from your ship",
    			category: "Activity",
    			summary: "Visit the station",
    			callback: this.$enterStation.bind(this) 
    		}
    	);
    };
    
    
    ///////////////////////////////////////
    
    this.$checkLastFitSession = function() {
        var lfs = this.LITF_flags.lastFitSession;
        if (lfs > -1) {
            var diff = clock.seconds - lfs;
            if (diff > 604800) {
                // More than a week from the last fit session
                this.LITF_cmdStats.strength -= _co.$randomValue(5, 10);
                if (this.LITF_cmdStats.strength < 0) { this.LITF_cmdStats.strength = 0; }
            }
        }
    };
    
    this.$healthManagement = function() {
    	var chance;
    
    	// Rule 1 - If player sickness > 1, every time he docks on a station 
    	//          there's a 10% chance of worsening (+1).
    
    	chance = Math.floor(Math.random() * 100) + 1;
    	if (this.LITF_cmdStats.sickness > 1 && chance < 10) {
    		this.LITF_cmdStats.sickness += 1;
    	}
    
    	// Rule 2 - If player sickness = 1, every time he docks on a station 
    	//          there's a 10% chance of healing (sickness = 0)
    
    	chance = Math.floor(Math.random() * 100) + 1;
    	if (this.LITF_cmdStats.sickness == 1 && chance < 10) {
    		this.LITF_cmdStats.sickness = 0;
    	}
    
    	// Rule 3 - If player health = 1, every time he docks on a station 
    	//          there's a 10% chance of healing (health = 0)
    
    	chance = Math.floor(Math.random() * 100) + 1;
    	if (this.LITF_cmdStats.health == 1 && chance < 10) {
    		this.LITF_cmdStats.health = 0;
    	}
    
    	// Rule 4 - If player health > 1, every time he docks on a station 
    	//          there's a 10% chance of worsening (+1).
    
    	chance = Math.floor(Math.random() * 100) + 1;
    	if (this.LITF_cmdStats.health > 1 && chance < 10) {
    		this.LITF_cmdStats.health += 1;
    	}
    
    	// Rule 5 - If player health > 2 and sickness < 2, every time he docks on a station 
    	//          there's a 10% chance of generating infections (sickness +1)
    
    	chance = Math.floor(Math.random() * 100) + 1;
    	if (this.LITF_cmdStats.health > 2 && this.LITF_cmdStats.sickness < 2 && chance < 10) {
    		this.LITF_cmdStats.sickness += 1;
    	}
    
    	// Rule 6 - If player health > 2 or player sickness > 2 
    	//          there's a chance of 10% of reducing physical shape 
    
    	chance = Math.floor(Math.random() * 100) + 1;
    	if ((this.LITF_cmdStats.health > 2 || this.LITF_cmdStats.sickness > 2) && chance < 10) {
    		var decay = Math.floor(Math.random() * 10) + 1;
    
    		this.LITF_cmdStats.strength -= decay;
    		if (this.LITF_cmdStats.strength < 10) {
    			this.LITF_cmdStats.strength = 10;
    		}
    	}
    };
    
    
    this.$enterStation = function() {
        var _nav = worldScripts.LITF_Navigation; 
        _nav.$startNavigation();
    };