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 Sprite_Picture_prototype_drawEro = Sprite_Picture.prototype.drawEro;
Sprite_Picture.prototype.drawEro = function (file) {
  $gameAvJacketMaker.clear();
  Sprite_Picture_prototype_drawEro.call(this, file);
};
var _Sprite_Picture_prototype_selectEro2Texture =
  Sprite_Picture.prototype.selectEro2Texture;
Sprite_Picture.prototype.selectEro2Texture = function (s, file, fileId, index) {
  var texture = _Sprite_Picture_prototype_selectEro2Texture.call(
    this,
    s,
    file,
    fileId,
    index
  );
  if (texture) {
    var id = texture.textureCacheIds[0];
    $gameAvJacketMaker.addEro(id);
  }
  return texture;
};
var TITLE_FONT_SIZE = 18;
var SUBTITLE_FONT_SIZE = 12;
var JacketScale;
(function (JacketScale) {
  JacketScale[(JacketScale["scale1"] = 1)] = "scale1";
  JacketScale[(JacketScale["scale2"] = 2.5)] = "scale2";
  JacketScale[(JacketScale["scale3"] = 3.35)] = "scale3";
})(JacketScale || (JacketScale = {}));
var Sprite_AvScreenShot = /** @class */ (function (_super) {
  __extends(Sprite_AvScreenShot, _super);
  function Sprite_AvScreenShot(ss, originCenter) {
    if (originCenter === void 0) {
      originCenter = true;
    }
    var _this = _super.call(this) || this;
    _this._ss = ss;
    _this._originCenter = originCenter;
    if (!ss) {
      console.error("ss is null");
    }
    _this.makeJacket();
    return _this;
  }
  Sprite_AvScreenShot.prototype.makeJacket = function () {
    this._sprite = new PIXI.Sprite();
    if (this._originCenter) {
      this._sprite.x = -148 / 2;
      this._sprite.y = -this.spriteHight() / 2;
    }
    this.addChild(this._sprite);
    var list = this._ss.eroImageList();
    for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
      var file = list_1[_i];
      var f = "av_" + file;
      var t = PIXI.utils.TextureCache[f];
      if (!t) {
        console.error(f + "のAV Jacketファイルが見つかりません");
        continue;
      }
      var s = new PIXI.Sprite(t);
      this._sprite.addChild(s);
      if (this._ss.manColor() > 0) {
        if (t.textureCacheIds.length > 0) {
          if (t.textureCacheIds[0].includes("man")) {
            var s2 = new PIXI.Sprite(t);
            this._sprite.addChild(s2);
            setManColorFilter(this._ss.manColor(), s2);
          }
        }
      }
    }
  };
  Sprite_AvScreenShot.prototype.destroy = function (options) {
    this.removeChild(this._sprite);
    _super.prototype.destroy.call(this, options);
  };
  Sprite_AvScreenShot.prototype.spriteHight = function () {
    return 92;
  };
  Sprite_AvScreenShot.prototype.setScreenShot = function (ss) {
    this._ss = ss;
    if (this._sprite) {
      this.removeChild(this._sprite);
    }
    this.makeJacket();
  };
  return Sprite_AvScreenShot;
})(Sprite);
var Sprite_AvActor = /** @class */ (function (_super) {
  __extends(Sprite_AvActor, _super);
  function Sprite_AvActor(avJacket) {
    var _this = _super.call(this) || this;
    _this._avJacket = avJacket;
    _this._avActor = avJacket.avActor();
    return _this;
  }
  Sprite_AvActor.prototype.refresh = function () {
    this.removeChildren();
    if (this._avJacket.manZIndex() == ManZIndex.back) {
      this.refreshMan();
      this.refreshActor();
    } else {
      this.refreshActor();
      this.refreshMan();
    }
  };
  Sprite_AvActor.prototype.refreshActor = function () {
    var a = $gameActors.actor(this._avActor.actorId());
    var actor = JsonEx.makeDeepCopy(a);
    this._avActor._cos.restoreCostume(actor);
    actor.setNaked(false);
    actor.setBote(this._avActor._cos.boteId());
    var faceId = this._avActor._cos.faceId();
    this.drawActor(actor, faceId, this._avJacket.actorOffsetX(), 0);
  };
  Sprite_AvActor.prototype.refreshMan = function () {
    if (!this._avJacket.isManTachieEnabled()) {
      return;
    }
    var actorId = this._avJacket.manId();
    if (actorId < 0) {
      return;
    }
    var a = $gameActors.actor(actorId);
    var actor = JsonEx.makeDeepCopy(a);
    var faceId = 1;
    if (this._avJacket.manCos()) {
      this._avJacket.manCos().restoreCostume(actor);
      faceId = this._avJacket.manCos().faceId();
    }
    this.drawActor(actor, faceId, this._avJacket.manX(), this._avJacket.manY());
  };
  Sprite_AvActor.prototype.drawActor = function (
    actor,
    faceId,
    offsetX,
    offsetY
  ) {
    if (!actor) {
      return;
    }
    var jacketScale = this.jacketScale();
    offsetY += this._avJacket.actorOffsetY(actor.actorId());
    var actorPos = Nore.Tachie.offset[actor.actorId()];
    var x =
      this.actorX(actor.actorId()) * jacketScale +
      offsetX * jacketScale -
      actorPos.x;
    var y =
      this.actorY(actor.actorId()) * jacketScale +
      offsetY * jacketScale -
      actorPos.y;
    var scale = this._avJacket.scale() * jacketScale;
    if (scale > 1 && scale < 1.01) {
      scale = 1;
    }
    this.drawTachieActor(
      actor,
      this,
      Math.round(x),
      Math.round(y),
      null,
      faceId,
      scale,
      false,
      false,
      1,
      100
    );
  };
  Sprite_AvActor.prototype.jacketScale = function () {
    return 1;
  };
  Sprite_AvActor.prototype.actorX = function (actorId) {
    switch (actorId) {
      case 4:
        return -14;
      case 5:
        return -15;
      case 8:
        return -15;
      case 9:
        return -2;
      case 10:
        return 6;
      case 11:
        return -3;
      case 13:
        return -12;
      case 16:
        return -33;
      case 17:
        return -20;
      case 18:
        return -25;
      case 19:
        return -20;
      case 20:
        return -14;
      case 21:
        return -24;
    }
    return 0;
  };
  Sprite_AvActor.prototype.actorY = function (actorId) {
    var base = -40;
    switch (actorId) {
      case 3:
        return base - 23;
      case 4:
        return base + 10;
      case 5:
        return base - 32;
      case 8:
        return base - 0;
      case 9:
        return base + 10;
      case 10:
        return base + 10;
      case 11:
        return base - 0;
      case 13:
        return base - 4;
      case 16:
        return base - 10;
      case 17:
        return base - 10;
      case 21:
        return base - 20;
    }
    return base;
  };
  Sprite_AvActor.prototype.update = function () {
    _super.prototype.update.call(this);
    if (this._avActor && this._avActor.isDirty()) {
      this.refresh();
    }
  };
  return Sprite_AvActor;
})(Sprite);
var Sprite_JacketText = /** @class */ (function (_super) {
  __extends(Sprite_JacketText, _super);
  function Sprite_JacketText(avJacket, spriteWidth, jacketScale, fontSize) {
    var _this = _super.call(this) || this;
    _this._textColor = new TextColor(1);
    _this._avJacket = avJacket;
    _this._spriteWidth = spriteWidth;
    _this._jacketScale = jacketScale;
    _this._fontSize = fontSize;
    _this._avText = _this._avJacket.avText();
    _this.bitmap = new BitmapNoOutline(_this.spriteWidth(), 220 * jacketScale);
    return _this;
  }
  Sprite_JacketText.prototype.textIndex = function () {
    switch (this._fontSize) {
      case FontSize.title:
        return 1;
      case FontSize.smallTitle:
        return 1;
      case FontSize.sub:
        return 2;
      case FontSize.smallSub:
        return 2;
    }
  };
  Sprite_JacketText.prototype.spriteWidth = function () {
    return this._spriteWidth;
  };
  Sprite_JacketText.prototype.spriteHeight = function () {
    return 100;
  };
  Sprite_JacketText.prototype.setText = function (text) {
    this._text = text;
  };
  Sprite_JacketText.prototype.refresh = function () {
    this.bitmap.clear();
    this.drawText();
    this.updateFilter();
  };
  Sprite_JacketText.prototype.drawText = function () {
    if (!this._text) {
      return;
    }
    this.bitmap.fontBold = true; //this._avText.isBold();
    this.bitmap.textColor = this._textColor.textColorMz();
    this.bitmap.outlineWidth = 0;
    this.bitmap.fontFace = this._avText.fontFace(this.textIndex());
    this.bitmap.fontSize = this._fontSize;
    if (this._avJacket.isVertical()) {
      this.drawVertialTitle(this._text, 0);
    } else {
      this.bitmap.drawText(
        this._text,
        0,
        5 * this._jacketScale,
        this.spriteWidth() - 10,
        40,
        "center"
      );
    }
  };
  Sprite_JacketText.prototype.updateFilter = function () {
    var thickness = this._avJacket.avText().outlineThickness1();
    if (this._fontSize == FontSize.sub || this._fontSize == FontSize.smallSub) {
      thickness = this._avJacket.avText().outlineThickness2();
    }
    this.filters = this._textColor.makeFilters(this._fontSize, thickness);
  };
  Sprite_JacketText.prototype.glowFilterDistance = function () {
    switch (this._jacketScale) {
      case JacketScale.scale1:
        return 4;
      case JacketScale.scale2:
        return 8;
      case JacketScale.scale3:
        return 10;
      default:
        console.error("不正なスケールです:" + this._jacketScale);
    }
  };
  Sprite_JacketText.prototype.outlineFilterWidth = function () {
    if (this._spriteWidth > 200) {
      return 3;
    } else {
      return 2;
    }
  };
  Sprite_JacketText.prototype.pixiColor = function () {
    var r = parseInt(this._outlineColor.substring(1, 3), 16) * 256 * 256;
    var g = parseInt(this._outlineColor.substring(3, 5), 16) * 256;
    var b = parseInt(this._outlineColor.substring(5, 7), 16);
    return r + g + b;
  };
  Sprite_JacketText.prototype.plainColor = function () {
    var rate = 1.1;
    var r = parseInt(this._color.substring(1, 3), 16);
    r += Math.floor((256 - r) / rate);
    var g = parseInt(this._color.substring(3, 5), 16);
    g += Math.floor((256 - g) / rate);
    var b = parseInt(this._color.substring(5, 7), 16);
    b += Math.floor((256 - b) / rate);
    //p(this._color)
    var rString = r.toString(16);
    if (rString.length == 0) {
      rString = "0" + rString;
    }
    var gString = g.toString(16);
    if (gString.length == 0) {
      gString = "0" + gString;
    }
    var bString = b.toString(16);
    if (bString.length == 0) {
      bString = "0" + bString;
    }
    return "#" + rString + gString + bString;
  };
  Sprite_JacketText.prototype.setFontSize = function (n) {
    if (this._fontSize == n) {
      return;
    }
    this._fontSize = n;
  };
  Sprite_JacketText.prototype.setTextColor = function (c) {
    if (this._textColor.id() == c.id()) {
      return;
    }
    this._textColor = c;
  };
  Sprite_JacketText.prototype.isShorter = function (text) {
    if (this._fontSize == FontSize.sub) {
      return false;
    }
    if (this._fontSize == FontSize.smallSub) {
      return false;
    }
    return text.length >= 13;
  };
  Sprite_JacketText.prototype.isShorter12 = function (text) {
    if (this._fontSize == FontSize.sub) {
      return false;
    }
    if (this._fontSize == FontSize.smallSub) {
      return false;
    }
    return text.length >= 12;
  };
  Sprite_JacketText.prototype.drawVertialTitle = function (text, x) {
    var y = this.textStartY();
    if (this.isShorter(text)) {
      y -= 12;
    } else if (this.isShorter12(text)) {
      if (this._fontSize == FontSize.title) {
        y -= 12;
      } else {
        y -= 4;
      }
    }
    for (var i = 0; i < text.length; i++) {
      var c = text.charAt(i);
      this.drawCharacter(c, y);
      y += this._fontSize + 1;
      y += this.packY(text);
    }
  };
  Sprite_JacketText.prototype.packY = function (text) {
    if (this.isShorter(text)) {
      if (this._fontSize == FontSize.title) {
        return -7;
      } else {
        return -2;
      }
    } else if (this.isShorter12(text)) {
      return -2;
    }
    return 0;
  };
  Sprite_JacketText.prototype.drawCharacter = function (c, y) {
    if (this.isRotationChar(c)) {
      this.drawRotationChar(c, y);
    } else if (this.isPunctuationMark(c)) {
      this.drawPunctuationMark(c, y);
    } else if (this.isMiniCharacter(c)) {
      this.drawMiniCharacter(c, y);
    } else {
      if (this._jacketScale == JacketScale.scale3) {
        this.bitmap.drawText(c, 0, y, 60, 30, "center");
      } else {
        this.bitmap.drawText(c, 0, y, 50, 30, "center");
      }
    }
  };
  Sprite_JacketText.prototype.isRotationChar = function (c) {
    switch (c) {
      case "ー":
      case "ー":
      case "～":
      case "-":
      case "…":
      case "【":
      case "】":
      case "『":
      case "』":
      case "「":
      case "」":
      case "（":
      case "）":
      case "(":
      case ")":
      case "<":
      case ">":
      case "{":
      case "}":
      case "｛":
      case "｝":
      case "＝":
      case "=":
        return true;
    }
    return false;
  };
  Sprite_JacketText.prototype.drawRotationChar = function (c, y) {
    if (this._spriteWidth > 200) {
      if (this._fontSize == FontSize.sub) {
        this.bitmap.drawTextRotate(c, -4, y - 8, 50, 30, "center");
      } else {
        this.bitmap.drawTextRotate(c, -9, y - 14, 50, 30, "center");
      }
    } else {
      this.bitmap.drawTextRotate(c, 2, y + 1, 50, 30, "center");
    }
  };
  Sprite_JacketText.prototype.isPunctuationMark = function (c) {
    switch (c) {
      case "、":
      case "。":
        return true;
    }
    return false;
  };
  Sprite_JacketText.prototype.drawPunctuationMark = function (c, y) {
    if (this._spriteWidth > 200) {
      if (this._fontSize == FontSize.title) {
        this.bitmap.drawText(c, 0 + 31, y - 22, 50, 30, "center");
      } else {
        this.bitmap.drawText(c, 0 + 26, y - 15, 50, 30, "center");
      }
    } else {
      this.bitmap.drawText(c, 0 + 8, y - 6, 50, 30, "center");
    }
  };
  Sprite_JacketText.prototype.isMiniCharacter = function (c) {
    switch (c) {
      case "ぁ":
      case "ぃ":
      case "ぅ":
      case "ぇ":
      case "ぉ":
      case "ゃ":
      case "ょ":
      case "ゅ":
      case "っ":
      case "ァ":
      case "ィ":
      case "ゥ":
      case "ェ":
      case "ォ":
      case "ッ":
      case "ャ":
      case "ュ":
      case "ョ":
        return true;
    }
  };
  Sprite_JacketText.prototype.drawMiniCharacter = function (c, y) {
    var offsetX = Math.floor(this._fontSize / 8);
    var offsetY = Math.floor(this._fontSize / 8);
    if (this._fontSize == FontSize.title) {
      offsetX += 6;
      offsetY += 4;
    }
    if (this._fontSize == FontSize.sub) {
      offsetX += 3;
      offsetY += 3;
    }
    this.bitmap.drawText(c, 0 + offsetX, y - offsetY, 50, 30, "center");
  };
  Sprite_JacketText.prototype.textStartY = function () {
    return 10 * this._jacketScale;
  };
  return Sprite_JacketText;
})(Sprite);
var TextColor = /** @class */ (function () {
  function TextColor(weaponId) {
    this._weaponId = weaponId;
  }
  TextColor.prototype.textColor = function () {
    return parseInt(this.weapon().meta["color"], 16);
  };
  TextColor.prototype.textColorMz = function () {
    return "#" + this.weapon().meta["color"];
  };
  TextColor.prototype.weapon = function () {
    return $dataWeapons[this._weaponId];
  };
  TextColor.prototype.id = function () {
    return this._weaponId;
  };
  TextColor.prototype.makeFilters = function (fontSize, thickness) {
    var filters = [];
    filters.push(this.makeOutlineFiler(1, fontSize, thickness));
    filters.push(this.makeOutlineFiler(2, fontSize, thickness));
    filters.push(this.makeGlowFiler(1, fontSize, thickness));
    filters.push(this.makeDropShadowFiler(fontSize));
    var result = [];
    for (var _i = 0, filters_1 = filters; _i < filters_1.length; _i++) {
      var f = filters_1[_i];
      if (f) {
        result.push(f);
      }
    }
    return result;
  };
  TextColor.prototype.makeOutlineFiler = function (index, fontSize, thickness) {
    var weapon = this.weapon();
    if (!weapon.meta["outline%1_color".format(index)]) {
      return null;
    }
    var color = parseInt(weapon.meta["outline%1_color".format(index)], 16);
    var width = parseInt(weapon.meta["outline%1_width".format(index)]);
    var filter = new PIXI.filters.OutlineFilter(
      width * this.outlineScale(fontSize, thickness),
      color,
      0.5
    );
    return filter;
  };
  TextColor.prototype.makeGlowFiler = function (index, fontSize, thickness) {
    var weapon = this.weapon();
    if (!weapon.meta["glow%1_color".format(index)]) {
      return null;
    }
    var color = parseInt(weapon.meta["glow%1_color".format(index)], 16);
    var strength = parseInt(weapon.meta["glow%1_strength".format(index)]);
    var distance = parseInt(weapon.meta["glow%1_distance".format(index)]);
    distance *= this.glowFilterDistanceRate(fontSize, thickness);
    var filter = new PIXI.filters.GlowFilter({
      distance: distance,
      outerStrength: strength,
      color: color,
      quality: 0.7,
    });
    return filter;
  };
  TextColor.prototype.makeDropShadowFiler = function (fontSize) {
    var weapon = this.weapon();
    if (!weapon.meta["dropShadowColor"]) {
      return null;
    }
    var color = parseInt(weapon.meta["dropShadowColor"], 16);
    var distance = parseInt(weapon.meta["dropShadowDistance"]);
    distance *= this.glowFilterDistanceRate(fontSize);
    if (fontSize == FontSize.smallTitle || fontSize == FontSize.smallSub) {
      var filter_1 = new PIXI.filters.DropShadowFilter({
        color: color,
        distance: 1,
        blur: 0,
        alpha: 1,
      });
      filter_1.offset.x = 1;
      filter_1.offset.y = 1;
      return filter_1;
    }
    var filter = new PIXI.filters.DropShadowFilter({
      color: color,
      distance: Math.round(distance),
      blur: 0,
      alpha: 1,
    });
    return filter;
  };
  TextColor.prototype.outlineScale = function (fontSize, thickness) {
    var rate = 1;
    if (thickness == Thickness.thin) {
      rate = 0.5;
    } else if (thickness == Thickness.slim) {
      rate = 0.75;
    } else if (thickness == Thickness.bold) {
      rate = 1.25;
    }
    switch (fontSize) {
      case FontSize.title:
        return 0.5 * rate;
      case FontSize.sub:
        return 0.4 * rate;
      case FontSize.smallTitle:
        return 0.5 * 0.4;
      case FontSize.smallSub:
        return 0.4 * 0.4;
      default:
        console.error("不正なフォントサイズです");
    }
  };
  TextColor.prototype.glowFilterDistanceRate = function (fontSize, thickness) {
    var rate = 1;
    if (thickness == Thickness.thin) {
      rate = 0.5;
    } else if (thickness == Thickness.slim) {
      rate = 0.75;
    } else if (thickness == Thickness.bold) {
      rate = 1.25;
    }
    switch (fontSize) {
      case FontSize.title:
        return 1 * rate;
      case FontSize.sub:
        return 0.8 * rate;
      case FontSize.smallTitle:
        return 0.3 * rate;
      case FontSize.smallSub:
        return 0.24 * rate;
      default:
        console.error("不正なスケールです:" + fontSize);
    }
  };
  return TextColor;
})();
var FontSize;
(function (FontSize) {
  FontSize[(FontSize["title"] = 56)] = "title";
  FontSize[(FontSize["sub"] = 40)] = "sub";
  FontSize[(FontSize["smallTitle"] = 17)] = "smallTitle";
  FontSize[(FontSize["smallSub"] = 12)] = "smallSub";
})(FontSize || (FontSize = {}));
var Sprite_AvText = /** @class */ (function (_super) {
  __extends(Sprite_AvText, _super);
  function Sprite_AvText(avJacket, jacketScale) {
    if (jacketScale === void 0) {
      jacketScale = JacketScale.scale1;
    }
    var _this = _super.call(this) || this;
    _this._bottom = false;
    _this._avJacket = avJacket;
    _this._jacketScale = jacketScale;
    _this._avText = avJacket.avText();
    _this.bitmap = new BitmapNoOutline(
      _this.spriteWidth(),
      _this.spriteHeight()
    );
    _this._text1 = new Sprite_JacketText(
      _this._avJacket,
      _this.spriteWidth(),
      jacketScale,
      _this.fontSizeTitle()
    );
    _this.addChild(_this._text1);
    _this._text2 = new Sprite_JacketText(
      _this._avJacket,
      _this.spriteWidth(),
      jacketScale,
      _this.fontSizeSubTitle()
    );
    _this.addChild(_this._text2);
    _this.refresh();
    return _this;
  }
  Sprite_AvText.prototype.spriteWidth = function () {
    return Math.floor(147 * this._jacketScale);
  };
  Sprite_AvText.prototype.spriteHeight = function () {
    return Math.floor(200 * this._jacketScale);
  };
  Sprite_AvText.prototype.whiteLineHeight = function () {
    return Math.ceil(36 * this._jacketScale);
  };
  Sprite_AvText.prototype.fontSizeTitle = function () {
    if (this._jacketScale == JacketScale.scale3) {
      return FontSize.title;
    } else {
      return FontSize.smallTitle;
    }
    //return Math.ceil(TITLE_FONT_SIZE * this._jacketScale);
  };
  Sprite_AvText.prototype.fontSizeSubTitle = function () {
    if (this._jacketScale == JacketScale.scale3) {
      return FontSize.sub;
    } else {
      return FontSize.smallSub;
    }
    //return Math.ceil(SUBTITLE_FONT_SIZE * this._jacketScale);
  };
  Sprite_AvText.prototype.update = function () {
    _super.prototype.update.call(this);
    if (this._avText.isDirty()) {
      this.refresh();
    }
  };
  Sprite_AvText.prototype.refresh = function () {
    if (this._bg) {
      this.removeChild(this._bg);
      this._bg = null;
    }
    var color1 = this._avText.textColor1();
    var color2 = this._avText.textColor2();
    this.bitmap.clear();
    this._text1.setFontSize(this.fontSizeTitle());
    this._text2.setFontSize(this.fontSizeSubTitle());
    this._text1.setTextColor(color1);
    this._text2.setTextColor(color2);
    this._text1.setText(this._avText.text1());
    this._text2.setText(this._avText.text2());
    if (this._avJacket.isVertical()) {
      this.drawTypeVertical3();
    } else if (this._avJacket.isTopBottom()) {
      this.drawTopBottom();
    } else {
      this.drawType3();
    }
  };
  Sprite_AvText.prototype.drawTypeVertical3 = function () {
    this._text1.refresh();
    this._text2.refresh();
    this._text1.x = 110;
    this._text1.y = -10;
    this._text2.x = -14;
    this._text2.y = -10;
  };
  Sprite_AvText.prototype.drawTopBottom = function () {
    this._text1.refresh();
    this._text2.refresh();
    this._text1.x = 2;
    this._text1.y = 4;
    this._text2.x = 2;
    this._text2.y = 150;
  };
  Sprite_AvText.prototype.drawType3 = function () {
    this.fillBg();
    this.addChild(this._text1);
    this.addChild(this._text2);
    this._text1.refresh();
    this._text2.refresh();
    this.updatePositionType3();
  };
  Sprite_AvText.prototype.lineY = function () {
    if (this._bottom) {
      return this.spriteHeight() - this.whiteLineHeight();
    } else {
      return this.centerY();
    }
  };
  Sprite_AvText.prototype.updatePositionType3 = function () {
    var y = this.lineY();
    this._text1.x = 2;
    this._text1.y = y - 13;
    this._text2.x = 2;
    this._text2.y = y + 16 - 12;
  };
  Sprite_AvText.prototype.fillBg = function () {
    var w = this.spriteWidth();
    var h = this.whiteLineHeight();
    var y;
    if (this._bottom) {
      y = this.spriteHeight() - this.whiteLineHeight();
    } else {
      y = this.centerY();
    }
    var dark = new PIXI.Graphics();
    dark.beginFill(this.pixiBgColor(), 0.8);
    dark.drawRect(0, 0, w, h);
    dark.endFill();
    this.addChildAt(dark, 0);
    dark.y = y;
    this._bg = dark;
  };
  Sprite_AvText.prototype.centerY = function () {
    return Math.round(82 * this._jacketScale);
  };
  Sprite_AvText.prototype.pixiBgColor = function () {
    var layout = $gameAvLayoutManager.colorScheme(1);
    var color = layout.bgColor();
    var r = parseInt(color.substring(1, 3), 16) * 256 * 256;
    var g = parseInt(color.substring(3, 5), 16) * 256;
    var b = parseInt(color.substring(5, 7), 16);
    return r + g + b;
  };
  Sprite_AvText.prototype.setBottom = function (b) {
    if (this._bottom == b) {
      return;
    }
    this._bottom = b;
    this.refresh();
  };
  return Sprite_AvText;
})(Sprite);
var Sprite_BaseAvJacket = /** @class */ (function (_super) {
  __extends(Sprite_BaseAvJacket, _super);
  function Sprite_BaseAvJacket() {
    return (_super !== null && _super.apply(this, arguments)) || this;
  }
  Sprite_BaseAvJacket.prototype.drawFrame = function (rect) {
    this.drawFrameTop(rect);
    this.drawFrameBottom(rect);
    this.drawFrameLeft(rect);
    this.drawFrameRight(rect);
  };
  Sprite_BaseAvJacket.prototype.drawFrameLeft = function (rect) {
    var white = new PIXI.Graphics();
    white.beginFill(0xffffff, 1);
    white.drawRect(0, 0, this.outerFrameWidth(), rect.height);
    white.endFill();
    this.addChild(white);
  };
  Sprite_BaseAvJacket.prototype.drawFrameRight = function (rect) {
    var white = new PIXI.Graphics();
    white.beginFill(0xffffff, 1);
    white.drawRect(0, 0, this.outerFrameWidth(), rect.height);
    white.x = rect.width - this.outerFrameWidth();
    white.endFill();
    this.addChild(white);
  };
  Sprite_BaseAvJacket.prototype.drawFrameTop = function (rect) {
    var white = new PIXI.Graphics();
    white.beginFill(0xffffff, 1);
    white.drawRect(0, 0, rect.width, this.outerFrameWidth());
    white.endFill();
    this.addChild(white);
  };
  Sprite_BaseAvJacket.prototype.drawFrameBottom = function (rect) {
    var white = new PIXI.Graphics();
    white.beginFill(0xffffff, 1);
    white.drawRect(0, 0, rect.width, this.outerFrameWidth());
    white.y = rect.height - this.outerFrameWidth();
    white.endFill();
    this.addChild(white);
  };
  Sprite_BaseAvJacket.prototype.frameColor = function () {
    return 0xffffff;
  };
  Sprite_BaseAvJacket.prototype.createBackSprite = function () {
    var backItemId = this._avJacket.backItemId();
    if (this._avJacket.layout() == 21) {
      backItemId = 201; // 黒背景
    }
    if (this._avJacket.layout() == 22) {
      backItemId = 202; // 白背景
    }
    var armor = $dataArmors[backItemId];
    if (armor.meta["back"]) {
      var backId = parseInt(armor.meta["back"]);
      var t = PIXI.utils.TextureCache["back_" + backId.padZero(3) + ".png"];
      var s = new PIXI.Sprite(t);
      s.scale.x = s.scale.y = this.jacketScale() / JacketScale.scale3;
      return s;
    } else if (armor.meta["backColor"]) {
      var color = armor.meta["backColor"];
      var dark = new PIXI.Graphics();
      dark.beginFill(parseInt(color), 1);
      dark.drawRect(0, 0, this.spriteWidth(), this.spriteHeight());
      dark.endFill();
      var s = new PIXI.Sprite();
      s.addChild(dark);
      return s;
    } else {
      console.error("背景画像が不正です:" + backItemId);
    }
  };
  Sprite_BaseAvJacket.prototype.update = function () {
    _super.prototype.update.call(this);
    this.updatePosition();
    if (this._avJacket.isDirty()) {
      this.refresh();
    }
  };
  Sprite_BaseAvJacket.prototype.updatePosition = function () {
    if (this.isAvJacketThumbnail()) {
      this.updateThumbnailAvJacketPosition();
    } else {
      this.updateAvJacketPosition();
    }
    this.updateAvTextPosition();
  };
  Sprite_BaseAvJacket.prototype.updateAvTextPosition = function () {
    if (this._avJacket.isBottom()) {
      this._avText.setBottom(true);
    } else {
      this._avText.setBottom(false);
    }
  };
  Sprite_BaseAvJacket.prototype.updateAvJacketPosition = function () {
    var margin = this.margin();
    this._screenShot.scale.x = 1;
    this._screenShot.scale.y = 1;
    this._screenShot.anchor.x = 0.5;
    this._screenShot.anchor.y = 0.5;
    this._screenShot.rotation = 0;
    this._screenShot.x = this.spriteWidth() / 2;
    if (this._screenShot.filters && this._screenShot.filters.length > 0) {
      this._screenShot.filters = [];
    }
    if (this._avJacket.isCenter()) {
      this._screenShot.y =
        ((200 - this._screenShot.spriteHight()) / 2) * this.jacketScale() +
        margin;
    } else {
      this._screenShot.y =
        (200 - this._screenShot.spriteHight()) * this.jacketScale() + margin;
    }
    this._screenShot.y += this.spriteHeight() / 4;
  };
  Sprite_BaseAvJacket.prototype.updateThumbnailAvJacketPosition = function () {
    var thumbnail = this._avJacket.thumbnail();
    this._screenShot.anchor.x = 0.5;
    this._screenShot.anchor.y = 0.5;
    this._screenShot.scale.x = thumbnail.scale();
    this._screenShot.scale.y = thumbnail.scale();
    this._screenShot.x =
      (thumbnail.x() / JacketScale.scale3) * this.jacketScale();
    this._screenShot.y =
      (thumbnail.y() / JacketScale.scale3) * this.jacketScale();
    this._screenShot.rotation = (thumbnail.angle() * Math.PI) / 180;
    this._screenShot.visible = true;
    if (!this._screenShot.filters || this._screenShot.filters.length == 0) {
      this._screenShot.filters = [this.outlineFilter()];
    }
  };
  Sprite_BaseAvJacket.prototype.isAvJacketThumbnail = function () {
    if (!this._avJacket.isNoScreenShot()) {
      return false;
    }
    return this._avJacket.isThumbnail();
  };
  Sprite_BaseAvJacket.prototype.refresh = function () {
    this.refreshBack();
    this._avActor.refresh();
    this._avText.refresh();
    this._avParts.refresh();
    this.createBackSprite();
    this._screenShot.setScreenShot(this._avJacket.screenShot());
    this.refreshBack();
    this.updatePosition();
    if (this._avJacket.isNoScreenShot()) {
      if (this._avJacket.isThumbnail()) {
        this._screenShot.visible = true;
      } else {
        this._screenShot.visible = false;
      }
    } else {
      this._screenShot.visible = true;
    }
    if (this._avJacket.isCenter()) {
      this._avActor.visible = false;
    } else {
      this._avActor.visible = true;
    }
  };
  Sprite_BaseAvJacket.prototype.refreshBack = function () {
    if (this._backSprite) {
      this._backLayer.removeChild(this._backSprite);
    }
    var margin = this.margin();
    this._backSprite = this.createBackSprite();
    this._backSprite.x = margin;
    this._backSprite.y = margin;
    this._backLayer.addChild(this._backSprite);
  };
  Sprite_BaseAvJacket.prototype.destroy = function (options) {
    this._backLayer.removeChild(this._backSprite);
    _super.prototype.destroy.call(this, options);
  };
  Sprite_BaseAvJacket.prototype.outlineColor = function () {
    return 0x000000;
  };
  return Sprite_BaseAvJacket;
})(Sprite);
var Sprite_AvJacket = /** @class */ (function (_super) {
  __extends(Sprite_AvJacket, _super);
  function Sprite_AvJacket(avJacket) {
    var _this = _super.call(this) || this;
    var margin = _this.margin();
    _this._avJacket = avJacket;
    _this._screenShot = new Sprite_AvScreenShot(avJacket.screenShot());
    _this._screenShot.x = margin;
    _this._avActor = new Sprite_AvActor(avJacket);
    _this._avActor.x = margin;
    _this._avActor.y = margin;
    _this._avText = new Sprite_AvText(avJacket);
    _this._avText.x = margin;
    _this._avText.y = margin;
    _this._avParts = new Sprite_AvParts(avJacket, JacketScale.scale1);
    _this._avParts.x = margin;
    _this._avParts.y = margin;
    var g = new PIXI.Graphics();
    g.beginFill(_this.frameColor(), 1);
    g.drawRect(
      0,
      0,
      _this.spriteWidth() + margin * 2,
      _this.spriteHeight() + margin * 2
    );
    g.endFill();
    _this.addChild(g);
    _this._selectedLayer = new PIXI.Sprite();
    _this._backLayer = new PIXI.Sprite();
    _this.addChild(_this._backLayer);
    _this.addChild(_this._avActor);
    _this.addChild(_this._screenShot);
    _this.addChild(_this._avParts);
    _this.addChild(_this._avText);
    var rect = new Rectangle(0, 0, 150, 204);
    var myMask = new PIXI.Graphics();
    myMask.beginFill(0xffffff);
    myMask.drawRect(
      rect.x + _this.getGlobalPosition().x,
      rect.y + _this.getGlobalPosition().y,
      rect.width,
      rect.height
    );
    myMask.endFill();
    _this.mask = myMask;
    _this.addChild(_this.mask);
    _this.drawFrame(rect);
    _this.addChild(_this._selectedLayer);
    _this._frame.width = rect.width;
    _this._frame.height = rect.height;
    _this.updatePosition();
    return _this;
  }
  Sprite_AvJacket.prototype.update = function () {
    _super.prototype.update.call(this);
    this.updateTouch();
  };
  Sprite_AvJacket.prototype.outerFrameWidth = function () {
    return 2;
  };
  Sprite_AvJacket.prototype.margin = function () {
    return 2;
  };
  Sprite_AvJacket.prototype.jacketScale = function () {
    return JacketScale.scale1;
  };
  Sprite_AvJacket.prototype.outlineFilter = function () {
    var filter = new PIXI.filters.OutlineFilter(1, this.outlineColor(), 0.5);
    filter.alpha = 0.7;
    return filter;
  };
  Sprite_AvJacket.prototype.spriteWidth = function () {
    return 147;
  };
  Sprite_AvJacket.prototype.spriteHeight = function () {
    return 200;
  };
  Sprite_AvJacket.prototype.setHandler = function (f) {
    this._clickHandler = f;
  };
  Sprite_AvJacket.prototype.updateTouch = function () {
    if (!this._clickHandler) {
      return;
    }
    var touchPos = new Point(TouchInput.x, TouchInput.y);
    var localPos = this.worldTransform.applyInverse(touchPos);
    if (this._frame.contains(localPos.x, localPos.y)) {
      if (TouchInput.isTriggered()) {
        this._clickHandler();
      } else {
        this.select();
      }
    } else {
      this.deselect();
    }
  };
  Sprite_AvJacket.prototype.deselect = function () {
    if (!this._selected) {
      return;
    }
    this._selected = false;
    this._selectedLayer.removeChildren();
  };
  Sprite_AvJacket.prototype.select = function () {
    if (this._selected) {
      return;
    }
    this._selected = true;
    var baseTexture = Nore.getSystemBaseTexture("Window");
    var w = 48;
    var h = 48;
    var m = 5;
    var r = new Rectangle(96, 96, w, h);
    var texture = new PIXI.Texture(baseTexture, r);
    var s = new PIXI.Sprite(texture);
    s.x = -1;
    s.y = -1;
    s.scale.x = (this.spriteWidth() + m) / w;
    s.scale.y = (this.spriteHeight() + m) / h;
    this._selectedLayer.addChild(s);
  };
  return Sprite_AvJacket;
})(Sprite_BaseAvJacket);
var Sprite_AvParts = /** @class */ (function (_super) {
  __extends(Sprite_AvParts, _super);
  function Sprite_AvParts(avJacket, jackeScale) {
    var _this = _super.call(this) || this;
    _this._avJacket = avJacket;
    _this._jackeScale = jackeScale;
    return _this;
  }
  Sprite_AvParts.prototype.refresh = function () {
    this.removeChildren();
    var partsList = this._avJacket.partsList();
    for (var _i = 0, partsList_1 = partsList; _i < partsList_1.length; _i++) {
      var partsId = partsList_1[_i];
      this.addParts(partsId);
    }
  };
  Sprite_AvParts.prototype.addParts = function (partsId) {
    var t = this.getTexture(partsId);
    var s = new PIXI.Sprite(t);
    if (partsId < 10) {
      if (!this._avJacket.isDividedLayout()) {
        return;
      }
    } else if (partsId >= 11 && partsId <= 19) {
      if (!this._avJacket.isActorLayout()) {
        return;
      }
      if (this._avJacket.isBigActorLayout()) {
        s.x -= Math.round(this.bigActorIconOffset());
      }
    }
    s.scale.x = s.scale.y = this._jackeScale / JacketScale.scale3;
    s.x += this._avJacket.manLayoutActorOffsetX() * this._jackeScale;
    s.y +=
      this._avJacket.actorOffsetY(this._avJacket.actorId()) * this._jackeScale;
    this.addChild(s);
  };
  Sprite_AvParts.prototype.getTexture = function (partsId) {
    return PIXI.utils.TextureCache["parts_" + partsId.padZero(3) + ".png"];
  };
  Sprite_AvParts.prototype.bigActorIconOffset = function () {
    return 10;
  };
  Sprite_AvParts.prototype.destroy = function (options) {
    this.removeChildren();
    _super.prototype.destroy.call(this, options);
  };
  return Sprite_AvParts;
})(Sprite);


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 preloadLastJacket
 * @text ジャケット画像を先読み
 * @des ジャケット画像を先読み
 * @arg actorId
 * @type number
 * @desc actorId
 *
 * @command showLastJacket
 * @text ジャケット画像を表示
 * @des ジャケット画像を表示
 * @arg actorId
 * @type number
 * @desc actorId
 *
 * @command hideLastJacket
 * @text ジャケット画像を消去
 * @des ジャケット画像を消去
 *
 * @command preloadJacketNtr
 * @text NTRジャケット画像を先読み
 * @des NTRジャケット画像を先読み
 * @arg itemId
 * @type number
 * @desc itemId
 *
 * @command showJacketNtr
 * @text NTRジャケット画像を表示
 * @des NTRジャケット画像を表示
 * @arg itemId
 * @type number
 * @desc itemId
 */
var Nore;
(function (Nore) {
  var pluginName = "Nore_AvJacketUiBig";
  PluginManager.registerCommand(
    pluginName,
    "preloadLastJacket",
    function (args) {
      var actorId = parseInt(args.actorId);
      var av = $slg.avInfo().actorLastShowResultAv(actorId);
      var jacket = av.avJacket();
      if (jacket.isActorOnlyLayout()) {
        return;
      }
      var ss = jacket.screenShot();
      var imageId = ss.imageId();
      this._waitLoading = true;
      Nore.preloadWebp2(imageId);
    }
  );
  PluginManager.registerCommand(pluginName, "showLastJacket", function (args) {
    if (SceneManager._scene instanceof Scene_Map2) {
      var actorId = parseInt(args.actorId);
      var av = $slg.avInfo().actorLastShowResultAv(actorId);
      var jacket = av.avJacket();
      var isSyusan = av.isSyusan();
      var isBote = av.isBote();
      $gameSwitches.setValue(113, isBote);
      $gameSwitches.setValue(114, isSyusan);
      var scene = SceneManager._scene;
      scene.showBigJacket(jacket);
    }
  });
  PluginManager.registerCommand(pluginName, "hideLastJacket", function (args) {
    if (SceneManager._scene instanceof Scene_Map2) {
      var scene = SceneManager._scene;
      scene.hideBigJacket();
    }
  });
  PluginManager.registerCommand(
    pluginName,
    "preloadJacketNtr",
    function (args) {
      var itemId = parseInt(args.itemId);
      var av = $slg.avInfo().findAvByItemId(itemId);
      if (!av) {
        return;
      }
      var jacket = av.avJacket();
      if (jacket.isActorOnlyLayout()) {
        return;
      }
      var ss = jacket.screenShot();
      var imageId = ss.imageId();
      this._waitLoading = true;
      Nore.preloadWebp2(imageId);
    }
  );
  PluginManager.registerCommand(pluginName, "showJacketNtr", function (args) {
    if (SceneManager._scene instanceof Scene_Map2) {
      var itemId = parseInt(args.itemId);
      var av = $slg.avInfo().findAvByItemId(itemId);
      if (!av) {
        console.error("AVが存在しません:" + itemId);
        return;
      }
      var jacket = av.avJacket();
      var scene = SceneManager._scene;
      scene.showBigJacket(jacket);
    }
  });
  var Scene_AvJacketBig = /** @class */ (function (_super) {
    __extends(Scene_AvJacketBig, _super);
    function Scene_AvJacketBig() {
      return (_super !== null && _super.apply(this, arguments)) || this;
    }
    Scene_AvJacketBig.prototype.create = function () {
      _super.prototype.create.call(this);
      this.createAvWindow();
    };
    Scene_AvJacketBig.prototype.createAvWindow = function () {
      this._avWindow = new Window_AvJacketBig();
      this.addChild(this._avWindow);
    };
    Scene_AvJacketBig.prototype.update = function () {
      _super.prototype.update.call(this);
      if (
        Input.isTriggered("cancel") ||
        Input.isTriggered("ok") ||
        TouchInput.isTriggered() ||
        TouchInput.rightButton
      ) {
        SoundManager.playOk();
        this.popScene();
      }
    };
    Scene_AvJacketBig.prototype.createCancelButton = function () {
      this._cancelButton = new Sprite_Button2("cancel", true);
      this._cancelButton.x = 860;
      this._cancelButton.y = 30;
      this.addWindow(this._cancelButton);
    };
    return Scene_AvJacketBig;
  })(Scene_MenuBase);
  Nore.Scene_AvJacketBig = Scene_AvJacketBig;
  var Window_AvJacketBig = /** @class */ (function (_super) {
    __extends(Window_AvJacketBig, _super);
    function Window_AvJacketBig() {
      var _this = this;
      var r = new Rectangle(270, 60, 500, 500);
      _this = _super.call(this, r) || this;
      _this.backOpacity = 0;
      _this.frameVisible = false;
      _this.createJacket();
      return _this;
    }
    Window_AvJacketBig.prototype.createJacket = function () {
      var av = $gameTemp.bigAv;
      this._jacketSprite = new Sprite_AvJacketBig(
        av.avJacket(),
        JacketScale.scale3,
        null
      );
      this.addChild(this._jacketSprite);
      this._jacketSprite.x = 100;
      this._jacketSprite.y = 20;
      av.avJacket().setDirty();
    };
    Window_AvJacketBig.prototype.update = function () {
      _super.prototype.update.call(this);
      $gameTemp.bigAv.avJacket().clearDirty();
    };
    return Window_AvJacketBig;
  })(Window_Base);
  Nore.Window_AvJacketBig = Window_AvJacketBig;
  var Sprite_AvJacketBig = /** @class */ (function (_super) {
    __extends(Sprite_AvJacketBig, _super);
    function Sprite_AvJacketBig(avJacket, jacketScale, callback) {
      if (callback === void 0) {
        callback = null;
      }
      var _this = _super.call(this) || this;
      _this._callback = callback;
      _this._jacketScale = jacketScale;
      var margin = _this.margin();
      _this._avJacket = avJacket;
      _this._screenShot = new Sprite_AvScreenShotBig(avJacket, jacketScale);
      _this._screenShot.x = margin;
      _this._avActor = new Sprite_AvActorBig(avJacket, jacketScale);
      _this._avActor.x = margin;
      _this._avActor.y = margin;
      _this._avText = new Sprite_AvTextBig(avJacket, jacketScale);
      _this._avText.x = margin;
      _this._avText.y = margin;
      _this._avParts = new Sprite_JacketPartsBig(avJacket, jacketScale);
      _this._avParts.x = margin;
      _this._avParts.y = margin;
      var g = new PIXI.Graphics();
      g.beginFill(_this.frameColor(), 1);
      g.drawRect(
        0,
        0,
        _this.spriteWidth() + margin * 2,
        _this.spriteHeight() + margin * 2
      );
      g.endFill();
      _this.addChild(g);
      _this._backLayer = new PIXI.Sprite();
      _this.addChild(_this._backLayer);
      _this.addChild(_this._avActor);
      _this.addChild(_this._screenShot);
      _this.addChild(_this._avParts);
      _this.addChild(_this._avText);
      var spriteWidth = _this.spriteWidth() + 4;
      var spriteHeight = _this.spriteHeight() + 4;
      var rect = new Rectangle(0, 0, spriteWidth, spriteHeight);
      var myMask = new PIXI.Graphics();
      myMask.beginFill(0xffffff);
      myMask.drawRect(
        rect.x + _this.getGlobalPosition().x,
        rect.y + _this.getGlobalPosition().y,
        rect.width,
        rect.height
      );
      myMask.endFill();
      _this.mask = myMask;
      _this.addChild(_this.mask);
      _this.drawFrame(rect);
      _this._frame.width = rect.width;
      _this._frame.height = rect.height;
      _this.updatePosition();
      _this._screenShot.loadImage(_this.onLoad.bind(_this));
      return _this;
    }
    Sprite_AvJacketBig.prototype.onLoad = function () {
      if (this._callback) {
        this._callback();
      }
      this.refresh();
    };
    Sprite_AvJacketBig.prototype.outerFrameWidth = function () {
      return 3;
    };
    Sprite_AvJacketBig.prototype.margin = function () {
      return 3;
    };
    Sprite_AvJacketBig.prototype.spriteWidth = function () {
      return Math.floor(147 * this._jacketScale);
    };
    Sprite_AvJacketBig.prototype.spriteHeight = function () {
      return Math.floor(200 * this._jacketScale);
    };
    Sprite_AvJacketBig.prototype.createBackSprite = function () {
      var backItemId = this._avJacket.backItemId();
      if (this._avJacket.layout() == 21) {
        backItemId = 201; // 黒背景
      }
      if (this._avJacket.layout() == 22) {
        backItemId = 202; // 白背景
      }
      var armor = $dataArmors[backItemId];
      if (armor.meta["back"]) {
        var backId = parseInt(armor.meta["back"]);
        var t = PIXI.utils.TextureCache["back_" + backId.padZero(3) + ".png"];
        var s = new PIXI.Sprite(t);
        return s;
      } else if (armor.meta["backColor"]) {
        var color = armor.meta["backColor"];
        var dark = new PIXI.Graphics();
        dark.beginFill(parseInt(color), 1);
        dark.drawRect(0, 0, this.spriteWidth(), this.spriteHeight());
        dark.endFill();
        var s = new PIXI.Sprite();
        s.addChild(dark);
        return s;
      } else {
        console.error("背景画像が不正です:" + backItemId);
      }
    };
    Sprite_AvJacketBig.prototype.jacketScale = function () {
      return this._jacketScale;
    };
    Sprite_AvJacketBig.prototype.outlineFilter = function () {
      var filter = new PIXI.filters.OutlineFilter(2, this.outlineColor(), 0.5);
      filter.alpha = 0.7;
      return filter;
    };
    return Sprite_AvJacketBig;
  })(Sprite_BaseAvJacket);
  Nore.Sprite_AvJacketBig = Sprite_AvJacketBig;
  var Sprite_AvScreenShotBig = /** @class */ (function (_super) {
    __extends(Sprite_AvScreenShotBig, _super);
    function Sprite_AvScreenShotBig(jacket, jacketScale) {
      var _this = _super.call(this) || this;
      _this._jacket = jacket;
      _this._jacketScale = jacketScale;
      _this._ss = jacket.screenShot();
      if (!jacket) {
        console.error("jacket is null");
      }
      return _this;
    }
    Sprite_AvScreenShotBig.prototype.loadImage = function (callback) {
      this._callback = callback;
      if (this._jacket.hasNoImage()) {
        this.onLoad();
        return;
      }
      var imageId = this._ss.imageId();
      this._waitLoading = true;
      Nore.preloadWebp2(imageId, this.onLoad.bind(this));
    };
    Sprite_AvScreenShotBig.prototype.onLoad = function () {
      this._waitLoading = false;
      if (this._callback) {
        this._callback();
      }
    };
    Sprite_AvScreenShotBig.prototype.makeJacket = function () {
      if (this._jacket.hasNoImage()) {
        return;
      }
      this._sprite = new PIXI.Sprite();
      this.addChild(this._sprite);
      this._sprite.x = (-1280 / 2) * this.imageScale();
      this._sprite.y = (-800 / 2) * this.imageScale();
      var list = this._ss.eroImageList();
      for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
        var file = list_1[_i];
        var f = file;
        var t = PIXI.utils.TextureCache[f];
        if (!t) {
          console.error(f + "のAV Jacketファイルが見つかりません");
          continue;
        }
        var s = new PIXI.Sprite(t);
        //s.scale.x = this.imageScale();
        //s.scale.y = this.imageScale();
        this._sprite.addChild(s);
        if (this._ss.manColor() > 0) {
          if (t.textureCacheIds.length > 0) {
            if (t.textureCacheIds[0].includes("man")) {
              var s2 = new PIXI.Sprite(t);
              this._sprite.addChild(s2);
              setManColorFilter(this._ss.manColor(), s2);
            }
          }
        }
      }
      this._sprite.scale.x = this.imageScale();
      this._sprite.scale.y = this.imageScale();
    };
    Sprite_AvScreenShotBig.prototype.imageScale = function () {
      return (147 / 1280) * this._jacketScale;
    };
    Sprite_AvScreenShotBig.prototype.destroy = function (options) {
      this.removeChild(this._sprite);
      this.releaseWebp();
      _super.prototype.destroy.call(this, options);
    };
    Sprite_AvScreenShotBig.prototype.releaseWebp = function () {
      var imageId = this._ss.imageId();
      Nore.releaseWebp(imageId + "_1");
    };
    Sprite_AvScreenShotBig.prototype.spriteHight = function () {
      return 92;
    };
    Sprite_AvScreenShotBig.prototype.setScreenShot = function (ss) {
      this._ss = ss;
      if (this._sprite) {
        this.removeChild(this._sprite);
      }
      if (this._waitLoading) {
        return;
      }
      this.makeJacket();
    };
    Sprite_AvScreenShotBig.prototype.update = function () {
      _super.prototype.update.call(this);
      if (!this._waitLoading) {
        return;
      }
      if (this.isLoaded()) {
        this._waitLoading = false;
        this.makeJacket();
      }
    };
    Sprite_AvScreenShotBig.prototype.isLoaded = function () {
      var imageId = this._ss.imageId();
      if (!Nore.isWebpLoaded(imageId + "_1")) {
        return false;
      }
      if (!Nore.isWebpLoaded(imageId + "_2")) {
        return false;
      }
      return true;
    };
    return Sprite_AvScreenShotBig;
  })(Sprite);
  var Sprite_AvActorBig = /** @class */ (function (_super) {
    __extends(Sprite_AvActorBig, _super);
    function Sprite_AvActorBig(avJacket, jacketScale) {
      var _this = _super.call(this, avJacket) || this;
      _this._jacketScale = jacketScale;
      return _this;
    }
    Sprite_AvActorBig.prototype.jacketScale = function () {
      return this._jacketScale;
    };
    return Sprite_AvActorBig;
  })(Sprite_AvActor);
  var Sprite_AvTextBig = /** @class */ (function (_super) {
    __extends(Sprite_AvTextBig, _super);
    function Sprite_AvTextBig(avJacket, jacketScale) {
      return _super.call(this, avJacket, jacketScale) || this;
    }
    Sprite_AvTextBig.prototype.updatePositionType3 = function () {
      var y = this.lineY();
      if (this._jacketScale == JacketScale.scale2) {
        this._text1.x = 4;
        this._text1.y = y + 3;
        this._text2.x = 4;
        this._text2.y = y + 41;
      } else {
        this._text1.x = 4;
        this._text1.y = y - 1;
        this._text2.x = 4;
        this._text2.y = y + 56;
      }
    };
    Sprite_AvTextBig.prototype.drawTypeVertical3 = function () {
      this._text1.refresh();
      this._text2.refresh();
      if (this._jacketScale == JacketScale.scale2) {
        this._text1.x = 310;
        this._text1.y = 0;
        this._text2.x = 6;
        this._text2.y = 0;
      } else {
        this._text1.x = 410;
        this._text1.y = 0;
        this._text2.x = 6;
        this._text2.y = -6;
      }
    };
    Sprite_AvTextBig.prototype.drawTopBottom = function () {
      this._text1.refresh();
      this._text2.refresh();
      if (this._jacketScale == JacketScale.scale2) {
        this._text1.x = 4;
        this._text1.y = 50;
        this._text2.x = 4;
        this._text2.y = 400;
      } else {
        this._text1.x = 4;
        this._text1.y = 75;
        this._text2.x = 4;
        this._text2.y = 526;
      }
    };
    return Sprite_AvTextBig;
  })(Sprite_AvText);
  var Sprite_JacketPartsBig = /** @class */ (function (_super) {
    __extends(Sprite_JacketPartsBig, _super);
    function Sprite_JacketPartsBig(avJacket, jacketScale) {
      var _this = _super.call(this, avJacket, jacketScale) || this;
      _this._jacketScale = jacketScale;
      return _this;
    }
    Sprite_JacketPartsBig.prototype.bigActorIconOffset = function () {
      return 10 * this._jacketScale;
    };
    return Sprite_JacketPartsBig;
  })(Sprite_AvParts);
})(Nore || (Nore = {}));

repo_name: onms/dead

license: unknown


code:
var __extends =
  (this && this.__extends) ||
  (function () {
    var extendStatics = function (d, b) {
      extendStatics =
        Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array &&
          function (d, b) {
            d.__proto__ = b;
          }) ||
        function (d, b) {
          for (var p in b)
            if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
      return extendStatics(d, b);
    };
    return function (d, b) {
      if (typeof b !== "function" && b !== null)
        throw new TypeError(
          "Class extends value " + String(b) + " is not a constructor or null"
        );
      extendStatics(d, b);
      function __() {
        this.constructor = d;
      }
      d.prototype =
        b === null
          ? Object.create(b)
          : ((__.prototype = b.prototype), new __());
    };
  })();
/*:ja
 * @target MZ
 * @author ル
 *
 * @command showResult
 * @text AVリザルト
 * @des AVリザルト
 *
 * @command setAvJacketName
 * @text AVジャケット名を変数 81 82 83 に設定
 * @arg actorId
 * @type number
 * @text actorId
 * @desc actorId
 *
 * @command setAvJacketNameByItem
 * @text 指定のitemIDのAVジャケット名を変数 81 82 83 に設定
 * @arg itemId
 * @type number
 * @text itemId
 * @desc itemId
 */
var Nore;
(function (Nore) {
  var AV_TITLE_VAR_1 = 81;
  var AV_TITLE_VAR_2 = 82;
  var TANEOYA_VAR_1 = 83;
  var SALES_VAR_1 = 84;
  var pluginName = "Nore_AvResultBar";
  PluginManager.registerCommand(pluginName, "showResult", function (args) {
    $gameTemp.av = $slg.avInfo().nextResultAv();
    if (!$gameTemp.av) {
      console.error("AVが見つかりません");
      return;
    }
    $slg.plusFan($gameTemp.av.plusFan());
    SceneManager.push(Scene_AvResultBar);
  });
  PluginManager.registerCommand(pluginName, "setAvJacketName", function (args) {
    var actorId = parseInt(args.actorId);
    var lastAv = $slg.avInfo().actorLastShowResultAv(actorId);
    if (lastAv) {
      $gameVariables.setValue(AV_TITLE_VAR_1, lastAv.jacketTitle());
      $gameVariables.setValue(AV_TITLE_VAR_2, lastAv.jacketSubTitle());
      $gameVariables.setValue(SALES_VAR_1, lastAv.realSales());
      if (lastAv.isSyusan()) {
        var actor = $gameActors.actor(actorId);
        var name_1 = actor.lastBaby().taneoyaName();
        $gameVariables.setValue(TANEOYA_VAR_1, name_1);
      }
    }
  });
  PluginManager.registerCommand(
    pluginName,
    "setAvJacketNameByItem",
    function (args) {
      var itemId = parseInt(args.itemId);
      var lastAv = $slg.avInfo().findAvByItemId(itemId);
      if (lastAv) {
        $gameVariables.setValue(AV_TITLE_VAR_1, lastAv.jacketTitle());
        $gameVariables.setValue(AV_TITLE_VAR_2, lastAv.jacketSubTitle());
        $gameVariables.setValue(SALES_VAR_1, lastAv.realSales());
        if (lastAv.isSyusan()) {
          var actor = $gameActors.actor(actorId);
          var name_2 = actor.lastBaby().taneoyaName();
          $gameVariables.setValue(TANEOYA_VAR_1, name_2);
        }
      }
    }
  );
})(Nore || (Nore = {}));
var AV_SALES_RATE = 10;
var AvReviewType;
(function (AvReviewType) {
  AvReviewType["popularity"] = "popularity";
  AvReviewType["mania"] = "mania";
  AvReviewType["okaidoku"] = "okaidoku";
  AvReviewType["chijoku"] = "chijoku";
  AvReviewType["nuki"] = "nuki";
  AvReviewType["eros"] = "eros";
  AvReviewType["sm"] = "sm";
})(AvReviewType || (AvReviewType = {}));
var AvReview = /** @class */ (function () {
  function AvReview() {
    this._reviewList = [];
  }
  AvReview.prototype.makeReview = function (av) {
    var list = av.avParamList();
    var actor = $gameActors.actor(av.actorId());
    this.addReview(AvReviewType.eros, this.calcEros(actor, list));
    if (av.containsType(AvRequired.sm)) {
      this.addReview(AvReviewType.sm, this.calcSm(actor, list));
    }
    this.addReview(AvReviewType.nuki, this.calcNuki(actor, list));
  };
  AvReview.prototype.calcEros = function (actor, list) {
    var n =
      (actor.eroParam(AvRequired.kiss) +
        actor.eroParam(AvRequired.chichi) * 2) /
      30;
    return Math.ceil(n / 10) * 10 + Math.randomInt(10);
  };
  AvReview.prototype.calcSm = function (actor, list) {
    var n = 0;
    for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
      var param = list_1[_i];
      if (param.requiredType() == AvRequired.sm) {
        n += param.total() * 3;
      } else {
        n += param.total();
      }
    }
    n /= list.length + 2;
    return Math.ceil(n / 10) * 10 + Math.randomInt(10);
  };
  AvReview.prototype.calcNuki = function (actor, list) {
    var n = 0;
    for (var _i = 0, list_2 = list; _i < list_2.length; _i++) {
      var param = list_2[_i];
      n += param.total();
    }
    n /= list.length;
    return Math.ceil(n / 10) * 10 + Math.randomInt(10);
  };
  AvReview.prototype.calcPopularity = function (actor, list) {
    return actor.eroAbility(Ability.popularity);
  };
  AvReview.prototype.addReview = function (type, value) {
    this._reviewList.push(new AvReviewOne(type, value));
  };
  AvReview.prototype.choiseType = function () {
    var typeList = [];
    typeList.push(AvReviewType.mania);
    return typeList;
  };
  AvReview.prototype.reviewList = function () {
    return this._reviewList;
  };
  return AvReview;
})();
var AvReviewOne = /** @class */ (function () {
  function AvReviewOne(type, value) {
    this.type = type;
    this.value = value;
  }
  return AvReviewOne;
})();
var Scene_AvResultBar = /** @class */ (function (_super) {
  __extends(Scene_AvResultBar, _super);
  function Scene_AvResultBar() {
    return (_super !== null && _super.apply(this, arguments)) || this;
  }
  Scene_AvResultBar.prototype.create = function () {
    this.loadAvImage();
    _super.prototype.create.call(this);
    this.createDark();
    this.createResultWindow();
    this.saveAvTitleVar();
  };
  Scene_AvResultBar.prototype.start = function () {
    _super.prototype.start.call(this);
    this._avWindow.refresh();
  };
  Scene_AvResultBar.prototype.isReady = function () {
    if (!this._spriteSheetLoaded) {
      return false;
    }
    return _super.prototype.isReady.call(this);
  };
  Scene_AvResultBar.prototype.saveAvTitleVar = function () {
    var sw = this.actorAvTalkSw();
    if (sw > 0) {
      $gameSwitches.setValue(sw, true);
    }
  };
  Scene_AvResultBar.prototype.actorAvTalkSw = function () {
    switch ($gameTemp.av.actorId()) {
      case 9:
        return 190;
      case 4:
        return 191;
      case 13:
        return 192;
      case 17:
        return 193;
    }
    return -1;
  };
  Scene_AvResultBar.prototype.loadAvImage = function () {};
  Scene_AvResultBar.prototype.createDark = function () {
    var dark = new PIXI.Graphics();
    dark.beginFill(0, 0.8);
    dark.drawRect(0, 0, Graphics.boxWidth + 10, Graphics.boxHeight + 10);
    dark.endFill();
    this.addChild(dark);
  };
  Scene_AvResultBar.prototype.createResultWindow = function () {
    this._avWindow = new Window_AvResultBar(this.onLoad.bind(this));
    this.addChild(this._avWindow);
    this._avWindow.setHandler("ok", this.onOk.bind(this));
    this._avWindow.setHandler("cancel", this.onOk.bind(this));
    this._avWindow.activate();
  };
  Scene_AvResultBar.prototype.onLoad = function () {
    //p('onLoad')
    this._spriteSheetLoaded = true;
  };
  Scene_AvResultBar.prototype.update = function () {
    _super.prototype.update.call(this);
    if (TouchInput.isTriggered()) {
      this.onOk();
    }
  };
  Scene_AvResultBar.prototype.onOk = function () {
    if (!this._avWindow.isFinished()) {
      this._avWindow.activate();
      return;
    }
    var av = $gameTemp.av;
    av.showResult();
    this.popScene();
  };
  return Scene_AvResultBar;
})(Scene_MenuBase);
var Window_AvResultBar = /** @class */ (function (_super) {
  __extends(Window_AvResultBar, _super);
  function Window_AvResultBar(callback) {
    var _this = this;
    var r = new Rectangle(90, 48, 1100, 704);
    _this = _super.call(this, r) || this;
    _this.createJacket(callback);
    _this.createSalesSprite();
    ImageManager.loadSystem("result");
    return _this;
  }
  Window_AvResultBar.prototype.createJacket = function (callback) {
    var av = $gameTemp.av;
    this._jacketSprite = new Nore.Sprite_AvJacketBig(
      av.avJacket(),
      JacketScale.scale3,
      callback
    );
    this._jacketSprite.x = 15;
    this._jacketSprite.y = 15;
    this.addChild(this._jacketSprite);
    this._jacketSprite.refresh();
  };
  Window_AvResultBar.prototype.refresh = function () {
    this._contentsBackSprite.removeChildren();
    _super.prototype.refresh.call(this);
    this.drawSpriteBack();
    this.drawTitle();
    this.drawParameter(550, 360);
    this.drawManParameter(830, 360);
  };
  Window_AvResultBar.prototype.drawSpriteBack = function () {
    var offsetYSales = ConfigManager.language == "jp" ? 0 : 40;
    {
      var s = this.getSprite(0, 0, 492, 146);
      s.x = 546;
      s.y = 20;
      this._contentsBackSprite.addChild(s);
    }
    {
      var s2 = this.getSprite(0, 150, 500, 126);
      s2.x = 546 - 6;
      s2.y = 182;
      this._contentsBackSprite.addChild(s2);
      var s3 = this.getSprite(0, 276 + offsetYSales, 500, 40);
      s3.x = 546 - 6;
      s3.y = 182 + 14;
      this._contentsBackSprite.addChild(s3);
    }
    var offsetY = ConfigManager.language == "jp" ? 0 : 30;
    {
      var s4 = this.getSprite(0, 370, 216, 344);
      s4.x = 546 - 7;
      s4.y = 320;
      this._contentsBackSprite.addChild(s4);
      var s5 = this.getSprite(0, 714 + offsetY, 216, 30);
      s5.x = 546 - 7;
      s5.y = 350;
      this._contentsBackSprite.addChild(s5);
    }
    {
      var s6 = this.getSprite(218, 370, 270, 344);
      s6.x = 546 - 7 + 230;
      s6.y = 320;
      this._contentsBackSprite.addChild(s6);
      var s7 = this.getSprite(218, 714 + offsetY, 226, 30);
      s7.x = 546 - 7 + 250;
      s7.y = 350;
      this._contentsBackSprite.addChild(s7);
    }
  };
  Window_AvResultBar.prototype.update = function () {
    _super.prototype.update.call(this);
  };
  Window_AvResultBar.prototype.drawTitle = function () {
    var xx = 566;
    var ww = 460;
    var av = $gameTemp.av;
    var actor = av.actor();
    this.contents.fontSize = 18;
    this.contents.outlineWidth = 2;
    this.contents.outlineColor = "#43005c";
    this.drawText(
      TextManager.avResult1.format(actor.name(), av.avCountTotal()),
      xx,
      21,
      ww,
      "center"
    );
    this.contents.outlineColor = "#000000";
    this.contents.outlineWidth = 5;
    this.contents.fontSize = 32;
    this.drawText(av.jacketTitle(), xx, 58, ww, "center");
    this.contents.fontSize = 20;
    this.drawText(av.jacketSubTitle(), xx, 96, ww, "center");
    this.contents.fontSize = 18;
    this.contents.outlineWidth = 2;
    this.contents.outlineColor = "#43005c";
    this.drawText(TextManager.avResult2, xx, 126, ww, "center");
  };
  Window_AvResultBar.prototype.getSprite = function (x, y, w, h) {
    var baseTexture = Nore.getSystemBaseTexture("result");
    var r = new Rectangle(x, y, w, h);
    var texture = new PIXI.Texture(baseTexture, r);
    var s = new PIXI.Sprite(texture);
    return s;
  };
  Window_AvResultBar.prototype.createSalesSprite = function () {
    var av = $gameTemp.av;
    this._salesSprite = new Sprite_AvSales(
      av.realSales(),
      av.reward(),
      av.plusFan()
    );
    this._salesSprite.x = 550;
    this._salesSprite.y = 220;
    this.addChild(this._salesSprite);
  };
  Window_AvResultBar.prototype.createBarSprite = function () {
    var yy = 300;
    var xx = 600;
    var interval = 100;
    var av = $gameTemp.av;
    var list = av.reviewList();
    var reviewOne1 = list[0];
    this._bar1 = new Sprite_AvGauge(reviewOne1.type, reviewOne1.value);
    this._bar1.x = xx;
    this._bar1.y = yy;
    this.addChild(this._bar1);
    var reviewOne2 = list[1];
    this._bar2 = new Sprite_AvGauge(reviewOne2.type, reviewOne2.value);
    this._bar2.x = xx + interval;
    this._bar2.y = yy;
    this.addChild(this._bar2);
    var reviewOne3 = list[2];
    if (!reviewOne3) {
      return;
    }
    this._bar3 = new Sprite_AvGauge(reviewOne3.type, reviewOne3.value);
    this._bar3.x = xx + interval * 2;
    this._bar3.y = yy;
    this.addChild(this._bar3);
  };
  Window_AvResultBar.prototype.isFinished = function () {
    return this._salesSprite.isFinished();
  };
  Window_AvResultBar.prototype.drawParameter = function (x, y) {
    var av = $gameTemp.av;
    var upEroInfo = av.upEroInfo();
    if (!upEroInfo) {
      return;
    }
    var list = Nore.$avParamManager.list();
    var actor = av.actor();
    this.contents.fontSize = 20;
    this.changeTextColor(ColorManager.normalColor());
    this.drawText(av.actor().name(), x - 0, y + 20, 200, "center");
    var after = upEroInfo.afterActorParam();
    var diff = upEroInfo.diffActorParam();
    for (var i = 0; i < list.length; i++) {
      this.drawStatusOne(after, diff, x + 23, y + 70, i, list[i], false);
    }
  };
  Window_AvResultBar.prototype.drawStatusOne = function (
    afterEroInfo,
    diff,
    x,
    y,
    index,
    info,
    isMan
  ) {
    var yy = y + index * 37;
    var xx = x;
    //this.drawIcon(info.iconIndex(), xx, yy);
    this.changeTextColor(ColorManager.normalColor());
    if (isMan) {
      this.drawText(afterEroInfo.value(info.type()), xx + 40, yy, 42, "right");
    } else {
      this.drawText(
        this.commaValue(afterEroInfo.value(info.type())),
        xx + 40,
        yy,
        42,
        "right"
      );
    }
    this.changeTextColor(ColorManager.crisisColor());
    var up = diff.value(info.type());
    if (up > 0) {
      var offset = false ? 0 : 65;
      if (isMan) {
        this.drawText("+" + up, xx + offset, yy, 80, "right");
      } else {
        this.drawText("+" + this.commaValue(up), xx + offset, yy, 80, "right");
      }
    }
  };
  Window_AvResultBar.prototype.drawManParameter = function (x, y) {
    var av = $gameTemp.av;
    var upEroInfo = av.upEroInfo();
    if (!upEroInfo) {
      return;
    }
    var list = Nore.$avParamManager.list();
    var actor = av.actor();
    this.changeTextColor(ColorManager.normalColor());
    this.drawText(av.mainMan().name(), x - 10, y + 20, 180, "center");
    var after = upEroInfo.afterManParam();
    var diff = upEroInfo.mainManUpEro();
    for (var i = 0; i < list.length; i++) {
      this.drawStatusOne(after, diff, x, y + 70, i, list[i], true);
    }
  };
  Window_AvResultBar.prototype.commaValue = function (value) {
    var value1 = Math.floor(value / 10);
    var value2 = value % 10;
    return value1 + "." + value2;
  };
  return Window_AvResultBar;
})(Window_Selectable);
var Sprite_AvSales = /** @class */ (function (_super) {
  __extends(Sprite_AvSales, _super);
  function Sprite_AvSales(sales, reward, fan) {
    var _this = _super.call(this) || this;
    _this._time = 0;
    _this._finished = false;
    _this.createBitmap();
    _this._sales = sales;
    _this._reward = reward;
    _this._plusFan = fan;
    return _this;
  }
  Sprite_AvSales.prototype.createBitmap = function () {
    this.bitmap = new Bitmap(840, 210);
  };
  Sprite_AvSales.prototype.update = function () {
    _super.prototype.update.call(this);
    if (!this._sales) {
      return;
    }
    if (this._finished) {
      return;
    }
    this.nextStep();
    this.refresh();
  };
  Sprite_AvSales.prototype.maxStep = function () {
    return 60;
  };
  Sprite_AvSales.prototype.nextStep = function () {
    this._time++;
    this._current =
      Math.round((this._sales / this.maxStep()) * this._time) +
      Math.randomInt(4) -
      2;
    this._currentReward = Math.round(
      (this._current / this._sales) * this._reward
    );
    this._currentFan = Math.round(
      (this._plusFan / this.maxStep()) * this._time
    );
    if (this._time == this.maxStep()) {
      this._finished = true;
      this._current = this._sales;
      this._currentReward = this._reward;
      this._currentFan = this._plusFan;
    }
  };
  Sprite_AvSales.prototype.refresh = function () {
    this.bitmap.clear();
    this.drawSales(15);
    this.drawReward(130);
    this.drawFan(330);
  };
  Sprite_AvSales.prototype.drawSales = function (x) {
    this.bitmap.textColor = ColorManager.normalColor();
    this.bitmap.fontSize = 40;
    this.bitmap.drawText(this._current + "", x, 35, 120, 40, "right");
  };
  Sprite_AvSales.prototype.drawReward = function (x) {
    this.bitmap.textColor = ColorManager.normalColor();
    this.bitmap.fontSize = 40;
    this.bitmap.drawText(
      this._currentReward + "",
      x - 24,
      35,
      148,
      40,
      "right"
    );
    this.bitmap.fontSize = 26;
    this.bitmap.drawText("Ｇ", x, 40, 148, 40, "right");
  };
  Sprite_AvSales.prototype.drawFan = function (x) {
    this.bitmap.textColor = ColorManager.normalColor();
    this.bitmap.fontSize = 40;
    this.bitmap.drawText(
      this._currentFan * FAN_UNIT + "",
      x - 24,
      35,
      148,
      40,
      "right"
    );
    this.bitmap.fontSize = 26;
    this.bitmap.drawText("人", x, 40, 148, 40, "right");
  };
  Sprite_AvSales.prototype.isFinished = function () {
    return this._finished;
  };
  Sprite_AvSales.prototype.drawIcon = function (iconIndex, x, y) {
    var bitmap = ImageManager.loadSystem("IconSet");
    var pw = ImageManager.iconWidth;
    var ph = ImageManager.iconHeight;
    var sx = (iconIndex % 16) * pw;
    var sy = Math.floor(iconIndex / 16) * ph;
    this.bitmap.blt(bitmap, sx, sy, pw, ph, x, y);
  };
  return Sprite_AvSales;
})(Sprite);
var Sprite_AvGauge = /** @class */ (function (_super) {
  __extends(Sprite_AvGauge, _super);
  function Sprite_AvGauge(title, value) {
    var _this = _super.call(this) || this;
    _this._time = 0;
    _this._finished = false;
    _this._title = title;
    _this._value = value;
    _this.createBitmap();
    return _this;
  }
  Sprite_AvGauge.prototype.createBitmap = function () {
    this.bitmap = new Bitmap(150, 300);
  };
  Sprite_AvGauge.prototype.update = function () {
    _super.prototype.update.call(this);
    if (!this._value) {
      return;
    }
    if (this._finished) {
      return;
    }
    this.nextStep();
    this.refresh();
  };
  Sprite_AvGauge.prototype.maxStep = function () {
    return 100;
  };
  Sprite_AvGauge.prototype.nextStep = function () {
    this._time++;
    this._current = this._time;
    if (this._time == this._value) {
      this._finished = true;
      this._current = this._value;
    }
  };
  Sprite_AvGauge.prototype.refresh = function () {
    this.bitmap.clear();
    this.drawGauge(5);
    this.drawValue(5);
  };
  Sprite_AvGauge.prototype.drawGauge = function (y) {
    var hh = 100;
    this.bitmap.fillRect(
      20,
      hh - this._current,
      20,
      this._current,
      ColorManager.salesColor()
    );
  };
  Sprite_AvGauge.prototype.drawValue = function (y) {
    this.bitmap.textColor = ColorManager.salesColor();
    this.bitmap.drawText(this._current + "", -10, 93, 51, 40, "right");
    this.bitmap.textColor = ColorManager.normalColor();
    this.bitmap.fontSize = 20;
    this.bitmap.drawText(this.getTitle(), 0, 120, 100, 40, "left");
  };
  Sprite_AvGauge.prototype.getTitle = function () {
    switch (this._title) {
      case AvReviewType.nuki:
        return "ヌキ度";
      case AvReviewType.sm:
        return "鬼畜度";
      case AvReviewType.eros:
        return "エロ度";
      case AvReviewType.mania:
        return "マニア度";
      case AvReviewType.chijoku:
        return "恥辱度";
    }
    return "";
  };
  return Sprite_AvGauge;
})(Sprite);