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

Expansion MincePie

Content

Warnings

  1. Found XML equipment list
  2. XML script list found
  3. Required Expansions mismatch between OXP Manifest and Expansion Manager at character position 0056 (DIGIT ZERO vs LATIN SMALL LETTER N)
  4. No version in dependency reference to oolite.oxp.Griff.Santa:null

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Santa likes mince pies. Putting one out is a sure way to make sure he'll come to your system - though his sense of smell isn't that good, so he will have to be within range of the pie to attract him in. Sit near the pie to see Santa eat. Mince pies work like mines so you need space in your rack to buy one (using F3 for equipment). Like Santa, mince pies are time of year limited. Santa likes mince pies. Putting one out is a sure way to make sure he'll come to your system - though his sense of smell isn't that good, so he will have to be within range of the pie to attract him in. Sit near the pie to see Santa eat. Mince pies work like mines so you need space in your rack to buy one (using F3 for equipment). Like Santa, mince pies are time of year limited.
Identifier oolite.oxp.Chris.MincePie oolite.oxp.Chris.MincePie
Title MincePie MincePie
Category Missions Missions
Author Chris Chris
Version 1.1 1.1
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
  • oolite.oxp.Griff.Santa:0
  • oolite.oxp.Griff.Santa:
  • Optional Expansions
    Conflict Expansions
    Information URL http://wiki.alioth.net/index.php/X n/a
    Download URL https://wiki.alioth.net/img_auth.php/2/27/MincePie_1.1.oxz n/a
    License CC BY-NC-SA 4 CC BY-NC-SA 4
    File Size n/a
    Upload date 1610873255

    Documentation

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

    readme.txt

    Name:
    mincePie.oxp
    
    License:
    This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
    
    Description:
    Even dafter than santa.oxp, which this is a development for.
    
    Installation:
    Place the mincePie.oxp folder in the AddOns folder inside your oolite folder.
    You must have santa.oxp installed for this to work.
    
    Instructions:
    Santa likes mince pies. Putting one out is a sure way to make sure he'll come to your system - though his sense of smell isn't that good, so he will have to be within range of the pie to attract him in. Sit near the pie to see Santa eat. Mince pies work like mines so you need space in your rack to buy one (using F3 for equipment). Like Santa, mince pies are time of year limited, though given the slightly extended date range you can attract Santa a bit earlier than he'd normally come.
    
    Currently a beta version, and not yet on the wiki - I have some slight enhancements planned, but given timescales thought I ought to get it out! This is also my first attempt at an OXP, so I'm sure there are things I could do better, or tricks I'm missing - feedback would be welcomed (on topic http://aegidian.org/bb/viewtopic.php?t=7237 or pm aracer http://aegidian.org/bb/privmsg.php?mode=post&u=2739 on oolite bb).
    
    Chris
    

    Equipment

    Name Visible Cost [deci-credits] Tech-Level
    Mince Pie yes 250 100+

    Ships

    Name
    Eaten Mince Pie
    Mince Pie

    Models

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

    Scripts

    Path
    Scripts/hungrySanta.js
    this.name           = "hungrySanta"
    this.author         = "Chris McSweeny"
    this.copyright      = "Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License."
    this.description    = "Hungry santa seeks mince pies";
    this.version        = "1.0 beta"
    
    this.seekPie = function() {
        var pies = system.shipsWithRole("EQ_MINCE_PIE_MINE", this.ship, 20000);
        if (pies.length != 0)
        {
            if (this.ship.AI != "hungrySantaAI.plist") {
                this.ship.setAI("hungrySantaAI.plist");
            }
        }
        pies = system.shipsWithRole("EQ_MINCE_PIE_MINE");
        if (pies.length == 0)
        {
            this.shipTimer.stop();
            delete this.shipTimer;
            delete this.shipDied;
            delete this.playerWillEnterWitchspace;
            delete this.eatingPie;
            delete this.eatenPie;
            delete this.burp;
            delete this.seekPie;
        }
    }
    
    this.shipDied = this.playerWillEnterWitchspace = function () {
        if (this.shipTimer) {
            this.shipTimer.stop();
            delete this.shipTimer;
        }
    }
    
    this.eatingPie = function () {
        var pies = system.shipsWithRole("EQ_MINCE_PIE_MINE", this.ship, 100);
        if (pies.length != 0)
        {
            pies[0].orientation = this.ship.orientation;
        }
    }
    
    this.eatenPie = function () {
        var pies = system.shipsWithRole("EQ_MINCE_PIE_MINE", this.ship, 100);
        if (pies.length != 0)
        {
            var piePos = pies[0].position;
            var pieOrient = pies[0].orientation;
            pies[0].remove();
            system.legacy_addShipsAtPrecisely("eatenMincePie", 1, "abs", piePos);
            var eatenPies = system.shipsWithRole("eatenMincePie", this.ship, 100);
            if (eatenPies.length != 0) {
                eatenPies[0].orientation = pieOrient;
            }
        }
        this.ship.commsMessage("Thanks for the pie - have a pressie from Santa");
        switch (Math.floor(Math.random()*4)) {
        case 0:
            this.ship.ejectSpecificItem("prezzie1");
            break;
        case 1:
            this.ship.ejectSpecificItem("prezzie3");
            break;
        case 2:
            this.ship.ejectSpecificItem("prezzie6");
            break;
        case 3:
            this.ship.ejectSpecificItem("prezzie7");
            break;
        default:
            break;
        }
        this.burpTimer = new Timer(this, this.burp, 6, 0);
    }
    
    this.burp = function () {
        this.ship.commsMessage("Burp");
    }
    
    // script startup - start timer
    if (!this.shipTimer) {
        this.shipTimer = new Timer(this, this.seekPie, 10, 10);
    }
    
    Scripts/mincePie.js
    this.name           = "mincePie"
    this.author         = "Chris McSweeny"
    this.copyright      = "Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License."
    this.description    = "Mince Pie for santa";
    this.version        = "1.0 beta"
    
    this.shipSpawned = function() {
        // make stationary
        this.ship.desiredSpeed = 0;
        // make santa jump in if he's not already in system
        if (system.countShipsWithRole("santaclaus") == 0) {
            system.legacy_addShips('santaclaus', 1); 
        }
        // make santa search for mince pie
        var santas = system.shipsWithRole("santaclaus");
    	santas.forEach(function(ship) {
    	    ship.setScript("hungrySanta.js")
    	});    
    }
    
    Scripts/mincePieStartup.js
    this.name           = "mincePieStartup"
    this.author         = "Chris McSweeny"
    this.copyright      = "Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License."
    this.description    = "Something for Santa";
    this.version        = "1.0 beta"
    
    // All code, plists, models, textures in MincePie.oxp created by Chris McSweeny (with a little help from Eric Walch).
    // MincePie.oxp requires santa.oxp to be installed.
    // This does not imply any endorsement from the authors of santa.oxp
    // MincePie.oxp released under Oolite Creative Commons license.
    this.startUp = this.reset = function() { 
        var today = new Date(); 
        if ((today.getMonth() == 11) && (today.getDate() < 26) && worldScripts["santaClausMain"]) { 
            var mincePieInfo = EquipmentInfo.infoForKey("EQ_MINCE_PIE_MINE"); 
            mincePieInfo.effectiveTechLevel = 1; 
        } else { 
            missionVariables.TL_FOR_EQ_MINCE_PIE_MINE = null; 
        } 
    } 
    
    this.shipLaunchedFromStation = function(station) { 
        var today = new Date(); 
        if ((today.getMonth() == 11) && (today.getDate() < 26)) { 
        } else { 
            var mincePiesRemoved = 0; 
            while (player.ship.hasEquipment("EQ_MINCE_PIE_MINE")) { 
                player.ship.removeEquipment("EQ_MINCE_PIE_MINE"); 
                mincePiesRemoved++; 
            } 
            if (mincePiesRemoved == 1) { 
                player.consoleMessage("Your mince pie was stale"); 
            } else if (mincePiesRemoved > 1) { 
                player.consoleMessage("Your mince pies were stale"); 
            }    
        } 
        delete this.shipLaunchedFromStation; 
    }