Source: mod.js

/**
 * config.json should be in the root folder of your .zip file
 * @typedef {object} config
 * @property {string} id - id of your mod
 * @property {string} name - name of your mod
 * @property {string} description - description of your mod
 * @property {string} version - version of your mod
 * @property {string} compatible - what minimum version of Queen's Brothel does this mod need
 * @example
 * {
 *     "id": "modID",
 *     "name": "My mod",
 *     "description": "A description of my mod.",
 *     "version": "1.0.0",
 *     "compatible": "0.7.3"
 * }
 */

/**
 * See {@link https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html#pack__anchor} for more info on Phaser asset packs
 * urls will be relative to your assets.zip directory
 * @typedef {object} loadpackConfig
 * @property {object} assetHeader
 * @property {array} assetHeader.files
 * @example
 * {
 *     "type": "script",
 *     "key": "myModScript",
 *     "url": "myMod.js"
 * },
 * {
 *     "type": "image",
 *     "key": "hotGirl",
 *     "url": "assets/hotGirl.png"
 * }
 */

/**
 * The mod class will let you handle everything you need to do.
 * @class Mod
 * @param {string} id
 */
class Mod {
    constructor(id) {
        this.id = id;
        this.name = id;
        MODS[id] = this;

        /**
         * @name Mod#menu
         * @type {MenuManager}
         */
        this.menu = Gameplay.prototype.menu;
        /**
         * The QuestManager for this mod's quests
         * @name Mod#quest
         * @type {QuestManager}
         */
        this.quest = new QuestManager(this.id);
        /**
         * The default QuestManager
         * @name Mod#QBquest
         * @type {QuestManager}
         */
        this.QBquest = Gameplay.prototype.quest;
        /**
         * @name Mod#girl
         * @type {GirlManager}
         */
        this.girl = Gameplay.prototype.girl;
        /**
         * @name Mod#dialogue
         * @type {DialogueManager}
         */
        this.dialogue = Gameplay.prototype.dialogue;
        /**
         * @name Mod#map
         * @type {MapManager}
         */
        this.map = Gameplay.prototype.map;
        /**
         * @name Mod#client
         * @type {ClientManager}
         */
        this.client = Gameplay.prototype.client;
        /**
         * @name Mod#item
         * @type {ItemManager}
         */
        this.item = Gameplay.prototype.item;
        /**
         * @name Mod#clothes
         * @type {ClothesManager}
         */
        this.clothes = Gameplay.prototype.clothes;
        /**
         * @name Mod#animation
         * @type {AnimationManager}
         */
        this.animation = Gameplay.prototype.animation;
        /**
         * @name Mod#battle
         * @type {BattleManager}
         */
        this.battle = Gameplay.prototype.battle;
        /**
         * @name Mod#boss
         * @type {BossManager}
         */
        this.boss = Gameplay.prototype.boss;
        /**
         * @name Mod#QBsound
         * @type {SoundManager}
         */
        this.QBsound = Gameplay.prototype.sound;

        /**
         * Fades the game to black and then returns back to game back to normal and resolves the Promise at the same time
         * @method fade
         * @memberOf Mod
         * @instance
         * @param {number} [delay=1000]
         * @returns Promise
         * @example
         * myMod.fade().then(() => {console.log("After done fading.");});
         */
        this.fade = Gameplay.prototype.fade;

        /**
         * Flashes the screen and returns back to normal
         * @method cumFlash
         * @memberOf Mod
         * @instance
         */
        this.cumFlash = Gameplay.prototype.cumFlash;

        /**
         * Returns the amount of gold the player has
         * @method getGold
         * @memberOf Mod
         * @instance
         * @returns {number}
         */
        this.getGold = Gameplay.prototype.getGold;

        /**
         * Gives gold to the player
         * @method addGold
         * @memberOf Mod
         * @instance
         * @param {number} amount
         * @example
         * myMod.addGold(1000);
         */
        this.addGold = Gameplay.prototype.addGold;

        /**
         * Removes gold from the player
         * @method removeGold
         * @memberOf Mod
         * @instance
         * @param {number} amount
         * @example
         * myMod.removeGold(1000);
         */
        this.removeGold = Gameplay.prototype.removeGold;

        /**
         * Saves the game
         * @method save
         * @memberOf Mod
         * @instance
         */
        this.save = Gameplay.prototype.save;

        /**
         * Displays a notification pop-up in the top left corner of the game and also puts it in the notifications menu
         * @method notify
         * @memberOf Mod
         * @instance
         * @param {string} text - The text to send to the notifications
         * @example
         * myMod.notify("Hello!");
         */
        this.notify = Gameplay.prototype.notify;

        /**
         * Returns todays date, the same string in the HUD of the game
         * @method getDate
         * @memberOf Mod
         * @instance
         * @returns {string}
         */
        this.getDate = Gameplay.prototype.getDate;

        /**
         * Returns the current day as a number
         * @method getDay
         * @memberOf Mod
         * @instance
         * @returns {number}
         */
        this.getDay = Gameplay.prototype.getDay;

        /**
         * Returns the level of a body part by the given exp parameter
         * @method getLevel
         * @memberOf Mod
         * @instance
         * @param {number} exp
         * @returns {number}
         */
        this.getLevel = Gameplay.prototype.getLevel;

        /**
         * Returns the exp of a body part by the given level parameter
         * @method getExp
         * @memberOf Mod
         * @instance
         * @param {number} level
         * @returns {number}
         */
        this.getExp = Gameplay.prototype.getExp;

        /**
         * A Sigmoid function
         * @method Sigmoid
         * @memberOf Mod
         * @instance
         * @param {number} skill
         * @param {number} difficulty
         * @param {number} [steepness=-10]
         * @param {number} [offset=5]
         * @returns {number}
         */
        this.Sigmoid = Gameplay.prototype.Sigmoid;

        /**
         * Returns all of the quests for the game + all of the mods
         * @method getAllQuests
         * @memberOf Mod
         * @instance
         * @returns {Array}
         */
        this.getAllQuests = Gameplay.prototype.getAllQuests;

        /**
         * Returns all of the active quests for the game and searches through all of the mods
         * @method getActiveQuests
         * @memberOf Mod
         * @instance
         * @returns {Array}
         */
        this.getActiveQuests = Gameplay.prototype.getActiveQuests;

        /**
         * Returns the player's reputation for the brothel
         * @method getReputation
         * @memberOf Mod
         * @instance
         * @returns {number}
         */
        this.getReputation = Gameplay.prototype.getReputation;

        /**
         * Increases the reputation for the brothel
         * @method increaseReputation
         * @memberOf Mod
         * @instance
         * @param {number} amount
         */
        this.increaseReputation = Gameplay.prototype.increaseReputation;

        /**
         * Decreases the reputation for the brothel
         * @method decreaseReputation
         * @memberOf Mod
         * @instance
         * @param {number} amount
         */
        this.decreaseReputation = Gameplay.prototype.decreaseReputation;
    }

    /**
     * @method setName
     * @memberOf Mod
     * @instance
     * @param {string} name
     */
    setName(name) {
        this.name = name;
    }

    /**
     * This method is called when the user loads a save file. All of the variables you need to initialize should be here.
     * @method boot
     * @memberOf Mod
     * @instance
     */
    boot() {

    }

    /**
     * This method is called after a save file is selected and before {@link Mod#boot}. It should be used to create any quests/clothes/stuff needed to initialize the mod
     * @method init
     * @memberOf Mod
     * @instance
     */
    init() {

    }

    /**
     * This method is called whenever the player goes to sleep. It is called after the game's default newDay function
     * @method newDay
     * @memberOf Mod
     * @instance
     */
    newDay() {

    }

    /**
     * Returns the given mod's class
     * @method getOtherMod
     * @memberOf Mod
     * @instance
     * @param {string} modID
     * @return {*}
     */
    getOtherMod(modID) {
        if (MODS.hasOwnProperty(modID)) {
            return MODS[modID];
        } else {
            throw "Mod " + modID + " is not booted or does not exist."
        }
    }
}