code:
var MAN_PARAMS = {
  18: {
    name: "Yoshio",
    kiss: 12,
    chichi: 21,
    cri: 21,
    manko: 14,
    anal: 10,
    sm: 12,
    skill1: "Lolicon",
    skill2: "Likes raw",
    skill3: "",
    level: 0,
    price: 0,
    job: "former Yakuza",
    jobEn: "former Yakuza",
    type: "Scum",
  },
  19: {
    name: "Busujima",
    kiss: 30,
    chichi: 14,
    cri: 10,
    manko: 10,
    anal: 12,
    sm: 15,
    skill1: "Likes raw",
    skill2: "Rough",
    skill3: "Voyeur",
    level: 0,
    price: 0,
    job: "Sports Teacher",
    jobEn: "Sports Teacher",
    type: "Scum",
  },
  20: {
    name: "Taro",
    kiss: 21,
    chichi: 10,
    cri: 13,
    manko: 15,
    anal: 3,
    sm: 4,
    skill1: "Likes mature",
    skill2: "Likes cuckold",
    skill3: "Cunnilingus expert",
    level: 0,
    price: 0,
    job: "part-time worker",
    jobEn: "part-time worker",
    type: "Scum",
  },
  21: {
    name: "Oliver",
    kiss: 2,
    chichi: 3,
    cri: 4,
    manko: 25,
    anal: 27,
    sm: 13,
    skill1: "Big dick",
    skill2: "Strongman",
    skill3: "",
    level: 0,
    price: 0,
    job: "illegal resident",
    jobEn: "illegal resident",
    type: "Foreigner",
  },
  50: {
    name: "Yaku Shimaru Numao",
    kiss: 2,
    chichi: 9,
    cri: 24,
    manko: 30,
    anal: 7,
    sm: 6,
    skill1: "Smegma",
    skill2: "Likes raw",
    skill3: "",
    level: 10,
    price: 30,
    job: "Yakuza Associate Member",
    jobEn: "Yakuza Associate Member",
    type: "Scum",
  },
  51: {
    name: "Shige-san",
    kiss: 2,
    chichi: 3,
    cri: 5,
    manko: 3,
    anal: 5,
    sm: 25,
    skill1: "Likes urine",
    skill2: "Likes big breasts",
    skill3: "",
    level: 1,
    price: 75,
    job: "temporary worker",
    jobEn: "temporary worker",
    type: "Polite",
  },
  52: {
    name: "Takahashi Munashi",
    kiss: 3,
    chichi: 5,
    cri: 4,
    manko: 5,
    anal: 25,
    sm: 18,
    skill1: "Voyeur",
    skill2: "Likes breasts",
    skill3: "Likes restraint",
    level: 1,
    price: 105,
    job: "plumber",
    jobEn: "plumber",
    type: "Old man",
  },
  1: {
    name: "Shinji",
    kiss: 15,
    chichi: 14,
    cri: 11,
    manko: 21,
    anal: 15,
    sm: 5,
    skill1: "Likes breasts",
    skill2: "Likes big breasts",
    skill3: "Kiss fiend",
    level: 2,
    price: 230,
    job: "??student",
    jobEn: "??student",
    type: "Child",
  },
  5: {
    name: "Ren",
    kiss: 14,
    chichi: 30,
    cri: 6,
    manko: 0,
    anal: 12,
    sm: 0,
    skill1: "Likes breasts",
    skill2: "Small size",
    skill3: "Lots of semen",
    level: 0,
    price: 0,
    job: "??student",
    jobEn: "??student",
    type: "Child",
  },
  3: {
    name: "Yuzuki",
    kiss: 22,
    chichi: 3,
    cri: 5,
    manko: 16,
    anal: 31,
    sm: 25,
    skill1: "Cunnilingus expert",
    skill2: "Masochist",
    skill3: "Small size",
    level: 0,
    price: 0,
    job: "??student",
    jobEn: "??student",
    type: "Child",
  },
  53: {
    name: "Oda Nobbu",
    kiss: 15,
    chichi: 19,
    cri: 23,
    manko: 30,
    anal: 0,
    sm: 0,
    skill1: "Intellectual",
    skill2: "Shota lover",
    skill3: "",
    level: 1,
    price: 180,
    job: "store clerk",
    jobEn: "store clerk",
    type: "Polite",
  },
  22: {
    name: "Debuo",
    kiss: 21,
    chichi: 14,
    cri: 3,
    manko: 12,
    anal: 4,
    sm: 15,
    skill1: "Lolicon",
    skill2: "Prostitution",
    skill3: "Shota lover",
    level: 0,
    price: 250,
    job: "Hero Association Staff",
    jobEn: "Hero Association Staff",
    type: "Polite",
  },
  48: {
    name: "Kuzuo",
    kiss: 3,
    chichi: 12,
    cri: 15,
    manko: 18,
    anal: 25,
    sm: 25,
    skill1: "Lolicon",
    skill2: "Prostitution",
    skill3: "Rough",
    level: 0,
    price: 300,
    job: "Hero Association Staff",
    jobEn: "Hero Association Staff",
    type: "Scum",
  },
  49: {
    name: "Gario",
    kiss: 31,
    chichi: 18,
    cri: 18,
    manko: 21,
    anal: 8,
    sm: 15,
    skill1: "Lolicon",
    skill2: "Prostitution",
    skill3: "Exhibitionist",
    level: 0,
    price: 400,
    job: "Hero Association Staff",
    jobEn: "Hero Association Staff",
    type: "Polite",
  },
  16: {
    name: "Kazuo",
    kiss: 12,
    chichi: 3,
    cri: 25,
    manko: 11,
    anal: 2,
    sm: 29,
    skill1: "Voyeur",
    skill2: "Rough",
    skill3: "Sadist",
    level: 0,
    price: 0,
    job: "unemployed",
    jobEn: "unemployed",
    type: "Scum",
  },
  54: {
    name: "Suzuki Gonzo",
    kiss: 12,
    chichi: 4,
    cri: 31,
    manko: 12,
    anal: 4,
    sm: 35,
    skill1: "Rough",
    skill2: "Likes big breasts",
    skill3: "Exhibitionist",
    level: 2,
    price: 600,
    job: "scaffold erector",
    jobEn: "scaffold erector",
    type: "Old man",
  },
  55: {
    name: "Anal no Yashichi",
    kiss: 31,
    chichi: 23,
    cri: 13,
    manko: 10,
    anal: 28,
    sm: 15,
    skill1: "Likes anal",
    skill2: "Likes mature",
    skill3: "",
    level: 2,
    price: 800,
    job: "unemployed",
    jobEn: "unemployed",
    type: "Old man",
  },
  56: {
    name: "Gonzalez",
    kiss: 13,
    chichi: 31,
    cri: 15,
    manko: 3,
    anal: 22,
    sm: 24,
    skill1: "Big dick",
    skill2: "Likes restraint",
    skill3: "",
    level: 3,
    price: 700,
    job: "bouncer",
    jobEn: "bouncer",
    type: "Foreigner",
  },
  57: {
    name: "Andre",
    kiss: 16,
    chichi: 8,
    cri: 28,
    manko: 26,
    anal: 12,
    sm: 21,
    skill1: "Shota lover",
    skill2: "Smegma",
    skill3: "",
    level: 3,
    price: 1000,
    job: "Yakuza Associate Member",
    jobEn: "Yakuza Associate Member",
    type: "Foreigner",
  },
  2: {
    name: "Takuo",
    kiss: 21,
    chichi: 16,
    cri: 17,
    manko: 12,
    anal: 16,
    sm: 11,
    skill1: "Likes outdoor",
    skill2: "Voyeur",
    skill3: "Lolicon",
    level: 2,
    price: 750,
    job: "unemployed",
    jobEn: "unemployed",
    type: "Scum",
  },
  26: {
    name: "Min",
    kiss: 11,
    chichi: 4,
    cri: 1,
    manko: 3,
    anal: 21,
    sm: 37,
    skill1: "Hypnosis",
    skill2: "",
    skill3: "",
    level: 0,
    price: 900,
    job: "hypnotist",
    jobEn: "hypnotist",
    type: "Polite",
  },
  61: {
    name: "King under the Bridge",
    kiss: 21,
    chichi: 24,
    cri: 21,
    manko: 2,
    anal: 0,
    sm: 15,
    skill1: "Prostitution",
    skill2: "Kiss fiend",
    skill3: "",
    level: 3,
    price: 800,
    job: "company executive",
    jobEn: "company executive",
    type: "Scum",
  },
  24: {
    name: "Tagosaku",
    kiss: 19,
    chichi: 1,
    cri: 6,
    manko: 14,
    anal: 32,
    sm: 23,
    skill1: "Vagrant",
    skill2: "Likes outdoor",
    skill3: "",
    level: 2,
    price: 777,
    job: "vagrant",
    jobEn: "vagrant",
    type: "Old man",
  },
  8: {
    name: "Senri",
    kiss: 0,
    chichi: 0,
    cri: 0,
    manko: 0,
    anal: 0,
    sm: 0,
    skill1: "",
    skill2: "",
    skill3: "",
    level: 0,
    price: 0,
    job: "",
    jobEn: "",
    type: "",
  },
};
function findManSkill(name) {
  for (var i = 10; i <= 100; i++) {
    var skill = $dataSkills[i];
    if (!skill) {
      continue;
    }
    if (skill.name == name) {
      return skill;
    }
  }
  return null;
}
var ManParamOne = /** @class */ (function () {
  function ManParamOne(type, value) {
    this.type = type;
    this.value = value;
  }
  return ManParamOne;
})();
var FriendshipLevel;
(function (FriendshipLevel) {
  FriendshipLevel[(FriendshipLevel["NONE"] = -1)] = "NONE";
  FriendshipLevel[(FriendshipLevel["E"] = 0)] = "E";
  FriendshipLevel[(FriendshipLevel["D"] = 1)] = "D";
  FriendshipLevel[(FriendshipLevel["C"] = 2)] = "C";
  FriendshipLevel[(FriendshipLevel["B"] = 3)] = "B";
  FriendshipLevel[(FriendshipLevel["A"] = 4)] = "A";
  FriendshipLevel[(FriendshipLevel["S"] = 5)] = "S";
})(FriendshipLevel || (FriendshipLevel = {}));
function getManDouseiSkill(actorId, friendship) {
  var param = MAN_PARAMS[actorId];
  if (!param) {
    console.error(actorId + "のmanが見つかりません");
    return [];
  }
  var result = [];
  var list = [
    new ManParamOne(BodyType.kiss, param.kiss),
    new ManParamOne(BodyType.chichi, param.chichi),
    new ManParamOne(BodyType.cri, param.cri),
    //new ManParamOne(BodyType.manko, param.manko),
    new ManParamOne(BodyType.anal, param.anal),
    new ManParamOne(BodyType.sm, param.sm),
  ];
  list = list.sort(function (a, b) {
    return b.value - a.value;
  });
  result.push(BodyType.manko);
  result.push(list[0].type);
  //result.push(list[1].type);
  if ($gameSwitches.value(264)) {
    result.push(list[1].type);
    result.push(list[2].type);
    result.push(list[3].type);
    result.push(list[4].type);
    return result;
  }
  if (friendship >= FriendshipLevel.D) {
    result.push(list[1].type);
  }
  if (friendship >= FriendshipLevel.C) {
    result.push(list[2].type);
  }
  if (friendship >= FriendshipLevel.B) {
    result.push(list[3].type);
  }
  if (friendship >= FriendshipLevel.A) {
    result.push(list[4].type);
  }
  /*
    if (! result.contains(BodyType.manko)) {
        if (actorId == 19 || actorId == 5 || actorId == 16) {
            result.push(BodyType.manko);
        }
    }*/
  return result;
}


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 ManCommand;
(function (ManCommand) {
  ManCommand["soupKichen"] = "soupKichen";
  ManCommand["manage"] = "manage";
})(ManCommand || (ManCommand = {}));
var Window_ManCommand = /** @class */ (function (_super) {
  __extends(Window_ManCommand, _super);
  function Window_ManCommand() {
    var _this = this;
    var r = new Rectangle(Nore.MAIN_MENU_W, Nore.TOP_Y, 220, 146);
    _this = _super.call(this, r) || this;
    _this.makeCommandList();
    _this.refresh();
    _this.hide();
    return _this;
  }
  Window_ManCommand.prototype.itemHeight = function () {
    return 60;
  };
  Window_ManCommand.prototype.makeCommandList = function () {
    var enable =
      !$slg.manInfo().soupKichen().isEmpty() &&
      $slg.manInfo().soupKichen().isEnabled();
    this.addCommand(TextManager.manageMan, ManCommand.manage, true);
    this.addCommand(TextManager.soupKichen, ManCommand.soupKichen, enable);
  };
  Window_ManCommand.prototype.resetFontSettings = function () {
    this.contents.fontFace = $gameSystem.mainFontFace();
    this.contents.fontSize = 22;
    this.resetTextColor();
  };
  return Window_ManCommand;
})(Window_Command);
var Window_ManList = /** @class */ (function (_super) {
  __extends(Window_ManList, _super);
  function Window_ManList() {
    var _this = this;
    var r = new Rectangle(
      Nore.MAIN_MENU_W + 222,
      Nore.TOP_Y,
      260,
      800 - Nore.TOP_Y
    );
    _this = _super.call(this, r) || this;
    _this.makeData();
    _this.refresh();
    _this.hide();
    return _this;
  }
  Window_ManList.prototype.setManInfoWindow = function (infoWindow) {
    this._infoWindow = infoWindow;
    this.select(0);
  };
  Window_ManList.prototype.setManParamWindow = function (manParamWindow) {
    this._manParamWindow = manParamWindow;
  };
  Window_ManList.prototype.makeData = function () {
    this._manList = $slg.manInfo().manList();
  };
  Window_ManList.prototype.maxItems = function () {
    if (!this._manList || this._manList.length == 0) {
      return 1;
    }
    return this._manList.length;
  };
  Window_ManList.prototype.drawItem = function (index) {
    this.contents.fontSize = 20;
    var man = this._manList[index];
    var rect = this.itemRect(index);
    this.resetTextColor();
    this.drawIcon(man.iconIndex(), rect.x + 2, rect.y + 2);
    this.drawText(man.name(), rect.x + 40, rect.y, rect.width);
  };
  Window_ManList.prototype.selectedMan = function () {
    if (!this._manList) {
      return null;
    }
    return this._manList[this.index()];
  };
  Window_ManList.prototype.select = function (index) {
    var lastIndex = this.index();
    _super.prototype.select.call(this, index);
    if (lastIndex == index) {
      return;
    }
    var actor = this.selectedMan();
    if (this._infoWindow && actor) {
      this._infoWindow.setMan(actor);
    }
    if (this._manParamWindow && actor) {
      this._manParamWindow.setMan(actor);
    }
  };
  Window_ManList.prototype.show = function () {
    _super.prototype.show.call(this);
    var actor = this.selectedMan();
    if (this._infoWindow && actor) {
      this._infoWindow.setMan(actor);
    }
    if (this._manParamWindow && actor) {
      this._manParamWindow.setMan(actor);
    }
  };
  return Window_ManList;
})(Window_Selectable);
var ManSyusan = /** @class */ (function () {
  function ManSyusan(manId, actorId) {
    this._manId = manId;
    this._actorId = actorId;
    this.calcManSysan();
    this.countNakadashi();
    this.calcFriendship();
  }
  ManSyusan.prototype.calcManSysan = function () {
    this._babyList = [];
    var actor = $gameActors.actor(this._actorId);
    for (var _i = 0, _a = actor.babyList(); _i < _a.length; _i++) {
      var baby = _a[_i];
      if (baby.taneoyaId() == this._manId) {
        this._babyList.push(baby);
      }
    }
  };
  ManSyusan.prototype.calcFriendship = function () {
    var actor = $gameActors.actor(this._actorId);
    this._friendshipLevel = actor.friendshipLevel(this._manId);
  };
  ManSyusan.prototype.babyList = function () {
    return this._babyList;
  };
  ManSyusan.prototype.actorName = function () {
    var actor = $gameActors.actor(this._actorId);
    return actor.name();
  };
  ManSyusan.prototype.actorIconIndex = function () {
    var actor = $gameActors.actor(this._actorId);
    return actor.iconIndex();
  };
  ManSyusan.prototype.countNakadashi = function () {
    this._nakadashi = 0;
    var actor = $gameActors.actor(this._actorId);
    var history = actor.dousei().history(this._manId);
    if (history) {
      this._nakadashi += history.count(DouseiPlayId.sex);
    }
    var avList = $slg.avInfo().actorAvList(this._actorId);
    for (var _i = 0, avList_1 = avList; _i < avList_1.length; _i++) {
      var av = avList_1[_i];
      if (av.mainManId() == this._manId) {
        this._nakadashi += av.nakadashi();
      }
    }
  };
  ManSyusan.prototype.nakadashi = function () {
    return this._nakadashi;
  };
  ManSyusan.prototype.friendshipLevel = function () {
    return this._friendshipLevel;
  };
  return ManSyusan;
})();
var Window_ManInfo = /** @class */ (function (_super) {
  __extends(Window_ManInfo, _super);
  function Window_ManInfo() {
    var r = new Rectangle(Nore.MAIN_MENU_W + 486, Nore.TOP_Y + 372, 460, 384);
    return _super.call(this, r) || this;
  }
  Window_ManInfo.prototype.setMan = function (actor) {
    this._actor = actor;
    this.refresh();
  };
  Window_ManInfo.prototype.refresh = function () {
    this.contents.clear();
    this.drawName(20, 6);
    this.drawJob(230, 6);
    this.drawLabel(20, 6);
    this.drawSyusanList(20, 70);
  };
  Window_ManInfo.prototype.drawName = function (x, y) {
    this.contents.fontSize = 26;
    this.drawIcon(this._actor.iconIndex(), x, y);
    this.drawText(this._actor.name(), x + 40, y, 130);
  };
  Window_ManInfo.prototype.drawJob = function (x, y) {
    this.contents.fontSize = 20;
    this.drawText(this._actor.job(), x, y, 185);
  };
  Window_ManInfo.prototype.valueInterval = function () {
    return 95;
  };
  Window_ManInfo.prototype.drawLabel = function (x, y) {
    this.contents.fontSize = 20;
    //this.drawText(TextManager.manExperience, x, y, 200);
    this.contents.fontSize = 18;
    var ww = 85;
    this.drawText(TextManager.douseiFriendship, x + 110, y + 36, ww, "right");
    this.drawText(
      getEroParamTitle(EroType.nakadashi).label(),
      x + this.valueInterval() * 2 + 20,
      y + 36,
      ww,
      "right"
    );
    var xx = x + this.valueInterval() * 3 + 20;
    if (ConfigManager.language == "en") {
      xx += 10;
    }
    this.drawText(
      getEroParamTitle(EroType.syusan).label(),
      xx,
      y + 36,
      ww,
      "right"
    );
  };
  Window_ManInfo.prototype.drawSyusanList = function (x, y) {
    this.contents.fontSize = 20;
    var yy = y;
    var list = this.calcManSysanList();
    for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
      var syusan = list_1[_i];
      this.drawSyusan(x, yy, syusan);
      yy += 40;
    }
  };
  Window_ManInfo.prototype.drawSyusan = function (x, y, syusan) {
    this.drawIcon(syusan.actorIconIndex(), x, y);
    this.drawText(syusan.actorName(), x + 40, y, 200);
    var icon = this.friendshipIcon(syusan.friendshipLevel());
    this.drawIcon(icon, x + 154, y + 5);
    var xx = 74 + x;
    //this.drawText(syusan.friendshipLevel(), x + 50, y, 120, 'right');
    this.drawText(
      this.numberText(syusan.nakadashi()),
      xx + this.valueInterval(),
      y,
      120,
      "right"
    );
    this.drawText(
      this.numberText(syusan.babyList().length),
      xx + this.valueInterval() * 2,
      y,
      120,
      "right"
    );
  };
  Window_ManInfo.prototype.numberText = function (n) {
    if (n == 0) {
      return "-";
    }
    return n;
  };
  Window_ManInfo.prototype.calcManSysanList = function () {
    var result = [];
    for (var _i = 0, _a = $gameParty.getActorIdList(); _i < _a.length; _i++) {
      var actorId = _a[_i];
      result.push(new ManSyusan(this._actor.actorId(), actorId));
    }
    return result;
  };
  return Window_ManInfo;
})(Window_Base);
var Window_SoupKichenList = /** @class */ (function (_super) {
  __extends(Window_SoupKichenList, _super);
  function Window_SoupKichenList() {
    var _this = this;
    var r = new Rectangle(Nore.MAIN_MENU_W + 222, Nore.TOP_Y, 260, 490);
    _this = _super.call(this, r) || this;
    _this.makeData();
    _this.refresh();
    _this.hide();
    return _this;
  }
  Window_SoupKichenList.prototype.setManParamWindow = function (
    manParamWindow
  ) {
    this._manParamWindow = manParamWindow;
  };
  Window_SoupKichenList.prototype.makeData = function () {
    this._manList = $slg.manInfo().soupKichen().manList();
  };
  Window_SoupKichenList.prototype.maxItems = function () {
    if (!this._manList || this._manList.length == 0) {
      return 1;
    }
    return this._manList.length;
  };
  Window_SoupKichenList.prototype.refresh = function () {
    _super.prototype.refresh.call(this);
    if (this.index() >= this._manList.length) {
      this.select(this._manList.length - 1);
    }
  };
  Window_SoupKichenList.prototype.itemHeight = function () {
    return 60;
  };
  Window_SoupKichenList.prototype.resetFontSettings = function () {
    this.contents.fontFace = $gameSystem.mainFontFace();
    this.contents.fontSize = 22;
    this.resetTextColor();
  };
  Window_SoupKichenList.prototype.drawItem = function (index) {
    var man = this._manList[index];
    var rect = this.itemRect(index);
    this.resetTextColor();
    if (man) {
      this.drawIcon(man.iconIndex(), rect.x + 2, rect.y + 8);
      this.drawText(man.name(), rect.x + 40, rect.y - 4, rect.width);
      this.contents.fontSize = 16;
      this.drawText(man.job(), rect.x + 40, rect.y + 20, 90);
      this.contents.fontSize = 16;
      this.drawIcon(Icon.gold, rect.x + 134, rect.y + 22);
      this.drawText(
        man.price() + "Ｇ",
        rect.x - 10,
        rect.y + 20,
        rect.width,
        "right"
      );
      if (man.isOsusume()) {
        this.changeTextColor(ColorManager.crisisColor());
        this.drawText("Recommended", rect.x - 10, rect.y - 8, rect.width, "right");
      }
    } else {
      this.contents.fontSize = 18;
      if ($slg.manInfo().soupKichen().isEnabled()) {
        this.drawText(TextManager.noSoupKichenMan, rect.x, rect.y, rect.width);
      } else {
        this.drawText(
          TextManager.noSoupKichenFacility,
          rect.x,
          rect.y,
          rect.width
        );
      }
    }
  };
  Window_SoupKichenList.prototype.selectedMan = function () {
    return this._manList[this.index()];
  };
  Window_SoupKichenList.prototype.isCurrentItemEnabled = function () {
    return this.selectedMan() != null;
  };
  Window_SoupKichenList.prototype.show = function () {
    _super.prototype.show.call(this);
    var man = this.selectedMan();
    if (!man) {
      return;
    }
    var actor = man.actor();
    if (this._manParamWindow && actor) {
      this._manParamWindow.setMan(actor);
    }
  };
  return Window_SoupKichenList;
})(Window_Selectable);
var SoupKichenCommand;
(function (SoupKichenCommand) {
  SoupKichenCommand["hire"] = "hire";
  SoupKichenCommand["cancel"] = "cancel";
})(SoupKichenCommand || (SoupKichenCommand = {}));
var Window_SoupKichenCommand = /** @class */ (function (_super) {
  __extends(Window_SoupKichenCommand, _super);
  function Window_SoupKichenCommand() {
    var _this = this;
    var r = new Rectangle(Nore.MAIN_MENU_W + 486 - 26, Nore.TOP_Y, 260, 190);
    _this = _super.call(this, r) || this;
    _this.refresh();
    _this.hide();
    return _this;
  }
  Window_SoupKichenCommand.prototype.itemHeight = function () {
    return 60;
  };
  Window_SoupKichenCommand.prototype.makeCommandList = function () {
    if (!this._man) {
      return;
    }
    var enable = this._man.price() <= $gameParty.gold();
    this.addCommand(
      TextManager.hireMan.format(this._man.price()),
      SoupKichenCommand.hire,
      enable
    );
    this.addCommand(TextManager.cancel, SoupKichenCommand.cancel, true);
  };
  Window_SoupKichenCommand.prototype.resetFontSettings = function () {
    this.contents.fontFace = $gameSystem.mainFontFace();
    this.contents.fontSize = 22;
    this.resetTextColor();
  };
  Window_SoupKichenCommand.prototype.setMan = function (man) {
    this._man = man;
    this.refresh();
  };
  Window_SoupKichenCommand.prototype.playOkSound = function () {
    if (this.index() == 1) {
      SoundManager.playCancel();
    }
  };
  Window_SoupKichenCommand.prototype.hire = function () {
    SoundManager.playShop();
    $gameParty.loseGold(this._man.price());
    $slg.manInfo().hire(this._man);
  };
  return Window_SoupKichenCommand;
})(Window_Command);

repo_name: onms/dead

license: unknown


code:
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
var MANKO_ID_LIST = [100, 300, 500, 700, 1000, 1500, 2000];
var ANAL_ID_LIST = [100, 200, 400, 600, 900, 1300, 1600];
var NAKADASHI_COUNT_ACCE_LIST = [1101, 1102, 1103, 1104, 1105];
var DEPRAVITY_LIST = [20, 40, 60, 80];
var REPUTATION_LIST = [200, 400, 600, 800];
var Nore;
(function (Nore) {
  var MankoSprite = /** @class */ (function (_super) {
    __extends(MankoSprite, _super);
    function MankoSprite(status) {
      var _this = _super.call(this) || this;
      _this._showActionWait = 0;
      _this._actionFaceId = -1;
      _this._status = status;
      _this._frame.width = 300;
      _this._frame.height = 350;
      _this.refresh();
      return _this;
    }
    MankoSprite.prototype.refresh = function () {
      this.removeChildren();
      this.createBackImage();
      this.createBaseImage();
      this.createInmonImage();
      this.createChikubiImage();
      this.createMankoImage();
      this.createAnalImage();
      this.createKuriRingImage();
      this.createNippleRingImage();
      this.createYakiinImage();
      this.createIrezumiImage();
      this.createIrezumi2Image();
      this.createHesoImage();
      this.createSyusanImage();
      this.createKubiwaImage();
      this.createHoppeImage();
      this.createFaceImage();
      this.createKuchiImage();
      this.createNamidaImage();
      this.createMankoRingImage();
      this.createMekakushiImage();
      this.createNakadashiRakugakiImage();
      this.createBontageImage();
      this.createNoseHookImage();
      this.createActionImage();
    };
    MankoSprite.prototype.createBackImage = function () {
      this._backSprite = new PIXI.Sprite(this.getBackImage());
      this.addChild(this._backSprite);
    };
    MankoSprite.prototype.createSyusanImage = function () {
      this._syusanSprite = this.getSyusanSprite();
      if (this._syusanSprite) {
        this.addChild(this._syusanSprite);
      }
    };
    MankoSprite.prototype.createBaseImage = function () {
      this._baseSprite = new PIXI.Sprite(this.getBaseImage());
      this.addChild(this._baseSprite);
    };
    MankoSprite.prototype.createInmonImage = function () {
      this._inmonSprite = new PIXI.Sprite(this.getInmonImage());
      this.addChild(this._inmonSprite);
    };
    MankoSprite.prototype.createChikubiImage = function () {
      this._chikubiSprite = new PIXI.Sprite(this.getChikubiImage());
      this._chikubiSprite.alpha = this._status.chikubiKuroImageAlpha();
      this.addChild(this._chikubiSprite);
    };
    MankoSprite.prototype.createAnalImage = function () {
      this._analSprite = new PIXI.Sprite(this.getAnalImage());
      this.addChild(this._analSprite);
    };
    MankoSprite.prototype.createMankoImage = function () {
      this._mankoSprite = new PIXI.Sprite(this.getMankoImage());
      this.addChild(this._mankoSprite);
      this._mankoKuroSprite = new PIXI.Sprite(this.getMankoKuroImage());
      this._mankoKuroSprite.alpha = this._status.mankoKuroImageAlpha();
      this.addChild(this._mankoKuroSprite);
    };
    MankoSprite.prototype.createIrezumiImage = function () {
      this._irezumiSprite = new PIXI.Sprite(this.getIrezumiImage());
      this.addChild(this._irezumiSprite);
    };
    MankoSprite.prototype.createIrezumi2Image = function () {
      this._irezumi2Sprite = new PIXI.Sprite(this.getIrezumi2Image());
      this.addChild(this._irezumi2Sprite);
    };
    MankoSprite.prototype.createMankoRingImage = function () {
      this._labiaSprite = new PIXI.Sprite(this.getLabiaImage());
      this.addChild(this._labiaSprite);
    };
    MankoSprite.prototype.createYakiinImage = function () {
      this._yakiinSprite = new PIXI.Sprite(this.getYakiinImage());
      this.addChild(this._yakiinSprite);
    };
    MankoSprite.prototype.createNippleRingImage = function () {
      this._nippleSprite = new PIXI.Sprite(this.getNippleImage());
      this.addChild(this._nippleSprite);
    };
    MankoSprite.prototype.createKuriRingImage = function () {
      this._kuriSprite = new PIXI.Sprite(this.getKuriRingImage());
      this.addChild(this._kuriSprite);
    };
    MankoSprite.prototype.createHesoImage = function () {
      this._hesoSprite = new PIXI.Sprite(this.getHesoImage());
      this.addChild(this._hesoSprite);
    };
    MankoSprite.prototype.createKubiwaImage = function () {};
    MankoSprite.prototype.createHoppeImage = function () {
      this._hoppeSprite = new PIXI.Sprite(this.getHoppeImage());
      this.addChild(this._hoppeSprite);
    };
    MankoSprite.prototype.createNamidaImage = function () {
      this._namidaSprite = new PIXI.Sprite(this.getNamidaImage());
      this.addChild(this._namidaSprite);
    };
    MankoSprite.prototype.createFaceImage = function () {
      this._faceSprite = new PIXI.Sprite(this.getFaceImage());
      this.addChild(this._faceSprite);
    };
    MankoSprite.prototype.createKuchiImage = function () {
      this._kuchiSprite = new PIXI.Sprite(this.getKuchiImage());
      this.addChild(this._kuchiSprite);
    };
    MankoSprite.prototype.createMekakushiImage = function () {
      this._mekakushiSprite = new PIXI.Sprite(this.getMekakushiImage());
      this.addChild(this._mekakushiSprite);
    };
    MankoSprite.prototype.createNakadashiRakugakiImage = function () {
      this._rakugakiSprite = new PIXI.Sprite(this.getNakadashiRakugakiImage());
      this.addChild(this._rakugakiSprite);
    };
    MankoSprite.prototype.createBontageImage = function () {
      this._bontageSprite = new PIXI.Sprite(this.getBontageImage());
      this.addChild(this._bontageSprite);
    };
    MankoSprite.prototype.createActionImage = function () {
      this._actionSprite = new PIXI.Sprite(this.getActionImage());
      this.addChild(this._actionSprite);
      this._actionSprite.visible = false;
    };
    MankoSprite.prototype.createNoseHookImage = function () {
      this._noseHookSprite = new PIXI.Sprite(this.getNoseHookImage());
      this.addChild(this._noseHookSprite);
    };
    MankoSprite.prototype.getBackImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var backId = 1;
      var text = "%1_%2_status_back_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        backId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getBaseImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var baseId = this._status.baseImageId();
      if (this._status.boteId() > 0) {
        var text = "%1_%2_status_bote_01.png".format(
          this.getEroActorId(actorId),
          eroId.padZero(2)
        );
        return PIXI.utils.TextureCache[text];
      } else {
        var text = "%1_%2_status_base_01.png".format(
          this.getEroActorId(actorId),
          eroId.padZero(2)
        );
        return PIXI.utils.TextureCache[text];
      }
    };
    MankoSprite.prototype.getChikubiImage = function () {
      /*if (! this._status.costume().isKuroChikubi()) {
                return null;
            }*/
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var chikubiId = 1;
      var text = "%1_%2_status_kuro_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        chikubiId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getInmonImage = function () {
      if (!this._status.costume().hasAcce(1013)) {
        return null;
      }
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var boteId = this._status.costume().boteId();
      var text = "%1_%2_status_inmon_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        boteId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getAnalImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var analId = this._status.analImageId();
      var text = "%1_%2_status_anal_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        analId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getEroActorId = function (actorId) {
      return "0" + actorId;
    };
    MankoSprite.prototype.getMankoImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var mankoId = this._status.mankoImageId();
      var text = "%1_%2_status_manko_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        mankoId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getMankoKuroImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var mankoId = this._status.mankoImageId();
      var text = "%1_%2_status_manko_k_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        mankoId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getIrezumiImage = function () {
      if (!this._status.hasAcce(1080)) {
        return null;
      }
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var boteId = this._status.boteId() + 1;
      var text = "%1_%2_status_irezumi_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        boteId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getIrezumi2Image = function () {
      if (!this._status.hasAcce(1081)) {
        return null;
      }
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var text = "%1_%2_status_irezumi_03.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getLabiaImage = function () {
      if (!this._status.hasAcce(1008)) {
        return null;
      }
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var mankoId = this._status.mankoImageId();
      var text = "%1_%2_status_labia_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        mankoId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getYakiinImage = function () {
      if (!this._status.hasAcce(1000) && !this._status.hasAcce(1001)) {
        return null;
      }
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var boteId = this._status.costume().boteId();
      var text = "%1_%2_yakiin_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        boteId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getNippleImage = function () {
      if (!this._status.hasAcce(1001) && !this._status.hasAcce(1002)) {
        return null;
      }
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var nippleId = 1;
      var text = "%1_%2_status_nipple_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        nippleId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getKuriRingImage = function () {
      if (!this._status.costume().hasAcce(1005)) {
        return null;
      }
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var mankoId = 1;
      /*if (this._status.day() == $gameSystem.day()) {
                mankoId = this._status.beforeMankoImageId();
            }*/
      var text = "%1_%2_status_kuri_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        mankoId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getSeiekiImage = function () {};
    MankoSprite.prototype.getSyusanSprite = function () {
      if (!this._status.costume().hasAcce(1021)) {
        return null;
      }
      var s = new PIXI.Sprite();
      var actorId = this._status.actorId();
      var actor = $gameActors.actor(actorId);
      var babyList = actor.babyList();
      for (var i = 0; i < babyList.length; i++) {
        var baby = babyList[i];
        if (!baby.isSyusan()) {
          continue;
        }
        var index = i + 1;
        var file = this.getSyusanAcceFile(index, baby.isMale());
        if (PIXI.utils.TextureCache[file + ".png"]) {
          s.addChild(new PIXI.Sprite(PIXI.utils.TextureCache[file + ".png"]));
        }
      }
      return s;
    };
    MankoSprite.prototype.getSyusanAcceFile = function (syusanCount, male) {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var boteId = this._status.costume().boteId();
      var actor = $gameActors.actor(actorId);
      if (male) {
        if (boteId == 0) {
          return "%1_%2_status_syusan_m_%3".format(
            this.getEroActorId(actorId),
            eroId.padZero(2),
            syusanCount.padZero(2)
          );
        } else {
          return "%1_%2_status_syusan_m_%3_b".format(
            this.getEroActorId(actorId),
            eroId.padZero(2),
            syusanCount.padZero(2),
            boteId
          );
        }
      } else {
        if (boteId == 0) {
          return "%1_%2_status_syusan_f_%3".format(
            this.getEroActorId(actorId),
            eroId.padZero(2),
            syusanCount.padZero(2)
          );
        } else {
          return "%1_%2_status_syusan_f_%3_b".format(
            this.getEroActorId(actorId),
            eroId.padZero(2),
            syusanCount.padZero(2),
            boteId
          );
        }
      }
    };
    MankoSprite.prototype.getHesoImage = function () {
      if (!this._status.hasAcce(1003) && !this._status.hasAcce(1004)) {
        return null;
      }
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var boteId = this._status.costume().boteId() + 1;
      var text = "%1_%2_status_heso_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        boteId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getBontageImage = function () {
      if (this._status.outerId() != "c") {
        return null;
      }
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var boteId = 1;
      if (this._status.actorId() == 4 && this._status.boteId() > 0) {
        boteId = 2;
      }
      var text = "%1_%2_status_bontage_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        boteId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getActionImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var actionId = 1;
      var text = "%1_%2_status_action_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        actionId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getFaceImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var faceId = this._status.faceId();
      if (this._actionFaceId > 0) {
        faceId = this._actionFaceId;
      }
      if (this._status.isNoHightlight()) {
        var text_1 = "%1_%2_status_face_%3_n.png".format(
          this.getEroActorId(actorId),
          eroId.padZero(2),
          faceId.padZero(2)
        );
        if (PIXI.utils.TextureCache[text_1]) {
          return PIXI.utils.TextureCache[text_1];
        }
      }
      if (this._status.isBottomHightlight()) {
        var text_2 = "%1_%2_status_face_%3_l.png".format(
          this.getEroActorId(actorId),
          eroId.padZero(2),
          faceId.padZero(2)
        );
        if (PIXI.utils.TextureCache[text_2]) {
          return PIXI.utils.TextureCache[text_2];
        }
      }
      var text = "%1_%2_status_face_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        faceId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getKuchiImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var kuchiId = this._status.kuchiId();
      var text = "%1_%2_status_kuchi_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        kuchiId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getMekakushiImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var mekakushiId = this._status.mekakushiId();
      var text = "%1_%2_status_mekakushi_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        mekakushiId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getHoppeImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var hoppeId = this._status.hoppeId();
      if (this._showActionWait > 0) {
        hoppeId = 2;
      }
      var text = "%1_%2_status_hoppe_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        hoppeId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getNamidaImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var namidaId = this._status.namidaId();
      var text = "%1_%2_status_namida_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        namidaId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getNoseHookImage = function () {
      if (!this._status.hasAcce(1009)) {
        return null;
      }
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var text = "%1_%2_status_nose_01.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getNakadashiRakugakiImage = function () {
      var actorId = this._status.actorId();
      var eroId = this.getEroImageId();
      var cos = this._status.costume();
      var nakadashi = this.getNakadashiRakugakiImageId(cos);
      var text = "%1_%2_status_naka_%3.png".format(
        this.getEroActorId(actorId),
        eroId.padZero(2),
        nakadashi.padZero(2)
      );
      return PIXI.utils.TextureCache[text];
    };
    MankoSprite.prototype.getNakadashiRakugakiImageId = function (cos) {
      var count = 0;
      for (var i = 0; i < NAKADASHI_COUNT_ACCE_LIST.length; i++) {
        var acce = NAKADASHI_COUNT_ACCE_LIST[i];
        if (cos._acceMap[acce]) {
          count++;
        } else {
          return count;
        }
      }
      return count;
    };
    MankoSprite.prototype.getEroImageId = function () {
      switch (this._status.actorId()) {
        case 4:
          return 13;
        case 8:
          return 7;
        case 9:
          return 5;
        case 10:
          return 11;
        case 11:
          return 11;
        case 13:
          return 14;
        case 17:
          return 1;
      }
      return 0;
    };
    MankoSprite.prototype.destroy = function () {
      this.removeChildren();
      _super.prototype.destroy.call(this);
    };
    MankoSprite.prototype.update = function () {
      _super.prototype.update.call(this);
      this.updateAction();
      this.updateTouch();
    };
    MankoSprite.prototype.updateAction = function () {
      if (this._showActionWait > 0) {
        this._showActionWait--;
        if (this._showActionWait <= 0) {
          this._actionFaceId = -1;
          this.refresh();
        }
      }
    };
    MankoSprite.prototype.showAction = function (faceId) {
      this._showActionWait = 60;
      this._actionFaceId = faceId;
      this.refresh();
      this._actionSprite.visible = true;
    };
    MankoSprite.prototype.setHandler = function (f) {
      this._onClick = f;
    };
    MankoSprite.prototype.updateTouch = function () {
      if (!TouchInput.isTriggered()) {
        return;
      }
      var touchPos = new Point(TouchInput.x, TouchInput.y);
      var localPos = this.worldTransform.applyInverse(touchPos);
      if (this._frame.contains(localPos.x, localPos.y)) {
        if (this._onClick) {
          this._onClick();
        }
      }
    };
    return MankoSprite;
  })(Sprite);
  Nore.MankoSprite = MankoSprite;
})(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 __());
    };
  })();
var Nore;
(function (Nore) {
  var Scene_Members = /** @class */ (function (_super) {
    __extends(Scene_Members, _super);
    function Scene_Members() {
      return (_super !== null && _super.apply(this, arguments)) || this;
    }
    Scene_Members.prototype.create = function () {
      Scene_MenuBase.prototype.create.call(this);
      this.createmembersWindow();
    };
    Scene_Members.prototype.createmembersWindow = function () {
      var rect = new Rectangle(
        0,
        0,
        Graphics.boxWidth + 10,
        Graphics.boxHeight + 10
      );
      this._membersWindow = new Window_Members(rect);
      this._membersWindow.refresh();
      this.addChild(this._membersWindow);
    };
    Scene_Members.prototype.onOk = function () {};
    Scene_Members.prototype.onChange = function () {};
    Scene_Members.prototype.onCancel = function () {};
    Scene_Members.prototype.update = function () {
      _super.prototype.update.call(this);
      if (Input.isTriggered("ok")) {
        this.popScene();
      }
    };
    Scene_Members.prototype.popScene = function () {
      _super.prototype.popScene.call(this);
    };
    return Scene_Members;
  })(Scene_MenuBase);
  Nore.Scene_Members = Scene_Members;
  var MEM_W = 115;
  var Window_MembersBase = /** @class */ (function (_super) {
    __extends(Window_MembersBase, _super);
    function Window_MembersBase() {
      return (_super !== null && _super.apply(this, arguments)) || this;
    }
    Window_MembersBase.prototype.getActorIdList = function () {
      return $gameParty.getActorIdList();
    };
    Window_MembersBase.prototype.actor = function (index) {
      var actorId = this.getActorIdList()[index];
      return $gameActors.actor(actorId);
    };
    Window_MembersBase.prototype.selectLast = function () {
      var actorId = -1;
      if ($gameParty.menuActor()) {
        actorId = $gameParty.menuActor().actorId();
      }
      var index = this.getActorIdList().indexOf(actorId);
      if (index < 0) {
        this.smoothSelect(0);
        return;
      }
      this.smoothSelect(index || 0);
    };
    Window_MembersBase.prototype.processOk = function () {
      var actor = this.actor(this.index());
      $gameParty.setMenuActor(actor);
      Window_StatusBase.prototype.processOk.call(this);
    };
    Window_MembersBase.prototype.drawActorName = function (actor, x, y) {
      this.changeTextColor(ColorManager.normalColor());
      this.drawText(actor.name(), x, y, 120);
    };
    Window_MembersBase.prototype.drawLine = function (y) {
      var padding = this.itemPadding();
      var x = padding;
      var width = this.innerWidth - padding * 2;
      this.drawRect(x, y, width, 3);
    };
    Window_MembersBase.prototype.xPosByActor = function (actorId) {
      return $gameActors.actor(actorId).posByActor();
    };
    Window_MembersBase.prototype.actorFaceId = function (actor) {
      switch (actor.actorId()) {
        case 1:
          return 1;
        case 2:
          return 3;
        case 3:
          return 1;
      }
      return 1;
    };
    Window_MembersBase.prototype.eroActorFaceId = function (actor) {
      switch (actor.actorId()) {
        case 1:
          return 13;
        case 2:
          return 13;
        case 3:
          return 13;
        case 7:
          return 9;
      }
      return 4;
    };
    Window_MembersBase.prototype.hoppeId = function (actor) {
      return 0;
    };
    return Window_MembersBase;
  })(Window_Selectable);
  Nore.Window_MembersBase = Window_MembersBase;
  var Window_Members = /** @class */ (function (_super) {
    __extends(Window_Members, _super);
    function Window_Members() {
      return (_super !== null && _super.apply(this, arguments)) || this;
    }
    Window_Members.prototype.initialize = function (rect) {
      _super.prototype.initialize.call(this, rect);
      this._additionalSprites = {};
    };
    Window_Members.prototype.makeItems = function () {
      this._dataList = [];
      var list = this.getActorIdList();
      for (var i = 0; i < list.length; i++) {
        var actor = $gameActors.actor(list[i]);
        if (!this.isVisible(actor)) {
          continue;
        }
        this._dataList.push(actor);
      }
      p(this._dataList);
    };
    Window_Members.prototype.refresh = function () {
      this.makeItems();
      this.contents.clear();
      this._windowContentsBackSprite2.removeChildren();
      this._windowContentsSprite.removeChildren();
      _super.prototype.refresh.call(this);
      for (var i = 0; i < this._dataList.length; i++) {
        var actor = this._dataList[i];
        var yy = 50;
        var rect = this.itemRect(i);
        this.drawActorBg(actor, rect);
        this.drawActor(actor, rect.x, yy);
      }
      this.drawLine(486);
    };
    Window_Members.prototype.isVisible = function (actor) {
      switch (actor.actorId()) {
        case 9:
          // ノノカ
          return $slg.stage() >= 2;
      }
      return false;
    };
    Window_Members.prototype.drawActorBg = function (actor, rect) {
      var sprite = null;
      if (actor.isSlave()) {
        sprite = this.getBgSprite(2, rect);
      } else if (actor.isCaptive()) {
        sprite = this.getBgSprite(1, rect);
      }
      if (!sprite) {
        return;
      }
      sprite.x = rect.x;
      this._windowContentsBackSprite2.addChild(sprite);
    };
    Window_Members.prototype.drawActor = function (a, x, y) {
      var actor = JsonEx.makeDeepCopy(a);
      var tachieX = x + this.xPosByActor(actor.actorId()) - 40;
      var faceId = this.actorFaceId(actor);
      if (actor.getDefaultFaceId() > 1) {
        faceId = actor.getDefaultFaceId();
      }
      actor.setHoppeId(this.hoppeId(actor));
      var rect = new Rectangle(x - 60, 45, 236, 410);
      this.drawTachieActor(
        actor,
        this._windowContentsSprite,
        tachieX,
        y + 45,
        rect,
        faceId,
        0.5,
        false
      );
      var yy = y + 400;
      var xx = x + 10;
      this.drawStatus(actor, xx, yy);
      yy += 10;
      this.contents.fontSize = 22;
      this.drawActorName(actor, xx, yy + this.lineHeight() * 1);
      this.contents.fontSize = 20;
    };
    Window_Members.prototype.lineHeight = function () {
      return 30;
    };
    Window_Members.prototype.drawBackgroundRect = function (rect) {
      _super.prototype.drawBackgroundRect.call(this, rect);
      return;
      var sprite = this.getBgSprite(1, rect);
      p(sprite);
      sprite.x = rect.x;
      this._windowContentsBackSprite2.addChild(sprite);
    };
    Window_Members.prototype.drawStatus = function (actor, x, y) {
      this.contents.fontSize = 14;
      this.contents.fontSize = 22;
    };
    Window_Members.prototype.placeBasicGauges = function (actor, x, y) {
      this.placeGauge(actor, "hp", x, y);
      this.placeGauge(actor, "mp", x, y + this.gaugeLineHeight());
    };
    Window_Members.prototype.placeGauge = function (actor, type, x, y) {
      var key = "actor%1-gauge-%2".format(actor.actorId(), type);
      var sprite = this.createInnerSprite(key, Sprite_Gauge);
      sprite.setup(actor, type);
      sprite.move(x, y);
      sprite.show();
    };
    Window_Members.prototype.createInnerSprite = function (key, spriteClass) {
      var dict = this._additionalSprites;
      if (dict[key]) {
        return dict[key];
      } else {
        var sprite = new spriteClass();
        dict[key] = sprite;
        this.addInnerChild(sprite);
        return sprite;
      }
    };
    Window_Members.prototype.gaugeLineHeight = function () {
      return 24;
    };
    Window_Members.prototype.drawLabel = function (label, x, y) {
      var baseTexture2 = Nore.getSystemBaseTexture("Battle");
      var rect = new Rectangle(0, 0, 48, 24);
      if (label == "HP") {
        rect.y = 24;
      }
      if (label == "MP") {
        rect.y = 48;
      }
      var texture = new PIXI.Texture(baseTexture2, rect);
      var sprite = new PIXI.Sprite(texture);
      sprite.x = x;
      sprite.y = y + 22;
      this._windowContentsSprite.addChild(sprite);
    };
    Window_Members.prototype.getBgSprite = function (index, rect) {
      var baseTexture2 = Nore.getSystemBaseTexture("back" + index);
      var texture = new PIXI.Texture(
        baseTexture2,
        new Rectangle(0, 0, rect.width, 480)
      );
      var sprite = new PIXI.Sprite(texture);
      return sprite;
    };
    Window_Members.prototype.setFormationMode = function () {};
    Window_Members.prototype.maxItems = function () {
      if (!this._dataList) {
        return 0;
      }
      return this._dataList.length;
    };
    Window_Members.prototype.maxCols = function () {
      return this.getActorIdList().length;
    };
    Window_Members.prototype.itemHeight = function () {
      return this.height - 30;
    };
    return Window_Members;
  })(Window_MembersBase);
  Nore.Window_Members = Window_Members;
})(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 __());
    };
  })();
Window_MenuCommand.prototype.makeCommandList = function () {
  this.addOptionsCommand();
  this.addSaveCommand();
  this.addCommand(TextManager.kigae, "kigae", true);
  this.addGameEndCommand();
};
var KIGAE_OPEN_SWITCH = 65;
var Nore;
(function (Nore) {
  Scene_Map.prototype.callMenu = function () {
    if ($gameMap.mapId() == 1) {
      SoundManager.playOk();
      SceneManager.push(Scene_Menu2);
      Window_MenuCommand.initCommandPosition();
      $gameTemp.clearDestination();
      this._mapNameWindow.hide();
      this._waitCount = 2;
    } else {
      $gameSwitches.setValue(62, false);
      SoundManager.playOk();
      $gameSwitches.setValue(1, true);
    }
  };
  var _Scene_Map_prototype_isMenuCalled = Scene_Map.prototype.isMenuCalled;
  Scene_Map.prototype.isMenuCalled = function () {
    if ($slg.clicker().currentStage().isWaitVictory()) {
      return false;
    }
    if ($gameSwitches.value(171)) {
      return false;
    }
    if (this._windowBackLog) {
      return false;
    }
    return _Scene_Map_prototype_isMenuCalled.call(this);
    return (
      Input.isTriggered("menu") ||
      Input.isTriggered("cancel") ||
      TouchInput.isCancelled()
    );
  };
  var Scene_Menu2 = /** @class */ (function (_super) {
    __extends(Scene_Menu2, _super);
    function Scene_Menu2() {
      return (_super !== null && _super.apply(this, arguments)) || this;
    }
    Scene_Menu2.prototype.create = function () {
      Scene_Base.prototype.create.call(this);
      this.createBackground();
      this.updateActor();
      this.createWindowLayer();
      this.createCommandWindow();
      this.createGoldWindow();
      this.createStatusWindow();
      this.createMsgWindow();
    };
    Scene_Menu2.prototype.update = function () {
      _super.prototype.update.call(this);
      // $slg.update();
    };
    Scene_Menu2.prototype.start = function () {
      _super.prototype.start.call(this);
      this.startSelection();
    };
    Scene_Menu2.prototype.startSelection = function () {
      if (!$gameTemp.isCancelMenu) {
        return;
      }
      $gameTemp.isCancelMenu = false;
      this.commandPersonal();
      this._commandWindow.deactivate();
    };
    Scene_Menu2.prototype.createMsgWindow = function () {
      this._msgWindow = new Nore.Window_Msg(176);
      this._msgWindow.setHandler("ok", this.onMsgOk.bind(this));
      this._msgWindow.deactivate();
      this._msgWindow.setText(TextManager.cantKigae);
      this.addChild(this._msgWindow);
      this._msgWindow.hide();
    };
    Scene_Menu2.prototype.createBackground = function () {
      _super.prototype.createBackground.call(this);
      this.createDark();
    };
    Scene_Menu2.prototype.createStatusWindow = function () {
      var rect = this.statusWindowRect();
      this._statusWindow = new Nore.Window_Members(rect);
      this._statusWindow.makeItems();
      this.addWindow(this._statusWindow);
    };
    Scene_Menu2.prototype.statusWindowRect = function () {
      var ww = Graphics.boxWidth;
      var wy = 114;
      var wh = Graphics.boxHeight - wy;
      var wx = 0;
      return new Rectangle(wx, wy, ww, wh);
    };
    Scene_Menu2.prototype.createDark = function () {
      var dark = new PIXI.Graphics();
      dark.beginFill(0, 0.4);
      dark.drawRect(0, 0, Graphics.boxWidth + 10, Graphics.boxHeight + 10);
      dark.endFill();
      this.addChild(dark);
    };
    Scene_Menu2.prototype.goldWindowRect = function () {
      var rect = _super.prototype.goldWindowRect.call(this);
      rect.x = 0;
      rect.y = 45;
      rect.width = 200;
      return rect;
    };
    Scene_Menu2.prototype.createCommandWindow = function () {
      var rect = this.commandWindowRect();
      var commandWindow = new Window_MenuCommand2(rect);
      commandWindow.setHandler("item", this.commandItem.bind(this));
      commandWindow.setHandler("skill", this.commandPersonal.bind(this));
      commandWindow.setHandler("equip", this.commandPersonal.bind(this));
      commandWindow.setHandler("status", this.commandPersonal.bind(this));
      commandWindow.setHandler("medal", this.commandMedal.bind(this));
      commandWindow.setHandler("eroStatus", this.commandPersonal.bind(this));
      commandWindow.setHandler("formation", this.commandFormation.bind(this));
      commandWindow.setHandler("options", this.commandOptions.bind(this));
      commandWindow.setHandler("save", this.commandSave.bind(this));
      commandWindow.setHandler("load", this.commandLoad.bind(this));
      commandWindow.setHandler("gameEnd", this.commandGameEnd.bind(this));
      commandWindow.setHandler("cancel", this.popScene.bind(this));
      commandWindow.setHandler("kigae", this.commandPersonal.bind(this));
      commandWindow.setHandler("record", this.commandRecord.bind(this));
      commandWindow.setHandler("mainMenu", this.commandMainMenu.bind(this));
      commandWindow.setHandler("history", this.commandPersonal.bind(this));
      commandWindow.setHandler(
        "encyclopedia",
        this.commandEncyclopedia.bind(this)
      );
      commandWindow.setHandler("collection", this.commandCollection.bind(this));
      commandWindow.setHandler("babyList", this.commandBabyList.bind(this));
      commandWindow.setHandler("powerUp", this.commandPersonal.bind(this));
      commandWindow.setHandler("powerUp2", this.commandPowerup.bind(this));
      this.addWindow(commandWindow);
      this._commandWindow = commandWindow;
    };
    Scene_Menu2.prototype.commandWindowRect = function () {
      var wx = 208;
      var ww = Graphics.boxWidth - wx;
      var wh = 114;
      var wy = 0;
      return new Rectangle(wx, wy, ww, wh);
    };
    Scene_Menu2.prototype.commandEncyclopedia = function () {
      this.popScene();
    };
    Scene_Menu2.prototype.commandStatus = function () {
      SceneManager.push(Scene_Status2);
    };
    Scene_Menu2.prototype.commandCollection = function () {
      SceneManager.push(Scene_Collection);
    };
    Scene_Menu2.prototype.commandBabyList = function () {
      SceneManager.push(Scene_BabyListAll);
    };
    Scene_Menu2.prototype.commandMainMenu = function () {
      $gameSwitches.setValue(62, false);
      $gameSwitches.setValue(84, true);
      this.popScene();
    };
    Scene_Menu2.prototype.commandMedal = function () {
      SceneManager.push(Scene_Medal);
    };
    Scene_Menu2.prototype.commandKigae = function () {
      SceneManager.push(Nore.Scene_Kigae);
    };
    Scene_Menu2.prototype.commandLoad = function () {
      SceneManager.push(Scene_Load);
    };
    Scene_Menu2.prototype.commandOffering = function () {
      SceneManager.push(Nore.Scene_Upgrade);
    };
    Scene_Menu2.prototype.commandMembers = function () {
      SceneManager.push(Nore.Scene_Members);
    };
    Scene_Menu2.prototype.commandFormation = function () {
      SceneManager.push(Nore.Scene_Formation);
    };
    Scene_Menu2.prototype.commandPowerup = function () {
      SceneManager.push(Nore.Scene_PowerUp);
    };
    Scene_Menu2.prototype.commandItem = function () {
      if ($gameParty.battleItems().length == 0 && !$gameSwitches.value(218)) {
        SoundManager.playBuzzer();
        this._msgWindow.setText(TextManager.hasNoItems);
        this._msgWindow.show();
        this._msgWindow.activate();
        return;
      }
      SceneManager.push(Nore.Scene_Item2);
    };
    Scene_Menu2.prototype.commandRecord = function () {
      SceneManager.push(Nore.Scene_Record);
    };
    Scene_Menu2.prototype.onPersonalOk = function () {
      switch (this._commandWindow.currentSymbol()) {
        case "skill":
          SceneManager.push(Scene_Skill2);
          break;
        case "equip":
          SceneManager.push(Scene_Equip2);
          break;
        case "status":
          SceneManager.push(Scene_Status2);
          break;
        case "eroStatus":
          var actorId = $gameParty.menuActor().actorId();
          var actorHistory = $gameSystem
            .historyManager()
            .getActorHistory(actorId);
          $gameTemp.history = actorHistory.lastHistory();
          SceneManager.push(Nore.Scene_EroStatus);
          break;
        case "kigae":
          {
            var actor = $gameParty.menuActor();
            /*if (! actor.canKigae()) {
                            SoundManager.playBuzzer();
                            this._msgWindow.show();
                            this._msgWindow.activate();
                            return;
                        }*/
            SceneManager.push(Nore.Scene_Kigae);
          }
          break;
        case "history":
          $gameTemp.lastHistoryIndex = null;
          SceneManager.push(Scene_HistoryList);
          break;
        case "powerUp":
          SceneManager.push(Scene_PowerUp2);
          break;
        case "levelUp":
          {
            var actor = $gameParty.menuActor();
            /*if (! actor.canLevelUp($gameParty.partyExp())) {
                            SoundManager.playBuzzer();
                            this._statusWindow.activate();
                            return;
                        }*/
            SceneManager.push(Scene_LevelUp);
          }
          break;
      }
    };
    Scene_Menu2.prototype.onMsgOk = function () {
      this._commandWindow.activate();
      this._msgWindow.hide();
      this._msgWindow.deactivate();
    };
    return Scene_Menu2;
  })(Scene_Menu);
  Nore.Scene_Menu2 = Scene_Menu2;
  var Window_MenuCommand2 = /** @class */ (function (_super) {
    __extends(Window_MenuCommand2, _super);
    function Window_MenuCommand2() {
      return (_super !== null && _super.apply(this, arguments)) || this;
    }
    Window_MenuCommand2.prototype.maxCols = function () {
      return 6;
    };
    Window_MenuCommand2.prototype.addMainCommands = function () {
      var enabled = this.areMainCommandsEnabled();
      if (this.needsCommand("item")) {
        this.addCommand(TextManager._item, "item", $gameSwitches.value(1));
      }
      //this.addCommand(TextManager.menuLevel, "levelUp", $gameSwitches.value(1));
      if (this.needsCommand("skill")) {
        //this.addCommand(TextManager._skill, "skill", enabled);
        this.addCommand(TextManager.powerUp, "powerUp", enabled);
      }
      //this.addCommand(TextManager.powerUp2, "powerUp2", $gameSystem.day() >= 6 && ! $gameSwitches.value(1));
      this.addCommand(TextManager.record, "record", true);
      if (this.needsCommand("equip")) {
        this.addCommand(TextManager._equip, "equip", enabled);
      }
      if (this.needsCommand("status")) {
        //this.addCommand(TextManager._status, "status", enabled);
      }
      //this.addCommand(TextManager.eroStatus, "eroStatus", enabled);
      this.addCommand(TextManager.medal, "medal", enabled);
      this.addCommand(
        TextManager.kigae,
        "kigae",
        $gameSwitches.value(KIGAE_OPEN_SWITCH)
      );
      //this.addCommand(TextManager.encyclopedia, "encyclopedia", true);
      this.addCommand(TextManager.history, "history", true);
      //this.addCommand(TextManager.collection, "collection", true);
      this.addCommand(TextManager.babyList, "babyList", true);
    };
    Window_MenuCommand2.prototype.addOptionsCommand = function () {
      if (this.needsCommand("options")) {
        var enabled = this.isOptionsEnabled();
        this.addCommand(TextManager._options, "options", enabled);
      }
    };
    Window_MenuCommand2.prototype.addSaveCommand = function () {
      if (this.needsCommand("save")) {
        var enabled = this.isSaveEnabled();
        this.addCommand(TextManager._save, "save", enabled);
        //this.addCommand(TextManager.load, "load", true);
      }
    };
    Window_MenuCommand2.prototype.addGameEndCommand = function () {
      var enabled = this.isGameEndEnabled();
      this.addCommand(TextManager._gameEnd, "gameEnd", enabled);
    };
    return Window_MenuCommand2;
  })(Window_MenuCommand);
  // Open Menu Screen
  Game_Interpreter.prototype.command351 = function () {
    if (!$gameParty.inBattle()) {
      SceneManager.push(Nore.Scene_Menu2);
      Window_MenuCommand.initCommandPosition();
    }
    return true;
  };
})(Nore || (Nore = {}));
Scene_MenuBase.prototype.createCancelButton = function () {
  this._cancelButton = new Sprite_Button2("cancel", true);
  this._cancelButton.x = Graphics.boxWidth - this._cancelButton.width - 6;
  this._cancelButton.y = this.buttonY() + 7;
  this.addWindow(this._cancelButton);
};


code:
function Window_Message2() {
  this.initialize.apply(this, arguments);
}
Window_Message2.prototype = Object.create(Window_Scrollable.prototype);
Window_Message2.prototype.constructor = Window_Message2;
Window_Message2.prototype.initialize = function (rect) {
  Window_Base.prototype.initialize.call(this, rect);
  this.openness = 0;
  this.initMembers();
};
var Window_Message_prototype_startMessage =
  Window_Message.prototype.startMessage;
Window_Message.prototype.startMessage = function () {
  if (Nore.BackLog) {
    Nore.BackLog.$gameBackLog.addLog(
      $gameMessage.speakerName(),
      $gameMessage.allText()
    );
  }
  Window_Message_prototype_startMessage.call(this);
};
Window_Message2.prototype.initMembers = function () {
  this._background = 0;
  this._positionType = 2;
  this._waitCount = 0;
  this._faceBitmap = null;
  this._textState = null;
  this._goldWindow = null;
  this._nameBoxWindow = null;
  this._choiceListWindow = null;
  this._numberInputWindow = null;
  this._eventItemWindow = null;
  this.clearFlags();
};
Window_Message2.prototype.setGoldWindow = function (goldWindow) {
  this._goldWindow = goldWindow;
};
Window_Message2.prototype.setNameBoxWindow = function (nameBoxWindow) {
  this._nameBoxWindow = nameBoxWindow;
};
Window_Message2.prototype.setChoiceListWindow = function (choiceListWindow) {
  this._choiceListWindow = choiceListWindow;
};
Window_Message2.prototype.setNumberInputWindow = function (numberInputWindow) {
  this._numberInputWindow = numberInputWindow;
};
Window_Message2.prototype.setEventItemWindow = function (eventItemWindow) {
  this._eventItemWindow = eventItemWindow;
};
Window_Message2.prototype.clearFlags = function () {
  this._showFast = false;
  this._lineShowFast = false;
  this._pauseSkip = false;
};
Window_Message2.prototype.update = function () {
  this.checkToNotClose();
  Window_Scrollable.prototype.update.call(this);
  this.synchronizeNameBox();
  while (!this.isOpening() && !this.isClosing()) {
    if (this.updateWait()) {
      return;
    } else if (this.updateLoading()) {
      return;
    } else if (this.updateInput()) {
      return;
    } else if (this.updateMessage()) {
      return;
    } else if (this.canStart()) {
      this.startMessage();
    } else {
      this.startInput();
      return;
    }
  }
};
var Window_Message_prototype_update = Window_Message.prototype.update;
Window_Message.prototype.update = function () {
  Window_Message_prototype_update.call(this);
  this.updateWidth();
};
Window_Message.prototype.updateWidth = function () {
  if ($gameSwitches.value(2)) {
    this.width = 672;
    this.x = 0;
  } else {
    this.width = 872;
    this.x = 200;
  }
};
Window_Message2.prototype.checkToNotClose = function () {
  if (this.isOpen() && this.isClosing() && this.doesContinue()) {
    this.open();
  }
};
Window_Message2.prototype.synchronizeNameBox = function () {
  this._nameBoxWindow.openness = this.openness;
};
Window_Message2.prototype.canStart = function () {
  return $gameMessage.hasText() && !$gameMessage.scrollMode();
};
Window_Message2.prototype.startMessage = function () {
  var text = $gameMessage.allText();
  var textState = this.createTextState(text, 0, 0, 0);
  textState.x = this.newLineX(textState);
  textState.startX = textState.x;
  this._textState = textState;
  this.newPage(this._textState);
  this.updatePlacement();
  this.updateBackground();
  this.open();
  this._nameBoxWindow.start();
};
Window_Message2.prototype.newLineX = function (textState) {
  var faceExists = $gameMessage.faceName() !== "";
  var faceWidth = ImageManager.faceWidth;
  var spacing = 20;
  var margin = faceExists ? faceWidth + spacing : 4;
  return textState.rtl ? this.innerWidth - margin : margin;
};
Window_Message2.prototype.updatePlacement = function () {
  var goldWindow = this._goldWindow;
  this._positionType = $gameMessage.positionType();
  this.y = (this._positionType * (Graphics.boxHeight - this.height)) / 2;
  if (goldWindow) {
    goldWindow.y = this.y > 0 ? 0 : Graphics.boxHeight - goldWindow.height;
  }
};
Window_Message2.prototype.updateBackground = function () {
  this._background = $gameMessage.background();
  this.setBackgroundType(this._background);
};
Window_Message2.prototype.terminateMessage = function () {
  this._goldWindow.close();
  $gameMessage.clear();
};
Window_Message2.prototype.updateWait = function () {
  if (this._waitCount > 0) {
    this._waitCount--;
    return true;
  } else {
    return false;
  }
};
Window_Message2.prototype.updateLoading = function () {
  if (this._faceBitmap) {
    if (this._faceBitmap.isReady()) {
      this.drawMessageFace();
      this._faceBitmap = null;
      return false;
    } else {
      return true;
    }
  } else {
    return false;
  }
};
Window_Message2.prototype.updateInput = function () {
  if (this.isAnySubWindowActive()) {
    return true;
  }
  if (this.pause) {
    if (this.isTriggered()) {
      Input.update();
      this.pause = false;
      if (!this._textState) {
        this.terminateMessage();
      }
    }
    return true;
  }
  return false;
};
Window_Message2.prototype.isAnySubWindowActive = function () {
  return (
    this._choiceListWindow.active ||
    this._numberInputWindow.active ||
    this._eventItemWindow.active
  );
};
Window_Message2.prototype.updateMessage = function () {
  var textState = this._textState;
  if (textState) {
    while (!this.isEndOfText(textState)) {
      if (this.needsNewPage(textState)) {
        this.newPage(textState);
      }
      this.updateShowFast();
      this.processCharacter(textState);
      if (this.shouldBreakHere(textState)) {
        break;
      }
    }
    this.flushTextState(textState);
    if (this.isEndOfText(textState) && !this.pause) {
      this.onEndOfText();
    }
    return true;
  } else {
    return false;
  }
};
Window_Message2.prototype.shouldBreakHere = function (textState) {
  if (this.canBreakHere(textState)) {
    if (!this._showFast && !this._lineShowFast) {
      return true;
    }
    if (this.pause || this._waitCount > 0) {
      return true;
    }
  }
  return false;
};
Window_Message2.prototype.canBreakHere = function (textState) {
  if (!this.isEndOfText(textState)) {
    var c = textState.text[textState.index];
    if (c.charCodeAt(0) >= 0xdc00 && c.charCodeAt(0) <= 0xdfff) {
      // surrogate pair
      return false;
    }
    if (textState.rtl && c.charCodeAt(0) > 0x20) {
      return false;
    }
  }
  return true;
};
Window_Message2.prototype.onEndOfText = function () {
  if (!this.startInput()) {
    if (!this._pauseSkip) {
      this.startPause();
    } else {
      this.terminateMessage();
    }
  }
  this._textState = null;
};
Window_Message2.prototype.startInput = function () {
  if ($gameMessage.isChoice()) {
    this._choiceListWindow.start();
    return true;
  } else if ($gameMessage.isNumberInput()) {
    this._numberInputWindow.start();
    return true;
  } else if ($gameMessage.isItemChoice()) {
    this._eventItemWindow.start();
    return true;
  } else {
    return false;
  }
};
Window_Message2.prototype.isTriggered = function () {
  return (
    Input.isRepeated("ok") ||
    Input.isRepeated("cancel") ||
    TouchInput.isRepeated()
  );
};
Window_Message2.prototype.doesContinue = function () {
  return (
    $gameMessage.hasText() &&
    !$gameMessage.scrollMode() &&
    !this.areSettingsChanged()
  );
};
Window_Message2.prototype.areSettingsChanged = function () {
  return (
    this._background !== $gameMessage.background() ||
    this._positionType !== $gameMessage.positionType()
  );
};
Window_Message2.prototype.updateShowFast = function () {
  if (this.isTriggered()) {
    this._showFast = true;
  }
};
Window_Message2.prototype.newPage = function (textState) {
  this.contents.clear();
  this.resetFontSettings();
  this.clearFlags();
  this.updateSpeakerName();
  this.loadMessageFace();
  textState.x = textState.startX;
  textState.y = 0;
  textState.height = this.calcTextHeight(textState);
};
Window_Message2.prototype.updateSpeakerName = function () {
  this._nameBoxWindow.setName($gameMessage.speakerName());
};
Window_Message2.prototype.loadMessageFace = function () {
  this._faceBitmap = ImageManager.loadFace($gameMessage.faceName());
};
Window_Message2.prototype.drawMessageFace = function () {
  var faceName = $gameMessage.faceName();
  var faceIndex = $gameMessage.faceIndex();
  var rtl = $gameMessage.isRTL();
  var width = ImageManager.faceWidth;
  var height = this.innerHeight;
  var x = rtl ? this.innerWidth - width - 4 : 4;
  this.drawFace(faceName, faceIndex, x, 0, width, height);
};
Window_Message2.prototype.processControlCharacter = function (textState, c) {
  Window_Base.prototype.processControlCharacter.call(this, textState, c);
  if (c === "\f") {
    this.processNewPage(textState);
  }
};
Window_Message2.prototype.processNewLine = function (textState) {
  this._lineShowFast = false;
  Window_Base.prototype.processNewLine.call(this, textState);
  if (this.needsNewPage(textState)) {
    this.startPause();
  }
};
Window_Message2.prototype.processNewPage = function (textState) {
  if (textState.text[textState.index] === "\n") {
    textState.index++;
  }
  textState.y = this.contents.height;
  this.startPause();
};
Window_Message2.prototype.isEndOfText = function (textState) {
  return textState.index >= textState.text.length;
};
Window_Message2.prototype.needsNewPage = function (textState) {
  return (
    !this.isEndOfText(textState) &&
    textState.y + textState.height > this.contents.height
  );
};
Window_Message2.prototype.processEscapeCharacter = function (code, textState) {
  switch (code) {
    case "$":
      this._goldWindow.open();
      break;
    case ".":
      this.startWait(15);
      break;
    case "|":
      this.startWait(60);
      break;
    case "!":
      this.startPause();
      break;
    case ">":
      this._lineShowFast = true;
      break;
    case "<":
      this._lineShowFast = false;
      break;
    case "^":
      this._pauseSkip = true;
      break;
    default:
      Window_Base.prototype.processEscapeCharacter.call(this, code, textState);
      break;
  }
};
Window_Message2.prototype.startWait = function (count) {
  this._waitCount = count;
};
Window_Message2.prototype.startPause = function () {
  this.startWait(10);
  this.pause = true;
};