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 (b.hasOwnProperty(p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
/*============================================================================
 Nore_AutoSave.js
----------------------------------------------------------------------------
 This software is released under the MIT License.
 http://opensource.org/licenses/mit-license.php
============================================================================*/
/*:ja
 * @plugindesc オートセーブができるスクリプト
 * @author ル
 * @version 0.02
 *
 * @help
 * オートセーブのプラグインコマンド
 * Nore_AutoSave autoSave XXXX
 * XXXX にオートセーブのタイトルを設定できます
 *
 *
 * @param autosaveJp
 * @text オートセーブの日本語名
 * @default オートセーブ
 *
 * @param autosaveEn
 * @text オートセーブの英語名
 * @default Autosave
 *
 * @param autosaveCh
 * @text オートセーブの中国語名
 * @default オートセーブ
 *
 */
var Nore;
(function (Nore) {
  var parameters = PluginManager.parameters("Nore_AutoSave");
  var AUTO_SAVE_TITLE_JP = parameters["autosaveJp"];
  var AUTO_SAVE_TITLE_EN = parameters["autosaveEn"];
  var AUTO_SAVE_TITLE_CH = parameters["autosaveCh"];
  var AUTO_SAVE_DUMMY_ID = 999;
  Nore.AUTO_SAVE_DUMMY_ID = AUTO_SAVE_DUMMY_ID;
  var AUTO_SAVE_ID = 0;
  var pluginName = "Nore_AutoSave";
  var _Game_Interpreter_pluginCommand =
    Game_Interpreter.prototype.pluginCommand;
  Game_Interpreter.prototype.pluginCommand = function (command, args) {
    _Game_Interpreter_pluginCommand.apply(this, arguments);
    if (command === pluginName) {
      switch (args[0]) {
        case "autoSave":
          $autoSaveManager.autoSave(args[1]);
          return;
        default:
          console.error("不正なプラグインコマンドです。" + args[0]);
      }
    }
  };
  var $autoSaveManager;
  var _DataManager_createGameObjects = DataManager.createGameObjects;
  DataManager.createGameObjects = function () {
    _DataManager_createGameObjects.call(this);
    $autoSaveManager = new AutoSaveManager();
  };
  var AutoSaveManager = /** @class */ (function () {
    function AutoSaveManager() {}
    AutoSaveManager.prototype.autoSave = function (autoSaveName) {
      if (!autoSaveName) {
        //console.log('オートセーブ名が指定されていません');
      }
      var info = DataManager.loadGlobalInfo()[AUTO_SAVE_ID];
      if (info && info.playtime == $gameSystem.playtimeText()) {
        return;
      }
      SceneManager.snapForThumbnail();
      $gameSystem.onBeforeSave();
      var lastAccessId = DataManager._lastAccessedId;
      var saveId = AUTO_SAVE_DUMMY_ID;
      //console.log('オートセーブ実行:' + saveId + ' ' + autoSaveName);
      this._autoSaveName = autoSaveName;
      if (DataManager.saveGame(saveId)) {
        StorageManager.cleanBackup(saveId);
      }
      DataManager._lastAccessedId = lastAccessId;
      this._autoSaveName = null;
    };
    return AutoSaveManager;
  })();
  Nore.AutoSaveManager = AutoSaveManager;

  var _Window_SavefileList_prototype_drawFileId =
    Window_SavefileList.prototype.drawFileId;
  Window_SavefileList.prototype.drawFileId = function (id, x, y) {
    if (id == 0) {
      var text = AUTO_SAVE_TITLE_JP;
      switch ($gameVariables.value(1999)) {
        case 2:
          text = AUTO_SAVE_TITLE_EN;
          break;
        case 3:
          text = AUTO_SAVE_TITLE_CH;
          break;
      }
      this.drawText(text.format(id - AUTO_SAVE_ID + 1), x, y, 180);
      return;
    }
    _Window_SavefileList_prototype_drawFileId.call(this, id, x, y);
  };
  Scene_File.prototype.savefileId = function () {
    var fileId = this._listWindow.selectedId();
    if (fileId == AUTO_SAVE_ID) {
      return AUTO_SAVE_DUMMY_ID;
    }
    return fileId;
  };

  var Scene_File_prototype_update = Scene_File.prototype.update;
  Scene_File.prototype.update = function () {
    Scene_File_prototype_update.call(this);
    if (this._interpreter) {
      this._interpreter.update();
      if (TouchInput.rightButton) {
        $gameSwitches.setValue(50, true);
        return;
      }
      if (!this._interpreter.isRunning()) {
        var label = $gameVariables.value(renameVar2);
        this._interpreter = null;
        this._listWindow.activate();
        var id = this._listWindow.selectedId();
        var info = DataManager.loadGlobalInfo();
        if (!info[id]) {
          return;
        }
        if (info[id].label == label) {
          SoundManager.playCancel();
          return;
        }
        SoundManager.playOk();
        info[id].label = label;
        this._listWindow.refresh();
        DataManager.saveGlobalInfo(info);
      }
    }
  };
  const _Scene_Save_prototype_onSavefileOk = Scene_Save.prototype.onSavefileOk;
  Scene_Save.prototype.onSavefileOk = function () {
    const fileId = this.savefileId();
    if (fileId == undefined || fileId == AUTO_SAVE_DUMMY_ID) {
      this.onSaveFailure();
      return;
    }
    _Scene_Save_prototype_onSavefileOk.call(this);
  };
  var StorageManager_localFilePath = StorageManager.localFilePath;
  StorageManager.localFilePath = function (savefileId) {
    if (savefileId === AUTO_SAVE_DUMMY_ID) {
      return (
        this.localFileDirectoryPath() + "file%1.rpgsave".format(AUTO_SAVE_ID)
      );
    }
    return StorageManager_localFilePath.call(this, savefileId);
  };
  DataManager.saveGameWithoutRescue = function (savefileId) {
    if (savefileId == undefined) {
      console.error("save file id が指定されていません");
      return false;
    }
    var json = JsonEx.stringify(this.makeSaveContents());
    if (json.length >= 200000) {
      console.warn("Save data too big!");
    }
    StorageManager.save(savefileId, json);
    if (savefileId == AUTO_SAVE_DUMMY_ID) {
      savefileId = AUTO_SAVE_ID;
    }
    this._lastAccessedId = savefileId;
    var globalInfo = this.loadGlobalInfo() || [];
    globalInfo[savefileId] = this.makeSavefileInfo();
    this.saveGlobalInfo(globalInfo);
    return true;
  };
  var _DataManager_isThisGameFile = DataManager.isThisGameFile;
  DataManager.isThisGameFile = function (savefileId) {
    if (savefileId == AUTO_SAVE_DUMMY_ID) {
      return true;
    } else {
      return _DataManager_isThisGameFile.apply(this, arguments);
    }
  };
  var _DataManager_loadGameWithoutRescue = DataManager.loadGameWithoutRescue;
  DataManager.loadGameWithoutRescue = function (savefileId) {
    const lastAccessId = this._lastAccessedId;
    const result = _DataManager_loadGameWithoutRescue.apply(this, arguments);
    if (this._lastAccessedId == AUTO_SAVE_DUMMY_ID) {
      this._lastAccessedId = lastAccessId;
    }
    return result;
  };

  DataManager.selectSavefileForNewGame = function () {
    var globalInfo = this.loadGlobalInfo();
    this._lastAccessedId = 1;
    if (globalInfo) {
      var numSavefiles = Math.max(0, getGlobalLength(globalInfo));
      if (numSavefiles < this.maxSavefiles()) {
        this._lastAccessedId = numSavefiles + 1;
      } else {
        var timestamp = Number.MAX_VALUE;
        for (var i = 1; i < globalInfo.length; i++) {
          if (!globalInfo[i]) {
            this._lastAccessedId = i;
            break;
          }
          if (globalInfo[i].timestamp < timestamp) {
            timestamp = globalInfo[i].timestamp;
            this._lastAccessedId = i;
          }
        }
      }
    }
  };

  function getGlobalLength(globalInfo) {
    let max = 0;
    for (let i = 0; i < 95; i++) {
      if (globalInfo[i]) {
        max = i;
      }
    }
    return max;
  }
})(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 (b.hasOwnProperty(p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
/*:ja
 * @author ル
 *
 * @param rightTreeOffset
 * @desc 右側のツリーは、この値だけずれます
 * @default 15
 *
 * @param closeRelativeX
 * @desc 近親マークのx座標
 * @default 0
 *
 * @param closeRelativeY
 * @desc 近親マークのy座標
 * @default 0
 *
 * @param closeRelativeNameY
 * @desc 近親マークつきの家系図の名前のy座標
 * @default 0
 *
 */
var Nore;
(function (Nore) {
  var Parameters = PluginManager.parameters("Nore_FamilyTree2");
  Nore.RIGHT_TREE_OFFSET = Parameters["rightTreeOffset"]
    ? Math.trunc(Parameters["rightTreeOffset"])
    : 15;
  Nore.CLOSE_RELATIVE_X = Parameters["closeRelativeX"]
    ? Math.trunc(Parameters["closeRelativeX"])
    : 0;
  Nore.CLOSE_RELATIVE_Y = Parameters["closeRelativeY"]
    ? Math.trunc(Parameters["closeRelativeY"])
    : 0;
  Nore.CLOSE_RELATIVE_NAME_Y = Parameters["closeRelativeNameY"]
    ? Math.trunc(Parameters["closeRelativeNameY"])
    : 0;
  // 設定
  var FONT_NAME = "游ゴシック";
  var FONT_SIZE = 18;
  var COLOR = 0x2a1713;
  Nore.CHILD_TEXT_JA = "の子供";
  Nore.CHILD_TEXT_EN = "Child of";
  var loader;
  var _Scene_Boot_loadSystemImages = Scene_Boot.loadSystemImages;
  Scene_Boot.loadSystemImages = function () {
    _Scene_Boot_loadSystemImages.call(this);
    loader = new PIXI.loaders.Loader();
    loader.add("HeaderFont", "./fonts/bgfont.fnt").load(function () {});
  };
  var Scene_Map_prototype_update = Scene_Map.prototype.update;
  Scene_Map.prototype.update = function () {
    Scene_Map_prototype_update.call(this);
    if ($gameSwitches.value(601)) {
      this.showFamilyTree();
    } else {
      this.hideFamilyTree();
    }
  };
  Scene_Map.prototype.showFamilyTree = function () {
    if (!this._familyTreeWindow) {
      this.createFamilyTreeBg();
      this._familyTreeWindow = new Nore.Window_FamilyTree(
        0,
        0,
        Graphics.boxWidth,
        Graphics.boxHeight
      );
      this._spriteset.addChild(this._familyTreeWindow);
    }
    this._familyTreeBg.visible = true;
    this._familyTreeWindow.visible = true;
    this._familyTreeWindow.update();
  };
  Scene_Map.prototype.hideFamilyTree = function () {
    if (this._familyTreeWindow && this._familyTreeWindow.visible) {
      this._familyTreeWindow.visible = false;
      this._familyTreeBg.visible = false;
    }
  };
  Scene_Map.prototype.createFamilyTreeBg = function () {
    if (this._familyTreeBg) {
      return;
    }
    var g = new PIXI.Graphics();
    g.beginFill(0x976d64, 1);
    g.drawRect(0, 0, Graphics.boxWidth + 10, Graphics.boxHeight + 10);
    g.endFill();
    this._familyTreeBg = g;
    this._spriteset.addChild(g);
  };
})(Nore || (Nore = {}));
var Game_FamilyTree = /** @class */ (function () {
  function Game_FamilyTree() {
    this._children = [];
  }
  Game_FamilyTree.prototype.addChild = function (taneoyaId, childCount) {
    var newChild = new Game_Child(taneoyaId);
    newChild.plusBrother(childCount - 1);
    this._children.push(newChild);
    this._lastChild = newChild;
    return newChild.id();
  };
  Game_FamilyTree.prototype.addGrandchild = function (childCount, id) {
    if (id) {
      var parent_1 = this.findChild(id);
      if (!parent_1) {
        console.error(
          "孫を追加しようとしましたが、" + id + "のIDの子供が存在しません"
        );
        return;
      }
      var newChild = new Game_Child(
        parent_1.taneoyaId(),
        parent_1.generation() + 1
      );
      newChild.plusBrother(childCount - 1);
      parent_1.addChild(newChild);
      return newChild.id();
    } else {
      if (!this._lastChild) {
        console.error(
          "孫を追加しようとしましたが、直前に産まれた子供が存在しません"
        );
        return;
      }
      var newChild = new Game_Child(
        this._lastChild.taneoyaId(),
        this._lastChild.generation() + 1
      );
      newChild.plusBrother(childCount - 1);
      this._lastChild.addChild(newChild);
      this._lastChild = newChild;
      return newChild.id();
    }
  };
  Game_FamilyTree.prototype.addBrother = function (taneoyaId) {
    if (!taneoyaId) {
      console.error("兄弟を追加しようとしましたが、種親IDが指定されていません");
      return;
    }
    var child = this.findLastChild(taneoyaId);
    if (!child) {
      console.error(
        "兄弟を追加しようとしましたが、" +
          taneoyaId +
          "の種親IDが見つからないため新規に追加しました"
      );
      this.addChild(taneoyaId);
      return;
    }
    child.plusBrother(1);
  };
  Game_FamilyTree.prototype.findLastChild = function (taneoyaId) {
    for (var i = this._children.length - 1; i >= 0; i--) {
      var child = this._children[i];
      if (child.taneoyaId() == taneoyaId) {
        return child;
      }
    }
    return null;
  };
  Game_FamilyTree.prototype.children = function () {
    return this._children;
  };
  Game_FamilyTree.prototype.countChild = function (taneoyaId) {
    var total = 0;
    for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
      var c = _a[_i];
      total += c.countChild(taneoyaId);
    }
    return total;
  };
  Game_FamilyTree.prototype.findChild = function (id) {
    for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
      var c = _a[_i];
      if (c.id() == id) {
        return c;
      }
      var found = c.findChild(id);
      if (found) {
        return found;
      }
    }
    return null;
  };
  return Game_FamilyTree;
})();
var Game_Child = /** @class */ (function () {
  function Game_Child(taneoyaId, generation) {
    if (generation === void 0) {
      generation = 1;
    }
    this._brotherCount = 1;
    this._children = [];
    this._id = $gameSystem.nextChildId();
    this._taneoyaId = taneoyaId;
    this._generation = generation;
  }
  Game_Child.prototype.id = function () {
    return this._id;
  };
  Game_Child.prototype.taneoyaId = function () {
    return this._taneoyaId;
  };
  Game_Child.prototype.addChild = function (child) {
    this._children.push(child);
  };
  Game_Child.prototype.plusBrother = function (n) {
    this._brotherCount += n;
  };
  Game_Child.prototype.brotherCount = function () {
    return this._brotherCount;
  };
  Game_Child.prototype.hasGrandchild = function () {
    return this._children.length > 0;
  };
  Game_Child.prototype.child = function () {
    return this._children[0];
  };
  Game_Child.prototype.generation = function () {
    return this._generation;
  };
  Game_Child.prototype.countChild = function (taneoyaId) {
    if (this._taneoyaId != taneoyaId) {
      return 0;
    }
    var total = this._brotherCount;
    for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
      var c = _a[_i];
      total += c.countChild(taneoyaId);
    }
    return total;
  };
  Game_Child.prototype.findChild = function (id) {
    var c = this.child();
    if (c) {
      if (c.id() == id) {
        return c;
      }
      return c.findChild(id);
    }
    return null;
  };
  return Game_Child;
})();
Game_System.prototype.addChild = function (taneoyaId, childCount) {
  if (childCount === void 0) {
    childCount = 1;
  }
  this._familyTree = this._familyTree || new Game_FamilyTree();
  return this._familyTree.addChild(taneoyaId, childCount);
};
Game_System.prototype.addBrother = function (taneoyaId) {
  this._familyTree = this._familyTree || new Game_FamilyTree();
  this._familyTree.addBrother(taneoyaId);
};
Game_System.prototype.addGrandchild = function (childCount, parentId) {
  if (childCount === void 0) {
    childCount = 1;
  }
  this._familyTree = this._familyTree || new Game_FamilyTree();
  return this._familyTree.addGrandchild(childCount, parentId);
};
Game_System.prototype.nextChildId = function () {
  this._nextChildId = this._nextChildId || 0;
  this._nextChildId++;
  return this._nextChildId;
};
Game_System.prototype.familyTree = function () {
  this._familyTree = this._familyTree || new Game_FamilyTree();
  return this._familyTree;
};
Game_System.prototype.countChild = function (taneoyaId) {
  this._familyTree = this._familyTree || new Game_FamilyTree();
  return this._familyTree.countChild(taneoyaId);
};
(function (Nore) {
  var Scene_FamilyTree = /** @class */ (function (_super) {
    __extends(Scene_FamilyTree, _super);
    function Scene_FamilyTree() {
      return (_super !== null && _super.apply(this, arguments)) || this;
    }
    Scene_FamilyTree.prototype.create = function () {
      _super.prototype.create.call(this);
      this.createFamilyTreeWindow();
    };
    Scene_FamilyTree.prototype.createBackground = function () {
      var g = new PIXI.Graphics();
      g.beginFill(0x976d64, 1);
      g.drawRect(0, 0, Graphics.boxWidth + 10, Graphics.boxHeight + 10);
      g.endFill();
      this.addChild(g);
    };
    Scene_FamilyTree.prototype.createFamilyTreeWindow = function () {
      this._familyTreeWindow = new Window_FamilyTree(
        0,
        0,
        Graphics.boxWidth,
        Graphics.boxHeight
      );
      this._familyTreeWindow.refresh();
      this.addWindow(this._familyTreeWindow);
    };
    Scene_FamilyTree.prototype.update = function () {
      _super.prototype.update.call(this);
      if (Input.isTriggered("cancel")) {
        SoundManager.playCancel();
        SceneManager.pop();
      }
    };
    return Scene_FamilyTree;
  })(Scene_MenuBase);
  Nore.Scene_FamilyTree = Scene_FamilyTree;
  var Sprite_Pic = /** @class */ (function (_super) {
    __extends(Sprite_Pic, _super);
    function Sprite_Pic(name) {
      var _this = _super.call(this) || this;
      _this._name = name;
      _this.bitmap = ImageManager.loadPicture("エロステータス/" + name);
      return _this;
    }
    Sprite_Pic.prototype.update = function () {
      _super.prototype.update.call(this);
    };
    return Sprite_Pic;
  })(Sprite);
  var BG_COLOR = "#976d64";
  var LINE_COLOR = "#2a1713";
  var BLOCK_COLOR = "#ffe9c3";
  var INTERBAL_X = 120;
  var MARGIN_BETWEEN_FATHER_AND_CHILD = 50;
  var MARGIN_BETWEEN_FATHER_AND_CHILDREN = 80;
  var GRAND_CHILD_X = 76;
  var GRAND_CHILD_Y = 30;
  var INTERVAL_GRANDCHILD_Y = 120;
  var MAX_CHILDREN = 4; // 最大の表示子供。これより多い子供は省略
  var CenterLineInfo = /** @class */ (function () {
    function CenterLineInfo(initialY) {
      this._leftYList = [];
      this._rightYList = [];
      this._initialY = initialY;
    }
    CenterLineInfo.prototype.addLeft = function (y) {
      this._leftYList.push(y);
    };
    CenterLineInfo.prototype.addRight = function (y) {
      this._rightYList.push(y);
    };
    CenterLineInfo.prototype.maxY = function () {
      return Math.max(this.maxLeft(), this.maxRight());
    };
    CenterLineInfo.prototype.maxLeft = function () {
      var max = this._initialY;
      for (var _i = 0, _a = this._leftYList; _i < _a.length; _i++) {
        var n = _a[_i];
        if (max < n) {
          max = n;
        }
      }
      return max - this._initialY;
    };
    CenterLineInfo.prototype.maxRight = function () {
      var max = this._initialY;
      for (var _i = 0, _a = this._rightYList; _i < _a.length; _i++) {
        var n = _a[_i];
        if (max < n) {
          max = n;
        }
      }
      return max - this._initialY;
    };
    CenterLineInfo.prototype.initialY = function () {
      return this._initialY;
    };
    CenterLineInfo.prototype.leftYList = function () {
      return this._leftYList;
    };
    CenterLineInfo.prototype.rightYList = function () {
      return this._rightYList;
    };
    return CenterLineInfo;
  })();
  var FONT_NAME = "游ゴシック";
  var FONT_SIZE = 18;
  var COLOR = 0x2a1713;
  var Sprite_Name = /** @class */ (function (_super) {
    __extends(Sprite_Name, _super);
    function Sprite_Name(taneoyaId, isChild) {
      var _this = _super.call(this) || this;
      //this.bitmap.drawText('ゴブリン', 0, 0, 100, 30, 'center');
      var name;
      if (isChild) {
        name = getBabyName(taneoyaId);
      } else {
        name = getTaneoyaName(taneoyaId);
      }
      var bmtext2 = new PIXI.extras.BitmapText(name, {
        font: {
          name: FONT_NAME,
          size: FONT_SIZE,
        },
        align: "left",
        tint: COLOR,
      });
      bmtext2.x = Math.floor((102 - bmtext2.width) / 2);
      bmtext2.y = 8;
      _this.addChild(bmtext2);
      return _this;
    }
    return Sprite_Name;
  })(Sprite);
  var Sprite_Child = /** @class */ (function (_super) {
    __extends(Sprite_Child, _super);
    function Sprite_Child() {
      var _this = (_super !== null && _super.apply(this, arguments)) || this;
      _this._maxHeight = 0;
      return _this;
    }
    Sprite_Child.prototype.createNameSprite = function (
      taneoyaId,
      x,
      y,
      isChild,
      isCloseRelative
    ) {
      if (isChild) {
        var type = getBabyPic(taneoyaId);
        var babyPic = new Sprite_Pic("menu_P04 PC001 子孫-" + type);
        babyPic.x = x;
        babyPic.y = y - 82;
        this.addChild(babyPic);

        if (isCloseRelative) {
          var closePic = new Sprite_Pic("menu_P04 PC001 家系図_子_近親マーク");
          closePic.x = x + Nore.CLOSE_RELATIVE_X;
          closePic.y = y - 26 + Nore.CLOSE_RELATIVE_Y;
          this.addChild(closePic);
        }

        var sprite = new Sprite_Name(taneoyaId, true);
        sprite.x = x;
        if (isCloseRelative) {
          sprite.y = y + 6 + Nore.CLOSE_RELATIVE_NAME_Y;
        } else {
          sprite.y = y;
        }
        this.addChild(sprite);
      } else {
        var sprite = new Sprite_Name(taneoyaId, false);
        sprite.x = x;
        sprite.y = y;
        this.addChild(sprite);
      }
    };
    Sprite_Child.prototype.calcGrandChildCount = function () {
      var n = 0;
      var child = this._child;
      while (child.hasGrandchild()) {
        n++;
        child = child.child();
      }
      return n;
    };
    Sprite_Child.prototype.calcHeight = function () {
      if (this._maxHeight > 0) {
        return this._maxHeight;
      }
      if (this._child.brotherCount() === 1) {
        // 兄弟がいない場合
        return 150;
      }
      return 190;
    };
    Sprite_Child.prototype.createBitmap = function () {
      var height = 200 + this.calcGrandChildCount() * INTERVAL_GRANDCHILD_Y;
      this.bitmap = new Bitmap(600, height);
    };
    Sprite_Child.prototype.drawLineVertial = function (x, y, height) {
      this.bitmap.fillRect(x, y, 3, height, LINE_COLOR);
      this.bitmap.fillRect(x + 1, y, 1, height, BLOCK_COLOR);
    };
    Sprite_Child.prototype.drawLineHorizontal = function (x, y, width) {
      this.bitmap.fillRect(x, y, width, 3, LINE_COLOR);
      this.bitmap.fillRect(x, y + 1, width, 1, BLOCK_COLOR);
    };
    Sprite_Child.prototype.drawLineHorizontalDouble = function (x, y, width) {
      this.drawLineHorizontal(x, y, width);
      this.drawLineHorizontal(x, y + 4, width);
    };
    Sprite_Child.prototype.putDot = function (x, y, color) {
      this.bitmap.fillRect(x, y, 1, 1, color);
    };
    Sprite_Child.prototype.drawPlus = function (plus, x, y) {
      var bmtext2 = new PIXI.extras.BitmapText("+" + plus, {
        font: {
          name: FONT_NAME,
          size: FONT_SIZE,
        },
        align: "center",
        tint: COLOR,
      });
      bmtext2.x = x;
      bmtext2.y = y;
      this.addChild(bmtext2);
      return bmtext2;
    };
    Sprite_Child.prototype.maxChildren = function () {
      return MAX_CHILDREN;
    };
    return Sprite_Child;
  })(Sprite);
  var Sprite_ChildLeft = /** @class */ (function (_super) {
    __extends(Sprite_ChildLeft, _super);
    function Sprite_ChildLeft(child, y, centerLineInfo) {
      var _this = _super.call(this) || this;
      _this.y = y;
      _this._centerLineInfo = centerLineInfo;
      _this._child = child;
      _this.updatePosition();
      _this.createBitmap();
      _this.addFatherPic();
      _this.addChildPic(child, 0);
      _this._centerLineInfo.addLeft(_this.y);
      return _this;
    }
    Sprite_ChildLeft.prototype.addFatherPic = function () {
      var fatherPic = new Sprite_Pic("menu_P04 PC001 家系図_親_left");
      fatherPic.x = INTERBAL_X * 3;
      this.addChild(fatherPic);
      this.createNameSprite(
        this._child.taneoyaId(),
        fatherPic.x,
        fatherPic.y,
        false
      );
    };
    Sprite_ChildLeft.prototype.addChildPic = function (child, y) {
      if (child.hasGrandchild()) {
        this.addGrandChild(y, child);
      } else {
        this.drawBgLines(child, y);
        var maxChild = Math.min(child.brotherCount(), MAX_CHILDREN);
        var xx = (MAX_CHILDREN - maxChild) * INTERBAL_X;
        var yy = y;
        for (var i = 0; i < maxChild; i++) {
          var childPic = new Sprite_Pic("menu_P04 PC001 家系図_子");
          childPic.x = 77 + INTERBAL_X * i + xx;
          if (child.brotherCount() == 1) {
            childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILD + yy;
          } else {
            childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILDREN + yy;
          }
          this.addChild(childPic);

          this.createNameSprite(
            child.taneoyaId(),
            childPic.x,
            childPic.y + 26,
            true,
            child.generation() > 1
          );
        }
        if (child.brotherCount() > this.maxChildren()) {
          this.addOmitPic(child.brotherCount() - this.maxChildren(), y);
        }
      }
    };
    Sprite_ChildLeft.prototype.addOmitPic = function (num, y) {
      var bro1 = MAX_CHILDREN;
      var childPic = new Sprite_Pic("menu_P04 PC001 家系図_省略");
      childPic.x = 21 + INTERBAL_X * bro1;
      childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILD + 8 + y;
      this.drawLineHorizontal(childPic.x - 10, childPic.y + 2, 10);
      this.addChild(childPic);
      this.drawPlus(num, childPic.x + 15, childPic.y - 7);
    };
    Sprite_ChildLeft.prototype.addGrandChild = function (y, child) {
      this._centerLineInfo.addLeft(this.y + y + INTERVAL_GRANDCHILD_Y);
      var hh = 70;
      var xx = 129 + 3 * INTERBAL_X;
      this.drawLineHorizontal(
        xx - GRAND_CHILD_X,
        y + 0 + hh - 1,
        GRAND_CHILD_X + 2
      );
      this.drawLineVertial(xx, y + 20, 50);
      this.drawLineVertial(xx - GRAND_CHILD_X, y + 0 + hh + 1, 50);
      var childPic = new Sprite_Pic("menu_P04 PC001 家系図_親_left");
      childPic.x = 3 * INTERBAL_X;
      childPic.y = y + 20 + hh + GRAND_CHILD_Y;
      this.addChild(childPic);
      this.createNameSprite(
        child.taneoyaId(),
        childPic.x,
        childPic.y,
        true,
        child.generation() > 1
      );
      if (!this._maxHeight) {
        this._maxHeight = 190;
      }
      this._maxHeight += INTERVAL_GRANDCHILD_Y;
      if (child.brotherCount() > 1) {
        var maxChild = Math.min(child.brotherCount(), MAX_CHILDREN - 1) - 1;
        this.drawLineHorizontal(
          409 - INTERBAL_X * maxChild,
          y + hh - 1,
          INTERBAL_X * maxChild + 5
        );
        var xx_1 = 0;
        var yy = y + 12;
        for (var i = 0; i < maxChild; i++) {
          this.drawLineVertial(
            289 - INTERBAL_X * i,
            y + MARGIN_BETWEEN_FATHER_AND_CHILDREN - 9,
            50
          );
          var childPic_1 = new Sprite_Pic("menu_P04 PC001 家系図_子");
          childPic_1.x = 237 - INTERBAL_X * i + xx_1;
          childPic_1.y = MARGIN_BETWEEN_FATHER_AND_CHILDREN + yy;
          this.addChild(childPic_1);
          this.createNameSprite(
            child.taneoyaId(),
            childPic_1.x,
            childPic_1.y + 26,
            true,
            child.generation() > 1
          );
        }
        this.putDot(409 - INTERBAL_X * maxChild, y + 70, LINE_COLOR);
      } else {
        this.putDot(xx - GRAND_CHILD_X, y + 70, LINE_COLOR);
      }
      if (child.brotherCount() > MAX_CHILDREN - 1) {
        this.addOmitPic(child.brotherCount() - (MAX_CHILDREN - 1), y + 9);
      } else {
        this.putDot(491, y + 70, LINE_COLOR);
      }
      this.addChildPic(child.child(), y + INTERVAL_GRANDCHILD_Y);
    };
    Sprite_ChildLeft.prototype.updatePosition = function () {
      this.x = 306 - INTERBAL_X * 3;
    };
    Sprite_ChildLeft.prototype.drawBgLines = function (child, y) {
      var bro1 = Math.min(child.brotherCount() - 1, 3);
      if (child.brotherCount() == 1) {
        this.drawLineVertial(129 + INTERBAL_X * 3, 20 + y, 30);
        return;
      }
      var xx = (3 - bro1) * INTERBAL_X;
      var maxChild = Math.min(bro1, MAX_CHILDREN);
      this.drawLineVertial(129 + INTERBAL_X * maxChild + xx, 23 + y, 60);
      this.drawLineHorizontal(
        129 + xx,
        60 + y,
        INTERBAL_X * Math.min(bro1, MAX_CHILDREN - 1) + 1
      );
      this.putDot(129 + xx, 61 + y, LINE_COLOR);
      for (var i = 0; i < Math.min(bro1, MAX_CHILDREN); i++) {
        this.drawLineVertial(129 + INTERBAL_X * i + xx, 62 + y, 29);
      }
    };
    return Sprite_ChildLeft;
  })(Sprite_Child);
  var Sprite_ChildRight = /** @class */ (function (_super) {
    __extends(Sprite_ChildRight, _super);
    function Sprite_ChildRight(child, y, centerLineInfo) {
      var _this = _super.call(this) || this;
      _this.y = y;
      _this._centerLineInfo = centerLineInfo;
      _this._child = child;
      _this.updatePosition();
      _this.createBitmap();
      _this.addFatherPic();
      _this.addChildPic(child, 0);
      _this._centerLineInfo.addRight(_this.y);
      return _this;
    }
    Sprite_ChildRight.prototype.addFatherPic = function () {
      var fatherPic = new Sprite_Pic("menu_P04 PC001 家系図_親_right");
      fatherPic.x = 0;
      this.addChild(fatherPic);
      this.createNameSprite(
        this._child.taneoyaId(),
        fatherPic.x + 45,
        fatherPic.y,
        false
      );
    };
    Sprite_ChildRight.prototype.addChildPic = function (child, y) {
      if (child.hasGrandchild()) {
        this.addGrandChild(y, child);
      } else {
        this.drawBgLines(child, y);
        var maxChild = Math.min(child.brotherCount(), MAX_CHILDREN);
        var xx = -33;
        var yy = y;
        for (var i = 0; i < maxChild; i++) {
          var childPic = new Sprite_Pic("menu_P04 PC001 家系図_子");
          childPic.x = INTERBAL_X * i + xx;
          if (child.brotherCount() == 1) {
            childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILD + yy;
          } else {
            childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILDREN + yy;
          }
          this.addChild(childPic);
          this.createNameSprite(
            child.taneoyaId(),
            childPic.x,
            childPic.y + 26,
            true,
            child.generation() > 1
          );
        }
        if (child.brotherCount() > this.maxChildren()) {
          this.addOmitPic(child.brotherCount() - this.maxChildren(), y);
        }
      }
    };
    Sprite_ChildRight.prototype.addOmitPic = function (num, y) {
      var childPic = new Sprite_Pic("menu_P04 PC001 家系図_省略");
      childPic.x = 0;
      childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILD + 8 + y;
      this.drawLineHorizontal(childPic.x + 10, childPic.y + 2, 10);
      this.addChild(childPic);
      var sprite = this.drawPlus(num, childPic.x - 6, childPic.y - 7);
      sprite.x -= sprite.width;
    };
    Sprite_ChildRight.prototype.addGrandChild = function (y, child) {
      this._centerLineInfo.addRight(this.y + y + INTERVAL_GRANDCHILD_Y);
      var hh = 70;
      var xx = 19;
      this.drawLineHorizontal(20, y + 0 + hh - 1, GRAND_CHILD_X + 2);
      this.drawLineVertial(xx, y + 20, 50);
      this.drawLineVertial(xx + GRAND_CHILD_X, y + 0 + hh + 1, 50);
      var childPic = new Sprite_Pic("menu_P04 PC001 家系図_親_right");
      childPic.x = 0;
      childPic.y = y + 20 + hh + GRAND_CHILD_Y;
      this.addChild(childPic);

      this.createNameSprite(
        child.taneoyaId(),
        childPic.x + 45,
        childPic.y,
        true,
        child.generation() > 1
      );
      if (!this._maxHeight) {
        this._maxHeight = 190;
      }
      this._maxHeight += INTERVAL_GRANDCHILD_Y;
      if (child.brotherCount() > 1) {
        var maxChild = Math.min(child.brotherCount(), MAX_CHILDREN - 1) - 1;
        this.drawLineHorizontal(98, y + hh - 1, INTERBAL_X * maxChild + 4);
        var xx_2 = 0;
        var yy = y + 12;
        this.putDot(98 + INTERBAL_X * maxChild + 3, y + hh, LINE_COLOR);
        for (var i = 0; i < maxChild; i++) {
          this.drawLineVertial(
            219 + INTERBAL_X * i,
            y + MARGIN_BETWEEN_FATHER_AND_CHILDREN - 9,
            50
          );
          var childPic_2 = new Sprite_Pic("menu_P04 PC001 家系図_子");
          childPic_2.x = 167 + INTERBAL_X * i + xx_2;
          childPic_2.y = MARGIN_BETWEEN_FATHER_AND_CHILDREN + yy;
          this.addChild(childPic_2);
          this.createNameSprite(
            child.taneoyaId(),
            childPic_2.x,
            childPic_2.y + 26,
            true,
            child.generation() > 1
          );
        }
      } else {
        this.putDot(97, y + 70, LINE_COLOR);
      }
      if (child.brotherCount() > MAX_CHILDREN - 1) {
        this.addOmitPic(child.brotherCount() - (MAX_CHILDREN - 1), y + 9);
      } else {
        this.putDot(491, y + 70, LINE_COLOR);
      }
      this.addChildPic(child.child(), y + INTERVAL_GRANDCHILD_Y);
    };
    Sprite_ChildRight.prototype.updatePosition = function () {
      this.x = 566;
    };
    Sprite_ChildRight.prototype.drawBgLines = function (child, y) {
      var bro1 = Math.min(child.brotherCount() - 1, 4);
      if (child.brotherCount() == 1) {
        this.drawLineVertial(19, 20 + y, 30);
        return;
      }
      var xx = 10;
      var maxChild = Math.min(bro1, MAX_CHILDREN - 1);
      this.drawLineVertial(19, 23 + y, 60);
      this.drawLineHorizontal(
        21,
        60 + y,
        INTERBAL_X * Math.min(bro1, MAX_CHILDREN - 1) + 1
      );
      this.putDot(
        21 + INTERBAL_X * Math.min(bro1, MAX_CHILDREN - 1),
        60 + y + 1,
        LINE_COLOR
      );
      for (var i = 0; i < Math.min(bro1, MAX_CHILDREN - 1); i++) {
        this.drawLineVertial(129 + INTERBAL_X * i + xx, 62 + y, 29);
      }
    };
    return Sprite_ChildRight;
  })(Sprite_Child);
  var Sprite_VerticalLine = /** @class */ (function (_super) {
    __extends(Sprite_VerticalLine, _super);
    function Sprite_VerticalLine(centerLineInfo) {
      var _this = _super.call(this) || this;
      var offsetX = 60;
      var max = centerLineInfo.maxY() + 6;

      // bitmapの最大サイズ超え
      let margin = 20;
      max = Math.min(max, 16384 - margin);

      _this.bitmap = new Bitmap(120, max + margin);
      _this.drawLineVertial(offsetX + 0, 0, max);
      _this.drawLineVertial(offsetX + 3, 0, max);
      var yList = centerLineInfo.leftYList();
      for (var i = 0; i < yList.length; i++) {
        var y = yList[i];
        _this.drawLineHorizontal(0, y - centerLineInfo.initialY(), offsetX + 1);
        _this.drawLineHorizontal(
          0,
          y - centerLineInfo.initialY() + 4,
          offsetX + 1
        );
      }
      var yList2 = centerLineInfo.rightYList();
      for (var i = 0; i < yList2.length; i++) {
        var y = yList2[i];
        _this.drawLineHorizontal(
          offsetX + 5,
          y - centerLineInfo.initialY(),
          offsetX + 1
        );
        _this.drawLineHorizontal(
          offsetX + 5,
          y - centerLineInfo.initialY() + 4,
          offsetX + 1
        );
      }
      if (centerLineInfo.maxLeft() > centerLineInfo.maxRight()) {
        _this.bitmap.fillRect(
          offsetX + 1,
          centerLineInfo.maxLeft() + 2,
          3,
          1,
          LINE_COLOR
        );
        _this.bitmap.fillRect(
          offsetX,
          centerLineInfo.maxLeft() + 3,
          3,
          1,
          BG_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 1,
          centerLineInfo.maxLeft() + 4,
          3,
          1,
          LINE_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 1,
          centerLineInfo.maxLeft() + 5,
          4,
          1,
          BLOCK_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 1,
          centerLineInfo.maxLeft() + 6,
          4,
          1,
          LINE_COLOR
        );
      } else if (centerLineInfo.maxLeft() < centerLineInfo.maxRight()) {
        _this.bitmap.fillRect(
          offsetX + 2,
          centerLineInfo.maxRight() + 2,
          3,
          1,
          LINE_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 4,
          centerLineInfo.maxRight() + 3,
          3,
          1,
          BG_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 2,
          centerLineInfo.maxRight() + 4,
          3,
          1,
          LINE_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 2,
          centerLineInfo.maxRight() + 5,
          4,
          1,
          BLOCK_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 1,
          centerLineInfo.maxRight() + 6,
          4,
          1,
          LINE_COLOR
        );
      } else {
      }
      return _this;
    }
    Sprite_VerticalLine.prototype.drawLineVertial = function (x, y, height) {
      this.bitmap.fillRect(x, y, 3, height, LINE_COLOR);
      this.bitmap.fillRect(x + 1, y, 1, height, BLOCK_COLOR);
    };
    Sprite_VerticalLine.prototype.drawLineHorizontal = function (x, y, width) {
      this.bitmap.fillRect(x, y, width, 3, LINE_COLOR);
      this.bitmap.fillRect(x, y + 1, width, 1, BLOCK_COLOR);
    };
    return Sprite_VerticalLine;
  })(Sprite);
  var Window_FamilyTree = /** @class */ (function (_super) {
    __extends(Window_FamilyTree, _super);
    function Window_FamilyTree() {
      return (_super !== null && _super.apply(this, arguments)) || this;
    }
    Window_FamilyTree.prototype.initialize = function (x, y, w, h) {
      _super.prototype.initialize.call(this, x, y, w, h);
      this.backOpacity = 0;
      this._windowBackSprite.alpha = 0;
      this._windowFrameSprite.visible = false;
      //this.contentsOpacity = 0;
      this._maxHeight = 1100;
      this.createBaseSprite();
      this.addPicture();
      this.createChildSprites();
      this.createFadeSprite();
      this.y = -1000;
    };
    Window_FamilyTree.prototype.createFadeSprite = function () {
      this._fadeSprite = new ScreenSprite();
      this.addChild(this._fadeSprite);
    };
    Window_FamilyTree.prototype.createBaseSprite = function () {
      this._baseSprite = new Sprite();
      this.addChild(this._baseSprite);
    };
    Window_FamilyTree.prototype.addPicture = function () {
      this._pic1 = new Sprite_Pic("menu_P04 PC001 家系図_A");
      this._baseSprite.addChild(this._pic1);
      this._pic2 = new Sprite_Pic("menu_P04 PC001 家系図_B");
      this._pic2.y = Graphics.boxHeight;
      this._baseSprite.addChild(this._pic2);
    };
    Window_FamilyTree.prototype.createChildSprites = function () {
      var familyTree = $gameSystem.familyTree();
      if (familyTree.children().length === 0) {
        return;
      }
      this.addSerenaBack();
      var initialY = 1420;
      var centerLineInfo = new CenterLineInfo(initialY);
      var leftY = initialY;
      var rightY = initialY;
      var plusRightHeight = false;
      for (var _i = 0, _a = familyTree.children(); _i < _a.length; _i++) {
        var child = _a[_i];
        var isLeft = leftY <= rightY;
        if (isLeft) {
          /*if (lastLeftHeight > 0) {
                        this.addVertialLine(leftY, lastLeftHeight);
                    }*/
          leftY += this.addLeft(child, leftY, centerLineInfo);
        } else {
          rightY += this.addRight(child, rightY, centerLineInfo);
          if (!plusRightHeight) {
            plusRightHeight = true;
            rightY += Nore.RIGHT_TREE_OFFSET;
          }
        }
      }
      this.drawCenterLine(centerLineInfo);
      this.addSerenaSprite();
      this._maxHeight = Math.max(leftY, rightY) - 550;
    };
    Window_FamilyTree.prototype.drawCenterLine = function (centerLineInfo) {
      var height = centerLineInfo.maxY();
      var sprite = new Sprite_VerticalLine(centerLineInfo);
      sprite.x = 450;
      sprite.y = centerLineInfo.initialY() + 16;
      this._baseSprite.addChild(sprite);
    };
    Window_FamilyTree.prototype.addSerenaBack = function () {
      var g = new PIXI.Graphics();
      g.beginFill(0x976d64, 1);
      g.drawRect(0, 0, 140, 160);
      g.endFill();
      g.x = 440;
      g.y = Graphics.boxHeight * 2 - 204;
      this._baseSprite.addChild(g);
    };
    Window_FamilyTree.prototype.addSerenaSprite = function () {
      this._pic3 = new Sprite_Pic("menu_P04 PC001 家系図_C");
      this._pic3.x = 424;
      this._pic3.y = 1332;
      this._baseSprite.addChild(this._pic3);
    };
    Window_FamilyTree.prototype.addLeft = function (child, y, centerLineInfo) {
      var sprite = new Sprite_ChildLeft(child, y, centerLineInfo);
      this._baseSprite.addChild(sprite);
      return sprite.calcHeight();
    };
    Window_FamilyTree.prototype.addRight = function (child, y, centerLineInfo) {
      var sprite = new Sprite_ChildRight(child, y, centerLineInfo);
      this._baseSprite.addChild(sprite);
      return sprite.calcHeight();
    };
    Window_FamilyTree.prototype.refresh = function () {};
    Object.defineProperty(Window_FamilyTree.prototype, "backOpacity", {
      set: function (n) {},
      enumerable: true,
      configurable: true,
    });
    Window_FamilyTree.prototype.update = function () {
      _super.prototype.update.call(this);
      if (this._fadeSprite) {
        this._fadeSprite.opacity = 255 - $gameScreen.brightness();
      }
      if (Input.isPressed("up")) {
        this.y += this.interval();
        if (this.y > 0) {
          this.y = 0;
        }
      } else if (Input.isPressed("down")) {
        this.y -= this.interval();
        if (this.y < -this.maxY()) {
          this.y = -this.maxY();
        }
      }
    };
    Window_FamilyTree.prototype.interval = function () {
      return 10;
    };
    Window_FamilyTree.prototype.maxY = function () {
      return this._maxHeight;
    };
    return Window_FamilyTree;
  })(Window_Base);
  Nore.Window_FamilyTree = Window_FamilyTree;
})(Nore || (Nore = {}));
/*
(function() {

    function p(arg) {
        console.log(arg);
    }

    (window as any).p = p;

})();
*/
var TANEOYA_MAP = {
  1: ["不明", "不明"],
  2: ["ジャック", "ジャック"],
  3: ["ヘンリー", "ヘンリー"],
  4: ["ゴードン", "ゴードン"],
  5: ["ドッヂ", "ドッヂ"],
  6: ["通り魔ジョン（賞金首）", "ジョン"],
  7: ["異教徒ブライ（賞金首）", "ブライ"],
  8: ["強姦魔トム（賞金首）", "トム"],
  9: ["強盗ゴブログ（賞金首）", "ゴブログ"],
  10: ["ゴミ漁りギー（賞金首）", "ギー"],
  11: ["人攫いビョーン（賞金首）", "ビョーン"],
  12: ["博愛者ギニュー（賞金首）", "ギニュー"],
  13: ["ヴァンサン（スラム）", "ヴァンサン"],
  14: ["アルベール（市民）", "アルベール"],
  15: ["サミュエル（市民）", "サミュエル"],
  16: ["ドニ（市民）", "ドニ"],
  17: ["マチアス（市民）", "マチアス"],
  18: ["マルセル（市民）", "マルセル"],
  19: ["店主ディーコン（市民）", "ディーコン"],
  20: ["富豪グービル（市民）", "グーピル"],
  21: ["市警長デムーラン（市民）", "デムーラン"],
  22: ["町医者ロドリグ（市民）", "ロドリグ"],
  23: ["オリバー（冒険者）", "オリバー"],
  24: ["ガエタン（冒険者）", "ガエタン"],
  25: ["ジョエル（冒険者）", "ジョエル"],
  26: ["トリスタン（冒険者）", "トリスタン"],
  27: ["豚のゲクラン（市民）", "ゲクラン"],
  28: ["本屋のティム（市民）", "ティム"],
  29: ["ギャングリーダーガヌロン（スラム）", "ガヌロン"],
  30: ["ギャングのバーダン（スラム）", "バーダン"],
  31: ["人間（個人", ""],
  32: ["人間（個人", ""],
  33: ["人間（個人", ""],
  34: ["人間（個人", ""],
  35: ["人間（個人", ""],
  36: ["人間（個人", ""],
  37: ["人間（個人", ""],
  38: ["人間（個人", ""],
  39: ["人間（個人", ""],
  40: ["人間（個人", ""],
  41: ["人間（個人", ""],
  42: ["人間（個人", ""],
  43: ["人間（個人", ""],
  44: ["人間（個人", ""],
  45: ["人間（個人", ""],
  46: ["人間（個人", ""],
  47: ["人間（個人", ""],
  48: ["人間（個人", ""],
  49: ["人間（個人", ""],
  50: ["人間（個人", ""],
  51: ["温泉屋ヘンリー（第三部）", "ヘンリー"],
  52: ["鬼狩りマクシス（第三部）", "マクシス"],
  53: ["宿屋モリス（第三部）", "モリス"],
  54: ["武器屋ピエール（第三部）", "ピエール"],
  55: ["乱暴者ブリュノ（第三部）", "ブリュノ"],
  56: ["マセガキマセル（第三部）", "マセル"],
  57: ["種馬スタリオン（第三部）", "スタリオン"],
  58: ["農夫ボンド（第三部）", "ボンド"],
  59: ["人間（個人", ""],
  60: ["人間（個人", ""],
  61: ["人間（個人", ""],
  62: ["人間（個人", ""],
  63: ["人間（個人", ""],
  64: ["人間（個人", ""],
  65: ["人間（個人", ""],
  66: ["人間（個人", ""],
  67: ["人間（個人", ""],
  68: ["人間（個人", ""],
  69: ["人間（個人", ""],
  70: ["人間（個人", ""],
  71: ["人間（個人", ""],
  72: ["人間（個人", ""],
  73: ["人間（個人", ""],
  74: ["人間（個人", ""],
  75: ["人間（個人", ""],
  76: ["人間（個人", ""],
  77: ["人間（個人", ""],
  78: ["人間（個人", ""],
  79: ["人間（個人", ""],
  80: ["人間（個人", ""],
  81: ["人間（個人", ""],
  82: ["人間（個人", ""],
  83: ["人間（個人", ""],
  84: ["人間（個人", ""],
  85: ["人間（個人", ""],
  86: ["人間（個人", ""],
  87: ["人間（個人", ""],
  88: ["人間（個人", ""],
  89: ["人間（個人", ""],
  90: ["人間（個人", ""],
  91: ["人間（個人", ""],
  92: ["人間（個人", ""],
  93: ["人間（個人", ""],
  94: ["人間（個人", ""],
  95: ["人間（個人", ""],
  96: ["人間（個人", ""],
  97: ["人間（個人", ""],
  98: ["人間（個人", ""],
  99: ["人間（個人", ""],
  100: ["分からない", "父親不明"],
  101: ["不明", "不明", "父親不明"],
  102: ["孤児", "孤児"],
  103: ["市警隊員", "市警隊員"],
  104: ["冒険者", "冒険者"],
  105: ["ごろつき", "ごろつき"],
  106: ["市民悪漢（ちんぴら）", "チンピラ"],
  107: ["異教徒", "異教徒"],
  108: ["浮浪者", "浮浪者"],
  109: ["ガヌロンの息子", "ガヌロンの息子", "ガヌロンの孫"],
  110: ["人間（職業", ""],
  111: ["人間（職業", ""],
  112: ["人間（職業", ""],
  113: ["人間（職業", ""],
  114: ["人間（職業", ""],
  115: ["売春客", "売春客"],
  116: ["異人", "異人"],
  117: ["囚人", "囚人"],
  118: ["人間（職業", ""],
  119: ["人間（職業", ""],
  120: ["人間（職業", ""],
  121: ["人間（職業", ""],
  122: ["人間（職業", ""],
  123: ["人間（職業", ""],
  124: ["人間（職業", ""],
  125: ["人間（職業", ""],
  126: ["人間（職業", ""],
  127: ["人間（職業", ""],
  128: ["人間（職業", ""],
  129: ["人間（職業", ""],
  130: ["人間（職業", ""],
  131: ["人間（職業", ""],
  132: ["人間（職業", ""],
  133: ["人間（職業", ""],
  134: ["人間（職業", ""],
  135: ["人間（職業", ""],
  136: ["人間（職業", ""],
  137: ["人間（職業", ""],
  138: ["人間（職業", ""],
  139: ["人間（職業", ""],
  140: ["人間（職業", ""],
  141: ["人間（職業", ""],
  142: ["人間（職業", ""],
  143: ["人間（職業", ""],
  144: ["人間（職業", ""],
  145: ["人間（職業", ""],
  146: ["人間（職業", ""],
  147: ["人間（職業", ""],
  148: ["人間（職業", ""],
  149: ["人間（職業", ""],
  150: ["人間（職業", ""],
  151: ["モンスター（個体", ""],
  152: ["モンスター（個体", ""],
  153: ["モンスター（個体", ""],
  154: ["モンスター（個体", ""],
  155: ["モンスター（個体", ""],
  156: ["モンスター（個体", ""],
  157: ["モンスター（個体", ""],
  158: ["モンスター（個体", ""],
  159: ["モンスター（個体", ""],
  160: ["モンスター（個体", ""],
  161: ["モンスター（個体", ""],
  162: ["モンスター（個体", ""],
  163: ["モンスター（個体", ""],
  164: ["モンスター（個体", ""],
  165: ["モンスター（個体", ""],
  166: ["モンスター（個体", ""],
  167: ["モンスター（個体", ""],
  168: ["モンスター（個体", ""],
  169: ["モンスター（個体", ""],
  170: ["モンスター（個体", ""],
  171: ["モンスター（個体", ""],
  172: ["モンスター（個体", ""],
  173: ["モンスター（個体", ""],
  174: ["モンスター（個体", ""],
  175: ["モンスター（個体", ""],
  176: ["モンスター（個体", ""],
  177: ["モンスター（個体", ""],
  178: ["モンスター（個体", ""],
  179: ["モンスター（個体", ""],
  180: ["モンスター（個体", ""],
  181: ["モンスター（個体", ""],
  182: ["モンスター（個体", ""],
  183: ["モンスター（個体", ""],
  184: ["モンスター（個体", ""],
  185: ["モンスター（個体", ""],
  186: ["モンスター（個体", ""],
  187: ["モンスター（個体", ""],
  188: ["モンスター（個体", ""],
  189: ["モンスター（個体", ""],
  190: ["モンスター（個体", ""],
  191: ["モンスター（個体", ""],
  192: ["モンスター（個体", ""],
  193: ["モンスター（個体", ""],
  194: ["モンスター（個体", ""],
  195: ["モンスター（個体", ""],
  196: ["モンスター（個体", ""],
  197: ["モンスター（個体", ""],
  198: ["モンスター（個体", ""],
  199: ["モンスター（個体", ""],
  200: ["モンスター（個体", ""],
  201: ["ゴブリン", "ゴブリン"],
  202: ["ゴブリンの仔", "ゴブリンの仔"],
  203: ["モンスター（種族", ""],
  204: ["モンスター（種族", ""],
  205: ["モンスター（種族", ""],
  206: ["オーク", "オーク"],
  207: ["オークの仔", "オークの仔"],
  208: ["モンスター（種族", ""],
  209: ["モンスター（種族", ""],
  210: ["モンスター（種族", ""],
  211: ["スライム", "スライム"],
  212: ["モンスター（種族", ""],
  213: ["ビッグスライム", "スライム"],
  214: ["ビッグスライム", "スライム", "セレナの子"],
  215: ["モンスターの仔", ""],
  216: ["スタリオン", "スタリオン"],
  217: ["スタリオンの仔", "スタリオンの仔"],
  218: ["モンスター（種族", ""],
  219: ["モンスター（種族", ""],
  220: ["モンスター（種族", ""],
  221: ["ローパー", "ローパー", "ローパーの幼体"],
  222: ["ローパーの仔", "ローパーの幼体"],
  223: ["モンスター（種族", ""],
  224: ["モンスター（種族", ""],
  225: ["モンスター（種族", ""],
  226: ["ピッグマン", "ピッグマン"],
  227: ["ピッグマンの仔", "ピッグマンの仔"],
  228: ["モンスター（種族", ""],
  229: ["モンスター（種族", ""],
  230: ["モンスター（種族", ""],
  231: ["ワーグ", "ワーグ", "ワーグの仔"],
  232: ["ワーグの仔", "ワーグの仔"],
  233: ["モンスター（種族", ""],
  234: ["モンスター（種族", ""],
  235: ["モンスター（種族", ""],
  236: ["モンスター（個体", ""],
  237: ["モンスター（個体", ""],
  238: ["モンスター（種族", ""],
  239: ["モンスター（種族", ""],
  240: ["モンスター（種族", ""],
  241: ["モンスター（種族", ""],
  242: ["モンスター（種族", ""],
  243: ["モンスター（種族", ""],
  244: ["モンスター（種族", ""],
  245: ["モンスター（種族", ""],
  246: ["モンスター（種族", ""],
  247: ["モンスター（種族", ""],
  248: ["モンスター（種族", ""],
  249: ["モンスター（種族", ""],
  250: ["モンスター（種族", ""],
  251: ["その他", ""],
  252: ["その他", ""],
  253: ["その他", ""],
  254: ["その他", ""],
  255: ["その他", ""],
  256: ["その他", ""],
  257: ["その他", ""],
  258: ["その他", ""],
  259: ["その他", ""],
  260: ["その他", ""],
  261: ["その他", ""],
  262: ["その他", ""],
  263: ["その他", ""],
  264: ["その他", ""],
  265: ["その他", ""],
  266: ["その他", ""],
  267: ["その他", ""],
  268: ["その他", ""],
  269: ["その他", ""],
  270: ["その他", ""],
  271: ["その他", ""],
  272: ["その他", ""],
  273: ["その他", ""],
  274: ["その他", ""],
  275: ["その他", ""],
  276: ["その他", ""],
  277: ["その他", ""],
  278: ["その他", ""],
  279: ["その他", ""],
  280: ["その他", ""],
  281: ["その他", ""],
  282: ["その他", ""],
  283: ["その他", ""],
  284: ["その他", ""],
  285: ["その他", ""],
  286: ["その他", ""],
  287: ["その他", ""],
  288: ["その他", ""],
  289: ["その他", ""],
  290: ["その他", ""],
  291: ["その他", ""],
  292: ["その他", ""],
  293: ["その他", ""],
  294: ["その他", ""],
  295: ["その他", ""],
  296: ["その他", ""],
  297: ["その他", ""],
  298: ["その他", ""],
  299: ["その他", ""],
  300: ["その他", ""],
};
function getTaneoyaName(id) {
  if (!TANEOYA_MAP[id]) {
    console.error("ID が" + id + "の種親が見つかりません");
    return "";
  }
  return TANEOYA_MAP[id][1];
}
function getBabyName(id) {
  if (!TANEOYA_MAP[id]) {
    console.error("ID が" + id + "の子供が見つかりません");
    return "";
  }
  if (TANEOYA_MAP[id][2]) {
    return TANEOYA_MAP[id][2];
  }
  return TANEOYA_MAP[id][1] + "の子";
}
function getBabyPic(id) {
  switch (id) {
    case 201:
      return "ゴブリンの子供";
    case 202:
      return "ゴブリンの子供";
    case 206:
      return "オークの子供";
    case 207:
      return "オークの子供";
    case 211:
      return "スライムの幼体";
    case 213:
      return "スライムの幼体";
    case 216:
      return "スタリオンの子供";
    case 217:
      return "スタリオンの子供";
    case 221:
      return "ローパーの子供";
    case 222:
      return "ローパーの子供";
    case 226:
      return "ピッグマンの子供";
    case 227:
      return "ピッグマンの子供";
    case 231:
      return "ワーグの子供";
    case 232:
      return "ワーグの子供";
    case 6:
      return "悪人の子供";
    case 7:
      return "黒人の子供";
    case 29:
      return "黒人の子供";
    case 30:
      return "黒人の子供";
    case 109:
      return "黒人の子供";
    default:
      return "〇〇の子供";
  }
}

repo_name: Idkwtcm/violated

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 (b.hasOwnProperty(p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
/*:ja
 * @author ル
 *
 * @param rightTreeOffset
 * @desc 右側のツリーは、この値だけずれます
 * @default 15
 */
var Nore;
(function (Nore) {
  var Parameters = PluginManager.parameters("Nore_FamilyTree2");
  Nore.RIGHT_TREE_OFFSET = Parameters["rightTreeOffset"]
    ? Math.trunc(Parameters["rightTreeOffset"])
    : 15;
  // 設定
  var FONT_NAME = "游ゴシック";
  var FONT_SIZE = 18;
  var COLOR = 0x2a1713;
  Nore.CHILD_TEXT_JA = "の子供";
  Nore.CHILD_TEXT_EN = "Child of";
  var loader;
  var _Scene_Boot_loadSystemImages = Scene_Boot.loadSystemImages;
  Scene_Boot.loadSystemImages = function () {
    _Scene_Boot_loadSystemImages.call(this);
    loader = new PIXI.loaders.Loader();
    loader.add("HeaderFont", "./fonts/bgfont.fnt").load(function () {});
  };
  var Scene_Map_prototype_update = Scene_Map.prototype.update;
  Scene_Map.prototype.update = function () {
    Scene_Map_prototype_update.call(this);
    if ($gameSwitches.value(601)) {
      this.showFamilyTree();
    } else {
      this.hideFamilyTree();
    }
  };
  Scene_Map.prototype.showFamilyTree = function () {
    if (!this._familyTreeWindow) {
      this.createFamilyTreeBg();
      this._familyTreeWindow = new Nore.Window_FamilyTree(
        0,
        0,
        Graphics.boxWidth,
        Graphics.boxHeight
      );
      this._spriteset.addChild(this._familyTreeWindow);
    }
    this._familyTreeBg.visible = true;
    this._familyTreeWindow.visible = true;
    this._familyTreeWindow.update();
  };
  Scene_Map.prototype.hideFamilyTree = function () {
    if (this._familyTreeWindow && this._familyTreeWindow.visible) {
      this._familyTreeWindow.visible = false;
      this._familyTreeBg.visible = false;
    }
  };
  Scene_Map.prototype.createFamilyTreeBg = function () {
    if (this._familyTreeBg) {
      return;
    }
    var g = new PIXI.Graphics();
    g.beginFill(0x976d64, 1);
    g.drawRect(0, 0, Graphics.boxWidth + 10, Graphics.boxHeight + 10);
    g.endFill();
    this._familyTreeBg = g;
    this._spriteset.addChild(g);
  };
})(Nore || (Nore = {}));
var Game_FamilyTree = /** @class */ (function () {
  function Game_FamilyTree() {
    this._children = [];
  }
  Game_FamilyTree.prototype.addChild = function (taneoyaId, childCount) {
    var newChild = new Game_Child(taneoyaId);
    newChild.plusBrother(childCount - 1);
    this._children.push(newChild);
    this._lastChild = newChild;
    return newChild.id();
  };
  Game_FamilyTree.prototype.addGrandchild = function (childCount, id) {
    if (id) {
      var parent_1 = this.findChild(id);
      if (!parent_1) {
        console.error(
          "孫を追加しようとしましたが、" + id + "のIDの子供が存在しません"
        );
        return;
      }
      var newChild = new Game_Child(
        parent_1.taneoyaId(),
        parent_1.generation() + 1
      );
      newChild.plusBrother(childCount - 1);
      parent_1.addChild(newChild);
      return newChild.id();
    } else {
      if (!this._lastChild) {
        console.error(
          "孫を追加しようとしましたが、直前に産まれた子供が存在しません"
        );
        return;
      }
      var newChild = new Game_Child(
        this._lastChild.taneoyaId(),
        this._lastChild.generation() + 1
      );
      newChild.plusBrother(childCount - 1);
      this._lastChild.addChild(newChild);
      this._lastChild = newChild;
      return newChild.id();
    }
  };
  Game_FamilyTree.prototype.addBrother = function (taneoyaId) {
    if (!taneoyaId) {
      console.error("兄弟を追加しようとしましたが、種親IDが指定されていません");
      return;
    }
    var child = this.findLastChild(taneoyaId);
    if (!child) {
      console.error(
        "兄弟を追加しようとしましたが、" +
          taneoyaId +
          "の種親IDが見つからないため新規に追加しました"
      );
      this.addChild(taneoyaId);
      return;
    }
    child.plusBrother(1);
  };
  Game_FamilyTree.prototype.findLastChild = function (taneoyaId) {
    for (var i = this._children.length - 1; i >= 0; i--) {
      var child = this._children[i];
      if (child.taneoyaId() == taneoyaId) {
        return child;
      }
    }
    return null;
  };
  Game_FamilyTree.prototype.children = function () {
    return this._children;
  };
  Game_FamilyTree.prototype.countChild = function (taneoyaId) {
    var total = 0;
    for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
      var c = _a[_i];
      total += c.countChild(taneoyaId);
    }
    return total;
  };
  Game_FamilyTree.prototype.findChild = function (id) {
    for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
      var c = _a[_i];
      if (c.id() == id) {
        return c;
      }
      var found = c.findChild(id);
      if (found) {
        return found;
      }
    }
    return null;
  };
  return Game_FamilyTree;
})();
var Game_Child = /** @class */ (function () {
  function Game_Child(taneoyaId, generation) {
    if (generation === void 0) {
      generation = 1;
    }
    this._brotherCount = 1;
    this._children = [];
    this._id = $gameSystem.nextChildId();
    this._taneoyaId = taneoyaId;
    this._generation = generation;
  }
  Game_Child.prototype.id = function () {
    return this._id;
  };
  Game_Child.prototype.taneoyaId = function () {
    return this._taneoyaId;
  };
  Game_Child.prototype.addChild = function (child) {
    this._children.push(child);
  };
  Game_Child.prototype.plusBrother = function (n) {
    this._brotherCount += n;
  };
  Game_Child.prototype.brotherCount = function () {
    return this._brotherCount;
  };
  Game_Child.prototype.hasGrandchild = function () {
    return this._children.length > 0;
  };
  Game_Child.prototype.child = function () {
    return this._children[0];
  };
  Game_Child.prototype.generation = function () {
    return this._generation;
  };
  Game_Child.prototype.countChild = function (taneoyaId) {
    if (this._taneoyaId != taneoyaId) {
      return 0;
    }
    var total = this._brotherCount;
    for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
      var c = _a[_i];
      total += c.countChild(taneoyaId);
    }
    return total;
  };
  Game_Child.prototype.findChild = function (id) {
    var c = this.child();
    if (c) {
      if (c.id() == id) {
        return c;
      }
      return c.findChild(id);
    }
    return null;
  };
  return Game_Child;
})();
Game_System.prototype.addChild = function (taneoyaId, childCount) {
  if (childCount === void 0) {
    childCount = 1;
  }
  this._familyTree = this._familyTree || new Game_FamilyTree();
  return this._familyTree.addChild(taneoyaId, childCount);
};
Game_System.prototype.addBrother = function (taneoyaId) {
  this._familyTree = this._familyTree || new Game_FamilyTree();
  this._familyTree.addBrother(taneoyaId);
};
Game_System.prototype.addGrandchild = function (childCount, parentId) {
  if (childCount === void 0) {
    childCount = 1;
  }
  this._familyTree = this._familyTree || new Game_FamilyTree();
  return this._familyTree.addGrandchild(childCount, parentId);
};
Game_System.prototype.nextChildId = function () {
  this._nextChildId = this._nextChildId || 0;
  this._nextChildId++;
  return this._nextChildId;
};
Game_System.prototype.familyTree = function () {
  this._familyTree = this._familyTree || new Game_FamilyTree();
  return this._familyTree;
};
Game_System.prototype.countChild = function (taneoyaId) {
  this._familyTree = this._familyTree || new Game_FamilyTree();
  return this._familyTree.countChild(taneoyaId);
};
(function (Nore) {
  var Scene_FamilyTree = /** @class */ (function (_super) {
    __extends(Scene_FamilyTree, _super);
    function Scene_FamilyTree() {
      return (_super !== null && _super.apply(this, arguments)) || this;
    }
    Scene_FamilyTree.prototype.create = function () {
      _super.prototype.create.call(this);
      this.createFamilyTreeWindow();
    };
    Scene_FamilyTree.prototype.createBackground = function () {
      var g = new PIXI.Graphics();
      g.beginFill(0x976d64, 1);
      g.drawRect(0, 0, Graphics.boxWidth + 10, Graphics.boxHeight + 10);
      g.endFill();
      this.addChild(g);
    };
    Scene_FamilyTree.prototype.createFamilyTreeWindow = function () {
      this._familyTreeWindow = new Window_FamilyTree(
        0,
        0,
        Graphics.boxWidth,
        Graphics.boxHeight
      );
      this._familyTreeWindow.refresh();
      this.addWindow(this._familyTreeWindow);
    };
    Scene_FamilyTree.prototype.update = function () {
      _super.prototype.update.call(this);
      if (Input.isTriggered("cancel")) {
        SoundManager.playCancel();
        SceneManager.pop();
      }
    };
    return Scene_FamilyTree;
  })(Scene_MenuBase);
  Nore.Scene_FamilyTree = Scene_FamilyTree;
  var Sprite_Pic = /** @class */ (function (_super) {
    __extends(Sprite_Pic, _super);
    function Sprite_Pic(name) {
      var _this = _super.call(this) || this;
      _this._name = name;
      _this.bitmap = ImageManager.loadPicture("エロステータス/" + name);
      return _this;
    }
    Sprite_Pic.prototype.update = function () {
      _super.prototype.update.call(this);
    };
    return Sprite_Pic;
  })(Sprite);
  var BG_COLOR = "#976d64";
  var LINE_COLOR = "#2a1713";
  var BLOCK_COLOR = "#ffe9c3";
  var INTERBAL_X = 120;
  var MARGIN_BETWEEN_FATHER_AND_CHILD = 50;
  var MARGIN_BETWEEN_FATHER_AND_CHILDREN = 80;
  var GRAND_CHILD_X = 76;
  var GRAND_CHILD_Y = 30;
  var INTERVAL_GRANDCHILD_Y = 120;
  var MAX_CHILDREN = 4; // 最大の表示子供。これより多い子供は省略
  var CenterLineInfo = /** @class */ (function () {
    function CenterLineInfo(initialY) {
      this._leftYList = [];
      this._rightYList = [];
      this._initialY = initialY;
    }
    CenterLineInfo.prototype.addLeft = function (y) {
      this._leftYList.push(y);
    };
    CenterLineInfo.prototype.addRight = function (y) {
      this._rightYList.push(y);
    };
    CenterLineInfo.prototype.maxY = function () {
      return Math.max(this.maxLeft(), this.maxRight());
    };
    CenterLineInfo.prototype.maxLeft = function () {
      var max = this._initialY;
      for (var _i = 0, _a = this._leftYList; _i < _a.length; _i++) {
        var n = _a[_i];
        if (max < n) {
          max = n;
        }
      }
      return max - this._initialY;
    };
    CenterLineInfo.prototype.maxRight = function () {
      var max = this._initialY;
      for (var _i = 0, _a = this._rightYList; _i < _a.length; _i++) {
        var n = _a[_i];
        if (max < n) {
          max = n;
        }
      }
      return max - this._initialY;
    };
    CenterLineInfo.prototype.initialY = function () {
      return this._initialY;
    };
    CenterLineInfo.prototype.leftYList = function () {
      return this._leftYList;
    };
    CenterLineInfo.prototype.rightYList = function () {
      return this._rightYList;
    };
    return CenterLineInfo;
  })();
  var FONT_NAME = "游ゴシック";
  var FONT_SIZE = 18;
  var COLOR = 0x2a1713;
  var Sprite_Name = /** @class */ (function (_super) {
    __extends(Sprite_Name, _super);
    function Sprite_Name(taneoyaId, isChild) {
      var _this = _super.call(this) || this;
      //this.bitmap.drawText('ゴブリン', 0, 0, 100, 30, 'center');
      var name;
      if (isChild) {
        name = getBabyName(taneoyaId);
      } else {
        name = getTaneoyaName(taneoyaId);
      }
      var bmtext2 = new PIXI.extras.BitmapText(name, {
        font: {
          name: FONT_NAME,
          size: FONT_SIZE,
        },
        align: "left",
        tint: COLOR,
      });
      bmtext2.x = Math.floor((102 - bmtext2.width) / 2);
      bmtext2.y = 8;
      _this.addChild(bmtext2);
      return _this;
    }
    return Sprite_Name;
  })(Sprite);
  var Sprite_Child = /** @class */ (function (_super) {
    __extends(Sprite_Child, _super);
    function Sprite_Child() {
      var _this = (_super !== null && _super.apply(this, arguments)) || this;
      _this._maxHeight = 0;
      return _this;
    }
    Sprite_Child.prototype.createNameSprite = function (
      taneoyaId,
      x,
      y,
      isChild
    ) {
      if (isChild) {
        var type = getBabyPic(taneoyaId);
        var babyPic = new Sprite_Pic("menu_P04 PC001 子孫-" + type);
        babyPic.x = x;
        babyPic.y = y - 82;
        this.addChild(babyPic);
        var sprite = new Sprite_Name(taneoyaId, true);
        sprite.x = x;
        sprite.y = y;
        this.addChild(sprite);
      } else {
        var sprite = new Sprite_Name(taneoyaId, false);
        sprite.x = x;
        sprite.y = y;
        this.addChild(sprite);
      }
    };
    Sprite_Child.prototype.calcGrandChildCount = function () {
      var n = 0;
      var child = this._child;
      while (child.hasGrandchild()) {
        n++;
        child = child.child();
      }
      return n;
    };
    Sprite_Child.prototype.calcHeight = function () {
      if (this._maxHeight > 0) {
        return this._maxHeight;
      }
      if (this._child.brotherCount() === 1) {
        // 兄弟がいない場合
        return 150;
      }
      return 190;
    };
    Sprite_Child.prototype.createBitmap = function () {
      var height = 200 + this.calcGrandChildCount() * INTERVAL_GRANDCHILD_Y;
      this.bitmap = new Bitmap(600, height);
    };
    Sprite_Child.prototype.drawLineVertial = function (x, y, height) {
      this.bitmap.fillRect(x, y, 3, height, LINE_COLOR);
      this.bitmap.fillRect(x + 1, y, 1, height, BLOCK_COLOR);
    };
    Sprite_Child.prototype.drawLineHorizontal = function (x, y, width) {
      this.bitmap.fillRect(x, y, width, 3, LINE_COLOR);
      this.bitmap.fillRect(x, y + 1, width, 1, BLOCK_COLOR);
    };
    Sprite_Child.prototype.drawLineHorizontalDouble = function (x, y, width) {
      this.drawLineHorizontal(x, y, width);
      this.drawLineHorizontal(x, y + 4, width);
    };
    Sprite_Child.prototype.putDot = function (x, y, color) {
      this.bitmap.fillRect(x, y, 1, 1, color);
    };
    Sprite_Child.prototype.drawPlus = function (plus, x, y) {
      var bmtext2 = new PIXI.extras.BitmapText("+" + plus, {
        font: {
          name: FONT_NAME,
          size: FONT_SIZE,
        },
        align: "center",
        tint: COLOR,
      });
      bmtext2.x = x;
      bmtext2.y = y;
      this.addChild(bmtext2);
      return bmtext2;
    };
    Sprite_Child.prototype.maxChildren = function () {
      return MAX_CHILDREN;
    };
    return Sprite_Child;
  })(Sprite);
  var Sprite_ChildLeft = /** @class */ (function (_super) {
    __extends(Sprite_ChildLeft, _super);
    function Sprite_ChildLeft(child, y, centerLineInfo) {
      var _this = _super.call(this) || this;
      _this.y = y;
      _this._centerLineInfo = centerLineInfo;
      _this._child = child;
      _this.updatePosition();
      _this.createBitmap();
      _this.addFatherPic();
      _this.addChildPic(child, 0);
      _this._centerLineInfo.addLeft(_this.y);
      return _this;
    }
    Sprite_ChildLeft.prototype.addFatherPic = function () {
      var fatherPic = new Sprite_Pic("menu_P04 PC001 家系図_親_left");
      fatherPic.x = INTERBAL_X * 3;
      this.addChild(fatherPic);
      this.createNameSprite(
        this._child.taneoyaId(),
        fatherPic.x,
        fatherPic.y,
        false
      );
    };
    Sprite_ChildLeft.prototype.addChildPic = function (child, y) {
      if (child.hasGrandchild()) {
        this.addGrandChild(y, child);
      } else {
        this.drawBgLines(child, y);
        var maxChild = Math.min(child.brotherCount(), MAX_CHILDREN);
        var xx = (MAX_CHILDREN - maxChild) * INTERBAL_X;
        var yy = y;
        for (var i = 0; i < maxChild; i++) {
          var childPic = new Sprite_Pic("menu_P04 PC001 家系図_子");
          childPic.x = 77 + INTERBAL_X * i + xx;
          if (child.brotherCount() == 1) {
            childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILD + yy;
          } else {
            childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILDREN + yy;
          }
          this.addChild(childPic);
          this.createNameSprite(
            child.taneoyaId(),
            childPic.x,
            childPic.y + 26,
            true
          );
        }
        if (child.brotherCount() > this.maxChildren()) {
          this.addOmitPic(child.brotherCount() - this.maxChildren(), y);
        }
      }
    };
    Sprite_ChildLeft.prototype.addOmitPic = function (num, y) {
      var bro1 = MAX_CHILDREN;
      var childPic = new Sprite_Pic("menu_P04 PC001 家系図_省略");
      childPic.x = 21 + INTERBAL_X * bro1;
      childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILD + 8 + y;
      this.drawLineHorizontal(childPic.x - 10, childPic.y + 2, 10);
      this.addChild(childPic);
      this.drawPlus(num, childPic.x + 15, childPic.y - 7);
    };
    Sprite_ChildLeft.prototype.addGrandChild = function (y, child) {
      this._centerLineInfo.addLeft(this.y + y + INTERVAL_GRANDCHILD_Y);
      var hh = 70;
      var xx = 129 + 3 * INTERBAL_X;
      this.drawLineHorizontal(
        xx - GRAND_CHILD_X,
        y + 0 + hh - 1,
        GRAND_CHILD_X + 2
      );
      this.drawLineVertial(xx, y + 20, 50);
      this.drawLineVertial(xx - GRAND_CHILD_X, y + 0 + hh + 1, 50);
      var childPic = new Sprite_Pic("menu_P04 PC001 家系図_親_left");
      childPic.x = 3 * INTERBAL_X;
      childPic.y = y + 20 + hh + GRAND_CHILD_Y;
      this.addChild(childPic);
      this.createNameSprite(child.taneoyaId(), childPic.x, childPic.y, true);
      if (!this._maxHeight) {
        this._maxHeight = 190;
      }
      this._maxHeight += INTERVAL_GRANDCHILD_Y;
      if (child.brotherCount() > 1) {
        var maxChild = Math.min(child.brotherCount(), MAX_CHILDREN - 1) - 1;
        this.drawLineHorizontal(
          409 - INTERBAL_X * maxChild,
          y + hh - 1,
          INTERBAL_X * maxChild + 5
        );
        var xx_1 = 0;
        var yy = y + 12;
        for (var i = 0; i < maxChild; i++) {
          this.drawLineVertial(
            289 - INTERBAL_X * i,
            y + MARGIN_BETWEEN_FATHER_AND_CHILDREN - 9,
            50
          );
          var childPic_1 = new Sprite_Pic("menu_P04 PC001 家系図_子");
          childPic_1.x = 237 - INTERBAL_X * i + xx_1;
          childPic_1.y = MARGIN_BETWEEN_FATHER_AND_CHILDREN + yy;
          this.addChild(childPic_1);
          this.createNameSprite(
            child.taneoyaId(),
            childPic_1.x,
            childPic_1.y + 26,
            true
          );
        }
        this.putDot(409 - INTERBAL_X * maxChild, y + 70, LINE_COLOR);
      } else {
        this.putDot(xx - GRAND_CHILD_X, y + 70, LINE_COLOR);
      }
      if (child.brotherCount() > MAX_CHILDREN - 1) {
        this.addOmitPic(child.brotherCount() - (MAX_CHILDREN - 1), y + 9);
      } else {
        this.putDot(491, y + 70, LINE_COLOR);
      }
      this.addChildPic(child.child(), y + INTERVAL_GRANDCHILD_Y);
    };
    Sprite_ChildLeft.prototype.updatePosition = function () {
      this.x = 306 - INTERBAL_X * 3;
    };
    Sprite_ChildLeft.prototype.drawBgLines = function (child, y) {
      var bro1 = Math.min(child.brotherCount() - 1, 3);
      if (child.brotherCount() == 1) {
        this.drawLineVertial(129 + INTERBAL_X * 3, 20 + y, 30);
        return;
      }
      var xx = (3 - bro1) * INTERBAL_X;
      var maxChild = Math.min(bro1, MAX_CHILDREN);
      this.drawLineVertial(129 + INTERBAL_X * maxChild + xx, 23 + y, 60);
      this.drawLineHorizontal(
        129 + xx,
        60 + y,
        INTERBAL_X * Math.min(bro1, MAX_CHILDREN - 1) + 1
      );
      this.putDot(129 + xx, 61 + y, LINE_COLOR);
      for (var i = 0; i < Math.min(bro1, MAX_CHILDREN); i++) {
        this.drawLineVertial(129 + INTERBAL_X * i + xx, 62 + y, 29);
      }
    };
    return Sprite_ChildLeft;
  })(Sprite_Child);
  var Sprite_ChildRight = /** @class */ (function (_super) {
    __extends(Sprite_ChildRight, _super);
    function Sprite_ChildRight(child, y, centerLineInfo) {
      var _this = _super.call(this) || this;
      _this.y = y;
      _this._centerLineInfo = centerLineInfo;
      _this._child = child;
      _this.updatePosition();
      _this.createBitmap();
      _this.addFatherPic();
      _this.addChildPic(child, 0);
      _this._centerLineInfo.addRight(_this.y);
      return _this;
    }
    Sprite_ChildRight.prototype.addFatherPic = function () {
      var fatherPic = new Sprite_Pic("menu_P04 PC001 家系図_親_right");
      fatherPic.x = 0;
      this.addChild(fatherPic);
      this.createNameSprite(
        this._child.taneoyaId(),
        fatherPic.x + 45,
        fatherPic.y,
        false
      );
    };
    Sprite_ChildRight.prototype.addChildPic = function (child, y) {
      if (child.hasGrandchild()) {
        this.addGrandChild(y, child);
      } else {
        this.drawBgLines(child, y);
        var maxChild = Math.min(child.brotherCount(), MAX_CHILDREN);
        var xx = -33;
        var yy = y;
        for (var i = 0; i < maxChild; i++) {
          var childPic = new Sprite_Pic("menu_P04 PC001 家系図_子");
          childPic.x = INTERBAL_X * i + xx;
          if (child.brotherCount() == 1) {
            childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILD + yy;
          } else {
            childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILDREN + yy;
          }
          this.addChild(childPic);
          this.createNameSprite(
            child.taneoyaId(),
            childPic.x,
            childPic.y + 26,
            true
          );
        }
        if (child.brotherCount() > this.maxChildren()) {
          this.addOmitPic(child.brotherCount() - this.maxChildren(), y);
        }
      }
    };
    Sprite_ChildRight.prototype.addOmitPic = function (num, y) {
      var childPic = new Sprite_Pic("menu_P04 PC001 家系図_省略");
      childPic.x = 0;
      childPic.y = MARGIN_BETWEEN_FATHER_AND_CHILD + 8 + y;
      this.drawLineHorizontal(childPic.x + 10, childPic.y + 2, 10);
      this.addChild(childPic);
      var sprite = this.drawPlus(num, childPic.x - 6, childPic.y - 7);
      sprite.x -= sprite.width;
    };
    Sprite_ChildRight.prototype.addGrandChild = function (y, child) {
      this._centerLineInfo.addRight(this.y + y + INTERVAL_GRANDCHILD_Y);
      var hh = 70;
      var xx = 19;
      this.drawLineHorizontal(20, y + 0 + hh - 1, GRAND_CHILD_X + 2);
      this.drawLineVertial(xx, y + 20, 50);
      this.drawLineVertial(xx + GRAND_CHILD_X, y + 0 + hh + 1, 50);
      var childPic = new Sprite_Pic("menu_P04 PC001 家系図_親_right");
      childPic.x = 0;
      childPic.y = y + 20 + hh + GRAND_CHILD_Y;
      this.addChild(childPic);
      this.createNameSprite(
        child.taneoyaId(),
        childPic.x + 45,
        childPic.y,
        true
      );
      if (!this._maxHeight) {
        this._maxHeight = 190;
      }
      this._maxHeight += INTERVAL_GRANDCHILD_Y;
      if (child.brotherCount() > 1) {
        var maxChild = Math.min(child.brotherCount(), MAX_CHILDREN - 1) - 1;
        this.drawLineHorizontal(98, y + hh - 1, INTERBAL_X * maxChild + 4);
        var xx_2 = 0;
        var yy = y + 12;
        this.putDot(98 + INTERBAL_X * maxChild + 3, y + hh, LINE_COLOR);
        for (var i = 0; i < maxChild; i++) {
          this.drawLineVertial(
            219 + INTERBAL_X * i,
            y + MARGIN_BETWEEN_FATHER_AND_CHILDREN - 9,
            50
          );
          var childPic_2 = new Sprite_Pic("menu_P04 PC001 家系図_子");
          childPic_2.x = 167 + INTERBAL_X * i + xx_2;
          childPic_2.y = MARGIN_BETWEEN_FATHER_AND_CHILDREN + yy;
          this.addChild(childPic_2);
          this.createNameSprite(
            child.taneoyaId(),
            childPic_2.x,
            childPic_2.y + 26,
            true
          );
        }
      } else {
        this.putDot(97, y + 70, LINE_COLOR);
      }
      if (child.brotherCount() > MAX_CHILDREN - 1) {
        this.addOmitPic(child.brotherCount() - (MAX_CHILDREN - 1), y + 9);
      } else {
        this.putDot(491, y + 70, LINE_COLOR);
      }
      this.addChildPic(child.child(), y + INTERVAL_GRANDCHILD_Y);
    };
    Sprite_ChildRight.prototype.updatePosition = function () {
      this.x = 566;
    };
    Sprite_ChildRight.prototype.drawBgLines = function (child, y) {
      var bro1 = Math.min(child.brotherCount() - 1, 4);
      if (child.brotherCount() == 1) {
        this.drawLineVertial(19, 20 + y, 30);
        return;
      }
      var xx = 10;
      var maxChild = Math.min(bro1, MAX_CHILDREN - 1);
      this.drawLineVertial(19, 23 + y, 60);
      this.drawLineHorizontal(
        21,
        60 + y,
        INTERBAL_X * Math.min(bro1, MAX_CHILDREN - 1) + 1
      );
      this.putDot(
        21 + INTERBAL_X * Math.min(bro1, MAX_CHILDREN - 1),
        60 + y + 1,
        LINE_COLOR
      );
      for (var i = 0; i < Math.min(bro1, MAX_CHILDREN - 1); i++) {
        this.drawLineVertial(129 + INTERBAL_X * i + xx, 62 + y, 29);
      }
    };
    return Sprite_ChildRight;
  })(Sprite_Child);
  var Sprite_VerticalLine = /** @class */ (function (_super) {
    __extends(Sprite_VerticalLine, _super);
    function Sprite_VerticalLine(centerLineInfo) {
      var _this = _super.call(this) || this;
      var offsetX = 60;
      var max = centerLineInfo.maxY() + 6;
      _this.bitmap = new Bitmap(160, max + 20);
      _this.drawLineVertial(offsetX + 0, 0, max);
      _this.drawLineVertial(offsetX + 3, 0, max);
      var yList = centerLineInfo.leftYList();
      for (var i = 0; i < yList.length; i++) {
        var y = yList[i];
        _this.drawLineHorizontal(0, y - centerLineInfo.initialY(), offsetX + 1);
        _this.drawLineHorizontal(
          0,
          y - centerLineInfo.initialY() + 4,
          offsetX + 1
        );
      }
      var yList2 = centerLineInfo.rightYList();
      for (var i = 0; i < yList2.length; i++) {
        var y = yList2[i];
        _this.drawLineHorizontal(
          offsetX + 5,
          y - centerLineInfo.initialY(),
          offsetX + 1
        );
        _this.drawLineHorizontal(
          offsetX + 5,
          y - centerLineInfo.initialY() + 4,
          offsetX + 1
        );
      }
      if (centerLineInfo.maxLeft() > centerLineInfo.maxRight()) {
        _this.bitmap.fillRect(
          offsetX + 1,
          centerLineInfo.maxLeft() + 2,
          3,
          1,
          LINE_COLOR
        );
        _this.bitmap.fillRect(
          offsetX,
          centerLineInfo.maxLeft() + 3,
          3,
          1,
          BG_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 1,
          centerLineInfo.maxLeft() + 4,
          3,
          1,
          LINE_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 1,
          centerLineInfo.maxLeft() + 5,
          4,
          1,
          BLOCK_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 1,
          centerLineInfo.maxLeft() + 6,
          4,
          1,
          LINE_COLOR
        );
      } else if (centerLineInfo.maxLeft() < centerLineInfo.maxRight()) {
        _this.bitmap.fillRect(
          offsetX + 2,
          centerLineInfo.maxRight() + 2,
          3,
          1,
          LINE_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 4,
          centerLineInfo.maxRight() + 3,
          3,
          1,
          BG_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 2,
          centerLineInfo.maxRight() + 4,
          3,
          1,
          LINE_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 2,
          centerLineInfo.maxRight() + 5,
          4,
          1,
          BLOCK_COLOR
        );
        _this.bitmap.fillRect(
          offsetX + 1,
          centerLineInfo.maxRight() + 6,
          4,
          1,
          LINE_COLOR
        );
      } else {
      }
      return _this;
    }
    Sprite_VerticalLine.prototype.drawLineVertial = function (x, y, height) {
      this.bitmap.fillRect(x, y, 3, height, LINE_COLOR);
      this.bitmap.fillRect(x + 1, y, 1, height, BLOCK_COLOR);
    };
    Sprite_VerticalLine.prototype.drawLineHorizontal = function (x, y, width) {
      this.bitmap.fillRect(x, y, width, 3, LINE_COLOR);
      this.bitmap.fillRect(x, y + 1, width, 1, BLOCK_COLOR);
    };
    return Sprite_VerticalLine;
  })(Sprite);
  var Window_FamilyTree = /** @class */ (function (_super) {
    __extends(Window_FamilyTree, _super);
    function Window_FamilyTree() {
      return (_super !== null && _super.apply(this, arguments)) || this;
    }
    Window_FamilyTree.prototype.initialize = function (x, y, w, h) {
      _super.prototype.initialize.call(this, x, y, w, h);
      this.backOpacity = 0;
      this._windowBackSprite.alpha = 0;
      this._windowFrameSprite.visible = false;
      //this.contentsOpacity = 0;
      this._maxHeight = 1100;
      this.createBaseSprite();
      this.addPicture();
      this.createChildSprites();
      this.createFadeSprite();
      this.y = -1000;
    };
    Window_FamilyTree.prototype.createFadeSprite = function () {
      this._fadeSprite = new ScreenSprite();
      this.addChild(this._fadeSprite);
    };
    Window_FamilyTree.prototype.createBaseSprite = function () {
      this._baseSprite = new Sprite();
      this.addChild(this._baseSprite);
    };
    Window_FamilyTree.prototype.addPicture = function () {
      this._pic1 = new Sprite_Pic("menu_P04 PC001 家系図_A");
      this._baseSprite.addChild(this._pic1);
      this._pic2 = new Sprite_Pic("menu_P04 PC001 家系図_B");
      this._pic2.y = Graphics.boxHeight;
      this._baseSprite.addChild(this._pic2);
    };
    Window_FamilyTree.prototype.createChildSprites = function () {
      var familyTree = $gameSystem.familyTree();
      if (familyTree.children().length === 0) {
        return;
      }
      this.addSerenaBack();
      var initialY = 1420;
      var centerLineInfo = new CenterLineInfo(initialY);
      var leftY = initialY;
      var rightY = initialY;
      var plusRightHeight = false;
      for (var _i = 0, _a = familyTree.children(); _i < _a.length; _i++) {
        var child = _a[_i];
        var isLeft = leftY <= rightY;
        if (isLeft) {
          /*if (lastLeftHeight > 0) {
                        this.addVertialLine(leftY, lastLeftHeight);
                    }*/
          leftY += this.addLeft(child, leftY, centerLineInfo);
        } else {
          rightY += this.addRight(child, rightY, centerLineInfo);
          if (!plusRightHeight) {
            plusRightHeight = true;
            rightY += Nore.RIGHT_TREE_OFFSET;
          }
        }
      }
      this.drawCenterLine(centerLineInfo);
      this.addSerenaSprite();
      this._maxHeight = Math.max(leftY, rightY) - 550;
    };
    Window_FamilyTree.prototype.drawCenterLine = function (centerLineInfo) {
      var height = centerLineInfo.maxY();
      var sprite = new Sprite_VerticalLine(centerLineInfo);
      sprite.x = 450;
      sprite.y = centerLineInfo.initialY() + 16;
      this._baseSprite.addChild(sprite);
    };
    Window_FamilyTree.prototype.addSerenaBack = function () {
      var g = new PIXI.Graphics();
      g.beginFill(0x976d64, 1);
      g.drawRect(0, 0, 140, 160);
      g.endFill();
      g.x = 440;
      g.y = Graphics.boxHeight * 2 - 204;
      this._baseSprite.addChild(g);
    };
    Window_FamilyTree.prototype.addSerenaSprite = function () {
      this._pic3 = new Sprite_Pic("menu_P04 PC001 家系図_C");
      this._pic3.x = 424;
      this._pic3.y = 1332;
      this._baseSprite.addChild(this._pic3);
    };
    Window_FamilyTree.prototype.addLeft = function (child, y, centerLineInfo) {
      var sprite = new Sprite_ChildLeft(child, y, centerLineInfo);
      this._baseSprite.addChild(sprite);
      return sprite.calcHeight();
    };
    Window_FamilyTree.prototype.addRight = function (child, y, centerLineInfo) {
      var sprite = new Sprite_ChildRight(child, y, centerLineInfo);
      this._baseSprite.addChild(sprite);
      return sprite.calcHeight();
    };
    Window_FamilyTree.prototype.refresh = function () {};
    Object.defineProperty(Window_FamilyTree.prototype, "backOpacity", {
      set: function (n) {},
      enumerable: true,
      configurable: true,
    });
    Window_FamilyTree.prototype.update = function () {
      _super.prototype.update.call(this);
      if (this._fadeSprite) {
        this._fadeSprite.opacity = 255 - $gameScreen.brightness();
      }
      if (Input.isPressed("up")) {
        this.y += this.interval();
        if (this.y > 0) {
          this.y = 0;
        }
      } else if (Input.isPressed("down")) {
        this.y -= this.interval();
        if (this.y < -this.maxY()) {
          this.y = -this.maxY();
        }
      }
    };
    Window_FamilyTree.prototype.interval = function () {
      return 10;
    };
    Window_FamilyTree.prototype.maxY = function () {
      return this._maxHeight;
    };
    return Window_FamilyTree;
  })(Window_Base);
  Nore.Window_FamilyTree = Window_FamilyTree;
})(Nore || (Nore = {}));
/*
(function() {

    function p(arg) {
        console.log(arg);
    }

    (window as any).p = p;

})();
*/
var TANEOYA_MAP = {
  1: ["不明", "不明"],
  2: ["ジャック", "ジャック"],
  3: ["ヘンリー", "ヘンリー"],
  4: ["ゴードン", "ゴードン"],
  5: ["ドッヂ", "ドッヂ"],
  6: ["通り魔ジョン（賞金首）", "ジョン"],
  7: ["異教徒ブライ（賞金首）", "ブライ"],
  8: ["強姦魔トム（賞金首）", "トム"],
  9: ["強盗ゴブログ（賞金首）", "ゴブログ"],
  10: ["ゴミ漁りギー（賞金首）", "ギー"],
  11: ["人攫いビョーン（賞金首）", "ビョーン"],
  12: ["博愛者ギニュー（賞金首）", "ギニュー"],
  13: ["ヴァンサン（スラム）", "ヴァンサン"],
  14: ["アルベール（市民）", "アルベール"],
  15: ["サミュエル（市民）", "サミュエル"],
  16: ["ドニ（市民）", "ドニ"],
  17: ["マチアス（市民）", "マチアス"],
  18: ["マルセル（市民）", "マルセル"],
  19: ["店主ディーコン（市民）", "ディーコン"],
  20: ["富豪グービル（市民）", "グーピル"],
  21: ["市警長デムーラン（市民）", "デムーラン"],
  22: ["町医者ロドリグ（市民）", "ロドリグ"],
  23: ["オリバー（冒険者）", "オリバー"],
  24: ["ガエタン（冒険者）", "ガエタン"],
  25: ["ジョエル（冒険者）", "ジョエル"],
  26: ["トリスタン（冒険者）", "トリスタン"],
  27: ["豚のゲクラン（市民）", "ゲクラン"],
  28: ["本屋のティム（市民）", "ティム"],
  29: ["ギャングリーダーガヌロン（スラム）", "ガヌロン"],
  30: ["ギャングのバーダン（スラム）", "バーダン"],
  31: ["人間（個人", ""],
  32: ["人間（個人", ""],
  33: ["人間（個人", ""],
  34: ["人間（個人", ""],
  35: ["人間（個人", ""],
  36: ["人間（個人", ""],
  37: ["人間（個人", ""],
  38: ["人間（個人", ""],
  39: ["人間（個人", ""],
  40: ["人間（個人", ""],
  41: ["人間（個人", ""],
  42: ["人間（個人", ""],
  43: ["人間（個人", ""],
  44: ["人間（個人", ""],
  45: ["人間（個人", ""],
  46: ["人間（個人", ""],
  47: ["人間（個人", ""],
  48: ["人間（個人", ""],
  49: ["人間（個人", ""],
  50: ["人間（個人", ""],
  51: ["温泉屋ヘンリー（第三部）", "ヘンリー"],
  52: ["鬼狩りマクシス（第三部）", "マクシス"],
  53: ["宿屋モリス（第三部）", "モリス"],
  54: ["武器屋ピエール（第三部）", "ピエール"],
  55: ["乱暴者ブリュノ（第三部）", "ブリュノ"],
  56: ["マセガキマセル（第三部）", "マセル"],
  57: ["種馬スタリオン（第三部）", "スタリオン"],
  58: ["農夫ボンド（第三部）", "ボンド"],
  59: ["人間（個人", ""],
  60: ["人間（個人", ""],
  61: ["人間（個人", ""],
  62: ["人間（個人", ""],
  63: ["人間（個人", ""],
  64: ["人間（個人", ""],
  65: ["人間（個人", ""],
  66: ["人間（個人", ""],
  67: ["人間（個人", ""],
  68: ["人間（個人", ""],
  69: ["人間（個人", ""],
  70: ["人間（個人", ""],
  71: ["人間（個人", ""],
  72: ["人間（個人", ""],
  73: ["人間（個人", ""],
  74: ["人間（個人", ""],
  75: ["人間（個人", ""],
  76: ["人間（個人", ""],
  77: ["人間（個人", ""],
  78: ["人間（個人", ""],
  79: ["人間（個人", ""],
  80: ["人間（個人", ""],
  81: ["人間（個人", ""],
  82: ["人間（個人", ""],
  83: ["人間（個人", ""],
  84: ["人間（個人", ""],
  85: ["人間（個人", ""],
  86: ["人間（個人", ""],
  87: ["人間（個人", ""],
  88: ["人間（個人", ""],
  89: ["人間（個人", ""],
  90: ["人間（個人", ""],
  91: ["人間（個人", ""],
  92: ["人間（個人", ""],
  93: ["人間（個人", ""],
  94: ["人間（個人", ""],
  95: ["人間（個人", ""],
  96: ["人間（個人", ""],
  97: ["人間（個人", ""],
  98: ["人間（個人", ""],
  99: ["人間（個人", ""],
  100: ["分からない（輪姦）", "父親不明"],
  101: ["名も知らぬ男", "名も知らぬ男"],
  102: ["孤児", "孤児"],
  103: ["市警隊員", "市警隊員"],
  104: ["冒険者", "冒険者"],
  105: ["ごろつき", "ごろつき"],
  106: ["市民悪漢（ちんぴら）", "チンピラ"],
  107: ["異教徒", "異教徒"],
  108: ["浮浪者", "浮浪者"],
  109: ["人間（職業", ""],
  110: ["人間（職業", ""],
  111: ["人間（職業", ""],
  112: ["人間（職業", ""],
  113: ["人間（職業", ""],
  114: ["人間（職業", ""],
  115: ["売春客", "売春客"],
  116: ["異人", "異人"],
  117: ["囚人", "囚人"],
  118: ["人間（職業", ""],
  119: ["人間（職業", ""],
  120: ["人間（職業", ""],
  121: ["人間（職業", ""],
  122: ["人間（職業", ""],
  123: ["人間（職業", ""],
  124: ["人間（職業", ""],
  125: ["人間（職業", ""],
  126: ["人間（職業", ""],
  127: ["人間（職業", ""],
  128: ["人間（職業", ""],
  129: ["人間（職業", ""],
  130: ["人間（職業", ""],
  131: ["人間（職業", ""],
  132: ["人間（職業", ""],
  133: ["人間（職業", ""],
  134: ["人間（職業", ""],
  135: ["人間（職業", ""],
  136: ["人間（職業", ""],
  137: ["人間（職業", ""],
  138: ["人間（職業", ""],
  139: ["人間（職業", ""],
  140: ["人間（職業", ""],
  141: ["人間（職業", ""],
  142: ["人間（職業", ""],
  143: ["人間（職業", ""],
  144: ["人間（職業", ""],
  145: ["人間（職業", ""],
  146: ["人間（職業", ""],
  147: ["人間（職業", ""],
  148: ["人間（職業", ""],
  149: ["人間（職業", ""],
  150: ["人間（職業", ""],
  151: ["モンスター（個体", ""],
  152: ["モンスター（個体", ""],
  153: ["モンスター（個体", ""],
  154: ["モンスター（個体", ""],
  155: ["モンスター（個体", ""],
  156: ["モンスター（個体", ""],
  157: ["モンスター（個体", ""],
  158: ["モンスター（個体", ""],
  159: ["モンスター（個体", ""],
  160: ["モンスター（個体", ""],
  161: ["モンスター（個体", ""],
  162: ["モンスター（個体", ""],
  163: ["モンスター（個体", ""],
  164: ["モンスター（個体", ""],
  165: ["モンスター（個体", ""],
  166: ["モンスター（個体", ""],
  167: ["モンスター（個体", ""],
  168: ["モンスター（個体", ""],
  169: ["モンスター（個体", ""],
  170: ["モンスター（個体", ""],
  171: ["モンスター（個体", ""],
  172: ["モンスター（個体", ""],
  173: ["モンスター（個体", ""],
  174: ["モンスター（個体", ""],
  175: ["モンスター（個体", ""],
  176: ["モンスター（個体", ""],
  177: ["モンスター（個体", ""],
  178: ["モンスター（個体", ""],
  179: ["モンスター（個体", ""],
  180: ["モンスター（個体", ""],
  181: ["モンスター（個体", ""],
  182: ["モンスター（個体", ""],
  183: ["モンスター（個体", ""],
  184: ["モンスター（個体", ""],
  185: ["モンスター（個体", ""],
  186: ["モンスター（個体", ""],
  187: ["モンスター（個体", ""],
  188: ["モンスター（個体", ""],
  189: ["モンスター（個体", ""],
  190: ["モンスター（個体", ""],
  191: ["モンスター（個体", ""],
  192: ["モンスター（個体", ""],
  193: ["モンスター（個体", ""],
  194: ["モンスター（個体", ""],
  195: ["モンスター（個体", ""],
  196: ["モンスター（個体", ""],
  197: ["モンスター（個体", ""],
  198: ["モンスター（個体", ""],
  199: ["モンスター（個体", ""],
  200: ["モンスター（個体", ""],
  201: ["ゴブリン", "ゴブリン"],
  202: ["ゴブリン近親", "ゴブリンの子"],
  203: ["モンスター（種族", ""],
  204: ["モンスター（種族", ""],
  205: ["モンスター（種族", ""],
  206: ["オーク", "オーク"],
  207: ["オーク（近親", "オークの子"],
  208: ["モンスター（種族", ""],
  209: ["モンスター（種族", ""],
  210: ["モンスター（種族", ""],
  211: ["スライム", "スライム"],
  212: ["モンスター（種族", ""],
  213: ["ビッグスライム", "ビッグスライム"],
  214: ["モンスター（種族", ""],
  215: ["モンスター（種族", ""],
  216: ["スタリオン", "スタリオン"],
  217: ["スタリオン近親", "スタリオンの子"],
  218: ["モンスター（種族", ""],
  219: ["モンスター（種族", ""],
  220: ["モンスター（種族", ""],
  221: ["ローパー", "ローパー", "ローパーの幼体"],
  222: ["ローパー（近親", "ローパーの幼体"],
  223: ["モンスター（種族", ""],
  224: ["モンスター（種族", ""],
  225: ["モンスター（種族", ""],
  226: ["ピッグマン", "ピッグマン"],
  227: ["ピッグマン近親", "ピッグマンの子"],
  228: ["モンスター（種族", ""],
  229: ["モンスター（種族", ""],
  230: ["モンスター（種族", ""],
  231: ["ワーグ", "ワーグ", "ワーグの仔"],
  232: ["ワーグ（近親", "ワーグの仔"],
  233: ["モンスター（種族", ""],
  234: ["モンスター（種族", ""],
  235: ["モンスター（種族", ""],
  236: ["モンスター（個体", ""],
  237: ["モンスター（個体", ""],
  238: ["モンスター（種族", ""],
  239: ["モンスター（種族", ""],
  240: ["モンスター（種族", ""],
  241: ["モンスター（種族", ""],
  242: ["モンスター（種族", ""],
  243: ["モンスター（種族", ""],
  244: ["モンスター（種族", ""],
  245: ["モンスター（種族", ""],
  246: ["モンスター（種族", ""],
  247: ["モンスター（種族", ""],
  248: ["モンスター（種族", ""],
  249: ["モンスター（種族", ""],
  250: ["モンスター（種族", ""],
  251: ["その他", ""],
  252: ["その他", ""],
  253: ["その他", ""],
  254: ["その他", ""],
  255: ["その他", ""],
  256: ["その他", ""],
  257: ["その他", ""],
  258: ["その他", ""],
  259: ["その他", ""],
  260: ["その他", ""],
  261: ["その他", ""],
  262: ["その他", ""],
  263: ["その他", ""],
  264: ["その他", ""],
  265: ["その他", ""],
  266: ["その他", ""],
  267: ["その他", ""],
  268: ["その他", ""],
  269: ["その他", ""],
  270: ["その他", ""],
  271: ["その他", ""],
  272: ["その他", ""],
  273: ["その他", ""],
  274: ["その他", ""],
  275: ["その他", ""],
  276: ["その他", ""],
  277: ["その他", ""],
  278: ["その他", ""],
  279: ["その他", ""],
  280: ["その他", ""],
  281: ["その他", ""],
  282: ["その他", ""],
  283: ["その他", ""],
  284: ["その他", ""],
  285: ["その他", ""],
  286: ["その他", ""],
  287: ["その他", ""],
  288: ["その他", ""],
  289: ["その他", ""],
  290: ["その他", ""],
  291: ["その他", ""],
  292: ["その他", ""],
  293: ["その他", ""],
  294: ["その他", ""],
  295: ["その他", ""],
  296: ["その他", ""],
  297: ["その他", ""],
  298: ["その他", ""],
  299: ["その他", ""],
  300: ["その他", ""],
};
function getTaneoyaName(id) {
  if (!TANEOYA_MAP[id]) {
    console.error("ID が" + id + "の種親が見つかりません");
    return "";
  }
  return TANEOYA_MAP[id][1];
}
function getBabyName(id) {
  if (!TANEOYA_MAP[id]) {
    console.error("ID が" + id + "の子供が見つかりません");
    return "";
  }
  if (TANEOYA_MAP[id][2]) {
    return TANEOYA_MAP[id][2];
  }
  return TANEOYA_MAP[id][1] + "の子";
}
function getBabyPic(id) {
  switch (id) {
    case 201:
      return "ゴブリンの子供";
    case 206:
      return "オークの子供";
    case 211:
      return "スライムの幼体";
    case 216:
      return "スタリオンの子供";
    case 221:
      return "ローパーの子供";
    case 226:
      return "ピッグマンの子供";
    case 231:
      return "ワーグの子供";
    case 6:
      return "悪人の子供";
    case 7:
      return "黒人の子供";
    default:
      return "〇〇の子供";
  }
}


code:
/*:
 * @plugindesc 画像で文字を描画するよ
 * @author ル
 * @version 1.01
 *
 *
 * @param numOffsetX
 * @text 画像数字のx座標の調整
 * @desc この値だけ、数字のx座標がずれます
 * @default 0
 *
 * @param numOffsetY
 * @text 画像数字のy座標の調整
 * @desc この値だけ、数字のy座標がずれます
 * @default 0
 *
 * @param width1
 * @text 画像数字の幅1
 * @desc １文字につきこれだけ幅がとられます
 * @default 12
 *
 * @param width2
 * @text 画像数字の幅2
 * @desc １文字につきこれだけ幅がとられます
 * @default 8
 *
 * @param textOffsetX
 * @text 画像文字のx座標の調整
 * @desc この値だけ、x座標がずれます
 * @default 0
 *
 * @param textOffsetY
 * @text 画像文字のy座標の調整
 * @desc この値だけ、y座標がずれます
 * @default 4
 */
var Nore;
(function (Nore) {
  // 設定
  var FONT_NAME = "游ゴシック";
  var FONT_SIZE = 18;
  var TEXT_COLOR = 0xffffff;
  var OUTLINE_COLOR = 0x2a1713;
  var HANKAKU_SPACE_WIDTH = 8;
  var ZENKAKU_SPACE_WIDTH = 16;
  var parameters = PluginManager.parameters("Nore_ImageFont");
  var numOffsetX = parseInt(parameters["numOffsetX"]);
  var numOffsetY = parseInt(parameters["numOffsetY"]);
  var textOffsetX = parseInt(parameters["textOffsetX"]);
  var textOffsetY = parseInt(parameters["textOffsetY"]);
  var width1 = parseInt(parameters["width1"]);
  var width2 = parseInt(parameters["width2"]);
  var _Scene_Boot_loadSystemImages = Scene_Boot.loadSystemImages;
  Scene_Boot.loadSystemImages = function () {
    _Scene_Boot_loadSystemImages.call(this);
    ImageManager.reserveSystem("Number");
  };
  function getBaseTexture() {
    var baseTexture = PIXI.utils.BaseTextureCache["system/Number"];
    if (!baseTexture) {
      var bitmap = ImageManager.loadSystem("Number");
      if (!bitmap.isReady()) {
        return;
      }
      baseTexture = new PIXI.BaseTexture(bitmap._image);
      //baseTexture.resource.url = 'system/Number';
      PIXI.utils.BaseTextureCache["system/Number"] = baseTexture;
    }
    return baseTexture;
  }
  Nore.getBaseTexture = getBaseTexture;
  var Sprite_Picture_prototype_loadBitmap = Sprite_Picture.prototype.loadBitmap;
  Sprite_Picture.prototype.loadBitmap = function () {
    Sprite_Picture_prototype_loadBitmap.call(this);
    if (!this.dTextInfo) {
      this.removeBitmapText();
    }
  };
  Sprite_Picture.prototype.removeBitmapText = function () {
    if (this.bitmapTextList) {
      for (var _i = 0, _a = this.bitmapTextList; _i < _a.length; _i++) {
        var b = _a[_i];
        b.destroy();
        this.removeChild(b);
      }
    }
  };
  var _Sprite_Picture_prototype_makeDynamicBitmap =
    Sprite_Picture.prototype.makeDynamicBitmap;
  Sprite_Picture.prototype.makeDynamicBitmap = function () {
    this.removeBitmapText();
    this.bitmapTextList = [];
    _Sprite_Picture_prototype_makeDynamicBitmap.call(this);
  };
  var _Sprite_Picture_prototype_processText =
    Sprite_Picture.prototype._processText;
  Sprite_Picture.prototype._processText = function (bitmap) {
    var text = this.dTextInfo.value.substr(0, this.dTextInfo.value.length - 1);
    var right = isRight(text);
    if (right) {
      text = text.substr(0, text.length - " right".length);
    }
    var re = /([0-9]*)( *)(　*)(.*)/g;
    var match = re.exec(text);
    //console.log(text)
    //console.log(match)
    if (!match) {
      console.error("テキストが不正です。" + text);
      return;
    }
    if (!match[1] && !isEroStatusScene()) {
      // エロステページでも数字描画でもない場合
      _Sprite_Picture_prototype_processText.call(this, bitmap);
      return;
    }
    var xx = 0;
    if (match[1]) {
      var fontType = choiceFontType(this.dTextInfo.size);
      if (right) {
        xx -= (match[1].length - 1) * fontWidth(fontType);
      }
      xx += this.drawNumber(
        parseInt(match[1]),
        numOffsetX + xx,
        numOffsetY,
        100,
        fontType
      );
    }
    if (match[2]) {
      xx += HANKAKU_SPACE_WIDTH;
    }
    if (match[3]) {
      xx += ZENKAKU_SPACE_WIDTH;
    }
    if (match[4]) {
      this.addBitmapTexts(xx, match[4], FONT_SIZE);
    }
  };
  /**
   * 右詰めか？
   * @param text
   * @returns
   */
  function isRight(text) {
    var re = / right/g;
    var match = re.exec(text);
    return match;
  }
  function choiceFontType(size) {
    switch (size) {
      case 22:
        return 0;
      default:
        return 1;
    }
  }
  function isEroStatusScene() {
    /*if ($gameVariables.value(2000) > 0) {
            return true;
        }*/
    if ($gameSwitches.value(81)) {
      return true;
    }
    return false;
  }
  Sprite_Picture.prototype.addBitmapTexts = function (xx, text, size) {
    this.addBitmapText(text, size, OUTLINE_COLOR, xx + -1, -1);
    this.addBitmapText(text, size, OUTLINE_COLOR, xx + 1, -1);
    this.addBitmapText(text, size, OUTLINE_COLOR, xx + -1, 1);
    this.addBitmapText(text, size, OUTLINE_COLOR, xx + 1, 1);
    this.addBitmapText(text, size, TEXT_COLOR, xx + 0, 0);
  };
  Sprite_Picture.prototype.addBitmapText = function (text, size, color, x, y) {
    var bmtext = new PIXI.extras.BitmapText(text, {
      font: {
        name: FONT_NAME,
        size: size,
      },
      tint: color,
    });
    bmtext.x = textOffsetX + x;
    bmtext.y = textOffsetY + y;
    this.addChild(bmtext);
    this.bitmapTextList.push(bmtext);
  };
  function fontWidth(fontType) {
    switch (fontType) {
      case 0:
        return width1;
      case 1:
        return width2;
      default:
        return width2;
    }
  }
  Sprite_Picture.prototype.drawNumber = function drawNumber(
    num,
    x,
    y,
    w,
    type
  ) {
    var baseTexture = getBaseTexture();
    if (!baseTexture) {
      return;
    }
    var xx = 0;
    var yy = type * 32;
    var pw = 32;
    var ph = 32;
    var ww = fontWidth(type);
    var str = num + "";
    if (num < 0) {
      str = Math.abs(num) + "";
    }
    var dx;
    for (var i = 0; i < str.length; i++) {
      var s = parseInt(str[i]);
      var sx = s * pw + xx;
      var sy = yy;
      var dy = y;
      dx = x + i * ww;
      var texture = new PIXI.Texture(baseTexture);
      texture.frame = new PIXI.Rectangle(sx, sy, pw, ph);
      var sprite = new PIXI.Sprite(texture);
      sprite.x = dx;
      sprite.y = dy;
      this.addChild(sprite);
      this.bitmapTextList.push(sprite);
    }
    return dx + ww - x;
  };
})(Nore || (Nore = {}));