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

Expansion Hard Eject

Content

Warnings

  1. No version in dependency reference to oolite.oxp.phkb.ShipRepurchase:null
  2. No version in dependency reference to oolite.oxp.Thargoid.RepairBots:null
  3. Conflict Expansions mismatch between OXP Manifest and Expansion Manager at character position 0064 (DIGIT ZERO vs LATIN SMALL LETTER N)

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description New insurance rules gives you after ejection ship in basic configuration. All lost upgrades displays on F5 screen as damaged. You may restore lost upgrades immediately if system TL allows it or later in system with adequate TL. Insurance covers 50% of lost equipment price. New insurance rules gives you after ejection ship in basic configuration. All lost upgrades displays on F5 screen as damaged. You may restore lost upgrades immediately if system TL allows it or later in system with adequate TL. Insurance covers 50% of lost equipment price.
Identifier oolite.oxp.stranger.HardEject oolite.oxp.stranger.HardEject
Title Hard Eject Hard Eject
Category Mechanics Mechanics
Author stranger stranger
Version 0.4.1 0.4.1
Tags ejection, equipment, ship ejection, equipment, ship
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
  • oolite.oxp.phkb.ShipRepurchase:0
  • oolite.oxp.Thargoid.RepairBots:0
  • oolite.oxp.phkb.ShipRepurchase:
  • oolite.oxp.Thargoid.RepairBots:
  • Information URL http://aegidian.org/bb/viewtopic.php?f=4&t=19581 n/a
    Download URL https://wiki.alioth.net/img_auth.php/e/e1/HardEject.oxz n/a
    License CC-BY-NC-SA 3.0 CC-BY-NC-SA 3.0
    File Size n/a
    Upload date 1610873492

    Documentation

    Also read http://wiki.alioth.net/index.php/Hard%20Eject

    ReadMe & License.txt

    Hard Eject OXP by Stranger
    
    This OXP is released under the Creative Commons Attribution - Non-Commercial - Share Alike 3.0 license.
    You are free to use and distribute this OXP on non-commercial basis. 
    Rebundling of this OXP within another distribution is permitted as long as it is unchanged.
    Any mods/derivatives of this OXP must be distributed under another names.
    The license information (either as this file or merged into a larger one) must be included in the OXP.
    
    --------------------------------------------------------------
    
    This OXP changes game mechanics by implementing more strong (and more realistic!) rules of ship insurance.
    By default ejection from ship in escape capsule leads only to loss of cargo (and escape capsule itself). New ship inherits all functional equipment from lost ship regardless of system TL - you get ship fully equipped with high tech gadgets anywhere in low tech systems!
    New insurance rules gives you ship in basic configuration. All lost upgrades displays on F5 screen as damaged. You may restore lost upgrades immediately if system TL allows it or later in system with adequate TL. In both cases insurance covers 50% of lost equipment price.
    Galactic hyperdrive remains in inventory to prevent trap in isolated systems.
    All standard lasers are removed from inventory and replaced with front pulse laser (or miner laser in case of miner scenario).
    All pylon mounted items (missiles, mines, extra fuel tanks, pylon mounted galactic hyperdrive pods etc) are removed without compensation.
    Extra items, gathered as awards in missions (cloaking device for example) are removed from inventory without compensation.
    
    List of extra items, removed from inventory without compensation:
    
    Military Jammer aka MASC'M
    Military Scanner Filtering
    Naval Cloaking Device
    Naval Energy Unit
    Shield Enhancers
    
    To achieve 50% insurance fee you must have CLEAR legal status and do not have ANY installed second-hand (salvaged) equipment!
    
    Enjoy!
    
    --------------------------------------------------------------
    
    COMPATIBILITY ISSUES
    
    This OXP is not compatible with Ship Repurchase OXP (author phkb).
    This OXP is not compatible with Repair Bots (author Thargoid) or any such OXP, restoring damaged equipment in flight.
    
    ______________________________________________________________
    
    Version history:
    
    13.02.2019 - Version 0.4.1	Converted onto OXZ.
    14.04.2018 - Version 0.4	In case of miner scenario ship remains mining laser in front port.
    				manifest.plist added.
    31.03.2018 - Version 0.3	Script rewritten to dynamically process additional OXP equipment.
    03.12.2013 - Version 0.2.	Script modified to prevent infinite loop in case of nonstandard pylon mounted equipment (obsolete, now I have better decision).
    				Pylon mounted Galactic Drive pods removed from inventory without compensation.
    22.11.2013 - Version 0.1.	Initial release.

    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/hard_eject.js
    "use strict";
    this.name                   = "Hard Eject";
    this.author                 = "Stranger";
    this.copyright				= "Creative Commons: attribution, non-commercial, sharealike with clauses - see readme.txt";
    this.description			= "Script for simulating payment for lost equipment after ejecting in escape capsule.";
    this.version				= "0.4.1";
    
    //this equipment remove in any case
    this.$equipment_remove = new Array(
        "EQ_CLOAKING_DEVICE",
        "EQ_MILITARY_JAMMER",
        "EQ_MILITARY_SCANNER_FILTER",
        "EQ_NAVAL_ENERGY_UNIT",
        "EQ_SHIELD_ENHANCER"
    );
    
    this.shipLaunchedFromStation = function()
    	{
        this.$escapeFlag = 0;        // reset eject history
        }
    
    this.shipLaunchedEscapePod = function()
        {
        this.$escapeFlag = 1;        // eject recorded
        }
    
    this.shipDockedWithStation = function()
    	{
        if (this.$escapeFlag == 1)    // eject detected
            {        
            for (var i = 0; i < this.$equipment_remove.length; i++)
                {
                player.ship.removeEquipment(this.$equipment_remove[i]);
                }
            var shipRoleInfo = player.ship.shipClassName;
            if (shipRoleInfo.indexOf("Mining") != -1 || shipRoleInfo.indexOf("Bushmaster") != -1)
                {
                player.ship.forwardWeapon = "EQ_WEAPON_MINING_LASER";   // miner scenario
                }
            else
                {
                player.ship.forwardWeapon = "EQ_WEAPON_PULSE_LASER";    // generic scenario
                }
            player.ship.aftWeapon = "EQ_WEAPON_NONE";        
            player.ship.portWeapon = "EQ_WEAPON_NONE";
            player.ship.starboardWeapon = "EQ_WEAPON_NONE";
            player.ship.awardEquipment("EQ_MISSILE_REMOVAL");
    
            var eqList = player.ship.equipment;
            // check player legal status AND unlicensed equipment
            if (player.bounty == 0 && (!missionVariables.anarchies_salvaged_equipment || missionVariables.anarchies_salvaged_equipment == 0))         
                {
                for (var i = 0; i < eqList.length; i++)
                    {
                    var eq = eqList[i];
                    // processing any remaining equipment with exception of Breakable Equipment AND Galactic Hyperdrive
                    if (player.ship.equipmentStatus(eq.equipmentKey) == "EQUIPMENT_OK" && eq.equipmentKey.indexOf("EQ_BREAKABLE") < 0 && eq.equipmentKey != "EQ_GAL_DRIVE" && eq.damageProbability > 0)
                        {
                        player.ship.setEquipmentStatus(eq.equipmentKey, "EQUIPMENT_DAMAGED");
                        }    
                    }          
                }
            else
                {
                for (var i = 0; i < eqList.length; i++)
                    {
                    var eq = eqList[i];
                    if (eq.equipmentKey.indexOf("EQ_BREAKABLE") < 0 && eq.equipmentKey != "EQ_GAL_DRIVE")
                        {
                        player.ship.removeEquipment(eq.equipmentKey);
                        }
                    }
                missionVariables.anarchies_salvaged_equipment = 0;  // erase salvaged equipment history
                }
            }
        }