dead-bunny/js/plugins/Nore_Av.js
2025-01-12 01:21:39 -06:00

1296 lines
33 KiB
JavaScript

/*:ja
* @target MZ
* @author ル
*
* @command makeAv
* @text AVを作成
* @des AVを作成
* @arg actorId
* @type number
* @text actorId
* @desc actorId
* @arg itemId
* @type number
* @text itemId
* @desc itemId
*
* @command recordAv
* @text AVのコモンイベント実行
* @des AVのコモンイベント実行
*
* @command mainActorVar55
* @text 変数55にメイン男優IDを入れる
*
*/
var Nore;
(function (Nore) {
var pluginName = "Nore_Av";
PluginManager.registerCommand(pluginName, "makeAv", function (args) {
$gameAvJacketList.clear();
var actorId = parseInt(args.actorId);
var itemId = parseInt(args.itemId);
var av = new Av(actorId, itemId);
av.make(99);
$gameTemp.av = av;
$gameParty.setMenuActorId(actorId);
var avInfo = $slg.avInfo();
avInfo.addAv(av);
});
PluginManager.registerCommand(pluginName, "recordAv", function (args) {
var avItemId = $gameVariables.value(24);
var item = $dataItems[avItemId];
if (!item) {
console.error("Avアイテムが存在しません:" + avItemId);
return;
}
var commonEventId = parseInt(item.meta["common"]);
var actorId = parseInt(item.meta["actorId"]);
if (isNaN(commonEventId)) {
console.error("コモンイベントが存在しません:" + avItemId);
return;
}
p("recordAv commonEvent:" + commonEventId);
$gameTemp.inRecordAv = true;
//$gameTemp.reserveCommonEvent(commonEventId);
//$gameMap._interpreter.setupReservedCommonEvent()
var commonEvent = $dataCommonEvents[commonEventId];
$gameSwitches.setValue(18, true);
$gameMap._interpreter.setupChild(commonEvent.list, 0);
});
PluginManager.registerCommand(pluginName, "mainActorVar55", function (args) {
if (!$gameTemp.av) {
console.error("Avが存在しません");
return;
}
$gameVariables.setValue(55, $gameTemp.av.mainManId());
});
var AvParamInfo = /** @class */ (function () {
function AvParamInfo(_type, _iconIndex) {
this._type = _type;
this._iconIndex = _iconIndex;
}
AvParamInfo.prototype.type = function () {
return this._type;
};
AvParamInfo.prototype.iconIndex = function () {
return this._iconIndex;
};
AvParamInfo.prototype.name = function () {
return getAvParamType(this._type);
};
return AvParamInfo;
})();
Nore.AvParamInfo = AvParamInfo;
var AvParamManager = /** @class */ (function () {
function AvParamManager() {
this._paramArray = [];
this._paramArray.push(new AvParamInfo(AvRequired.kiss, Icon.kiss));
this._paramArray.push(new AvParamInfo(AvRequired.chichi, Icon.chichi));
this._paramArray.push(new AvParamInfo(AvRequired.cri, Icon.cri));
this._paramArray.push(new AvParamInfo(AvRequired.manko, Icon.manko));
this._paramArray.push(new AvParamInfo(AvRequired.anal, Icon.anal));
this._paramArray.push(new AvParamInfo(AvRequired.sm, Icon.sm));
}
AvParamManager.prototype.findIconIndex = function (type) {
for (var _i = 0, _a = this._paramArray; _i < _a.length; _i++) {
var data = _a[_i];
if (data.type() == type) {
return data.iconIndex();
}
}
return 1;
};
AvParamManager.prototype.list = function () {
return this._paramArray.concat();
};
return AvParamManager;
})();
Nore.$avParamManager = new AvParamManager();
})(Nore || (Nore = {}));
var SHOTA_SW = 254;
var AvInfo = /** @class */ (function () {
function AvInfo() {
this._resultEvent = [];
this._avList = [];
}
AvInfo.prototype.allList = function () {
return this._avList;
};
AvInfo.prototype.pushResultAv = function (avId, id) {
this._resultEvent.push(avId);
//$gameSwitches.setValue(7, true);
$gameVariables.setValue(8, this.findAv(avId).reward());
$gameParty.addCommonEvent(211, id);
};
AvInfo.prototype.nextResultAv = function () {
if (this._resultEvent.length == 0) {
return null;
}
var avId = this._resultEvent.shift();
return this.findAv(avId);
};
AvInfo.prototype.addAv = function (av) {
this._avList.push(av);
};
AvInfo.prototype.avReward = function () {
var n = 0;
for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
var av = _a[_i];
n += av.reward();
}
return n;
};
AvInfo.prototype.onReward = function () {
for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
var av = _a[_i];
av.onReward(av.reward());
}
};
AvInfo.prototype.makeAvList = function (actor) {
switch (actor.actorId()) {
case 8:
return this.makeActor8AvList();
case 9:
return this.makeActor9AvList();
}
return [];
};
AvInfo.prototype.makeActor8AvList = function () {
var result = [];
if (!this.hasAv(101)) {
result.push(new Av(8, 101));
} else {
if (!this.hasAv(102) && !this.hasAv(103)) {
result.push(new Av(8, 102));
result.push(new Av(8, 103));
}
}
return result;
};
AvInfo.prototype.makeActor9AvList = function () {
var result = [];
if (!this.hasAv(121)) {
result.push(new Av(9, 121));
return result;
}
if (!this.hasAv(122)) {
result.push(new Av(9, 122));
}
var actor = $gameActors.actor(9);
if (actor.boteId >= 1) {
result.push(new Av(9, 124));
}
return result;
};
AvInfo.prototype.hasAv = function (itemId) {
for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
var av = _a[_i];
if (av.itemId() == itemId) {
return true;
}
}
return false;
};
AvInfo.prototype.currentAvList = function () {
return this._avList;
};
AvInfo.prototype.totalAvCount = function () {
return this._avList.length;
};
AvInfo.prototype.actorAvList = function (actorId) {
var result = [];
for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
var av = _a[_i];
if (av.actorId() == actorId) {
result.push(av);
}
if (actorId == 8) {
if (av.actorId() == 5) {
// センリとレンのイベント
result.push(av);
}
}
}
return result;
};
AvInfo.prototype.actorLastShowResultAv = function (actorId) {
for (var i = 0; i < this._avList.length; i++) {
var index = this._avList.length - i - 1;
var av = this._avList[index];
if (av.actorId() == actorId) {
if (av.isShowResult()) {
return av;
}
}
}
return null;
};
AvInfo.prototype.actorLastAv = function (actorId) {
for (var i = 0; i < this._avList.length; i++) {
var index = this._avList.length - i - 1;
var av = this._avList[index];
if (av.actorId() == actorId) {
return av;
}
}
return null;
};
AvInfo.prototype.actorAvCount = function (actorId) {
var result = 0;
for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
var av = _a[_i];
if (av.actorId() == actorId) {
result++;
}
}
return result;
};
AvInfo.prototype.findAv = function (avId) {
for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
var av = _a[_i];
if (av.id() == avId) {
return av;
}
}
console.error("IDが" + avId + "のAVが見つかりません");
return null;
};
AvInfo.prototype.findAvByItemId = function (itemId) {
for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
var av = _a[_i];
if (av.itemId() == itemId) {
return av;
}
}
console.error("item IDが" + itemId + "のAVが見つかりません");
return null;
};
AvInfo.prototype.countAv = function (itemId) {
var n = 0;
for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
var av = _a[_i];
if (av.itemId() == itemId) {
n++;
}
}
return n;
};
AvInfo.prototype.lastAv = function (itemId) {
var n = 0;
for (var i = 0; i < this._avList.length; i++) {
var av = this._avList[this._avList.length - 1 - i];
if (av.itemId() == itemId) {
return av;
}
}
return null;
};
AvInfo.prototype.noPhotoTexture = function () {
return PIXI.utils.TextureCache["no_photo" + ".png"];
};
AvInfo.prototype.findBeforeAv = function (av) {
for (var i = 0; i < this._avList.length; i++) {
var a = this._avList[this._avList.length - 1 - i];
if (av.itemId() == a.itemId()) {
if (av != a) {
return a;
}
}
}
return null;
};
AvInfo.prototype.finishedAvCount = function () {
var n = 0;
for (var _i = 0, _a = this._avList; _i < _a.length; _i++) {
var av = _a[_i];
if (av.isDone()) {
n++;
}
}
return n;
};
return AvInfo;
})();
var Av = /** @class */ (function () {
function Av(actorId, itemId) {
this._elapsedCount = 0;
this._totalReward = 0;
this._review = new AvReview();
this._screenShotList = [];
this._id = $slg.nextAvId();
this._actorId = actorId;
this._itemId = itemId;
this._mainManId = this.eroParam().mainMan;
this._nakadashi = this.eroParam().nakadashi;
this._anal = this.eroParam().anal;
this._fela = this.eroParam().fela;
this._subMan1Id = 0;
this._subMan2Id = 0;
this._imageIndex = 1;
this._showResult = false;
this._avCount = $slg.avInfo().countAv(this._itemId) + 1;
}
Av.prototype.id = function () {
return this._id;
};
Av.prototype.avCount = function () {
return this._avCount;
};
Av.prototype.avCountTotal = function () {
var list = $slg.avInfo().actorAvList(this._actorId);
return list.indexOf(this) + 1;
};
Av.prototype.make = function (beforeAvDay) {
this.calcFan(beforeAvDay);
this.makeReview();
this.calcSales();
this.calcPlusFan();
this.calcReward();
};
Av.prototype.reviewList = function () {
return this._review.reviewList();
};
Av.prototype.calcFan = function (beforeAvDay) {
var fan = $slg.fan();
fan *= this.fanRepeatRate();
this._fan = Math.round(fan);
};
Av.prototype.calcPlusFan = function () {
var firstFan = 100 + Math.randomInt(260);
this._plusFan = Math.round(
firstFan * this.newFanRate() * this.facilityFanBonus()
);
};
Av.prototype.plusFan = function () {
return this._plusFan;
};
Av.prototype.newFanRate = function () {
switch (this.popularityLevel()) {
case 0:
return 0.09;
case 1:
return 0.1;
case 2:
return 0.12;
case 3:
return 0.14;
case 4:
return 0.16;
case 5:
return 0.21;
case 6:
return 0.25;
default:
return 0.3;
}
};
Av.prototype.facilityFanBonus = function () {
if ($slg.facilityInfo().hasFacility(62)) {
return 1.1;
}
return 1;
};
Av.prototype.popularityLevel = function () {
var avCount = Math.floor($slg.avInfo().totalAvCount() / 3);
return avCount;
};
Av.prototype.fanRepeatRate = function () {
return 0.8;
};
Av.prototype.fan = function () {
return this._fan;
};
Av.prototype.sales = function () {
return this._sales;
};
Av.prototype.realSales = function () {
return this._sales * 20 + this.salesOnesPlace();
};
Av.prototype.makeReview = function () {
this._review = new AvReview();
this._review.makeReview(this);
};
Av.prototype.hpCost = function () {
var hp = this.item().meta["hp"];
if (isNaN(hp)) {
console.error("AVにHPが見つかりません");
return 10;
}
hp *= this.hpDebuff();
if (hp >= 9999) {
hp = 9999;
}
if (this.isSyusan() && $slg.facilityInfo().hasFacility(69)) {
hp = Math.floor(hp / 3);
} else if (this.isSyusan() && $slg.facilityInfo().hasFacility(68)) {
hp = Math.floor((hp / 3) * 2);
}
return hp;
};
Av.prototype.hpDebuff = function () {
return 1;
/*const count = $slg.avInfo().countAv(this.itemId());
switch (count) {
case 0: return 1;
case 1: return 1.5;
default: return 2;
}*/
};
Av.prototype.setUpEroInfo = function (upEroInfo) {
this._upEroInfo = upEroInfo;
};
Av.prototype.upEroInfo = function () {
return this._upEroInfo;
};
Av.prototype.calcReward = function () {
var base = this.rewardBase();
var bonus = 1;
if ($gameSwitches.value(SHOTA_SW)) {
bonus = 1.05;
}
this._reward = Math.round(((base * this.sales()) / 100) * bonus);
p("reward:" + this._reward);
$gameVariables.setValue(8, this._reward);
};
Av.prototype.rewardBase = function () {
return 26;
};
Av.prototype.gainReward = function () {
$gameParty.gainGold(this._reward);
};
Av.prototype.calcSales = function () {
var base = 500;
var rate = this.calcPopularityRate(this.popularityLevel());
var paramRate = this.paramRate();
var difficultyRate = this.difficultyRate();
var countDebuff = this.countDebuff();
this._salesParamRate = paramRate;
this._salesPopuRate = rate;
this._salesDifficultyRate = difficultyRate;
this._countDebuff = countDebuff;
var skillBonusRate = this.skillBonusRate();
p(
"popuRate:" +
rate +
" paramRate:" +
paramRate +
" difficultyRate:" +
difficultyRate +
" countDebuff:" +
countDebuff +
" skillBonusRate:" +
skillBonusRate
);
this._sales = Math.round(
base * rate * paramRate * difficultyRate * countDebuff + this._fan / 2.5
);
p("sales:" + this._sales);
};
Av.prototype.countDebuff = function () {
if (!this.isSyusan()) {
return 1;
}
var count = $slg.avInfo().countAv(this.itemId());
switch (count) {
case 0:
return 1;
case 1:
return 0.5;
default:
return 0.3;
}
};
Av.prototype.difficultyRate = function () {
var list = this.avParamList();
var qualify = 0;
for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
var param = list_1[_i];
qualify += param.value();
}
qualify /= list.length;
if (qualify <= 30) {
return 0.5;
}
if (qualify <= 40) {
return 0.6;
}
if (qualify <= 50) {
return 0.7;
}
if (qualify <= 60) {
return 0.8;
}
if (qualify <= 70) {
return 0.9;
}
if (qualify <= 80) {
return 1;
}
if (qualify <= 90) {
return 1.1;
}
if (qualify <= 100) {
return 1.2;
}
if (qualify <= 110) {
return 1.3;
}
return 1.4;
};
Av.prototype.paramRate = function () {
var list = this.avParamList();
var qualify = 0;
var value = 0;
for (var _i = 0, list_2 = list; _i < list_2.length; _i++) {
var param = list_2[_i];
qualify += param.value();
value += param.total();
}
return (value / qualify - 1) / 3 + 1;
};
Av.prototype.calcPopularityRate = function (level) {
switch (level) {
case 0:
return 1;
case 1:
return 1.1;
case 2:
return 1.2;
case 3:
return 1.4;
case 4:
return 1.6;
case 5:
return 1.9;
case 6:
return 2.2;
case 7:
return 2.6;
case 8:
return 3.0;
case 9:
return 3.5;
case 10:
return 4.0;
}
return 4;
};
Av.prototype.actorId = function () {
return this._actorId;
};
Av.prototype.actor = function () {
return $gameActors.actor(this.actorId());
};
Av.prototype.reward = function () {
return Math.round(
((this._reward * this.currentRewardRate()) / 100) * $slg.avRewardRate()
);
};
Av.prototype.currentRewardRate = function () {
return this.rewardRate(this._elapsedCount);
};
Av.prototype.isDone = function () {
return this._done;
};
Av.prototype.cost = function () {
return 0;
};
Av.prototype.energyCost = function () {
return this.item().price;
};
Av.prototype.isShowMan = function () {
return this.item().meta["showMan"] != null;
};
Av.prototype.item = function () {
return $dataItems[this._itemId];
};
Av.prototype.onReward = function (n) {
this._totalReward += n;
this._elapsedCount++;
};
Av.prototype.name = function () {
switch (ConfigManager.language) {
case "en":
if (this.item().meta["nameEn"]) {
return this.item().meta["nameEn"];
}
break;
case "ch":
case "jp":
break;
}
if (this._avCount > 1) {
return TextManager.avCount.format(this.item().name, this._avCount);
}
return this.item().name;
};
Av.prototype.jacketTitle = function () {
if (this._avJacket) {
return this._avJacket.title();
}
return this.name();
};
Av.prototype.jacketSubTitle = function () {
if (this._avJacket) {
return this._avJacket.subTitle();
}
return "";
};
Av.prototype.itemId = function () {
return this._itemId;
};
Av.prototype.rewardRate = function (elapsedDay) {
switch (elapsedDay) {
case 0:
return 100;
}
var rate = 100 - elapsedDay * 4 - 20;
if (rate < 0) {
return 0;
}
return rate;
};
Av.prototype.totalReward = function () {
return this._totalReward;
};
Av.prototype.param = function (requiredType) {
var n = 0;
switch (requiredType) {
case AvRequired.manko:
n = this.chitsuParam();
break;
case AvRequired.chichi:
n = this.chichiParam();
break;
case AvRequired.cri:
n = this.criParam();
break;
case AvRequired.anal:
n = this.analParam();
break;
case AvRequired.kiss:
n = this.kissParam();
break;
case AvRequired.sm:
n = this.smParam();
break;
}
return Math.floor(n / 10);
};
Av.prototype.chitsuParam = function () {
var actor = this.actor();
return actor.eroParam(AvRequired.manko);
};
Av.prototype.analParam = function () {
var actor = this.actor();
return actor.eroParam(AvRequired.anal);
};
Av.prototype.chichiParam = function () {
var actor = this.actor();
return actor.eroParam(AvRequired.chichi);
};
Av.prototype.criParam = function () {
var actor = this.actor();
return actor.eroParam(AvRequired.cri);
};
Av.prototype.kissParam = function () {
var actor = this.actor();
return actor.eroParam(AvRequired.kiss);
};
Av.prototype.smParam = function () {
var actor = this.actor();
return actor.eroParam(AvRequired.sm);
};
Av.prototype.requiredSkills = function () {
var list = [];
if ($gameSystem.difficulty() == Difficulty.easy) {
return list;
}
var eroParam = this.eroParam();
this.addSkill(list, this.findSkill(eroParam.skill1));
this.addSkill(list, this.findSkill(eroParam.skill2));
this.addSkill(list, this.findSkill(eroParam.skill3));
return list;
};
Av.prototype.effectiveSkills = function () {
var list = [];
var eroParam = this.eroParam();
this.addSkill(list, this.findSkill(eroParam.skill4));
this.addSkill(list, this.findSkill(eroParam.skill5));
this.addSkill(list, this.findSkill(eroParam.skill6));
return list;
};
Av.prototype.addSkill = function (list, item) {
if (item) {
list.push(item);
}
};
Av.prototype.findSkill = function (name) {
if (name == "") {
return null;
}
for (var i = 11; i < 40; i++) {
var item = $dataSkills[i];
if (item.name == name) {
return item;
}
}
console.error(name + "が見つかりません");
return null;
};
Av.prototype.requiredManko = function () {
var param = this.eroParam();
if (param.av1 == AvRequired.manko) {
return param.av1_param;
}
if (param.av2 == AvRequired.manko) {
return param.av2_param;
}
if (param.av3 == AvRequired.manko) {
return param.av3_param;
}
return 0;
};
Av.prototype.requiredCri = function () {
var param = this.eroParam();
if (param.av1 == AvRequired.cri) {
return param.av1_param;
}
if (param.av2 == AvRequired.cri) {
return param.av2_param;
}
if (param.av3 == AvRequired.cri) {
return param.av3_param;
}
return 0;
};
Av.prototype.eroParam = function () {
var key = this._actorId + "_" + this._itemId;
var param = ERO_PARAMS[key];
if (!param) {
console.error("key " + key + " のエロパラメーターが見つかりません");
}
return param;
};
Av.prototype.containsType = function (type) {
if (this.av1() == type) {
return true;
}
if (this.av2() == type) {
return true;
}
if (this.av3() == type) {
return true;
}
return false;
};
Av.prototype.avParamList = function () {
var result = [];
var param = this.eroParam();
var rate = this.avParamRate() * $gameSystem.difficultyAvParamRate();
if (param.av1_param > 0) {
var av1 = this.av1();
result.push(
new AvParam(
av1,
param.av1_param,
this.param(av1),
this.countManParam(av1),
rate
)
);
}
if (param.av2_param > 0) {
var av2 = this.av2();
result.push(
new AvParam(
av2,
param.av2_param,
this.param(av2),
this.countManParam(av2),
rate
)
);
}
if (param.av3_param > 0) {
var av3 = this.av3();
result.push(
new AvParam(
av3,
param.av3_param,
this.param(av3),
this.countManParam(av3),
rate
)
);
}
result = result.sort(function (a, b) {
return a.sortType() - b.sortType();
});
return result;
};
Av.prototype.avParamRate = function () {
if (this.isSyusan()) {
return 1;
}
if (this.isGeneralAv()) {
return 1;
}
switch (this.avCount()) {
case 1:
return 1;
case 2:
return 1.2;
}
return 1.2;
};
Av.prototype.isGeneralAv = function () {
switch (this._itemId) {
case 153:
case 186:
case 288:
case 319:
return true;
}
return false;
};
Av.prototype.av1 = function () {
var param = this.eroParam();
return this.toAvRequired(param.av1);
};
Av.prototype.av2 = function () {
var param = this.eroParam();
return this.toAvRequired(param.av2);
};
Av.prototype.av3 = function () {
var param = this.eroParam();
return this.toAvRequired(param.av3);
};
Av.prototype.toAvRequired = function (required) {
switch (required) {
case AvRequired.manko:
return AvRequired.manko;
case AvRequired.chichi:
return AvRequired.chichi;
case AvRequired.cri:
return AvRequired.cri;
case AvRequired.anal:
return AvRequired.anal;
case AvRequired.kiss:
return AvRequired.kiss;
case AvRequired.sm:
return AvRequired.sm;
}
};
Av.prototype.mainMan = function () {
if (this.mainManId()) {
return $gameActors.actor(this.mainManId());
}
return null;
};
Av.prototype.subMan1 = function () {
if (this.subMan1Id()) {
return $gameActors.actor(this.subMan1Id());
}
return null;
};
Av.prototype.subMan2 = function () {
if (this.subMan2Id()) {
return $gameActors.actor(this.subMan2Id());
}
return null;
};
Av.prototype.mainManId = function () {
return this._mainManId;
};
Av.prototype.subMan1Id = function () {
return this._subMan1Id;
};
Av.prototype.subMan2Id = function () {
return this._subMan2Id;
};
Av.prototype.isMainManFixed = function () {
return this.eroParam().mainMan > 0;
};
Av.prototype.mainManName = function () {
var mainManId = this.mainManId();
if (mainManId == 0) {
return "";
}
return $gameActors.actor(mainManId).name();
};
Av.prototype.mainManIconIndex = function () {
var mainManId = this.mainManId();
if (mainManId == 0) {
return -1;
}
return $gameActors.actor(mainManId).iconIndex();
};
Av.prototype.subMan1Name = function () {
if (this._subMan1Id == 0) {
return "";
}
return $gameActors.actor(this._subMan1Id).name();
};
Av.prototype.subMan1IconIndex = function () {
if (this._subMan1Id == 0) {
return -1;
}
return $gameActors.actor(this._subMan1Id).iconIndex();
};
Av.prototype.subMan2Name = function () {
if (this._subMan2Id == 0) {
return "";
}
return $gameActors.actor(this._subMan2Id).name();
};
Av.prototype.subMan2IconIndex = function () {
if (this._subMan2Id == 0) {
return -1;
}
return $gameActors.actor(this._subMan2Id).iconIndex();
};
Av.prototype.setMainMan = function (n) {
this.resetMan(n);
this._mainManId = n;
};
Av.prototype.setSubMan1 = function (n) {
this.resetMan(n);
this._subMan1Id = n;
};
Av.prototype.setSubMan2 = function (n) {
this.resetMan(n);
this._subMan2Id = n;
};
Av.prototype.resetMan = function (n) {
if (this._mainManId == n) {
this._mainManId = 0;
}
if (this._subMan1Id == n) {
this._subMan1Id = 0;
}
if (this._subMan2Id == n) {
this._subMan2Id = 0;
}
};
Av.prototype.countManParam = function (param) {
var n = 0;
if (this._mainManId > 0) {
var mainMan = $gameActors.actor(this._mainManId);
n += mainMan.eroParam(param);
}
if (this._subMan1Id > 0) {
var subMan1 = $gameActors.actor(this._subMan1Id);
n += Math.floor(subMan1.eroParam(param) / 2);
}
if (this._subMan2Id > 0) {
var subMan2 = $gameActors.actor(this._subMan2Id);
n += Math.floor(subMan2.eroParam(param) / 2);
}
return n;
};
Av.prototype.isEnabled = function () {
if (this._mainManId == 0) {
return false;
}
if (!this.isEnabledParam()) {
return false;
}
if (!this.isEnabledSkill()) {
return false;
}
return true;
};
Av.prototype.isEnabledParam = function () {
var list = this.avParamList();
for (var i = 0; i < list.length; i++) {
var avParam = list[i];
var param = this.param(avParam.requiredType());
var requiredValue = avParam.value();
if (param + avParam.plus() < requiredValue) {
return false;
}
}
return true;
};
Av.prototype.isEnabledSkill = function () {
var allSkills = this.allSkills();
var skills = this.requiredSkills();
for (var _i = 0, skills_1 = skills; _i < skills_1.length; _i++) {
var skill = skills_1[_i];
if (!allSkills.contains(skill)) {
return false;
}
}
return true;
};
Av.prototype.isDisplayMode = function () {
return this._itemId == 1;
};
Av.prototype.isMatchParam = function (type) {
if (this.isDisplayMode()) {
return true;
}
var list = this.avParamList();
for (var _i = 0, list_3 = list; _i < list_3.length; _i++) {
var param = list_3[_i];
if (param.requiredType() == type) {
return true;
}
}
return false;
};
Av.prototype.done = function () {
this._done = true;
};
Av.prototype.allSkills = function () {
var result = [];
var main = this.mainMan();
if (main) {
var manParam = MAN_PARAMS[main.actorId()];
this.addSkill(result, this.findSkill(manParam.skill1));
this.addSkill(result, this.findSkill(manParam.skill2));
this.addSkill(result, this.findSkill(manParam.skill3));
}
var sub1 = this.subMan1();
if (sub1) {
var manParam = MAN_PARAMS[sub1.actorId()];
this.addSkill(result, this.findSkill(manParam.skill1));
this.addSkill(result, this.findSkill(manParam.skill2));
this.addSkill(result, this.findSkill(manParam.skill3));
}
var sub2 = this.subMan2();
if (sub2) {
var manParam = MAN_PARAMS[sub2.actorId()];
this.addSkill(result, this.findSkill(manParam.skill1));
this.addSkill(result, this.findSkill(manParam.skill2));
this.addSkill(result, this.findSkill(manParam.skill3));
}
return result;
};
Av.prototype.isRequiredSkill = function (skill) {
if (this.isDisplayMode()) {
return true;
}
return this.requiredSkills().contains(skill);
};
Av.prototype.isEffectiveSkill = function (skill) {
return this.effectiveSkills().contains(skill);
};
Av.prototype.containsMan = function (actorId) {
if (this._mainManId == actorId) {
return true;
}
if (this._subMan1Id == actorId) {
return true;
}
if (this._subMan2Id == actorId) {
return true;
}
return false;
};
Av.prototype.showResult = function () {
this._showResult = true;
};
Av.prototype.isShowResult = function () {
return this._showResult;
};
Av.prototype.screenShot = function () {
if (!this._avJacket) {
return null;
}
return this._avJacket.screenShot();
};
Av.prototype.setAvJacket = function (jacket) {
this._avJacket = jacket;
};
Av.prototype.avJacket = function () {
return this._avJacket;
};
Av.prototype.defaultJacket = function () {
var ss;
if (this.actor().boteId > 0) {
ss = this.item().meta["ssBote"];
if (!ss) {
ss = this.defaultJacketSs();
}
} else {
ss = this.defaultJacketSs();
}
if (!ss) {
console.error(this.itemId() + "のssデータが存在しません");
}
var list = JsonEx.parse(ss);
var result = [];
for (var _i = 0, list_4 = list; _i < list_4.length; _i++) {
var s = list_4[_i];
result.push(s + ".png");
}
return new AvScreenShot(result);
};
Av.prototype.defaultJacketSs = function () {
if ($gameSwitches.value(51)) {
var ss = this.item().meta["ss1"];
if (ss) {
return ss;
}
}
return this.item().meta["ss"];
};
Av.prototype.defaultJacket2 = function () {
var ss;
if (this.actor().boteId > 0) {
ss = this.item().meta["ssBote2"];
if (!ss) {
ss = this.item().meta["ss2"];
}
} else {
ss = this.item().meta["ss2"];
}
if (!ss) {
return null;
}
var list = JsonEx.parse(ss);
var result = [];
for (var _i = 0, list_5 = list; _i < list_5.length; _i++) {
var s = list_5[_i];
result.push(s + ".png");
}
return new AvScreenShot(result);
};
Av.prototype.nakadashi = function () {
return this._nakadashi;
};
Av.prototype.anal = function () {
return this._anal;
};
Av.prototype.isFela = function () {
return this._fela > 0;
};
Av.prototype.isSyusan = function () {
return this.item().meta["syusan"] != null;
};
Av.prototype.auto = function () {
if (!this.isMainManFixed()) {
}
};
Av.prototype.isBote = function () {
var avActor = this._avJacket.avActor();
if (!avActor) {
return false;
}
return avActor.cos().boteId() > 0;
};
Av.prototype.screenShotList = function () {
return this._screenShotList;
};
Av.prototype.setScreenShotList = function (list) {
this._screenShotList = list;
};
Av.prototype.commonEventId = function () {
var commonEventId = parseInt(this.item().meta["common"]);
return commonEventId;
};
Av.prototype.skillBonusRate = function () {
var bonus = 0;
var skills = this.effectiveSkills();
var allSkills = this.allSkills();
for (var _i = 0, skills_2 = skills; _i < skills_2.length; _i++) {
var skill = skills_2[_i];
if (allSkills.contains(skill)) {
bonus += 15;
}
}
return bonus;
};
Av.prototype.salesOnesPlace = function () {
if (this._onesPlace === undefined) {
this._onesPlace = Math.randomInt(10);
}
return this._onesPlace;
};
Av.prototype.isNinshin = function () {};
Av.prototype.canContraception = function () {
if (this.nakadashi() == 0) {
// 避妊の必要なし
return false;
}
return true;
};
Av.prototype.setContraception = function (b) {
this._contraception = b;
};
Av.prototype.isContraception = function () {
return this._contraception;
};
Av.prototype.taii = function () {
var param = this.eroParam();
return param.taii;
};
Av.prototype.finishSale = function () {
this._finishSale = true;
};
Av.prototype.isFinishSale = function () {
return this._finishSale;
};
Av.prototype.isFavorite = function () {
return this._favorite;
};
Av.prototype.setFavorite = function (b) {
this._favorite = b;
};
Av.prototype.setAuto = function () {
this._auto = true;
};
Av.prototype.isAuto = function () {
return this._auto;
};
return Av;
})();
var AvParam = /** @class */ (function () {
function AvParam(required, value, woman, plus, rate) {
this._required = required;
this._value = value;
this._woman = woman;
this._plus = plus;
this._rate = rate;
}
AvParam.prototype.requiredType = function () {
return this._required;
};
AvParam.prototype.value = function () {
return Math.round(this._value * this._rate);
};
AvParam.prototype.woman = function () {
return this._woman;
};
AvParam.prototype.name = function () {
return getAvParamType(this._required);
};
AvParam.prototype.iconIndex = function () {
return Nore.$avParamManager.findIconIndex(this._required);
};
AvParam.prototype.plus = function () {
return this._plus;
};
AvParam.prototype.total = function () {
return this.plus() + this.woman();
};
AvParam.prototype.sortType = function () {
switch (this._required) {
case AvRequired.kiss:
return 0;
case AvRequired.chichi:
return 1;
case AvRequired.cri:
return 2;
case AvRequired.manko:
return 3;
case AvRequired.anal:
return 4;
case AvRequired.sm:
return 5;
}
};
return AvParam;
})();