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 Place = /** @class */ (function () {
  function Place(enemyId) {
    this._stageList = [];
    this._enemyId = enemyId;
    this.createStage();
    this.calcDifficulty();
  }
  Place.prototype.enemyId = function () {
    return this._enemyId;
  };
  Place.prototype.orderId = function () {
    var enemy = $dataEnemies[this.enemyId()];
    if (enemy.meta["order"]) {
      return parseInt(enemy.meta["order"]);
    }
    return this._enemyId;
  };
  Place.prototype.calcDifficulty = function () {
    var stage = this.lastStage();
    var bossDefficulty = this.bossDifficulty(stage._enemyId);
    if (bossDefficulty > 0) {
      this._difficulty = bossDefficulty;
      return;
    }
    var enemy = $dataEnemies[stage._enemyId];
    var hp = enemy.params[0];
    var atk = enemy.params[2];
    var interval = enemy.params[6];
    var dps = Math.floor((atk * 1000) / interval);
    var total = dps * 4 + hp;
    //p(enemy.name + ':' + total )
    if (total <= 1500) {
      this._difficulty = 1;
    } else if (total <= 3500) {
      this._difficulty = 2;
    } else if (total <= 5000) {
      this._difficulty = 3;
    } else if (total <= 10000) {
      this._difficulty = 4;
    } else {
      this._difficulty = 5;
    }
  };
  Place.prototype.bossDifficulty = function (enemyId) {
    switch (enemyId) {
      case 50:
        return 5;
      case 51:
        return 2;
      case 31:
      case 32:
      case 33:
      case 34:
      case 35:
        return 4;
      case 41:
      case 42:
      case 43:
        return 1;
      case 80:
      case 81:
      case 82:
        return 5;
      case 62:
        return 3;
    }
    return -1;
  };
  Place.prototype.difficulty = function () {
    return this._difficulty;
  };
  Place.prototype.lastStage = function () {
    return this._stageList[this._stageList.length - 1];
  };
  Place.prototype.createStage = function () {
    for (var i = 0; i < 10; i++) {
      var placeStageId = this._enemyId + i;
      var weapon = $dataEnemies[placeStageId];
      if (weapon.name == this.nameJp()) {
        this._stageList.push(new PlaceStage(placeStageId));
      } else {
        break;
      }
    }
  };
  Place.prototype.rewardList = function () {
    var stage = this.currentPlaceStage();
    if (!stage) {
      return [];
    }
    return stage.rewardList();
  };
  Place.prototype.currentPlaceStage = function () {
    for (var _i = 0, _a = this._stageList; _i < _a.length; _i++) {
      var placeStage = _a[_i];
      if (!placeStage.isClear()) {
        return placeStage;
      }
    }
    return null;
  };
  Place.prototype.currentStage = function () {
    if (this.isClear()) {
      return null;
    }
    var current = this.currentPlaceStage();
    return $slg.clicker().getStage(current.stageId());
  };
  Place.prototype.inBattle = function () {
    if (this.isClear()) {
      return false;
    }
    return this.currentStage() == $slg.clicker().currentStage();
  };
  Place.prototype.isClear = function () {
    for (var _i = 0, _a = this._stageList; _i < _a.length; _i++) {
      var placeStage = _a[_i];
      if (!placeStage.isClear()) {
        return false;
      }
    }
    return true;
  };
  Place.prototype.maxStep = function () {
    return this._stageList.length;
  };
  Place.prototype.step = function () {
    var max = 0;
    for (var _i = 0, _a = this._stageList; _i < _a.length; _i++) {
      var placeStage = _a[_i];
      max = placeStage.step();
      if (!placeStage.isClear()) {
        break;
      }
    }
    return max;
  };
  Place.prototype.name = function () {
    if (this._enemyId <= 0) {
      return "";
    }
    var item = this.item();
    switch (ConfigManager.language) {
      case "en":
        if (item.meta["nameEn"]) {
          return item.meta["nameEn"];
        }
        break;
      case "ch":
      case "jp":
        break;
    }
    return item.name;
  };
  Place.prototype.nameJp = function () {
    if (this._enemyId <= 0) {
      return "";
    }
    var item = this.item();
    return item.name;
  };
  Place.prototype.item = function () {
    if (this._enemyId <= 0) {
      return null;
    }
    return $dataEnemies[this._enemyId];
  };
  Place.prototype.mapId = function () {
    var item = this.item();
    return parseInt(item.meta["mapId"]);
  };
  Place.prototype.iconIndex = function () {
    var item = this.item();
    if (!item.meta["iconIndex"]) {
      return 0;
    }
    return parseInt(item.meta["iconIndex"]);
  };
  Place.prototype.getLastStage = function () {
    return this._stageList[this._stageList.length - 1];
  };
  Place.prototype.clearReward = function () {
    var list = this.getLastStage().rewardList();
    for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
      var r = list_1[_i];
      if (r.type() == PlaceRewardType.sw) {
        return r;
      }
    }
    return null;
  };
  Place.prototype.rewardDesc = function () {
    var item = this.item();
    if (!item.meta["rewardDesc"]) {
      return "";
    }
    var rewardDesc = parseInt(item.meta["rewardDesc"]);
    return TextManager["rewardDesc" + rewardDesc];
  };
  return Place;
})();
var PlaceStage = /** @class */ (function () {
  function PlaceStage(enemyId) {
    this._enemyId = enemyId;
    if (isNaN(this.step())) {
      console.error("step が不正です:" + enemyId);
    }
  }
  PlaceStage.prototype.enemyId = function () {
    return this._enemyId;
  };
  PlaceStage.prototype.name = function () {
    if (this._enemyId <= 0) {
      return "";
    }
    var item = this.item();
    return item.name;
  };
  PlaceStage.prototype.item = function () {
    if (this._enemyId <= 0) {
      return null;
    }
    return $dataEnemies[this._enemyId];
  };
  PlaceStage.prototype.step = function () {
    if (this._enemyId <= 0) {
      return 0;
    }
    return parseInt(this.item().meta["step"]);
  };
  PlaceStage.prototype.inBattle = function () {
    if (this.isClear()) {
      return false;
    }
    return this.getStage() == $slg.clickerStage();
  };
  PlaceStage.prototype.isClear = function () {
    var stage = $slg.clicker().getStage(this._enemyId);
    return stage.isClear();
  };
  PlaceStage.prototype.getStage = function () {
    return $slg.clicker().getStage(this.stageId());
  };
  PlaceStage.prototype.stageId = function () {
    return this._enemyId;
  };
  PlaceStage.prototype.rewardList = function () {
    var result = [];
    var item = this.item();
    if (item.gold > 0) {
      result.push(
        new PlaceReward(this._enemyId, PlaceRewardType.gold, item.gold)
      );
    }
    if (item.meta["sw"]) {
      var sw = parseInt(item.meta["sw"]);
      result.push(new PlaceReward(this._enemyId, PlaceRewardType.sw, sw));
    }
    return result;
  };
  PlaceStage.prototype.mapId = function () {
    var item = this.item();
    return parseInt(item.meta["mapId"]);
  };
  PlaceStage.prototype.gainReward = function () {
    var stage = $slg.battleInfo().getStage(this.stageId());
    if (stage.isGainReward()) {
      console.error("すでに報酬を受取済みです");
      return;
    }
    stage.gainReward();
    for (var _i = 0, _a = this.rewardList(); _i < _a.length; _i++) {
      var r = _a[_i];
      r.gainReward();
    }
  };
  return PlaceStage;
})();
var PlaceRewardType;
(function (PlaceRewardType) {
  PlaceRewardType["gold"] = "gold";
  PlaceRewardType["sw"] = "sw";
})(PlaceRewardType || (PlaceRewardType = {}));
var PlaceReward = /** @class */ (function () {
  function PlaceReward(itemId, type, value) {
    this._itemId = itemId;
    this._type = type;
    this._value = value;
  }
  PlaceReward.prototype.type = function () {
    return this._type;
  };
  PlaceReward.prototype.value = function () {
    return this._value;
  };
  PlaceReward.prototype.swDescription = function () {
    if (this._itemId == 31) {
      // マリナの家付近の基地
      return "決戦が可能になります";
    }
    if (this._value == 213) {
      // ノノカの学校
      return "ノノカのAV撮影解放";
    }
    if (this._value == 218) {
      // ２面決戦開始
      return "マリナの息子を捕らえることができます";
    }
    if (this._value == 219) {
      // ２面決戦勝利
      return "マリナを捕らえることができます";
    }
    return "";
  };
  PlaceReward.prototype.gainReward = function () {
    switch (this._type) {
      case PlaceRewardType.gold:
        $gameParty.gainGold(this._value);
        break;
    }
  };
  return PlaceReward;
})();
var Nore;
(function (Nore) {
  var STAGE_VAR = 2;
  var MILITATY_TOP_OFFSET = 60;
  var MilitaryCommand;
  (function (MilitaryCommand) {
    MilitaryCommand["formation"] = "formation";
    MilitaryCommand["battle1"] = "battle1";
    MilitaryCommand["battle2"] = "battle2";
    MilitaryCommand["battle3"] = "battle3";
    MilitaryCommand["boss"] = "boss";
  })((MilitaryCommand = Nore.MilitaryCommand || (Nore.MilitaryCommand = {})));
  var Window_Military = /** @class */ (function (_super) {
    __extends(Window_Military, _super);
    //_towerWindow: Window_TowerInfo;
    function Window_Military() {
      var _this = this;
      var r = new Rectangle(
        Nore.MAIN_MENU_W,
        Nore.TOP_Y,
        580,
        800 - Nore.TOP_Y
      );
      _this = _super.call(this, r) || this;
      _this.setHandler("change", _this.onChange.bind(_this));
      _this.refresh();
      _this.createDetailWindow();
      _this.autoSelect();
      return _this;
      //this._towerWindow = new Window_TowerInfo();
      //this.addChild(this._towerWindow);
    }
    Window_Military.prototype.createDetailWindow = function () {
      this._detailWindow = new Window_MilitaryDetail();
      this.addChild(this._detailWindow);
    };
    Window_Military.prototype.autoSelect = function () {
      for (var i = 0; i < this._dataList.length; i++) {
        var place = this._dataList[i];
        var placeStage = place.currentPlaceStage();
        var isCurretPlace =
          $slg.clicker().currentStageId() == placeStage.stageId();
        if (isCurretPlace) {
          this.select(i);
          return;
        }
      }
      this.select(0);
    };
    Window_Military.prototype.select = function (index) {
      _super.prototype.select.call(this, index);
      var place = this.selectedPlace();
      if (!place) {
        return;
      }
      this._detailWindow.setPlace(place);
    };
    Window_Military.prototype.refresh = function () {
      this._windowContentsSprite.removeChildren();
      this.makeItems();
      _super.prototype.refresh.call(this);
      this.drawTitle();
      this.onChange();
    };
    Window_Military.prototype.makeItems = function () {
      this._dataList = [];
      this._dataList.push(new Place(1)); // アンテナ基地
      if ($gameSwitches.value(245) && $slg.stage() == 1) {
        this._dataList.push(new Place(6)); // ノノカ
      }
      if ($slg.stage() >= 2) {
        this._dataList.push(new Place(11)); // 防衛施設
      }
      if ($gameSwitches.value(328)) {
        this._dataList.push(new Place(31)); // 怪人王の研究所
      }
      if ($gameActors.actor(9).countSyusan() > 0) {
        this._dataList.push(new Place(21)); // A区のヒーロー駐屯所
      }
      if ($gameSwitches.value(241)) {
        this._dataList.push(new Place(23)); // A区の基地
      }
      if ($gameSwitches.value(265)) {
        // ミユのHイベント
        this._dataList.push(new Place(26)); // 洗脳施設
      }
      if ($gameSwitches.value(216)) {
        this._dataList.push(new Place(41)); //　マリナの家付近
      }
      if ($gameSwitches.value(242)) {
        this._dataList.push(new Place(16)); // 公園の基地
      }
      if ($gameSwitches.value(218)) {
        this._dataList.push(new Place(51)); //マリナと決戦
      } else {
        if ($gameSwitches.value(216)) {
          this._dataList.push(new Place(50)); //マリナと戦い
        }
      }
      if ($gameSwitches.value(355)) {
        this._dataList.push(new Place(55)); //マリナと決戦
      }
      if ($gameSwitches.value(229)) {
        this._dataList.push(new Place(53)); //サキと決戦
      }
      if ($gameSwitches.value(1084)) {
        this._dataList.push(new Place(56)); //マリナの高校
      }
      if ($gameSwitches.value(1159)) {
        this._dataList.push(new Place(62)); //サキの中学
      }
      if ($gameSwitches.value(235)) {
        this._dataList.push(new Place(54)); //ココナと決戦
      }
      if ($gameSwitches.value(240)) {
        this._dataList.push(new Place(80)); // 防衛施設
      }
      if ($gameSwitches.value(249)) {
        this._dataList.push(new Place(70)); //ヒーロー本部
      }
      if ($gameSwitches.value(327)) {
        this._dataList.push(new Place(100)); //最終決戦
      }
      if ($slg.stage() >= 2 && $gameSwitches.value(346)) {
        this._dataList.push(new Place(64)); //さらしもの(ノノカ)
      }
      if ($slg.stage() >= 3 && $gameSwitches.value(347)) {
        this._dataList.push(new Place(65)); //さらしもの(マリナ)
      }
      if ($slg.stage() >= 4 && $gameSwitches.value(348)) {
        this._dataList.push(new Place(66)); //さらしもの(サキ)
      }
      if ($slg.stage() >= 5 && $gameSwitches.value(349)) {
        this._dataList.push(new Place(67)); //さらしもの(ココナ)
      }
      if ($gameSwitches.value(332)) {
        this._dataList.push(new Place(90)); // Dr.ゲーリー
      }
      this.removeClearedPlace();
      this.sortPlace();
    };
    Window_Military.prototype.sortPlace = function () {
      this._dataList = this._dataList.sort(function (a, b) {
        if (a.difficulty() == b.difficulty()) {
          return a.orderId() - b.orderId();
        }
        return a.difficulty() - b.difficulty();
      });
    };
    Window_Military.prototype.removeClearedPlace = function () {
      var list = [];
      for (var _i = 0, _a = this._dataList; _i < _a.length; _i++) {
        var place = _a[_i];
        if (!place.isClear()) {
          list.push(place);
        }
      }
      this._dataList = list;
    };
    Window_Military.prototype.maxItems = function () {
      if (!this._dataList) {
        return 0;
      }
      return this._dataList.length;
    };
    Window_Military.prototype.drawTitle = function () {
      this.changeTextColor(ColorManager.normalColor());
      {
        var r = new Rectangle(0, 392, 170, 32);
        if (ConfigManager.language == "en") {
          r.y += 32;
        }
        var s = this.getSprite(r.x, r.y, r.width, r.height);
        s.x = 55;
        s.y = 30;
        this.addChild(s);
      }
      {
        var r = new Rectangle(180, 392, 270, 32);
        if (ConfigManager.language == "en") {
          r.y += 32;
        }
        var s = this.getSprite(r.x, r.y, r.width, r.height);
        s.x = 300;
        s.y = 30;
        this.addChild(s);
      }
      //this.drawText(TextManager.selectTarget, 20, 10, 200);
      //this.drawText(TextManager.battleDifficulty, 310, 10, 200, 'right');
    };
    Window_Military.prototype.getSprite = function (x, y, w, h) {
      var baseTexture = Nore.getSystemBaseTexture("gacha");
      var r = new Rectangle(x, y, w, h);
      var texture = new PIXI.Texture(baseTexture, r);
      var s = new PIXI.Sprite(texture);
      return s;
    };
    Window_Military.prototype.addBg = function () {};
    Window_Military.prototype.itemHeight = function () {
      return 112;
    };
    Window_Military.prototype.itemRect = function (index) {
      var r = _super.prototype.itemRect.call(this, index);
      r.y += MILITATY_TOP_OFFSET;
      return r;
    };
    Window_Military.prototype.overallHeight = function () {
      return _super.prototype.overallHeight.call(this) + MILITATY_TOP_OFFSET;
    };
    Window_Military.prototype.maxCols = function () {
      return 1;
    };
    Window_Military.prototype.canBattle = function () {
      return $slg.nextTroopId() > 0;
    };
    Window_Military.prototype.rowSpacing = function () {
      return 8;
    };
    Window_Military.prototype.drawItem = function (index) {
      this.contents.fontSize = 16;
      this.changeTextColor(ColorManager.normalColor());
      var rect = this.itemRect(index);
      var place = this._dataList[index];
      var placeStage = place.currentPlaceStage();
      var isCurretPlace =
        $slg.clicker().currentStageId() == placeStage.stageId();
      if (isCurretPlace) {
        this.contents.fillRect(
          rect.x,
          rect.y,
          rect.width,
          rect.height,
          "#FFFF0044"
        );
      }
      {
        var s = this.getSprite(0, 457, 464, 3);
        s.x = 82 + rect.x;
        s.y = 48 + rect.y;
        this._windowContentsSprite.addChild(s);
      }
      //this.drawBattleStatus(placeStage, rect, isCurretPlace);
      this.drawStage(rect.x + 10, place, rect);
      this.drawClearReward(rect.x + 72, place, rect);
      this.drawName(rect.x + 16, place, rect);
      this.drawDifficulty(place, rect);
      this.drawTaikenbanNg(place, rect);
    };
    Window_Military.prototype.drawTaikenbanNg = function (place, rect) {
      if ($gameSystem.isTaikenbanOkBattle(place.enemyId())) {
        return;
      }
      this.contents.fontSize = 14;
      this.changeTextColor(ColorManager.deathColor());
      this.drawText("体験版では選択できません", rect.x + 62, rect.y - 17, 200);
    };
    Window_Military.prototype.drawBattleStatus = function (
      placeStage,
      rect,
      isCurretPlace
    ) {
      if (isCurretPlace) {
        this.drawText("戦闘中", rect.x + 2, rect.y - 5, 100);
      }
    };
    Window_Military.prototype.drawStage = function (x, place, rect) {
      var paramY = -5;
      this.drawText(
        place.step() + "/" + place.maxStep(),
        x,
        rect.y + paramY,
        rect.width,
        "left"
      );
    };
    Window_Military.prototype.drawClearReward = function (x, place, rect) {
      this.contents.fontSize = 15;
      var paramY = 42;
      var xx = 60;
      this.changeTextColor(ColorManager.crisisColor());
      this.drawText(
        TextManager.areaReward,
        x,
        rect.y + paramY,
        rect.width,
        "left"
      );
      var list = place.rewardList();
      var rewardY = paramY;
      this.changeTextColor(ColorManager.normalColor());
      for (var _i = 0, list_2 = list; _i < list_2.length; _i++) {
        var r = list_2[_i];
        var rewardX = rect.x + 120 + xx;
        if (r.type() == PlaceRewardType.gold) {
          this.drawIcon(Icon.gold, rewardX, rect.y + rewardY + 2);
          this.drawText(
            r.value(),
            rewardX - 40,
            rect.y + rewardY,
            100,
            "right"
          );
        }
      }
      var desc = place.rewardDesc();
      if (desc) {
        rewardY += 25;
        this.changeTextColor(ColorManager.crisisColor());
        this.drawText(
          TextManager.clearReward,
          x,
          rect.y + rewardY,
          rect.width,
          "left"
        );
        this.changeTextColor(ColorManager.normalColor());
        this.drawText(
          place.rewardDesc(),
          rect.x + 124 + xx,
          rect.y + rewardY,
          380,
          "left"
        );
      }
    };
    Window_Military.prototype.drawDifficulty = function (place, rect) {
      var x = rect.x + 400;
      var y = rect.y + 0;
      var offset = 0;
      for (var i = 0; i < place.difficulty(); i++) {
        this.drawIcon(407, x + offset, y);
        offset += 26;
      }
    };
    Window_Military.prototype.drawName = function (x, place, rect) {
      this.contents.fontSize = 20;
      this.drawIconBig(place.iconIndex(), x, rect.y + 23);
      this.drawText(place.name(), x + 54, rect.y + 0, rect.width - 200);
      var stage = place.currentStage();
      if (!stage) {
        return;
      }
    };
    Window_Military.prototype.drawIconBig = function (index, x, y) {
      var bitmap = ImageManager.loadSystem("IconSet");
      var pw = ImageManager.iconWidth;
      var ph = ImageManager.iconHeight;
      var iconIndex = 64 + index * 2;
      var sx = (iconIndex % 16) * pw;
      var sy = Math.floor(64 / 16) * ph + Math.floor(index / 8) * ph * 3;
      this.contents.blt(bitmap, sx, sy, pw * 2, ph * 2 + 10, x, y);
    };
    Window_Military.prototype.onChange = function () {
      //this._windowContentsSprite.removeChildren();
      var index = this.index();
      //this.drawTroop(troopId);
    };
    Window_Military.prototype.decide = function () {
      var place = this.selectedPlace();
      if ($slg.clickerStage().enemyId() == place.currentStage().enemyId()) {
        return -1;
      }
      var reserveCommon = $slg.clicker().start(place.currentStage().enemyId());
      this.refresh();
      return reserveCommon;
    };
    Window_Military.prototype.isCurrentItemEnabled = function () {
      var place = this.selectedPlace();
      if (!place) {
        return false;
      }
      if (!$gameSystem.isTaikenbanOkBattle(place.enemyId())) {
        return false;
      }
      var placeStage = place.currentPlaceStage();
      var isCurretPlace =
        $slg.clicker().currentStageId() == placeStage.stageId();
      if (isCurretPlace) {
        return false;
      }
      return !place.isClear();
    };
    Window_Military.prototype.selectedPlace = function () {
      if (!this._dataList) {
        return null;
      }
      return this._dataList[this.index()];
    };
    return Window_Military;
  })(Window_Selectable);
  Nore.Window_Military = Window_Military;
})(Nore || (Nore = {}));
var HeroEnemy = /** @class */ (function () {
  function HeroEnemy(enemyId) {
    this._enemyId = enemyId;
  }
  HeroEnemy.prototype.battlerName = function () {
    return this.enemy().battlerName;
  };
  HeroEnemy.prototype.enemy = function () {
    return $dataEnemies[this._enemyId];
  };
  HeroEnemy.prototype.hp = function () {
    return this.enemy().params[0];
  };
  HeroEnemy.prototype.atk = function () {
    return this.enemy().params[2];
  };
  HeroEnemy.prototype.spd = function () {
    return Math.floor(AGI_BASE_VALUE / this.enemy().params[6]);
  };
  HeroEnemy.prototype.element = function () {
    for (var _i = 0, _a = this.enemy().traits; _i < _a.length; _i++) {
      var t = _a[_i];
      if (t.code == 11) {
        if (t.dataId == 2) {
          return MonsterElement.flame;
        }
        if (t.dataId == 3) {
          return MonsterElement.water;
        }
        if (t.dataId == 4) {
          return MonsterElement.wood;
        }
      }
    }
    return MonsterElement.none;
  };
  return HeroEnemy;
})();


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 Window_MilitaryDetail = /** @class */ (function (_super) {
  __extends(Window_MilitaryDetail, _super);
  function Window_MilitaryDetail() {
    var _this = this;
    var r = new Rectangle(580, 0, 520, 800 - Nore.TOP_Y);
    _this = _super.call(this, r) || this;
    _this._sprite1 = new Sprite_MilitaryEnemy(0);
    _this.addChild(_this._sprite1);
    _this._sprite2 = new Sprite_MilitaryEnemy(1);
    _this.addChild(_this._sprite2);
    _this._sprite1.visible = false;
    _this._sprite2.visible = false;
    return _this;
  }
  Window_MilitaryDetail.prototype.setPlace = function (place) {
    if (this._place == place) {
      return;
    }
    this._place = place;
    this.refresh();
  };
  Window_MilitaryDetail.prototype.refresh = function () {
    this.contents.clear();
    this.refreshImage();
    this.refreshDescription();
  };
  Window_MilitaryDetail.prototype.refreshImage = function () {
    var enemyId = this._place.currentPlaceStage().enemyId();
    var troop = $dataTroops[enemyId];
    if (!troop) {
      return;
    }
    if (troop.members[0]) {
      var hero = new ClickerEnemy(troop.members[0].enemyId);
      this._sprite1.setBattler(hero);
      this._sprite1.visible = true;
    }
    if (troop.members[1]) {
      var hero = new ClickerEnemy(troop.members[1].enemyId);
      this._sprite2.setBattler(hero);
      this._sprite2.visible = true;
    } else {
      this._sprite2.visible = false;
    }
  };
  Window_MilitaryDetail.prototype.enemy = function () {
    var enemyId = this._place._enemyId;
    return new ClickerEnemy(enemyId);
  };
  Window_MilitaryDetail.prototype.refreshDescription = function () {
    if (this.enemy().enemy().meta["enemyDesc"]) {
      var desc = this.enemy().enemy().meta["enemyDesc"];
      var text = TextManager["enemyDesc" + desc];
      var texts = text.split("\n");
      this.contents.textColor = ColorManager.normalColor();
      this.contents.fontSize = 19;
      var y = 30;
      for (var _i = 0, texts_1 = texts; _i < texts_1.length; _i++) {
        var t = texts_1[_i];
        this.contents.drawText(t, 10, y, 480, 40, "center");
        y += 26;
      }
    }
  };
  return Window_MilitaryDetail;
})(Window_Base);
var Sprite_MilitaryEnemy = /** @class */ (function (_super) {
  __extends(Sprite_MilitaryEnemy, _super);
  function Sprite_MilitaryEnemy(index) {
    var _this = _super.call(this) || this;
    _this.bitmap = new Bitmap(350, 740);
    _this._index = index;
    _this.addLabel();
    _this._enemySprite = new Sprite_PlaceEnemy();
    _this.addChild(_this._enemySprite);
    _this.x = index * 236 + 22;
    _this.y = 100;
    return _this;
  }
  Sprite_MilitaryEnemy.prototype.setBattler = function (enemy) {
    this.bitmap.clear();
    this._enemy = enemy;
    this._enemySprite.setBattler(enemy, 30);
    this.refreshStatus();
    this.refreshSkill();
  };
  Sprite_MilitaryEnemy.prototype.addLabel = function () {
    var s = this.getSprite(0, 297, 56, 96);
    s.x = 30;
    s.y = 350;
    this.addChild(s);
    {
      var s_1 = this.getSprite(96, 380, 200, 3);
      s_1.x = 32;
      s_1.y = 448;
      this.addChild(s_1);
    }
    {
      var s_2 = this.getSprite(96, 265, 100, 30);
      s_2.x = 33;
      s_2.y = 460;
      this.addChild(s_2);
    }
  };
  Sprite_MilitaryEnemy.prototype.refreshStatus = function () {
    this.bitmap.fontSize = 20;
    var enemy = this._enemy;
    this.bitmap.textColor = ColorManager.normalColor();
    var hpRateStr = enemy.enemy().meta["hpRate"];
    var hpRate = 100;
    if (hpRateStr) {
      hpRate = parseInt(hpRateStr);
    }
    this.drawStatus("HP", enemy.mhp(), 0, hpRate);
    var atkRate = 100;
    if (hpRate < 100) {
      atkRate = 75;
    }
    this.drawStatus(
      "ATK",
      Math.round((enemy.atk() / atkRate) * 100),
      1,
      atkRate
    );
    if (enemy.enemyId() == 53) {
      // サキだけはSPDが下がったようにみせる
      var rate = 0.4;
      this.drawStatus("SPD", Math.round(enemy.spd() / rate), 2, rate * 100);
    } else {
      this.drawStatus("SPD", enemy.spd(), 2);
    }
  };
  Sprite_MilitaryEnemy.prototype.getSprite = function (x, y, w, h) {
    var baseTexture = Nore.getSystemBaseTexture("gacha");
    var r = new Rectangle(x, y, w, h);
    var texture = new PIXI.Texture(baseTexture, r);
    var s = new PIXI.Sprite(texture);
    return s;
  };
  Sprite_MilitaryEnemy.prototype.drawStatus = function (
    label,
    value,
    yIndex,
    rate
  ) {
    if (rate === void 0) {
      rate = 100;
    }
    var top = 340 + yIndex * 35;
    var left = 50;
    var w = 156;
    this.bitmap.textColor = ColorManager.systemColor();
    this.bitmap.textColor = ColorManager.normalColor();
    this.bitmap.drawText(value, left, top, w, 40, "right");
    if (rate < 100) {
      this.bitmap.drawText(
        "→ " + Math.round((value * rate) / 100),
        left + 80,
        top,
        w,
        40,
        "right"
      );
    }
  };
  Sprite_MilitaryEnemy.prototype.refreshSkill = function () {
    this.bitmap.textColor = ColorManager.normalColor();
    var skillList = this._enemy.skills();
    //p(skillList)
    for (var i = 0; i < skillList.length; i++) {
      this.drawSkill(skillList[i], i);
    }
  };
  Sprite_MilitaryEnemy.prototype.drawSkill = function (skill, index) {
    var top = 484 + index * 200;
    var left = 34;
    this.bitmap.textColor = ColorManager.normalColor();
    this.bitmap.fontSize = 19;
    //this.bitmap.fontBold = true;
    this.bitmap.drawText(this.skillName(skill), left, top, 170, 40);
    this.bitmap.fontBold = false;
    this.bitmap.fontSize = 15;
    var texts = this.skillDescription(skill).split("\n");
    var value = this.skillValue(skill);
    top += 28;
    this.bitmap.drawText(texts[0].format(value), left, top, 190, 40);
    if (texts.length > 1) {
      this.bitmap.drawText(texts[1].format(value), left, top + 24, 190, 40);
    }
    this.bitmap.textColor = "#f3de67";
    this.bitmap.drawText(TextManager.probability, left, top + 25 * 2, 150, 40);
    this.bitmap.textColor = "#84ecff";
    this.bitmap.drawText(
      skill.successRate + "％",
      left,
      top + 25 * 2,
      128,
      40,
      "right"
    );
  };
  Sprite_MilitaryEnemy.prototype.skillName = function (skill) {
    if (ConfigManager.language == "en") {
      if (skill.meta["nameEn"]) {
        return skill.meta["nameEn"];
      }
    }
    return skill.name;
  };
  Sprite_MilitaryEnemy.prototype.skillValue = function (skill) {
    if (skill.meta["damage"]) {
      return skill.meta["damage"];
    }
    return "";
  };
  Sprite_MilitaryEnemy.prototype.skillDescription = function (skill) {
    if (ConfigManager.language == "en") {
      if (skill.meta["descEn"]) {
        return skill.meta["descEn"];
      }
      if (skill.meta["desc1En"]) {
        if (skill.meta["desc2En"]) {
          return skill.meta["desc1En"] + "\n" + skill.meta["desc2En"];
        } else {
          return skill.meta["desc1En"];
        }
      }
    }
    return skill.description;
  };
  return Sprite_MilitaryEnemy;
})(Sprite_Clickable);
var Sprite_PlaceEnemy = /** @class */ (function (_super) {
  __extends(Sprite_PlaceEnemy, _super);
  function Sprite_PlaceEnemy() {
    return (_super !== null && _super.apply(this, arguments)) || this;
  }
  Sprite_PlaceEnemy.prototype.setBattler = function (enemy, offsetY) {
    if (offsetY === void 0) {
      offsetY = 0;
    }
    this._enemy = enemy;
    this._offsetY = offsetY;
    this._name = enemy.battlerName();
    if (this._name) {
      this.visible = false;
      this.bitmap = ImageManager.loadEnemy(this._name);
      this.updateOutline();
    }
  };
  Sprite_PlaceEnemy.prototype.update = function () {
    _super.prototype.update.call(this);
    this.updateBitmap();
    this.updatePosition();
  };
  Sprite_PlaceEnemy.prototype.updateOutline = function () {
    var filter3 = new PIXI.filters.OutlineFilter(3, this.pixiColor());
    this.filters = [filter3];
  };
  Sprite_PlaceEnemy.prototype.pixiColor = function () {
    switch (this._enemy.element()) {
      case MonsterElement.flame:
        return MonsterElementColor.flame;
      case MonsterElement.water:
        return MonsterElementColor.water;
      case MonsterElement.wood:
        return MonsterElementColor.wood;
    }
    return 0x888888;
  };
  Sprite_PlaceEnemy.prototype.updateBitmap = function () {
    if (!this._name) {
      return;
    }
    if (!this.bitmap) {
      return;
    }
    this.bitmap = ImageManager.loadEnemy(this._name);
    if (this.bitmap.isReady() && this.bitmap.width > 10) {
      this.visible = true;
    }
  };
  Sprite_PlaceEnemy.prototype.updatePosition = function () {
    if (!this.bitmap) {
      return;
    }
    this.x = (250 - this.bitmap.width) / 2;
    this.y = 300 - this.bitmap.height + this._offsetY;
  };
  return Sprite_PlaceEnemy;
})(Sprite_Clickable);

repo_name: onms/dead

license: unknown


code:
/*:ja
 * @target MZ
 * @author ル
 *
 *
 * @command taneoyaName
 * @text 種親の名前を設定
 * @des 種親の名前を設定
 * @arg actorId
 * @type number
 * @text actorId
 * @desc actorId
 *
 * @command taneoyaType
 * @text 種親のタイプをキャラごとの変数に設定
 * @des 種親のタイプをキャラごとの変数に設定
 * @arg actorId
 * @type number
 * @text actorId
 * @desc actorId
 */
var Nore;
(function (Nore) {
  var pluginName = "Nore_Ninshin";
  PluginManager.registerCommand(pluginName, "ninshin", function (args) {
    var actorId = parseInt(args.actorId);
    var actor = $gameActors.actor(actorId);
    if (actor.isBote()) {
      return;
    }
    var time = actor.calcNinshinTime();
    var taneoyaId = $gameTemp.av.mainManId();
    actor.ninshin(taneoyaId);
    var e = new NinshinTimeGaugeEvent(actorId, time, taneoyaId);
    $slg.addTimeGaugeEvent(e);
  });
  PluginManager.registerCommand(pluginName, "taneoyaName", function (args) {
    var actorId = parseInt(args.actorId);
    var actor = $gameActors.actor(actorId);
    var ninshinCount = actor.babyList().length;
    var baby = actor.lastBaby();
    if ($gameSwitches.value(999)) {
      // 回想中
      baby = new Baby(actorId, 19);
      ninshinCount = 2;
    }
    var taneoya = $gameActors.actor(baby.taneoyaId());
    var taneoyaNameVar = 52;
    var ninshinCountVar = 53;
    var name = taneoya.name();
    $gameVariables.setValue(taneoyaNameVar, name);
    $gameVariables.setValue(ninshinCountVar, ninshinCount);
  });
  PluginManager.registerCommand(pluginName, "taneoyaType", function (args) {
    var actorId = parseInt(args.actorId);
    switch (actorId) {
      case 4:
        $gameVariables.setValue(144, taneoyaType4());
        return;
      case 8:
        $gameVariables.setValue(145, taneoyaType8());
        return;
      case 9:
        $gameVariables.setValue(143, taneoyaType9());
        return;
      case 13:
        $gameVariables.setValue(142, taneoyaType13());
        return;
      case 17:
        $gameVariables.setValue(141, taneoyaType17());
        return;
      default:
        console.error(actorId + "の設定が見つかりません");
    }
  });
  function taneoyaType4() {
    var actor = $gameActors.actor(4);
    var taneoyaId = actor.lastBaby().taneoyaId();
    if (taneoyaId == 5) {
      // レン
      return 0;
    }
    if (taneoyaId == 20) {
      // タロウ
      return 1;
    }
    if (MAN_PARAMS[taneoyaId]) {
      return 2;
    }
    return 3;
  }
  function taneoyaType8() {
    var actor = $gameActors.actor(8);
    var taneoyaId = actor.lastBaby().taneoyaId();
    if (taneoyaId == 5) {
      // レン
      return 0;
    }
    return 1;
  }
  function taneoyaType9() {
    var actor = $gameActors.actor(9);
    var taneoyaId = actor.lastBaby().taneoyaId();
    if (taneoyaId == 19) {
      // ブスジマ
      return 0;
    }
    if (MAN_PARAMS[taneoyaId]) {
      return 1;
    }
    return 2;
  }
  function taneoyaType13() {
    var actor = $gameActors.actor(13);
    var taneoyaId = actor.lastBaby().taneoyaId();
    if (taneoyaId == 16) {
      // カスゾウ
      return 0;
    }
    if (MAN_PARAMS[taneoyaId]) {
      return 1;
    }
    return 2;
  }
  function taneoyaType17() {
    var actor = $gameActors.actor(17);
    var taneoyaId = actor.lastBaby().taneoyaId();
    if (taneoyaId == 21) {
      // オリバー
      return 0;
    }
    if (MAN_PARAMS[taneoyaId]) {
      return 1;
    }
    return 2;
  }
})(Nore || (Nore = {}));
function getSenriNinshinScenarioId(actor) {
  if (actor.dousei().isSkipBoteEvent()) {
    return "センリ_妊娠スキップ_01";
  }
  switch (actor.countSyusan()) {
    case 0:
      return "センリ_妊娠_01";
    default:
      return "センリ_妊娠_02";
  }
}
function getNonokaNinshinScenarioId(actor) {
  if (actor.dousei().isSkipBoteEvent()) {
    return "ノノカ_妊娠スキップ_01";
  }
  switch (actor.countSyusan()) {
    case 0:
      return "ノノカ_妊娠_01";
    default:
      return "ノノカ_妊娠_02";
  }
}
function getMarinaNinshinScenarioId(actor) {
  if (actor.dousei().isSkipBoteEvent()) {
    return "マリナ_妊娠スキップ_01";
  }
  switch (actor.countSyusan()) {
    case 1:
      return "マリナ_妊娠_01";
    default:
      return "マリナ_妊娠_02";
  }
}
function getSakiNinshinScenarioId(actor) {
  if (actor.dousei().isSkipBoteEvent()) {
    return "サキ_妊娠スキップ_01";
  }
  switch (actor.countSyusan()) {
    case 0:
      return "サキ_妊娠_01";
    default:
      return "サキ_妊娠_02";
  }
}
function getKokonaNinshinScenarioId(actor) {
  if (actor.dousei().isSkipBoteEvent()) {
    return "ココナ_妊娠スキップ_01";
  }
  switch (actor.countSyusan()) {
    case 0:
      return "ココナ_妊娠_01";
    default:
      return "ココナ_妊娠_02";
  }
}
function getMiyuNinshinScenarioId(actor) {
  if (actor.dousei().isSkipBoteEvent()) {
    return "ミユ_妊娠スキップ_01";
  }
  switch (actor.countSyusan()) {
    case 0:
      return "ミユ_妊娠_01";
    default:
      return "ミユ_妊娠_02";
  }
}
function getKanamiNinshinScenarioId(actor) {
  if (actor.dousei().isSkipBoteEvent()) {
    return "カナミ_妊娠スキップ_01";
  }
  switch (actor.countSyusan()) {
    case 0:
      return "カナミ_妊娠_01";
    default:
      return "カナミ_妊娠_02";
  }
}


code:
var LANGUAGE_LIST = [
  "jp",
  "en",
  //   'ch',
];
Scene_Options.prototype.optionsWindowRect = function () {
  var n = Math.min(this.maxCommands(), this.maxVisibleCommands());
  var ww = 560;
  var wh = this.calcWindowHeight(n, true);
  var wx = (Graphics.boxWidth - ww) / 2;
  var wy = (Graphics.boxHeight - wh) / 2;
  return new Rectangle(wx, wy, ww, wh);
};
Window_Options.prototype.volumeOffset = function () {
  return 2;
};
ConfigManager.showSikyu = true;
ConfigManager.rightClickSkip = true;
ConfigManager.battleSe = true;
ConfigManager.gameActive = false;
ConfigManager.skipKey = true;
ConfigManager.windowAlpha = 92;
ConfigManager.autoSpeed = 1;
ConfigManager.autoTimeEvent = true;
ConfigManager.openRecollection = false;
ConfigManager.simpleMenu = false;
ConfigManager.outerTransparentEnabled = false;
Window_Options.prototype.addGeneralOptions = function () {
  this.addCommand(TextManager._alwaysDash, "alwaysDash");
  this.addCommand(TextManager.showSikyu, "showSikyu");
  //this.addCommand(TextManager.commandRemember, "commandRemember");
  //this.addCommand(TextManager._touchUI, "touchUI");
  this.addCommand(TextManager.battleSe, "battleSe");
  this.addCommand(TextManager.language, "language");
  this.addCommand(TextManager.windowAlpha, "windowAlpha");
  this.addCommand(TextManager.rightClickSkip, "rightClickSkip");
  this.addCommand(TextManager.skipKey, "skipKey");
  this.addCommand(TextManager.autoSpeed, "autoSpeed");
  this.addCommand(TextManager.autoTimeEvent, "autoTimeEvent");
  this.addCommand(TextManager.simpleMenu, "simpleMenu");
  this.addCommand(
    TextManager.outerTransparentEnabled,
    "outerTransparentEnabled"
  );
  //this.addCommand(TextManager.gameActive, "gameActive");
};
Window_Options.prototype.addVolumeOptions = function () {
  this.addCommand(TextManager._bgmVolume, "bgmVolume");
  //this.addCommand(TextManager._bgsVolume, "bgsVolume");
  //this.addCommand(TextManager._meVolume, "meVolume");
  this.addCommand(TextManager._seVolume, "seVolume");
  this.addCommand("OK", "ok");
  //this.addCommand(TextManager._voiceVolume, "voiceVolume");
};
Window_Options.prototype.isVolumeSymbol = function (symbol) {
  if (symbol.includes("Alpha")) {
    return true;
  }
  return symbol.includes("Volume");
};
var _ConfigManager_makeData = ConfigManager.makeData;
ConfigManager.makeData = function () {
  var config = _ConfigManager_makeData.call(this);
  config.voiceVolume = this.voiceVolume;
  config.language = this.language;
  config.showSikyu = this.showSikyu;
  config.confirmEnter = this.confirmEnter;
  config.windowAlpha = this.windowAlpha;
  config.skipKey = this.skipKey;
  config.rightClickSkip = this.rightClickSkip;
  config.battleSe = this.battleSe;
  config.gameActive = this.gameActive;
  config.autoSpeed = this.autoSpeed;
  config.autoTimeEvent = this.autoTimeEvent;
  config.openRecollection = this.openRecollection;
  config.simpleMenu = this.simpleMenu;
  config.outerTransparentEnabled = this.outerTransparentEnabled;
  return config;
};
var _ConfigManager_applyData = ConfigManager.applyData;
ConfigManager.applyData = function (config) {
  _ConfigManager_applyData.call(this, config);
  this.voiceVolume = this.readVolume(config, "voiceVolume");
  this.windowAlpha = this.readVolume(config, "windowAlpha");
  this.language = this.readLanguage(config, "language");
  this.showSikyu = this.readFlag(config, "showSikyu", true);
  this.skipKey = this.readFlag(config, "skipKey", true);
  this.rightClickSkip = this.readFlag(config, "rightClickSkip", true);
  this.confirmEnter = this.readFlag(config, "confirmEnter", true);
  this.battleSe = this.readFlag(config, "battleSe", true);
  this.gameActive = this.readFlag(config, "gameActive", true);
  this.autoSpeed = this.readAutoSpeed(config, "autoSpeed");
  this.autoTimeEvent = this.readFlag(config, "autoTimeEvent");
  this.openRecollection = this.readFlag(config, "openRecollection");
  this.simpleMenu = this.readFlag(config, "simpleMenu");
  this.outerTransparentEnabled = this.readFlag(
    config,
    "outerTransparentEnabled"
  );
};
ConfigManager.readLanguage = function (config, name) {
  if (name in config) {
    return config[name];
  } else {
    return "jp";
  }
};
ConfigManager.readAutoSpeed = function (config, name) {
  if (name in config) {
    return Number(config[name]).clamp(0, 4);
  } else {
    return 1;
  }
};
Object.defineProperty(ConfigManager, "voiceVolume", {
  get: function () {
    return AudioManager._voiceVolume;
  },
  set: function (value) {
    AudioManager._voiceVolume = value;
  },
  configurable: true,
});
Scene_Options.prototype.maxCommands = function () {
  // Increase this value when adding option items.
  return 14;
};
Scene_Options.prototype.maxVisibleCommands = function () {
  return 14;
};
var _Scene_Options_prototype_createOptionsWindow =
  Scene_Options.prototype.createOptionsWindow;
Scene_Options.prototype.createOptionsWindow = function () {
  _Scene_Options_prototype_createOptionsWindow.call(this);
  this._optionsWindow.setHandler("language", this.onLanguage.bind(this));
  //this._optionsWindow.setHandler("autoSpeed", this.onAutoSpeed.bind(this));
};
Scene_Options.prototype.onLanguage = function () {
  switch (ConfigManager.language) {
    case "en":
      initVocabEn();
      break;
    case "jp":
      initVocabJp();
      break;
    case "ch":
      //initVocabCh();
      break;
  }
  this._optionsWindow.makeCommandList();
  this._optionsWindow.refresh();
};
Window_Options.prototype.changeValue = function (symbol, value) {
  var lastValue = this.getConfigValue(symbol);
  if (lastValue !== value) {
    this.setConfigValue(symbol, value);
    this.redrawItem(this.findSymbol(symbol));
    this.playCursorSound();
    if (symbol == "language") {
      ConfigManager.language = value;
      this.callHandler("language");
    }
  }
};
var _Window_Options_prototype_drawItem = Window_Options.prototype.drawItem;
Window_Options.prototype.drawItem = function (index) {
  var title = this.commandName(index);
  if (title != "OK") {
    _Window_Options_prototype_drawItem.call(this, index);
    return;
  }
  var rect = this.itemLineRect(index);
  this.resetTextColor();
  this.changePaintOpacity(this.isCommandEnabled(index));
  this.drawText(title, rect.x, rect.y, rect.width, "center");
};
Window_Options.prototype.statusText = function (index) {
  var symbol = this.commandSymbol(index);
  var value = this.getConfigValue(symbol);
  if (this.isSkipKeySymbol(symbol)) {
    return this.skipStatusText(value);
  } else if (this.isAutoSpeedSymbol(symbol)) {
    return this.autoSpeedText(value);
  } else if (this.isLanguageSymbol(symbol)) {
    return this.languageStatusText(value);
  } else if (this.isVolumeSymbol(symbol)) {
    return this.volumeStatusText(value);
  } else {
    return this.booleanStatusText(value);
  }
};
Window_Options.prototype.skipStatusText = function (value) {
  if (value) {
    return "ctrl";
  } else {
    return "shift";
  }
};
Window_Options.prototype.autoSpeedText = function (value) {
  switch (value) {
    case 0:
      return TextManager.autoSpeed1;
    case 1:
      return TextManager.autoSpeed2;
    case 2:
      return TextManager.autoSpeed3;
    case 3:
      return TextManager.autoSpeed4;
    case 4:
      return TextManager.autoSpeed5;
  }
};
Window_Options.prototype.languageStatusText = function (value) {
  switch (value) {
    case "en":
      return "DLSite En(Partial)";
    case "jp":
      return "DazedTL";
    case "ch":
      return "中国語";
  }
  return "";
};
Window_Options.prototype.isSimpleMenuSymbol = function (symbol) {
  return symbol == "simpleMenu";
};
Window_Options.prototype.isSkipKeySymbol = function (symbol) {
  return symbol == "skipKey";
};
Window_Options.prototype.isAutoSpeedSymbol = function (symbol) {
  return symbol == "autoSpeed";
};
Window_Options.prototype.isLanguageSymbol = function (symbol) {
  return symbol == "language";
};
Window_Options.prototype.cursorRight = function () {
  var index = this.index();
  var symbol = this.commandSymbol(index);
  if (this.isLanguageSymbol(symbol)) {
    this.changeLanguage(symbol, true);
  } else if (this.isAutoSpeedSymbol(symbol)) {
    this.changeAutoSpeed(symbol, true);
  } else if (this.isVolumeSymbol(symbol)) {
    this.changeVolume(symbol, true, false);
  } else {
    this.changeValue(symbol, true);
  }
};
Window_Options.prototype.changeLanguage = function (symbol, forward) {
  var lastValue = this.getConfigValue(symbol);
  var index = LANGUAGE_LIST.indexOf(lastValue);
  if (forward) {
    index++;
  } else {
    index--;
  }
  if (index >= LANGUAGE_LIST.length) {
    this.changeValue(symbol, LANGUAGE_LIST[0]);
  } else if (index < 0) {
    this.changeValue(symbol, LANGUAGE_LIST[LANGUAGE_LIST.length - 1]);
  } else {
    this.changeValue(symbol, LANGUAGE_LIST[index]);
  }
};
Window_Options.prototype.changeAutoSpeed = function (symbol, forward) {
  var lastValue = this.getConfigValue(symbol);
  if (forward) {
    if (lastValue == 4) {
      this.changeValue(symbol, 0);
    } else {
      this.changeValue(symbol, lastValue + 1);
    }
  } else {
    if (lastValue == 0) {
      this.changeValue(symbol, 4);
    } else {
      this.changeValue(symbol, lastValue - 1);
    }
  }
};
Window_Options.prototype.processOk = function () {
  var index = this.index();
  var symbol = this.commandSymbol(index);
  if (symbol == "ok") {
    this.processCancel();
  } else if (this.isAutoSpeedSymbol(symbol)) {
    this.changeAutoSpeed(symbol, true);
  } else if (this.isLanguageSymbol(symbol)) {
    this.changeLanguage(symbol, true);
  } else if (this.isVolumeSymbol(symbol)) {
    this.changeVolume(symbol, true, true);
  } else {
    this.changeValue(symbol, !this.getConfigValue(symbol));
  }
};
var _Window_Options_prototype_processCancel =
  Window_Options.prototype.processCancel;
Window_Options.prototype.processCancel = function () {
  var index = this.index();
  var symbol = this.commandSymbol(index);
  if (symbol.includes("Volume")) {
    this.cursorLeft();
  } else {
    _Window_Options_prototype_processCancel.call(this);
  }
};
Window_Options.prototype.cursorLeft = function () {
  var index = this.index();
  var symbol = this.commandSymbol(index);
  if (this.isLanguageSymbol(symbol)) {
    this.changeLanguage(symbol, false);
  } else if (this.isAutoSpeedSymbol(symbol)) {
    this.changeAutoSpeed(symbol, false);
  } else if (this.isVolumeSymbol(symbol)) {
    this.changeVolume(symbol, false, false);
  } else {
    this.changeValue(symbol, false);
  }
};
ConfigManager.readVolume = function (config, name) {
  if (name in config) {
    return Number(config[name]).clamp(0, 100);
  } else {
    return 20;
  }
};
ConfigManager.language = "jp";
SceneManager.isGameActive = function () {
  // [Note] We use "window.top" to support an iframe.
  try {
    if (ConfigManager.gameActive) {
      return true;
    }
    return window.top.document.hasFocus();
  } catch (e) {
    // SecurityError
    return true;
  }
};
Window_Options.prototype.volumeStatusText = function (value) {
  return value + "％";
};


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 __());
    };
  })();
/*:ja
 * @target MZ
 * @author ル
 *
 * @command addScenario
 * @text SLGシナリオ追加
 * @des SLGシナリオ追加
 * @arg scenario
 * @type string
 * @arg isSlg
 * @type boolean
 * @text SLG画面のみ
 *
 * @command reserveActionPoint
 * @text アクションポイント予約
 * @des アクションポイント予約
 * @arg point
 * @type number
 * @text point
 * @desc point
 *
 * @command consumeActionPoint
 * @text アクションポイント消費
 * @des アクションポイント消費
 *
 * @command clearActionPoint
 * @text アクションポイントクリア
 * @des アクションポイントクリア
 *
 */
var RECOVER_CIV_CRYSTAL = 50;
var NO_ITEM_VAR = 133;
var FAN_UNIT = 10;
var Nore;
(function (Nore) {
  var pluginName = "Nore_Party";
  PluginManager.registerCommand(pluginName, "addScenario", function (args) {
    var isSlg = args.isSlg == "true";
    if (isSlg) {
      $gameParty.addSlgScenario(args.scenario, -1);
    } else {
      $gameParty.addScenario(args.scenario, -1);
    }
  });
  PluginManager.registerCommand(
    pluginName,
    "consumeActionPoint",
    function (args) {
      $gameParty.consumeActionPoint();
    }
  );
  PluginManager.registerCommand(
    pluginName,
    "clearActionPoint",
    function (args) {
      $gameParty.clearActionPoint();
    }
  );
})(Nore || (Nore = {}));
var SKILL_POINT;
(function (SKILL_POINT) {
  SKILL_POINT[(SKILL_POINT["DUNGEON_START"] = 20)] = "DUNGEON_START";
  SKILL_POINT[(SKILL_POINT["WIN_BATTLE"] = 5)] = "WIN_BATTLE";
})(SKILL_POINT || (SKILL_POINT = {}));
var SIROHATA_ID = 17;
var BAKUDAN_ID = 19;
var SUISIDE_ID = 21;
var BATTLE_COS_ID = 1;
var CAPTIVE_COS_ID = 2;
var TEMP_COS_ID = 3;
var CRYSTAL_VAR = 68;
var GachaTicket = /** @class */ (function () {
  function GachaTicket(actorId) {
    this._actorId = actorId;
  }
  GachaTicket.prototype.actorId = function () {
    return this._actorId;
  };
  return GachaTicket;
})();
var SlgScenatio = /** @class */ (function () {
  function SlgScenatio(_scenario, _id) {
    this._scenario = _scenario;
    this._id = _id;
  }
  SlgScenatio.prototype.scenario = function () {
    return this._scenario;
  };
  SlgScenatio.prototype.id = function () {
    return this._id;
  };
  return SlgScenatio;
})();
var FriendshipBonusType;
(function (FriendshipBonusType) {
  FriendshipBonusType["hpFlame"] = "hpFlame";
  FriendshipBonusType["atkFlame"] = "atkFlame";
  FriendshipBonusType["hpWater"] = "hpWater";
  FriendshipBonusType["atkWater"] = "atkWater";
  FriendshipBonusType["hpWood"] = "hpWood";
  FriendshipBonusType["atkWood"] = "atkWood";
})(FriendshipBonusType || (FriendshipBonusType = {}));
var Game_NoreParty = /** @class */ (function (_super) {
  __extends(Game_NoreParty, _super);
  function Game_NoreParty() {
    var _this = _super.call(this) || this;
    _this._scenarioList = [];
    _this._slgScenarioList = [];
    _this._commonEventList = [];
    _this._upGoldValue = 0;
    _this._gachaTicketList = [];
    return _this;
  }
  Game_NoreParty.prototype.friendshipBonus = function (type) {
    this._friendshipBonus = this._friendshipBonus || {};
    if (this._friendshipBonus[type]) {
      return this._friendshipBonus[type];
    }
    return 0;
  };
  Game_NoreParty.prototype.upFriendshipBonus = function (type, value) {
    this._friendshipBonus = this._friendshipBonus || {};
    if (!this._friendshipBonus[type]) {
      this._friendshipBonus[type] = 0;
    }
    this._friendshipBonus[type] += value;
  };
  Game_NoreParty.prototype.friendshipBonusRate = function (type) {
    switch (type) {
      case FriendshipBonusType.hpFlame:
      case FriendshipBonusType.hpWater:
      case FriendshipBonusType.hpWood:
        return 3;
    }
    return 1;
  };
  Game_NoreParty.prototype.setMenuActorId = function (actorId) {
    this._menuActorId = actorId;
  };
  Game_NoreParty.prototype.menuActor = function () {
    var actor = $gameActors.actor(this._menuActorId);
    return actor;
  };
  Game_NoreParty.prototype.maxPower = function () {
    return $slg.facilityInfo().maxPower();
  };
  Game_NoreParty.prototype.addScenario = function (scenario, id) {
    p("addScenario:" + scenario + " id:" + id);
    this._scenarioList.push(new SlgScenatio(scenario, id));
    $slg.setDirty();
  };
  Game_NoreParty.prototype.addSlgScenario = function (scenario, id) {
    p("addSlgScenario:" + scenario);
    this._slgScenarioList.push(new SlgScenatio(scenario, id));
    $slg.setDirty();
  };
  Game_NoreParty.prototype.clearScenario = function () {
    this._scenarioList = [];
  };
  Game_NoreParty.prototype.nextSlgScenario = function () {
    if (this._slgScenarioList.length > 0) {
      var data = this._slgScenarioList.shift();
      $slg.fadeoutTimeGaugeEvent(data.id());
      return data.scenario();
    }
  };
  Game_NoreParty.prototype.nextScenario = function () {
    if (this._scenarioList.length > 0) {
      var data = this._scenarioList.shift();
      $slg.fadeoutTimeGaugeEvent(data.id());
      return data.scenario();
    }
    return null;
  };
  Game_NoreParty.prototype.addCommonEvent = function (commonId, id) {
    this._commonEventList.push(new CommonEventData(commonId, id));
    $slg.setDirty();
  };
  Game_NoreParty.prototype.insertCommonEvent = function (commonId, id) {
    this._commonEventList.unshift(new CommonEventData(commonId, id));
    $slg.setDirty();
  };
  Game_NoreParty.prototype.hasCommonEvent = function () {
    if (this._commonEventList.length > 0) {
      return true;
    }
    return false;
  };
  Game_NoreParty.prototype.nextCommonEvent = function () {
    if (this._commonEventList.length > 0) {
      var data = this._commonEventList.shift();
      $slg.fadeoutTimeGaugeEvent(data.id());
      return data.commonEventId;
    }
    return null;
  };
  Game_NoreParty.prototype.isDirty = function () {
    return this._dirty;
  };
  Game_NoreParty.prototype.setDirty = function () {
    this._dirty = true;
  };
  Game_NoreParty.prototype.clearDirty = function () {
    this._dirty = false;
  };
  /*isAllDead() {
        return this._hp <= 0;
    }*/
  Game_NoreParty.prototype.saveCostume = function (slotId) {
    for (var i = 1; i <= 24; i++) {
      var a = $gameActors.actor(i);
      a.saveCostume(slotId);
    }
  };
  Game_NoreParty.prototype.restoreCostume = function (slotId) {
    for (var i = 1; i <= 24; i++) {
      var a = $gameActors.actor(i);
      a.restoreCostume(slotId, true);
    }
  };
  Game_NoreParty.prototype.isLayeredCharacterEnabledMap = function (mapId) {
    return true;
  };
  Game_NoreParty.prototype.gainGold = function (amount) {
    if (amount > 0) {
      this._upGoldValue += amount;
    }
    _super.prototype.gainGold.call(this, amount);
    this._dirty = true;
    this.checkGoldEvent();
  };
  Game_NoreParty.prototype.checkGoldEvent = function () {
    /*if (! $gameSwitches.value(61)) {
            if (this.gold() >= 125) {
                $gameSwitches.setValue(61, true);
                $gameParty.addScenario('1面_02_お金イベント_01');
                $slg.setDirty();
            }
        }*/
  };
  Game_NoreParty.prototype.getActorIdList = function () {
    var candidates = [8, 10, 11, 9, 4, 13, 17];
    var result = [];
    for (
      var _i = 0, candidates_1 = candidates;
      _i < candidates_1.length;
      _i++
    ) {
      var actorId = candidates_1[_i];
      if (this.isVisible(actorId)) {
        result.push(actorId);
      }
    }
    return result;
  };
  Game_NoreParty.prototype.isVisible = function (actorId) {
    switch (actorId) {
      case 9:
        // ノノカ
        return $slg.stage() >= 2;
      case 10:
        // カナミ
        return $gameSwitches.value(253);
      case 11:
        // ミユ
        return $gameSwitches.value(250);
      case 4:
        // マリナ
        //return true;
        return $slg.stage() >= 3;
      case 13:
        // サキ
        //return true;
        return $slg.stage() >= 4;
      case 17:
        // ココナ
        //return true;
        return $slg.stage() >= 5;
    }
    return true;
  };
  Game_NoreParty.prototype.makeMenuActorPrevious = function () {
    var actorId = this.menuActor().actorId();
    var actorIdList = this.getActorIdList();
    var index = actorIdList.indexOf(actorId);
    if (index < 0) {
      this.setMenuActorId(actorIdList[0]);
    } else if (index == 0) {
      this.setMenuActorId(actorIdList[actorIdList.length - 1]);
    } else {
      this.setMenuActorId(actorIdList[index - 1]);
    }
  };
  Game_NoreParty.prototype.makeMenuActorNext = function () {
    var actorId = this.menuActor().actorId();
    var actorIdList = this.getActorIdList();
    var index = actorIdList.indexOf(actorId);
    if (index < 0) {
      this.setMenuActorId(actorIdList[0]);
    } else if (index == actorIdList.length - 1) {
      this.setMenuActorId(actorIdList[0]);
    } else {
      this.setMenuActorId(actorIdList[index + 1]);
    }
  };
  Game_NoreParty.prototype.upGoldValue = function () {
    return this._upGoldValue;
  };
  Game_NoreParty.prototype.clearUpGoldValue = function () {
    this._upGoldValue = 0;
  };
  Game_NoreParty.prototype.isAllLessHp = function () {
    for (var _i = 0, _a = this.getActorIdList(); _i < _a.length; _i++) {
      var actorId = _a[_i];
      var actor = $gameActors.actor(actorId);
      if (actor.hpRate() >= 1) {
        return false;
      }
    }
    return true;
  };
  Game_NoreParty.prototype.gachaTicket = function () {
    this._gachaTicketList = this._gachaTicketList || [];
    return this._gachaTicketList.length;
  };
  Game_NoreParty.prototype.addGachaTicket = function (t) {
    this._gachaTicketList = this._gachaTicketList || [];
    this._gachaTicketList.push(t);
  };
  Game_NoreParty.prototype.useGachaTicket = function () {
    this._gachaTicketList = this._gachaTicketList || [];
    if (this._gachaTicketList.length == 0) {
      console.error("ガチャチケがありません。");
      return null;
    }
    return this._gachaTicketList.shift();
  };
  return Game_NoreParty;
})(Game_Party);
var MilkSet = /** @class */ (function () {
  function MilkSet() {
    this._map = {};
  }
  MilkSet.prototype.push = function (milk) {
    if (this._map[milk.id]) {
      this._map[milk.id].num++;
    } else {
      this._map[milk.id] = new Milk(milk);
    }
  };
  MilkSet.prototype.makeList = function () {
    var array = [];
    for (var key in this._map) {
      var milk = this._map[key];
      array.push(milk);
    }
    array = array.sort(function (a, b) {
      return a.id() - b.id();
    });
    return array;
  };
  return MilkSet;
})();
var Milk = /** @class */ (function () {
  function Milk(item) {
    this._item = item;
    this.num = 1;
  }
  Milk.prototype.id = function () {
    return this._item.id;
  };
  Milk.prototype.item = function () {
    return this._item;
  };
  return Milk;
})();


code:
var PassiveMaker = /** @class */ (function () {
  function PassiveMaker() {}
  PassiveMaker.prototype.make = function (actor, skill, battleMembers) {
    var passiveSkills = this.makePassiveSkills(skill);
    if (passiveSkills.length == 0) {
      return [];
    }
    var result = [];
    for (
      var _i = 0, passiveSkills_1 = passiveSkills;
      _i < passiveSkills_1.length;
      _i++
    ) {
      var passiveSkill = passiveSkills_1[_i];
      if (!passiveSkill) {
        continue;
      }
      var targets = this.makePassiveTargets(actor, skill, battleMembers);
      passiveSkill.setTargets(targets);
      var valueRate = this.calcValueRate(skill, battleMembers, actor);
      passiveSkill.setValueRate(valueRate);
      result.push(passiveSkill);
    }
    return result;
  };
  PassiveMaker.prototype.makePassiveSkills = function (skill) {
    var result = [];
    if (skill.meta["agi"]) {
      result.push(
        new PassiveSkill(PassiveType.agiUp, parseInt(skill.meta["agi"]))
      );
    }
    if (skill.meta["atk"]) {
      result.push(
        new PassiveSkill(PassiveType.atkUp, parseInt(skill.meta["atk"]))
      );
    }
    if (skill.meta["mhp"]) {
      result.push(
        new PassiveSkill(PassiveType.mhpUp, parseInt(skill.meta["mhp"]))
      );
    }
    if (skill.meta["mhpSelf"]) {
      result.push(
        new PassiveSkill(PassiveType.mhpSelf, parseInt(skill.meta["mhpSelf"]))
      );
    }
    if (skill.meta["atkSelf"]) {
      result.push(
        new PassiveSkill(PassiveType.atkSelf, parseInt(skill.meta["atkSelf"]))
      );
    }
    if (skill.meta["agiSelf"]) {
      result.push(
        new PassiveSkill(PassiveType.agiSelf, parseInt(skill.meta["agiSelf"]))
      );
    }
    if (skill.meta["skillRate"]) {
      result.push(
        new PassiveSkill(
          PassiveType.skillRateUp,
          parseInt(skill.meta["skillRate"])
        )
      );
    }
    if (skill.meta["deathAtk"]) {
      result.push(
        new PassiveSkill(PassiveType.deathAtk, parseInt(skill.meta["deathAtk"]))
      );
    }
    if (skill.meta["recoverHp"]) {
      result.push(
        new PassiveSkill(
          PassiveType.recoverHp,
          parseInt(skill.meta["recoverHp"])
        )
      );
    }
    if (skill.meta["recoverHpAll"]) {
      result.push(
        new PassiveSkill(
          PassiveType.recoverHpAll,
          parseInt(skill.meta["recoverHpAll"])
        )
      );
    }
    if (skill.meta["deathRecover"]) {
      result.push(null);
    }
    if (skill.meta["provoke"]) {
      result.push(
        new PassiveSkill(PassiveType.provoke, parseInt(skill.meta["provoke"]))
      );
    }
    if (result.length == 0) {
      console.error("不正なパッシブスキルです");
      p(skill);
    }
    return result;
  };
  PassiveMaker.prototype.makePassiveTargets = function (
    actor,
    skill,
    battleMembers
  ) {
    var candidates = this.makePassiveCandidates(actor, skill, battleMembers);
    return this.applyPassiveCondition(actor, skill, candidates);
  };
  PassiveMaker.prototype.applyPassiveCondition = function (
    actor,
    skill,
    battleMembers
  ) {
    var list = [];
    var left = null;
    var right = null;
    if (skill.meta["toMinHp"]) {
      return this.findMinHp(battleMembers);
    }
    for (var i = 0; i < battleMembers.length; i++) {
      var b = battleMembers[i];
      right = battleMembers[i + 1];
      if (skill.meta["toTop"]) {
        list.push(b);
        return list;
      }
      if (skill.meta["toBack"]) {
        if (b == actor) {
          for (var k = i + 1; k < battleMembers.length; k++) {
            var b2 = battleMembers[k];
            list.push(b2);
          }
          return list;
        }
      }
      if (skill.meta["toLeftFlame"]) {
        if (b == actor) {
          if (left && left.element() == MonsterElement.flame) {
            list.push(left);
          }
        }
      }
      if (skill.meta["toLeftWater"]) {
        if (b == actor) {
          if (left && left.element() == MonsterElement.water) {
            list.push(left);
          }
        }
      }
      if (skill.meta["toLeftWood"]) {
        if (b == actor) {
          if (left && left.element() == MonsterElement.wood) {
            list.push(left);
          }
        }
      }
      if (skill.meta["toRightFlame"]) {
        if (b == actor) {
          if (right) {
            if (right.element() == MonsterElement.flame) {
              list.push(right);
            }
          }
        }
      }
      if (skill.meta["toRightWater"]) {
        if (b == actor) {
          if (right) {
            if (right.element() == MonsterElement.water) {
              list.push(right);
            }
          }
        }
      }
      if (skill.meta["toRightWood"]) {
        if (b == actor) {
          if (right) {
            if (right.element() == MonsterElement.wood) {
              list.push(right);
            }
          }
        }
      }
      if (skill.meta["toWater"]) {
        if (b.element() == MonsterElement.water) {
          list.push(b);
        }
      }
      if (skill.meta["toFlame"]) {
        if (b.element() == MonsterElement.flame) {
          list.push(b);
        }
      }
      if (skill.meta["toWood"]) {
        if (b.element() == MonsterElement.wood) {
          list.push(b);
        }
      }
      if (skill.meta["toSelf"]) {
        if (b == actor) {
          list.push(b);
        }
      }
      if (skill.meta["toLeft"]) {
        if (b == actor) {
          list.push(left);
        }
      }
      if (skill.meta["toRight"]) {
        if (b == actor) {
          list.push(right);
        }
      }
      if (skill.meta["toBottomSelf"]) {
        if (b == actor) {
          if (i == battleMembers.length - 1) {
            list.push(b);
          }
        }
      }
      left = b;
    }
    var result = [];
    for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
      var b = list_1[_i];
      if (b) {
        result.push(b);
      }
    }
    return result;
  };
  PassiveMaker.prototype.findMinHp = function (battleMembers) {
    var min = battleMembers[0];
    for (
      var _i = 0, battleMembers_1 = battleMembers;
      _i < battleMembers_1.length;
      _i++
    ) {
      var b = battleMembers_1[_i];
      if (min.mhpBase() > b.mhpBase()) {
        min = b;
      }
    }
    return [min];
  };
  PassiveMaker.prototype.makePassiveCandidates = function (
    actor,
    skill,
    battleMembers
  ) {
    var result = [];
    if (
      skill.meta["toLeft"] ||
      skill.meta["toRight"] ||
      skill.meta["toMinHp"] ||
      skill.meta["toTop"] ||
      skill.meta["toBack"] ||
      skill.meta["toFront"] ||
      skill.meta["toBottomSelf"] ||
      skill.meta["toTopSelf"] ||
      skill.meta["toTop"] ||
      skill.meta["toLeftFlame"] ||
      skill.meta["toLeftWater"] ||
      skill.meta["toLeftWood"] ||
      skill.meta["toRightWater"] ||
      skill.meta["toRightFlame"] ||
      skill.meta["toRightWood"]
    ) {
      return battleMembers;
    }
    if (skill.meta["toFriend"]) {
      for (
        var _i = 0, battleMembers_2 = battleMembers;
        _i < battleMembers_2.length;
        _i++
      ) {
        var b = battleMembers_2[_i];
        if (b == actor) {
          continue;
        }
        if (b) {
          result.push(b);
        }
      }
    }
    if (skill.meta["toSelf"]) {
      result.push(actor);
    }
    return result;
  };
  PassiveMaker.prototype.calcValueRate = function (
    skill,
    battleMembers,
    actor
  ) {
    var result = 0;
    var isEnabled = false;
    if (skill.meta["flameCount"]) {
      isEnabled = true;
      var value = parseInt(skill.meta["flameCount"]);
      for (
        var _i = 0, battleMembers_3 = battleMembers;
        _i < battleMembers_3.length;
        _i++
      ) {
        var b = battleMembers_3[_i];
        if (b == actor) {
          continue;
        }
        if (b.element() == MonsterElement.flame) {
          result += value;
        }
      }
    }
    if (skill.meta["woodCount"]) {
      isEnabled = true;
      var value = parseInt(skill.meta["woodCount"]);
      for (
        var _a = 0, battleMembers_4 = battleMembers;
        _a < battleMembers_4.length;
        _a++
      ) {
        var b = battleMembers_4[_a];
        if (b == actor) {
          continue;
        }
        if (b.element() == MonsterElement.wood) {
          result += value;
        }
      }
    }
    if (skill.meta["waterCount"]) {
      isEnabled = true;
      var value = parseInt(skill.meta["waterCount"]);
      for (
        var _b = 0, battleMembers_5 = battleMembers;
        _b < battleMembers_5.length;
        _b++
      ) {
        var b = battleMembers_5[_b];
        if (b == actor) {
          continue;
        }
        if (b.element() == MonsterElement.water) {
          result += value;
        }
      }
    }
    if (skill.meta["frontCount"]) {
      isEnabled = true;
      var value = parseInt(skill.meta["frontCount"]);
      for (
        var _c = 0, battleMembers_6 = battleMembers;
        _c < battleMembers_6.length;
        _c++
      ) {
        var b = battleMembers_6[_c];
        if (b == actor) {
          break;
        }
        result += value;
      }
    }
    if (!isEnabled) {
      return -1;
    }
    return result;
  };
  return PassiveMaker;
})();
var PassiveSkills = /** @class */ (function () {
  function PassiveSkills() {
    this._skills = [];
    /*
        paramPlusSelf(battleActor: BattleActor, value: number, type: PassiveType): number {
            let rate = 0;

            for (const s of this._skills) {
                if (s.type() == type) {
                    if (s.isTarget(battleActor)) {
                        rate += s.value();
                    }
                }
            }
            return Math.round(value * rate / 100);
        }*/
  }
  PassiveSkills.prototype.push = function (skill) {
    this._skills.push(skill);
  };
  PassiveSkills.prototype.agiPlus = function (battleActor) {
    var result = 0;
    result += this.paramRatePlus(
      battleActor,
      battleActor.agiBase(),
      PassiveType.agiUp
    );
    result += this.paramRatePlus(
      battleActor,
      battleActor.agiBase(),
      PassiveType.agiSelf
    );
    return result;
  };
  PassiveSkills.prototype.atkPlus = function (battleActor) {
    var result = 0;
    result += this.paramRatePlus(
      battleActor,
      battleActor.atkBase(),
      PassiveType.atkUp
    );
    result += this.paramRatePlus(
      battleActor,
      battleActor.atkBase(),
      PassiveType.atkSelf
    );
    return result;
  };
  PassiveSkills.prototype.deathAtk = function (battleActor, value) {
    var rate = 0;
    for (var _i = 0, _a = this._skills; _i < _a.length; _i++) {
      var s = _a[_i];
      if (s.type() == PassiveType.deathAtk) {
        if (s.isTarget(battleActor)) {
          var n = $slg.formation().deadMembers().length;
          rate += s.value() * n;
        }
      }
    }
    return Math.round((value * rate) / 100);
  };
  PassiveSkills.prototype.mhpPlus = function (battleActor) {
    var result = 0;
    result += this.paramRatePlus(
      battleActor,
      battleActor.mhpBase(),
      PassiveType.mhpUp
    );
    result += this.paramRatePlus(
      battleActor,
      battleActor.mhpBase(),
      PassiveType.mhpSelf
    );
    return result;
  };
  PassiveSkills.prototype.skillRatePlus = function (battleActor) {
    var result = 0;
    result += this.paramPlus(battleActor, 0, PassiveType.skillRateUp);
    result += this.paramPlus(battleActor, 0, PassiveType.skillRateSelf);
    return result;
  };
  PassiveSkills.prototype.paramRatePlus = function (battleActor, value, type) {
    var rate = 0;
    for (var _i = 0, _a = this._skills; _i < _a.length; _i++) {
      var s = _a[_i];
      if (s.type() == type) {
        if (s.isTarget(battleActor)) {
          rate += s.value();
        }
      }
    }
    return Math.round((value * rate) / 100);
  };
  PassiveSkills.prototype.paramPlus = function (battleActor, value, type) {
    var n = 0;
    for (var _i = 0, _a = this._skills; _i < _a.length; _i++) {
      var s = _a[_i];
      if (s.type() == type) {
        if (s.isTarget(battleActor)) {
          n += s.value();
        }
      }
    }
    return n;
  };
  PassiveSkills.prototype.provokeValue = function (battleActor) {
    var n = 0;
    for (var _i = 0, _a = this._skills; _i < _a.length; _i++) {
      var s = _a[_i];
      if (s.type() == PassiveType.provoke) {
        if (s.isTarget(battleActor)) {
          n += s.value();
        }
      }
    }
    return n;
  };
  return PassiveSkills;
})();
var PassiveSkill = /** @class */ (function () {
  function PassiveSkill(type, value) {
    this._targetIdList = [];
    this._type = type;
    this._value = value;
    this._valueRate = -1;
  }
  PassiveSkill.prototype.type = function () {
    return this._type;
  };
  PassiveSkill.prototype.value = function () {
    if (this._valueRate >= 0) {
      return this._value * this._valueRate;
    }
    return this._value;
  };
  PassiveSkill.prototype.setValueRate = function (rate) {
    this._valueRate = rate;
  };
  PassiveSkill.prototype.valueRate = function () {
    return this._valueRate;
  };
  PassiveSkill.prototype.setTargets = function (battleMembers) {
    this._targetIdList = [];
    for (
      var _i = 0, battleMembers_7 = battleMembers;
      _i < battleMembers_7.length;
      _i++
    ) {
      var b = battleMembers_7[_i];
      this._targetIdList.push(b.id());
    }
  };
  PassiveSkill.prototype.isTarget = function (battleActor) {
    return this._targetIdList.contains(battleActor.id());
  };
  return PassiveSkill;
})();
var PassiveType;
(function (PassiveType) {
  PassiveType["atkUp"] = "atkUp";
  PassiveType["mhpUp"] = "mhpUp";
  PassiveType["agiUp"] = "agiUp";
  PassiveType["mhpSelf"] = "mhpSelf";
  PassiveType["atkSelf"] = "atkSelf";
  PassiveType["agiSelf"] = "agiSelf";
  PassiveType["deathAtk"] = "deathAtk";
  PassiveType["skillRateUp"] = "skillRateUp";
  PassiveType["skillRateSelf"] = "skillRateSelf";
  PassiveType["recoverHp"] = "recoverHp";
  PassiveType["recoverHpAll"] = "recoverHpAll";
  PassiveType["provoke"] = "provoke";
})(PassiveType || (PassiveType = {}));
var SKILL_VALUE_META_LIST = [
  "atk",
  "agi",
  "mhp",
  "mhpSelf",
  "agiSelf",
  "atkSelf",
  "damage",
  "skillRate",
  "deathRecover",
  "recoverHp",
  "recoverHpAll",
  "deathAtk",
];


code:
/*:ja
 * @target MZ
 * @author ル
 */
var Nore;
(function (Nore) {
  var colorCache = {};
  ColorManager.textColor = function (n) {
    if (colorCache[n]) {
      return colorCache[n];
    }
    var px = 96 + (n % 8) * 12 + 6;
    var py = 144 + Math.floor(n / 8) * 12 + 6;
    var r = this._windowskin.getPixel(px, py);
    colorCache[n] = r;
    return r;
  };
  var renderTexture;
  /*
    Bitmap.snap2 = Bitmap.snap;
    Bitmap.snap = function (stage) {
        var width = Graphics.width;
        var height = Graphics.height;
        // var bitmap = new Bitmap(width, height);
        if (!renderTexture) {
            renderTexture = PIXI.RenderTexture.create(width, height);
        }
        if (stage) {
            Graphics.app.renderer.render(stage, renderTexture);
            stage.worldTransform.identity();
            const sprite =  new PIXI.Sprite(new PIXI.Texture(renderTexture));
            sprite.addLoadListener = function() {

            }
            const _sprite_destroy = sprite.destroy;
            sprite.destroy = function() {
                if (this.texture) {
                    this.texture.destroy();
                    this.texture = null;
                    _sprite_destroy.call(this);
                }

                //this.
            };
            return sprite;
            // context.drawImage(canvas, 0, 0);
        } else {
            //TODO: Ivan: what if stage is not present?
        }
        return null;
    };
    /*SceneManager.snapForBackground = function() {
        this._backgroundBitmap = this.snap();
    };*/
  /*
    Scene_MenuBase.prototype.createBackground = function() {
        this._backgroundSprite = SceneManager.backgroundBitmap();
        this.addChild(this._backgroundSprite);
    };*/
  var _Scene_MenuBase_prototype_destroy = Scene_MenuBase.prototype.destroy;
  Scene_MenuBase.prototype.destroy = function () {
    if (this._backgroundSprite) {
      this.removeChild(this._backgroundSprite);
      this._backgroundSprite = null;
    }
    _Scene_MenuBase_prototype_destroy.call(this);
  };
  PIXI.Container.prototype.destroyAndRemoveChildren = function () {
    for (var i = this.children.length; i >= 0; i--) {
      if (this.children[i]) {
        this.children[i].emit("removed");
        if (this.children[i]._windowFrameSprite) {
          this.children[i]._windowFrameSprite.destroyAndRemoveChildren();
        }
        if (this.children[i]._windowContentsSprite) {
          this.children[i]._windowContentsSprite.destroyAndRemoveChildren();
        }
        if (this.children[i].destroyAndRemoveChildren) {
          this.children[i].destroyAndRemoveChildren();
        }
        this.children[i].destroy({
          children: true,
          texture: true,
        });
      }
    }
    this.removeChildren();
  };
})(Nore || (Nore = {}));


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 __());
    };
  })();
Game_CharacterBase.prototype.rotation = function () {
  return 0;
};
Game_Event.prototype.rotation = function () {
  if (!this.page()) {
    return 0;
  }
  var list = this.page().list;
  if (list.length == 0) {
    return 0;
  }
  var firstEvent = list[0];
  if (firstEvent.code != 108) {
    return 0;
  }
  if (firstEvent.parameters[0] == "rotation") {
    return 90 * (Math.PI / 180);
  }
  return 0;
};
var _Game_Event_screenX = Game_Event.prototype.screenX;
Game_Event.prototype.screenX = function () {
  if (this.rotation() > 0) {
    return _Game_Event_screenX.call(this) - 20;
  }
  return _Game_Event_screenX.call(this);
};
var _Game_Event_screenY = Game_Event.prototype.screenY;
Game_Event.prototype.screenY = function () {
  if (this.rotation() > 0) {
    return _Game_Event_screenY.call(this) - 20;
  }
  return _Game_Event_screenY.call(this);
};
var Game_Player2 = /** @class */ (function (_super) {
  __extends(Game_Player2, _super);
  function Game_Player2() {
    return (_super !== null && _super.apply(this, arguments)) || this;
  }
  Game_Player2.prototype.mainActorId = function () {
    return 8;
  };
  Game_Player2.prototype.mainActor = function () {
    return $gameActors.actor(this.mainActorId());
  };
  Game_Player2.prototype.centerY = function () {
    if ($gameSwitches.value(211)) {
      return (Graphics.height / $gameMap.tileHeight() - 1) / 2.0 - 1;
    } else {
      return (Graphics.height / $gameMap.tileHeight() - 1) / 2.0;
    }
  };
  Game_Player2.prototype.screenX = function () {
    var offset = 0;
    return _super.prototype.screenX.call(this) + offset;
  };
  Game_Player2.prototype.rotation = function () {
    if ($gameSystem.isInPersonSexAnime()) {
      return 0;
    }
    if ($gameSystem.isEroSexAnime()) {
      return 90 * (Math.PI / 180);
    }
    return 0;
  };
  return Game_Player2;
})(Game_Player);
Game_Map.prototype.displayX = function () {
  var x = this._displayX;
  if (false) {
    return x - 10;
  }
  return x;
};


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 __());
    };
  })();
/*:ja
 * @target MZ
 * @author ル
 *
 * @command reco
 * @text 回想登録
 * @des 回想登録
 * @arg id
 * @type number
 * @text id
 * @desc id
 *
 * @command openRecollection
 * @text 回想全解放
 *
 * @command closeRecollection
 * @text 回想全解放を元に戻す
 */
var Nore;
(function (Nore) {
  var pluginName = "Nore_Recollection";
  PluginManager.registerCommand(pluginName, "reco", function (args) {
    var switch_id = parseInt(args.id);
    p("回想登録:" + switch_id);
    var info = DataManager._globalInfo;
    if (!info) {
      p("失敗");
      return;
    }
    info[99] = info[99] || {};
    if (info[99][switch_id]) {
      return;
    }
    info[99][switch_id] = true;
  });
  PluginManager.registerCommand(
    pluginName,
    "openRecollection",
    function (args) {
      ConfigManager.openRecollection = true;
      ConfigManager.save();
    }
  );
  PluginManager.registerCommand(
    pluginName,
    "closeRecollection",
    function (args) {
      ConfigManager.openRecollection = false;
      ConfigManager.save();
    }
  );
})(Nore || (Nore = {}));
var noreRecoActorId = -2;
var OTHER = 98;
var EVENT_OFF = 99;
var EVENT_ON = 100;
var Scene_Recollection2 = /** @class */ (function (_super) {
  __extends(Scene_Recollection2, _super);
  function Scene_Recollection2() {
    return (_super !== null && _super.apply(this, arguments)) || this;
  }
  Scene_Recollection2.prototype.createCommandWindow = function () {
    this._rec_list = new Window_RecList2(
      -4,
      58,
      Graphics.width,
      Graphics.height - 62
    );
    // リロードの場合：回想リストを表示にする。通常はここがfalse
    if (Scene_Recollection.reload_rec_list) {
      //this._rec_window.deactivate();
      //this._rec_window.visible = false;
      this._rec_list.visible = true;
      this._rec_list.activate();
    } else {
      //this._rec_window.activate();
      //this._rec_window.visible = true;
      this._rec_list.visible = false;
      this._rec_list.deactivate();
    }
    this._rec_list.setHandler("ok", this.commandDoRecMode.bind(this));
    this._rec_list.setHandler("cancel", this.onCancelList.bind(this));
    this._mode = "recollection";
    this._rec_list.select(Scene_Recollection.rec_list_index);
    this.addWindow(this._rec_list);
    // CG参照用ダミーコマンド
    this._dummy_window = new Window_Command(new Rectangle(0, 0, 0, 0));
    this._dummy_window.isCurrentItemEnabled = function () {
      return true;
    };
    this._dummy_window.deactivate();
    this._dummy_window.visible = false;
    this._dummy_window.setHandler("ok", this.commandDummyOk.bind(this));
    this._dummy_window.setHandler("cancel", this.commandDummyCancel.bind(this));
    this._dummy_window.addCommand("next", "ok");
    this.addWindow(this._dummy_window);
    Scene_Recollection.reload_rec_list = false;
    this._dummy_window.isTouchedInsideFrame = function () {
      return true;
    };
    this._dummy_window.onTouch = function (triggered) {
      if (triggered) {
        this.processOk();
      }
    };
    this.commandShowRecollection();
    this._recoActorWindow = new Window_RecoActor();
    this._recoActorWindow.refresh();
    this.addWindow(this._recoActorWindow);
    this._rec_list.deactivate();
    this._recoActorWindow.activate();
    this._recoActorWindow.setHandler("change", this.onChange.bind(this));
    this._recoActorWindow.setHandler(
      "cancel",
      this.commandBackSelectMode.bind(this)
    );
    this._recoActorWindow.setHandler("ok", this.onOk.bind(this));
    this.selectInitialActor();
  };
  Scene_Recollection2.prototype.selectInitialActor = function () {
    if (noreRecoActorId > 0) {
      this._recoActorWindow.selectActor(noreRecoActorId);
      this._recoActorWindow.deactivate();
      this.onOk();
    }
  };
  Scene_Recollection2.prototype.onChange = function () {
    var actorId = this._recoActorWindow.selectedActorId();
    if (actorId >= EVENT_OFF) {
      return;
    }
    this._rec_list.setActorId(actorId);
    noreRecoActorId = actorId;
  };
  Scene_Recollection2.prototype.onOk = function () {
    var actorId = this._recoActorWindow.selectedActorId();
    if (actorId == EVENT_OFF) {
      $gameTemp.recoEventOn = false;
      this._rec_list.refresh();
      this._recoActorWindow.refresh();
      this._recoActorWindow.activate();
      return;
    }
    if (actorId == EVENT_ON) {
      $gameTemp.recoEventOn = true;
      this._rec_list.refresh();
      this._recoActorWindow.refresh();
      this._recoActorWindow.activate();
      return;
    }
    this._rec_list.activate();
  };
  Scene_Recollection2.prototype.onCancelList = function () {
    this._recoActorWindow.activate();
  };
  Scene_Recollection2.prototype.commandDoRecMode = function () {
    var info = this._rec_list.selectedInfo();
    Scene_Recollection.rec_list_index = this._rec_list.index();
    $gameTemp.ignoreFiles = {};
    $gameTemp.eroBack = null;
    if (this._rec_list.isVisible(info)) {
      // 回想モードの場合
      Scene_Recollection._rngd_recollection_doing = true;
      DataManager.setupNewGame();
      $gamePlayer.setTransparent(255);
      this.fadeOutAll();
      //$dataSystem.optTransparent = false;
      var commonEventId = info.common_event_id;
      p("回想実行:" + commonEventId);
      $gameTemp.reserveCommonEvent(commonEventId);
      $gamePlayer.reserveTransfer(
        rngd_recollection_mode_settings.sandbox_map_id,
        0,
        0,
        0
      );
      $gameSwitches.setValue(999, true);
      sessionStorage.setItem("noreCommonEventId", commonEventId);
      sessionStorage.setItem(
        "norePlayerMap",
        rngd_recollection_mode_settings.sandbox_map_id
      );
      SceneManager.push(Scene_Map2);
    } else {
      SoundManager.playBuzzer();
      this._rec_list.activate();
    }
    this._rec_list.refresh();
  };
  return Scene_Recollection2;
})(Scene_Recollection);
Window_RecList.prototype.itemHeight = function () {
  return 228;
};
var Window_RecoActor = /** @class */ (function (_super) {
  __extends(Window_RecoActor, _super);
  function Window_RecoActor() {
    var _this = this;
    var r = new Rectangle(-4, -4, 1084, 68);
    _this = _super.call(this, r) || this;
    _this.select(0);
    return _this;
  }
  Window_RecoActor.prototype.maxItems = function () {
    return this.actorIdList().length;
  };
  Window_RecoActor.prototype.maxCols = function () {
    return this.maxItems();
  };
  Window_RecoActor.prototype.drawItem = function (index) {
    this.contents.fontSize = 22;
    var rect = this.itemRect(index);
    var yOffset = 7;
    var actorId = this.actorIdList()[index];
    if (actorId < 0) {
      this.drawText("ALL", rect.x, rect.y + yOffset, rect.width, "center");
    } else if (actorId == OTHER) {
      this.drawText("OTHER", rect.x, rect.y + yOffset, rect.width, "center");
    } else if (actorId == EVENT_OFF) {
      if (!this.isEventOn()) {
        this.contents.fillRect(
          rect.x + 1,
          rect.y + 1,
          rect.width - 2,
          rect.height - 2,
          "#BB3333"
        );
      }
      this.drawText(
        "EVENT OFF",
        rect.x,
        rect.y + yOffset,
        rect.width,
        "center"
      );
    } else if (actorId == EVENT_ON) {
      if (this.isEventOn()) {
        this.contents.fillRect(
          rect.x + 1,
          rect.y + 1,
          rect.width - 2,
          rect.height - 2,
          "#BB3333"
        );
      }
      this.drawText("EVENT ON", rect.x, rect.y + yOffset, rect.width, "center");
    } else {
      var actor = $gameActors.actor(actorId);
      var iconIndex = actor.iconIndex();
      this.drawIcon(iconIndex, rect.x, rect.y + 2);
      this.drawText(
        actor.name(),
        rect.x + 32,
        rect.y + yOffset,
        rect.width,
        "left"
      );
    }
  };
  Window_RecoActor.prototype.actorIdList = function () {
    return [-1, 8, 9, 4, 13, 17, 10, 11, OTHER]; //, EVENT_OFF, EVENT_ON];
  };
  Window_RecoActor.prototype.selectedActorId = function () {
    return this.actorIdList()[this.index()];
  };
  Window_RecoActor.prototype.selectActor = function (actorId) {
    var index = this.actorIdList().indexOf(actorId);
    this.select(index);
  };
  Window_RecoActor.prototype.isEventOn = function () {
    return $gameTemp.recoEventOn;
  };
  return Window_RecoActor;
})(Window_Selectable);
var RecoInfo = /** @class */ (function () {
  function RecoInfo() {}
  return RecoInfo;
})();
var Window_RecList2 = /** @class */ (function (_super) {
  __extends(Window_RecList2, _super);
  function Window_RecList2(x, y, width, height) {
    var _this = _super.call(this, new Rectangle(x, y, width, height)) || this;
    _this.windowWidth = width;
    _this.windowHeight = height;
    _this.select(0);
    _this.get_global_variables();
    var infos = rngd_recollection_mode_settings.rec_cg_set;
    for (var i = 0; i < infos.length; i++) {
      var info = infos[i];
      if (_this.isVisible(info)) {
        var bmpName = info.thumbnail;
        var bmp = ImageManager.loadEro(bmpName);
      }
    }
    ImageManager.loadEro("never_watch_picture");
    _this._actorId = -1;
    _this.refresh();
    return _this;
  }
  Window_RecList2.prototype.isVisible = function (info) {
    if (this.isShowAll()) {
      return true;
    }
    if (this._global_variables["switches"][info.switch_id]) {
      return true;
    }
    if (Nore.isOmakeRecollection(info.switch_id)) {
      return true;
    }
    return false;
  };
  Window_RecList2.prototype.standardPadding = function () {
    return 4;
  };
  Window_RecList2.prototype.makeData = function () {
    this._data = [];
    for (
      var _i = 0, _a = rngd_recollection_mode_settings.rec_cg_set;
      _i < _a.length;
      _i++
    ) {
      var info = _a[_i];
      if (this.isInclude(info)) {
        this._data.push(info);
      }
    }
  };
  Window_RecList2.prototype.isInclude = function (data) {
    if (this._actorId < 0) {
      return true;
    } else if (!$gameTemp.recoEventOn) {
      if (data.event) {
        return false;
      }
    }
    if (this._actorId == data.actorId) {
      return true;
    }
    return false;
  };
  Window_RecList2.prototype.refresh = function () {
    this._windowContentsSprite.removeChildren();
    this.makeData();
    _super.prototype.refresh.call(this);
  };
  Window_RecList2.prototype.maxItems = function () {
    return this._data.length;
  };
  Window_RecList2.prototype.itemHeight = function () {
    return 238;
  };
  Window_RecList2.prototype.maxCols = function () {
    return 4;
  };
  Window_RecList2.prototype.setActorId = function (actorId) {
    this._actorId = actorId;
    this.refresh();
    if (this.index() >= this.maxItems()) {
      this.select(0);
    }
  };
  Window_RecList2.prototype.colSpacing = function () {
    return 0;
  };
  Window_RecList2.prototype.maxPageRows = function () {
    var pageHeight = this.height; // - this.padding * 2;
    return Math.floor(pageHeight / this.itemHeight());
  };
  Window_RecList2.prototype.itemRect = function (index) {
    var maxCols = this.maxCols();
    var itemWidth = this.itemWidth();
    var itemHeight = this.itemHeight();
    var colSpacing = this.colSpacing();
    var rowSpacing = this.rowSpacing();
    var col = index % maxCols;
    var row = Math.floor(index / maxCols);
    var x = col * itemWidth + colSpacing / 2 - this.scrollBaseX();
    var y = row * itemHeight + rowSpacing / 2 - this.scrollBaseY();
    var width = itemWidth - colSpacing + 2;
    var height = itemHeight - rowSpacing;
    return new Rectangle(x, y, width, height);
  };
  Window_RecList2.prototype.drawItem = function (index) {
    var rec_cg = this._data[index];
    //rngd_recollection_mode_settings.rec_cg_set[index];
    var rect = this.itemRect(index);
    var text_height = 0;
    if (rngd_recollection_mode_settings.rec_list_window.show_title_text) {
      this.contents.fontSize = 20;
      if (this.isVisible(rec_cg)) {
        this.changeTextColor(ColorManager.normalColor());
        var title = rec_cg.title;
        if (ConfigManager.language == "en" && rec_cg.titleEn) {
          title = rec_cg.titleEn;
        }
        if (false) {
          var hint = rec_cg.hint;
          var hints = hint.split("\n");
          if (hints.length > 1) {
            this.contents.drawText(
              hints[0],
              rect.x + 4,
              rect.y + this.itemHeight() - 62,
              this.itemWidth(),
              32,
              "center"
            );
            this.contents.drawText(
              hints[1],
              rect.x + 4,
              rect.y + this.itemHeight() - 38,
              this.itemWidth(),
              32,
              "center"
            );
          } else {
            this.contents.drawText(
              rec_cg.hint,
              rect.x + 4,
              rect.y + this.itemHeight() - 52,
              this.itemWidth(),
              32,
              "center"
            );
          }
        } else {
          this.contents.drawText(
            title,
            rect.x + 4,
            rect.y + this.itemHeight() - 36,
            this.itemWidth(),
            32,
            rngd_recollection_mode_settings.rec_list_window.title_text_align
          );
        }
      } else {
        this.contents.drawText(
          rngd_recollection_mode_settings.rec_list_window
            .never_watch_title_text,
          rect.x + 4,
          rect.y + 4,
          this.itemWidth(),
          32,
          rngd_recollection_mode_settings.rec_list_window.title_text_align
        );
        this.changeTextColor(ColorManager.textColor(7));
        if (rec_cg.hint) {
          var hint = rec_cg.hint;
          var hints = hint.split("\n");
          if (hints.length > 1) {
            this.contents.drawText(
              hints[0],
              rect.x + 4,
              rect.y + this.itemHeight() - 62,
              this.itemWidth(),
              32,
              "center"
            );
            this.contents.drawText(
              hints[1],
              rect.x + 4,
              rect.y + this.itemHeight() - 38,
              this.itemWidth(),
              32,
              "center"
            );
          } else {
            this.contents.drawText(
              rec_cg.hint,
              rect.x + 4,
              rect.y + this.itemHeight() - 36,
              this.itemWidth(),
              32,
              "center"
            );
          }
        }
      }
      text_height = 32;
    }
    // CGセットのスイッチ番号が、全てのセーブデータを走査した後にTrueであればピクチャ表示
    if (this.isVisible(rec_cg)) {
      var thumbnail_file_name = rec_cg.pictures[0];
      if (rec_cg.thumbnail !== undefined && rec_cg.thumbnail !== null) {
        thumbnail_file_name = rec_cg.thumbnail;
      }
      this.drawRecollection(
        thumbnail_file_name,
        0,
        0,
        300,
        188,
        rect.x - 10,
        rect.y - 5 + text_height,
        rec_cg.paso
      );
    } else {
      this.drawRecollection(
        rngd_recollection_mode_settings.rec_list_window
          .never_watch_picture_name,
        0,
        0,
        300,
        188,
        rect.x - 10,
        rect.y - 5 + text_height,
        rec_cg.paso
      );
    }
  };
  Window_RecList2.prototype.get_global_variables = function () {
    this._global_variables = {
      switches: {},
    };
    var info = DataManager._globalInfo;
    //p(info)
    info[99] = info[99] || {};
    var rec_cg_max = rngd_recollection_mode_settings.rec_cg_set.length;
    for (var j = 0; j < rec_cg_max; j++) {
      var cg = rngd_recollection_mode_settings.rec_cg_set[j];
      if (info[99][cg.switch_id]) {
        this._global_variables["switches"][cg.switch_id] = true;
      }
    }
  };
  Window_RecList2.prototype.isShowAll = function () {
    if (Nore.isTaikenban()) {
      return false;
    }
    return ConfigManager.openRecollection;
  };
  Window_RecList2.prototype.selectedInfo = function () {
    return this._data[this.index()];
  };
  return Window_RecList2;
})(Window_Selectable);
Scene_Title.prototype.commandRecollection = function () {
  SceneManager.push(Scene_Recollection2);
};