/*:ja * @target MZ * @author ル * * @command showAv * @text AV画面 * @des AV画面 * @arg actorId * @type number * @arg avId * @type number * * */ 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 pluginName = "Nore_AvUi"; PluginManager.registerCommand(pluginName, "showAv", function (args) { var avId = Math.trunc(args.avId); var actorId = Math.trunc(args.actorId); var av = new Av(actorId, avId); $gameTemp.av = av; SceneManager.push(Nore.Scene_Av); }); var RIGHT_WINDOW_X = 696; var Scene_Av = /** @class */ (function (_super) { __extends(Scene_Av, _super); function Scene_Av() { return (_super !== null && _super.apply(this, arguments)) || this; } Scene_Av.prototype.create = function () { this._av = $gameTemp.av; _super.prototype.create.call(this); this.createAvWindow(); this.createConfirmWindow(); }; Scene_Av.prototype.start = function () { _super.prototype.start.call(this); this.onAvChange(); }; Scene_Av.prototype.createBackground = function () {}; Scene_Av.prototype.createAvWindow = function () { this._avWindow = new Window_Av(this._av); this.addChild(this._avWindow); this._avWindow.activate(); this._avWindow.select(0); this._avWindow.setHandler("ok", this.onOk.bind(this)); this._avWindow.setHandler("cancel", this.onCancel.bind(this)); this._avWindow.setHandler("change", this.onAvChange.bind(this)); this._paramWindow = new Window_AvParam(this._av); this.addChild(this._paramWindow); this._manWindow = new Window_AvMan(this._av, this._avWindow); this.addChild(this._manWindow); this._manWindow.setHandler("ok", this.onManOk.bind(this)); this._manWindow.setHandler("cancel", this.onManCancel.bind(this)); this._manWindow.setHandler("change", this.onManChange.bind(this)); this._manWindow.hide(); this._manParamWindow = new Window_AvManParams(this._av); this.addChild(this._manParamWindow); //this._manParamWindow.hide(); }; Scene_Av.prototype.createConfirmWindow = function () { this._confirmWindow = new Nore.Window_Confirm(500); this.addChild(this._confirmWindow); this._confirmWindow.visible = false; this._confirmWindow.setHandler("ok", this.onConfirmOk.bind(this)); this._confirmWindow.setHandler("cancel", this.onConfirmCancel.bind(this)); }; Scene_Av.prototype.onOk = function () { /*if (this._avWindow.index() == this._avWindow.autoIndex()) { // 避妊 if (! this._av.actor().canContraception() || ! this._av.canContraception()) { SoundManager.playBuzzer(); } else { const b = this._av.isContraception(); this._av.setContraception(! b); this._avWindow.refresh(); } this._avWindow.activate(); return; }*/ if (this._avWindow.index() == this._avWindow.okIndex()) { this.confirmOk(); return; } if (this._avWindow.index() == this._avWindow.cancelIndex()) { this.confirmCancel(); return; } this._manWindow.makeData(); this._manWindow.refresh(); this._manWindow.show(); this._manParamWindow.show(); this._manWindow.activate(); this._manWindow.select(0); }; Scene_Av.prototype.onCancel = function () { this.popScene(); }; Scene_Av.prototype.onManOk = function () { var actor = this._manWindow.selectedActor(); var actorId; if (actor) { actorId = actor.actorId(); } else { actorId = 0; } this._manWindow.deactivate(); this._manWindow.select(-1); var index = this._avWindow.index(); if (index == 0) { this._av.setMainMan(actorId); } else if (index == 1) { this._av.setSubMan1(actorId); } else { this._av.setSubMan2(actorId); } this._paramWindow.refresh(); this._avWindow.refresh(); this._avWindow.activate(); this._manWindow.hide(); }; Scene_Av.prototype.onManCancel = function () { this._paramWindow.refresh(); this._avWindow.refresh(); this._avWindow.activate(); this._manWindow.hide(); this._manParamWindow.hide(); }; Scene_Av.prototype.onManChange = function () { var actor = this._manWindow.selectedActor(); this._manParamWindow.setMan(actor); }; Scene_Av.prototype.onAvChange = function () { var actor = this._avWindow.selectedActor(); if (actor) { this._manParamWindow.setMan(actor); this._manParamWindow.show(); } else { this._manParamWindow.setMan(null); this._manParamWindow.hide(); } }; Scene_Av.prototype.confirmCancel = function () { this._inCancel = true; this._confirmWindow.setText(TextManager.confirmAvCancel); this._confirmWindow.visible = true; this._confirmWindow.select(0); this._confirmWindow.activate(); }; Scene_Av.prototype.confirmOk = function () { this._inCancel = false; this._confirmWindow.setText(TextManager.confirmAvOk); this._confirmWindow.visible = true; this._confirmWindow.select(0); this._confirmWindow.activate(); }; Scene_Av.prototype.onConfirmOk = function () { if (this._inCancel) { this.popScene(); } else { $gameAvJacketList.clear(); $slg.makeAv($gameTemp.av); $gameVariables.setValue(Nore.VIDEO_ID_VAR, $gameTemp.av.itemId()); $gameSwitches.setValue(62, true); SceneManager.popAllScene(); } }; Scene_Av.prototype.onConfirmCancel = function () { this._inCancel = false; this._confirmWindow.visible = false; this._avWindow.activate(); }; return Scene_Av; })(Scene_MenuBase); Nore.Scene_Av = Scene_Av; var Window_Av = /** @class */ (function (_super) { __extends(Window_Av, _super); function Window_Av(av) { var _this = this; var r = new Rectangle(25, 35, 660, 735); _this = _super.call(this, r) || this; _this._av = av; _this.createTachieLayer(); _this.autoSet(); _this.refresh(); return _this; } Window_Av.prototype.autoSet = function () { if (this._av.avCount() <= 1) { return; } if (!this._av.isSyusan()) { //return; } var last = $slg.avInfo().lastAv(this._av.itemId()); this._av.setSubMan1(last.subMan1Id()); this._av.setSubMan2(last.subMan2Id()); this._av.setMainMan(last.mainManId()); }; Window_Av.prototype.createTachieLayer = function () { this._actorLayer = new Sprite(); this.addChild(this._actorLayer); }; Window_Av.prototype.refresh = function () { _super.prototype.refresh.call(this); this.drawDescription(); this.drawAv(); this.drawButton(); this.drawTachie(); }; Window_Av.prototype.maxItems = function () { return 5; }; Window_Av.prototype.itemRect = function (index) { /*if (index == this.autoIndex()) { return new Rectangle(380, 400, 220, 40); }*/ if (index == this.okIndex()) { return new Rectangle(380, 450, 140, 40); } if (index == this.cancelIndex()) { return new Rectangle(380, 500, 140, 40); } var r = _super.prototype.itemRect.call(this, index); r.x += 280; r.y += 176 + index * 15; r.width = 220; return r; }; Window_Av.prototype.drawAv = function () { this.contents.fontSize = 24; this.changeTextColor(ColorManager.normalColor()); var y = 130; this.drawAVContents(y); this.drawMainActor(this.itemRect(0).y + 3); this.drawSubActor1(this.itemRect(1).y + 3); this.drawSubActor2(this.itemRect(2).y + 3); }; Window_Av.prototype.drawAVContents = function (y) { this.drawSpriteLabel(0, y); this.drawText(this._av.name(), this.contentsX(), y, 300); }; Window_Av.prototype.drawMainActor = function (y) { if (this._av.isMainManFixed()) { this.drawIcon(Icon.lock, 252, y); } this.drawSpriteLabel(63, y + 4); this.drawIcon(this._av.mainManIconIndex(), this.valueX(), y); this.drawText( this._av.mainManName(), this.valueX() + this.iconWidth(), y, 300 ); }; Window_Av.prototype.drawSubActor1 = function (y) { this.drawSpriteLabel(63 * 2, y + 4); this.drawIcon(this._av.subMan1IconIndex(), this.valueX(), y); this.drawText( this._av.subMan1Name(), this.valueX() + this.iconWidth(), y, 300 ); }; Window_Av.prototype.drawSubActor2 = function (y) { this.drawSpriteLabel(63 * 3, y + 4); this.drawIcon(this._av.subMan2IconIndex(), this.valueX(), y); this.drawText( this._av.subMan2Name(), this.valueX() + this.iconWidth(), y, 300 ); }; Window_Av.prototype.iconWidth = function () { return 40; }; Window_Av.prototype.drawSpriteLabel = function (sy, y) { var rect = new Rectangle(0, sy, 120, 40); if (ConfigManager.language == "en") { rect.x += 120; rect.width += 30; } var s = this.getSprite(rect.x, rect.y, rect.width, rect.height); s.x = this.titleX(); s.y = y + 8; this._windowContentsSprite.addChild(s); }; Window_Av.prototype.titleX = function () { return 120; }; Window_Av.prototype.contentsX = function () { return 290; }; Window_Av.prototype.valueX = function () { return this.contentsX() + 4; }; Window_Av.prototype.getSprite = function (x, y, w, h) { var baseTexture = Nore.getSystemBaseTexture("av"); var r = new Rectangle(x, y, w, h); var texture = new PIXI.Texture(baseTexture, r); var s = new PIXI.Sprite(texture); return s; }; Window_Av.prototype.hininIndex = function () { return -1; }; Window_Av.prototype.autoIndex = function () { return -1; }; Window_Av.prototype.okIndex = function () { return 3; }; Window_Av.prototype.cancelIndex = function () { return 4; }; Window_Av.prototype.drawButton = function () { var rect3 = this.itemRect(this.okIndex()); this.changePaintOpacity(this._av.isEnabled()); this.drawText("OK", rect3.x, rect3.y, rect3.width, "center"); this.changePaintOpacity(true); var rect4 = this.itemRect(this.cancelIndex()); this.drawText("Cancel", rect4.x, rect4.y, rect3.width, "center"); }; Window_Av.prototype.isCurrentItemEnabled = function () { if (this.index() == 0) { if (this._av.isMainManFixed()) { return false; } } if (this.index() == this.okIndex()) { return this._av.isEnabled(); } return true; }; Window_Av.prototype.selectedActor = function () { var actorId = this.selectedActorId(); if (actorId > 0) { return $gameActors.actor(actorId); } return null; }; Window_Av.prototype.selectedActorId = function () { switch (this.index()) { case 0: return this._av.mainManId(); case 1: return this._av.subMan1Id(); case 2: return this._av.subMan2Id(); } return 0; }; Window_Av.prototype.drawDescription = function () { this.changeTextColor(ColorManager.crisisColor()); this.contents.fontSize = 23; var ww = 620; var y1 = 20; var y2 = 64; if (this._av.mainManId() == 0) { this.drawText(TextManager.setMainMan, 50, 50, ww, "center"); } else if (!this._av.isEnabledParam()) { this.drawText(TextManager.setSubMan1, 0, y1, ww, "center"); this.drawText(TextManager.setSubMan2, 0, y2, ww, "center"); } else if (!this._av.isEnabledSkill()) { this.drawText(TextManager.setAvSkill, 0, y1, ww, "center"); } else { if ($slg.avInfo().findBeforeAv(this._av)) { this.changeTextColor(ColorManager.deathColor()); if (this._av.isGeneralAv()) { this.drawText(TextManager.canMakeAv2nd5, 20, y1, ww - 24, "center"); this.drawText(TextManager.canMakeAv2nd4, 20, y2, ww, "center"); } else if (this._av.isSyusan()) { this.drawText(TextManager.canMakeAv2nd3, 20, y1, ww - 24, "center"); this.drawText(TextManager.canMakeAv2nd4, 20, y2, ww, "center"); } else { this.drawText(TextManager.canMakeAv2nd, 0, y1, ww, "center"); //this.drawText(TextManager.canMakeAv2nd2, 0, y2, ww, 'center'); } } else { this.drawText(TextManager.canMakeAv, 0, y1, ww, "center"); } } }; Window_Av.prototype.drawTachie = function () { var actor = this._av.actor(); var x = -40 + this.getTachieOffsetX(actor.actorId()); var y = 200 + this.getTachieOffsetY(actor.actorId()); var rect = new Rectangle(20, 120, 380, 600); this.drawTachieActor( actor, this._actorLayer, x, y, rect, actor._defaultFaceId, 0.8 ); }; Window_Av.prototype.getTachieOffsetY = function (actorId) { switch (actorId) { case 8: return -50; case 10: return -60; case 11: return -60; case 13: return -20; case 17: return -50; } return 0; }; Window_Av.prototype.getTachieOffsetX = function (actorId) { switch (actorId) { case 4: return 0; case 8: return 20; } return 0; }; Window_Av.prototype.faceId = function () { switch (this._av.actorId()) { case 8: return 1; case 10: return 1; case 11: return 2; case 17: return 8; default: return 4; } }; Window_Av.prototype.itemHeight = function () { return 45; }; return Window_Av; })(Window_Selectable); var Window_AvParam = /** @class */ (function (_super) { __extends(Window_AvParam, _super); function Window_AvParam(av) { var _this = this; var r = new Rectangle(RIGHT_WINDOW_X, 35, 500, 346); _this = _super.call(this, r) || this; _this._av = av; _this.refresh(); return _this; } Window_AvParam.prototype.refresh = function () { _super.prototype.refresh.call(this); this.drawParams(); this.drawSkills(); }; Window_AvParam.prototype.titleX = function () { return 27; }; Window_AvParam.prototype.drawParams = function () { this.changePaintOpacity(true); this.drawSpriteLabel(237, 25); var yy = 52; var list = this._av.avParamList(); for (var i = 0; i < list.length; i++) { var avParam = list[i]; this.drawParamTitle(avParam, yy); this.drawParamValue(avParam, yy); this.drawParamGauge(216, yy, avParam); yy += this.lineHeight(); } }; Window_AvParam.prototype.drawParamTitle = function (avParam, y) { var iconX = 20; var iconY = 2; var xx = 64 - 5; this.changeTextColor(ColorManager.normalColor()); this.contents.fontSize = 18; this.drawIcon(avParam.iconIndex(), iconX, y + iconY); this.drawText(avParam.name(), xx, y, 59); }; Window_AvParam.prototype.drawParamValue = function (avParam, yy) { var valueX = 84; var param = avParam.woman(); if (param + avParam.plus() < avParam.value()) { this.contents.textColor = ColorManager.textColor(7); } else { this.contents.textColor = ColorManager.normalColor(); } this.drawText(param + avParam.plus(), valueX - 12, yy, 80, "right"); this.contents.textColor = ColorManager.normalColor(); this.drawText("/", valueX, yy, 80, "right"); this.drawText(avParam.value(), valueX + 40, yy, 80, "right"); }; Window_AvParam.prototype.lineHeight = function () { return 38; }; Window_AvParam.prototype.drawParamGauge = function (x, y, avParam) { var param = avParam.woman(); var requiredValue = avParam.value(); var plus = avParam.plus(); y += 10; var hh = 17; var rate = 2; var m = 1; var boxWidth = Math.max(param + plus, requiredValue); var maxBox = 90; if (boxWidth >= maxBox) { boxWidth = maxBox; } if (param >= maxBox) { param = maxBox; } this.contents.fillRect( x - m * 2, y - m * 2, boxWidth * rate + m * 4, hh + m * 4, "#FFFFFF" ); this.contents.fillRect( x - m * 1, y - m * 1, boxWidth * rate + m * 2, hh + m * 2, "#000000" ); this.contents.gradientFillRect( x, y, param * rate, hh, "#29f19c", "#02a1f9" ); if (param < maxBox) { if (param + plus > maxBox) { plus = maxBox - param; this.contents.gradientFillRect( x + param * rate, y, plus * rate, hh, "#ffff39", "#ffff39" ); } else { this.contents.gradientFillRect( x + param * rate, y, plus * rate, hh, "#ff8939", "#ffd25e" ); } } if (param + plus >= requiredValue) { this.contents.fillRect( x + requiredValue * rate, y - m * 4, 2, hh + m * 8, "#DD0000" ); } var remain = requiredValue - plus - param; this.contents.fontSize = 14; if (remain > 0) { this.changeTextColor(ColorManager.normalColor()); this.drawText( TextManager.paramRemain.format(remain), x + requiredValue * rate + 10, y - 6, 100 ); } else { this.changeTextColor(ColorManager.crisisColor()); var xx = param + plus; if (xx >= maxBox) { xx = maxBox; } this.drawText("OK +" + -remain, x + xx * rate + 10, y - 6, 100); } }; Window_AvParam.prototype.drawSkills = function () { this.contents.fontSize = 18; this.drawRequiredSkills(); this.drawEffectiveSkills(); }; Window_AvParam.prototype.drawRequiredSkills = function () { this.drawSpriteLabel(239 + 30, 190); var allSkills = this._av.allSkills(); this.changePaintOpacity(true); this.changeTextColor(ColorManager.normalColor()); var yy = 210; var xx = 70; for (var _i = 0, _a = this._av.requiredSkills(); _i < _a.length; _i++) { var skill = _a[_i]; if (allSkills.contains(skill)) { this.changePaintOpacity(true); } else { this.changePaintOpacity(false); } this.drawText(this.skillName(skill), xx, yy, 200); xx += 120; } }; Window_AvParam.prototype.drawSpriteLabel = function (sy, y) { var rect = new Rectangle(0, sy, 300, 32); if (ConfigManager.language == "en") { rect.y += 102; } var s = this.getSprite(rect.x, rect.y, rect.width, rect.height); s.x = this.titleX(); s.y = y; this._windowContentsSprite.addChild(s); }; Window_AvParam.prototype.getSprite = function (x, y, w, h) { var baseTexture = Nore.getSystemBaseTexture("av"); var r = new Rectangle(x, y, w, h); var texture = new PIXI.Texture(baseTexture, r); var s = new PIXI.Sprite(texture); return s; }; Window_AvParam.prototype.drawEffectiveSkills = function () { this.drawSpriteLabel(239 + 30 + 32, 258); var allSkills = this._av.allSkills(); var xx = 70; var yy = 276; this.changeTextColor(ColorManager.systemColor()); this.changePaintOpacity(true); this.changeTextColor(ColorManager.normalColor()); for (var _i = 0, _a = this._av.effectiveSkills(); _i < _a.length; _i++) { var skill = _a[_i]; if (allSkills.contains(skill)) { this.changePaintOpacity(true); } else { this.changePaintOpacity(false); } this.drawText(this.skillName(skill), xx, yy, 130); xx += 140; } var bonus = this._av.skillBonusRate(); if (bonus > 0) { this.changeTextColor(ColorManager.textColor(14)); this.changePaintOpacity(true); this.drawText(TextManager.avReward + " +" + bonus + "%", xx, yy, 200); } }; Window_AvParam.prototype.skillName = function (skill) { if (ConfigManager.language == "en") { var nameEn = skill.meta["nameEn"]; if (nameEn) { return nameEn; } } return skill.name; }; return Window_AvParam; })(Window_Selectable); var Window_AvMan = /** @class */ (function (_super) { __extends(Window_AvMan, _super); function Window_AvMan(av, avWindow) { var _this = this; var r = new Rectangle(RIGHT_WINDOW_X, 390, 280, 380); _this = _super.call(this, r) || this; _this._av = av; _this._avWindow = avWindow; _this.makeData(); _this.refresh(); return _this; } Window_AvMan.prototype.makeData = function () { this._itemList = $slg.manList(); if (this._av.isMainManFixed()) { var mainFixedMan = $gameActors.actor(this._av.mainManId()); var index = this._itemList.indexOf(mainFixedMan); if (index >= 0) { this._itemList.splice(index, 1); } } if (this._av.mainManId() > 0 && this._avWindow.index() == 0) { var main = $gameActors.actor(this._av.mainManId()); var index = this._itemList.indexOf(main); if (index >= 0) { this._itemList.splice(index, 1); } } if (this._av.subMan1Id() > 0 && this._avWindow.index() == 1) { var main = $gameActors.actor(this._av.subMan1Id()); var index = this._itemList.indexOf(main); if (index >= 0) { this._itemList.splice(index, 1); } } if (this._av.subMan2Id() > 0 && this._avWindow.index() == 2) { var main = $gameActors.actor(this._av.subMan2Id()); var index = this._itemList.indexOf(main); if (index >= 0) { this._itemList.splice(index, 1); } } this._itemList.push(null); }; Window_AvMan.prototype.maxItems = function () { if (!this._itemList) { return 0; } return this._itemList.length; }; Window_AvMan.prototype.selectedActor = function () { return this._itemList[this.index()]; }; Window_AvMan.prototype.drawItem = function (index) { var actor = this._itemList[index]; if (!actor) { return null; } if (this._av.containsMan(actor.actorId())) { this.changePaintOpacity(false); } else { this.changePaintOpacity(true); } this.contents.fontSize = 22; var rect = this.itemRect(index); this.drawIcon(actor.iconIndex(), rect.x + 20, rect.y); this.drawText(actor.name(), rect.x + 30 + 30, rect.y, rect.width); this.changePaintOpacity(true); }; return Window_AvMan; })(Window_Selectable); var Window_AvManParams = /** @class */ (function (_super) { __extends(Window_AvManParams, _super); function Window_AvManParams(av, height) { if (height === void 0) { height = 380; } var _this = this; var r = new Rectangle(984, 390, 270, height); _this = _super.call(this, r) || this; _this._av = av; _this.refresh(); return _this; } Window_AvManParams.prototype.setMan = function (actor) { this._actor = actor; this.refresh(); }; Window_AvManParams.prototype.refresh = function () { this._windowContentsSprite.removeChildren(); this.contents.clear(); this.contents.fontSize = 20; var list = Nore.$avParamManager.list(); for (var i = 0; i < list.length; i++) { this.drawItem(i, list[i]); } this.drawSkills(); }; Window_AvManParams.prototype.drawItem = function (index, info) { this.changePaintOpacity(this._av.isMatchParam(info.type())); this.changeTextColor(ColorManager.normalColor()); var yy = index * this.lineHeight() + 12; var left = 48; this.drawIcon(info.iconIndex(), left, yy); this.drawText(info.name(), left + 42, yy, 100); if (!this._actor) { return; } this.drawText(this._actor.eroParam(info.type()), 102, yy, 100, "right"); }; Window_AvManParams.prototype.getSprite = function (x, y, w, h) { var baseTexture = Nore.getSystemBaseTexture("av"); var r = new Rectangle(x, y, w, h); var texture = new PIXI.Texture(baseTexture, r); var s = new PIXI.Sprite(texture); return s; }; Window_AvManParams.prototype.drawSkills = function () { this.changeTextColor(ColorManager.systemColor()); this.changePaintOpacity(true); var yyy = this.lineHeight() * 6 + 2; this.contents.fontSize = 20; var s = this.getSprite(0, 430, 200, 50); s.x = 22; s.y = 258; this._windowContentsSprite.addChild(s); this.contents.fillRect(10, 238, 218, 2, "#9091a4"); if (!this._actor) { return; } this.changeTextColor(ColorManager.normalColor()); var yy = this.lineHeight() * 7 - 6; var skills = this._actor.manSkillList(); for (var i = 0; i < skills.length; i++) { var skill = skills[i]; if ( this._av.isRequiredSkill(skill) || this._av.isEffectiveSkill(skill) ) { this.changePaintOpacity(true); } else { this.changePaintOpacity(false); } this.drawText(this.skillName(skill), 92, yy, 130); yy += this.lineHeight() - 5; } }; Window_AvManParams.prototype.skillName = function (skill) { if (ConfigManager.language == "en") { var nameEn = skill.meta["nameEn"]; if (nameEn) { return nameEn; } } return skill.name; }; return Window_AvManParams; })(Window_Base); Nore.Window_AvManParams = Window_AvManParams; })(Nore || (Nore = {}));