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

Expansion OoCheat

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description A little OXP that adds a cheat menu to the game. A little OXP that adds a cheat menu to the game.
Identifier oolite.oxp.Thargoid.OoCheat oolite.oxp.Thargoid.OoCheat
Title OoCheat OoCheat
Category Mechanics Mechanics
Author Thargoid Thargoid
Version 1.11 1.11
Tags mechanics, cheat mechanics, cheat
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/OoCheat_OXP n/a
Download URL https://wiki.alioth.net/img_auth.php/6/63/OoCheat_1.11.oxz n/a
License Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license with clauses - see readme file Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license with clauses - see readme file
File Size n/a
Upload date 1610873315

Documentation

Also read http://wiki.alioth.net/index.php/OoCheat

ooCheat v1.11 ReadMe & License.txt

ooCheat OXP by Thargoid.

A little OXP that I wrote because I was bored, and as a little social experiment.

It adds a cheat menu to Oolite. To activate it, when docked go to the F4 screen and you should see an option to go to the menu.

Cheats that are made available include:

*	Award of 1000 credits.
*	Increase of rank (or awarding of 100 kills for Elite ranked players).
*	Clearing of legal status back to clean.
*	Repair of any damaged equipment on the ship.
*	Enhancement to energy recharge rate (switchable on/off).
*	Suppression of NPC missiles, except for Thargoid drones (switchable on/off).
*	Fuel tank refilled after every witchspace jump (switchable on/off).
*	Suppression of NPC capability to ECM missiles (switchable on/off).
*	Limited invulnerability - Q-bombs and crashing into planets will still kill you. (switchable on/off).

Requires Oolite v1.77 or higher to run - it is not compatible with 1.76.x or lower versions.

--------------------------------------------------------------

License:

This OXP is released under the Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license with the following clauses:

* Whilst you are free (and encouraged) to re-use any of the scripting, models or texturing in this OXP, the usage must be distinct from that within this OXP. Unique identifiers such as (but not limited to) unique shipdata.plist entity keys, mission variables, script names (this.name), equipment identity strings (EQ_), description list arrays and entity roles must not be re-used without prior agreement. Basically if it's unique or would identify or overwrite anything in the original OXP, then you may not re-use it (for obvious compatibility reasons).
* rebundling of this OXP within another distribution is permitted as long as it is unchanged. The following derivates however are permitted and except from the above:
	* the conversion of files between XML and openStep.
	* the merging of files with other files of the same type from other OXPs.
* The license information (either as this file or merged into a larger one) must be included in the OXP.
* Even though it is not compulsory, if you are re-using any sizable or recognisable piece of this OXP, please let me know :)

--------------------------------------------------------------
Instructions:

Unzip the file, and then move the folder "ooCheat 1.11.oxp" to the AddOns directory of your Oolite installation. Then start the game up and the ships should be added. 

--------------------------------------------------------------

Version history:

04/10/2010 - Version 1.00, Initial release.
19/02/2011 - Version 1.10, release for 1.75 trunk, with new limited invulnerability option.
23/01/2013 - Version 1.11, moved access to the new F4 screen to overcome clash with OXPConfig. Thus requires Oolite 1.77 or higher to run.

Equipment

This expansion declares no equipment.

Ships

This expansion declares no ships.

Models

This expansion declares no models.

Scripts

Path
Config/script.js
this.name					= "ooCheat";
this.author					= "Thargoid";
this.copyright				= "Creative Commons: attribution, non-commercial, sharealike with clauses - see readme.txt";
this.description			= "Cheat menu";
this.version				= "1.11";

this.startUp = function()
	{
	log("Cheat screen enabled");
	missionVariables.ooCheat_recharge = "Activate";
	missionVariables.ooCheat_missile = "Activate";
	missionVariables.ooCheat_fuel = "Activate";
	missionVariables.ooCheat_ecm = "Activate";
	missionVariables.ooCheat_invuln = "Activate";
	this.shipDockedWithStation();
	}

this.shipDockedWithStation = function(station)
	{
	if(player.ship.docked)
		{
		player.ship.dockedStation.setInterface("ooCheat",
			{ title: "Cheat Screen",
			category: "Game",
			summary: "Displays the ooCheat menu.",
			callback: this.displayMenu.bind(this) });
		}
	}
	
this.displayMenu = function()
	{
	mission.runScreen({title:"Cheat Menu", choicesKey:"ooCheat_choices"}, this.choice);
	mission.addMessageText("Name : " + player.name);
	mission.addMessageText("Credits : " + player.credits);
	mission.addMessageText("Legal Status : " + player.legalStatus);
	mission.addMessageText("Rank : " + player.rank + "  (" + player.score + " kills)");

	if(missionVariables.ooCheat_recharge === "Activate")
		{ mission.addMessageText("\nEnhanced recharge rate is deactivated."); }
	else
		{ mission.addMessageText("\nEnhanced recharge rate is activated."); }	

	if(missionVariables.ooCheat_missile === "Activate")
		{ mission.addMessageText("Incoming missile prevention is deactivated."); }
	else
		{ mission.addMessageText("Incoming missile prevention is activated."); }

	if(missionVariables.ooCheat_fuel === "Activate")
		{ mission.addMessageText("Auto jump refuelling is deactivated."); }
	else
		{ mission.addMessageText("Auto jump refuelling is activated."); }		
		
	if(missionVariables.ooCheat_ecm === "Activate")
		{ mission.addMessageText("Target ECM suppression is deactivated."); }
	else
		{ mission.addMessageText("Target ECM suppression is activated."); }

	if(missionVariables.ooCheat_invuln === "Activate")
		{ mission.addMessageText("Limited invulnerability is deactivated."); }
	else
		{ mission.addMessageText("Limited invulnerability is activated."); }		
	}

this.choice = function(choice)
	{
	switch(choice)
		{	
		case "OOCHEAT_1_CREDITS":
			{
			player.credits += 1000;
			this.displayMenu();
			break;
			}

		case "OOCHEAT_2_RANK":
			{
			this.increaseRank();
			this.displayMenu();
			break;
			}
		
		case "OOCHEAT_3_LEGAL":
			{
			player.bounty = 0;
			this.displayMenu();
			break;
			}
			
		case "OOCHEAT_4_REPAIR":
			{
			var eqCounter = 0 ; 
			for(eqCounter = 0;eqCounter<player.ship.equipment.length;eqCounter++)
				{
				if(player.ship.equipmentStatus(player.ship.equipment[eqCounter].equipmentKey) == "EQUIPMENT_DAMAGED")
					{ player.ship.setEquipmentStatus(player.ship.equipment[eqCounter].equipmentKey, "EQUIPMENT_OK"); }
				}
			this.displayMenu();
			break;
			}

		case "OOCHEAT_5_RECHARGE":
			{
			if(missionVariables.ooCheat_recharge === "Activate")
				{ missionVariables.ooCheat_recharge = "Deactivate"; }
			else	
				{ missionVariables.ooCheat_recharge = "Activate"; }
			this.displayMenu();	
			break;
			}

		case "OOCHEAT_6_MISSILE":
			{
			if(missionVariables.ooCheat_missile === "Activate")
				{ missionVariables.ooCheat_missile = "Deactivate"; }
			else	
				{ missionVariables.ooCheat_missile = "Activate"; }
			this.displayMenu();	
			break;
			}
			
		case "OOCHEAT_7_FUEL":
			{
			if(missionVariables.ooCheat_fuel === "Activate")
				{ missionVariables.ooCheat_fuel = "Deactivate"; }
			else	
				{ missionVariables.ooCheat_fuel = "Activate"; }
			this.displayMenu();	
			break;
			}

		case "OOCHEAT_8_ECM":
			{
			if(missionVariables.ooCheat_ecm === "Activate")
				{ missionVariables.ooCheat_ecm = "Deactivate"; }
			else	
				{ missionVariables.ooCheat_ecm = "Activate"; }
			this.displayMenu();	
			break;
			}		

		case "OOCHEAT_9_INVULN":
			{
			if(missionVariables.ooCheat_invuln === "Activate")
				{ missionVariables.ooCheat_invuln = "Deactivate"; }
			else	
				{ missionVariables.ooCheat_invuln = "Activate"; }
			this.displayMenu();	
			break;
			}			
		}
	}
	
this.increaseRank = function()
	{
	switch(true)
		{	
		case (player.score < 8):
			{
			player.score = 8;
			break;
			}
			
		case (player.score >= 8 && player.score < 16):
			{
			player.score = 16;
			break;
			}			

		case (player.score >= 16 && player.score < 32):
			{
			player.score = 32;
			break;
			}			
			
		case (player.score >= 32 && player.score < 64):
			{
			player.score = 64;
			break;
			}				

		case (player.score >= 64 && player.score < 128):
			{
			player.score = 128;
			break;
			}					

		case (player.score >= 128 && player.score < 512):
			{
			player.score = 512;
			break;
			}			
			
		case (player.score >= 512 && player.score < 2560):
			{
			player.score = 2560;
			break;
			}				
			
		case (player.score >= 2560 && player.score < 6400):
			{
			player.score = 6400;
			break;
			}				
			
		case (player.score >= 6400):
			{
			player.score += 100;
			break;
			}						
		}
	}
	
this.shipWillLaunchFromStation = function(station)
	{
	if(missionVariables.ooCheat_recharge === "Deactivate")
		{ this.rechargeTimer = new Timer(this, this.recharge, 0, 0.25); }
	}
	
this.shipWillDockWithStation = this.shipDied = function()
	{
	if(this.rechargeTimer && this.rechargeTimer.isRunning)
		{ 
		this.rechargeTimer.stop();
		delete this.rechargeTimer;
		}
	}	

this.recharge = function()
	{ player.ship.energy += 10; }
	
	
this.shipAttackedWithMissile = function(missile, whom)
	{
    if(missionVariables.ooCheat_missile === "Deactivate" && missile.primaryRole != "thargon" && missile.primaryRole != "tharglet")
		{ missile.remove(); }
	}

this.shipFiredMissile = function(missile, target)
	{
	if(missionVariables.ooCheat_ecm === "Deactivate" && target && target.equipmentStatus("EQ_ECM") === "EQUIPMENT_OK")
		{ target.removeEquipment("EQ_ECM"); }
	}
	
	
this.shipWillExitWitchspace = function()
	{
    if(missionVariables.ooCheat_fuel === "Deactivate")
		{ player.ship.fuel = 7; }
	}	

this.shipTakingDamage = function(amount, fromEntity, damageType)
	{
	if(amount && amount > 0 && missionVariables.ooCheat_invuln === "Deactivate") 
		{ player.ship.energy += amount; }
	}