Back to Index Page generated: Dec 20, 2024, 7:22:09 AM

Expansion Love Cats

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description A tale of love and betrayal amongst the vicious furry feline races of galaxy four. A tale of love and betrayal amongst the vicious furry feline races of galaxy four.
Identifier oolite.oxp.JohnSmith.LoveCats oolite.oxp.JohnSmith.LoveCats
Title Love Cats Love Cats
Category Missions Missions
Author John Smith John Smith
Version 2.0 2.0
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Lovecats.oxp n/a
Download URL https://wiki.alioth.net/img_auth.php/a/a9/LoveCats_2.0.oxz n/a
License CC-BY-NC-SA 3.0 CC-BY-NC-SA 3.0
File Size n/a
Upload date 1698241753

Documentation

Also read http://wiki.alioth.net/index.php/Love%20Cats

readme.txt

By johnsmith

A tale of love and betrayal amongst the vicious furry feline races of galaxy four. Can you pilot your way through the intrigue of the ancient mating rituals of the Teance system, and save star-crossed lovers from a fate worse than death?

Starts in galaxy four. A fast ship, fuel scoops, and a hard heart are recommended.

Minimum requirements: Oolite 1.80

To install:
Move the Lovecats.oxp file into the AddOns folder in your Oolite folder. The Oolite folder is where the Oolite program resides. The Lovecats.oxp file is in the Lovecats folder along with this README.txt file. DO NOT move the entire Lovecats folder into the AddOns folder - you only need the Lovecats.oxp file.

Version 2.0 Code changes by phkb
- Updated ship models to use Griff's Asp Mark II and escape pod.
- Fixed issue preventing bounty from being reset when mission complete.
- Fixed error in missiontext.plist that would prevent a text helper from being shown.
- Changed Captain Curruthers to Rear Admiral if the Cataclysm mission has been run.
- Switched %J references to %G references in missiontext.plist.
- Updated mark/unmark system to use latest Oolite standards.
- Characters are added to Library Pad, if installed.
- Ensured compatibility with Bounty System OXP.
- Code cleanup an refactoring.

Version 1.3.1 Code change by Eric Walch.
- Removed all 1.65 files and last legacy code.
- Converted plists to open-step versions.
- Changed the code for marking mission destinations, so it will work correct after Oolite 1.76.

Version 1.3 Code change by Eric Walch.
- Translated the legacy script code to JS. Raised the minimum Oolite to version 1.75.
- One can still play it with 1.65 and the legacy code when the file requires.plist is removed but it will bug than with intermediate Oolite releases.

Version 1.2.1 Code change by Eric Walch.
- Minor improvement to place one mission ship at a more defined start location. (Because of randomness it was sometimes impossible to find)

Version 1.2 Code change by Eric Walch.
- Added code to recover from other oxp's that overwrite its mission screens before a choice was made.
- Renamed internally files to more unique names.

Version 1.1 Code change by Eric Walch.
- Added MOP code to prevent clashing mission offers.
- Restructured the code for faster code evaluation.
- Removed the necessity to do this mission after the native nova mission. Added code that made them both more compatible and it now gives a clue when there is no solution because of a (rare) nova mission conflict. Doing this mission first will even prevent this rare conflict to happen at all.

Version 1.0 Original version Written by johnsmith.

Equipment

This expansion declares no equipment.

Ships

Name
Valrisian's Asp
Valrisian Hunter
Valrisian Hunters
Valrisian's Hunters
Escape capsule

Models

This expansion declares no models.

Scripts

Path
Scripts/lovecat.js
"use strict";
this.name = "wedding";
this.author = "johnsmith, JS translation by Eric Walch";
this.description = "Script used for the lovecats mission.";
this.version = "2.0";

// if the player has started Cataclysm, Curruthers has become a Rear Admiral
// so we'll tweak the rank in that case
this._rank = "Captain";

this.startUp = function () {
    if (missionVariables.wedding == "THE_END") {
        // mission is over, no need to evaluate any code anymore.
        this.$clearHandlers();
    }
    if (missionVariables.cataclysm) {
        this._rank = "Rear Admiral";
    }
	var vx = worldScripts.VimanaX_HUD;
	if (vx) {
		// update vimana to use a different model to the original
		vx._gameShips["Valrisian Hunters"] = "asp2";
		vx._gameShips["Valrisian's Hunters"] = "asp2";
		vx._gameShips["Valrisian Hunter"] = "asp2";
		vx._gameShips["Valrisian's Asp"] = "asp2";
	}
};

this.missionScreenOpportunity = function () {
    if (galaxyNumber != 3) return;
    var wedding = missionVariables.wedding;
    if (player.ship.dockedStation.isMainStation) {
        missionVariables.lovecats_rank = this._rank;

        if (system.ID > 142 && !wedding) {
            mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "wedding_quietword" });
            missionVariables.wedding = "STAGE199";
            missionVariables.wedding_started = "YES";
            mission.setInstructionsKey("wm1_short_desc0");
            mission.markSystem({system:141, name:"lovecats"});
        }

        if (system.ID == 141 && (wedding == "STAGE0" || wedding == "STAGE199")) {
            mission.unmarkSystem({system:141, name:"lovecats"});
            mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "wedding_first_briefing", choicesKey: "wedding_caruth_choice" },
                function (choice) {
                    if (choice == "WEDDING_YES") {
                        missionVariables.wedding = "STAGE1";
                        mission.setInstructionsKey("wm1_short_desc1");
                        mission.markSystem({system:149, name:"lovecats"});
                    }
                    if (choice == "WEDDING_NO") {
                        this.$missionEnded();
                    }
                });
            this.$addPadCharacter("felix");
        }

        if (system.ID > 142 && wedding == "STAGE1") {
            mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "wedding_news", overlay: "iNews.png" });
            missionVariables.wedding = "STAGE2";
        }

        if (system.ID == 149 && (wedding == "STAGE1" || wedding == "STAGE2")) {
            mission.unmarkSystem({system:149, name:"lovecats"});
            mission.setInstructionsKey(null); // needed here to avoid an string expansion problem in Oolite. Will be solved in Oolite 1.75.4
            mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "wedding_second_briefing", model: "lovecat_carlo" });
            var ship = mission.displayModel;
            ship.position = ship.position.multiply(4); // put a bit further away so it becomes smaller.
            missionVariables.wedding = "STAGE3";
            mission.setInstructionsKey("wm1_short_desc2");
            mission.markSystem({system:114, name:"lovecats"});
            this.$addPadCharacter("romeo");
            this.$addPadCharacter("oola");
        }

        if (system.ID == 16) {
            if (wedding == "DESTROYED") {
                mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "wedding_killed", overlay: "lovecats_Valrisian.png" });
                mission.setInstructionsKey(null);
                mission.unmarkSystem({system:16, name:"lovecats"});
                this.$missionEnded();
                player.bounty += 64;
                player.ship.manifest.narcotics += 1;
                player.ship.launch();
            }
            if (wedding == "CAPTURED") {
                mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "wedding_thanks_briefing", overlay: "lovecats_Valrisian.png" });
                missionVariables.wedding = "STAGE4";
                mission.setInstructionsKey(null);
                mission.unmarkSystem({system:16, name:"lovecats"});
                player.credits += 10000;
                // small hack to get the bounty system to do a full reset
                if (player.bounty == 0) player.bounty = 10;
                player.bounty = 0;
            }
        }

        if (system.ID > 17 && (wedding == "STAGE4" || wedding == "STAGE98")) { // Test for STAGE98 has historical reasons and could be in old save files.
            mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "wedding_oola", choicesKey: "wedding_oola_choice", overlay: "lovecats_heart.png" },
                function (choice) {
                    if (choice == "WEDDING_YES") {
                        missionVariables.wedding = "STAGE99";
                        mission.setInstructionsKey("wm1_short_desc6");
                        mission.markSystem({system:41, name:"lovecats"});
                    }
                    if (choice == "WEDDING_NO") {
                        this.$missionEnded();
                    }
                });
        }

        if (system.ID == 41 && wedding == "STAGE99") {
            mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "wedding_oola_thanks", overlay: "lovecats_heart.png" });
            missionVariables.wedding = "STAGE100";
            mission.setInstructionsKey(null);
            mission.unmarkSystem({system:41, name:"lovecats"});
            player.credits += 3209;
            player.score += 6;
            this.$addInfoToPadCharacter("romeo", "Married Oola Waad's sister.");
        }

        if ((system.ID == 16 || system.ID == 149) && wedding == "STAGE99") {
            mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "wedding_oola_betrayed", overlay: "lovecats_Valrisian.png" });
            missionVariables.wedding = "STAGE100";
            mission.setInstructionsKey(null);
            mission.unmarkSystem({system:41, name:"lovecats"});
            this.$addInfoToPadCharacter("romeo", "Married Oola Waad's sister.");
            this.$addInfoToPadCharacter("oola", "Sentenced to be executed on Teance.");
        }

        if (system.ID > 42 && wedding == "STAGE100") {
            mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "wedding_news2", overlay: "iNews.png" });
            this.$addInfoToPadCharacter("Assassinated " + (clock.days - 1) + ":23:02" + " on Teance.");
            this.$missionEnded();
        }

        if (this.nova_bug) {
            mission.runScreen({screenID:"lovecats", title: "Lovecat", messageKey: "nova_wedding_newsflash", overlay: {name:"solar.png", height:346} });
            this.nova_bug = false;
            if (wedding == "STAGE3" && (this.nova_bug_planet == 83 || this.nova_bug_planet == 114)) {
                mission.addMessageTextKey("nova_wedding_newsflash2");
            } else {
                this.$missionEnded(); // no solution left because of nova system.
            }
        }

        delete missionVariables.lovecats_rank;
    }
};

this.shipLaunchedFromStation = function () {
    if (galaxyNumber == 3) {
        this.$addShips();
    }
    delete this.shipLaunchedFromStation; // we only need this handler on the very first launch.
};

this.shipExitedWitchspace = function () {
    if (galaxyNumber != 3 || system.isInterstellarSpace) return;
    this.$addShips();
    if (!missionVariables.nova && missionVariables.wedding_started == "YES") {
        missionVariables.novacount = 0; // suppress the nova mission.
    }
    if (system.sun && system.sun.hasGoneNova && [16, 41, 83, 114, 141, 149].indexOf(system.ID) > -1) {
        // one of the mission systems is a nova system.
        this.nova_bug = true;
        this.nova_bug_planet = system.ID;
    }
};

this.guiScreenChanged = function () {
    if (galaxyNumber == 3 && player.ship.docked && player.ship.dockedStation.isMainStation && guiScreen == "GUI_SCREEN_SYSTEM_DATA") {
        if (system.ID == 114 && missionVariables.wedding == "STAGE3") {
            mission.addMessageTextKey("wedding_moved");
            mission.setInstructionsKey("wm1_short_desc4");
            mission.unmarkSystem({system:114, name:"lovecats"});
            mission.markSystem({system:83, name:"lovecats"});
        }
        if (system.ID == 83 && missionVariables.wedding == "STAGE3") {
            mission.addMessageTextKey("wedding_missed");
            mission.setInstructionsKey("wm1_short_desc4");
            mission.unmarkSystem({system:114, name:"lovecats"});
            mission.unmarkSystem({system:83, name:"lovecats"});
        }
    }
};

this.$addShips = function () {
    if (system.ID == 83 && missionVariables.wedding == "STAGE3") {
        var position = Vector3D(-0.02, 0, 0.11).fromCoordinateSystem("wpu");
        system.addShips("lovecat_carlo", 1, position);
        mission.setInstructionsKey("wm1_short_desc4");
    }
    if (system.ID == 41 && missionVariables.wedding == "STAGE99") {
        system.addShipsToRoute("cat_asp", 4, 0.01, "wp");
        system.addShipsToRoute("cat_asp2", 2, 0.01, "wp");
    }
    if (system.ID == 149 && missionVariables.conhunt == "MISSION_COMPLETE") {
        system.addShipsToRoute("cat_asp3", 4, 0.5, "wp");
    }
};

this.$missionEnded = function () {
    missionVariables.wedding = "THE_END";
    delete missionVariables.wedding_started;
    this.$clearHandlers();
};


this.$clearHandlers = function () {
    delete this.missionScreenOpportunity;
    delete this.shipLaunchedFromStation;
    delete this.shipExitedWitchspace;
    delete this.missionScreenOpportunity;
    delete this.guiScreenChanged;
};

//-------------------------------------------------------------------------------------------------------------
this.$addPadCharacter = function(person, info) {
    var pad = worldScripts.Lib_PAD;
	if (!pad) return;
	var dta = {};
	var cat = [];
    cat.push("PERSONS.GENERIC");

	switch (person) {
		case "romeo":
			dta.name = "Romeo Valrisian";
			dta.origin = "Teance";
			dta.species = "Feline";
			dta.gender = "Male";
			dta.age = 27;
			dta.ship = "Asp Mark II";
			dta.rank = "";
			dta.t0 = 0;
			dta.t1 = "lib_null.png";
			dta.t2 = 0;
			break;
        case "oola":
			dta.name = "Oola Waad";
			dta.origin = "Onzaenve";
			dta.species = "Feline";
			dta.gender = "Female";
			dta.age = 23;
			dta.ship = "Unknown";
			dta.rank = "";
			dta.t0 = 0;
			dta.t1 = "lib_null.png";
			dta.t2 = 0;
			break;
        case "felix":
			dta.name = "Felix Valrisian";
			dta.origin = "Teance";
			dta.species = "Feline";
			dta.gender = "Male";
			dta.age = 47;
			dta.ship = "Unknown";
			dta.rank = "Regent";
			dta.t0 = 0;
			dta.t1 = "lib_null.png";
			dta.t2 = 0;
			break;
    }

    dta.info = [];
    if (info) dta.info.push(info);
	var id = "PERSONS." + (dta.rank != "" ? dta.rank.toUpperCase() : dta.name.split(" ")[0]) + " " + dta.name.split(" ")[1].toUpperCase();
	pad._addPageInCategory(id, dta, cat, false);
}

//-------------------------------------------------------------------------------------------------------------
this.$addInfoToPadCharacter = function(person, text) {
    var pad = worldScripts.Lib_PAD;
	if (!pad) return;
    var id = "";
    switch (person) {
        case "romeo":
            id = "Romeo Valrisian".toUpperCase();
            break;
        case "oola":
            id = "Oola Waad".toUpperCase();
            break;
        case "felix":
            id = "Regent Valrisian".toUpperCase();
            break;
    }
    worldScripts.Lib_PAD._setPageEntry("PERSONS." + id + ".info", text);
}
Scripts/lovecat_asp.js
"use strict";
this.name = "lovecat_asp";
this.author = "eric walch";
this.description = "ship script for lovecats";
this.version = "1.2";

this.shipDied = function () {
	this.ship.commsMessage("Miew! Miew!!!")
	if (this.ship.primaryRole == "lovecat_carlo") {
		if (missionVariables.wedding != "CAPTURED") missionVariables.wedding = "DESTROYED"
		// missionVariables.wedding will be set to "CAPTURED" when delivering the scooped pilot
		mission.unmarkSystem({system:83, name:"lovecats"});
		mission.unmarkSystem({system:114, name:"lovecats"});
	}
}

this.shipLaunchedEscapePod = function (pod) {
	if (this.ship.primaryRole == "lovecat_carlo") {
		pod.commsMessage("I'll never mary Oola Waad.");
		//pod.setCargo("slaves", 1); // needed to keep a scripted pod in the hold.
		mission.setInstructionsKey("wm1_short_desc3a", "wedding");
		mission.unmarkSystem({system:83, name:"lovecats"});
		mission.unmarkSystem({system:114, name:"lovecats"});
	}
}

this.shipEnergyIsLow = function () {
	this.ship.abandonShip();
	delete this.shipEnergyIsLow;
}
Scripts/lovecat_escapepod.js
"use strict";
this.name = "lovecat_escapepod";
this.author = "eric walch";
this.description = "ship script for lovecats";
this.version = "1.1";

this.shipDied = function () {
    missionVariables.wedding = "DESTROYED";
}

this.shipWasScooped = function (scooper) {
    if (scooper.isPlayer) {
        mission.setInstructionsKey("wm1_short_desc3", "wedding");
        missionVariables.wedding = "CAPTURED";
        mission.markSystem({system:16, name:"lovecats"});
    }
}
Scripts/lovecat_romeo.js
"use strict";
this.name = "lovecat_romeo";
this.author = "eric walch";
this.description = "pilot script for lovecats";
this.version = "1.1";

this.unloadCharacter = function () {
    missionVariables.wedding = "CAPTURED";
    player.addMessageToArrivalReport(expandMissionText("wedding_transfer"));
    player.bounty |= 64;
}