MagicIncompatibleHullmods

Proposes a universal solution for hullmod incompatibilities when they can't be avoided through isApplicableToShip. When called, it will remove the offending hullmod, and add a "WARNING" hullmod detailing which hullmod was removed and why. Please note that it is best practice to remove the hullmod that was just added due to the presence of a previously installed one rather than the opposite. Weapons must be added to data/config/modSetting.json in the MagicLib.interferences_weapons section.

- id: weapon id from weapon_data.csv - intensity: defines the amount of interference generated. By default it can be "WEAK", "MILD" or "STRONG, but mods can add new ratings in modSettings.json, although those will not be mentioned in the hullmod description. By default, weak = -20 flux dissipation for each other interference weapon installed, mild = -40 and strong = -80 Then the weapon must have an everyframeWeaponScript to trigger the interference check:

    if(weapon.getShip().getOriginalOwner()<0 && !weapon.getSlot().isBuiltIn()){
    MagicInterference.ApplyInterference(weapon.getShip().getVariant());
}

A default script is provided: org.magiclib.weapons.MagicBasicInterferenceEffect Please note that the interference trait should be mentioned in the weapon extra effect part of the tooltip card.

Author

Tartiflette

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun clearData()
Link copied to clipboard
open fun getReason(variant: ShipVariantAPI): List<String>
Link copied to clipboard
open fun removeHullmodWithWarning(variant: ShipVariantAPI, toRemove: String, removeCause: String)