code:
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
var Nore;
(function (Nore) {
  var SlgCommand;
  (function (SlgCommand) {
    SlgCommand["play"] = "play";
    SlgCommand["stop"] = "stop";
    SlgCommand["actor"] = "actor";
    SlgCommand["facility"] = "facility";
    SlgCommand["business"] = "business";
    SlgCommand["study"] = "study";
    SlgCommand["military"] = "military";
    SlgCommand["invasion"] = "invasion";
    SlgCommand["formation"] = "formation";
    SlgCommand["decisiveBattle"] = "decisiveBattle";
    SlgCommand["soupKichen"] = "soupKichen";
    SlgCommand["option"] = "option";
    SlgCommand["save"] = "save";
    SlgCommand["character"] = "character";
    SlgCommand["av"] = "av";
    SlgCommand["kigae"] = "kigae";
    SlgCommand["dousei"] = "dousei";
    SlgCommand["status"] = "status";
    SlgCommand["endRecording"] = "endRecording";
    SlgCommand["none"] = "none";
  })((SlgCommand = Nore.SlgCommand || (Nore.SlgCommand = {})));
  Nore.TOP_Y = 43;
  var PAPA_VAR = 21;
  var PRICE_VAR = 22;
  Nore.BATTLE_ID_VAR = 23;
  var PAPA_SW = 41;
  Nore.VIDEO_ID_VAR = 24;
  var X_INTERVAL = 110;
  var Y_INTERVAL = 100;
  var Scene_Slg = /** @class */ (function (_super) {
    __extends(Scene_Slg, _super);
    function Scene_Slg() {
      var _this = (_super !== null && _super.apply(this, arguments)) || this;
      _this._waitEventList = [];
      return _this;
    }
    Scene_Slg.prototype.create = function () {
      $gameTemp.inSlg = true;
      this._backlogDisabled = true;
      _super.prototype.create.call(this);
      this.createBackground();
      this.createPictures();
      this.createWindowLayer();
      this.createAllWindows();
      this.createPictures2();
      this.addChild(this._messageWindow);
      this.createCharacterWindow();
      this.createFormationWindow();
      this.createFacilityListWindow();
      this.createCommandWindow();
      this.createParameterWindow();
      this.createMilitaryWindow();
      this.createDecisiveBattleWindow();
      this.createManListWindow();
      this.setParentCommand();
      this.createConfirmWindow();
      this.onCommandChange();
      this.createFadeSprite();
      this.checkSlgInterpreter();
    };
    Scene_Slg.prototype.setParentCommand = function () {
      this._facilityListWindow.setParentCommandWindow(this._commandWindow);
      this._formationWindow.setParentCommandWindow(this._commandWindow);
      this._militaryWindow.setParentCommandWindow(this._commandWindow);
      this._charListWindow.setParentCommandWindow(this._commandWindow);
      this._decisiveBattleWindow.setParentCommandWindow(this._commandWindow);
      this._manCommandWindow.setParentCommandWindow(this._commandWindow);
    };
    Scene_Slg.prototype.setFirstSelection = function () {
      var command = $gameTemp.lastCharCommand;
      if (!command) {
        return;
      }
      this._commandWindow.selectSymbol(command);
      this.onCharacterActivate(true);
      if ($gameParty.menuActor()) {
        this._charListWindow.selectActor($gameParty.menuActor().actorId());
      }
    };
    Scene_Slg.prototype.selectInitialSelection = function () {};
    Scene_Slg.prototype.terminate = function () {
      $gameTemp.inSlg = false;
      $slg.setSlg(false);
      $slg.onSlgTerminate();
      _super.prototype.terminate.call(this);
      //SceneManager.snapForBackground();
    };
    Scene_Slg.prototype.start = function () {
      _super.prototype.start.call(this);
      this._commandWindow.refresh();
      this._commandWindow.select(0);
      this.setFirstSelection();
      this._militaryWindow.refresh();
      this._facilityListWindow.start();
      this.update();
      $slg.setSlg(true);
    };
    Scene_Slg.prototype.updateBackLog = function () {
      if (this._backlogDisabled) {
        return;
      }
      if (!this._commandWindow.active) {
        return;
      }
      if (
        Input.isTriggered(Nore.BackLog.backLogButton) ||
        TouchInput.wheelY < 0
      ) {
        this._windowBackLog = new Nore.BackLog.Window_BackLog();
        SoundManager.playOk();
        this.addChild(this._windowBackLog);
      }
    };
    Scene_Slg.prototype.update = function () {
      _super.prototype.update.call(this);
      this.updateFade();
      $gameScreen.update();
      this.updateSlgEvent();
    };
    Scene_Slg.prototype.updateSlgEvent = function () {
      var isRunning = $slg.isInterpreterRunning();
      //$slg.update();
      if ($slg.isInterpreterRunning()) {
        return;
      } else {
        if (isRunning) {
          $slg.clearInterpreter();
          this.finishScenario();
          return;
        }
      }
      if (this.isInterpreterRunning()) {
        return;
      }
      if ($slg.isDirty()) {
        var slgScenario = $gameParty.nextSlgScenario();
        if (slgScenario) {
          p("TimeEvent SlgScenario:" + slgScenario);
          this.playScenario(slgScenario);
          return;
        }
        var scenario = $gameParty.nextScenario();
        if (scenario) {
          p("TimeEvent scenario:" + scenario);
          this.playScenario(scenario);
          return;
        }
        if ($gameParty.hasCommonEvent()) {
          this.popScene();
          return;
        }
      }
      if ($slg.isDirty()) {
        this.refresh();
        $gameParty.clearDirty();
      }
      if (!this._interpreter) {
        this.updateEvent();
      }
    };
    Scene_Slg.prototype.updateFade = function () {
      this._fadeSprite.opacity = 255 - $gameScreen.brightness();
    };
    Scene_Slg.prototype.refresh = function () {
      this._topWindow.refresh();
      this._formationWindow.refresh();
      this._formationFilterWindow.refresh();
      this._formationListWindow.refresh();
      this._formationDetailWindow.refresh();
      $slg.clearDirty();
      var list = $slg.eventList();
      if (list.length > 0) {
        var history_1 = list.shift();
        if (history_1.status() == TanetsukeStatus.fertilize) {
          history_1.becomePregnant();
        } else if (history_1.status() == TanetsukeStatus.syusan) {
          history_1.syusan();
        } else if (history_1.status() == TanetsukeStatus.firstSex) {
          history_1.playSex();
        }
        var event_1 = new SlgEvent(history_1);
        this.playScenario(event_1.eventName());
      }
    };
    Scene_Slg.prototype.createFadeSprite = function () {
      this._fadeSprite = new ScreenSprite();
      this.addChild(this._fadeSprite);
    };
    Scene_Slg.prototype.createWindowLayer = function () {
      this._windowLayer = new WindowLayer();
      this._windowLayer.x = 0;
      this._windowLayer.y = 0;
      this.addChild(this._windowLayer);
    };
    Scene_Slg.prototype.createConfirmWindow = function () {
      this._confirmWindow = new Nore.Window_Confirm(500);
      this._confirmWindow.setText("AV撮影を行いますか？");
      this.addChild(this._confirmWindow);
      this._confirmWindow.visible = false;
      this._confirmWindow.setHandler("ok", this.onConfirmOk.bind(this));
      this._confirmWindow.setHandler("cancel", this.onConfirmCancel.bind(this));
      this._msgWindow = new Nore.Window_Msg();
      this._msgWindow.setText("AV撮影を行いますか？");
      this.addChild(this._msgWindow);
      this._msgWindow.visible = false;
      this._msgWindow.setHandler("ok", this.onConfirmCancel.bind(this));
      this._msgWindow.setHandler("cancel", this.onConfirmCancel.bind(this));
    };
    Scene_Slg.prototype.startInitialScenario = function () {};
    Scene_Slg.prototype.finishScenario = function () {
      var slgScenario = $gameParty.nextSlgScenario();
      if (slgScenario) {
        this.playScenario(slgScenario);
        return;
      }
      var scenario = $gameParty.nextScenario();
      if (scenario) {
        this.playScenario(scenario);
        return;
      }
      $gameTemp.inSlg = true;
      if (this._confirmBattle) {
        $gameVariables.setValue(Nore.BATTLE_ID_VAR, 1);
        this.popScene();
        return;
      }
      if (this._showAvResult) {
        SceneManager.push(Scene_AvResult);
        return;
      }
      this.refresh();
      this._commandWindow.refresh();
      this._commandWindow.show();
      this._facilityListWindow.select(-1);
      this._facilityListWindow.deactivate();
      if ($gameTemp.selectBattle) {
        $gameTemp.selectBattle = false;
        this._commandWindow.selectSymbol(SlgCommand.invasion);
        this._commandWindow.deactivate();
        this.onInvasion();
      } else if ($gameTemp.selectFormation) {
        $gameTemp.selectFormation = false;
        this._commandWindow.selectSymbol(SlgCommand.formation);
        this._commandWindow.deactivate();
        this.onFormation();
      } else if ($gameTemp.menuIndex() >= 0) {
        this._commandWindow.select($gameTemp.menuIndex());
        if ($gameTemp.lastSelection == SlgCommand.actor) {
          $gameTemp.lastSelection = null;
          this._commandWindow.deactivate();
        } else if ($gameTemp.lastSelection == SlgCommand.character) {
          $gameTemp.lastSelection = null;
          this._commandWindow.deactivate();
          this._charListWindow.selectActor($gameParty.menuActor().actorId());
          this._charListWindow.activate();
        } else {
          this._commandWindow.activate();
        }
      } else {
        this._commandWindow.activate();
        this._commandWindow.select(0);
      }
      $slg.setDirty();
    };
    Scene_Slg.prototype.updateEvent = function () {
      if (this._waitEventList.length > 0) {
        var event_2 = this._waitEventList.shift();
        this.playScenario(event_2.eventName());
      }
    };
    Scene_Slg.prototype.playScenario = function (name) {
      this.beforePlayScenario();
      _super.prototype.playScenario.call(this, name);
    };
    Scene_Slg.prototype.playCommonEvent = function (commonId) {
      p("playCommonEvent:" + commonId);
      var commonEvent = $dataCommonEvents[commonId];
      if (isNaN(commonId)) {
        console.error("コモンイベントが存在しません:");
        return;
      }
      p(commonEvent.list);
      this.beforePlayScenario();
      $slg._interpreter = new Game_Interpreter();
      $slg._interpreter._list = [];
      $slg._interpreter._list.push({ code: 0, indent: 0, parameters: [] });
      $slg._interpreter.setupChild(commonEvent.list, 0);
    };
    Scene_Slg.prototype.beforePlayScenario = function () {
      $gameTemp.inSlg = false;
      this._commandWindow.hide();
      this._facilityListWindow.hide();
      this._facilityCommandWindow.hide();
      this._formationWindow.hide();
      this._formationListWindow.hide();
      this._formationFilterWindow.hide();
      this._formationListWindow.deactivate();
      this._formationDetailWindow.hide();
      this._charListWindow.hide();
      this._charListWindow.deactivate();
      this._militaryWindow.hide();
      this._decisiveBattleWindow.hide();
      this._manCommandWindow.hide();
      this._manListWindow.hide();
      this._soupKichenCommandWindow.hide();
      this._soupKichenListWindow.hide();
      this._manParamWindow.hide();
      this._militaryWindow.deactivate();
    };
    Scene_Slg.prototype.checkSlgInterpreter = function () {
      if ($slg.isInterpreterRunning()) {
        this.beforePlayScenario();
      }
    };
    Scene_Slg.prototype.createBackground = function () {
      /*this._backgroundSprite = new Sprite(SceneManager.backgroundBitmap());
            this.addChild(this._backgroundSprite);

            const dark = new PIXI.Graphics();
            dark.beginFill(0x000000, 0.7);
            dark.drawRect(0, 0, Graphics.width, Graphics.height);
            dark.endFill();
            this.addChild(dark);
    */
      this._backgroundFilter = new PIXI.filters.BlurFilter();
      this._backgroundSprite = new Sprite();
      this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
      this._backgroundSprite.filters = [this._backgroundFilter];
      this.addChild(this._backgroundSprite);
      this.setBackgroundOpacity(42);
    };
    Scene_Slg.prototype.setBackgroundOpacity = function (opacity) {
      this._backgroundSprite.opacity = opacity;
    };
    Scene_Slg.prototype.createFacilityListWindow = function () {
      this._facilityListWindow = new Window_FacilityTree();
      this.addChild(this._facilityListWindow);
      this._facilityListWindow.select(0);
      this._facilityListWindow.setHandler("ok", this.onFacilityOk.bind(this));
      this._facilityListWindow.setHandler(
        "cancel",
        this.onFacilityCancel.bind(this)
      );
      this._facilityListWindow.setHandler(
        "activate",
        this.onFacilityActivate.bind(this)
      );
      this._facilityListWindow.deactivate();
      this._facilityListWindow.select(-1);
      this._facilityCommandWindow = new Nore.Window_FacilityCommand();
      this._facilityCommandWindow.setHandler(
        FacilityCommand.levelUp,
        this.onFacilityCommandLevelUp.bind(this)
      );
      this._facilityCommandWindow.setHandler(
        "cancel",
        this.onFacilityCommandCancel.bind(this)
      );
      this.addChild(this._facilityCommandWindow);
      this._facilityCommandWindow.activate();
      this._facilityCommandWindow.select(0);
    };
    Scene_Slg.prototype.createMilitaryWindow = function () {
      this._militaryWindow = new Nore.Window_Military();
      this.addWindow(this._militaryWindow);
      this._militaryWindow.activate();
      this._militaryWindow.setHandler("ok", this.onMilitary.bind(this));
      this._militaryWindow.setHandler(
        "cancel",
        this.onMilitaryCancel.bind(this)
      );
      this._militaryWindow.setHandler(
        "activate",
        this.onMilitaryActivate.bind(this)
      );
      this._militaryWindow.deactivate();
      this._militaryWindow.hide();
    };
    Scene_Slg.prototype.onMilitary = function () {
      this._confirmWindow.visible = true;
      this._confirmMilitary = true;
      this._confirmWindow.select(0);
      this._confirmWindow.setText(TextManager.confirmBattle);
      this._confirmWindow.activate();
    };
    Scene_Slg.prototype.createCharacterWindow = function () {
      this._charListWindow = new Window_CharacterList();
      this.addChild(this._charListWindow);
      this._charListWindow.deactivate();
      this._charListWindow.select(-1);
      this._charListWindow.setHandler("ok", this.onCharacterOk.bind(this));
      this._charListWindow.setHandler(
        "cancel",
        this.onCharacterCancel.bind(this)
      );
      this._charListWindow.setHandler(
        "activate",
        this.onCharacterActivate.bind(this)
      );
    };
    Scene_Slg.prototype.onCharacterCommand2 = function () {
      p(this._charListWindow.index());
      if (this._charListWindow.index() < 0) {
        this._charListWindow.select(0);
      }
      this._charListWindow.activate();
    };
    Scene_Slg.prototype.onCharacterOk = function () {
      var actor = this._charListWindow.selectedActor();
      $gameParty.setMenuActor(actor);
      $gameTemp.lastSelection = SlgCommand.character;
      var symbol = this._commandWindow.currentSymbol();
      switch (symbol) {
        case SlgCommand.av:
          if (actor.dousei().isDouseiNinshin()) {
            this._msgWindow.setTexts([TextManager.avNg1, TextManager.avNg2]);
            this._msgWindow.visible = true;
            SoundManager.playBuzzer();
            this._msgWindow.activate();
            return;
          }
          if ($slg.hasLastSaleTimeGaugeEvent(actor.actorId())) {
            $gameParty.addCommonEvent(491, -1);
            return;
          }
          $gameTemp.lastCharCommand = SlgCommand.av;
          SceneManager.push(Scene_AvTree);
          return;
        case SlgCommand.kigae:
          $gameTemp.lastCharCommand = SlgCommand.kigae;
          SceneManager.push(Nore.Scene_Kigae);
          return;
        case SlgCommand.dousei:
          if (actor.dousei().isTaikenbanNg()) {
            this._msgWindow.setTexts([
              TextManager.douseiTaikenbanNg,
              TextManager.douseiTaikenbanNg2,
            ]);
            this._msgWindow.visible = true;
            SoundManager.playBuzzer();
            this._msgWindow.activate();
            return;
          }
          $gameTemp.lastCharCommand = SlgCommand.dousei;
          SceneManager.push(Nore.Scene_Dousei);
          return;
        case SlgCommand.status:
          $gameTemp.lastCharCommand = SlgCommand.status;
          $gameTemp.lastSelectedEroStatusIndex = 0;
          SceneManager.push(Nore.Scene_EroStatus);
          return;
      }
    };
    Scene_Slg.prototype.onCharacterCancel = function () {
      this._charListWindow.select(-1);
      this._charListWindow.deactivate();
      this._commandWindow.activate();
    };
    Scene_Slg.prototype.createFormationWindow = function () {
      this._formationWindow = new Nore.Window_Formation();
      this.addWindow(this._formationWindow);
      this._formationWindow.deactivate();
      this._formationWindow.select(0);
      this._formationWindow.setHandler("ok", this.onFormationSelect.bind(this));
      this._formationWindow.setHandler(
        "cancel",
        this.onFormationCancel.bind(this)
      );
      this._formationWindow.setHandler(
        "change",
        this.onFormationChange.bind(this)
      );
      this._formationWindow.setHandler("pageup", this.onPageup.bind(this));
      this._formationWindow.setHandler("pagedown", this.onPagedown.bind(this));
      this._formationWindow.setHandler(
        "tab",
        this.onFormationLevelUp.bind(this)
      );
      this._formationWindow.setHandler(
        "activate",
        this.onFormationActivate.bind(this)
      );
      this._formationListWindow = new Nore.Window_FormationList();
      this.addWindow(this._formationListWindow);
      this._formationListWindow.deactivate();
      this._formationListWindow.select(0);
      this._formationListWindow.setHandler(
        "ok",
        this.onFormationListOk.bind(this)
      );
      this._formationListWindow.setHandler(
        "cancel",
        this.onFormationListCancel.bind(this)
      );
      this._formationListWindow.setHandler(
        "change",
        this.onFormationListChange.bind(this)
      );
      this._formationFilterWindow = new Nore.Window_FormationFilter();
      this.addWindow(this._formationFilterWindow);
      this._formationDetailWindow = new Nore.Window_FormationDetail();
      this.addWindow(this._formationDetailWindow);
      this._formationDetailWindow.deactivate();
      this._formationLevelUpWindow = new Nore.Window_FormationLevelUp();
      this.addWindow(this._formationLevelUpWindow);
      this._formationLevelUpWindow.deactivate();
      this._formationDetailWindow.setLevelUpWindow(
        this._formationLevelUpWindow
      );
      this._formationDetailWindow.setListWindow(this._formationListWindow);
      this._formationDetailWindow.setFormationWindow(this._formationWindow);
      this._formationLevelUpWindow.hide();
    };
    Scene_Slg.prototype.onFormationLevelUp = function () {
      this._formationDetailWindow.onLevelUp();
    };
    Scene_Slg.prototype.onPageup = function () {
      this._formationWindow.pageup();
    };
    Scene_Slg.prototype.onPagedown = function () {
      this._formationWindow.pagedown();
    };
    Scene_Slg.prototype.onFormationSelect = function () {
      this._formationListWindow.activate();
    };
    Scene_Slg.prototype.onFormationChange = function () {
      if (!this._formationWindow.visible) {
        return;
      }
      var actor = this._formationWindow.selectedActor();
      this._formationDetailWindow.setup(actor);
      this._commandWindow.deactivate();
      this._formationWindow.refreshLabel();
    };
    Scene_Slg.prototype.onFormationListChange = function () {
      var actor = this._formationListWindow.selectedActor();
      this._formationDetailWindow.setup(actor);
    };
    Scene_Slg.prototype.onFormationCancel = function () {
      this._commandWindow.activate();
    };
    Scene_Slg.prototype.onFormationListOk = function () {
      var actor = this._formationListWindow.selectedActor();
      if ($slg.formation().isBattleMamber(actor)) {
        SoundManager.playBuzzer();
        this._formationWindow.activate();
        return;
      }
      this._formationWindow.setBattleActor(actor);
      this._formationWindow.activate();
      this._formationListWindow.refresh();
    };
    Scene_Slg.prototype.onFormationListCancel = function () {
      this._formationWindow.activate();
    };
    Scene_Slg.prototype.createDecisiveBattleWindow = function () {
      this._decisiveBattleWindow = new Nore.Window_DecisiveBattle();
      this.addWindow(this._decisiveBattleWindow);
      this._decisiveBattleWindow.hide();
      this._decisiveBattleWindow.setHandler(
        "ok",
        this.onDecisiveBattleOk.bind(this)
      );
      this._decisiveBattleWindow.setHandler(
        "cancel",
        this.onDecisiveBattleCancel.bind(this)
      );
      this._decisiveBattleWindow.setHandler(
        "activate",
        this.onDecisiveBattleActivate.bind(this)
      );
    };
    Scene_Slg.prototype.createManListWindow = function () {
      var av = new Av(1, 1);
      this._manParamWindow = new Nore.Window_AvManParams(av, 372);
      this._manParamWindow.y = Nore.TOP_Y;
      this.addWindow(this._manParamWindow);
      this._manParamWindow.hide();
      this._manCommandWindow = new Window_ManCommand();
      this.addWindow(this._manCommandWindow);
      this._manCommandWindow.select(0);
      this._manCommandWindow.hide();
      this._manCommandWindow.deactivate();
      this._manCommandWindow.setHandler("change", this.onManChange.bind(this));
      this._manCommandWindow.setHandler("ok", this.onManOk.bind(this));
      this._manCommandWindow.setHandler("cancel", this.onManCancel.bind(this));
      this._manListWindow = new Window_ManList();
      this._manListWindow.setHandler("cancel", this.onManListCancel.bind(this));
      this.addWindow(this._manListWindow);
      this._manListWindow.hide();
      this._manListWindow.deactivate();
      this._manInfoWindow = new Window_ManInfo();
      this.addWindow(this._manInfoWindow);
      this._manInfoWindow.hide();
      this._manParamWindow.x = this._manInfoWindow.x;
      this._manListWindow.setManInfoWindow(this._manInfoWindow);
      this._manListWindow.setManParamWindow(this._manParamWindow);
      this._soupKichenListWindow = new Window_SoupKichenList();
      this.addWindow(this._soupKichenListWindow);
      this._soupKichenListWindow.select(0);
      this._soupKichenListWindow.hide();
      this._soupKichenListWindow.setManParamWindow(this._manParamWindow);
      this._soupKichenListWindow.setHandler(
        "ok",
        this.onSoupKichenOk.bind(this)
      );
      this._soupKichenListWindow.setHandler(
        "cancel",
        this.onSoupKichenCancel.bind(this)
      );
      this._soupKichenListWindow.setHandler(
        "change",
        this.onSoupKichenChange.bind(this)
      );
      this._soupKichenListWindow.setHandler(
        "change",
        this.onSoupKichenChange.bind(this)
      );
      this._soupKichenListWindow.setHandler(
        "activate",
        this.onManActivate.bind(this)
      );
      this._soupKichenCommandWindow = new Window_SoupKichenCommand();
      this.addWindow(this._soupKichenCommandWindow);
      this._soupKichenCommandWindow.select(0);
      this._soupKichenCommandWindow.hide();
      this._soupKichenCommandWindow.setHandler(
        SoupKichenCommand.hire,
        this.onManHireOk.bind(this)
      );
      this._soupKichenCommandWindow.setHandler(
        SoupKichenCommand.cancel,
        this.onManHireCancel.bind(this)
      );
    };
    Scene_Slg.prototype.onManOk = function () {
      if (this._manCommandWindow.index() == 0) {
        this._manListWindow.activate();
      } else {
        this._soupKichenListWindow.activate();
      }
    };
    Scene_Slg.prototype.onManCancel = function () {
      this._commandWindow.activate();
    };
    Scene_Slg.prototype.onManListCancel = function () {
      this._manCommandWindow.activate();
    };
    Scene_Slg.prototype.onManChange = function () {
      this.updateManCommandList();
    };
    Scene_Slg.prototype.onSoupKichenChange = function () {
      var man = this._soupKichenListWindow.selectedMan();
      if (!man) {
        this._manParamWindow.hide();
        return;
      }
      this._manParamWindow.setMan(man.actor());
    };
    Scene_Slg.prototype.onManHireOk = function () {
      this._soupKichenCommandWindow.hire();
      this._soupKichenCommandWindow.hide();
      this._soupKichenListWindow.makeData();
      this._soupKichenListWindow.refresh();
      this._soupKichenListWindow.show();
      this._soupKichenListWindow.activate();
      this._manListWindow.makeData();
      this._manListWindow.refresh();
    };
    Scene_Slg.prototype.onManHireCancel = function () {
      this._soupKichenCommandWindow.hide();
      this._soupKichenListWindow.show();
      this._soupKichenListWindow.activate();
    };
    Scene_Slg.prototype.onSoupKichenOk = function () {
      var man = this._soupKichenListWindow.selectedMan();
      this._soupKichenCommandWindow.setMan(man);
      this._soupKichenCommandWindow.select(0);
      this._soupKichenCommandWindow.activate();
      this._soupKichenCommandWindow.show();
    };
    Scene_Slg.prototype.onSoupKichenCancel = function () {
      this._manParamWindow.hide();
      this._manCommandWindow.activate();
    };
    Scene_Slg.prototype.createPictures = function () {
      var width = Graphics.width;
      var height = Graphics.height;
      var x = (Graphics.width - width) / 2;
      var y = (Graphics.height - height) / 2;
      this._pictureContainer = new Sprite();
      this._pictureContainer.setFrame(x, y, width, height);
      for (var i = 0; i < 10; i++) {
        this._pictureContainer.addChild(new Sprite_Picture(i));
      }
      this.addChild(this._pictureContainer);
    };
    Scene_Slg.prototype.createPictures2 = function () {
      var width = Graphics.width;
      var height = Graphics.height;
      var x = (Graphics.width - width) / 2;
      var y = (Graphics.height - height) / 2;
      this._pictureContainer2 = new Sprite();
      this._pictureContainer2.setFrame(x, y, width, height);
      for (var i = 10; i <= $gameScreen.maxPictures() - 1; i++) {
        this._pictureContainer2.addChild(new Sprite_Picture(i));
      }
      this.addChild(this._pictureContainer2);
    };
    Scene_Slg.prototype.createParameterWindow = function () {
      this._topWindow = new Nore.Window_Top(true);
      this._topWindow.hideTimeGauge();
      this.addChild(this._topWindow);
      this._topWindow.update();
    };
    Scene_Slg.prototype.createCommandWindow = function () {
      this._commandWindow = new Nore.Window_SlgCommand();
      this.addChild(this._commandWindow);
      this._commandWindow.setHandler(
        SlgCommand.invasion,
        this.onInvasion.bind(this)
      );
      this._commandWindow.setHandler(
        SlgCommand.option,
        this.onOption.bind(this)
      );
      this._commandWindow.setHandler(SlgCommand.save, this.onSave.bind(this));
      this._commandWindow.setHandler(
        SlgCommand.facility,
        this.onFacility.bind(this)
      );
      this._commandWindow.setHandler(
        SlgCommand.formation,
        this.onFormation.bind(this)
      );
      this._commandWindow.setHandler(
        SlgCommand.decisiveBattle,
        this.onDecisiveBattle.bind(this)
      );
      this._commandWindow.setHandler(
        SlgCommand.soupKichen,
        this.onSoupKichen.bind(this)
      );
      this._commandWindow.setHandler(
        SlgCommand.av,
        this.onCharacterAv.bind(this)
      );
      this._commandWindow.setHandler(
        SlgCommand.kigae,
        this.onCharacterKigae.bind(this)
      );
      this._commandWindow.setHandler(
        SlgCommand.dousei,
        this.onCharacterDousei.bind(this)
      );
      this._commandWindow.setHandler(
        SlgCommand.status,
        this.onCharacterStatus.bind(this)
      );
      this._commandWindow.setHandler(
        SlgCommand.endRecording,
        this.onEndRecording.bind(this)
      );
      this._commandWindow.setHandler("cancel", this.onCommandCancel.bind(this));
      this._commandWindow.setHandler("change", this.onCommandChange.bind(this));
    };
    Scene_Slg.prototype.onEndRecording = function () {};
    Scene_Slg.prototype.selectCharacterList = function () {
      if (this._charListWindow.index() < 0) {
        this._charListWindow.select(0);
      }
      this._charListWindow.activate();
    };
    Scene_Slg.prototype.onCharacterActivate = function (noSe) {
      if (noSe === void 0) {
        noSe = false;
      }
      TouchInput.clear();
      if (!noSe) {
        SoundManager.playOk();
      }
      this._commandWindow.deactivate();
      switch (this._commandWindow.currentSymbol()) {
        case SlgCommand.av:
          this.onCharacterAv();
          return;
        case SlgCommand.kigae:
          this.onCharacterKigae();
          return;
        case SlgCommand.dousei:
          this.onCharacterDousei();
          return;
        case SlgCommand.status:
          this.onCharacterStatus();
          return;
      }
      this._commandWindow.activate();
    };
    Scene_Slg.prototype.onCharacterAv = function () {
      this._charListWindow.setSlgType(SlgCommand.av);
      this.selectCharacterList();
    };
    Scene_Slg.prototype.onCharacterKigae = function () {
      this._charListWindow.setSlgType(SlgCommand.kigae);
      this.selectCharacterList();
    };
    Scene_Slg.prototype.onCharacterDousei = function () {
      this._charListWindow.setSlgType(SlgCommand.dousei);
      this.selectCharacterList();
    };
    Scene_Slg.prototype.onCharacterStatus = function () {
      this._charListWindow.setSlgType(SlgCommand.status);
      this.selectCharacterList();
    };
    Scene_Slg.prototype.onRest = function () {
      this._commandWindow.activate();
    };
    Scene_Slg.prototype.onManActivate = function () {
      TouchInput.clear();
      SoundManager.playOk();
      this._commandWindow.deactivate();
      this.onSoupKichen();
    };
    Scene_Slg.prototype.updateManCommandList = function () {
      if (this._manCommandWindow.index() == 0) {
        this._manListWindow.show();
        this._soupKichenListWindow.hide();
        this._manInfoWindow.show();
        this._manParamWindow.show();
        this._manListWindow.reselect();
      } else {
        this._manListWindow.hide();
        if ($slg.manInfo().soupKichen().isEmptyOrDisabled()) {
          this._manParamWindow.hide();
        } else {
          this._manParamWindow.show();
        }
        this._soupKichenListWindow.show();
        this._manInfoWindow.hide();
      }
    };
    Scene_Slg.prototype.onSoupKichen = function () {
      //this._manParamWindow.show();
      this._manCommandWindow.activate();
    };
    Scene_Slg.prototype.onFacilityOk = function () {
      var f = this._facilityListWindow.selectedFacility();
      if (f.isTaikenbanNg()) {
        this._facilityListWindow.activate();
        SoundManager.playBuzzer();
        return;
      }
      if ($slg.facilityInfo().hasFacility(f.itemId())) {
        this._facilityListWindow.activate();
        return;
      }
      var x = this._facilityListWindow.commandX();
      var y = this._facilityListWindow.commandY();
      var facility = new Facility(f.itemId(), f.level());
      if (facility.level() == facility.maxLevel()) {
        this._facilityListWindow.activate();
        SoundManager.playBuzzer();
        return;
      }
      this._facilityCommandWindow.x = x;
      this._facilityCommandWindow.y = y;
      this._facilityCommandWindow.setFacility(facility);
      this._facilityCommandWindow.show();
      this._facilityCommandWindow.activate();
    };
    Scene_Slg.prototype.onFacilityCancel = function () {
      this._facilityListWindow.select(-1);
      this._commandWindow.activate();
    };
    Scene_Slg.prototype.onFacilityCommandCancel = function () {
      this._facilityListWindow.activate();
      this._facilityCommandWindow.hide();
    };
    Scene_Slg.prototype.onFacilityCommandLevelUp = function () {
      var facility = this._facilityListWindow.selectedFacility().facility();
      if (facility.price() > $gameParty.gold()) {
        SoundManager.playBuzzer();
        this._facilityCommandWindow.activate();
        return;
      }
      this._facilityCommandWindow.hide();
      $gameParty.loseGold(facility.price());
      SoundManager.playShop();
      var e = new FacilityTimeGaugeEvent(
        facility.constructionTime(),
        facility.itemId(),
        facility.level()
      );
      $slg.addTimeGaugeEvent(e);
      //$slg.facilityInfo().levelUp(facility);
      this._facilityListWindow.refresh();
      this._facilityListWindow.activate();
      this._facilityListWindow.select(0);
    };
    // military
    Scene_Slg.prototype.onMilitaryCancel = function () {
      this._militaryWindow.select(-1);
      this._commandWindow.activate();
    };
    Scene_Slg.prototype.onFormationActivate = function () {
      TouchInput.clear();
      SoundManager.playOk();
      this._commandWindow.deactivate();
      this.onFormation();
    };
    Scene_Slg.prototype.onFormation = function () {
      this._formationWindow.activate();
      this._formationWindow.select(0);
    };
    Scene_Slg.prototype.popScene = function () {
      $gameTemp.lastCharCommand = null;
      _super.prototype.popScene.call(this);
    };
    Scene_Slg.prototype.onConfirmOk = function () {
      if (this._confirmMilitary) {
        var reserveCommon = this._militaryWindow.decide();
        if (reserveCommon < 0) {
          this.popScene();
          $gameTemp.reserveCommonEvent(141);
        } else {
          // マリナとの戦闘前
          if (reserveCommon == 237) {
            // 左のメニュー非表示
            $gameSwitches.setValue(17, false);
            $gameSwitches.setValue(42, true);
          }
        }
      } else if (this._confirmDecisiveBattle) {
        this.onFinishDecisiveBattle();
      } else {
      }
    };
    Scene_Slg.prototype.onConfirmCancel = function () {
      this._confirmWindow.visible = false;
      this._msgWindow.visible = false;
      if (this._confirmMilitary) {
        this._militaryWindow.activate();
      } else if (this._confirmDecisiveBattle) {
        this._commandWindow.activate();
      } else {
        this._charListWindow.activate();
      }
      this._confirmMilitary = false;
    };
    Scene_Slg.prototype.onMilitaryActivate = function () {
      TouchInput.clear();
      SoundManager.playOk();
      this._commandWindow.deactivate();
      this.onInvasion();
    };
    Scene_Slg.prototype.onInvasion = function () {
      this._militaryWindow.show();
      this._militaryWindow.activate();
    };
    Scene_Slg.prototype.onFacilityActivate = function () {
      TouchInput.clear();
      this._commandWindow.deactivate();
      SoundManager.playOk();
      this.onFacility();
    };
    Scene_Slg.prototype.onFacility = function () {
      this._facilityListWindow.show();
      this._facilityListWindow.activate();
      this._facilityListWindow.select(0);
    };
    Scene_Slg.prototype.onOption = function () {
      $gameTemp.lastCharCommand = null;
      SceneManager.push(Scene_Options);
    };
    Scene_Slg.prototype.onSave = function () {
      $gameTemp.lastCharCommand = SlgCommand.save;
      SceneManager.push(Scene_Save);
    };
    Scene_Slg.prototype.onCommandCancel = function () {
      this.popScene();
    };
    Scene_Slg.prototype.onCommandChange = function () {
      var symbol = this._commandWindow.currentSymbol();
      if (this._interpreter) {
        return;
      }
      $gameTemp.setMenuIndex(this._commandWindow.index());
      this._facilityListWindow.hide();
      this._militaryWindow.hide();
      this._charListWindow.hide();
      this._formationWindow.hide();
      this._formationFilterWindow.hide();
      this._formationListWindow.hide();
      this._formationDetailWindow.hide();
      this._decisiveBattleWindow.hide();
      this._soupKichenListWindow.hide();
      this._manInfoWindow.hide();
      this._manCommandWindow.hide();
      this._manListWindow.hide();
      this._manParamWindow.hide();
      switch (symbol) {
        case SlgCommand.facility:
          this._facilityListWindow.show();
          break;
        case SlgCommand.invasion:
          this._militaryWindow.show();
          break;
        case SlgCommand.formation:
          this._formationWindow.show();
          this._formationFilterWindow.show();
          this._formationListWindow.show();
          break;
        case SlgCommand.character:
        case SlgCommand.av:
        case SlgCommand.kigae:
        case SlgCommand.dousei:
        case SlgCommand.status:
          this._charListWindow.show();
          break;
        case SlgCommand.decisiveBattle:
          this._decisiveBattleWindow.refresh();
          this._decisiveBattleWindow.show();
          break;
        case SlgCommand.soupKichen:
          this._soupKichenListWindow.refresh();
          this._manCommandWindow.show();
          this.updateManCommandList();
          //this._soupKichenListWindow.show();
          break;
      }
    };
    Scene_Slg.prototype.onDecisiveBattleActivate = function () {
      TouchInput.clear();
      SoundManager.playOk();
      this._commandWindow.deactivate();
      this.onDecisiveBattle();
    };
    Scene_Slg.prototype.onDecisiveBattle = function () {
      this._confirmDecisiveBattle = true;
      var canExecute = $slg.decisiveBattleInfo().canExecute();
      if (!canExecute) {
        this._msgWindow.setText(TextManager.decisiveBattleDialog);
        this._msgWindow.visible = true;
        SoundManager.playBuzzer();
        this._msgWindow.activate();
        return;
      }
      this._confirmWindow.visible = true;
      this._confirmWindow.setText(TextManager.decisiveBattleConfirm);
      this._confirmWindow.activate();
    };
    Scene_Slg.prototype.onDecisiveBattleOk = function () {
      var cost = this._decisiveBattleWindow.selectedCost();
      if (cost.isFinished()) {
        SoundManager.playBuzzer();
        this._decisiveBattleWindow.activate();
        return;
      }
      this._confirmDecisiveBattle = true;
      this._confirmWindow.visible = true;
      this._confirmWindow.setText("この資源を納品しますか？");
      this._confirmWindow.activate();
    };
    Scene_Slg.prototype.onDecisiveBattleCancel = function () {
      this._decisiveBattleWindow.select(-1);
      this._commandWindow.activate();
    };
    Scene_Slg.prototype.onFinishDecisiveBattle = function () {
      this._confirmWindow.hide();
      $gameSwitches.setValue(5, true);
      $slg.decisiveBattleInfo().consumeCost();
      this.popScene();
    };
    return Scene_Slg;
  })(Nore.Scene_Talk);
  Nore.Scene_Slg = Scene_Slg;
  var SlgEvent = /** @class */ (function () {
    function SlgEvent(history) {
      this._source = history;
    }
    SlgEvent.prototype.eventName = function () {
      var actorId = this._source.actorId().padZero(2);
      if (this._source.status() == TanetsukeStatus.pregnant) {
        return "妊娠イベント_01";
      }
      if (this._source.status() == TanetsukeStatus.inSex) {
        return "セックスイベント_%1_01".format(actorId);
      } else {
        return "出産イベント_01";
      }
    };
    return SlgEvent;
  })();
  Nore.MAIN_MENU_W = 182;
})(Nore || (Nore = {}));
var Sprite_Tachie = /** @class */ (function (_super) {
  __extends(Sprite_Tachie, _super);
  function Sprite_Tachie(x, y, scale) {
    if (x === void 0) {
      x = 860;
    }
    if (y === void 0) {
      y = -100;
    }
    if (scale === void 0) {
      scale = 1;
    }
    var _this = _super.call(this, new Rectangle(0, 0, 0, 0)) || this;
    _this._x = x;
    _this._y = y;
    _this._scale = scale;
    _this.update();
    return _this;
  }
  Sprite_Tachie.prototype.initialize = function () {
    var x = 550;
    _super.prototype.initialize.call(
      this,
      new Rectangle(x, 0, this.contentsWidth(), this.contentsHeight())
    );
    this.frameVisible = false;
    this.backOpacity = 0;
    this.margin = 0;
    this.padding = 0;
    var g = new PIXI.Graphics();
    g.beginFill(0x000);
    g.drawRect(0, 0, 500, 500);
    g.endFill();
    this._back = g;
    this.addChild(this._back);
    this._actorLayer = new Sprite();
    this.addChild(this._actorLayer);
  };
  Sprite_Tachie.prototype.setActorId = function (actorId) {
    if (this._actorId == actorId) {
      return;
    }
    this._actorId = actorId;
    this.redraw();
  };
  Sprite_Tachie.prototype.update = function () {
    _super.prototype.update.call(this);
    this.updatePosition();
    if (this.actor() && this.actor().isDirty()) {
      this.redraw();
    }
  };
  Sprite_Tachie.prototype.updatePosition = function () {
    this.x = this._x;
    this.y = this._y;
    this.scale.x = this._scale;
    this.scale.y = this._scale;
    this._back.visible = false;
  };
  Sprite_Tachie.prototype.actor = function () {
    return $gameActors.actor(this._actorId);
  };
  Sprite_Tachie.prototype.redraw = function () {
    if (!this.visible) {
      //  return;
    }
    this.contents.clear();
    this.contentsBack.clear();
    if (!this._actorLayer) {
      return;
    }
    this.drawActor();
  };
  Sprite_Tachie.prototype.drawActor = function () {
    var hMinus = 0;
    if ($gameSwitches.value(4)) {
      hMinus = 0;
    }
    var rect = new Rectangle(120, 0, 600, 1000);
    var x = -10; //$gameActors.actor(this._actorId).posByActor();
    var y = 10;
    var actor = this.actor();
    if (!actor) {
      return;
    }
    this._actorLayer.removeChildren();
    var faceId = actor.getDefaultFaceId();
    this.drawTachieActor(actor, this._actorLayer, x, y, null, faceId);
  };
  Sprite_Tachie.prototype.contentsWidth = function () {
    return 378;
  };
  Sprite_Tachie.prototype.contentsHeight = function () {
    return Graphics.height;
  };
  return Sprite_Tachie;
})(Window_Base);


code:
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
var Nore;
(function (Nore) {
  var Window_SlgCommand = /** @class */ (function (_super) {
    __extends(Window_SlgCommand, _super);
    function Window_SlgCommand() {
      var _this = this;
      var r = new Rectangle(0, Nore.TOP_Y + 2, Nore.MAIN_MENU_W + 1, 762);
      _this = _super.call(this, r) || this;
      _this.frameVisible = false;
      //this.createBackground();
      _this.padding = 0;
      _this.backOpacity = 0;
      _this.addChild(_this._windowContentsSprite);
      _this.loadImage();
      return _this;
    }
    Window_SlgCommand.prototype.loadImage = function () {
      if (ConfigManager.language == "jp") {
        ImageManager.loadSystem("button3");
      } else {
        ImageManager.loadSystem("button3_en");
      }
    };
    Window_SlgCommand.prototype.itemRect = function (index) {
      var r = _super.prototype.itemRect.call(this, index);
      r.y += 10;
      if (index >= 4) {
        r.y += 11;
      }
      if (index >= 5) {
        r.y += 11;
      }
      if (index >= 7) {
        r.y += 11;
      }
      if (index >= 9) {
        r.y += 11;
      }
      return r;
    };
    Window_SlgCommand.prototype.activate = function () {
      _super.prototype.activate.call(this);
      this.onUp();
    };
    Window_SlgCommand.prototype.deactivate = function () {
      _super.prototype.deactivate.call(this);
      this.onPush();
    };
    Window_SlgCommand.prototype.createBackground = function () {
      var baseTexture = Nore.getSystemBaseTexture("menu");
      if (!baseTexture) {
        return;
      }
      var texture = new PIXI.Texture(
        baseTexture,
        new Rectangle(0, 0, 184, baseTexture.height)
      );
      this._bg = new PIXI.Sprite(texture);
      this._bg.alpha = 0.5;
      this._windowContentsBackSprite.addChild(this._bg);
    };
    Window_SlgCommand.prototype.itemHeight = function () {
      return 69;
    };
    Window_SlgCommand.prototype.update = function () {
      _super.prototype.update.call(this);
      this.updateTutoArrow();
      this.updateWheel();
      this.updateTouchSave();
    };
    Window_SlgCommand.prototype.updateWheel = function () {
      if (this._wheelWait > 0) {
        this._wheelWait--;
        return;
      }
      if (TouchInput.wheelY > 0) {
        this._wheelWait = 2;
        if (this.active) {
          SoundManager.playCursor();
          this.cursorDown(true);
        }
      } else if (TouchInput.wheelY < 0) {
        this._wheelWait = 2;
        if (this.active) {
          SoundManager.playCursor();
          this.cursorUp(true);
        }
      }
    };
    Window_SlgCommand.prototype.updateTouchSave = function () {
      if (this.currentSymbol() != Nore.SlgCommand.save) {
        return;
      }
      if (!TouchInput.isTriggered()) {
        return;
      }
      if (TouchInput.y < 100) {
        return;
      }
      if (TouchInput.x < 150) {
        return;
      }
      SoundManager.playOk();
      this.callOkHandler();
    };
    Window_SlgCommand.prototype.updateTutoArrow = function () {
      var symbol = this.tutoArrowSymbol();
      if (this._lastTutoSymbol != symbol) {
        this.refresh();
      }
    };
    Window_SlgCommand.prototype.refresh = function () {
      if (this._tutoArrow) {
        this.removeChild(this._tutoArrow);
      }
      this._windowContentsSprite.removeChildren();
      this._buttonList = [];
      _super.prototype.refresh.call(this);
      this.drawTutoArrow();
    };
    Window_SlgCommand.prototype.drawTutoArrow = function () {
      if (this._tutoArrow) {
        this.removeChild(this._tutoArrow);
      }
      var symbol = this.tutoArrowSymbol();
      this._lastTutoSymbol = symbol;
      if (symbol == Nore.SlgCommand.none) {
        return;
      }
      var index = this.findSymbol(symbol);
      var rect = this.itemRect(index);
      this.drawArrow(rect.x + 148, rect.y - 6);
    };
    Window_SlgCommand.prototype.tutoArrowSymbol = function () {
      var tutorial = $gameTutorial.currentTutorial();
      switch (tutorial) {
        case Tutorial.AV:
        case Tutorial.AV_2:
          return Nore.SlgCommand.av;
        case Tutorial.NEXT_DAY:
        //return 1;
        case Tutorial.FACILITY_1:
        case Tutorial.FACILITY_2:
          return Nore.SlgCommand.facility;
        case Tutorial.BATTLE:
          return Nore.SlgCommand.invasion;
        case Tutorial.FORMATION:
          return Nore.SlgCommand.formation;
        case Tutorial.DECISIVE_BATTLE_1:
          if ($gameSwitches.value(109)) {
            return Nore.SlgCommand.decisiveBattle;
          }
          return Nore.SlgCommand.none;
      }
      return Nore.SlgCommand.none;
    };
    Window_SlgCommand.prototype.drawArrow = function (x, y) {
      var baseTexture2 = Nore.getSystemBaseTexture("0213_sys");
      var texture = new PIXI.Texture(baseTexture2);
      var sprite = new PIXI.Sprite(texture);
      sprite.x = x;
      sprite.y = y;
      this._tutoArrow = sprite;
      this.addChild(sprite);
    };
    Window_SlgCommand.prototype.makeCommandList = function () {
      this.addCommand(TextManager.charAv, Nore.SlgCommand.av, true);
      this.addCommand(TextManager.charKigae, Nore.SlgCommand.kigae, true);
      this.addCommand(
        TextManager.charDousei,
        Nore.SlgCommand.dousei,
        this.isDouseiEnabled()
      );
      this.addCommand(TextManager.charStatus, Nore.SlgCommand.status, true);
      this.addCommand(TextManager.facility, Nore.SlgCommand.facility, true);
      this.addCommand(
        TextManager._formation,
        Nore.SlgCommand.formation,
        this.isFormationEnabled()
      );
      this.addCommand(
        TextManager.invasion,
        Nore.SlgCommand.invasion,
        this.isFormationEnabled()
      );
      this.addCommand(
        TextManager.soupKichen,
        Nore.SlgCommand.soupKichen,
        this.isSoupKichenEnabled()
      );
      this.addCommand(
        TextManager.decisiveBattle,
        Nore.SlgCommand.decisiveBattle,
        this.isDecisiveBattleEnabled()
      );
      this.addCommand(TextManager._save, Nore.SlgCommand.save, true);
    };
    Window_SlgCommand.prototype.isDouseiEnabled = function () {
      return $slg.facilityInfo().hasDouseiRoom();
    };
    Window_SlgCommand.prototype.isDecisiveBattleEnabled = function () {
      return $gameSwitches.value(109) && !$gameSwitches.value(9);
    };
    Window_SlgCommand.prototype.isSoupKichenEnabled = function () {
      return true;
      //return $slg.manInfo().soupKichen().level() >= 1;
    };
    Window_SlgCommand.prototype.isFormationEnabled = function () {
      return $gameSwitches.value(211);
    };
    Window_SlgCommand.prototype.drawItem = function (index) {
      var symbol = this.commandSymbol(index);
      var rect = this.itemLineRect(index);
      var align = this.itemTextAlign();
      this.resetTextColor();
      //this.changePaintOpacity(this.isCommandEnabled(index));
      //this.drawText(this.commandName(index), rect.x, rect.y, rect.width, align);
      var disable = !this.isCommandEnabled(index);
      var pushed = false;
      if (this.index() == index && !this.active) {
        pushed = true;
      }
      var button = new Sprite_Button3(symbol, true, disable, pushed);
      var left = rect.x + 8 + 9;
      var yy = rect.y - 4;
      button.x = left;
      button.y = yy;
      this._windowContentsSprite.addChild(button);
      this._buttonList.push(button);
    };
    Window_SlgCommand.prototype.drawBackgroundRect = function () {};
    Window_SlgCommand.prototype.select = function (index) {
      _super.prototype.select.call(this, index);
      if (!this._buttonList) {
        return;
      }
      for (var i = 0; i < this._buttonList.length; i++) {
        var button = this._buttonList[i];
        if (i == index) {
          button.select();
        } else {
          button.deselect();
          button.deactivate();
        }
      }
      if (index < 0) {
        for (var i = 0; i < this._buttonList.length; i++) {
          var button = this._buttonList[i];
          button.activate();
        }
      }
    };
    Window_SlgCommand.prototype.currentSymbol = function () {
      var symbol = _super.prototype.currentSymbol.call(this);
      if (symbol == Nore.SlgCommand.soupKichen) {
        if (!this.isSoupKichenEnabled()) {
          return "";
        }
      }
      if (symbol == Nore.SlgCommand.formation) {
        if (!this.isFormationEnabled()) {
          return "";
        }
      }
      if (symbol == Nore.SlgCommand.invasion) {
        if (!this.isFormationEnabled()) {
          return "";
        }
      }
      if (symbol == Nore.SlgCommand.decisiveBattle) {
        if (!this.isDecisiveBattleEnabled()) {
          return "";
        }
      }
      return symbol;
    };
    Window_SlgCommand.prototype.cursorDown = function (wrap) {
      var index = this.index();
      var maxItems = this.maxItems();
      var maxCols = this.maxCols();
      if (index < maxItems - maxCols || (wrap && maxCols === 1)) {
        var next = (index + maxCols) % maxItems;
        for (var i = 0; i < 4; i++) {
          if (!this._list[next].enabled) {
            next++;
          }
        }
        this.smoothSelect(next);
      }
    };
    Window_SlgCommand.prototype.cursorUp = function (wrap) {
      var index = Math.max(0, this.index());
      var maxItems = this.maxItems();
      var maxCols = this.maxCols();
      if (index >= maxCols || (wrap && maxCols === 1)) {
        var next = (index - maxCols + maxItems) % maxItems;
        for (var i = 0; i < 4; i++) {
          if (!this._list[next].enabled) {
            next--;
          }
        }
        this.smoothSelect(next);
      }
    };
    Window_SlgCommand.prototype.setCursorRect = function () {};
    Window_SlgCommand.prototype.onPush = function () {
      if (!this._buttonList) {
        return;
      }
      var index = this.index();
      for (var i = 0; i < this._buttonList.length; i++) {
        var button = this._buttonList[i];
        if (i == index) {
          button.push();
        } else {
          button.up();
        }
      }
    };
    Window_SlgCommand.prototype.onUp = function () {
      if (!this._buttonList) {
        return;
      }
      for (var i = 0; i < this._buttonList.length; i++) {
        var button = this._buttonList[i];
        button.up();
      }
    };
    Window_SlgCommand.prototype.processCancel = function () {
      SoundManager.playCancel();
      this.updateInputData();
      this.callCancelHandler();
    };
    return Window_SlgCommand;
  })(Window_Command);
  Nore.Window_SlgCommand = Window_SlgCommand;
})(Nore || (Nore = {}));

repo_name: onms/dead

license: unknown


code:
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
var SLG_WINDOW_SW = 3;
var Scene_Map2 = /** @class */ (function (_super) {
  __extends(Scene_Map2, _super);
  function Scene_Map2() {
    var _this = (_super !== null && _super.apply(this, arguments)) || this;
    _this._buttonList = [];
    return _this;
  }
  Scene_Map2.prototype.start = function () {
    _super.prototype.start.call(this);
    this._screenShotManager = new ScreenShotManager();
    $gameTemp.lastCharCommand = null;
  };
  Scene_Map2.prototype.createDisplayObjects = function () {
    _super.prototype.createDisplayObjects.call(this);
  };
  Scene_Map2.prototype.buttonY = function () {
    return -6;
  };
  Scene_Map2.prototype.buttonInterval = function () {
    return 55;
  };
  Scene_Map2.prototype.buttonX = function () {
    return 1042;
  };
  Scene_Map2.prototype.createMenuButton = function () {
    this.createRecordButton();
  };
  Scene_Map2.prototype.hideForSnapshot = function () {
    $gameScreen.clearFade();
    _super.prototype.update.call(this);
    this._messageWindow.visible = false;
    this._nameBoxWindow.visible = false;
  };
  Scene_Map2.prototype.createRecordButton = function () {
    this._recordButton = new Sprite_OverableButton("up2", true);
    this._recordButton.x = Graphics.width - 65;
    this._recordButton.y = this.buttonY();
    this._recordButton.visible = false;
    this.addWindow(this._recordButton);
    this._buttonList.push(this._recordButton);
    this._recordButton.setClickHandler(this.onRecord.bind(this));
  };
  Scene_Map2.prototype.isAnyButtonPressed = function () {
    for (var _i = 0, _a = this._buttonList; _i < _a.length; _i++) {
      var button = _a[_i];
      if (button.visible && button.isPressed()) {
        return true;
      }
    }
    return false;
  };
  Scene_Map2.prototype.onOption = function () {
    SoundManager.playOk();
    SceneManager.push(Scene_Options);
  };
  Scene_Map2.prototype.updateMenuButton = function () {
    if (this._menuButton) {
      var menuEnabled = this.isMenuEnabled();
      if (menuEnabled === this._menuEnabled) {
        this._menuButton.visible = this._menuEnabled;
        this._optionButton.visible = this._menuEnabled;
        this._warpButton.visible = this._menuEnabled;
      } else {
        this._menuEnabled = menuEnabled;
      }
    }
  };
  Scene_Map2.prototype.createSpriteset = function () {
    this._spriteset = new Spriteset_Map2();
    this.addChild(this._spriteset);
    this._spriteset.update();
  };
  Scene_Map2.prototype.terminate = function () {
    this._spriteset.waitForMenu();
    _super.prototype.terminate.call(this);
  };
  Scene_Map2.prototype.hideMenuButton = function () {
    if (this._spriteset._battleWindow) {
      this._spriteset._battleWindow.hide();
    }
  };
  Scene_Map2.prototype.update = function () {
    _super.prototype.update.call(this);
    this.updateFlags();
    this.updateSlg();
    this.updateRecordButton();
    this.updateScreenShot();
    if ($gameParty.isDirty()) {
      $gameParty.clearDirty();
      this._spriteset._dayWindow.refresh();
    }
  };
  Scene_Map2.prototype.updateScreenShot = function () {
    this._screenShotManager.update();
  };
  Scene_Map2.prototype.onMapTouch = function () {
    var x = $gameMap.canvasToMapX(TouchInput.x);
    var y = $gameMap.canvasToMapY(TouchInput.y);
    if (TouchInput.y <= 50) {
      return;
    }
    if (
      this._spriteset._avCharWindow &&
      this._spriteset._avCharWindow.visible
    ) {
      if (TouchInput.x < 300) {
        return;
      }
    }
    if (TouchInput.x >= 1040) {
      if (TouchInput.y <= 300) {
        return;
      }
    }
    if (
      this._spriteset._clickerWindow &&
      this._spriteset._clickerWindow.visible
    ) {
      if (TouchInput.x >= this._spriteset._clickerWindow.x) {
        return;
      }
    }
    if ($gameTemp.timeSpeedUp) {
      return;
    }
    if ($slg.hasWaitFireTimeEvent()) {
      return;
    }
    // 自動ドアの調整
    if ($gameMap.mapId() == 6) {
      this.setDestinationMap6(x, y);
      return;
    }
    $gameTemp.setDestination(x, y);
  };
  Scene_Map2.prototype.setDestinationMap6 = function (x, y) {
    if (y == 11) {
      if (x == 17 || x == 19 || x == 21 || x == 23) {
        $gameTemp.setDestination(x, y - 1);
        return;
      }
    }
    if (y == 19) {
      if (x == 19 || x == 21) {
        $gameTemp.setDestination(x, y - 1);
        return;
      }
    }
    $gameTemp.setDestination(x, y);
  };
  Scene_Map2.prototype.updateSlg = function () {
    $slg.updateTimeGaugeEventFade();
    if ($gameMap._interpreter && $gameMap._interpreter.isRunning()) {
      return;
    }
    $slg.update();
    if ($slg.isDirty()) {
      var scenario = $gameParty.nextScenario();
      if (scenario) {
        p("TimeEvent scenario:" + scenario);
        this.playScenario(scenario);
        return;
      }
      var commonId = $gameParty.nextCommonEvent();
      if (commonId > 0) {
        p("TimeEvent commonId:" + commonId);
        $gameTemp.reserveCommonEvent(commonId);
      }
    }
  };
  Scene_Map2.prototype.playScenario = function (id) {
    $gameMap._interpreter = new Game_Interpreter();
    $gameMap._interpreter._list = [];
    $gameMap._interpreter._list.push({
      code: 357,
      indent: 0,
      parameters: ["Nore_Tes", "Run", null, { id: id }],
    });
    $gameMap._interpreter._list.push({ code: 0, indent: 0, parameters: [] });
    p($gameMap._interpreter._list);
  };
  Scene_Map2.prototype.updateFlags = function () {};
  Scene_Map2.prototype.updateRecordButton = function () {
    if ($gameSystem.isRecollection()) {
      this._recordButton.visible = false;
      return;
    }
    this._recordButton.visible = $gameSystem.isEroEvent();
  };
  Scene_Map2.prototype.onRecord = function () {
    this.saveAvJacket();
  };
  Scene_Map2.prototype.saveAvJacket = function () {
    AudioManager.playSe({ name: "Camera", volume: 100, pitch: 100, pan: 0 });
    var screenShot = $gameAvJacketMaker.makeScreenShot();
    var jacketWindow = new Window_MakeAvJacket(screenShot);
    this.addChild(jacketWindow);
    $gameAvJacketList.pushScreenShot(screenShot);
  };
  Scene_Map2.prototype.showGachaResult = function (battleActorId, isNew) {
    this._spriteset.showGachaResult(battleActorId, isNew);
  };
  Scene_Map2.prototype.showGachaResultList = function (list, newList) {
    this._spriteset.showGachaResultList(list, newList);
  };
  Scene_Map2.prototype.hideGachaResult = function () {
    this._spriteset.hideGachaResult();
  };
  Scene_Map2.prototype.showGachaRate = function (rate) {
    this._spriteset.showGachaRate(rate);
  };
  Scene_Map2.prototype.hideGachaRate = function () {
    this._spriteset.hideGachaRate();
  };
  Scene_Map2.prototype.showBigJacket = function (jacket) {
    this._spriteset.showBigJacket(jacket);
  };
  Scene_Map2.prototype.hideBigJacket = function () {
    this._spriteset.hideBigJacket();
  };
  Scene_Map2.prototype.showMonsterBonus = function () {
    this._spriteset.showMonsterBonus();
  };
  Scene_Map2.prototype.hideMonsterBonus = function () {
    this._spriteset.hideMonsterBonus();
  };
  return Scene_Map2;
})(Scene_Map);
var Spriteset_Map2 = /** @class */ (function (_super) {
  __extends(Spriteset_Map2, _super);
  function Spriteset_Map2() {
    return (_super !== null && _super.apply(this, arguments)) || this;
  }
  Spriteset_Map2.prototype.createUpperLayer = function () {
    this.createPictures();
    if ($gameMap.mapId() != 3) {
      this.createClickerWindow();
    }
    this.createAvCharWindow();
    this.createTopWindow();
    this.createPictures2();
    this.createTimer();
    this.createOverallFilters();
  };
  Spriteset_Map2.prototype.createAvCharWindow = function () {
    this._avCharWindow = new Window_AvCharList();
    this.addChild(this._avCharWindow);
  };
  Spriteset_Map2.prototype.createTopWindow = function () {
    this._dayWindow = new Nore.Window_Top(false);
    this.addChild(this._dayWindow);
  };
  Spriteset_Map2.prototype.createDouseiSprite = function () {
    this._douseiSet = new Sprite_DouseiSet();
    this.addChild(this._douseiSet);
  };
  Spriteset_Map2.prototype.createClickerWindow = function () {
    if ($gameMap.mapId() == 3) {
      return;
    }
    if ($gameMap.mapId() == 33) {
      if ($gameSwitches.value(283)) {
        // 怪人ガチャ
        return;
      }
    }
    this._clickerWindow = new Spriteset_Clicker();
    this.addChild(this._clickerWindow);
  };
  Spriteset_Map2.prototype.waitForMenu = function () {
    this._waitForMenu = true;
  };
  Spriteset_Map2.prototype.update = function () {
    _super.prototype.update.call(this);
    this.updateWindowVisible();
  };
  Spriteset_Map2.prototype.updateWindowVisible = function () {
    var visible = true; //$gameSwitches.value(SLG_WINDOW_SW);
    if (this._waitForMenu) {
      //visible = false;
    }
    if (this._dayWindow) {
      if (!$gameSwitches.value(999)) {
        if (!$gameSwitches.value(18)) {
          this._dayWindow.visible = visible;
        }
      }
    }
  };
  Spriteset_Map2.prototype.processAnimationRequests = function () {
    if (!this._clickerWindow || !this._clickerWindow.visible) {
      _super.prototype.processAnimationRequests.call(this);
    }
  };
  Spriteset_Map2.prototype.createPictures = function () {
    var width = Graphics.width;
    var height = Graphics.height;
    var x = (Graphics.width - width) / 2;
    var y = (Graphics.height - height) / 2;
    this._pictureContainer = new Sprite();
    this._pictureContainer.setFrame(x, y, width, height);
    for (var i = 0; i < 10; i++) {
      this._pictureContainer.addChild(new Sprite_Picture(i));
    }
    this.addChild(this._pictureContainer);
  };
  Spriteset_Map2.prototype.createPictures2 = function () {
    var width = Graphics.width;
    var height = Graphics.height;
    var x = (Graphics.width - width) / 2;
    var y = (Graphics.height - height) / 2;
    this._pictureContainer2 = new Sprite();
    this._pictureContainer2.setFrame(x, y, width, height);
    for (var i = 10; i <= $gameScreen.maxPictures() - 1; i++) {
      this._pictureContainer2.addChild(new Sprite_Picture(i));
    }
    this.addChild(this._pictureContainer2);
  };
  Spriteset_Map2.prototype.showGachaResult = function (battleActorId, isNew) {
    var actor = $slg.formation().findBattleActor(battleActorId);
    if (!actor) {
      console.error(battleActorId + "のキャラが存在しません");
    }
    var sprite = new Nore.Sprite_GachaResult(actor, isNew);
    this.addChild(sprite);
    this._gachaResultSprite = sprite;
  };
  Spriteset_Map2.prototype.hideGachaResult = function () {
    if (this._gachaResultSprite) {
      this.removeChild(this._gachaResultSprite);
      this._gachaResultSprite = null;
    }
    if (this._gachaResultSpriteList) {
      for (var i = 0; i < this._gachaResultSpriteList.length; i++) {
        var sprite = this._gachaResultSpriteList[i];
        this.removeChild(sprite);
      }
      this._gachaResultSpriteList = [];
    }
  };
  Spriteset_Map2.prototype.showGachaResultList = function (list, newList) {
    this._gachaResultSpriteList = [];
    for (var i = 0; i < list.length; i++) {
      var battleActorId = list[i];
      var isNew = newList[i];
      var actor = $slg.formation().findBattleActor(battleActorId);
      if (!actor) {
        console.error(battleActorId + "のキャラが存在しません");
      }
      var sprite = new Nore.Sprite_GachaResult5Ren(actor, isNew, i);
      this.addChild(sprite);
      this._gachaResultSpriteList.push(sprite);
    }
  };
  Spriteset_Map2.prototype.showGachaRate = function (rareList) {
    var sprite = new Nore.Sprite_GachaRate(rareList);
    this.addChild(sprite);
    this._gachaRateSprite = sprite;
  };
  Spriteset_Map2.prototype.hideGachaRate = function () {
    if (this._gachaRateSprite) {
      this.removeChild(this._gachaRateSprite);
      this._gachaRateSprite = null;
    }
  };
  Spriteset_Map2.prototype.createShadow = function () {
    this._shadowSprite = new Sprite();
    this._shadowSprite.anchor.x = 0.5;
    this._shadowSprite.anchor.y = 1;
    this._shadowSprite.z = 6;
    this._tilemap.addChild(this._shadowSprite);
  };
  Spriteset_Map2.prototype.loadSystemImages = function () {
    Spriteset_Base.prototype.loadSystemImages.call(this);
    ImageManager.loadSystem("Balloon");
  };
  Spriteset_Map2.prototype.showBigJacket = function (jacket) {
    this.hideBigJacket();
    this._jacketSprite = new Nore.Sprite_AvJacketBig(
      jacket,
      JacketScale.scale3
    );
    this._jacketSprite.y = 0;
    this.addChild(this._jacketSprite);
  };
  Spriteset_Map2.prototype.hideBigJacket = function () {
    if (this._jacketSprite) {
      this._jacketSprite.destroy();
      this.removeChild(this._jacketSprite);
      this._jacketSprite = null;
    }
  };
  Spriteset_Map2.prototype.showMonsterBonus = function () {
    var sprite = new Nore.Sprite_MonsterBonus();
    this.addChild(sprite);
    this._monsterBonusSprite = sprite;
  };
  Spriteset_Map2.prototype.hideMonsterBonus = function () {
    if (this._monsterBonusSprite) {
      this.removeChild(this._monsterBonusSprite);
      this._monsterBonusSprite = null;
    }
  };
  return Spriteset_Map2;
})(Spriteset_Map);


code:
/*:ja
 * @target MZ
 */
var Nore;
(function (Nore) {
  Sprite_Clickable.prototype.changeTextColor = function (color) {
    this.bitmap.textColor = color;
  };
  Sprite_Gauge.prototype.bitmapWidth = function () {
    return 208;
  };
  var _Sprite_Gauge_prototype_currentValue =
    Sprite_Gauge.prototype.currentValue;
  Sprite_Gauge.prototype.currentValue = function () {
    if (this._battler) {
      switch (this._statusType) {
        case "fame":
          return $gamePlayer.mainActor().fame;
        case "frustration":
          return $gamePlayer.mainActor().zasetsu;
      }
    }
    return _Sprite_Gauge_prototype_currentValue.call(this);
  };
  var _Sprite_Gauge_prototype_currentMaxValue =
    Sprite_Gauge.prototype.currentMaxValue;
  Sprite_Gauge.prototype.currentMaxValue = function () {
    if (this._battler) {
      switch (this._statusType) {
        case "fame":
          return $gamePlayer.mainActor().maxFame;
        case "frustration":
          return $gamePlayer.mainActor().maxZasetsu;
      }
    }
    return _Sprite_Gauge_prototype_currentMaxValue.call(this);
  };
  var Sprite_Gauge_prototype_label = Sprite_Gauge.prototype.label;
  Sprite_Gauge.prototype.label = function () {
    switch (this._statusType) {
      case "fame":
        return TextManager.fame;
      case "frustration":
        return TextManager.frustration;
    }
    return Sprite_Gauge_prototype_label.call(this);
  };
  Sprite_Gauge.prototype.gaugeX = function () {
    return this._statusType === "time" ? 0 : 100;
  };
  function getSystemBaseTexture(name) {
    var baseTexture = PIXI.utils.BaseTextureCache["system/" + name];
    if (!baseTexture) {
      var bitmap = ImageManager.loadSystem(name);
      if (!bitmap.isReady()) {
        return;
      }
      baseTexture = new PIXI.BaseTexture(bitmap._image);
      baseTexture.resource.url = "system/" + name;
      PIXI.utils.BaseTextureCache["system/" + name] = baseTexture;
    }
    return baseTexture;
  }
  Nore.getSystemBaseTexture = getSystemBaseTexture;
  var _Window_prototype_createContentsBackSprite =
    Window.prototype._createContentsBackSprite;
  Window.prototype._createContentsBackSprite = function () {
    _Window_prototype_createContentsBackSprite.call(this);
    this._windowContentsBackSprite2 = new Sprite();
    this._clientArea.addChild(this._windowContentsBackSprite2);
  };
  var Window_prototype__createContentsSprite =
    Window.prototype._createContentsSprite;
  Window.prototype._createContentsSprite = function () {
    this._windowContentsBackSprite = new Sprite();
    this._clientArea.addChild(this._windowContentsBackSprite);
    Window_prototype__createContentsSprite.call(this);
    this._windowContentsSprite = new Sprite();
    this._windowContentsSprite.x = -12;
    this._windowContentsSprite.y = -12;
    this._clientArea.addChild(this._windowContentsSprite);
  };
  Spriteset_Base.prototype.isAnimationPlaying = function () {
    if (this._animationSprites.length == 0) {
      return false;
    }
    for (var _i = 0, _a = this._animationSprites; _i < _a.length; _i++) {
      var anime = _a[_i];
      if (anime.isPlayingBattle()) {
        return true;
      } else {
      }
    }
    return false;
    return this._animationSprites.length > 0;
  };
  Sprite_AnimationMV.prototype.isPlayingBattle = function () {
    if (this._battleDuration > 0) {
      return this._battleDuration > this._frameIndex;
    }
    return this.isPlaying();
  };
  Sprite_Animation.prototype.isPlayingBattle = function () {
    if (this._battleDuration > 0) {
      return this._battleDuration > this._frameIndex;
    }
    return this._playing;
  };
  Window_Base.prototype.drawGoldImg = function (x, y) {
    var baseTexture = Nore.getSystemBaseTexture("gold");
    var texture = new PIXI.Texture(baseTexture);
    var sprite = new PIXI.Sprite(texture);
    sprite.x = x;
    sprite.y = y;
    this._windowContentsSprite.addChild(sprite);
  };
})(Nore || (Nore = {}));
var Rank;
(function (Rank) {
  Rank[(Rank["H"] = 0)] = "H";
  Rank[(Rank["G"] = 1)] = "G";
  Rank[(Rank["F"] = 2)] = "F";
  Rank[(Rank["E"] = 3)] = "E";
  Rank[(Rank["D"] = 4)] = "D";
  Rank[(Rank["C"] = 5)] = "C";
  Rank[(Rank["B"] = 6)] = "B";
  Rank[(Rank["A"] = 7)] = "A";
  Rank[(Rank["S"] = 8)] = "S";
  Rank[(Rank["MAX"] = 9)] = "MAX";
})(Rank || (Rank = {}));
Window_Base.prototype.drawRank = function (rank, x, y) {
  var iconIndex = 1923 + rank + 13;
  if (rank == Rank.MAX) {
    this.drawIcon(1923 + 6 + 16, x - 5, y);
    this.drawIcon(1923 + 6 + 17, x + 32 - 5, y);
    return;
  }
  this.drawIcon(iconIndex, x, y);
};


code:
/*:ja
 * @target MZ
 * @author ル
 *
 */
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
var TaneoyaId;
(function (TaneoyaId) {
  TaneoyaId[(TaneoyaId["none"] = 0)] = "none";
  TaneoyaId[(TaneoyaId["banzoku"] = 1)] = "banzoku";
  TaneoyaId[(TaneoyaId["chosyuhei"] = 2)] = "chosyuhei";
  TaneoyaId[(TaneoyaId["goblin"] = 3)] = "goblin";
  TaneoyaId[(TaneoyaId["vagrant"] = 4)] = "vagrant";
  TaneoyaId[(TaneoyaId["minister"] = 5)] = "minister";
  TaneoyaId[(TaneoyaId["bar"] = 6)] = "bar";
  TaneoyaId[(TaneoyaId["charles"] = 7)] = "charles";
  TaneoyaId[(TaneoyaId["gray"] = 8)] = "gray";
  TaneoyaId[(TaneoyaId["loli"] = 9)] = "loli";
  TaneoyaId[(TaneoyaId["oliver"] = 21)] = "oliver";
})(TaneoyaId || (TaneoyaId = {}));
var PARAM_RANK = [50, 100, 200, 320, 500];
var CostumeSaver = /** @class */ (function () {
  function CostumeSaver(actorId, faceId) {
    if (faceId === void 0) {
      faceId = -1;
    }
    this._faceId = -1;
    this._hoppeId = 0;
    this._namidaId = 0;
    this._namidaAcce = 0;
    this._boteId = 0;
    this._hightlight = Hightlight.normal;
    if (actorId < 0) {
      this._actorId = actorId;
      this._acceMap = {};
      return;
    }
    this.saveCostume(actorId, faceId);
  }
  CostumeSaver.prototype.isNull = function () {
    return this._actorId < 0;
  };
  CostumeSaver.prototype.saveCostume = function (actorId, faceId) {
    var actor = $gameActors.actor(actorId);
    this.saveCostumeActor(actor, faceId);
  };
  CostumeSaver.prototype.saveCostumeActor = function (actor, faceId) {
    this._actorId = actor.actorId();
    this._outerId = actor.outerId;
    this._outerTopId = actor.outerTopId;
    this._outerBottomId = actor.outerBottomId;
    this._armId = actor.armId;
    this._legId = actor.legId;
    this._innerTopId = actor.innerTopId;
    this._innerBottomId = actor.innerBottomId;
    this._poseId = actor.poseId;
    this._boteId = actor.boteId;
    this._hoppeId = actor.hoppeId;
    this._namidaId = actor.namidaId;
    this._namidaAcce = actor.getNamidaAcceId();
    this._hightlight = actor.hightlight();
    this._acceMap = JsonEx.makeDeepCopy(actor.acceMap);
    this.saveFace(faceId, actor.hoppeId);
  };
  CostumeSaver.prototype.restoreCostume = function (argActor, includeAcce) {
    if (includeAcce === void 0) {
      includeAcce = true;
    }
    var actor = argActor || $gameActors.actor(this._actorId);
    actor.setOuterId(this._outerId);
    actor.setOuterTopId(this._outerTopId);
    actor.setOuterBottomId(this._outerBottomId);
    actor.setArmId(this._armId);
    actor._legId = this._legId;
    actor._innerTopId = this._innerTopId;
    actor._innerBottomId = this._innerBottomId;
    actor.setHoppeId(this._hoppeId);
    actor.setAcceHoppeId(this._hoppeId);
    actor.setPoseId(this._poseId);
    actor.setNamidaId(this._namidaId);
    actor.setHightlight(this._hightlight);
    actor.setNamidaAcce(this._namidaAcce);
    if (includeAcce) {
      var list = this.fixedAcceList(actor.acceMap);
      actor.acceMap = JsonEx.makeDeepCopy(this._acceMap);
      for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
        var armorId = list_1[_i];
        actor.acceMap[armorId] = true;
      }
    }
    actor.setCacheChanged();
  };
  CostumeSaver.prototype.fixedAcceList = function (acceMap) {
    var result = [];
    for (var key in acceMap) {
      if (acceMap[key]) {
        var armor = $dataArmors[key];
        if (armor.meta["lock"]) {
          result.push(key);
        }
      }
    }
    return result;
  };
  CostumeSaver.prototype.saveFace = function (faceId, hoppeId) {
    this._faceId = faceId;
    this._hoppeId = hoppeId;
  };
  CostumeSaver.prototype.boteId = function () {
    return this._boteId || 0;
  };
  CostumeSaver.prototype.faceId = function () {
    return this._faceId || 1;
  };
  CostumeSaver.prototype.hoppeId = function () {
    return this._hoppeId || 0;
  };
  CostumeSaver.prototype.setFaceId = function (f) {
    this._faceId = f;
  };
  CostumeSaver.prototype.setHoppeId = function (h) {
    this._hoppeId = h;
  };
  CostumeSaver.prototype.setPoseId = function (h) {
    this._poseId = h;
  };
  CostumeSaver.prototype.poseId = function () {
    return this._poseId;
  };
  CostumeSaver.prototype.setInnerBottomId = function (id) {
    this._innerBottomId = id;
  };
  CostumeSaver.prototype.setAcceId = function (acceId) {
    var armor = $dataArmors[acceId];
    var group = parseInt(armor.meta["group"]);
    if (group > 0) {
      this.removeGroup(group, armor);
    }
  };
  CostumeSaver.prototype.removeGroup = function (groupId, newArmor) {
    var newId = newArmor.id;
    var isSet = this.hasAcce(newId);
    if (isSet && newArmor.meta["fixed"]) {
      return;
    }
    var removeList = [];
    for (var i in this._acceMap) {
      if (!this._acceMap[i]) {
        continue;
      }
      var acceItem = $dataArmors[i];
      if (acceItem.meta["group"]) {
        var group = parseInt(acceItem.meta["group"]);
        if (group == groupId) {
          removeList.push(i);
        }
      }
    }
    for (
      var _i = 0, removeList_1 = removeList;
      _i < removeList_1.length;
      _i++
    ) {
      var i = removeList_1[_i];
      delete this._acceMap[i];
    }
    if (!isSet) {
      this._acceMap[newId] = true;
    }
  };
  CostumeSaver.prototype.outerId = function () {
    return this._outerId;
  };
  CostumeSaver.prototype.setOuterId = function (id) {
    this._outerId = id;
  };
  CostumeSaver.prototype.innerBottomId = function () {
    return this._innerBottomId;
  };
  CostumeSaver.prototype.innerTopId = function () {
    return this._innerTopId;
  };
  CostumeSaver.prototype.legId = function () {
    return this._legId;
  };
  CostumeSaver.prototype.hasAcce = function (acceId) {
    return this._acceMap[acceId];
  };
  CostumeSaver.prototype.isKuroChikubi = function () {
    if (this._acceMap[1097]) {
      return true;
    }
    if (this._acceMap[1098]) {
      return false;
    }
    if (this._boteId == 2) {
      return true;
    }
    return false;
  };
  CostumeSaver.prototype.actorId = function () {
    return this._actorId;
  };
  return CostumeSaver;
})();
var CharacterCostume = /** @class */ (function (_super) {
  __extends(CharacterCostume, _super);
  function CharacterCostume() {
    return (_super !== null && _super.apply(this, arguments)) || this;
  }
  CharacterCostume.prototype.outerId = function () {
    return $gameActors.actor(this._actorId).outerId;
  };
  CharacterCostume.prototype.innerBottomId = function () {
    return $gameActors.actor(this._actorId).innerBottomId;
  };
  CharacterCostume.prototype.innerTopId = function () {
    return $gameActors.actor(this._actorId).innerTopId;
  };
  CharacterCostume.prototype.legId = function () {
    return $gameActors.actor(this._actorId).legId;
  };
  return CharacterCostume;
})(CostumeSaver);
var ScenarioEvent = /** @class */ (function () {
  function ScenarioEvent(file, ero, forEro) {
    this.file = file;
    this.ero = ero;
    this.forEro = forEro;
  }
  return ScenarioEvent;
})();
var ALPHA_INTERVAL = 0.04;
var ALPHA_INTERVAL2 = 0.1;
DataManager.setupNewGame = function () {
  this.createGameObjects();
  this.selectSavefileForNewGame();
  $gameParty.setupStartingMembers();
  $gamePlayer.setupForNewGame();
  $gameSystem.setupForNewGame();
  Graphics.frameCount = 0;
};
var Difficulty;
(function (Difficulty) {
  Difficulty[(Difficulty["normal"] = 0)] = "normal";
  Difficulty[(Difficulty["easy"] = 1)] = "easy";
})(Difficulty || (Difficulty = {}));
var Game_System2 = /** @class */ (function (_super) {
  __extends(Game_System2, _super);
  function Game_System2() {
    var _this = (_super !== null && _super.apply(this, arguments)) || this;
    _this._tryCount = 0;
    _this._equipId = 0;
    _this._chokyoTime = 0;
    _this._manAlpha = 1;
    _this._outerAlpha = 1;
    _this._manAlphaOff = false;
    _this._expBoxCount = 0;
    _this._additionalDay = 0;
    _this._hildaNinshin = false;
    return _this;
  }
  Game_System2.prototype.initialize = function () {
    _super.prototype.initialize.call(this);
    this._nextId = 0;
    this._gameId = this.initGameId();
  };
  Game_System2.prototype.setupForNewGame = function () {
    //$gameSwitches.setValue(40, Nore.isTaikenban());
  };
  Game_System2.prototype.isAutosaveEnabled = function () {
    if (this.isRecollection()) {
      // 回想中
      return false;
    }
    if ($gameSwitches.value(992)) {
      // オートセーブ禁止
      return false;
    }
    return _super.prototype.isAutosaveEnabled.call(this);
  };
  Game_System2.prototype.initGameId = function () {
    var d = new Date();
    var yy = d.getFullYear();
    var m = d.getMonth() + 1;
    var dd = d.getDay();
    var hh = d.getHours();
    var mm = d.getMinutes();
    var ss = d.getSeconds();
    return yy + "-" + m + "-" + dd + "_" + hh + "_" + mm + "_" + ss;
  };
  Game_System2.prototype.isEventReserved = function (actorId) {
    this._eventReservation = this._eventReservation || {};
    this._eventReservation[actorId] = this._eventReservation[actorId] || [];
    return this._eventReservation[actorId].length > 0;
  };
  Game_System2.prototype.isEroEventReserved = function (actorId) {
    this._eventReservation = this._eventReservation || {};
    this._eventReservation[actorId] = this._eventReservation[actorId] || [];
    if (this._eventReservation[actorId].length === 0) {
      return false;
    }
    return this._eventReservation[actorId][0].ero;
  };
  Game_System2.prototype.endEvent = function (file) {
    this._finishedEvents = this._finishedEvents || {};
    this._finishedEvents[file] = true;
  };
  Game_System2.prototype.restoreEvent = function (file) {
    this._finishedEvents = this._finishedEvents || {};
    //p('restore:' + file + ' ' + this._finishedEvents[file])
    this._finishedEvents[file] = false;
  };
  Game_System2.prototype.isEndEvent = function (file) {
    this._finishedEvents = this._finishedEvents || {};
    return this._finishedEvents[file];
  };
  Game_System2.prototype.getReservedActorEvent = function (actorId) {
    this._eventReservation = this._eventReservation || {};
    this._eventReservation[actorId] = this._eventReservation[actorId] || [];
    if (this._eventReservation[actorId][0]) {
      return this._eventReservation[actorId][0].file;
    }
    return null;
  };
  Game_System2.prototype.reserveActorEvent = function (
    actorId,
    scenarioId,
    ero,
    forEro
  ) {
    if (this.isEndEvent(scenarioId)) {
      //p('end' + scenarioId)
      return;
    }
    this._eventReservation = this._eventReservation || {};
    this._eventReservation[actorId] = this._eventReservation[actorId] || [];
    this._eventReservation[actorId].push(
      new ScenarioEvent(scenarioId, ero, forEro)
    );
  };
  Game_System2.prototype.clearReservedEvent = function () {
    this._eventReservation = {};
  };
  Game_System2.prototype.isRecollection = function () {
    return $gameSwitches.value(999);
  };
  Game_System2.prototype.isEroEvent = function () {
    if (this.isRecollection()) {
    }
    if ($gameSwitches.value(27)) {
      return false;
    }
    return $gameSwitches.value(26);
  };
  Game_System2.prototype.manAlpha = function () {
    return this._manAlpha;
  };
  Game_System2.prototype.upManAlpha = function () {
    if (this._manAlphaOff) {
      return;
    }
    this._manAlpha += ALPHA_INTERVAL;
    this._manAlpha = Math.min(1, this._manAlpha);
  };
  Game_System2.prototype.downManAlpha = function () {
    if (this._manAlphaOff) {
      return;
    }
    this._manAlpha -= ALPHA_INTERVAL;
    this._manAlpha = Math.max(0, this._manAlpha);
  };
  Game_System2.prototype.resetManAlpha = function () {
    this._manAlpha = 1;
  };
  Game_System2.prototype.offManAlpha = function () {
    this.resetManAlpha();
    this._manAlphaOff = true;
  };
  Game_System2.prototype.onManAlpha = function () {
    this._manAlphaOff = false;
  };
  Game_System2.prototype.outerAlpha = function () {
    if (ConfigManager.outerTransparentEnabled) {
      return this._outerAlpha;
    } else {
      return 1;
    }
  };
  Game_System2.prototype.upOuterAlpha = function () {
    this._outerAlpha += ALPHA_INTERVAL2;
    this._outerAlpha = Math.min(1, this._outerAlpha);
    this.onOuterAlphaChanged();
  };
  Game_System2.prototype.downOuterAlpha = function () {
    this._outerAlpha -= ALPHA_INTERVAL2;
    this._outerAlpha = Math.max(0, this._outerAlpha);
    this.onOuterAlphaChanged();
  };
  Game_System2.prototype.resetOuterAlpha = function () {
    this._outerAlpha = 1;
  };
  Game_System2.prototype.onOuterAlphaChanged = function () {
    for (var _i = 0, _a = $gameParty.members(); _i < _a.length; _i++) {
      var actor = _a[_i];
      actor.setCacheChanged();
    }
  };
  Game_System2.prototype.onAfterLoad = function () {
    _super.prototype.onAfterLoad.call(this);
    if (!$gameSwitches.value(996)) {
      this.resetOuterAlpha();
    }
    $gameSwitches.setValue(40, Nore.isTaikenban());
    $slg.formation().clearRareFilter();
    $slg.formation().clearElementFilter();
  };
  Game_System2.prototype.isCJK = function () {
    if (ConfigManager.language == "en") {
      return false;
    }
    return _super.prototype.isCJK.call(this);
  };
  Game_System2.prototype.sarachiActorId = function () {
    return $gameVariables.value(128);
  };
  Game_System2.prototype.isEroAcceAllOpened = function () {
    return true;
  };
  Game_System2.prototype.isNekoPlayer = function () {
    return $gameSwitches.value(32);
  };
  Game_System2.prototype.playNeko = function () {
    $gameSwitches.setValue(32, true);
  };
  Game_System2.prototype.endNeko = function () {
    $gameSwitches.setValue(32, false);
  };
  Game_System2.prototype.currentPlace = function () {
    return $gameVariables.value(72);
  };
  Game_System2.prototype.difficulty = function () {
    return $gameVariables.value(15);
  };
  Game_System2.prototype.difficultyDamageRate = function () {
    if (this.difficulty() == Difficulty.easy) {
      return 10;
    }
    return 1;
  };
  Game_System2.prototype.difficultyAvParamRate = function () {
    if (this.difficulty() == Difficulty.easy) {
      return 0.5;
    }
    return 1;
  };
  Game_System2.prototype.isTaikenbanOkAv = function (itemId) {
    if (!Nore.isTaikenban()) {
      return true;
    }
    switch (itemId) {
      case 101:
      case 102:
      case 103:
      case 121: // ーノノカの快楽
      case 122: // ーノノカの処女喪失
      case 124: // ーノノカの出産
      case 129: // ーノノカの睡眠姦
      case 133: // ーノノカの睡眠出産
      case 201: // 水着で射精
        return true;
    }
    return false;
  };
  Game_System2.prototype.isTaikenbanOkBattle = function (enemyId) {
    if (!Nore.isTaikenban()) {
      return true;
    }
    switch (enemyId) {
      case 1: // アンテナ基地
      case 6: // ノノカとの戦い
      //case 11:   // 防衛施設
      case 41: // マリナの家付近
      case 50: // マリナとの戦い
      case 121: // ーノノカの快楽
        return true;
    }
    return false;
  };
  return Game_System2;
})(Game_System);


code:
/*:ja
 * @target MZ
 * @author ル
 *
 * @command ninshin
 * @text 妊娠させる
 * @des 妊娠
 * @arg actorId
 * @type number
 * @text actorId
 * @desc actorId
 * @arg manId
 * @type number
 * @text manId
 * @desc 直前のAVの男優の場合 0
 *
 * @command bote
 * @text ボテ腹にさせる
 * @des ボテ腹
 * @arg actorId
 * @type number
 * @text actorId
 * @desc actorId
 *
 * @command syusan
 * @text 出産させる
 * @des 出産
 * @arg actorId
 * @type number
 * @text actorId
 * @desc actorId
 *
 * @command ninshinSyusan
 * @text 妊娠＆出産させる
 * @arg actorId
 * @type number
 * @text actorId
 * @desc actorId
 * @arg manId
 * @type number
 * @text manId
 * @desc manId
 *
 * @command setTaneoyaName
 * @text 種親の名前を29番の変数に設定
 * @des 種親の名前を29番の変数に設定
 * @arg actorId
 * @type number
 * @text actorId
 * @desc actorId
 *
 * @command countSyusan
 * @text 出産回数を26番の変数に設定
 * @des 出産回数を26番の変数に設定
 * @arg actorId
 * @type number
 * @text actorId
 * @desc actorId
 * @arg manId
 * @type number
 * @text manId
 * @desc manId
 *
 * @command syusanFutago
 * @text 双子出産用
 * @des 双子出産用
 * @arg actorId
 * @type number
 * @text actorId
 * @desc actorId
 */
var Nore;
(function (Nore) {
  var pluginName = "Nore_Syusan";
  PluginManager.registerCommand(pluginName, "ninshin", function (args) {
    var actorId = parseInt(args.actorId);
    var manId = parseInt(args.manId);
    if (manId <= 0) {
      manId = $gameTemp.av.mainManId();
    }
    if ($gameTemp.av) {
      if ($gameTemp.av.isContraception()) {
        p("避妊の設定なので妊娠しませんでした");
        return;
      }
    }
    var actor = $gameActors.actor(actorId);
    if (
      actor.lastBaby() &&
      actor.lastBaby().progress() != BabyProgress.syusan
    ) {
      p("すでに受精中のため、妊娠できません");
      return;
    }
    ninshin(actor, manId);
  });
  function ninshin(actor, manId) {
    actor.ninshin(manId);
    var time = actor.calcNinshinTime();
    var e = new NinshinTimeGaugeEvent(actor.actorId(), time, manId);
    $slg.addTimeGaugeEvent(e);
  }
  Nore.ninshin = ninshin;
  PluginManager.registerCommand(pluginName, "bote", function (args) {
    var actorId = parseInt(args.actorId);
    var actor = $gameActors.actor(actorId);
    if (actor.lastBaby().progress() != BabyProgress.jusei) {
      console.error("受精中になっていません");
      return;
    }
    actor.lastBaby().setBote();
    actor.setBote(1);
  });
  PluginManager.registerCommand(pluginName, "syusan", function (args) {
    var actorId = parseInt(args.actorId);
    var actor = $gameActors.actor(actorId);
    if (actor.lastBaby().progress() != BabyProgress.bote) {
      console.error("子供がボテ腹になっていません");
    }
    actor.lastBaby().syusan();
    actor.setBote(0);
    actor.onSyusan();
  });
  PluginManager.registerCommand(pluginName, "setTaneoyaName", function (args) {
    var actorId = parseInt(args.actorId);
    var actor = $gameActors.actor(actorId);
    if ($gameSystem.isRecollection() && !actor.lastBaby()) {
      var taneId = 73;
      $gameVariables.setValue(29, $gameActors.actor(taneId).name());
      $gameVariables.setValue(30, taneId);
      $gameVariables.setValue(26, 2);
      return;
    }
    if (!$gameSystem.isRecollection()) {
      if (
        actor.lastBaby().progress() != BabyProgress.bote &&
        actor.lastBaby().progress() != BabyProgress.jusei
      ) {
        console.error("妊娠していません");
      }
    }
    var name = actor.lastBaby().taneoyaName();
    $gameVariables.setValue(29, name);
    $gameVariables.setValue(30, actor.lastBaby().taneoyaId());
    $gameVariables.setValue(26, actor.babyList().length);
  });
  PluginManager.registerCommand(pluginName, "ninshinSyusan", function (args) {
    var actorId = parseInt(args.actorId);
    var manId = parseInt(args.manId);
    var actor = $gameActors.actor(actorId);
    actor.ninshin(manId);
    actor.lastBaby().setBote();
    actor.lastBaby().syusan();
  });
  PluginManager.registerCommand(pluginName, "countSyusan", function (args) {
    var actorId = parseInt(args.actorId);
    var manId = parseInt(args.manId);
    var actor = $gameActors.actor(actorId);
    if ($gameSystem.isRecollection()) {
      $gameVariables.setValue(26, 1);
      $gameVariables.setValue(27, 2);
      return;
    }
    var count = actor.countSyusanMan(manId);
    $gameVariables.setValue(26, count);
    $gameVariables.setValue(27, count + 1);
  });
  PluginManager.registerCommand(pluginName, "syusanFutago", function (args) {
    var actorId = parseInt(args.actorId);
    var manId = 71;
    var actor = $gameActors.actor(actorId);
    actor.ninshin(manId);
    actor.lastBaby().setBote();
    actor.lastBaby().syusan();
    actor.onSyusan();
    actor.ninshin(manId);
    actor.lastBaby().setBote();
    actor.lastBaby().syusan();
    actor.onSyusan();
  });
})(Nore || (Nore = {}));