140 lines
5.5 KiB
JavaScript
140 lines
5.5 KiB
JavaScript
const MobLeftPos = 300;
|
|
const MobRightPos = 800;
|
|
class MobTatie {
|
|
constructor(_PicName, _PicNo) {
|
|
this._PicName = _PicName;
|
|
this._PicNo = _PicNo;
|
|
}
|
|
}
|
|
const MobUIPath = "faces/PicTatie/";
|
|
let _MobPosX = MobLeftPos;
|
|
let _MobMX = 100;
|
|
let MobResetFlg = false;
|
|
Game_Interpreter.prototype.SetMobPos = function (_MPosStr, _MMX) {
|
|
_MMX = typeof _MMX !== 'undefined' ? _MMX : 100;
|
|
_MobMX = _MMX;
|
|
if (_MPosStr.indexOf("left") != -1) _MobPosX = MobLeftPos;
|
|
if (_MPosStr.indexOf("right") != -1) _MobPosX = MobRightPos;
|
|
if (_MPosStr.indexOf("ll") != -1) {
|
|
_MobPosX -= 100;
|
|
}
|
|
if (_MPosStr.indexOf("rl") != -1) _MobPosX += 100;
|
|
if (_MPosStr.indexOf("lr") != -1) _MobPosX -= 100;
|
|
if (_MPosStr.indexOf("rr") != -1) _MobPosX += 100;
|
|
}
|
|
const _MaxMobT = 5;
|
|
let Nupu_Setting_command101 = Game_Interpreter.prototype.command101;
|
|
Game_Interpreter.prototype.command101 = function () {
|
|
_Reset_AnalogMove();
|
|
let _MYobiFace = "";
|
|
let Tatie_p = this._params[0].indexOf("_Tatie");
|
|
let _TatieAddNo = 0;
|
|
let _AdNo = this._params[0].indexOf("___");
|
|
if (_AdNo != -1) {
|
|
_TatieAddNo = Number(this._params[0].substr(_AdNo + "___".length));
|
|
}
|
|
if (Tatie_p != -1) {
|
|
if (MobResetFlg) {
|
|
for (let i = 0; i <= _MaxMobT; i++) {
|
|
this.DelPict(PN_MobB + i);
|
|
this.DelPict(PN_MobT + i);
|
|
}
|
|
MobResetFlg = false;
|
|
}
|
|
_MYobiFace = this._params[0];
|
|
let _MobTName = this._params[0].substr(0, Tatie_p);
|
|
let _PicName = _MobTName + ((this._params[1] + 1) + (_TatieAddNo * 8));
|
|
this._params[0] = "";
|
|
let _addTatiePicFlg = true;
|
|
let BtmMNo = -1;
|
|
for (let i = 0; i <= _MaxMobT; i++) {
|
|
let _ViewTName = GetPicName(PN_MobB + i).replace(MobUIPath, "").slice(0, -1);
|
|
if (_ViewTName == _MobTName) {
|
|
BtmMNo = i;
|
|
break;
|
|
}
|
|
}
|
|
let TopMNo = -1;
|
|
for (let i = 0; i <= _MaxMobT; i++) {
|
|
let _ViewTName = GetPicName(PN_MobT + i).replace(MobUIPath, "").slice(0, -1);
|
|
if (_ViewTName == _MobTName) {
|
|
TopMNo = i;
|
|
break;
|
|
}
|
|
}
|
|
if (BtmMNo != -1 || TopMNo != -1) _addTatiePicFlg = false;
|
|
if (_addTatiePicFlg) {
|
|
for (let i = 1; i <= _MaxMobT; i++) {
|
|
if ($gameScreen.picture(PN_MobT + i) != undefined) {
|
|
this.PicNoCng(PN_MobT + i, PN_MobT + i - 1);
|
|
}
|
|
}
|
|
if (_MobPosX < Graphics.width / 2) {
|
|
this.SetPictC(PN_MobT + _MaxMobT, MobUIPath + _PicName, _MobPosX - 30, Graphics.height / 2, 0, _MobMX);
|
|
} else {
|
|
this.SetPictC(PN_MobT + _MaxMobT, MobUIPath + _PicName, _MobPosX + 30, Graphics.height / 2, 0, _MobMX);
|
|
}
|
|
this.MovePict(PN_MobT + _MaxMobT, _MobPosX, true, 15, 255, true)
|
|
} else {
|
|
if (TopMNo != _MaxMobT) {
|
|
for (let i = 1; i <= _MaxMobT; i++) {
|
|
if ($gameScreen.picture(PN_MobT + i) != undefined) {
|
|
this.PicNoCng(PN_MobT + i, PN_MobT + i - 1);
|
|
}
|
|
}
|
|
if (BtmMNo != -1) this.PicNoCng(PN_MobB + BtmMNo, PN_MobT + _MaxMobT);
|
|
if (TopMNo != -1) this.PicNoCng(PN_MobT + TopMNo - 1, PN_MobT + _MaxMobT);
|
|
this.CngPict(PN_MobT + _MaxMobT, MobUIPath + _PicName);
|
|
} else {
|
|
this.CngPict(PN_MobT + TopMNo, MobUIPath + _PicName);
|
|
}
|
|
}
|
|
this.MobPBack();
|
|
this.PicCngColor(PN_MobT + _MaxMobT);
|
|
}
|
|
MobYobiFaceImg = _MYobiFace;
|
|
Nupu_Setting_command101.call(this);
|
|
if (_MYobiFace != "") {
|
|
this._params[0] = _MYobiFace;
|
|
}
|
|
_MobPosX = MobLeftPos;
|
|
}
|
|
Game_Interpreter.prototype.MobTalkEnd = function () {
|
|
for (let i = 0; i <= _MaxMobT; i++) {
|
|
if ($gameScreen.picture(PN_MobB + i) != undefined) {
|
|
if ($gameScreen.picture(PN_MobB + i)._x < Graphics.width / 2) {
|
|
this.MovePict(PN_MobB + i, $gameScreen.picture(PN_MobB + i)._x - 30, true, 15, 0, true);
|
|
} else {
|
|
this.MovePict(PN_MobB + i, $gameScreen.picture(PN_MobB + i)._x + 30, true, 15, 0, true);
|
|
}
|
|
}
|
|
if ($gameScreen.picture(PN_MobT + i) != undefined) {
|
|
if ($gameScreen.picture(PN_MobT + i)._x < Graphics.width / 2) {
|
|
this.MovePict(PN_MobT + i, $gameScreen.picture(PN_MobT + i)._x - 30, true, 15, 0, true);
|
|
} else {
|
|
this.MovePict(PN_MobT + i, $gameScreen.picture(PN_MobT + i)._x + 30, true, 15, 0, true);
|
|
}
|
|
}
|
|
}
|
|
MobResetFlg = true;
|
|
}
|
|
Game_Interpreter.prototype.MobPBack = function () {
|
|
for (let i = 0; i <= _MaxMobT; i++) {
|
|
if ($gameScreen.picture(PN_MobB + i) != undefined) {
|
|
this.PicCngColor(PN_MobB + i, [-30, -30, -30, 0]);
|
|
}
|
|
if ($gameScreen.picture(PN_MobT + i) != undefined) {
|
|
this.PicCngColor(PN_MobT + i, [-30, -30, -30, 0]);
|
|
}
|
|
}
|
|
}
|
|
Game_Interpreter.prototype.MobAllBack = function () {
|
|
this.MobPBack();
|
|
for (let i = 0; i <= _MaxMobT; i++) {
|
|
for (let j = 0; j <= _MaxMobT - 1; j++) {
|
|
if ($gameScreen.picture(PN_MobB + j) == undefined) {
|
|
this.PicNoCng(PN_MobT + i, PN_MobB + j);
|
|
}
|
|
}
|
|
}
|
|
}
|