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

160 lines
4.4 KiB
JavaScript

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 startHanyouMsg
* @text 55番のIDの男との汎用エロを実行
* @arg scenarioId
* @type string
*
*
*/
var Nore;
(function (Nore) {
var pluginName = "Nore_WideUseEro";
PluginManager.registerCommand(pluginName, "startHanyouMsg", function (args) {
var manId = $gameVariables.value(55);
var manParam = MAN_PARAMS[manId];
var scenarioId = args.scenarioId;
{
var manName = $gameActors.actor(manId).nameJp();
var text = scenarioId.format(manName);
var list = $dataScenario[text];
if (list) {
console.log(
"Scenario \u30B3\u30DE\u30F3\u30C9\u5B9F\u884C: ".concat(text)
);
this.setupChild(list, this._eventId);
return;
}
}
{
var text2 = scenarioId.format(manParam.type);
var list2 = $dataScenario[text2];
if (!list2) {
console.error("id:" + text2 + " のデータが見つかりません");
return;
}
console.log(
"Scenario \u30B3\u30DE\u30F3\u30C9\u5B9F\u884C: ".concat(text2)
);
this.setupChild(list2, this._eventId);
}
});
})(Nore || (Nore = {}));
var Sprite_AvMan = /** @class */ (function (_super) {
__extends(Sprite_AvMan, _super);
function Sprite_AvMan(event) {
var _this = _super.call(this, event) || this;
_this.calcAvActor(event);
return _this;
}
Sprite_AvMan.prototype.calcAvActor = function (event) {
this._avVarId = parseInt(event.event().meta["avMan"]);
};
Sprite_AvMan.prototype.updateBitmap = function () {
if (this.isImageChanged()) {
this._tilesetId = $gameMap.tilesetId();
this._tileId = this._character.tileId();
this._characterName = this.characterName();
this._characterIndex = this.characterIndex();
if (this._tileId > 0) {
this.setTileBitmap();
} else {
this.setCharacterBitmap();
}
}
};
Sprite_AvMan.prototype.characterName = function () {
if (this._character.characterName() == "") {
return "";
}
var avVar = $gameVariables.value(this._avVarId);
if (avVar == 0) {
return "";
}
var man = $gameActors.actor(avVar);
if (!man) {
console.error(avVar + "の男が見つかりません");
return "";
}
return man.characterName();
};
Sprite_AvMan.prototype.characterIndex = function () {
var avVar = $gameVariables.value(this._avVarId);
if (avVar == 0) {
return 0;
}
var man = $gameActors.actor(avVar);
if (!man) {
console.error(avVar + "の男が見つかりません");
return 0;
}
return man.characterIndex();
};
Sprite_AvMan.prototype.updatePosition = function () {
this.x = this._character.screenX();
this.y = this._character.screenY();
this.z = this._character.screenZ();
};
Sprite_AvMan.prototype.isImageChanged = function () {
return (
this._characterName !== this.characterName() ||
this._characterIndex !== this.characterIndex()
);
};
Sprite_AvMan.prototype.characterBlockX = function () {
var index = this.characterIndex();
return (index % 4) * 3;
};
Sprite_AvMan.prototype.characterBlockY = function () {
var index = this.characterIndex();
if (this._character.characterIndex() >= 4) {
if (index < 4) {
index += 4;
}
}
return Math.floor(index / 4) * 4;
};
return Sprite_AvMan;
})(Sprite_Character);
function isAvManEvent(event) {
if (!event) {
return false;
}
if (!event.event()) {
return false;
}
return event.event().meta["avMan"] != null;
}