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

437 lines
14 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 __());
};
})();
var SLG_WINDOW_SW = 3;
var Scene_Map2 = /** @class */ (function (_super) {
__extends(Scene_Map2, _super);
function Scene_Map2() {
var _this = (_super !== null && _super.apply(this, arguments)) || this;
_this._buttonList = [];
return _this;
}
Scene_Map2.prototype.start = function () {
_super.prototype.start.call(this);
this._screenShotManager = new ScreenShotManager();
$gameTemp.lastCharCommand = null;
};
Scene_Map2.prototype.createDisplayObjects = function () {
_super.prototype.createDisplayObjects.call(this);
};
Scene_Map2.prototype.buttonY = function () {
return -6;
};
Scene_Map2.prototype.buttonInterval = function () {
return 55;
};
Scene_Map2.prototype.buttonX = function () {
return 1042;
};
Scene_Map2.prototype.createMenuButton = function () {
this.createRecordButton();
};
Scene_Map2.prototype.hideForSnapshot = function () {
$gameScreen.clearFade();
_super.prototype.update.call(this);
this._messageWindow.visible = false;
this._nameBoxWindow.visible = false;
};
Scene_Map2.prototype.createRecordButton = function () {
this._recordButton = new Sprite_OverableButton("up2", true);
this._recordButton.x = Graphics.width - 65;
this._recordButton.y = this.buttonY();
this._recordButton.visible = false;
this.addWindow(this._recordButton);
this._buttonList.push(this._recordButton);
this._recordButton.setClickHandler(this.onRecord.bind(this));
};
Scene_Map2.prototype.isAnyButtonPressed = function () {
for (var _i = 0, _a = this._buttonList; _i < _a.length; _i++) {
var button = _a[_i];
if (button.visible && button.isPressed()) {
return true;
}
}
return false;
};
Scene_Map2.prototype.onOption = function () {
SoundManager.playOk();
SceneManager.push(Scene_Options);
};
Scene_Map2.prototype.updateMenuButton = function () {
if (this._menuButton) {
var menuEnabled = this.isMenuEnabled();
if (menuEnabled === this._menuEnabled) {
this._menuButton.visible = this._menuEnabled;
this._optionButton.visible = this._menuEnabled;
this._warpButton.visible = this._menuEnabled;
} else {
this._menuEnabled = menuEnabled;
}
}
};
Scene_Map2.prototype.createSpriteset = function () {
this._spriteset = new Spriteset_Map2();
this.addChild(this._spriteset);
this._spriteset.update();
};
Scene_Map2.prototype.terminate = function () {
this._spriteset.waitForMenu();
_super.prototype.terminate.call(this);
};
Scene_Map2.prototype.hideMenuButton = function () {
if (this._spriteset._battleWindow) {
this._spriteset._battleWindow.hide();
}
};
Scene_Map2.prototype.update = function () {
_super.prototype.update.call(this);
this.updateFlags();
this.updateSlg();
this.updateRecordButton();
this.updateScreenShot();
if ($gameParty.isDirty()) {
$gameParty.clearDirty();
this._spriteset._dayWindow.refresh();
}
};
Scene_Map2.prototype.updateScreenShot = function () {
this._screenShotManager.update();
};
Scene_Map2.prototype.onMapTouch = function () {
var x = $gameMap.canvasToMapX(TouchInput.x);
var y = $gameMap.canvasToMapY(TouchInput.y);
if (TouchInput.y <= 50) {
return;
}
if (
this._spriteset._avCharWindow &&
this._spriteset._avCharWindow.visible
) {
if (TouchInput.x < 300) {
return;
}
}
if (TouchInput.x >= 1040) {
if (TouchInput.y <= 300) {
return;
}
}
if (
this._spriteset._clickerWindow &&
this._spriteset._clickerWindow.visible
) {
if (TouchInput.x >= this._spriteset._clickerWindow.x) {
return;
}
}
if ($gameTemp.timeSpeedUp) {
return;
}
if ($slg.hasWaitFireTimeEvent()) {
return;
}
// 自動ドアの調整
if ($gameMap.mapId() == 6) {
this.setDestinationMap6(x, y);
return;
}
$gameTemp.setDestination(x, y);
};
Scene_Map2.prototype.setDestinationMap6 = function (x, y) {
if (y == 11) {
if (x == 17 || x == 19 || x == 21 || x == 23) {
$gameTemp.setDestination(x, y - 1);
return;
}
}
if (y == 19) {
if (x == 19 || x == 21) {
$gameTemp.setDestination(x, y - 1);
return;
}
}
$gameTemp.setDestination(x, y);
};
Scene_Map2.prototype.updateSlg = function () {
$slg.updateTimeGaugeEventFade();
if ($gameMap._interpreter && $gameMap._interpreter.isRunning()) {
return;
}
$slg.update();
if ($slg.isDirty()) {
var scenario = $gameParty.nextScenario();
if (scenario) {
p("TimeEvent scenario:" + scenario);
this.playScenario(scenario);
return;
}
var commonId = $gameParty.nextCommonEvent();
if (commonId > 0) {
p("TimeEvent commonId:" + commonId);
$gameTemp.reserveCommonEvent(commonId);
}
}
};
Scene_Map2.prototype.playScenario = function (id) {
$gameMap._interpreter = new Game_Interpreter();
$gameMap._interpreter._list = [];
$gameMap._interpreter._list.push({
code: 357,
indent: 0,
parameters: ["Nore_Tes", "Run", null, { id: id }],
});
$gameMap._interpreter._list.push({ code: 0, indent: 0, parameters: [] });
p($gameMap._interpreter._list);
};
Scene_Map2.prototype.updateFlags = function () {};
Scene_Map2.prototype.updateRecordButton = function () {
if ($gameSystem.isRecollection()) {
this._recordButton.visible = false;
return;
}
this._recordButton.visible = $gameSystem.isEroEvent();
};
Scene_Map2.prototype.onRecord = function () {
this.saveAvJacket();
};
Scene_Map2.prototype.saveAvJacket = function () {
AudioManager.playSe({ name: "Camera", volume: 100, pitch: 100, pan: 0 });
var screenShot = $gameAvJacketMaker.makeScreenShot();
var jacketWindow = new Window_MakeAvJacket(screenShot);
this.addChild(jacketWindow);
$gameAvJacketList.pushScreenShot(screenShot);
};
Scene_Map2.prototype.showGachaResult = function (battleActorId, isNew) {
this._spriteset.showGachaResult(battleActorId, isNew);
};
Scene_Map2.prototype.showGachaResultList = function (list, newList) {
this._spriteset.showGachaResultList(list, newList);
};
Scene_Map2.prototype.hideGachaResult = function () {
this._spriteset.hideGachaResult();
};
Scene_Map2.prototype.showGachaRate = function (rate) {
this._spriteset.showGachaRate(rate);
};
Scene_Map2.prototype.hideGachaRate = function () {
this._spriteset.hideGachaRate();
};
Scene_Map2.prototype.showBigJacket = function (jacket) {
this._spriteset.showBigJacket(jacket);
};
Scene_Map2.prototype.hideBigJacket = function () {
this._spriteset.hideBigJacket();
};
Scene_Map2.prototype.showMonsterBonus = function () {
this._spriteset.showMonsterBonus();
};
Scene_Map2.prototype.hideMonsterBonus = function () {
this._spriteset.hideMonsterBonus();
};
return Scene_Map2;
})(Scene_Map);
var Spriteset_Map2 = /** @class */ (function (_super) {
__extends(Spriteset_Map2, _super);
function Spriteset_Map2() {
return (_super !== null && _super.apply(this, arguments)) || this;
}
Spriteset_Map2.prototype.createUpperLayer = function () {
this.createPictures();
if ($gameMap.mapId() != 3) {
this.createClickerWindow();
}
this.createAvCharWindow();
this.createTopWindow();
this.createPictures2();
this.createTimer();
this.createOverallFilters();
};
Spriteset_Map2.prototype.createAvCharWindow = function () {
this._avCharWindow = new Window_AvCharList();
this.addChild(this._avCharWindow);
};
Spriteset_Map2.prototype.createTopWindow = function () {
this._dayWindow = new Nore.Window_Top(false);
this.addChild(this._dayWindow);
};
Spriteset_Map2.prototype.createDouseiSprite = function () {
this._douseiSet = new Sprite_DouseiSet();
this.addChild(this._douseiSet);
};
Spriteset_Map2.prototype.createClickerWindow = function () {
if ($gameMap.mapId() == 3) {
return;
}
if ($gameMap.mapId() == 33) {
if ($gameSwitches.value(283)) {
// 怪人ガチャ
return;
}
}
this._clickerWindow = new Spriteset_Clicker();
this.addChild(this._clickerWindow);
};
Spriteset_Map2.prototype.waitForMenu = function () {
this._waitForMenu = true;
};
Spriteset_Map2.prototype.update = function () {
_super.prototype.update.call(this);
this.updateWindowVisible();
};
Spriteset_Map2.prototype.updateWindowVisible = function () {
var visible = true; //$gameSwitches.value(SLG_WINDOW_SW);
if (this._waitForMenu) {
//visible = false;
}
if (this._dayWindow) {
if (!$gameSwitches.value(999)) {
if (!$gameSwitches.value(18)) {
this._dayWindow.visible = visible;
}
}
}
};
Spriteset_Map2.prototype.processAnimationRequests = function () {
if (!this._clickerWindow || !this._clickerWindow.visible) {
_super.prototype.processAnimationRequests.call(this);
}
};
Spriteset_Map2.prototype.createPictures = function () {
var width = Graphics.width;
var height = Graphics.height;
var x = (Graphics.width - width) / 2;
var y = (Graphics.height - height) / 2;
this._pictureContainer = new Sprite();
this._pictureContainer.setFrame(x, y, width, height);
for (var i = 0; i < 10; i++) {
this._pictureContainer.addChild(new Sprite_Picture(i));
}
this.addChild(this._pictureContainer);
};
Spriteset_Map2.prototype.createPictures2 = function () {
var width = Graphics.width;
var height = Graphics.height;
var x = (Graphics.width - width) / 2;
var y = (Graphics.height - height) / 2;
this._pictureContainer2 = new Sprite();
this._pictureContainer2.setFrame(x, y, width, height);
for (var i = 10; i <= $gameScreen.maxPictures() - 1; i++) {
this._pictureContainer2.addChild(new Sprite_Picture(i));
}
this.addChild(this._pictureContainer2);
};
Spriteset_Map2.prototype.showGachaResult = function (battleActorId, isNew) {
var actor = $slg.formation().findBattleActor(battleActorId);
if (!actor) {
console.error(battleActorId + "のキャラが存在しません");
}
var sprite = new Nore.Sprite_GachaResult(actor, isNew);
this.addChild(sprite);
this._gachaResultSprite = sprite;
};
Spriteset_Map2.prototype.hideGachaResult = function () {
if (this._gachaResultSprite) {
this.removeChild(this._gachaResultSprite);
this._gachaResultSprite = null;
}
if (this._gachaResultSpriteList) {
for (var i = 0; i < this._gachaResultSpriteList.length; i++) {
var sprite = this._gachaResultSpriteList[i];
this.removeChild(sprite);
}
this._gachaResultSpriteList = [];
}
};
Spriteset_Map2.prototype.showGachaResultList = function (list, newList) {
this._gachaResultSpriteList = [];
for (var i = 0; i < list.length; i++) {
var battleActorId = list[i];
var isNew = newList[i];
var actor = $slg.formation().findBattleActor(battleActorId);
if (!actor) {
console.error(battleActorId + "のキャラが存在しません");
}
var sprite = new Nore.Sprite_GachaResult5Ren(actor, isNew, i);
this.addChild(sprite);
this._gachaResultSpriteList.push(sprite);
}
};
Spriteset_Map2.prototype.showGachaRate = function (rareList) {
var sprite = new Nore.Sprite_GachaRate(rareList);
this.addChild(sprite);
this._gachaRateSprite = sprite;
};
Spriteset_Map2.prototype.hideGachaRate = function () {
if (this._gachaRateSprite) {
this.removeChild(this._gachaRateSprite);
this._gachaRateSprite = null;
}
};
Spriteset_Map2.prototype.createShadow = function () {
this._shadowSprite = new Sprite();
this._shadowSprite.anchor.x = 0.5;
this._shadowSprite.anchor.y = 1;
this._shadowSprite.z = 6;
this._tilemap.addChild(this._shadowSprite);
};
Spriteset_Map2.prototype.loadSystemImages = function () {
Spriteset_Base.prototype.loadSystemImages.call(this);
ImageManager.loadSystem("Balloon");
};
Spriteset_Map2.prototype.showBigJacket = function (jacket) {
this.hideBigJacket();
this._jacketSprite = new Nore.Sprite_AvJacketBig(
jacket,
JacketScale.scale3
);
this._jacketSprite.y = 0;
this.addChild(this._jacketSprite);
};
Spriteset_Map2.prototype.hideBigJacket = function () {
if (this._jacketSprite) {
this._jacketSprite.destroy();
this.removeChild(this._jacketSprite);
this._jacketSprite = null;
}
};
Spriteset_Map2.prototype.showMonsterBonus = function () {
var sprite = new Nore.Sprite_MonsterBonus();
this.addChild(sprite);
this._monsterBonusSprite = sprite;
};
Spriteset_Map2.prototype.hideMonsterBonus = function () {
if (this._monsterBonusSprite) {
this.removeChild(this._monsterBonusSprite);
this._monsterBonusSprite = null;
}
};
return Spriteset_Map2;
})(Spriteset_Map);