code:
Game_Character.prototype.findDirectionTo = function (goalX, goalY) {
  var searchLimit = this.searchLimit();
  var mapWidth = $gameMap.width();
  var nodeList = [];
  var openList = [];
  var closedList = [];
  var start = {};
  var best = start;
  if (this.x === goalX && this.y === goalY) {
    return 0;
  }
  start.parent = null;
  start.x = this.x;
  start.y = this.y;
  start.g = 0;
  start.f = $gameMap.distance(start.x, start.y, goalX, goalY);
  nodeList.push(start);
  openList.push(start.y * mapWidth + start.x);
  while (nodeList.length > 0) {
    var bestIndex = 0;
    for (var i = 0; i < nodeList.length; i++) {
      if (nodeList[i].f < nodeList[bestIndex].f) {
        bestIndex = i;
      }
    }
    var current = nodeList[bestIndex];
    var x1 = current.x;
    var y1 = current.y;
    var pos1 = y1 * mapWidth + x1;
    var g1 = current.g;
    nodeList.splice(bestIndex, 1);
    openList.splice(openList.indexOf(pos1), 1);
    closedList.push(pos1);
    if (current.x === goalX && current.y === goalY) {
      best = current;
      break;
    }
    if (g1 >= searchLimit) {
      continue;
    }
    for (var j = 0; j < 4; j++) {
      var direction = 2 + j * 2;
      var x2 = $gameMap.roundXWithDirection(x1, direction);
      var y2 = $gameMap.roundYWithDirection(y1, direction);
      var pos2 = y2 * mapWidth + x2;
      if (closedList.includes(pos2)) {
        continue;
      }
      if (!this.canPassByAutoMove(x1, y1, direction)) {
        continue;
      }
      var g2 = g1 + 1;
      var index2 = openList.indexOf(pos2);
      if (index2 < 0 || g2 < nodeList[index2].g) {
        var neighbor = {};
        if (index2 >= 0) {
          neighbor = nodeList[index2];
        } else {
          nodeList.push(neighbor);
          openList.push(pos2);
        }
        neighbor.parent = current;
        neighbor.x = x2;
        neighbor.y = y2;
        neighbor.g = g2;
        neighbor.f = g2 + $gameMap.distance(x2, y2, goalX, goalY);
        if (!best || neighbor.f - neighbor.g < best.f - best.g) {
          best = neighbor;
        }
      }
    }
  }
  var node = best;
  while (node.parent && node.parent !== start) {
    node = node.parent;
  }
  var deltaX1 = $gameMap.deltaX(node.x, start.x);
  var deltaY1 = $gameMap.deltaY(node.y, start.y);
  if (deltaY1 > 0) {
    return 2;
  } else if (deltaX1 < 0) {
    return 4;
  } else if (deltaX1 > 0) {
    return 6;
  } else if (deltaY1 < 0) {
    return 8;
  }
  var deltaX2 = this.deltaXFrom(goalX);
  var deltaY2 = this.deltaYFrom(goalY);
  if (Math.abs(deltaX2) > Math.abs(deltaY2)) {
    return deltaX2 > 0 ? 4 : 6;
  } else if (deltaY2 !== 0) {
    return deltaY2 > 0 ? 8 : 2;
  }
  return 0;
};
Game_Character.prototype.searchLimit = function () {
  return 20;
};
Game_CharacterBase.prototype.canPassByAutoMove = function (x, y, d) {
  var x2 = $gameMap.roundXWithDirection(x, d);
  var y2 = $gameMap.roundYWithDirection(y, d);
  if (!$gameMap.isValid(x2, y2)) {
    return false;
  }
  if (this.isThrough() || this.isDebugThrough()) {
    return true;
  }
  if (!this.isMapPassable(x, y, d)) {
    return false;
  }
  if (this.isCollidedWithCharacters(x2, y2)) {
    var events = $gameMap.eventsXyNt(x2, y2);
    for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
      var event_1 = events_1[_i];
      if (event_1.event() && event_1.event().meta["door"]) {
        return true;
      }
    }
    return false;
  }
  return true;
};
Scene_Map.prototype.updateDestination = function () {
  if (this.isMapTouchOk()) {
    this.processMapTouch();
  } else {
    if ($gameMap.regionId($gamePlayer.x, $gamePlayer.y) == 1) {
      return;
    }
    $gameTemp.clearDestination();
    this._touchCount = 0;
  }
};


code:
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
/*:ja
 * @target MZ
 * @author ル
 *
 * @command showSalesPage
 * @text 販売ページ表示
 * @des 販売ページ表示
 */
var Nore;
(function (Nore) {
  var pluginName = "Nore_SalesPage";
  PluginManager.registerCommand(pluginName, "showSalesPage", function (args) {
    $gameParty.setMenuActorId(0);
    SceneManager.push(Scene_SalesPage);
  });
})(Nore || (Nore = {}));
var Scene_SalesPage = /** @class */ (function (_super) {
  __extends(Scene_SalesPage, _super);
  function Scene_SalesPage() {
    return (_super !== null && _super.apply(this, arguments)) || this;
  }
  Scene_SalesPage.prototype.create = function () {
    _super.prototype.create.call(this);
    this.createSalesWindow();
    this.createSalesTop();
  };
  Scene_SalesPage.prototype.createSalesTop = function () {
    this._salesTop = new Sprite_SalesTop(this._avList);
    this.addChild(this._salesTop);
  };
  Scene_SalesPage.prototype.createSalesWindow = function () {
    this._salesWindow = new Window_SalesPage();
    this._salesWindow.setHandler("cancel", this.onCancel.bind(this));
    this._salesWindow.setHandler("ok", this.onOk.bind(this));
    this.addChild(this._salesWindow);
    this._salesWindow.activate();
    this._avList = this._salesWindow.validAvList();
    if ($gameTemp.lastScrollY) {
      this._salesWindow.scrollTo(0, $gameTemp.lastScrollY);
    }
    if ($gameTemp.lastSelectedIndex >= 0) {
      this._salesWindow.select($gameTemp.lastSelectedIndex);
    } else {
      this._salesWindow.select(0);
    }
  };
  Scene_SalesPage.prototype.onCancel = function () {
    $gameTemp.lastScrollY = -1;
    $gameTemp.lastSelectedIndex = -1;
    this.popScene();
  };
  Scene_SalesPage.prototype.update = function () {
    _super.prototype.update.call(this);
  };
  Scene_SalesPage.prototype.onOk = function () {
    var avSet = this._salesWindow.selectedItem();
    if (!avSet) {
      this._salesWindow.activate();
      return;
    }
    if (avSet.isNull()) {
      this._salesWindow.activate();
      return;
    }
    $gameTemp.lastScrollY = this._salesWindow.scrollY();
    $gameTemp.lastSelectedIndex = this._salesWindow.index();
    SceneManager.snapForBackground();
    $gameTemp.avSet = avSet;
    SceneManager.push(Scene_AvJacketBigSalesPage);
  };
  return Scene_SalesPage;
})(Scene_MenuBase);
var Sprite_SalesTop = /** @class */ (function (_super) {
  __extends(Sprite_SalesTop, _super);
  function Sprite_SalesTop(avList) {
    var _this = _super.call(this) || this;
    _this._avList = avList;
    _this.bitmap = new BitmapNoOutline(Graphics.width, 90);
    _this.bitmap.clear();
    _this.bitmap.fillAll("#FFFFFF");
    var m = 10;
    var y = 40;
    _this.bitmap.fillRect(m, y, Graphics.width - m * 2, 2, "#303030");
    _this.bitmap.fillRect(m, y + 2, Graphics.width - m * 2, 36, "#eeeeee");
    _this.bitmap.textColor = "";
    _this.bitmap.fontBold = true;
    _this.bitmap.fontSize = 20;
    _this.bitmap.drawText("List of erotic videos (Sorted by number of sales)", 10, 4, 300, 32);
    _this.bitmap.fontBold = false;
    _this.bitmap.fontSize = 14;
    _this.bitmap.drawText(
      "%1 Titles".format(_this._avList.length),
      16,
      40,
      300,
      32
    );
    return _this;
  }
  return Sprite_SalesTop;
})(Sprite);
var NULL_AV_ID = -1;
var AvSet = /** @class */ (function () {
  function AvSet(itemId) {
    this._itemId = itemId;
    this._avList = [];
  }
  AvSet.prototype.avJacket = function () {
    if (this.isNull()) {
      return null;
    }
    return this.mainAv().avJacket();
  };
  AvSet.prototype.isNull = function () {
    return this._itemId == NULL_AV_ID;
  };
  AvSet.prototype.pushAv = function (av) {
    this._avList.push(av);
  };
  AvSet.prototype.avAt = function (index) {
    return this._avList[index];
  };
  AvSet.prototype.mainAv = function () {
    if (this._favoriteAvIndex >= 0) {
      return this._avList[this._favoriteAvIndex];
    } else {
      console.error("main av index が不正です" + this._favoriteAvIndex);
      return this._avList[0];
    }
  };
  AvSet.prototype.realSales = function () {
    var n = 0;
    for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
      var av = _a[_i];
      n += av.realSales();
    }
    return n;
  };
  AvSet.prototype.jacketTitle = function () {
    return this.mainAv().jacketTitle();
  };
  AvSet.prototype.jacketSubTitle = function () {
    return this.mainAv().jacketSubTitle();
  };
  AvSet.prototype.count = function () {
    return this._avList.length;
  };
  AvSet.prototype.favoriteAvIndex = function () {
    return this._favoriteAvIndex;
  };
  AvSet.prototype.setFavotireIndex = function (index) {
    this._favoriteAvIndex = index;
    for (var i = 0; i < this._avList.length; i++) {
      var av = this._avList[i];
      av.setFavorite(this._favoriteAvIndex == i);
    }
  };
  AvSet.prototype.onMake = function () {
    this._favoriteAvIndex = -1;
    for (var i = 0; i < this._avList.length; i++) {
      var av = this._avList[i];
      if (this._favoriteAvIndex >= 0) {
        av.setFavorite(false);
      }
      if (av.isFavorite()) {
        this._favoriteAvIndex = i;
      }
    }
    if (this._favoriteAvIndex < 0) {
      var index = 0;
      var lastAv = this._avList[index];
      lastAv.setFavorite(true);
      this._favoriteAvIndex = index;
    }
  };
  return AvSet;
})();
var AvSetMaker = /** @class */ (function () {
  function AvSetMaker(list) {
    this._list = list;
    this._map = {};
  }
  AvSetMaker.prototype.make = function () {
    for (var _i = 0, _a = this._list; _i < _a.length; _i++) {
      var av = _a[_i];
      if (!this._map[av.itemId()]) {
        this._map[av.itemId()] = new AvSet(av.itemId());
      }
      var avSet = this._map[av.itemId()];
      avSet.pushAv(av);
    }
    var result = [];
    for (var key in this._map) {
      var avSet = this._map[key];
      avSet.onMake();
      result.push(avSet);
    }
    return result;
  };
  return AvSetMaker;
})();
var Window_SalesPage = /** @class */ (function (_super) {
  __extends(Window_SalesPage, _super);
  function Window_SalesPage() {
    var _this = this;
    var y = 84;
    var r = new Rectangle(
      -4,
      y,
      Graphics.width + 4 * 2,
      Graphics.height + 4 - y
    );
    _this._isNoSumi = true;
    _this = _super.call(this, r) || this;
    _this.padding = 0;
    _this.makeItems();
    _this.refresh();
    return _this;
  }
  Window_SalesPage.prototype.loadWindowskin = function () {
    this.windowskin = ImageManager.loadSystem("Window2");
  };
  Window_SalesPage.prototype.updateBackOpacity = function () {
    this.backOpacity = 255;
  };
  Window_SalesPage.prototype.createContents = function () {
    var width = this.contentsWidth();
    var height = this.contentsHeight();
    this.destroyContents();
    this.contents = new BitmapNoOutline(width, height);
    this.contentsBack = new Bitmap(width, height);
    this.resetFontSettings();
  };
  Window_SalesPage.prototype.avList = function () {
    return this._avList;
  };
  Window_SalesPage.prototype.validAvList = function () {
    var result = [];
    for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
      var set = _a[_i];
      if (!set.isNull()) {
        result.push(set);
      }
    }
    return result;
  };
  Window_SalesPage.prototype.selectedItem = function () {
    return this._avList[this.index()];
  };
  Window_SalesPage.prototype.itemRect = function (index) {
    var r = _super.prototype.itemRect.call(this, index);
    r.x += 20;
    r.y += 10;
    return r;
  };
  Window_SalesPage.prototype.makeItems = function () {
    var actor = $gameParty.menuActor();
    var actorId = -1;
    if (actor) {
      actorId = actor.actorId();
    }
    var list = [];
    for (var _i = 0, _a = $slg.avInfo().allList(); _i < _a.length; _i++) {
      var av = _a[_i];
      if (av.isShowResult()) {
        if (actorId < 0) {
          list.push(av);
        } else if (av.actorId() == actorId) {
          list.push(av);
        }
      }
    }
    var avSetMaker = new AvSetMaker(list);
    this._avList = avSetMaker.make();
    this._avList = this._avList.sort(function (a, b) {
      return b.realSales() - a.realSales();
    });
    if (this._avList.length % this.maxCols() > 0) {
      var blankLength = this.maxCols() - (this._avList.length % this.maxCols());
      for (var i = 0; i < blankLength; i++) {
        this._avList.push(new AvSet(-1));
      }
    }
  };
  Window_SalesPage.prototype.refresh = function () {
    this._windowContentsSprite.x = 0;
    this._windowContentsSprite.y = 0;
    _super.prototype.refresh.call(this);
    this.contentsBack.visible = false;
    // this.drawTitle();
    //this.refreshBack();
  };
  Window_SalesPage.prototype.drawAllItems = function () {
    this._windowContentsSprite.removeChildren();
    _super.prototype.drawAllItems.call(this);
  };
  Window_SalesPage.prototype.drawItemBackground = function () {};
  /*setCursorRect() {

    }*/
  Window_SalesPage.prototype.colSpacing = function () {
    return 0;
  };
  Window_SalesPage.prototype.rowSpacing = function () {
    return 0;
  };
  /*refreshBack() {
        this._windowContentsBackSprite.removeChildren();

        const g = new PIXI.Graphics();
        g.beginFill(0xffffff, 1);
        g.drawRect(0, 0, this.width, this.height);
        g.endFill();
        this.addChild(g);

        this._windowContentsBackSprite.addChild(g)
    }*/
  Window_SalesPage.prototype.drawItem = function (index) {
    var rect = this.itemRect(index);
    this.drawFrame(rect);
    var av = this._avList[index];
    var jacket = av.avJacket();
    if (!jacket) {
      return;
    }
    var sprite = new Sprite_AvJacket(jacket);
    sprite.x = rect.x + 26;
    sprite.y = rect.y + 12;
    var avCount = av.count();
    if (avCount > 1) {
      if (avCount > 4) {
        avCount = 4;
      }
      var offset = (avCount - 1) * 3 - 2;
      for (var i = 0; i < avCount - 1; i++) {
        var g = new PIXI.Graphics();
        //g.beginFill(0x333333, 1);
        g.lineStyle(1, 0xaaaaaa);
        g.beginFill(0xdddddd, 1);
        g.drawRect(0, 0, sprite.width - 4, sprite.height - 4);
        g.endFill();
        g.x = sprite.x + 4 + offset;
        g.y = sprite.y - offset;
        this._windowContentsSprite.addChild(g);
        offset -= 3;
      }
    }
    this._windowContentsSprite.addChild(sprite);
    sprite.refresh();
    //sprite.setHandler(this.onAv.bind(this, av));
    this.contents.fontFace = "メイリオ";
    this.contents.textColor = "#005fc0";
    this.contents.fontBold = false;
    var xx = rect.x + 10;
    var yy = rect.y + 210;
    this.contents.fontSize = 14;
    this.drawText(av.jacketTitle(), xx, yy, 190);
    this.drawText(av.jacketSubTitle(), xx, yy + 16, 190);
    this.contents.textColor = "#C10000";
    this.contents.fontBold = true;
    this.drawText("Sales: " + av.realSales(), xx, yy + 16 + 18 + 2, 120);
  };
  Window_SalesPage.prototype.onAv = function (av) {
    if (this._avPressed) {
      return;
    }
    this._avPressed = true;
    SceneManager.snapForBackground();
    SoundManager.playOk();
    $gameTemp.avSet = av;
    SceneManager.push(Scene_AvJacketBigSalesPage);
  };
  Window_SalesPage.prototype.drawFrame = function (rect) {
    var g = new PIXI.Graphics();
    g.lineStyle(1, 0xcccccc);
    g.drawRect(0, 0, rect.width, rect.height);
    g.x = rect.x;
    g.y = rect.y;
    this._windowContentsSprite.addChild(g);
  };
  Window_SalesPage.prototype.maxCols = function () {
    return 6;
  };
  Window_SalesPage.prototype.drawImage = function () {};
  Window_SalesPage.prototype.drawTitle = function () {
    this.contents.textColor = "#333333";
    this.contents.fontSize = 17;
    this.contents.fontBold = true;
    this.drawText("Porno List", 10, 0, 320);
  };
  Window_SalesPage.prototype.itemWidth = function () {
    var w = _super.prototype.itemWidth.call(this);
    return w - 5;
  };
  Window_SalesPage.prototype.itemHeight = function () {
    return 285;
  };
  Window_SalesPage.prototype.maxItems = function () {
    if (this._avList) {
      return this._avList.length;
    }
    return 0;
  };
  Window_SalesPage.prototype.overallHeight = function () {
    var h = _super.prototype.overallHeight.call(this);
    return h + 20;
  };
  Window_SalesPage.prototype.ensureCursorVisible = function (smooth) {
    if (this._cursorAll) {
      this.scrollTo(0, 0);
    } else if (this.innerHeight > 0 && this.row() >= 0) {
      var scrollY_1 = this.scrollY();
      var itemTop = this.row() * this.itemHeight();
      var itemBottom = itemTop + this.itemHeight() + 20;
      var scrollMin = itemBottom - this.innerHeight;
      if (scrollY_1 > itemTop) {
        if (smooth) {
          this.smoothScrollTo(0, itemTop);
        } else {
          this.scrollTo(0, itemTop);
        }
      } else if (scrollY_1 < scrollMin) {
        if (smooth) {
          this.smoothScrollTo(0, scrollMin);
        } else {
          this.scrollTo(0, scrollMin);
        }
      }
    }
  };
  return Window_SalesPage;
})(Window_Selectable);
var Scene_AvJacketBigSalesPage = /** @class */ (function (_super) {
  __extends(Scene_AvJacketBigSalesPage, _super);
  function Scene_AvJacketBigSalesPage() {
    return (_super !== null && _super.apply(this, arguments)) || this;
  }
  Scene_AvJacketBigSalesPage.prototype.create = function () {
    var avSet = $gameTemp.avSet;
    this._avSet = avSet;
    this._index = avSet.favoriteAvIndex();
    _super.prototype.create.call(this);
    this.createAvWindow();
    this.createCancelButton();
    this.createMsgWindow();
    this.updateButtonVisible();
    this._jacketRect = new Rectangle(365, 27, 500, 670);
  };
  Scene_AvJacketBigSalesPage.prototype.createAvWindow = function () {
    this._avWindow = new Window_AvJacketBigSalesPage(this._avSet.mainAv());
    this.addChild(this._avWindow);
  };
  Scene_AvJacketBigSalesPage.prototype.createMsgWindow = function () {
    this._msgWindow = new Nore.Window_Msg(270);
    this._msgWindow.setTexts([
      TextManager.screenShot1,
      TextManager.screenShot2,
      TextManager.screenShot3,
      TextManager.screenShot4,
    ]);
    this.addChild(this._msgWindow);
    this._msgWindow.hide();
    this._msgWindow.setHandler("ok", this.onMsgOk.bind(this));
  };
  Scene_AvJacketBigSalesPage.prototype.update = function () {
    _super.prototype.update.call(this);
    if (Input.isTriggered("cancel") || TouchInput.rightButton) {
      SoundManager.playOk();
      this.popScene();
    } else if (Input.isTriggered("ok")) {
      this.onFavorite();
    } else if (Input.isTriggered("left")) {
      this.onLeft();
    } else if (Input.isTriggered("right")) {
      this.onRight();
    } else if (TouchInput.isTriggered()) {
      this.updateTouch();
    }
  };
  Scene_AvJacketBigSalesPage.prototype.updateTouch = function () {
    if ($gameTemp.confirmWindowActive) {
      return;
    }
    var x = TouchInput.x;
    var y = TouchInput.y;
    if (this._jacketRect.contains(x, y)) {
      this.onCancel();
    } else if (x < 250) {
      this.onCancel();
    } else if (x > 1030) {
      this.onCancel();
    } else if (y > 700) {
      if (x < 500) {
        this.onCancel();
      } else if (x > 920) {
        this.onCancel();
      }
    }
  };
  Scene_AvJacketBigSalesPage.prototype.onMsgOk = function () {
    this._msgWindow.hide();
    this._avWindow.activate();
    this._cancelButton.visible = true;
    this.updateButtonVisible();
  };
  Scene_AvJacketBigSalesPage.prototype.onCancel = function () {
    SoundManager.playCancel();
    this.popScene();
  };
  Scene_AvJacketBigSalesPage.prototype.updateButtonVisible = function () {
    if (this._downLoadButton) {
      this._downLoadButton.visible = true;
    }
    if (this._avSet.count() == 1) {
      this._rightButton.visible = false;
      this._leftButton.visible = false;
      this._favoriteButton.visible = false;
    } else {
      this._favoriteButton.visible = true;
      if (this._index == 0) {
        this._rightButton.visible = false;
        this._leftButton.visible = true;
      } else if (this._index == this._avSet.count() - 1) {
        this._rightButton.visible = true;
        this._leftButton.visible = false;
      } else {
        this._rightButton.visible = true;
        this._leftButton.visible = true;
      }
    }
    if (this._index == this._avSet.favoriteAvIndex()) {
      this._favoriteButton.push();
    } else {
      this._favoriteButton.up();
    }
  };
  Scene_AvJacketBigSalesPage.prototype.createCancelButton = function () {
    this._cancelButton = new Sprite_Button2("cancel", true);
    this._cancelButton.x = 860;
    this._cancelButton.y = 30;
    this.addWindow(this._cancelButton);
  };
  Scene_AvJacketBigSalesPage.prototype.createButtons = function () {
    var y = 370;
    this.addLeftButton(280, y);
    this.addRightButton(910, y);
    this.addBottomButton(530, 708);
    this.addDownLoadButton(700, 708);
  };
  Scene_AvJacketBigSalesPage.prototype.addLeftButton = function (x, y) {
    var button = new Sprite_Button2("pageup", true);
    button.x = x;
    button.y = y;
    this.addChild(button);
    button.setClickHandler(this.onLeft.bind(this));
    this._leftButton = button;
  };
  Scene_AvJacketBigSalesPage.prototype.addRightButton = function (x, y) {
    var button = new Sprite_Button2("pagedown", true);
    button.x = x;
    button.y = y;
    this.addChild(button);
    button.setClickHandler(this.onRight.bind(this));
    this._rightButton = button;
  };
  Scene_AvJacketBigSalesPage.prototype.addBottomButton = function (x, y) {
    var button = new Sprite_Button3("main", true);
    button.x = x;
    button.y = y;
    this.addChild(button);
    button.setClickHandler(this.onFavorite.bind(this));
    this.addChild(button);
    this._favoriteButton = button;
  };
  Scene_AvJacketBigSalesPage.prototype.addDownLoadButton = function (x, y) {
    if (!Nore.isTakeScreenshotEnabled()) {
      return;
    }
    var button = new Sprite_Button3("downLoad", true);
    button.x = x;
    button.y = y;
    this.addChild(button);
    button.setClickHandler(this.onDownLoad.bind(this));
    this.addChild(button);
    this._downLoadButton = button;
  };
  Scene_AvJacketBigSalesPage.prototype.onDownLoad = function () {
    var bitmap = this._avWindow.snap();
    Nore.takeScreenShotBitmap(this.makeFileName() + ".png", bitmap);
    SoundManager.playReflection();
    this._msgWindow.show();
    this._msgWindow.activate();
    this._avWindow.deactivate();
    this._rightButton.visible = false;
    this._leftButton.visible = false;
    this._favoriteButton.visible = false;
    this._downLoadButton.visible = false;
    this._cancelButton.visible = false;
  };
  Scene_AvJacketBigSalesPage.prototype.makeFileName = function () {
    var d = new Date();
    var timeStamp = "%1-%2-%3".format(
      d.getFullYear(),
      (d.getMonth() + 1).padZero(2),
      d.getDate().padZero(2)
    );
    timeStamp += "_%1%2%3".format(
      d.getHours().padZero(2),
      d.getMinutes().padZero(2),
      d.getSeconds().padZero(2)
    );
    return timeStamp;
  };
  Scene_AvJacketBigSalesPage.prototype.onLeft = function () {
    if (this._avSet.count() - 1 == this._index) {
      return;
    }
    SoundManager.playCursor();
    this._index++;
    this.refreshJacket();
    this.updateButtonVisible();
  };
  Scene_AvJacketBigSalesPage.prototype.onRight = function () {
    if (this._index == 0) {
      return;
    }
    SoundManager.playCursor();
    this._index--;
    this.refreshJacket();
    this.updateButtonVisible();
  };
  Scene_AvJacketBigSalesPage.prototype.onFavorite = function () {
    if (this._avSet.count() == 1) {
      return;
    }
    SoundManager.playOk();
    this._avSet.setFavotireIndex(this._index);
    this.updateButtonVisible();
  };
  Scene_AvJacketBigSalesPage.prototype.refreshJacket = function () {
    var av = this._avSet.avAt(this._index);
    this._avWindow.refreshJacket(av);
  };
  return Scene_AvJacketBigSalesPage;
})(Scene_MenuBase);
var Window_AvJacketBigSalesPage = /** @class */ (function (_super) {
  __extends(Window_AvJacketBigSalesPage, _super);
  function Window_AvJacketBigSalesPage(av) {
    var _this = this;
    var r = new Rectangle(270, 5, 500, 500);
    _this = _super.call(this, r) || this;
    _this._av = av;
    _this.backOpacity = 0;
    _this.frameVisible = false;
    _this.createJacket();
    _this._isWindow = false;
    return _this;
  }
  Window_AvJacketBigSalesPage.prototype.createJacket = function () {
    this._jacketSprite = new Nore.Sprite_AvJacketBig(
      this._av.avJacket(),
      JacketScale.scale3,
      null
    );
    this.addChild(this._jacketSprite);
    this.moveJacket();
  };
  Window_AvJacketBigSalesPage.prototype.moveJacket = function () {
    this._jacketSprite.x = 100;
    this._jacketSprite.y = 20;
  };
  Window_AvJacketBigSalesPage.prototype.refreshJacket = function (av) {
    this._av = av;
    this.removeChild(this._jacketSprite);
    this.createJacket();
  };
  Window_AvJacketBigSalesPage.prototype.update = function () {
    _super.prototype.update.call(this);
    if (this._av) {
      this._av.avJacket().clearDirty();
    }
  };
  Window_AvJacketBigSalesPage.prototype.snap = function () {
    var lastX = this.x;
    var lastY = this.y;
    this.x = 0;
    this.y = 0;
    this._jacketSprite.x = 0;
    this._jacketSprite.y = 0;
    var width = this._jacketSprite.spriteWidth() + 4;
    var height = this._jacketSprite.spriteHeight() + 4;
    var bitmap = new Bitmap(width, height);
    var renderTexture = PIXI.RenderTexture.create(width, height);
    var renderer = Graphics.app.renderer;
    renderer.render(this, renderTexture);
    this.worldTransform.identity();
    var canvas = renderer.extract.canvas(renderTexture);
    bitmap.context.drawImage(canvas, 0, 0);
    canvas.width = 0;
    canvas.height = 0;
    renderTexture.destroy({ destroyBase: true });
    bitmap.baseTexture.update();
    this.moveJacket();
    this.x = lastX;
    this.y = lastY;
    return bitmap;
  };
  return Window_AvJacketBigSalesPage;
})(Window_Base);

repo_name: onms/dead

license: unknown


code:
/*:ja
 * @target MZ
 * @author ル
 *
 *
 * @command RunIntro
 * @text 紹介分表示
 * @des 紹介分表示
 * @arg actorId
 * @type number
 * @arg index
 * @type number
 *
 * @command RunBote
 * @text ボテ表示
 * @des ボテ表示
 * @arg actorId
 * @type number
 * @arg isTaneoya
 * @type boolean
 * @arg index
 * @type number
 *
 * @command RunOuter
 * @text 服装表示
 * @des 服装表示
 * @arg actorId
 * @type number
 * @arg  outerId
 * @type string
 *
 * @command RunNakadashi
 * @text 中出し表示
 * @des 中出し表示
 * @arg actorId
 * @type number
 *
 * @command RunAnal
 * @text アナル表示
 * @des アナル表示
 * @arg actorId
 * @type number
 *
 * @command RunSyusan
 * @text 出産回数表示
 * @des 出産回数表示
 * @arg actorId
 * @type number
 *
 * @command RunManko
 * @text おまんこ表示
 * @des おまんこ表示
 * @arg actorId
 * @type number
 *
 * @command SyusanText
 * @text 出産テキスト作成
 * @des 出産テキスト作成
 * @arg actorId
 * @type number
 *
 * @command TaiiText
 * @text 好きな体位決定
 * @des 好きな体位決定
 * @arg actorId
 * @type number
 *
 * @command SexText
 * @text セックステキスト作成
 * @des セックステキスト作成
 * @arg actorId
 * @type number
 *
 * @command DecideFavotiteChinpo
 * @text 好きなちんぽ決定
 * @des 好きなちんぽ決定
 * @arg actorId
 * @type number
 *
 * @command makeMankoHenkeiText
 * @text おまんこ変形度テキスト作成
 */
var Nore;
(function (Nore) {
  var VAR_SARASHI_NAKADASHI = 881;
  var VAR_SARASHI_ANAL = 882;
  var VAR_SARASHI_TAII = 883;
  var VAR_SARASHI_SEX_TAII = 884;
  var VAR_SARASHI_CHINPO = 887;
  var pluginName = "Nore_Sarashi";
  var intro = "紹介";
  var bote = "ボテ腹";
  var common = "共通";
  var seed = "種";
  var other = "その他";
  var outer = "服装";
  var naka = "中出し";
  var syusan = "出産回数";
  var omanko = "おまんこ";
  PluginManager.registerCommand(pluginName, "TaiiText", function (args) {
    var actorId = parseInt(args.actorId);
    var actor = $gameActors.actor(actorId);
    var avList = $slg.avInfo().actorAvList(actorId);
    if (avList.length == 0) {
      $gameVariables.setValue(VAR_SARASHI_CHINPO, 0);
      return;
    }
    for (var i = 0; i < avList.length; i++) {
      var av = avList[avList.length - i - 1];
      var position = av.taii();
      if (position >= 0) {
        $gameVariables.setValue(VAR_SARASHI_TAII, position);
        return;
      }
    }
  });
  PluginManager.registerCommand(
    pluginName,
    "DecideFavotiteChinpo",
    function (args) {
      var actorId = parseInt(args.actorId);
      var actor = $gameActors.actor(actorId);
      var douseiManId = actor.dousei().manId();
      if (douseiManId > 0) {
        var chinpo_1 = decideFavoriteChinpo(actorId, douseiManId);
        $gameVariables.setValue(VAR_SARASHI_CHINPO, chinpo_1);
        return;
      }
      var avList = $slg.avInfo().actorAvList(actorId);
      if (avList.length == 0) {
        $gameVariables.setValue(VAR_SARASHI_CHINPO, 0);
        return;
      }
      var lastAv = avList[avList.length - 1];
      var chinpo = decideFavoriteChinpo(actorId, lastAv.mainManId());
      $gameVariables.setValue(VAR_SARASHI_CHINPO, chinpo);
    }
  );
  function decideFavoriteChinpo(actorId, manId) {
    switch (actorId) {
      case 4:
        return decideFavoriteChinpo4(manId);
      case 9:
        return decideFavoriteChinpo9(manId);
      case 13:
        return decideFavoriteChinpo13(manId);
      case 17:
        return decideFavoriteChinpo17(manId);
    }
    return 0;
  }
  function decideFavoriteChinpo4(manId) {
    switch (manId) {
      case 5:
        return 5; // レン
      case 20:
        return 20; // タロウ
    }
    return 78;
  }
  function decideFavoriteChinpo9(manId) {
    switch (manId) {
      case 19:
        return 19; // ブスジマ
    }
    return 78;
  }
  function decideFavoriteChinpo13(manId) {
    switch (manId) {
      case 16:
        return 16; // カスゾウ
    }
    return 78;
  }
  function decideFavoriteChinpo17(manId) {
    switch (manId) {
      case 21:
        return 21; // オリバー
    }
    return 78;
  }
  function plusVar(varId) {
    $gameVariables.setValue(varId, $gameVariables.value(varId) + 1);
  }
  PluginManager.registerCommand(pluginName, "SyusanText", function (args) {
    var actorId = parseInt(args.actorId);
    var actor = $gameActors.actor(actorId);
    var babyMap = {};
    for (var _i = 0, _a = actor.babyList(); _i < _a.length; _i++) {
      var b = _a[_i];
      if (b.isSyusan()) {
        switch (actorId) {
          case 4:
            switch (b.taneoyaId()) {
              case 5:
                plusVar(961);
                break;
              case 20:
                plusVar(962);
                break;
              default:
                plusVar(970);
                break;
            }
            break;
          case 9:
            switch (b.taneoyaId()) {
              case 19:
                plusVar(964);
                break;
              default:
                plusVar(970);
                break;
            }
            break;
          case 13:
            switch (b.taneoyaId()) {
              case 16:
                plusVar(966);
                break;
              default:
                plusVar(970);
                break;
            }
            break;
          case 17:
            switch (b.taneoyaId()) {
              case 21:
                plusVar(965);
                break;
              default:
                plusVar(970);
                break;
            }
            break;
        }
      }
    }
    var text = "";
    if ($gameVariables.value(961) > 0) {
      if (text.length > 0) {
        text += "\n";
      }
      var renName = $gameActors.actor(5).name();
      text += TextManager.syusanName.format(renName, $gameVariables.value(961));
    }
    if ($gameVariables.value(962) > 0) {
      if (text.length > 0) {
        text += "\n";
      }
      var tarouName = $gameActors.actor(20).name();
      text += TextManager.syusanName.format(
        tarouName,
        $gameVariables.value(962)
      );
    }
    if ($gameVariables.value(964) > 0) {
      if (text.length > 0) {
        text += "\n";
      }
      var renName = $gameActors.actor(19).name();
      text += TextManager.syusanName.format(renName, $gameVariables.value(964));
    }
    if ($gameVariables.value(966) > 0) {
      if (text.length > 0) {
        text += "\n";
      }
      var renName = $gameActors.actor(16).name();
      text += TextManager.syusanName.format(renName, $gameVariables.value(966));
    }
    if ($gameVariables.value(965) > 0) {
      if (text.length > 0) {
        text += "\n";
      }
      var renName = $gameActors.actor(21).name();
      text += TextManager.syusanName.format(renName, $gameVariables.value(965));
    }
    if ($gameVariables.value(970) > 0) {
      if (text.length > 0) {
        text += "\n";
      }
      var vagrantName = $gameActors.actor(78).name();
      text += TextManager.syusanName.format(
        vagrantName,
        $gameVariables.value(970)
      );
    }
    if (text == "") {
      $gameVariables.setValue(969, 0);
      return;
    }
    p("出産テキスト");
    p(text);
    $gameVariables.setValue(969, text);
  });
  PluginManager.registerCommand(pluginName, "RunIntro", function (args) {
    var s = getScenario(intro, args.actorId, null, args.index);
    if (!s) {
      console.error(args);
    }
    var list = $dataScenario[s.id];
    if (!list) {
      throw new Error("id:" + s.id + " のデータが見つかりません");
    }
    console.log("Scenario \u30B3\u30DE\u30F3\u30C9\u5B9F\u884C: ".concat(s.id));
    this.setupChild(list, this._eventId);
  });
  PluginManager.registerCommand(pluginName, "RunBote", function (args) {
    p("RunBote");
    var s;
    if (args.isTaneoya == "true") {
      var taneoyaId = $gameVariables.value(70);
      var taneoya = getTaneoyaNameJa(taneoyaId);
      s = getScenario(bote, args.actorId, taneoya, args.index);
      if (!s) {
        s = getScenario(bote, args.actorId, other, args.index);
      } else {
        $gameSwitches.setValue(160 + taneoyaId, true);
        p(160 + taneoyaId + "をON");
      }
    } else {
      s = getScenario(bote, args.actorId, null, args.index);
    }
    var list = $dataScenario[s.id];
    if (!list) {
      throw new Error("id:" + s.id + " のデータが見つかりません");
    }
    console.log("Scenario \u30B3\u30DE\u30F3\u30C9\u5B9F\u884C: ".concat(s.id));
    this.setupChild(list, this._eventId);
  });
  PluginManager.registerCommand(pluginName, "RunOuter", function (args) {
    var s = getOuterScenario(outer, args.actorId, args.outerId);
    var list = $dataScenario[s.id];
    if (!list) {
      throw new Error("id:" + s.id + " のデータが見つかりません");
    }
    console.log("Scenario \u30B3\u30DE\u30F3\u30C9\u5B9F\u884C: ".concat(s.id));
    this.setupChild(list, this._eventId);
  });
  PluginManager.registerCommand(pluginName, "RunNakadashi", function (args) {
    var s = getNakadashiScenario(naka, args.actorId);
    if (!s) {
      console.error(args);
      throw new Error("id: RunNakadashi のデータが見つかりません");
    }
    var list = $dataScenario[s.id];
    if (!list) {
      throw new Error("id:" + s.id + " のデータが見つかりません");
    }
    console.log("Scenario \u30B3\u30DE\u30F3\u30C9\u5B9F\u884C: ".concat(s.id));
    this.setupChild(list, this._eventId);
  });
  PluginManager.registerCommand(pluginName, "RunAnal", function (args) {
    var s = getAnalScenario(args.actorId);
    if (!s) {
      console.error(args);
      throw new Error("id: RunAnal のデータが見つかりません");
    }
    var list = $dataScenario[s.id];
    if (!list) {
      throw new Error("id:" + s.id + " のデータが見つかりません");
    }
    console.log("Scenario \u30B3\u30DE\u30F3\u30C9\u5B9F\u884C: ".concat(s.id));
    this.setupChild(list, this._eventId);
  });
  PluginManager.registerCommand(pluginName, "RunSyusan", function (args) {
    var s = getSyusanScenario(syusan, args.actorId);
    var list = $dataScenario[s.id];
    if (!list) {
      throw new Error("id:" + s.id + " のデータが見つかりません");
    }
    console.log("Scenario \u30B3\u30DE\u30F3\u30C9\u5B9F\u884C: ".concat(s.id));
    this.setupChild(list, this._eventId);
  });
  PluginManager.registerCommand(pluginName, "RunManko", function (args) {
    var s = getOmankoScenario(omanko, args.actorId);
    var list = $dataScenario[s.id];
    if (!list) {
      throw new Error("id:" + s.id + " のデータが見つかりません");
    }
    console.log("Scenario \u30B3\u30DE\u30F3\u30C9\u5B9F\u884C: ".concat(s.id));
    this.setupChild(list, this._eventId);
  });
  PluginManager.registerCommand(pluginName, "RunAcce", function (args) {
    var s = getAcceScenario(args.actorId, args.type);
    if (!s) {
      return;
    }
    var list = $dataScenario[s.id];
    if (!list) {
      console.error("id:" + s.id + " のデータが見つかりません");
      return;
    }
    console.log("Scenario \u30B3\u30DE\u30F3\u30C9\u5B9F\u884C: ".concat(s.id));
    this.setupChild(list, this._eventId);
  });
  PluginManager.registerCommand(
    pluginName,
    "makeMankoHenkeiText",
    function (args) {
      var value = $gameVariables.value(979);
      var text = "";
      switch (value) {
        case 1:
          text = "Ａ";
          break;
        case 2:
          text = "Ｂ";
          break;
        case 3:
          text = "Ｃ";
          break;
        case 4:
          text = "Ｄ";
          break;
        case 5:
          text = "Ｅ";
          break;
        case 6:
          text = "Ｆ";
          break;
        case 7:
          text = "Ｇ";
          break;
      }
      $gameVariables.setValue(973, text);
    }
  );
  function getScenario(type, actorId, taneoya, index) {
    var actorName = getActorName(actorId);
    var base1;
    if (taneoya) {
      base1 = "%1_%2_%3_%4".format(
        type,
        actorName,
        index.padZero(2),
        seed + taneoya
      );
    } else {
      base1 = "%1_%2_%3".format(type, actorName, index.padZero(2));
    }
    var base2;
    if (taneoya) {
      base2 = "%1_%2_%3_%4".format(
        type,
        actorName,
        index.padZero(2),
        seed + taneoya
      );
    } else {
      base2 = "%1_%2_%3".format(type, actorName, index.padZero(2));
    }
    p(base1);
    p(base2);
    var candidates = getCandidates(base1, base2);
    if (candidates.length == 0) {
      console.error(base1);
      return null;
    }
    var obj = {};
    var dice = Math.randomInt(candidates.length);
    obj.id = candidates[dice];
    return obj;
  }
  function getOuterName(outerId) {
    switch (outerId) {
      case "a":
        return "裸";
      case "b":
        return "通常";
      case "c":
        return "売春婦";
      case "g":
        return "下脱ぎ";
    }
  }
  function getOuterScenario(type, actorId, outer) {
    var actorName = getActorName(actorId);
    var outerName = getOuterName(outer);
    var base1 = "%1_%2_%3".format(type, actorName, outerName);
    var base2 = "%1_%2_%3".format(type, actorName, outerName);
    var candidates = getCandidates(base1, base2);
    if (candidates.length == 0) {
      p(base1);
      p(base2);
      return null;
    }
    var obj = {};
    var dice = Math.randomInt(candidates.length);
    obj.id = candidates[dice];
    return obj;
  }
  function getSyusanScenario(type, actorId) {
    var actorName = getActorName(actorId);
    var base1 = "%1_%2".format(type, actorName);
    var base2 = "%1_%2".format(type, actorName);
    p(base1);
    p(base2);
    var candidates = getCandidates(base1, base2);
    if (candidates.length == 0) {
      return null;
    }
    var obj = {};
    var dice = Math.randomInt(candidates.length);
    obj.id = candidates[dice];
    return obj;
  }
  function getOmankoScenario(type, actorId) {
    var actorName = getActorName(actorId);
    var lv;
    lv = $gameVariables.value(979);
    if (lv > 6) {
      lv = 6;
    }
    var lvStr = "LV" + lv;
    var base1 = "%1_%2_%3".format(type, actorName, lvStr);
    var base2 = "%1_%2_%3".format(type, actorName, lvStr);
    var candidates = getCandidates(base1, base2);
    if (candidates.length == 0) {
      return null;
    }
    var obj = {};
    var dice = Math.randomInt(candidates.length);
    obj.id = candidates[dice];
    return obj;
  }
  function getAcceScenario(actorId, type) {
    var actorName = getActorName(actorId);
    var actor = $gameActors.actor(actorId);
    if (type == "精液") {
      /*const nakadashiType = actor.getLastHistory().lastNakadashiType()
            if (nakadashiType == 0) {
                return null;
            }
            const name = getTaneoyaNameJa(nakadashiType);
            let base1 = '%1_%2_%3_01'.format(type, actorName, name);

            const obj = {};
            obj.id = base1
            return obj;*/
    }
    if (!actor.hasAcce(1014)) {
      return null;
    }
    var base1 = "%1_%2_01".format(type, actorName);
    var obj = {};
    obj.id = base1;
    return obj;
  }
  function getNakadashiScenario(type, actorId) {
    var actorName = getActorName(actorId);
    var count = $gameVariables.value(VAR_SARASHI_NAKADASHI);
    var nakaType = "非処女";
    var base1 = "%1_%2_%3".format(type, actorName, nakaType);
    var base2 = "%1_%2_%3".format(type, actorName, nakaType);
    var candidates = getCandidates(base1, base2);
    if (candidates.length == 0) {
      p(nakaType);
      p(base1);
      return null;
    }
    var obj = {};
    var dice = Math.randomInt(candidates.length);
    obj.id = candidates[dice];
    return obj;
  }
  function getAnalScenario(actorId) {
    var actorName = getActorName(actorId);
    var base1 = "アナル_%1_01".format(actorName);
    var obj = {};
    obj.id = base1;
    return obj;
  }
  function getCandidates(base1, base2) {
    var result = [];
    for (var i = 1; i <= 10; i++) {
      var id = base1 + "_" + i.padZero(2);
      var normalized = id.normalize("NFC");
      if ($dataScenario[normalized]) {
        result.push(normalized);
      } else {
        break;
      }
    }
    for (var i = 1; i <= 10; i++) {
      var id = base2 + "_" + i.padZero(2);
      var normalized = id.normalize("NFC");
      if ($dataScenario[normalized]) {
        result.push(normalized);
      } else {
        break;
      }
    }
    return result;
  }
  function getActorName(actorId) {
    switch (parseInt(actorId)) {
      case 4:
        return "マリナ";
      case 9:
        return "ノノカ";
      case 13:
        return "サキ";
      case 17:
        return "ココナ";
    }
    return $gameActors.actor(actorId).nameJp();
  }
})(Nore || (Nore = {}));
function getTaneoyaNameJa(taneoyaId) {
  switch (taneoyaId) {
    case TaneoyaId.banzoku:
      return $gameActors.actor(30).nameJp();
    case TaneoyaId.chosyuhei:
      return $gameActors.actor(61).nameJp();
    case TaneoyaId.charles:
      return $gameActors.actor(7).nameJp();
    case TaneoyaId.goblin:
      return $gameActors.actor(85).nameJp();
    case TaneoyaId.minister:
      return $gameActors.actor(13).nameJp();
    case TaneoyaId.vagrant:
      return $gameActors.actor(93).nameJp();
    case TaneoyaId.bar:
      return $gameActors.actor(113).nameJp();
    case TaneoyaId.oliver:
      return $gameActors.actor(21).nameJp();
    case TaneoyaId.gray:
      return $gameActors.actor(16).nameJp();
    case TaneoyaId.loli:
      return $gameActors.actor(140).nameJp();
  }
  return "名称未設定";
}
var Taii;
(function (Taii) {
  Taii[(Taii["none"] = -1)] = "none";
  Taii[(Taii["seijoui"] = 0)] = "seijoui";
  Taii[(Taii["back"] = 1)] = "back";
  Taii[(Taii["kijoui"] = 4)] = "kijoui";
  Taii[(Taii["hutaana"] = 2)] = "hutaana";
})(Taii || (Taii = {}));
var BARBARIAN_ID2 = 15;
Game_Followers.prototype.setup = function () {
  this._data = [];
  if ($gameSystem.sarachiActorId() > 0) {
    var actor = $gameActors.actor($gameSystem.sarachiActorId());
    if (!$gameSwitches.value(324)) {
      this._data.push(new Game_Follower(this.findIndex(actor)));
    }
    this._data.push(new Game_Follower(BARBARIAN_ID2));
    this._data.push(new Game_Follower(-1));
    return;
  }
  for (var i = 1; i < $gameParty.battleMembers().length; i++) {
    this._data.push(new Game_Follower(i));
  }
};
Game_Followers.prototype.findIndex = function (actor) {
  return $gameParty.members().indexOf(actor);
};
Game_Follower.prototype.actor = function () {
  if (this._memberIndex < 0) {
    return $gameActors.actor(10);
  }
  if (this._memberIndex == BARBARIAN_ID2) {
    return $gameActors.actor(BARBARIAN_ID2);
  }
  if ($gameSwitches.value(101)) {
    return $gameParty.members()[this._memberIndex];
  } else {
    return $gameParty.members()[this._memberIndex];
  }
};


code:
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
var Nore;
(function (Nore) {
  var Window_SavefileList2 = /** @class */ (function (_super) {
    __extends(Window_SavefileList2, _super);
    function Window_SavefileList2() {
      var _this = (_super !== null && _super.apply(this, arguments)) || this;
      _this._latestList = [];
      return _this;
    }
    Window_SavefileList2.prototype.setMode = function (mode, autosave) {
      this.makeLatestFileList();
      _super.prototype.setMode.call(this, mode, autosave);
    };
    Window_SavefileList2.prototype.makeLatestFileList = function () {
      this._latestList = [];
      var globalInfo = DataManager._globalInfo;
      if (!globalInfo) {
        return;
      }
      for (var i = 1; i < 100; i++) {
        var saveInfo = globalInfo[i];
        if (saveInfo) {
          this._latestList.push(saveInfo);
        }
      }
      this._latestList = this._latestList.sort(function (a, b) {
        return b.timestamp - a.timestamp;
      });
      //p(this._latestList)
    };
    Window_SavefileList2.prototype.maxCols = function () {
      return 4;
    };
    Window_SavefileList2.prototype.drawItem = function (index) {
      var savefileId = this.indexToSavefileId(index);
      var info = DataManager.savefileInfo(savefileId);
      var rect = this.itemRectWithPadding(index);
      this.resetTextColor();
      this.changePaintOpacity(this.isEnabled(savefileId));
      this.contents.fontSize = 20;
      var yy = rect.y;
      this.drawTitle(savefileId, rect.x, yy);
      this.changeTextColor(ColorManager.normalColor());
      if (info) {
        var lineHeight = this.lineHeight();
        this.drawNew(info, rect.x + 80, yy);
        this.drawGold(info, rect.x + 2, yy + lineHeight);
        this.drawFan(info, rect.x + 2 + 140, yy + lineHeight);
        this.drawStage(info, rect.x + 232, yy);
        this.drawTime(info, rect.x + 102, yy + lineHeight * 3 + 8);
        //this.drawContents(info, rect);
        this.drawPlaytime(
          info,
          rect.x + 4,
          yy + lineHeight * 2 + 8,
          rect.width
        );
      }
    };
    Window_SavefileList2.prototype.paint = function () {
      this._windowContentsSprite.removeChildren();
      _super.prototype.paint.call(this);
    };
    Window_SavefileList2.prototype.lineHeight = function () {
      return 28;
    };
    Window_SavefileList2.prototype.indexToSavefileId = function (index) {
      return index;
    };
    Window_SavefileList2.prototype.drawContents = function (info, rect) {
      var bottom = rect.y + rect.height;
      this.drawPartyCharacters(info, rect.x + 20, bottom - 8);
      var lineHeight = this.lineHeight();
      var y2 = bottom - lineHeight - 4;
      if (y2 >= lineHeight) {
      }
    };
    Window_SavefileList2.prototype.drawPartyCharacters = function (info, x, y) {
      /*if (info.fileList) {
                let characterX = x + 5;
                for (const data of info.fileList) {
                    //let pp = new Sprite_Player($gamePlayer)
                    this.drawCharacter(data, 0, characterX, y);
                }
            }*/
    };
    Window_SavefileList2.prototype.drawTitle = function (savefileId, x, y) {
      this.changeTextColor(ColorManager.systemColor());
      if (savefileId === 0) {
        this.drawText(TextManager._autosave, x, y, 180);
      } else {
        this.drawText(TextManager._file, x, y, 180);
        this.changeTextColor(ColorManager.crisisColor());
        this.drawText(
          savefileId,
          x,
          y,
          ConfigManager.language == "jp" ? 112 : 70,
          "right"
        );
      }
    };
    Window_SavefileList2.prototype.drawNew = function (info, x, y) {
      if (ConfigManager.language != "jp") {
        x -= 40;
      }
      var index = this._latestList.indexOf(info);
      if (index < 0) {
        return;
      }
      if (index > 4) {
        return;
      }
      this.changeTextColor(ColorManager.textColor(17));
      this.drawText(
        TextManager.saveLatest.format(index + 1),
        x,
        y,
        130,
        "right"
      );
      this.changeTextColor(ColorManager.textColor(0));
    };
    Window_SavefileList2.prototype.drawStage = function (info, x, y) {
      if (ConfigManager.language != "jp") {
        x -= 40;
      }
      var stageStr =
        ConfigManager.language == "jp"
          ? hankaku2Zenkaku(info.stage)
          : info.stage;
      var stage = TextManager.chapter.format(stageStr);
      if (info.stage == 0) {
        stage = TextManager.prologue;
      }
      this.changeTextColor(ColorManager.textColor(14));
      this.drawText(stage, x, y, 100, "left");
      this.changeTextColor(ColorManager.normalColor());
      var xx = x + 100;
      var w = 90;
      /*if (info.night) {
                //this.changeTextColor(ColorManager.textColor(12));

                this.drawText(TextManager.night, xx, y, w, 'left');
            } else if (info.inDungeon) {
                //this.changeTextColor(ColorManager.textColor(3));
                this.drawText(TextManager.afternoon, xx, y, w, 'left');
            } else {
                this.drawText(TextManager.morning, xx, y, w, 'left');
            }
            */
      this.changeTextColor(ColorManager.normalColor());
    };
    Window_SavefileList2.prototype.isAgito = function (mapId) {
      switch (mapId) {
        case 8:
        case 36:
        case 210:
        case 248:
          return true;
      }
      return false;
    };
    Window_SavefileList2.prototype.drawGold = function (info, x, y) {
      this.drawIcon(Icon.gold, x, y);
      this.drawText(info.gold + "Ｇ", x + 0, y, 104, "right");
    };
    Window_SavefileList2.prototype.drawFan = function (info, x, y) {
      this.drawIcon(Icon.fan, x, y);
      this.drawText(info.fan * FAN_UNIT, x + 0, y, 104, "right");
    };
    Window_SavefileList2.prototype.drawTime = function (info, x, y) {
      //this.drawText('LV ' + info.level, x - 70, y, 190, 'right');
      var time = new Date(info.timestamp);
      var mm = (time.getMonth() + 1).padZero(2);
      var d = time.getDate().padZero(2);
      var h = time.getHours().padZero(2);
      var m = time.getMinutes().padZero(2);
      var s = time.getSeconds().padZero(2);
      var str = "%1/%2/%3 %4:%5:%6".format(time.getFullYear(), mm, d, h, m, s);
      this.drawText(str, x - 152, y, 340, "right");
    };
    Window_SavefileList2.prototype.drawSp = function (info, x, y) {
      if (info.skillPoint) {
        var text = TextManager.spSave.format(info.skillPoint);
        this.drawText(text, x, y, 180, "left");
      }
    };
    Window_SavefileList2.prototype.selectSavefile = function (savefileId) {
      var index = Math.max(0, this.savefileIdToIndex(savefileId));
      this.select(index);
      this.setTopRow(Math.floor(index / 4) - 2);
    };
    Window_SavefileList2.prototype.savefileIdToIndex = function (savefileId) {
      return savefileId;
    };
    return Window_SavefileList2;
  })(Window_SavefileList);
  Nore.Window_SavefileList2 = Window_SavefileList2;
  DataManager.maxSavefiles = function () {
    return 96;
  };
  Scene_File.prototype.createListWindow = function () {
    var rect = this.listWindowRect();
    this._listWindow = new Window_SavefileList2(rect);
    this._listWindow.setHandler("ok", this.onSavefileOk.bind(this));
    this._listWindow.setHandler("cancel", this.onCancel.bind(this));
    //this._listWindow.setHandler("change", this.onChange.bind(this));
    this._listWindow.setMode(this.mode(), this.needsAutosave());
    this._listWindow.selectSavefile(this.firstSavefileId());
    //this._listWindow.refresh();
    this.addWindow(this._listWindow);
  };
  Scene_File.prototype.onCancel = function () {
    this.popScene();
  };
  Scene_File.prototype.buttonY = function () {
    return -18;
  };
  var _DataManager_makeSavefileInfo = DataManager.makeSavefileInfo;
  DataManager.makeSavefileInfo = function () {
    var info = _DataManager_makeSavefileInfo.call(this);
    info.stage = $slg.stage();
    info.gold = $gameParty.gold();
    info.fan = $slg.fan();
    info.mapId = $gameMap.mapId();
    return info;
  };
  DataManager.removeInvalidGlobalInfo = function () {
    var globalInfo = this._globalInfo;
    for (
      var _i = 0, globalInfo_1 = globalInfo;
      _i < globalInfo_1.length;
      _i++
    ) {
      var info = globalInfo_1[_i];
      var savefileId = globalInfo.indexOf(info);
      if (savefileId >= 90) {
        return;
      }
      if (!this.savefileExists(savefileId)) {
        delete globalInfo[savefileId];
      }
    }
  };
  DataManager.latestSavefileId = function () {
    var globalInfo = this._globalInfo;
    var validInfo = globalInfo.slice(1).filter(function (x) {
      return x;
    });
    var list = [];
    for (var _i = 0, validInfo_1 = validInfo; _i < validInfo_1.length; _i++) {
      var x = validInfo_1[_i];
      if (isNaN(x.timestamp)) {
        continue;
      }
      list.push(x);
    }
    var latest = Math.max.apply(
      Math,
      list.map(function (x) {
        return x.timestamp;
      })
    );
    var index = globalInfo.findIndex(function (x) {
      return x && x.timestamp === latest;
    });
    return index > 0 ? index : 0;
  };
  Scene_Save.prototype.helpWindowText = function () {
    return TextManager._saveMessage;
  };
  Scene_Load.prototype.helpWindowText = function () {
    return TextManager._loadMessage;
  };
})(Nore || (Nore = {}));
DataManager.loadSavefileImages = function (info) {
  /*
    if (info.characters && Symbol.iterator in info.characters) {
        for (const character of info.characters) {
            ImageManager.loadCharacter(character[0]);
        }
    }
    if (info.faces && Symbol.iterator in info.faces) {
        for (const face of info.faces) {
            ImageManager.loadFace(face[0]);
        }
    }
    */
};


code:
/*:ja
 * @target MZ
 * @author ル
 *
 * @command changeEroId
 * @text エロIDが変わる
 *
 */
var Nore;
(function (Nore) {
  var pluginName = "Nore_ScreenShot";
  PluginManager.registerCommand(pluginName, "changeEroId", function (args) {
    if (!(SceneManager._scene instanceof Scene_Map)) {
      console.error("マップ以外ではスクリーンショットを取れません");
      return;
    }
    var scene = SceneManager._scene;
    scene._screenShotManager = new ScreenShotManager();
    $gameAvJacketMaker.clear();
    p("エロID変化");
  });
  Nore.recordingFlag = false;
  function startRecording() {
    Nore.recordingFlag = true;
    console.info("スクリーンショット作成開始");
    return true;
  }
  Nore.startRecording = startRecording;
  function takeScreenShot(fileName) {
    if (!(SceneManager._scene instanceof Scene_Map)) {
      console.error("マップ以外ではスクリーンショットを取れません");
      return;
    }
    var scene = SceneManager._scene;
    scene.hideForSnapshot();
    var bitmap = SceneManager.snap();
    var fileFullPath = directoryPath() + "/" + fileName;
    var data = bitmap._canvas.toDataURL("image/" + "png").replace(/^.*,/, "");
    StorageManager.fsMkdir(directoryPath());
    StorageManager.fsWriteFile(fileFullPath, new Buffer(data, "base64"));
  }
  Nore.takeScreenShot = takeScreenShot;
  function takeScreenShotBitmap(fileName, bitmap) {
    var fileFullPath = directoryPath() + "/" + fileName;
    var data = bitmap._canvas.toDataURL("image/" + "png").replace(/^.*,/, "");
    StorageManager.fsMkdir(directoryPath());
    StorageManager.fsWriteFile(fileFullPath, new Buffer(data, "base64"));
  }
  Nore.takeScreenShotBitmap = takeScreenShotBitmap;
  function directoryPath() {
    var p = window.location.pathname.replace(/(\/www|)\/[^\/]*$/, "screenshot");
    if (p.match(/^\/([A-Z]\:)/)) {
      p = p.slice(1);
    }
    var result = decodeURIComponent(p);
    if (result[0] == "/") {
      return "." + result;
    }
    return result;
  }
})(Nore || (Nore = {}));
var ScreenShotManager = /** @class */ (function () {
  function ScreenShotManager() {
    this._lastEroImageList = [];
    this._takeScreenShotMap = {};
    this._screenShotCount = 0;
  }
  ScreenShotManager.prototype.update = function () {
    if (!Nore.recordingFlag) {
      return;
    }
    if (!$gameSwitches.value(26)) {
      return;
    }
    var list = this.removeUpper10Index($gameAvJacketMaker.eroImageList());
    if (this.isChanged(list)) {
      this.takeScreenShot(list);
    }
  };
  ScreenShotManager.prototype.takeScreenShot = function (newList) {
    this._lastEroImageList = newList;
    var key = JsonEx.stringify(this._lastEroImageList);
    if (this._takeScreenShotMap[key]) {
      return;
    }
    //p(this._lastEroImageList)
    var eroId = this.pasrseEroId(this._lastEroImageList);
    if (this.isEroIdChanged(eroId)) {
      console.error("eroId が変化しています:" + eroId + " " + this._lastEroId);
      return;
    }
    this._lastEroId = eroId;
    this.putTakeScreenShotMap(newList);
    this._screenShotCount++;
    //p(key)
    var fileName =
      eroId +
      "_" +
      this.screenShotId() +
      "_" +
      this._screenShotCount.padZero(3) +
      ".png";
    Nore.takeScreenShot(fileName);
  };
  ScreenShotManager.prototype.removeUpper10Index = function (newList) {
    var result = [];
    for (var k = 0; k < newList.length; k++) {
      if (newList[k].contains("back")) {
        continue;
      }
      var list = newList[k].split("_");
      if (list.length >= 4) {
        var index = parseInt(list[3]);
        if (index >= 10) {
          continue;
        }
      }
      result.push(newList[k]);
    }
    return result;
  };
  ScreenShotManager.prototype.screenShotId = function () {
    return $gameVariables.value(89).padZero(2);
  };
  /*isAnimeNotChanged(lastList: Array<string>) {

    }*/
  ScreenShotManager.prototype.putTakeScreenShotMap = function (newList) {
    var key = JsonEx.stringify(this._lastEroImageList);
    this._takeScreenShotMap[key] = true;
    for (var i = 0; i < 20; i++) {
      var otherList = [];
      for (var k = 0; k < newList.length; k++) {
        var list = newList[k].split("_");
        if (list.length >= 4) {
          var fileId = parseInt(list[2]);
          if (fileId < 100) {
            return;
          }
          var baseId = Math.round(fileId / 100) * 100;
          var newFile =
            list[0] + "_" + list[1] + "_" + (baseId + i) + "_" + list[3];
          if (list.length == 5) {
            newFile += "_" + list[4];
          }
          otherList.push(newFile);
        }
      }
      if (otherList.length == 0) {
        return;
      }
      //p(otherList)
      var key2 = JsonEx.stringify(otherList);
      this._takeScreenShotMap[key2] = true;
    }
  };
  ScreenShotManager.prototype.isEroIdChanged = function (eroId) {
    if (!this._lastEroId) {
      return false;
    }
    return eroId != this._lastEroId;
  };
  ScreenShotManager.prototype.pasrseEroId = function (list) {
    var splitList = list[0].split("_");
    return splitList[0] + "_" + splitList[1];
  };
  ScreenShotManager.prototype.isChanged = function (list) {
    if (this._lastEroImageList.length != list.length) {
      return true;
    }
    for (var i = 0; i < list.length; i++) {
      if (list[i] != this._lastEroImageList[i]) {
        return true;
      }
    }
    return false;
  };
  return ScreenShotManager;
})();


code:
/*:ja
 * @target MZ
 * @author ル
 */
var Nore;
(function (Nore) {
  var _Window_Selectable_prototype_select = Window_Selectable.prototype.select;
  Window_Selectable.prototype.select = function (index) {
    var last = this._index;
    _Window_Selectable_prototype_select.call(this, index);
    if (this._index != last) {
      this.callHandler("change");
    }
  };
  var _Window_Selectable_prototype_activate =
    Window_Selectable.prototype.activate;
  Window_Selectable.prototype.activate = function () {
    _Window_Selectable_prototype_activate.call(this);
    this.callHandler("change");
  };
  var _Window_Selectable_prototype_processTouch =
    Window_Selectable.prototype.processTouch;
  Window_Selectable.prototype.processTouch = function () {
    _Window_Selectable_prototype_processTouch.call(this);
    if (!this._parentCommandWindow) {
      return;
    }
    if (!this.isHandled("activate")) {
      return;
    }
    if (!this._parentCommandWindow.active) {
      return;
    }
    if (TouchInput.isClicked()) {
      if (this.isOpen() && this.visible) {
        if (!this.active) {
          if (this.isTouchedInsideFrame()) {
            this.callHandler("activate");
          }
        }
      }
    }
  };
  Window_Selectable.prototype.setParentCommandWindow = function (window) {
    this._parentCommandWindow = window;
  };
  /*
        Window_Selectable.prototype.drawBackgroundRect = function(rect) {
            const c1 = ColorManager.itemBackColor1();
            const c2 = ColorManager.itemBackColor2();
            const x = rect.x;
            const y = rect.y;
            const w = rect.width;
            const h = rect.height;

            const bitmap = ImageManager.loadSystem('itemBack');

            this.contentsBack.blt(bitmap, 0, 0, bitmap.width, bitmap.height, x, y, w, h);
            //this.contentsBack.strokeRect(x, y, w, h, c1);
        };
      */
})(Nore || (Nore = {}));


code:
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
/*:ja
 * @target MZ
 * @author ル
 *
 * @command Show
 * @text 子宮表示
 * @des 子宮表示
 * @arg x
 * @text x
 * @desc x
 * @type number
 * @arg y
 * @text y
 * @desc y
 * @type number
 * @arg scale
 * @text 拡大率%
 * @desc 拡大率%
 * @type number
 *
 * @arg angle
 * @text angle
 * @desc angle
 * @type number
 *
 * @arg type
 * @text type
 * @desc type
 * @type number
 * @arg reverse
 * @text 反転
 * @desc 反転
 * @type boolean
 *
 * @command StartChinpo
 * @text ちんぽ開始
 * @des ちんぽ開始
 *
 * @arg chinpoType
 * @text chinpoType
 * @desc chinpoType
 * @type string
 * @arg chinpoSize
 * @text chinpoSize
 * @desc chinpoSize
 * @type number
 *
 * @command EndChinpo
 * @text ちんぽ終了
 * @des ちんぽ終了
 *
 * @arg chinpoIn
 * @text chinpoIn
 * @desc chinpoIn
 * @type number
 *
 * @arg chinpoOut
 * @text chinpoOut
 * @desc chinpoOut
 * @type number
 *
 * @arg outStart
 * @text outStart
 * @desc outStart
 * @type boolean
 *
 * @command UpSeieki
 * @text 精液追加
 * @des 精液追加
 * @arg value
 * @text value
 * @desc value
 * @type number
 *
 * @command Syasei
 * @text 射精
 * @des 射精
 * @arg value
 * @text value
 * @desc value
 * @type number
 *
 * @command Hide
 * @text Hide
 * @des Hide
 */
var Nore;
(function (Nore) {
  var pluginName = "Nore_SikyuSprite";
  PluginManager.registerCommand(pluginName, "Show", function (args) {
    var x = parseInt(args.x);
    var y = parseInt(args.y);
    var scale = parseInt(args.scale);
    var type = parseInt(args.type);
    var angle = parseInt(args.angle);
    var reverse = args.reverse;
    SceneManager._scene.showSikyuSprite(x, y, scale, angle, type, reverse);
  });
  PluginManager.registerCommand(pluginName, "StartChinpo", function (args) {
    var chinpoType = args.chinpoType;
    var chinpoSize = args.chinpoSize;
    var chinpoIn = parseInt(args.chinpoIn);
    var chinpoOut = parseInt(args.chinpoOut);
    var outStart = args.outStart;
    SceneManager._scene.startChinpo(
      chinpoType,
      chinpoSize,
      chinpoIn,
      chinpoOut,
      outStart
    );
  });
  PluginManager.registerCommand(pluginName, "UpSeieki", function (args) {
    var value = parseInt(args.value);
    SceneManager._scene.upSeieki(value);
  });
  PluginManager.registerCommand(pluginName, "Syasei", function (args) {
    var value = parseInt(args.value);
    SceneManager._scene.syasei(value);
  });
  PluginManager.registerCommand(pluginName, "EndSyasei", function (args) {
    SceneManager._scene.endSyasei();
  });
  PluginManager.registerCommand(pluginName, "SeiekiAuto", function (args) {
    var actorId = parseInt(args.actorId);
    var actor = $gameActors.actor(actorId);
    var list = NAKADASHI_SEIEKI_ACCE_LIST;
    var value = 0;
    for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
      var acce = list_1[_i];
      if (actor.hasAcce(acce)) {
        value++;
      }
    }
    SceneManager._scene.upSeieki(value);
  });
  PluginManager.registerCommand(pluginName, "Seieki", function (args) {
    var value = parseInt(args.value);
    SceneManager._scene.upSeieki(value);
  });
  PluginManager.registerCommand(pluginName, "Hide", function (args) {
    var value = parseInt(args.value);
    SceneManager._scene.hideSikyuSprite(value);
  });
  PluginManager.registerCommand(pluginName, "EndChinpo", function (args) {
    SceneManager._scene.endSikyuSprite();
  });
  Scene_Map.prototype.showSikyuSprite = function (
    x,
    y,
    scale,
    angle,
    type,
    reverse
  ) {
    if (!this._sikyuSprite) {
      this._sikyuSprite = new Sprite_Sikyu();
      this.addChild(this._sikyuSprite);
    }
    this._sikyuSprite.show(x, y, scale, angle, type, reverse);
  };
  Scene_Map.prototype.startChinpo = function (
    chinpoType,
    chinpoSize,
    chinpoIn,
    chinpoOut,
    outStart
  ) {
    if (this._sikyuSprite) {
      this._sikyuSprite.startChinpo(
        chinpoType,
        chinpoSize,
        chinpoIn,
        chinpoOut,
        outStart
      );
    }
  };
  Scene_Map.prototype.upSeieki = function (value) {
    if (this._sikyuSprite) {
      this._sikyuSprite.upSeieki(value);
    }
  };
  Scene_Map.prototype.syasei = function (value) {
    if (this._sikyuSprite) {
      this._sikyuSprite.syasei(value);
    }
  };
  Scene_Map.prototype.endSyasei = function () {
    if (this._sikyuSprite) {
      this._sikyuSprite.endSyasei();
    }
  };
  Scene_Map.prototype.hideSikyuSprite = function (value) {
    if (this._sikyuSprite) {
      this.removeChild(this._sikyuSprite);
      this._sikyuSprite = null;
    }
  };
  Scene_Map.prototype.endSikyuSprite = function (value) {
    if (this._sikyuSprite) {
      this._sikyuSprite.endChinpo();
    }
  };
  var Sprite_Sikyu = /** @class */ (function (_super) {
    __extends(Sprite_Sikyu, _super);
    //_fadeSprite: ScreenSprite;
    function Sprite_Sikyu() {
      var _this = _super.call(this) || this;
      _this._seieki = 0;
      _this._syasei = 0;
      _this._animeIndex = 0;
      _this._contentSprite = new PIXI.Sprite();
      _this.addChild(_this._contentSprite);
      _this.createFadeSprite();
      return _this;
    }
    Sprite_Sikyu.prototype.createFadeSprite = function () {
      //this._fadeSprite = new ScreenSprite();
      //this.addChild(this._fadeSprite);
    };
    Sprite_Sikyu.prototype.show = function (x, y, scale, angle, type, reverse) {
      this.x = x;
      this.y = y;
      this.scale.x = this.scale.y = scale / 100;
      this._chinpoType = null;
      this._type = type;
      if (reverse) {
        this.scale.x = -this.scale.x;
        angle += 180;
      }
      this.rotation = (angle * Math.PI) / 180;
      this._animeIndex = 0;
      this.refresh();
      if ($gameVariables.value(980) >= 1 || !ConfigManager.showSikyu) {
        // ボテ腹
        this.visible = false;
      } else {
        this.visible = true;
      }
    };
    Sprite_Sikyu.prototype.hide = function () {
      this.visible = false;
    };
    Sprite_Sikyu.prototype.upSeieki = function (value) {
      this._seieki += value;
      //p('_seieki:' + value)
      this.refresh();
    };
    Sprite_Sikyu.prototype.syasei = function (type) {
      this._syasei = type;
      this.refresh();
    };
    Sprite_Sikyu.prototype.endSyasei = function () {
      this._syasei = null;
      this.refresh();
    };
    Sprite_Sikyu.prototype.startChinpo = function (
      chinpoType,
      chinpoSize,
      chinpoIn,
      chinpoOut,
      outStart
    ) {
      if (chinpoType) {
        this._chinpoType = chinpoType;
      } else if (!this._chinpoType) {
        this._chinpoType = "human";
      }
      this._chinpoSize = chinpoSize;
      this._chinpoIn = chinpoIn;
      this._chinpoOut = chinpoOut;
      this._pose = false;
      this._syasei = 0;
      this._animeIndex = 0;
      this._frameList = [];
      if (outStart) {
        this.pushOutFrame(chinpoOut);
        this.pushInFrame(chinpoIn);
      } else {
        this.pushInFrame(chinpoIn);
        this.pushOutFrame(chinpoOut);
      }
      //p(this._frameList)
      this.update();
    };
    Sprite_Sikyu.prototype.endChinpo = function () {
      this._chinpoType = null;
      this._frameList = [];
      this.refresh();
    };
    Sprite_Sikyu.prototype.pushInFrame = function (inFrame) {
      if (inFrame == 0) {
        this._pose = true;
        return;
      }
      for (var i = 0; i < inFrame - 1; i++) {
        var index = Math.round((i * 15) / inFrame);
        this._frameList.push(index);
      }
      this._frameList.push(15);
    };
    Sprite_Sikyu.prototype.pushOutFrame = function (outFrame) {
      if (outFrame == 0) {
        this._pose = true;
        return;
      }
      for (var i = 0; i < outFrame - 1; i++) {
        var index = 15 - Math.round((i * 15) / outFrame);
        this._frameList.push(index);
      }
      this._frameList.push(0);
    };
    Sprite_Sikyu.prototype.refresh = function () {
      this._contentSprite.removeChildren();
      this.drawSikyu();
      this.drawSeieki();
      this.drawTop();
    };
    Sprite_Sikyu.prototype.drawSikyu = function () {
      if (this._chinpoType && this._chinpoType.length > 0) {
        if (this._syasei > 0) {
          this.addSprite("子宮_" + this._chinpoType + "_" + 15);
          this.addSprite("子宮_射精" + this._syasei);
        } else {
          var index = this._frameList[this._animeIndex];
          this.addSprite("子宮_" + this._chinpoType + "_" + index);
        }
      } else {
        this.addSprite("子宮");
      }
    };
    Sprite_Sikyu.prototype.drawSeieki = function () {
      if (this._seieki == 0) {
        return;
      }
      this.addSprite("子宮_精液" + Math.min(this._seieki, 4));
    };
    Sprite_Sikyu.prototype.drawTop = function () {
      this.addSprite("子宮_上");
      this.addSprite("子宮" + this._type);
    };
    Sprite_Sikyu.prototype.addSprite = function (fileName) {
      var file = "0子宮_" + fileName;
      var texture = PIXI.utils.TextureCache[file + ".png"];
      if (!texture) {
        console.error("ファイルが見つかりません" + file);
      }
      var sprite = new PIXI.Sprite(texture);
      this._contentSprite.addChild(sprite);
    };
    Sprite_Sikyu.prototype.update = function () {
      _super.prototype.update.call(this);
      if (!this.visible) {
        return;
      }
      this.opacity = $gameScreen.brightness();
      this.updateAnime();
    };
    Sprite_Sikyu.prototype.updateAnime = function () {
      if (!this._frameList) {
        return;
      }
      this._animeIndex++;
      if (this._frameList.length <= this._animeIndex) {
        if (this._pose) {
          this._animeIndex--;
          return;
        }
        this._animeIndex = 0;
      }
      this.refresh();
    };
    Sprite_Sikyu.prototype.destroy = function () {
      this._contentSprite.removeChildren();
      _super.prototype.destroy.call(this);
    };
    return Sprite_Sikyu;
  })(Sprite_Clickable);
  Nore.Sprite_Sikyu = Sprite_Sikyu;
})(Nore || (Nore = {}));


code:
/*:ja
 * @target MZ
 * @author ル
 *
 * @command nextStage
 * @text 次のステージへ
 * @des 次のステージへ
 *
 */
var Nore;
(function (Nore) {
  var pluginName = "Nore_Slg";
  PluginManager.registerCommand(pluginName, "nextStage", function (args) {
    $slg.nextStage();
  });
  var DataManager_createGameObjects = DataManager.createGameObjects;
  DataManager.createGameObjects = function () {
    DataManager_createGameObjects.call(this);
    $gameTroop = new Game_Troop2();
    $slg = new Slg();
  };
  var _DataManager_extractSaveContents = DataManager.extractSaveContents;
  DataManager.extractSaveContents = function (contents) {
    _DataManager_extractSaveContents.call(this, contents);
    $slg = contents.slg;
  };
  var _DataManager_makeSaveContents = DataManager.makeSaveContents;
  DataManager.makeSaveContents = function () {
    var contents = _DataManager_makeSaveContents.call(this);
    contents.slg = $slg;
    return contents;
  };
})(Nore || (Nore = {}));
var troopIdList = [0, 7, 2, 3, 5];
var STAGE_VAR = 1;
var AREA_VAR = 2;
var BATTLE_VAR = 5;
var SHOW_SIDE_BATTLE_SW = 15;
var ONE_DAY_TIME = 240;
var Icon;
(function (Icon) {
  Icon[(Icon["kiss"] = 977)] = "kiss";
  Icon[(Icon["chichi"] = 896)] = "chichi";
  Icon[(Icon["cri"] = 898)] = "cri";
  Icon[(Icon["manko"] = 900)] = "manko";
  Icon[(Icon["anal"] = 901)] = "anal";
  Icon[(Icon["sm"] = 987)] = "sm";
  Icon[(Icon["lock"] = 802)] = "lock";
  Icon[(Icon["ok"] = 410)] = "ok";
  Icon[(Icon["bote"] = 947)] = "bote";
  Icon[(Icon["skill1"] = 812)] = "skill1";
  Icon[(Icon["skill2"] = 813)] = "skill2";
  Icon[(Icon["skillEmpty"] = 811)] = "skillEmpty";
  Icon[(Icon["gacha"] = 474)] = "gacha";
  Icon[(Icon["gold"] = 800)] = "gold";
  Icon[(Icon["gold2"] = 656)] = "gold2";
  Icon[(Icon["ticket"] = 658)] = "ticket";
  Icon[(Icon["fan"] = 966)] = "fan";
  Icon[(Icon["kikaku"] = 2112)] = "kikaku";
  Icon[(Icon["energy"] = 2115)] = "energy";
  Icon[(Icon["power"] = 2116)] = "power";
  Icon[(Icon["actionPoint"] = 407)] = "actionPoint";
  Icon[(Icon["actionPoint2"] = 412)] = "actionPoint2";
  Icon[(Icon["baby"] = 935)] = "baby";
  Icon[(Icon["rankH"] = 816)] = "rankH";
  Icon[(Icon["rankG"] = 817)] = "rankG";
  Icon[(Icon["rankF"] = 818)] = "rankF";
  Icon[(Icon["rankE"] = 819)] = "rankE";
  Icon[(Icon["rankD"] = 820)] = "rankD";
  Icon[(Icon["rankC"] = 821)] = "rankC";
  Icon[(Icon["rankB"] = 822)] = "rankB";
  Icon[(Icon["rankA"] = 823)] = "rankA";
  Icon[(Icon["rankS"] = 824)] = "rankS";
  Icon[(Icon["star"] = 427)] = "star";
  Icon[(Icon["n"] = 489)] = "n";
  Icon[(Icon["r"] = 490)] = "r";
  Icon[(Icon["sr"] = 491)] = "sr";
  Icon[(Icon["ssr"] = 493)] = "ssr";
})(Icon || (Icon = {}));
var Slg = /** @class */ (function () {
  function Slg() {
    this._interWait = 0;
    this._avId = 1;
    this._eventId = 1;
    this._tanetsukeMap = {};
    this._gameTime = 0;
    this._time = 0;
    this._battleInfo = new BattleInfo();
    this._facilityInfo = new FacilityInfo();
    this._decisiveBattleInfo = new DecisiveBattleInfo();
    this._avInfo = new AvInfo();
    this._formation = new Formation();
    this._manInfo = new ManInfo();
    this._fan = 0;
    this._waitingEventList = [];
    this._currentEventList = [];
    this._clicker = new Clicker();
    this._timeGaugeEventList = [];
  }
  Slg.prototype.isInterpreterRunning = function () {
    if (!this._interpreter) {
      return;
    }
    return this._interpreter.isRunning();
  };
  Slg.prototype.clearInterpreter = function () {
    this._interpreter = null;
  };
  Slg.prototype.fan = function () {
    return this._fan;
  };
  Slg.prototype.plusFan = function (n) {
    this._fan += n;
  };
  Slg.prototype.update = function () {
    /*
           if (this._speed == Speed.stop) {
               return;
           }
      */
    $slg.goldSe = false;
    if (this._interpreter) {
      this._interpreter.update();
    }
    this._gameTime++;
    if (this._gameTime % this.updateTime() == 0) {
      for (var i = 0; i < this.gameSpeed(); i++) {
        this.updateGame();
        this._time++;
      }
    }
  };
  Slg.prototype.gameSpeed = function () {
    return 1;
  };
  Slg.prototype.updateGame = function () {
    this.updateTimeGaugeEvent();
    this.updateFacilities();
    this.updateClicker();
    this.updateActors();
    this.updateTraining();
  };
  Slg.prototype.updateTraining = function () {
    $slg.formation().trainingInfo().update();
  };
  Slg.prototype.updateClicker = function () {
    this._clicker.update();
  };
  Slg.prototype.updateTimeGaugeEventFade = function () {
    var removeList = [];
    for (var _i = 0, _a = this._timeGaugeEventList; _i < _a.length; _i++) {
      var e = _a[_i];
      e.updateFade();
      if (e.isFinished()) {
        removeList.push(e);
        this._timeGaugeChanged = true;
      }
    }
    for (
      var _b = 0, removeList_1 = removeList;
      _b < removeList_1.length;
      _b++
    ) {
      var e = removeList_1[_b];
      var index = this._timeGaugeEventList.indexOf(e);
      this._timeGaugeEventList.splice(index, 1);
    }
  };
  Slg.prototype.updateTimeGaugeEvent = function () {
    var removeList = [];
    for (var _i = 0, _a = this._timeGaugeEventList; _i < _a.length; _i++) {
      var e = _a[_i];
      e.update();
      if (e.isFinished()) {
        removeList.push(e);
        this._timeGaugeChanged = true;
      }
    }
    for (
      var _b = 0, removeList_2 = removeList;
      _b < removeList_2.length;
      _b++
    ) {
      var e = removeList_2[_b];
      var index = this._timeGaugeEventList.indexOf(e);
      this._timeGaugeEventList.splice(index, 1);
    }
  };
  Slg.prototype.removeDouseiTimeGaugeEvent = function (actorId) {
    for (var _i = 0, _a = this._timeGaugeEventList; _i < _a.length; _i++) {
      var e = _a[_i];
      if (e.type() == TimeGaugeEventType.dousei) {
        var event_1 = e;
        if (event_1.actorId() == actorId) {
          var index = this._timeGaugeEventList.indexOf(e);
          this._timeGaugeEventList.splice(index, 1);
          this._timeGaugeChanged = true;
          return;
        }
      }
    }
  };
  Slg.prototype.isTimeGaugeChanged = function () {
    return this._timeGaugeChanged;
  };
  Slg.prototype.clearTimeGaugeChanged = function () {
    this._timeGaugeChanged = false;
  };
  Slg.prototype.timeGaugeEventList = function () {
    return this._timeGaugeEventList;
  };
  Slg.prototype.fadeoutTimeGaugeEvent = function (id) {
    if (id >= 0) {
      var index = 0;
      for (var _i = 0, _a = this._timeGaugeEventList; _i < _a.length; _i++) {
        var e = _a[_i];
        if (e.id() == id) {
          e.fadeout();
          return;
        }
        index++;
      }
    }
  };
  Slg.prototype.removeTimeGaugeEvent = function (id) {
    if (id >= 0) {
      var index = 0;
      for (var _i = 0, _a = this._timeGaugeEventList; _i < _a.length; _i++) {
        var e = _a[_i];
        if (e.id() == id) {
          this._timeGaugeEventList.splice(index, 1);
          this._timeGaugeChanged = true;
          return;
        }
        index++;
      }
    }
  };
  Slg.prototype.getTimeGaugeEvent = function (type) {
    for (var _i = 0, _a = this._timeGaugeEventList; _i < _a.length; _i++) {
      var e = _a[_i];
      if (e.type() == type) {
        return e;
      }
    }
    return null;
  };
  Slg.prototype.nextAvId = function () {
    var id = this._avId;
    this._avId++;
    return id;
  };
  Slg.prototype.nextTimeEventId = function () {
    var id = this._eventId;
    this._eventId++;
    return id;
  };
  Slg.prototype.nextStage = function () {
    $gameVariables.setValue(STAGE_VAR, this.stage() + 1);
  };
  Slg.prototype.nextTroopId = function () {
    return troopIdList[this.area()];
  };
  Slg.prototype.onStart = function () {
    this.facilityInfo().onStart();
    $gameSwitches.setValue(40, Nore.isTaikenban());
  };
  Slg.prototype.stage = function () {
    return $gameVariables.value(STAGE_VAR);
  };
  Slg.prototype.area = function () {
    return $gameVariables.value(AREA_VAR);
  };
  Slg.prototype.makeAv = function (av) {
    $gameVariables.setValue(7, $gameVariables.value(7) + 1);
    p("AV撮影:" + av.itemId());
    av.make(99);
    this.avInfo().addAv(av);
    var actor = $gameActors.actor(av.actorId());
    actor.onMakeAv(av.mainMan().actorId());
    actor.gainHp(-av.hpCost());
    var upEroInfo = this.upEroParam(
      av.actorId(),
      av.itemId(),
      av.mainMan(),
      av.subMan1(),
      av.subMan2()
    );
    av.setUpEroInfo(upEroInfo);
    upEroInfo.up();
    av.done();
    $gameTemp.lastSelection = null;
    var commonId = av.commonEventId();
    $gameParty.insertCommonEvent(commonId, -1);
  };
  Slg.prototype.upEroParam = function (
    actorId,
    itemId,
    mainMan,
    subMan1,
    subMan2
  ) {
    var key = actorId + "_" + itemId;
    console.log("upEroParam:" + key);
    var params = ERO_PARAMS[key];
    if (!params) {
      console.error(key + "の ERO_PARAMS が見つかりません");
      return null;
    }
    var result = new UpEroInfo(params, actorId);
    result.addMain(mainMan);
    result.addSub1(subMan1);
    result.addSub2(subMan2);
    var actor = $gameActors.actor(actorId);
    actor.upEro(EroType.acme, params.acme);
    actor.upEro(EroType.nakadashi, params.nakadashi);
    actor.upEro(EroType.anal, params.anal);
    actor.upEro(EroType.fela, params.fela);
    return result;
  };
  Slg.prototype.checkTimeEvent = function () {
    var removeList = [];
    for (var _i = 0, _a = this._waitingEventList; _i < _a.length; _i++) {
      var e = _a[_i];
      e.onNextDay();
      if (e.day() == 0) {
        this.fireEvent(e);
        removeList.push(e);
      }
    }
    for (
      var _b = 0, removeList_3 = removeList;
      _b < removeList_3.length;
      _b++
    ) {
      var e = removeList_3[_b];
      this._waitingEventList.splice(this._waitingEventList.indexOf(e), 1);
    }
  };
  Slg.prototype.clearEvent = function () {
    this._waitingEventList = [];
  };
  Slg.prototype.fireEvent = function (e) {
    if (e.commonId() > 0) {
      $gameParty.addCommonEvent(e.commonId());
    } else if (e.scenarioId()) {
      $gameParty.addScenario(e.scenarioId());
    }
  };
  Slg.prototype.updateTime = function () {
    return 1;
    //return 3;
  };
  Slg.prototype.updateTanetsuke = function () {
    for (var key in this._tanetsukeMap) {
      var tanesuke = this._tanetsukeMap[key];
      tanesuke.update();
    }
  };
  Slg.prototype.updateActors = function () {
    for (var i = 1; i < 20; i++) {
      var actor = $gameActors.actor(i);
      actor.update();
    }
  };
  Slg.prototype.updateFacilities = function () {
    this._facilityInfo.update();
  };
  Slg.prototype.fps = function () {
    return 60;
  };
  Slg.prototype.setDirty = function () {
    this._dirty = true;
  };
  Slg.prototype.isDirty = function () {
    if (this._dirty) {
      return true;
    }
    for (var key in this._tanetsukeMap) {
      var tanesuke = this._tanetsukeMap[key];
      if (tanesuke.isDirty()) {
        return true;
      }
    }
    return false;
  };
  Slg.prototype.clearDirty = function () {
    for (var key in this._tanetsukeMap) {
      var tanesuke = this._tanetsukeMap[key];
      tanesuke.clearDirty();
    }
    this._dirty = false;
  };
  Slg.prototype.eventList = function () {
    var result = [];
    for (var key in this._tanetsukeMap) {
      var tanesuke = this._tanetsukeMap[key];
      var history_1 = tanesuke.lastHistory();
      if (history_1.status() == TanetsukeStatus.fertilize) {
        result.push(history_1);
      }
      if (history_1.status() == TanetsukeStatus.firstSex) {
        result.push(history_1);
      }
      if (history_1.status() == TanetsukeStatus.syusan) {
        result.push(history_1);
      }
    }
    return result;
  };
  Slg.prototype.facilityInfo = function () {
    return this._facilityInfo;
  };
  Slg.prototype.avInfo = function () {
    return this._avInfo;
  };
  Slg.prototype.manInfo = function () {
    return this._manInfo;
  };
  Slg.prototype.calcAllAvReward = function () {
    return this.avInfo().avReward();
  };
  Slg.prototype.calcNewAvReward = function () {
    return 8;
  };
  Slg.prototype.formation = function () {
    return this._formation;
  };
  Slg.prototype.decisiveBattleInfo = function () {
    return this._decisiveBattleInfo;
  };
  Slg.prototype.calcKikakuReward = function () {
    return 5;
  };
  Slg.prototype.avRewardRate = function () {
    return 1;
  };
  Slg.prototype.reserveCommonId = function (day, commonId, slgOnly) {
    if (slgOnly === void 0) {
      slgOnly = false;
    }
    this._waitingEventList.push(new TimeEvent(day, commonId, null, slgOnly));
  };
  Slg.prototype.reserveScenarioId = function (day, scenarioId, slgOnly) {
    if (slgOnly === void 0) {
      slgOnly = false;
    }
    this._waitingEventList.push(new TimeEvent(day, -1, scenarioId, slgOnly));
  };
  Slg.prototype.inSlg = function () {
    return this._inSlg;
  };
  Slg.prototype.setSlg = function (b) {
    this._inSlg = b;
    this._dirty = true;
  };
  Slg.prototype.battleInfo = function () {
    return this._battleInfo;
  };
  Slg.prototype.manList = function () {
    return this._manInfo.manList();
  };
  Slg.prototype.hideSideBattle = function () {
    $gameSwitches.setValue(SHOW_SIDE_BATTLE_SW, false);
  };
  Slg.prototype.showSideBattle = function () {
    $gameSwitches.setValue(SHOW_SIDE_BATTLE_SW, true);
  };
  Slg.prototype.isHideSideBattle = function () {
    if ($gameTemp.inRecordAv) {
      return true;
    }
    if ($gameSwitches.value(17)) {
      return false;
    }
    if ($gameTemp.inSlg) {
      return false;
    }
    if ($gameMap._interpreter.isRunning()) {
      if (!this._interWait) {
        this._interWait = 1;
      } else {
        this._interWait++;
        if (this._interWait >= 4) {
          if (!$gameMap._interpreter.isRunning()) {
            this._interWait = 0;
          }
          return true;
        }
      }
    } else {
      this._interWait = 0;
    }
    return !$gameSwitches.value(SHOW_SIDE_BATTLE_SW);
  };
  Slg.prototype.onSlgTerminate = function () {
    this._interWait = 0;
  };
  Slg.prototype.addAvTimeGaugeEvent = function (av) {
    if (!av) {
      console.error("AVが nullです");
      return;
    }
    var e = new AvTimeGaugeEvent(TimeGaugeEventType.sale, 600, av);
    this._timeGaugeEventList.push(e);
    this._timeGaugeChanged = true;
  };
  Slg.prototype.hasLastSaleTimeGaugeEvent = function (actorId) {
    for (var i = 0; i < this._timeGaugeEventList.length; i++) {
      var e = this._timeGaugeEventList[i];
      if (e.type() == TimeGaugeEventType.sale) {
        var ee = e;
        if (ee.av().actorId() == actorId) {
          return true;
        }
      }
    }
    return false;
  };
  Slg.prototype.addTimeGaugeEvent = function (event) {
    this._timeGaugeEventList.push(event);
    this._timeGaugeChanged = true;
  };
  Slg.prototype.removeCommonTimeGaugeEvent = function (commonId) {
    for (var i = 0; i < this._timeGaugeEventList.length; i++) {
      var e = this._timeGaugeEventList[i];
      if (e.type() == TimeGaugeEventType.commonEvent) {
        var ee = e;
        if (ee._commonEventId == commonId) {
          this._timeGaugeEventList.splice(i, 1);
          this._timeGaugeChanged = true;
          return;
        }
      }
    }
  };
  Slg.prototype.removeTimeGaugeEventType = function (type) {
    for (var i = 0; i < this._timeGaugeEventList.length; i++) {
      var e = this._timeGaugeEventList[i];
      if (e.type() == type) {
        this._timeGaugeEventList.splice(i, 1);
        this._timeGaugeChanged = true;
        return;
      }
    }
  };
  Slg.prototype.fadeoutTimeGaugeEventType = function (type) {
    for (var i = 0; i < this._timeGaugeEventList.length; i++) {
      var e = this._timeGaugeEventList[i];
      if (e.type() == type) {
        e.fadeout();
        return;
      }
    }
  };
  Slg.prototype.hasWaitFireTimeEvent = function () {
    for (var i = 0; i < this._timeGaugeEventList.length; i++) {
      var e = this._timeGaugeEventList[i];
      if (e.isWaitFire()) {
        return true;
      }
    }
    return false;
  };
  Slg.prototype.clickerStage = function () {
    return this._clicker.currentStage();
  };
  Slg.prototype.clicker = function () {
    return this._clicker;
  };
  Slg.prototype.isBossBattle = function () {
    var clickerStage = this.clickerStage();
    if (clickerStage.inBattle()) {
      return clickerStage.isBoss();
    }
    return false;
  };
  Slg.prototype.isLastBossBattle = function () {
    var clickerStage = this.clickerStage();
    if (clickerStage.inBattle()) {
      return clickerStage.isLastBoss();
    }
    return false;
  };
  Slg.prototype.isBattle = function () {
    if (!$gameSwitches.value(SHOW_SIDE_BATTLE_SW)) {
      return false;
    }
    var clickerStage = this.clickerStage();
    if (clickerStage.inBattle()) {
      return true;
    }
    return false;
  };
  return Slg;
})();
var $slg;


code:
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
var Nore;
(function (Nore) {
  var Sprite_ActorHp = /** @class */ (function (_super) {
    __extends(Sprite_ActorHp, _super);
    function Sprite_ActorHp(actor) {
      var _this = _super.call(this) || this;
      _this._actor = actor;
      _this._frame.width = 135;
      _this._frame.height = 57;
      return _this;
    }
    Sprite_ActorHp.prototype.update = function () {
      _super.prototype.update.call(this);
      this.updateTouch();
      if (this._lastSpeedUp) {
        this.refresh();
      } else if (
        this._lastHp != Math.floor(this._actor.hpRate() * this.barWidth())
      ) {
        this.refresh();
      }
    };
    Sprite_ActorHp.prototype.barWidth = function () {
      return 127;
    };
    Sprite_ActorHp.prototype.refresh = function () {
      this._lastHp = Math.floor(this._actor.hpRate() * this.barWidth());
      if (this._actor.hpRate() == 1) {
        var gaugeSprite = this.getGaugeSprite(1, 1);
        this.addChild(gaugeSprite);
      } else {
        this._lastSpeedUp = false;
        var gaugeSprite = void 0;
        if (this._actor.isLastSpeedUp()) {
          this._actor.clearLastSpeedUp();
          this._lastSpeedUp = true;
          gaugeSprite = this.getGaugeSprite(2, this._actor.hpRate());
        } else {
          gaugeSprite = this.getGaugeSprite(0, this._actor.hpRate());
        }
        this.addChild(gaugeSprite);
      }
    };
    Sprite_ActorHp.prototype.getGaugeSprite = function (index, rate) {
      var baseTexture = Nore.getSystemBaseTexture("main");
      var r = new Rectangle(0, 320 + index * 28, Math.floor(127 * rate), 20);
      var texture = new PIXI.Texture(baseTexture, r);
      return new PIXI.Sprite(texture);
    };
    Sprite_ActorHp.prototype.updateTouch = function () {
      if (!TouchInput.isPressed()) {
        return;
      }
      var touchPos = new Point(TouchInput.x, TouchInput.y);
      var localPos = this.worldTransform.applyInverse(touchPos);
      if (this._frame.contains(localPos.x, localPos.y + 7)) {
        this._actor.speedUp();
      }
    };
    return Sprite_ActorHp;
  })(Sprite);
  Nore.Sprite_ActorHp = Sprite_ActorHp;
  var Sprite_ActorNinshinInfo = /** @class */ (function (_super) {
    __extends(Sprite_ActorNinshinInfo, _super);
    function Sprite_ActorNinshinInfo(actor, w, h) {
      if (w === void 0) {
        w = 110;
      }
      if (h === void 0) {
        h = 13;
      }
      var _this = _super.call(this) || this;
      _this._actor = actor;
      _this._dousei = actor.dousei();
      _this._barWidth = w;
      _this._barHeight = h;
      _this.bitmap = new Bitmap(_this._barWidth + 30, 20);
      return _this;
    }
    Sprite_ActorNinshinInfo.prototype.update = function () {
      _super.prototype.update.call(this);
      /*if (this._lastNinshin != Math.floor(this._actor.ninshinRate() * this.barWidth())) {
                this.refresh();
            }*/
      if (this.isChanged()) {
        this.refresh();
      }
    };
    Sprite_ActorNinshinInfo.prototype.isChanged = function () {
      if (this._nextUpInfo != this._dousei.nextUpInfo()) {
        return true;
      }
      if (this._lastBote != this._actor.boteId) {
        return true;
      }
      return false;
    };
    Sprite_ActorNinshinInfo.prototype.barWidth = function () {
      return this._barWidth;
    };
    Sprite_ActorNinshinInfo.prototype.refresh = function () {
      this._nextUpInfo = this._dousei.nextUpInfo();
      this._lastBote = this._actor.boteId;
      this.bitmap.clear();
      if (!this._nextUpInfo) {
        return;
      }
      if (!this._dousei.isActive()) {
        return;
      }
      this.drawText();
    };
    Sprite_ActorNinshinInfo.prototype.drawBg = function (type) {
      var bitmap = ImageManager.loadSystem("main");
      var offset = type == 0 ? 0 : 20;
      this.bitmap.blt(bitmap, 169, 173 + offset, 100, 26, 0, 5);
    };
    Sprite_ActorNinshinInfo.prototype.drawText = function () {
      this.bitmap.fontSize = 12;
      var xx = 2;
      var yy = 3;
      var w = 76;
      var h = 20;
      var text = "";
      var bgType = 0;
      if (this._actor.isJusei()) {
        text = TextManager.douseiJusei;
        bgType = 1;
      } else if (this._actor.isBote()) {
        if (this._dousei.isDouseiNinshin()) {
          text = TextManager.douseiSyusan;
        } else {
          text = TextManager.douseiNinshin;
        }
      } else if (!this.canNinshin()) {
        return;
      } else if (this._dousei.isCondom()) {
        text = TextManager.douseiCondom;
        bgType = 1;
      } else {
        var isMax = this._dousei.friendshipLevel() == FriendshipLevel.S;
        var rate = this._actor.juseiRate(isMax);
        var integer = Math.floor(rate);
        text = TextManager.douseiFertilization.format(integer);
        bgType = 1;
      }
      this.drawBg(bgType);
      this.bitmap.drawText(text, xx, yy, w, h, "center");
    };
    Sprite_ActorNinshinInfo.prototype.canNinshin = function () {
      if (!this._nextUpInfo) {
        return false;
      }
      for (var _i = 0, _a = this._nextUpInfo; _i < _a.length; _i++) {
        var info = _a[_i];
        if (info.type == AvRequired.manko) {
          return true;
        }
      }
      return false;
    };
    return Sprite_ActorNinshinInfo;
  })(Sprite);
  Nore.Sprite_ActorNinshinInfo = Sprite_ActorNinshinInfo;
})(Nore || (Nore = {}));