PT-BR: Initial commit

This commit is contained in:
OleSTEEP 2024-05-26 04:07:13 +03:00
parent c440da4bcc
commit e85110f4eb
488 changed files with 115254 additions and 0 deletions

4065
www.br/js/plugins.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,636 @@
//=============================================================================
// TDS Map Character Tag
// Version: 1.0
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_MapCharacterTag = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.MapCharacterTag = _TDS_.MapCharacterTag || {};
//=============================================================================
/*:
* @plugindesc
* Shortcut for tag system
*
* @author TDS
*
*
* @param Common Event ID
* @desc ID of the common event to run after tagging.
* @default 1
*
* @param Selected Variable ID
* @desc ID of the variable to set selected tagged actor ID.
* @default 1
*
*
* @param Disable Switch ID
* @desc ID of the switch used to disable the tagging system.
* @default 1
*
*
*/
//=============================================================================
// Node.js path
var path = require('path');
// Get Parameters
var parameters = PluginManager.parameters("Map_Character_Tag");
// Initialize Parameters
_TDS_.MapCharacterTag.params = {};
_TDS_.MapCharacterTag.params.commonEventID = Number(parameters['Common Event ID'] || 1);
_TDS_.MapCharacterTag.params.selectedVariableID = Number(parameters['Selected Variable ID'] || 1);
_TDS_.MapCharacterTag.params.disableSwitchID = Number(parameters['Disable Switch ID'] || 1);
//=============================================================================
// ** Input
//-----------------------------------------------------------------------------
// The static class that handles input data from the keyboard and gamepads.
//=============================================================================
// Set Key Mapper A Key
Input.keyMapper[65] = 'tag';
//=============================================================================
// ** Scene_Map
//-----------------------------------------------------------------------------
// The scene class of the map screen.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.MapCharacterTag.Game_Player_canMove = Game_Player.prototype.canMove;
_TDS_.MapCharacterTag.Game_Player_canStartLocalEvents = Game_Player.prototype.canStartLocalEvents;
//=============================================================================
// * Can Use Map Character Tag
//=============================================================================
Game_Player.prototype.canUseCharacterTag = function() {
// Get Scene
const scene = SceneManager._scene;
// If scene exists and has can use character tag function return it
if (scene && scene.canUseCharacterTag) { return scene.canUseCharacterTag(); };
return false;
};
//=============================================================================
// * Determine if player can start local events
//=============================================================================
Game_Player.prototype.canStartLocalEvents = function() {
// If Map Character tag is visible
if (SceneManager._scene._mapCharacterTag.opacity > 0) { return false; };
// Return Original Function
return _TDS_.MapCharacterTag.Game_Player_canStartLocalEvents.call(this);
};
//=============================================================================
// * Can Move
//=============================================================================
Game_Player.prototype.canMove = function() {
// Input A is being pressed
let scene = SceneManager._scene;
let isTagging = scene._mapCharacterTag ? scene._mapCharacterTag.opacity > 0 : false;
if (!!isTagging) { return false; };
// return Original Function
return _TDS_.MapCharacterTag.Game_Player_canMove.call(this);
};
//=============================================================================
// ** Scene_Map
//-----------------------------------------------------------------------------
// The scene class of the map screen.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.MapCharacterTag.Scene_Map_createDisplayObjects = Scene_Map.prototype.createDisplayObjects;
_TDS_.MapCharacterTag.Scene_Map_update = Scene_Map.prototype.update;
_TDS_.MapCharacterTag.Scene_Map_terminate = Scene_Map.prototype.terminate;
//=============================================================================
// * Create Display Objects
//=============================================================================
Scene_Map.prototype.createDisplayObjects = function() {
// Run Original Function
_TDS_.MapCharacterTag.Scene_Map_createDisplayObjects.call(this);
// Create Map Character Tag
this.createMapCharacterTag();
};
//=============================================================================
// * Terminate
//=============================================================================
Scene_Map.prototype.terminate = function() {
// Hide Map Character Tag
this._mapCharacterTag.visible = false;
// Run Original Function
_TDS_.MapCharacterTag.Scene_Map_terminate.call(this);
};
//=============================================================================
// * Frame Update
//=============================================================================
Scene_Map.prototype.update = function() {
// Run Original Function
_TDS_.MapCharacterTag.Scene_Map_update.call(this);
// Update Character Tag
this.updateCharacterTagInput();
};
//=============================================================================
// * Create Map Character Tag
//=============================================================================
Scene_Map.prototype.createMapCharacterTag = function() {
// Create Map Character Tag Sprite
this._mapCharacterTag = new Sprite_MapCharacterTag();
this.addChild(this._mapCharacterTag);
};
//=============================================================================
// * Determine if Character Tag can be used
//=============================================================================
Scene_Map.prototype.canUseCharacterTag = function() {
// If Event is running return false
if ($gameMap.isEventRunning()) { return false; };
// If Party size is 1 or less
if ($gameParty.size() <= 1) { return false;};
// If Disable Switch is on return false
if ($gameSwitches.value(_TDS_.MapCharacterTag.params.disableSwitchID)) { return false; }
let scene = SceneManager._scene;
let isProcessingAnyMovement = !!$gamePlayer.isMoving() || !!$gamePlayer.followers().areMoving() || Input.isPressed("left") || Input.isPressed("right") || Input.isPressed("up") || Input.isPressed("down");
if (!!isProcessingAnyMovement) {return false;}
// Return true by default
return true;
};
//=============================================================================
// * Update Character Tag
//=============================================================================
Scene_Map.prototype.updateCharacterTagInput = function() {
// If Input Trigger A
if (Input.isTriggered('tag')) {
// If Can use Character Tag
if (this.canUseCharacterTag()) {
// Get Tag
var tag = this._mapCharacterTag;
// If Tag is Finished
if (tag._finished) {
// Show Tag
tag.show();
};
};
};
};
//=============================================================================
// ** Sprite_MapCharacterTag
//-----------------------------------------------------------------------------
// Ring Menu for Omori's tag system on the map.
//=============================================================================
function Sprite_MapCharacterTag() { this.initialize.apply(this, arguments);}
Sprite_MapCharacterTag.prototype = Object.create(Sprite.prototype);
Sprite_MapCharacterTag.prototype.constructor = Sprite_MapCharacterTag;
//=============================================================================
// * Initialize Object
//=============================================================================
Sprite_MapCharacterTag.prototype.initialize = function() {
// Super Call
Sprite.prototype.initialize.call(this);
// Initialize Settings
this.initSettings();
// Create Background
this.createBackground();
// Create Party Sprites
this.createPartySprites();
};
//=============================================================================
// * Create Background
//=============================================================================
Sprite_MapCharacterTag.prototype.createBackground = function() {
// Create Background
this._backgroundSprite = new Sprite();
this.addChild(this._backgroundSprite);
};
//=============================================================================
// * Initialize Settings
//=============================================================================
Sprite_MapCharacterTag.prototype.initSettings = function() {
// Amount of Frames for Startup Animation
this._startUpFrames = 13;
// Animation Frames for Movement Animation
this._movingFrames = 10;
// Radius of the ring
this._ringRadius = 160;
// Animation Steps
this._steps = -1;
// Set Center X & Y Valeus
this._centerX = Graphics.width / 2;
this._centerY = (Graphics.height / 2) - 10;
// Animation Type (Start, Wait, Move Right, Move Left)
this._anim = '';
// Set Index to
this._index = 0;
// Set Opacity to 0
this.opacity = 0;
// Set Released To false
this._released = false;
// Finished Flag
this._finished = true;
};
//=============================================================================
// * Create Party Sprites
//=============================================================================
Sprite_MapCharacterTag.prototype.createPartySprites = function() {
// Initialize Party Sprites
this._partySprites = [];
// Create Party Sprites Container
this._partySpritesContainer = new Sprite()
this._partySpritesContainer.opacity = 0;
this.addChild(this._partySpritesContainer);
// Iterate
for (var i = 0; i < 4; i++) {
var sprite = new Sprite_MapCharacterTagFace();
sprite.setText('LÍDER');
sprite.x = this._centerX;
sprite.y = this._centerY;
this._partySprites[i] = sprite;
this._partySpritesContainer.addChild(sprite)
};
// Create Leader Sprite
this._leaderSprite = new Sprite_MapCharacterTagFace();
this._leaderSprite.x = this._centerX;
this._leaderSprite.y = this._centerY;
this._leaderSprite.showText();
this._leaderSprite.setText('PASSAR?')
this.addChild(this._leaderSprite);
// Refresh Party Sprites
this.refreshPartySprites();
};
//=============================================================================
// * Refresh Party Sprites
//=============================================================================
Sprite_MapCharacterTag.prototype.refreshPartySprites = function() {
for (var i = 0; i < this._partySprites.length; i++) {
// Get Sprite
var sprite = this._partySprites[i];
// Get Actor
var actor = $gameParty.members()[i];
sprite._faceSprite.actor = actor;
// Set Visibility
sprite.visible = actor !== undefined;
};
// Set Leader Sprite Face Sprite
this._leaderSprite._faceSprite.actor = $gameParty.leader();
};
//=============================================================================
// * Reset Party Sprites
//=============================================================================
Sprite_MapCharacterTag.prototype.resetPartySprites = function() {
for (var i = 0; i < this._partySprites.length; i++) {
// Get Sprite
var sprite = this._partySprites[i];
sprite.x = this._centerX;
sprite.y = this._centerY;
};
};
//=============================================================================
// * Activate & Deactivate
//=============================================================================
Sprite_MapCharacterTag.prototype.activate = function() { this._active = true; };
Sprite_MapCharacterTag.prototype.deactivate = function() { this._active = false; };
//=============================================================================
// * Determine if Animating
//=============================================================================
Sprite_MapCharacterTag.prototype.isAnimating = function() { return this._steps > -1; };
//=============================================================================
// * Determine if Inputs can be made
//=============================================================================
Sprite_MapCharacterTag.prototype.isInputable = function() {
if (this.isAnimating()) { return false; };
if (this._released) { return false; };
return true;
};
//=============================================================================
// * Get Max Items
//=============================================================================
Sprite_MapCharacterTag.prototype.maxItems = function() { return $gameParty.size(); };
//=============================================================================
// * Frame Update
//=============================================================================
Sprite_MapCharacterTag.prototype.update = function() {
// Super Call
Sprite.prototype.update.call(this);
// Update Animations
this.updateAnimations();
// Update Input
this.updateInput()
};
//=============================================================================
// * Move Left
//=============================================================================
Sprite_MapCharacterTag.prototype.moveLeft = function() {
// Set Steps
this._steps = this._movingFrames;
// Set Max
var max = this.maxItems();
// Set Index
this._index = (this._index - 1 + max) % max;
// Set Animation
this._anim = 'moveLeft';
};
//=============================================================================
// * Move Right
//=============================================================================
Sprite_MapCharacterTag.prototype.moveRight = function() {
// Set Steps
this._steps = this._movingFrames;
// Set Index
this._index = (this._index + 1) % this.maxItems();
// Set Animation
this._anim = 'moveRight'
};
//=============================================================================
// * Show
//=============================================================================
Sprite_MapCharacterTag.prototype.show = function() {
// Set Index to
this._index = 0;
// Refresh Party Sprites
this.refreshPartySprites();
// Reset Party Sprites
this.resetPartySprites();
// Snap Background Bitmap
SceneManager.snapForBackground(false);
// Set Background Bitmap
this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
this._backgroundSprite.opacity = 0;
this._backgroundSprite.blur = new PIXI.filters.BlurFilter();
this._backgroundSprite.filters = [this._backgroundSprite.blur];
this._backgroundSprite.blur.blur = 1;
this._backgroundSprite.blur.padding = 0;
// Set Party Sprites container Opacity
this._partySpritesContainer.opacity = 0;
// Start Startup Animation
this.startStartupAnim();
// Set Released To false
this._released = false;
// Finished Flag
this._finished = false;
};
//=============================================================================
// * Update Animations
//=============================================================================
Sprite_MapCharacterTag.prototype.onFinish = function() {
this._anim = null;
this._steps = -1;
this._backgroundSprite.bitmap = null;
this._released = false;
// Finished Flag
this._finished = true;
// If Index is more than 0
if (this._index > 0) {
// Get Actor ID
var actorId = $gameParty.members()[this._index].actorId();
// Set Actor ID Variable
$gameVariables.setValue(_TDS_.MapCharacterTag.params.selectedVariableID, actorId);
// Reserve Common Event
$gameTemp.reserveCommonEvent(_TDS_.MapCharacterTag.params.commonEventID);
};
// Reset Index
this._index = 0;
};
//=============================================================================
// * Update Animations
//=============================================================================
Sprite_MapCharacterTag.prototype.updateAnimations = function() {
// Set Release Flag
if (!this._released) {
// Set Active Flag
this._active = Input.isPressed('tag');
if (!this._active) {
this._released = true;
return;
};
} else if (!this._finished && this._released) {
// If Not Active
this.opacity -= 30;
// If Opacity is 0 or less set showing to false
if (this.opacity <= 0) {
// On Finish
this.onFinish();
};
return;
};
// If Steps is more than -1
if (!this._released && this._steps > -1) {
// Animation Switch Case
switch (this._anim) {
case 'start':
this.updateStartupAnim();
break;
case 'moveLeft':
this.updateMoveAnim(1);
break;
case 'moveRight':
this.updateMoveAnim(0)
break;
default:
// statements_def
break;
};
}
};
//=============================================================================
// * Update Input
//=============================================================================
Sprite_MapCharacterTag.prototype.updateInput = function() {
// If Inputable
if (this.isInputable()) {
// Left Input
if (Input.isRepeated('left')) { this.moveLeft(); };
// Right Input
if (Input.isRepeated('right')) { this.moveRight(); };
};
};
//=============================================================================
// * Start Startup Animation
//=============================================================================
Sprite_MapCharacterTag.prototype.startStartupAnim = function() {
// Animation Steps
this._steps = this._startUpFrames;
// Set Animation Type
this._anim = 'start';
};
//=============================================================================
// * Update Startup Animation
//=============================================================================
Sprite_MapCharacterTag.prototype.updateStartupAnim = function() {
// If Opacity is not at max
if (this.opacity < 255) {
// Increase Opacity
this.opacity += 60;
this._backgroundSprite.opacity += 60;
return;
}
var max = this.maxItems();
var d1 = 2.0 * Math.PI / max;
var d2 = 1.0 * Math.PI / this._startUpFrames;
var r = this._ringRadius - 1.0 * this._ringRadius * this._steps / this._startUpFrames;
for (var i = 0; i < max; i++) {
// Get Sprite
var sprite = this._partySprites[i];
var d = d1 * i + d2 * this._steps;
sprite.x = this._centerX + (r * Math.sin(d));
sprite.y = this._centerY - (r * Math.cos(d));
sprite.hideText();
sprite._faceSprite.deactivate();
};
// If Steps are more than 0
if (this._steps > 0) {
// Set party container opacity
this._partySpritesContainer.opacity = (this._partySpritesContainer.opacity * (this._steps - 1) + 255) / this._steps;
};
// Decrease Steps
this._steps--;
// If Animation is over
if (this._steps < 0) { this.updateWaitAnim(); };
};
//=============================================================================
// * Update Wait Animation
//=============================================================================
Sprite_MapCharacterTag.prototype.updateWaitAnim = function() {
var max = this.maxItems();
var d = 2.0 * Math.PI / max;
// Go Through Sprites
for (var i = 0; i < max; i++) {
// Get Sprite
var sprite = this._partySprites[i];
var j = i - this._index;
sprite.x = (this._centerX + (this._ringRadius * Math.sin(d * j)));
sprite.y = this._centerY - ((this._ringRadius * Math.cos(d * j)))
if (i === this._index) {
sprite.showText();
sprite._faceSprite.activate();
} else {
sprite._faceSprite.deactivate();
sprite.hideText();
}
};
};
//=============================================================================
// * Update Move Animation
//=============================================================================
Sprite_MapCharacterTag.prototype.updateMoveAnim = function(mode) {
var max = this.maxItems();
var d1 = 2.0 * Math.PI / max;
var d2 = d1 / this._movingFrames;
if (mode !== 0) { d2 *= -1; };
for (var i = 0; i < max; i++) {
// Get Sprite
var sprite = this._partySprites[i];
var j = i - this._index;
var d = d1 * j + d2 * this._steps;
sprite.x = (this._centerX + (this._ringRadius * Math.sin(d)));
sprite.y = this._centerY - ((this._ringRadius * Math.cos(d)))
sprite.hideText();
};
// Decrease Steps
this._steps--;
// If Animation is over
if (this._steps < 0) { this.updateWaitAnim(); };
};
//=============================================================================
// ** Sprite_MapCharacterTagFace
//-----------------------------------------------------------------------------
// Animated Face Sprite for menus.
//=============================================================================
function Sprite_MapCharacterTagFace() { this.initialize.apply(this, arguments);}
Sprite_MapCharacterTagFace.prototype = Object.create(Sprite.prototype);
Sprite_MapCharacterTagFace.prototype.constructor = Sprite_MapCharacterTagFace;
//=============================================================================
// * Initialize Object
//=============================================================================
Sprite_MapCharacterTagFace.prototype.initialize = function() {
// Super Call
Sprite.prototype.initialize.call(this);
// Set Center Position
this.anchor.set(0.5, 0.5);
// Create Sprites
this.createBackgroundSprite();
this.createTextSprite();
this.createFaceSprite();
// Hide Text
this.hideText();
};
//=============================================================================
// * Create Background Sprite
//=============================================================================
Sprite_MapCharacterTagFace.prototype.createBackgroundSprite = function() {
var bitmap = new Bitmap(110, 110 + 34)
bitmap.fillAll('rgba(0, 0, 0, 1)')
bitmap.fillRect(1, 1, bitmap.width - 2, bitmap.height - 2, 'rgba(255, 255, 255, 1)')
bitmap.fillRect(4, 4, bitmap.width - 8, 105, 'rgba(0, 0, 0, 1)')
bitmap.fillRect(0, 113, bitmap.width, 1, 'rgba(0, 0, 0, 1)')
bitmap.fillRect(4, 117, bitmap.width - 8, 22, 'rgba(0, 0, 0, 1)')
this._backgroundSprite = new Sprite(bitmap);
this._backgroundSprite.x = -(bitmap.width / 2);
this._backgroundSprite.y = -(110 / 2);
this.addChild(this._backgroundSprite);
};
//=============================================================================
// * Create Text Sprite
//=============================================================================
Sprite_MapCharacterTagFace.prototype.createTextSprite = function() {
var bitmap = new Bitmap(110, 32);
this._textSprite = new Sprite(bitmap);
this._textSprite.anchor.set(0.5, 0);
this._textSprite.y = (144 / 2) - 18;
this.addChild(this._textSprite);
};
//=============================================================================
// * Create Face Sprite
//=============================================================================
Sprite_MapCharacterTagFace.prototype.createFaceSprite = function() {
// Create Face Sprite
this._faceSprite = new Sprite_OmoMenuStatusFace();
this._faceSprite.anchor.set(0.5, 0.5)
this._faceSprite.actor = $gameParty.members()[0];
this._faceSprite.deactivate();
this.addChild(this._faceSprite);
this._faceMask = new Sprite(new Bitmap(110,110))
this._faceMask.x = -(110 / 2) + 2;
this._faceMask.y = -(110 / 2) + 2;
let white = 'rgba(255, 255, 255, 1)';
this._faceMask.bitmap.fillRect(0,0,106,2, white)
this._faceMask.bitmap.fillRect(104,0,2,106, white)
this.addChild(this._faceMask);
};
//=============================================================================
// * Activate & Deactivate
//=============================================================================
Sprite_MapCharacterTagFace.prototype.activate = function() { this._active = true; };
Sprite_MapCharacterTagFace.prototype.deactivate = function() { this._active = false; };
//=============================================================================
// * Show Text
//=============================================================================
Sprite_MapCharacterTagFace.prototype.setText = function(text) {
var bitmap = this._textSprite.bitmap;
bitmap.fontSize = 24;
bitmap.drawText(text, 0, 0, bitmap.width, bitmap.height, 'center');
};
//=============================================================================
// * Show Text
//=============================================================================
Sprite_MapCharacterTagFace.prototype.showText = function() {
this._backgroundSprite.setFrame(0, 0, 110, this._backgroundSprite.bitmap.height);
this._textSprite.visible = true;
};
//=============================================================================
// * Hide Text
//=============================================================================
Sprite_MapCharacterTagFace.prototype.hideText = function() {
this._backgroundSprite.setFrame(0, 0, 110, 114);
this._textSprite.visible = false;
};

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,290 @@
//=============================================================================
// TDS Omori BlackLetter Map
// Version: 1.5
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_OmoriBlackLetterMap = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.OmoriBlackLetterMap = _TDS_.OmoriBlackLetterMap || {};
//=============================================================================
/*:
* @plugindesc
* This plugin shows the Omori Black Letter map.
*
* @author TDS
*
*/
//=============================================================================
// ImageManager.loadSystem('blackletter_bg');
// ImageManager.loadSystem('blackLetter_map_atlas');
//=============================================================================
// ** Input
//-----------------------------------------------------------------------------
// The static class that handles input data from the keyboard and gamepads.
//=============================================================================
// * Key Mapper Keys
//=============================================================================
// Input.keyMapper['81'] = 'q';
// //=============================================================================
// // ** Scene_Map
// //-----------------------------------------------------------------------------
// // The scene class of the map screen.
// //=============================================================================
// // Alias Listing
// //=============================================================================
// _TDS_.OmoriBlackLetterMap.Scene_Map_updateScene = Scene_Map.prototype.updateScene;
// //=============================================================================
// // * Update Scene
// //=============================================================================
// Scene_Map.prototype.updateScene = function() {
// // Run Original Function
// _TDS_.OmoriBlackLetterMap.Scene_Map_updateScene.call(this);
// if (!SceneManager.isSceneChanging()) {
// this.updateCallBlackLetterMap();
// };
// };
// //=============================================================================
// // * Update Call Black Letter Map
// //=============================================================================
// Scene_Map.prototype.updateCallBlackLetterMap = function() {
// // If Q Is triggered
// if (Input.isTriggered('pageup')) {
// // If Disable switch is off
// if (!$gameSwitches.value(18)) {
// // Go to Black Letter Map Scene
// SceneManager.push(Scene_OmoriBlackLetterMap);
// };
// };
// };
_TDS_.OmoriBlackLetterMap.Scene_Map_needsFadeIn = Scene_Map.prototype.needsFadeIn;
Scene_Map.prototype.needsFadeIn = function() {
return (_TDS_.OmoriBlackLetterMap.Scene_Map_needsFadeIn.call(this) || SceneManager.isPreviousScene(Scene_OmoriBlackLetterMap));
};
//=============================================================================
// ** Scene_OmoriBlackLetterMap
//-----------------------------------------------------------------------------
// This scene shows the Black Letter map
//=============================================================================
function Scene_OmoriBlackLetterMap() { this.initialize.apply(this, arguments);}
Scene_OmoriBlackLetterMap.prototype = Object.create(Scene_Base.prototype);
Scene_OmoriBlackLetterMap.prototype.constructor = Scene_OmoriBlackLetterMap;
//=============================================================================
// * Object Initialization
//=============================================================================
Scene_OmoriBlackLetterMap.prototype.initialize = function() {
// Super Call
Scene_Base.prototype.initialize.call(this);
};
//=============================================================================
// * Initialize Atlas Lists
//=============================================================================
Scene_OmoriBlackLetterMap.prototype.initAtlastLists = function() {
// Run Original Function
Scene_Base.prototype.initAtlastLists.call(this);
// Add Required Atlas
// this.addRequiredAtlas('blackletter_bg');
this.addRequiredAtlas('blackLetter_map_atlas');
};
//=============================================================================
// * Create
//=============================================================================
Scene_OmoriBlackLetterMap.prototype.create = function() {
// Super Call
Scene_Base.prototype.create.call(this);
// Create Map Sprite
this._mapSprite = new Sprite_OmoBlackLetterMap();
this.addChild(this._mapSprite);
};
Scene_OmoriBlackLetterMap.prototype.start = function() {
Scene_Base.prototype.start.call(this);
this.startFadeIn(this.slowFadeSpeed());
};
//=============================================================================
// * Frame Update
//=============================================================================
Scene_OmoriBlackLetterMap.prototype.update = function() {
// Super Call
Scene_Base.prototype.update.call(this);
// If Cancel or Q is pressed
if (Input.isTriggered('cancel') || Input.isTriggered('q')) {
// If not busy
if (!this.isBusy()) {
// Play Cancel Sound
// SoundManager.playCancel();
// Pop Scene
this.popScene();
};
};
};
//=============================================================================
// ** Sprite_OmoBlackLetterMap
//-----------------------------------------------------------------------------
// This sprite is used to display the black letter map.
//=============================================================================
function Sprite_OmoBlackLetterMap() { this.initialize.apply(this, arguments);}
Sprite_OmoBlackLetterMap.prototype = Object.create(Sprite.prototype);
Sprite_OmoBlackLetterMap.prototype.constructor = Sprite_OmoBlackLetterMap;
//=============================================================================
// * Initialize Object
//=============================================================================
Sprite_OmoBlackLetterMap.prototype.initialize = function() {
// Super Call
Sprite.prototype.initialize.call(this);
// Create Background Sprite
this.createBackgroundSprite();
// Create Overlay Sprites
this.createOverlaySprites();
// Create Text Counter Sprite
};
//=============================================================================
// * Create Background Sprite
//=============================================================================
Sprite_OmoBlackLetterMap.prototype.createBackgroundSprite = function() {
// Create Background Sprite
this._backgroundSprite = new Sprite(ImageManager.loadSystem('blackletter_bg'));
this.addChild(this._backgroundSprite);
};
//=============================================================================
// * Create Overlay Sprites
//=============================================================================
Sprite_OmoBlackLetterMap.prototype.createOverlaySprites = function() {
// Create Overlay Bitmap
var bitmap = new Bitmap(Graphics.width, Graphics.height);
// Get Background Bitmap
var bgBitmap = ImageManager.loadAtlas('blackLetter_map_atlas');
var bgBitmap50 = ImageManager.loadAtlas('blackLetter_map_50_atlas');
// Get Map Data
bgBitmap.addLoadListener(() => {
bgBitmap50.addLoadListener(() => {
var mapData = [
{name: 'FLORESTA DOS FLAMA-LUZES', namePos: new Point(80, 195), rect: new Rectangle(0, 0, 193, 139), pos: new Point(111, 103), blackSwitchId: 23, nameSwitchId: 30, blackSwitch50Id: 900 },
// {name: 'Forgotten Pier', namePos: new Point(200, 27), rect: new Rectangle(194, 0, 155, 120), pos: new Point(225, 52), blackSwitchId: 21, nameSwitchId: 29 },
{name: 'FLORESTA CATA-VENTO', namePos: new Point(430, 240), rect: new Rectangle(350, 0, 99, 107), pos: new Point(471, 128), blackSwitchId: 24, nameSwitchId: 31, blackSwitch50Id: 901 },
{name: 'VILA BROTOPEIRA', namePos: new Point(25, 340), rect: new Rectangle(450, 0, 94, 80), pos: new Point(54, 267), blackSwitchId: 25, nameSwitchId: 32, blackSwitch50Id: 902 },
{name: 'FLORESTA VASTA', namePos: new Point(250, 300), rect: new Rectangle(0, 124, 640, 201), pos: new Point(-2, 143), blackSwitchId: 26, nameSwitchId: 33, blackSwitch50Id: 903 },
{name: 'POÇO SEM FUNDO', namePos: new Point(450, 355), rect: new Rectangle(0, 326, 418, 113), pos: new Point(119, 366), blackSwitchId: 27, nameSwitchId: 34, blackSwitch50Id: 904 },
{name: 'OASIS LARANJA', namePos: new Point(20, 55), rect: new Rectangle(545, 0, 122, 102), pos: new Point(31, 85), blackSwitchId: 28, nameSwitchId: 35, blackSwitch50Id: 905 },
{name: 'OUTRO-MUNDO', namePos: new Point(450, 75), rect: new Rectangle(419, 326, 140, 209), pos: new Point(390, 21), blackSwitchId: 29, nameSwitchId: 36, blackSwitch50Id: 906 },
]
// Initialize Name Windows Array
this._nameWindows = [];
// Create Container for Name Windows
this._nameWindowsContainer = new Sprite();
// Go Through Map Data
for (var i = 0; i < mapData.length; i++) {
// Get Data
var data = mapData[i];
// Get Rect & Position
var rect = data.rect, pos = data.pos;
var test = Math.randomInt(100) > 50;
// If Black switch ID is not on
/*if (!$gameSwitches.value(data.blackSwitchId)) {
if (!$gameSwitches.value(data.blackSwitch50Id)) {
// Draw Black onto Bitmap
bitmap.blt(bgBitmap50, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);
} else {
}
};*/
//if(!!$gameSwitches.value(data.blackSwitchId)) {bitmap.blt(bgBitmap, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);}
//else if(!!$gameSwitches.value(data.blackSwitch50Id)) {bitmap.blt(bgBitmap50, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);}
if(!!$gameSwitches.value(data.blackSwitch50Id)) {bitmap.blt(bgBitmap, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);}
else {
if(!$gameSwitches.value(data.blackSwitchId)) {
bitmap.blt(bgBitmap50, rect.x, rect.y, rect.width, rect.height, pos.x, pos.y);
}
}
// Get Name Position
var namePos = data.namePos;
var name = $gameSwitches.value(data.nameSwitchId) ? data.name : "???"
// Create Window
var win = new Window_OmoBlackLetterMapName(name);
// Set Window Position
win.x = namePos.x; win.y = namePos.y;
this._nameWindows.push(win);
this._nameWindowsContainer.addChild(win);
};
// Create Black Overlay Sprite
this._blackOverlay = new Sprite(bitmap);
this.addChild(this._blackOverlay)
// Add Name Window container as a child
this.addChild(this._nameWindowsContainer);
this.createTextCounterSprite();
})
})
};
//=============================================================================
// * Create Text Counter Sprite
//=============================================================================
Sprite_OmoBlackLetterMap.prototype.createTextCounterSprite = function() {
// Get Background Bitmap
var bgBitmap = ImageManager.loadAtlas('blackLetter_map_atlas');
// Create Bitmap
var bitmap = new Bitmap(200, 40);
bitmap.blt(bgBitmap, 450, 81, 39, 37, 5, 10);
bitmap.textColor = '#000000';
bitmap.outlineColor = 'rgba(255, 255, 255, 1)'
bitmap.outlineWidth = 3;
bitmap.drawText('%1/%2'.format($gameVariables.value(19), 26), 48, 0, 70, 55);
this._textCounterSprite = new Sprite(bitmap);
this._textCounterSprite.y = Graphics.height - 50;
this.addChild(this._textCounterSprite);
};
//=============================================================================
// ** Window_OmoBlackLetterMapName
//-----------------------------------------------------------------------------
// The window for displaying the name of a map section in the black letter map.
//=============================================================================
function Window_OmoBlackLetterMapName() { this.initialize.apply(this, arguments); }
Window_OmoBlackLetterMapName.prototype = Object.create(Window_Base.prototype);
Window_OmoBlackLetterMapName.prototype.constructor = Window_OmoBlackLetterMapName;
//=============================================================================
// * Object Initialization
//=============================================================================
Window_OmoBlackLetterMapName.prototype.initialize = function(name) {
// Set Name
this._name = name;
// Super Call
Window_Base.prototype.initialize.call(this, 0, 0, 300, 38);
this.refresh();
};
//=============================================================================
// * Settings
//=============================================================================
Window_OmoBlackLetterMapName.prototype.standardPadding = function() { return 4; };
Window_OmoBlackLetterMapName.prototype.windowWidth = function() { return Graphics.width; };
//=============================================================================
// * Refresh
//=============================================================================
Window_OmoBlackLetterMapName.prototype.refresh = function() {
// Clear Contents
this.contents.clear();
// Get Text Width
var textWidth = this.textWidth(this._name);
// Adjust Width
this.width = textWidth + (this._name === "???" ? 24 : this.padding*2);
this.contents.fontSize = 22;
// Draw Name
this.drawText(this._name, 0, -7, this.contentsWidth(), 'center');
};

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,781 @@
//=============================================================================
// TDS Message Save & Load
// Version: 1.0
//=============================================================================
// Add to Imported List
var Imported = Imported || {} ; Imported.TDS_OmoriSaveLoad = true;
// Initialize Alias Object
var _TDS_ = _TDS_ || {} ; _TDS_.OmoriSaveLoad = _TDS_.OmoriSaveLoad || {};
//=============================================================================
/*:
* @author TDS
* @plugindesc
* Combo Skills port from ACE.
*
*
*/
//=============================================================================
Game_Actor.prototype.faceSaveLoad = function() {
var actor = this.actor();
// When changing these the .png should not be required.
switch (actor.id) {
case 1: // Omori
return "01_OMORI_BATTLE";
case 2: // Aubrey
return "02_AUBREY_BATTLE";
case 3: // Kel
return "03_KEL_BATTLE";
case 4: // Hero
return "04_HERO_BATTLE";
case 8: // Omori
return "01_FA_OMORI_BATTLE";
case 9: // Aubrey
return "02_FA_AUBREY_BATTLE";
case 10: // Kel
return "03_FA_KEL_BATTLE";
case 11: // Hero
return "04_FA_HERO_BATTLE";
default:
return "default_face_image_here"; // if ther is one?
}
};
Game_Actor.prototype.faceSaveLoadIndex = function() {
var actor = this.actor();
// When changing these the .png should not be required.
switch (actor.id) {
case 1: // Omori
return 0;
case 2: // Aubrey
return 0;
case 3: // Kel
return 0;
case 4: // Hero
return 0;
default:
return 0;
}
};
//=============================================================================
// ** DataManager
//-----------------------------------------------------------------------------
// The static class that manages the database and game objects.
//=============================================================================
// Alias Listing
//=============================================================================
_TDS_.OmoriSaveLoad.DataManager_makeSavefileInfo = DataManager.makeSavefileInfo;
//=============================================================================
// * Make Save File Information
//=============================================================================
DataManager.makeSavefileInfo = function() {
// Get Original Info
var info = _TDS_.OmoriSaveLoad.DataManager_makeSavefileInfo.call(this);
// Get Leader
var actor = $gameParty.leader();
info.actorData = {name: actor.name(), level: actor.level, faceName: actor.faceSaveLoad(), faceIndex: actor.faceSaveLoadIndex()};
info.chapter = $gameVariables.value(23);
info.location = $gameMap.displayName();
// Return Info
return info;
};
//=============================================================================
// ** Game_Interpreter
//-----------------------------------------------------------------------------
// The interpreter for running event commands.
//=============================================================================
// * Call Save Menu
//=============================================================================
Game_Interpreter.prototype.callSaveMenu = function(save = true, load = true) {
// Call Save Menu
SceneManager.push(Scene_OmoriFile);
SceneManager._nextScene.setup(save, load);
};
//=============================================================================
// ** Scene_OmoriFile
//-----------------------------------------------------------------------------
// This scene is used to handle saving & loading.
//=============================================================================
function Scene_OmoriFile() { this.initialize.apply(this, arguments); }
Scene_OmoriFile.prototype = Object.create(Scene_Base.prototype);
Scene_OmoriFile.prototype.constructor = Scene_OmoriFile;
//=============================================================================
// * Object Initialization
//=============================================================================
Scene_OmoriFile.prototype.initialize = function() {
this._imageReservationId = 'file';
// Super Call
Scene_Base.prototype.initialize.call(this);
// Save Index
this._saveIndex = -1;
// If Can Select Flag is true
this._canSelect = false;
// Set Load Success Flag
this._loadSuccess = false;
// Set Save & Load Flags
this._canSave = true; this._canLoad = true;
};
//=============================================================================
// * Initialize Atlas Lists
//=============================================================================
Scene_OmoriFile.prototype.initAtlastLists = function() {
// Super Call
Scene_Base.prototype.initAtlastLists.call(this);
};
//=============================================================================
// * Load Reserved Bitmaps
//=============================================================================
Scene_OmoriFile.prototype.loadReservedBitmaps = function() {
// Super Call
Scene_Base.prototype.loadReservedBitmaps.call(this);
// Go through save files
for (var i = 1; i < 5; i++) {
// Get Save Info
const info = DataManager.loadSavefileInfo(i);
// If Information Exists
if (info) {
// Get Actor Data
const actor = info.actorData;
// Reserve Face Image
ImageManager.reserveFace(actor.faceName, actor.faceIndex, this._imageReservationId);
};
}
ImageManager.reserveSystem('faceset_states', 0, this._imageReservationId);
ImageManager.reserveParallax('polaroidBG_BS_sky', 0, this._imageReservationId);
};
//=============================================================================
// * Terminate
//=============================================================================
Scene_OmoriFile.prototype.setup = function(save, load) {
// Set Save & Load Flags
this._canSave = save; this._canLoad = load;
};
//=============================================================================
// * Terminate
//=============================================================================
Scene_OmoriFile.prototype.terminate = function() {
Scene_Base.prototype.terminate.call(this);
if (this._loadSuccess) {
$gameSystem.onAfterLoad();
};
};
//=============================================================================
// * Create
//=============================================================================
Scene_OmoriFile.prototype.create = function() {
// Super Call
Scene_Base.prototype.create.call(this);
// Create Background
this.createBackground();
this.createCommandWindow();
this.createfileWindows();
// Create Prompt Window
this.createPromptWindow();
};
//=============================================================================
// * Create Background
//=============================================================================
Scene_OmoriFile.prototype.createBackground = function() {
// Create Background Sprite
this._backgroundSprite = new TilingSprite();
this._backgroundSprite.bitmap = ImageManager.loadParallax('SAVE_MENU_BG');
this._backgroundSprite.move(0, 0, Graphics.width, Graphics.height);
this.addChild(this._backgroundSprite);
// let centerWidth = 42
// let bitmap = new Bitmap(Graphics.width, Graphics.height);
// bitmap.fillRect(0, 0, centerWidth, bitmap.height, 'rgba(255, 0, 0, 1)');
// bitmap.fillRect(bitmap.width - centerWidth, 0, centerWidth, bitmap.height, 'rgba(255, 0, 0, 1)');
// this._centerSprite = new Sprite(bitmap);
// this.addChild(this._centerSprite);
};
//=============================================================================
// * Create Command Window
//=============================================================================
Scene_OmoriFile.prototype.createCommandWindow = function() {
// Create Command Window
this._commandWindow = new Window_OmoriFileCommand();
this._commandWindow.setupFile(this._canSave, this._canLoad);
this._commandWindow.setHandler('ok', this.onCommandWindowOk.bind(this));
this._commandWindow.setHandler('cancel', this.onCommandWindowCancel.bind(this));
this.addChild(this._commandWindow);
};
//=============================================================================
// * Create File Windows
//=============================================================================
Scene_OmoriFile.prototype.createfileWindows = function() {
// Initialize File Windows Array
this._fileWindows = [];
let sx = this._commandWindow.x + this._commandWindow.width + 1;
// Iterate 3 times
for (var i = 0; i < 6; i++) {
// Create Window
var win = new Window_OmoriFileInformation(i);
win.x = sx;
win.y = 28 + (i * (win.height + 1))
// Set Window
this._fileWindows[i] = win;
this.addChild(win);
};
};
//=============================================================================
// * Create Prompt Window
//=============================================================================
Scene_OmoriFile.prototype.createPromptWindow = function() {
// Create Prompt Window
this._promptWindow = new Window_OmoriFilePrompt();
// Set Handlers
this._promptWindow.setHandler('ok', this.onPromptWindowOk.bind(this));
this._promptWindow.setHandler('cancel', this.onPromptWindowCancel.bind(this));
this._promptWindow.close();
this._promptWindow.openness = 0;
this._promptWindow.deactivate();
this.addChild(this._promptWindow);
};
//=============================================================================
// * Frame Update
//=============================================================================
Scene_OmoriFile.prototype.update = function() {
// Super Call
Scene_Base.prototype.update.call(this);
// Update Background
this.updateBackground();
// Update Select Input
if (this._canSelect) { this.updateSelectInput(); };
// if (Input.isTriggered('control')) {
// // this.onSavefileOk();
// for (var i = 0; i < this._fileWindows.length; i++) {
// // Set Window
// this._fileWindows[i].refresh();
// };
// };
};
//=============================================================================
// * Get Save File ID
//=============================================================================
Scene_OmoriFile.prototype.savefileId = function() { return this._saveIndex + 1; };
//=============================================================================
// * Check if out of bounds
//=============================================================================
Scene_OmoriFile.prototype.isOutOfBounds = function() {
let index = this._saveIndex;
let win = this._fileWindows[index];
if(win.y + win.height > Graphics.boxHeight) {return -28}
if(index === 0) {
if(win.y < 28) {return 28}
}
if(win.y < 0) {return 28}
return 0;
}
//=============================================================================
// * Update Save Index Cursor
//=============================================================================
Scene_OmoriFile.prototype.updateSaveIndexCursor = function() {
// Go Through File Windows
for (var i = 0; i < this._fileWindows.length; i++) {
// Get Window
var win = this._fileWindows[i];
// Set Selected STate
this._saveIndex === i ? win.select() : win.deselect();
};
};
//=============================================================================
// * Update Background
//=============================================================================
Scene_OmoriFile.prototype.updateBackground = function() {
this._backgroundSprite.origin.y += 1;
};
//=============================================================================
// * Update Select Background
//=============================================================================
Scene_OmoriFile.prototype.updateSelectInput = function() {
// If Ok
if (Input.isTriggered('ok')) {
// Call On Select Input Ok
this.onSelectInputOk();
return;
};
// If Cancel
if (Input.isTriggered('cancel')) {
// Play Cancel Sound
SoundManager.playCancel();
// On Select Input Cancel
this.onSelectInputCancel();
return;
};
// If Input Is repeated Up
if (Input.isRepeated('up')) {
// Play Cursor
SoundManager.playCursor();
// If Save index is 0
if (this._saveIndex === 0) {
// Set Save Index at the end
this._saveIndex = this._fileWindows.length-1;
} else {
// Decrease Save Index
this._saveIndex = (this._saveIndex - 1) % this._fileWindows.length;
}
// Update Save Index Cursor
this.updateSaveIndexCursor();
return;
};
// If Input Is repeated Down
if (Input.isRepeated('down')) {
// Play Cursor
SoundManager.playCursor();
// Increase Save Index
this._saveIndex = (this._saveIndex + 1) % this._fileWindows.length;
// Update Save Index Cursor
this.updateSaveIndexCursor();
return;
};
this.updatePlacement();
};
Scene_OmoriFile.prototype.updatePlacement = function() {
if(this._saveIndex < 0) {return;}
let bounds = this.isOutOfBounds();
if(!bounds) {return;}
for(let win of this._fileWindows) {
win.y += bounds;
}
}
//=============================================================================
// * On Command Window Ok
//=============================================================================
Scene_OmoriFile.prototype.onCommandWindowOk = function() {
// Set Can select Flag to true
this._canSelect = true;
// Set Save Index to 0
let latestFile = !!this._canSave ? DataManager.lastAccessedSavefileId() : DataManager.latestSavefileId();
let maxSavefiles = 6;
this._saveIndex = (latestFile - 1) % maxSavefiles;
// Update Save Index Cursor
this.updateSaveIndexCursor();
};
//=============================================================================
// * On Command Window Cancel
//=============================================================================
Scene_OmoriFile.prototype.onCommandWindowCancel = function() {
// If Previous scene is title screen
var isTitleScreen = SceneManager.isPreviousScene(Scene_OmoriTitleScreen);
// Pop Scene
this.popScene();
// If Previous scene is tile scene
if (isTitleScreen) {
// Prepare Title Scene
SceneManager._nextScene.prepare(1);
}
};
//=============================================================================
// * On Select Input Ok
//=============================================================================
Scene_OmoriFile.prototype.onSelectInputOk = function() {
// Get Index
var index = this._commandWindow.index();
// Get Save File ID
var saveFileid = this.savefileId();
// If Save
if (index === 0) {
// If File Exists
if (StorageManager.exists(saveFileid)) {
// Show Prompt Window
this.showPromptWindow('Reescrever?');
// Set Can select Flag to false
this._canSelect = false;
} else {
// Save The Game
this.saveGame();
};
} else {
// If File Exists
if (StorageManager.exists(saveFileid)) {
// Show Prompt Window
this.showPromptWindow('Abrir o arquivo?');
// Set Can select Flag to false
this._canSelect = false;
} else {
// Play Buzzer Sound
SoundManager.playBuzzer();
};
};
};
//=============================================================================
// * On Select Input Cancel
//=============================================================================
Scene_OmoriFile.prototype.onSelectInputCancel = function() {
// Set Can select Flag to false
this._canSelect = false;
// Set Save Index to -1
this._saveIndex = -1;
// Update Save Index Cursor
this.updateSaveIndexCursor();
// Activate Command Window
this._commandWindow.activate();
};
//=============================================================================
// * Show Prompt Window
//=============================================================================
Scene_OmoriFile.prototype.showPromptWindow = function(text) {
// Set Prompt Window Text
this._promptWindow.setPromptText(text);
// Show Prompt Window
this._promptWindow.open();
this._promptWindow.select(1);
this._promptWindow.activate();
};
//=============================================================================
// * On Prompt Window Ok
//=============================================================================
Scene_OmoriFile.prototype.onPromptWindowOk = function() {
// Get Index
var index = this._commandWindow.index();
// If Save
if (index === 0) {
// Save The Game
this.saveGame();
// Close Prompt Window
this._promptWindow.close();
this._promptWindow.deactivate();
// Set Can select Flag to true
this._canSelect = true;
} else {
// Load Game
this.loadGame();
};
};
//=============================================================================
// * On Prompt Window Cancel
//=============================================================================
Scene_OmoriFile.prototype.onPromptWindowCancel = function() {
// Close Prompt Window
this._promptWindow.close();
this._promptWindow.deactivate();
// Set Can select Flag to true
this._canSelect = true;
};
//=============================================================================
// * Save Game
//=============================================================================
Scene_OmoriFile.prototype.saveGame = function() {
// On Before Save
$gameSystem.onBeforeSave();
// Get Save File ID
var saveFileid = this.savefileId();
// Get File Window
var fileWindow = this._fileWindows[this._saveIndex];
// Save Game
if (DataManager.saveGame(saveFileid)) {
SoundManager.playSave();
StorageManager.cleanBackup(saveFileid);
fileWindow.refresh();
} else {
SoundManager.playBuzzer();
};
// Deactivate Prompt Window
this._promptWindow.deactivate();
this._promptWindow.close();
// Set Can select Flag to false
this._canSelect = true;
// Update Save Index Cursor
this.updateSaveIndexCursor();
};
//=============================================================================
// * Load Game
//=============================================================================
Scene_OmoriFile.prototype.loadGame = function() {
if (DataManager.loadGame(this.savefileId())) {
SoundManager.playLoad();
this.fadeOutAll();
// Reload Map if Updated
if ($gameSystem.versionId() !== $dataSystem.versionId) {
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
$gamePlayer.requestMapReload();
};
SceneManager.goto(Scene_Map);
this._loadSuccess = true;
// Close Prompt Window
this._promptWindow.close();
this._promptWindow.deactivate();
} else {
// Play Buzzer
SoundManager.playBuzzer();
// Close Prompt Window
this._promptWindow.close();
this._promptWindow.deactivate();
// Set Can select Flag to true
this._canSelect = true;
};
};
//=============================================================================
// ** Window_OmoriFileInformation
//-----------------------------------------------------------------------------
// The window for showing picture items for sorting
//=============================================================================
function Window_OmoriFileInformation() { this.initialize.apply(this, arguments); };
Window_OmoriFileInformation.prototype = Object.create(Window_Base.prototype);
Window_OmoriFileInformation.prototype.constructor = Window_OmoriFileInformation;
//=============================================================================
// * Object Initialization
//=============================================================================
Window_OmoriFileInformation.prototype.initialize = function(index) {
// Set Index
this._index = index;
// Super Call
Window_Base.prototype.initialize.call(this, 0, 0, this.windowWidth(), this.windowHeight());
// Create Cursor Sprite
this.createCursorSprite();
// Refresh
this.refresh();
// Deselect
this.deselect();
};
//=============================================================================
// * Settings
//=============================================================================
Window_OmoriFileInformation.prototype.standardPadding = function() { return 4}
Window_OmoriFileInformation.prototype.windowWidth = function () { return 382 + 54; };
Window_OmoriFileInformation.prototype.windowHeight = function() { return 142; }
//=============================================================================
// * Create Cursor Sprite
//=============================================================================
Window_OmoriFileInformation.prototype.createCursorSprite = function() {
// Create Cursor Sprite
this._cursorSprite = new Sprite_WindowCustomCursor();
this._cursorSprite.x = 10//-32;
this._cursorSprite.y = 20;
this.addChild(this._cursorSprite);
};
//=============================================================================
// * Select
//=============================================================================
Window_OmoriFileInformation.prototype.select = function() {
this._cursorSprite.visible = true;
this.contentsOpacity = 255;
};
//=============================================================================
// * Deselect
//=============================================================================
Window_OmoriFileInformation.prototype.deselect = function() {
this._cursorSprite.visible = false;
this.contentsOpacity = 100;
};
//=============================================================================
// * Refresh
//=============================================================================
Window_OmoriFileInformation.prototype.refresh = function() {
// Clear Contents
this.contents.clear();
// Get Color
var color = 'rgba(255, 255, 255, 1)';
// Get ID
var id = this._index + 1;
var valid = DataManager.isThisGameFile(id);
var info = DataManager.loadSavefileInfo(id);
// Draw Lines
this.contents.fillRect(0, 29, this.contents.width, 3, color);
for (var i = 0; i < 3; i++) {
var y = 55 + (i * 25)
this.contents.fillRect(113, y, this.contents.width - 117, 1, color);
};
// Draw File
this.contents.fontSize = 30;
this.contents.drawText('ARQUIVO ' + id + ':', 10 + 30, -5, 100, this.contents.fontSize);
// If Valid
if (valid) {
this.contents.drawText(info.chapter, 122 + 30, -5, this.contents.width, this.contents.fontSize);
this.contents.fontSize = 28;
let backBitmap = ImageManager.loadSystem('faceset_states');
let width = backBitmap.width / 4;
let height = backBitmap.height / 5;
// this.contents.blt(backBitmap, 0, 0, width, height, 0, 34, width + 10, height);
this.contents.blt(backBitmap, 0, 0, width, height, 1, 33);
// Get Actor
var actor = info.actorData
// Draw Actor Face
this.drawFace(actor.faceName, actor.faceIndex, -2, this.contents.height - Window_Base._faceHeight + 7, Window_Base._faceWidth, height - 2);
// Draw Actor Name
this.contents.fontSize = 24;
this.contents.drawText(actor.name, 118, 30, 100, 24);
// Draw Level
this.contents.drawText('NÍVEL:', 290 + 55, 30, 100, 24);
this.contents.drawText(actor.level, 290 + 55, 30, 70, 24, 'right');
// Draw Total PlayTime
this.contents.drawText('TEMPO DE JOGO:', 118, 55, 200, 24);
this.contents.drawText(info.playtime, 295 + 55, 55, 100, 24);
// Draw Location
this.contents.drawText('LOCAL:', 118, 80, 200, 24);
this.contents.drawText(info.location, 205, 80, 210, 24, 'right');
};
// Draw Border
this.contents.fillRect(102, 32, 3, 102, 'rgba(255, 255, 255, 1)')
this.contents.fillRect(0, 29, 108, 3, 'rgba(255, 255, 255, 1)')
};
//=============================================================================
// ** Window_OmoriFileCommand
//-----------------------------------------------------------------------------
// The window for selecting a command on the menu screen.
//=============================================================================
function Window_OmoriFileCommand() { this.initialize.apply(this, arguments); }
Window_OmoriFileCommand.prototype = Object.create(Window_Command.prototype);
Window_OmoriFileCommand.prototype.constructor = Window_OmoriFileCommand;
//=============================================================================
// * Object Initialization
//=============================================================================
Window_OmoriFileCommand.prototype.initialize = function() {
// Super Call
Window_Command.prototype.initialize.call(this, 42, 28);
// Setup File
this.setupFile(true, true);
};
//=============================================================================
// * Settings
//=============================================================================
Window_OmoriFileCommand.prototype.isUsingCustomCursorRectSprite = function() { return true; };
Window_OmoriFileCommand.prototype.lineHeight = function () { return 24; };
Window_OmoriFileCommand.prototype.windowWidth = function () { return 125; };
Window_OmoriFileCommand.prototype.windowHeight = function () { return 64; };
Window_OmoriFileCommand.prototype.standardPadding = function () { return 4; };
Window_OmoriFileCommand.prototype.numVisibleRows = function () { return 2; };
Window_OmoriFileCommand.prototype.maxCols = function () { return 1; };
Window_OmoriFileCommand.prototype.customCursorRectYOffset = function() { return 5; }
Window_OmoriFileCommand.prototype.customCursorRectTextXOffset = function() { return 30; }
//=============================================================================
// * Setup File
//=============================================================================
Window_OmoriFileCommand.prototype.setupFile = function (save, load) {
// Set Save & Load Flags
this._canSave = save; this._canLoad = load;
if(!!this._canSave) {this.select(0);}
else if(!!this._canLoad) {this.select(1)}
// Refresh
this.refresh();
};
//=============================================================================
// * Make Command List
//=============================================================================
Window_OmoriFileCommand.prototype.makeCommandList = function () {
this.addCommand("SALVAR", 'save', this._canSave);
this.addCommand("ABRIR", 'load', this._canLoad);
};
//=============================================================================
// ** Window_OmoriFilePrompt
//-----------------------------------------------------------------------------
// The window for selecting a command on the menu screen.
//=============================================================================
function Window_OmoriFilePrompt() { this.initialize.apply(this, arguments); }
Window_OmoriFilePrompt.prototype = Object.create(Window_Command.prototype);
Window_OmoriFilePrompt.prototype.constructor = Window_OmoriFilePrompt;
//=============================================================================
// * Object Initialization
//=============================================================================
Window_OmoriFilePrompt.prototype.initialize = function() {
// Super Call
Window_Command.prototype.initialize.call(this, 0, 0);
// Center Window
this.x = (Graphics.width - this.width) / 2;
this.y = (Graphics.height - this.height) / 2;
// Create Cover Sprite
this.createCoverSprite();
};
//=============================================================================
// * Create Background
//=============================================================================
Window_OmoriFilePrompt.prototype.createCoverSprite = function() {
var bitmap = new Bitmap(Graphics.width, Graphics.height);
bitmap.fillAll('rgba(0, 0, 0, 0.5)')
this._coverSprite = new Sprite(bitmap);
this._coverSprite.x = -this.x;
this._coverSprite.y = -this.y;
this.addChildAt(this._coverSprite, 0);
};
//=============================================================================
// * Openness
//=============================================================================
Object.defineProperty(Window.prototype, 'openness', {
get: function() { return this._openness; },
set: function(value) {
if (this._openness !== value) {
this._openness = value.clamp(0, 255);
this._windowSpriteContainer.scale.y = this._openness / 255;
this._windowSpriteContainer.y = this.height / 2 * (1 - this._openness / 255);
if (this._coverSprite) { this._coverSprite.opacity = this._openness; };
}
},
configurable: true
});
//=============================================================================
// * Settings
//=============================================================================
Window_OmoriFilePrompt.prototype.isUsingCustomCursorRectSprite = function() { return true; };
Window_OmoriFilePrompt.prototype.lineHeight = function () { return 22; };
Window_OmoriFilePrompt.prototype.windowWidth = function () { return 220; };
Window_OmoriFilePrompt.prototype.windowHeight = function () { return 70 + 20; };
Window_OmoriFilePrompt.prototype.standardPadding = function () { return 4; };
Window_OmoriFilePrompt.prototype.numVisibleRows = function () { return 2; };
Window_OmoriFilePrompt.prototype.maxCols = function () { return 1; };
Window_OmoriFilePrompt.prototype.customCursorRectXOffset = function() { return 50; }
Window_OmoriFilePrompt.prototype.customCursorRectYOffset = function() { return 33; }
Window_OmoriFilePrompt.prototype.customCursorRectTextXOffset = function() { return 80; }
Window_OmoriFilePrompt.prototype.customCursorRectTextYOffset = function() { return 28; }
//=============================================================================
// * Setup File
//=============================================================================
Window_OmoriFilePrompt.prototype.setPromptText = function (text) {
// Set Prompt Text
this._promptText = text;
// Refresh Contents
this.refresh();
};
//=============================================================================
// * Make Command List
//=============================================================================
Window_OmoriFilePrompt.prototype.makeCommandList = function () {
this.addCommand("SIM", 'ok');
this.addCommand("NÃO", 'cancel');
};
//=============================================================================
// * Refresh
//=============================================================================
Window_OmoriFilePrompt.prototype.refresh = function () {
// Super Call
Window_Command.prototype.refresh.call(this);
this.contents.drawText(this._promptText, 0, 0, this.contents.width, 24, 'center');
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,243 @@
//-----------------------------------------------------------------------------
// OMORI Minigame - Hardware Organization
//-----------------------------------------------------------------------------
Game_Interpreter.prototype.initializeHardwareOrganizing = function() {
var shelf1 = [];
var shelf2 = [];
var shelf3 = [];
var shelf4 = [];
var shelf5 = [];
var shelf6 = [];
$gameSystem.shelves = [];
$gameSystem.shelves.push(shelf1);
$gameSystem.shelves.push(shelf2);
$gameSystem.shelves.push(shelf3);
$gameSystem.shelves.push(shelf4);
$gameSystem.shelves.push(shelf5);
$gameSystem.shelves.push(shelf6);
$gameSystem.products = [
0, 0, 0, 0, 0, 0, // DRILL
10, 10, 10, 10, 10, 10, // TAPE
3, 3, 3, 3, 3, 3, // SHOVEL
4, 4, 4, 4, 4, 4, // SAW
6, 6, 6, 6, 6, 6, // HAMMER
7, 7, 7, 7, 7, 7 // WRENCH
];
//console.log($gameSystem.shelves[5])
var curElement = $gameSystem.products.length;
var temp;
var randomizedLoc;
while (0 !== curElement) {
randomizedLoc = Math.floor(Math.random() * curElement);
curElement -= 1;
temp = $gameSystem.products[curElement];
$gameSystem.products[curElement] = $gameSystem.products[randomizedLoc];
$gameSystem.products[randomizedLoc] = temp;
};
for (var i = 0; i < $gameSystem.shelves.length; i++) {
var shelf = $gameSystem.shelves[i];
for (var j = 0; j < 6; j++) {
shelf.push($gameSystem.products[0]);
$gameSystem.products.shift();
}
}
}
Game_Interpreter.prototype.placeTool = function() {
var shelf = $gameVariables.value(812);
for (var i = 0; i < $gameSystem.shelves[shelf].length; i++) {
if ($gameSystem.shelves[shelf][i] === -1) { // First empty space
// console.log($gameSystem.shelves[shelf][i]);
//
if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_3").text) $gameSystem.shelves[shelf][i] = 0;
else if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_4").text) $gameSystem.shelves[shelf][i] = 10;
else if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_5").text) $gameSystem.shelves[shelf][i] = 3;
else if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_6").text) $gameSystem.shelves[shelf][i] = 4;
else if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_7").text) $gameSystem.shelves[shelf][i] = 6;
else if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_8").text) $gameSystem.shelves[shelf][i] = 7;
break;
}
}
this.checkHardwareOrganization();
/*
console.log("Current Shelf: " + $gameVariables.value(812),
"Index: " + $gameVariables.value(814),
"Selected Item: " + $gameVariables.value(815),
"Currently Held Item: " + $gameVariables.value(813));*/
}
Game_Interpreter.prototype.replaceTool = function() {
var shelf = $gameVariables.value(812);
//
if ($gameVariables.value(813) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_3").text) $gameSystem.shelves[shelf][$gameVariables.value(814)] = 0;
else if ($gameVariables.value(813) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_4").text) $gameSystem.shelves[shelf][$gameVariables.value(814)] = 10;
else if ($gameVariables.value(813) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_5").text) $gameSystem.shelves[shelf][$gameVariables.value(814)] = 3;
else if ($gameVariables.value(813) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_6").text) $gameSystem.shelves[shelf][$gameVariables.value(814)] = 4;
else if ($gameVariables.value(813) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_7").text) $gameSystem.shelves[shelf][$gameVariables.value(814)] = 6;
else if ($gameVariables.value(813) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_8").text) $gameSystem.shelves[shelf][$gameVariables.value(814)] = 7;
this.checkHardwareOrganization();
/*console.log("REPLACING " + "Current Shelf: " + $gameVariables.value(812),
"Index: " + $gameVariables.value(814),
"Selected Item: " + $gameVariables.value(815),
"Currently Held Item: " + $gameVariables.value(813));*/
}
Game_Interpreter.prototype.returnTool = function() {
for (var shelf = 0; shelf < $gameSystem.shelves.length; shelf++) {
console.log(shelf);
for (var i = 0; i < $gameSystem.shelves[shelf].length; i++) {
if ($gameSystem.shelves[shelf][i] === -1) { // First empty space
// console.log($gameSystem.shelves[shelf][i]);
//
if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_3").text) $gameSystem.shelves[shelf][i] = 0;
else if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_4").text) $gameSystem.shelves[shelf][i] = 10;
else if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_5").text) $gameSystem.shelves[shelf][i] = 3;
else if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_6").text) $gameSystem.shelves[shelf][i] = 4;
else if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_7").text) $gameSystem.shelves[shelf][i] = 6;
else if ($gameVariables.value(815) === LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_8").text) $gameSystem.shelves[shelf][i] = 7;
break;
}
}
}
$gameVariables.setValue(813, -1);
$gameVariables.setValue(814, -1);
$gameVariables.setValue(815, 0);
}
var yin_GameInterpreter_setupChoicesShop = Game_Interpreter.prototype.setupChoices;
Game_Interpreter.prototype.setupChoices = function (params) {
if ($gameSwitches.value(804)) {
if (params[0][0] === "Hardware Shelf") {
var shelfNum = $gameVariables.value(812);
var shelfProducts = [];
for (var i = 0; i < $gameSystem.shelves[shelfNum].length; i++) {
if ($gameSystem.shelves[shelfNum][i] === -1) continue;
else if ($gameSystem.shelves[shelfNum][i] === 0) shelfProducts.push(LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_3").text);
else if ($gameSystem.shelves[shelfNum][i] === 10) shelfProducts.push(LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_4").text);
else if ($gameSystem.shelves[shelfNum][i] === 3) shelfProducts.push(LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_5").text);
else if ($gameSystem.shelves[shelfNum][i] === 4) shelfProducts.push(LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_6").text);
else if ($gameSystem.shelves[shelfNum][i] === 6) shelfProducts.push(LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_7").text);
else if ($gameSystem.shelves[shelfNum][i] === 7) shelfProducts.push(LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_8").text);
}
// for (var i = 0; i < $gameSystem.shelves[shelfNum].length; i++) {
// console.log("Shelf " + shelfNum + " Contents: " + this.getToolName($gameSystem.shelves[shelfNum][i]));
// }
// console.log("Shelf " + shelfNum + " Options List: " + shelfProducts);
shelfProducts.push(LanguageManager.getMessageData("farawaytown_extras_pizzaminigame.message_17").text);
}
var choices = shelfProducts ? shelfProducts : params[0].clone();
var cancelType = params[1];
var defaultType = params.length > 2 ? params[2] : 0;
var positionType = params.length > 3 ? params[3] : 2;
var background = params.length > 4 ? params[4] : 0;
// console.log(choices);
$gameMessage.setChoices(choices, defaultType, cancelType);
$gameMessage.setChoiceBackground(background);
$gameMessage.setChoicePositionType(positionType);
$gameMessage.setChoiceCallback(function (n) {
this._branch[this._indent] = n;
}.bind(this));
} else yin_GameInterpreter_setupChoicesShop.call(this, params);
};
Game_Interpreter.prototype.getToolName = function(id) {
// console.log(id);
if (id === -1) return "Nothing";
else if (id === 0) return LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_3").text;
else if (id === 1) return LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_4").text;
else if (id === 3) return LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_5").text;
else if (id === 4) return LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_6").text;
else if (id === 6) return LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_7").text;
else if (id === 7) return LanguageManager.getMessageData("farawaytown_extras_hardwareminigame.message_8").text;
}
Game_Interpreter.prototype.checkHardwareOrganization = function() {
for (var i = 0; i < $gameSystem.shelves.length; i++) {
var shelf = $gameSystem.shelves[i];
if (i === 0) var rightfulProduct = 0;
if (i === 1) var rightfulProduct = 4;
if (i === 2) var rightfulProduct = 10;
if (i === 3) var rightfulProduct = 6;
if (i === 4) var rightfulProduct = 3;
if (i === 5) var rightfulProduct = 7;
for (var j = 0; j < shelf.length; j++) {
if (shelf[j] === rightfulProduct) {
// console.log("Shelf " + i + ", Item " + j + ": TRUE");
var result = true;
} else {
// console.log("Shelf " + i + ", Item " + j + ": FALSE");
var result = false;
j = shelf.length;
}
}
if (!result) {
break;
}
// console.log("Shelf " + i + result);
}
// console.log("Everything organized? " + result);
return result;
};
//=============================================================================
// New Game_Character function for tools display
//=============================================================================
Game_Character.prototype.getToolGraphic = function (shelfItem) {
if (shelfItem === 0) {
var x = 0;
var y = 0;
} else if (shelfItem === 10) {
var x = 1;
var y = 3;
} else if (shelfItem === 3) {
var x = 0;
var y = 1;
} else if (shelfItem === 4) {
var x = 1;
var y = 1;
} else if (shelfItem === 6) {
var x = 0;
var y = 2;
} else if (shelfItem === 7) {
var x = 1;
var y = 2;
}
return this.setCustomFrameXY(x, y);
}
//=============================================================================
// Changes specific to the hardware shop minigame
//=============================================================================
var yin_WindowChoiceList_callOkHandlerShop = Window_ChoiceList.prototype.callOkHandler;
Window_ChoiceList.prototype.callOkHandler = function () {
if ($gameSwitches.value(804) && this._list[this.index()].name !== "SIM" && this._list[this.index()].name !== "NÃO") {
if (this._list[this.index()].name == "ESQUECE") {
$gameMap._interpreter.command115();
} else {
$gameVariables.setValue(814, this.index());
$gameVariables.setValue(815, this._list[this.index()].name);
}
}
yin_WindowChoiceList_callOkHandlerShop.call(this);
};
var yin_WindowChoiceList_numVisibleRowsHardware = Window_ChoiceList.prototype.numVisibleRows;
Window_ChoiceList.prototype.numVisibleRows = function () {
if ($gameSwitches.value(804)) {
var choices = $gameMessage.choices();
var numLines = choices.length > 7 ? 7 : choices.length;
return numLines;
}
return yin_WindowChoiceList_numVisibleRowsHardware.call(this);
};

View file

@ -0,0 +1,150 @@
//-----------------------------------------------------------------------------
// OMORI Minigame - Jukebox
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Show Choice Edits
//-----------------------------------------------------------------------------
var yin_GameInterpreter_setupChoicesJukebox = Game_Interpreter.prototype.setupChoices;
Game_Interpreter.prototype.setupChoices = function (params) {
if ($gameSystem._jukeboxList) console.log($gameSystem._jukeboxList.filter(function(x) { console.log(x, params[0][0]); return params[0][0] == x}));
if (params[0][0] === "JukeboxList" || ($gameSystem._jukeboxList && $gameSystem._jukeboxList.contains(params[0][0]))) {
params[0] = [];
params[0] = params[0].concat($gameSystem._jukeboxList);
if (!params[0].contains(["NEVERMIND, NEVERMIND"]) || params[0].contains(['farawaytown_extras_pizzaminigame.message_17', 'farawaytown_extras_pizzaminigame.message_17'])) {
//console.log("PUSH NEVERMIND");
params[0].push(['farawaytown_extras_pizzaminigame.message_17', 'farawaytown_extras_pizzaminigame.message_17']);
}
console.log(params[0]);
}
yin_GameInterpreter_setupChoicesJukebox.call(this, params);
};
//=============================================================================
// Window_ChoiceList Edits
//=============================================================================
var yin_WindowChoiceList_callOkHandlerJukebox = Window_ChoiceList.prototype.callOkHandler;
Window_ChoiceList.prototype.callOkHandler = function () {
if ($gameSystem._jukeboxOn) {
if (this._list[this.index()].name == "ESQUECE") {
$gameMap._interpreter.command115();
} else {
console.log(LanguageManager.getMessageData($gameSystem._jukeboxList[this.index()][0]).text);
if (LanguageManager.getMessageData($gameSystem._jukeboxList[this.index()][0]).text == "jb_omniboi") { // CHILL CD volume
var bgm = {
name: LanguageManager.getMessageData($gameSystem._jukeboxList[this.index()][0]).text,
volume: 90,
pitch: 100,
pan: 0
};
} else {
var bgm = {
name: LanguageManager.getMessageData($gameSystem._jukeboxList[this.index()][0]).text,
volume: 100,
pitch: 100,
pan: 0
};
}
AudioManager.playBgm(bgm);
}
$gameSystem._jukeboxOn = false;
}
yin_WindowChoiceList_callOkHandlerJukebox.call(this);
};
var yin_WindowChoiceList_makeCommandListJukebox = Window_ChoiceList.prototype.makeCommandList;
Window_ChoiceList.prototype.makeCommandList = function () {
if ($gameSystem._jukeboxOn) {
for (var i = 0; i < $gameMessage.choices().length; i++) {
if ($gameMessage.choices()[i][0].contains("farawaytown_")) {
var item = LanguageManager.getMessageData($gameMessage.choices()[i][1]).text;
$gameMessage.choices()[i] = item.toUpperCase();
}
}
}
yin_WindowChoiceList_makeCommandListJukebox.call(this);
};
var yin_WindowChoiceList_numVisibleRowsJukebox = Window_ChoiceList.prototype.numVisibleRows;
Window_ChoiceList.prototype.numVisibleRows = function () {
if ($gameSystem._jukeboxOn) {
var choices = $gameMessage.choices();
var numLines = choices.length > 11 ? 11 : choices.length;
return numLines;
}
return yin_WindowChoiceList_numVisibleRowsJukebox.call(this);
};
var yin_Window_ChoiceList_maxChoiceWidth = Window_ChoiceList.prototype.maxChoiceWidth;
Window_ChoiceList.prototype.maxChoiceWidth = function () {
if ($gameSystem._jukeboxOn) {
var maxWidth = 96;
var choices = $gameMessage.choices();
for (var i = 0; i < choices.length; i++) {
if ($gameMessage.choices()[i][0].contains("farawaytown_")) {
var choiceWidth = this.textWidthEx(LanguageManager.getMessageData(choices[i][1]).text) + this.textPadding() * 2;
} else {
//console.log(choices[i]);
var choiceWidth = this.textWidthEx(choices[i]) + this.textPadding() * 2;
}
if (maxWidth < choiceWidth) {
maxWidth = choiceWidth;
}
}
return maxWidth + 32 + this.textPadding();
} else {
return yin_Window_ChoiceList_maxChoiceWidth.call(this);
}
};
//=============================================================================
// Game_System Edits and Additions
//=============================================================================
var yin_GameSystem_initializeJukebox = Game_System.prototype.initialize;
Game_System.prototype.initialize = function() {
yin_GameSystem_initializeJukebox.call(this);
this._jukeboxListFull = { // All CD Items
// Format: CD Item ID (For checking if the player has the CD):[language file to the filename (To play the correct song based on the item), language file to the song name (for the choice list)]
198: ['sidequest_farawaytown_ginojukebox.message_20', 'sidequest_farawaytown_ginojukebox.message_200'],
199: ['sidequest_farawaytown_ginojukebox.message_21', 'sidequest_farawaytown_ginojukebox.message_201'],
200: ['sidequest_farawaytown_ginojukebox.message_22', 'sidequest_farawaytown_ginojukebox.message_202'],
201: ['sidequest_farawaytown_ginojukebox.message_23', 'sidequest_farawaytown_ginojukebox.message_203'],
202: ['sidequest_farawaytown_ginojukebox.message_24', 'sidequest_farawaytown_ginojukebox.message_204'],
203: ['sidequest_farawaytown_ginojukebox.message_25', 'sidequest_farawaytown_ginojukebox.message_205'],
204: ['sidequest_farawaytown_ginojukebox.message_26', 'sidequest_farawaytown_ginojukebox.message_206'],
205: ['sidequest_farawaytown_ginojukebox.message_27', 'sidequest_farawaytown_ginojukebox.message_207'],
206: ['sidequest_farawaytown_ginojukebox.message_28', 'sidequest_farawaytown_ginojukebox.message_208'],
207: ['sidequest_farawaytown_ginojukebox.message_29', 'sidequest_farawaytown_ginojukebox.message_209'],
208: ['sidequest_farawaytown_ginojukebox.message_30', 'sidequest_farawaytown_ginojukebox.message_210'],
209: ['sidequest_farawaytown_ginojukebox.message_31', 'sidequest_farawaytown_ginojukebox.message_211'],
210: ['sidequest_farawaytown_ginojukebox.message_32', 'sidequest_farawaytown_ginojukebox.message_212']
};
this._jukeboxList = [];
}
Game_System.prototype.addJukeboxItem = function(songID) {
this._jukeboxList.push(this._jukeboxListFull[songID]);
$gameParty.gainItem($dataItems[songID], -1)
var jukeboxCDs = [ // IDs of CD items (in the database)
198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210
];
if (this._jukeboxList.length >= jukeboxCDs.length){
$gameSystem.unlockAchievement("MUSIC_CONNOISSEUR_OF_SORTS")
}
}
Game_System.prototype.playerHasCD = function() {
var jukeboxCDs = [ // IDs of CD items (in the database)
198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210
];
var cdsInInventory = [];
for (var i = 0; i < jukeboxCDs.length; i++) {
if ($gameParty.hasItem($dataItems[jukeboxCDs[i]])) {
cdsInInventory.push($dataItems[jukeboxCDs[i]].id);
$gameVariables.setValue(829, $dataItems[jukeboxCDs[i]].name);
$gameVariables.setValue(830, $dataItems[jukeboxCDs[i]].id);
}
}
return cdsInInventory;
}

View file

@ -0,0 +1,500 @@
//-----------------------------------------------------------------------------
// OMORI Fixes
//-----------------------------------------------------------------------------
//=============================================================================
// Longer fade after loading the game
//=============================================================================
Scene_Map.prototype.start = function() {
Scene_Base.prototype.start.call(this);
SceneManager.clearStack();
if (SceneManager.isPreviousScene(Scene_OmoriFile)) {
this.startFadeIn(this.fadeSpeed(), false);
} else if (this._transfer) {
this.fadeInForTransfer();
this._mapNameWindow.open();
$gameMap.autoplay();
} else if (this.needsFadeIn()) {
this.startFadeIn(this.fadeSpeed(), false);
}
this.menuCalling = false;
};
//-----------------------------------------------------------------------------
// Parallax Before Tiles on Load Fix (Overwritten)
//-----------------------------------------------------------------------------
Scene_Map.prototype.update = function() {
this.updateDestination();
this.updateMainMultiply();
if (this.isSceneChangeOk()) {
this.updateScene();
} else if (SceneManager.isNextScene(Scene_Battle)) {
this.updateEncounterEffect();
}
this.updateWaitCount();
Scene_Base.prototype.update.call(this);
if (!Yanfly._openedConsole) Yanfly.openConsole();
this.updateCharacterTagInput();
};
//-----------------------------------------------------------------------------
// Emotion Elements Not Being Applied To Attacks Fix (Some Overwrites)
//-----------------------------------------------------------------------------
Game_Action.prototype.calcElementRate = function(target) {
/*if (this.item().damage.elementId < 0) {
return this.elementsMaxRate(target, this.subject().attackElements());
} else {*/
// YIN Instead of bypassing the subject's attack element, we want to use it if they are inflicted with an emotion.
// If elementId == None or Normal Attack
if (this.item().damage.elementId < 1) {
// These are all base emotion states (non afraid)
var emotionStates = [6, 7, 8, 10, 11, 12, 14, 15, 16];
emotionStates = [...emotionStates, 119,120,121]; // Space Ex Boyfriend
emotionStates = [...emotionStates, 122,123,197]; // Sweetheart
emotionStates = [...emotionStates, 124,125,126]; // Unbread Twins
// Search states for emotion states
var emotionAfflicted;
this.subject()._states.forEach(function(stateId) {
// Do we have an emotion state on us?
if (emotionStates.contains(stateId)) {
emotionAfflicted = true;
}
}, this);
if (emotionAfflicted) {
return target.elementRate(this.subject().attackElements()[0]); // If so, that is our attack element
} else {
return target.elementRate(this.item().damage.elementId);
}
} else {
return target.elementRate(this.item().damage.elementId);
}
//}
};
//-----------------------------------------------------------------------------
// This allows an "effective/not effective" sound
//-----------------------------------------------------------------------------
Game_Action.prototype.apply = function(target) {
// Run Original Function
_TDS_.OmoriBattleSystem.Game_Action_apply.call(this, target);
// Get Result
let result = target.result();
// Check iff hit
let hit = result.isHit();
// If Hit
if (hit) {
// Get Element Rate
let elementRate = this.calcElementRate(target);
// Set elemental results
result.elementStrong = elementRate > 1;
result.elementWeak = elementRate < 1;
if (result.hpDamage > 0) {
if(!!result.critical) {
AudioManager.playSe({ name: "BA_CRITICAL_HIT", volume: 250, pitch: 100, pan: 0});
}
else if (result.elementStrong) {
AudioManager.playSe({ name: "se_impact_double", volume: 150, pitch: 100, pan: 0});
} else if (result.elementWeak){
AudioManager.playSe({ name: "se_impact_soft", volume: 150, pitch: 100, pan: 0});
} else {
SoundManager.playEnemyDamage();
}
}
};
// If Target is an enemy
if (target.isEnemy()) {
// Get Item
let item = this.item();
// If result was a hit
if (hit) {
// If scanning enemy
if (item && item.meta.ScanEnemy && target.canScan()) {
// Scan Enemy
$gameParty.addScannedEnemy(target.enemyId());
};
};
} else {
// If result was a hit
if (hit) {
// If HP damage is more than 0
if (result.hpDamage > 0) {
// Increase Stress Count
$gameParty.stressEnergyCount++;
};
};
};
}
Yanfly.SVE.Game_Enemy_performDamage = Game_Enemy.prototype.performDamage;
Game_Enemy.prototype.performDamage = function() {
if (!this.hasSVBattler()) {
return Yanfly.SVE.Game_Enemy_performDamage.call(this);
}
Game_Battler.prototype.performDamage.call(this);
if (this.isSpriteVisible()) {
this.requestMotion(this.damageMotion());
} else {
$gameScreen.startShake(5, 5, 10);
}
};
Game_Actor.prototype.performDamage = function() {
Game_Battler.prototype.performDamage.call(this);
if (this.isSpriteVisible()) {
this.requestMotion('damage');
} else {
$gameScreen.startShake(5, 5, 10);
}
};
//-----------------------------------------------------------------------------
// Bad Word Filter
//-----------------------------------------------------------------------------
var yinBadWords_init = Game_System.prototype.initialize;
Game_System.prototype.initialize = function() {
yinBadWords_init.call(this);
this._badWords = [ // Bad words should be all lowercase!
// Bad Words
"aids","anal","anus","areola","arse","ass","balls","bastard ","beaner","berk","biatch","bint","bitch",
"blow","bogan","boner","boob","boom","breast","butt","cancer","chav","chink","clit","cocaine","cock",
"coitus","commie","condom","coolie","coon","coomer","cracker","crap","crotch","cum","cunt","damn","ferro",
"dago","dick","dildo","dilf","dong","drug","dumb","dyke","enema","erect","eskimo","fag","feck","fuck",
"gay","gipsy","gfy","gook","gringo","gyp","hardon","heroin","herpes","hiv","hoe","hole","homo","honk",
"hooker","horny","hymen","idiot","incest","injun","jap","jerkoff","jew","jigger ","jiz ","jizz","jock",
"juggalo","kaffir","kafir","kigger","killer","kink","kkk","kock","koon","kotex","krap","kum","kunt",
"lesbian","lesbo","loli","lsd","lube","lynch","mammy","meth","mick","milf","molest","mom","mong","moron",
"muff","mulatto","muncher","munt","murder","muslim","nazi","negress ","negro","n1g","nlg","nig","nip",
"nlgger","noonan","nooner","nuke","nut","oral","orga","orgies","orgy","oriental","paddy","pakeha","paki",
"pansies","pansy","peni5","pen15","penis","perv","phuc","phuk","phuq","pi55","pimp","piss","playboy","pocha",
"pocho","pohm","polack","poon","poop","porn","pu55i","pu55y","pube","puss","pygmy","quashie","queef","queer",
"quim","racist","raghead","randy","rape","rapist","rectum","redneck","redskin","reefer","reestie","reject",
"retard","rigger","rimjob","root","rump","russki","savage","scag","scat","schizo","schlong","screw","scrotum",
"scrub","semen","sex","shag","shat","shit","skank","skum","slag","slant","slave","slut","smut","snatch","snot",
"sodom","spade","spaz","sperm","spooge","spunk","squaw","strip","stupid","suicide","syphilis","tampon","tard",
"teat","terrorist","teste","testicle","thot","tit","toilet","tramp","trannie","tranny","trojan","turd","twat","twink",
"urine","uterus","vagina","vaginal","vibrate","virgin","vomit","vulva","wank","weenie","weewee","wetback",
"whigger","whiskey","whitey","whore","wigger","willie","willy","wog","wop","wtf","wuss","xtc","xxx","yank",
"yid","zigabo",
// Names
"aubrey","basil","bundy","gacy","hector","hero","hitler","jawsum","jinping","kel","kimjong","little","mari",
"oj","osama","pluto","polly","putin","ripper","rococo","stalin","trump","zodiac",
// Foreign Language Bad Words
"puto","puta","cuck","mierda","pendejo","Nigga","Nibba","trap","perra","faggot","dilldoe","blacky","pniss",
"biden","omori",
];
}
Window_OmoriInputLetters.prototype.onNameOk = function() {
// Get Text
var text = this._nameWindow.name();
// If Text Length is more than 0
if (text.length > 0) {
if(text.toLowerCase() === "omocat") {
$gameSystem.unlockAchievement("YOU_THINK_YOU_RE_CLEVER_HUH")
}
if (new RegExp($gameSystem._badWords.join("|")).test(text.toLowerCase())) { // YIN - Bad words check
this.playBuzzerSound();
return;
}
this.deactivate();
this.close();
this._nameWindow.close();
if (_TDS_.NameInput.params.nameVariableID > 0) {
$gameVariables.setValue(_TDS_.NameInput.params.nameVariableID, text);
};
} else {
this.playBuzzerSound();
};
};
//-----------------------------------------------------------------------------
// Title Screen Switch Check
//-----------------------------------------------------------------------------
DataManager.writeToFile = function(text, filename) {
var fs = require('fs');
var dirPath = StorageManager.localFileDirectoryPath();
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath);
}
// console.log("Writing File: " + filename + " Text: " + text);
fs.writeFileSync(dirPath + '/' + filename, text);
}
DataManager.writeToFileAsync = function(text, filename, callback) {
var fs = require('fs');
var dirPath = StorageManager.localFileDirectoryPath();
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath);
}
// console.log("Writing File: " + filename + " Text: " + text);
//fs.writeFileSync(dirPath + '/' + filename, text);
fs.writeFile(dirPath + '/' + filename, text, (err) => {
if(!!callback) {callback()}
})
}
DataManager.readFromFile = function(filename) {
var fs = require('fs');
var dirPath = StorageManager.localFileDirectoryPath();
if (!fs.existsSync(dirPath + '/' + filename)) {
return 0;
}
// console.log("Reading File: " + fs.readFileSync(dirPath + '/' + filename));
return fs.readFileSync(dirPath + '/' + filename, "utf-8");
}
Scene_OmoriFile.prototype.createWaitingWindow = function() {
let ww = Math.floor(Graphics.boxWidth/3);
let wh = Window_Base.prototype.lineHeight.call(this) + 16;
this._waitingWindow = new Window_Base(Math.ceil(Graphics.boxWidth / 2 - ww/2), Math.ceil(Graphics.boxHeight / 2 - wh/2));
this._waitingWindow.hide();
this.addChild(this._waitingWindow);
const MAX_TIME = 3;
this._waitingWindow.saveString = TextManager.message("saveWait");
this._waitingWindow.wait = MAX_TIME;
this._waitingWindow.refresh = function() {
if(this.wait > 0) {return this.wait--;}
this.saveString += ".";
this.contents.clear();
this.drawText(this.saveString,0,0,this.contents.width,"center");
this.wait = MAX_TIME;
if(this.saveString.contains("...")) {this.saveString.replace("...", "")}
}
this._waitingWindow.clear = function() {
this.saveString = TextManager.message("saveWait");
this.wait = MAX_TIME;
this.hide();
}
this._waitingWindow.update = function() {
Window_Base.prototype.update.call(this);
if(!this.visible) {return;}
this.refresh();
}
}
const _old_scene_OmoriFile_create = Scene_OmoriFile.prototype.create;
Scene_OmoriFile.prototype.create = function() {
_old_scene_OmoriFile_create.call(this);
this.createWaitingWindow(); // Create New Waiting Window
}
Scene_OmoriFile.prototype.backupSaveFile = function(callback) {
/*const fs = require("fs");
const ncp = require("ncp");
const pp = require("path")
const savePath = StorageManager.localFileDirectoryPath();
const destination_folder = pp.join(Permanent_Manager.dataFolder(), Permanent_Manager.determineOmoriFolder()); // Taking this from my Permanent Manager system;
ncp(savePath, destination_folder + "save", () => {
if(!!callback) {callback()}
})*/
callback();
}
Scene_OmoriFile.prototype.saveGame = function() {
// On Before Save
$gameSystem.onBeforeSave();
// Get Save File ID
var saveFileid = this.savefileId();
// Get File Window
var fileWindow = this._fileWindows[this._saveIndex];
// Save Game
this._promptWindow.deactivate();
this._promptWindow.close();
this._waitingWindow.show(); // Show Waiting Window;
if (DataManager.saveGame(saveFileid)) {
SoundManager.playSave();
StorageManager.cleanBackup(saveFileid);
var world;
if($gameSwitches.value(448) && $gameSwitches.value(447)) {
world = 449 // Special Flag When both the switches are on;
}
else if ($gameSwitches.value(448)) {
world = 448;
} else if ($gameSwitches.value(447)) {
world = 447;
} else if ($gameSwitches.value(446)) {
world = 446;
} else if ($gameSwitches.value(445)) {
world = 445;
} else if ($gameSwitches.value(444)) {
world = 444;
} else {
world = 0
}
DataManager.writeToFileAsync(world, "TITLEDATA", () => {
this.backupSaveFile(() => {
fileWindow.refresh();
// Deactivate Prompt Window
this._waitingWindow.clear();
// Set Can select Flag to false
this._canSelect = true;
// Update Save Index Cursor
this.updateSaveIndexCursor();
})
});
// console.log(world);
} else {
SoundManager.playBuzzer();
// Deactivate Prompt Window
this._promptWindow.deactivate();
this._promptWindow.close();
// Set Can select Flag to false
this._canSelect = true;
// Update Save Index Cursor
this.updateSaveIndexCursor();
};
};
//---------------------------------------------------------------------------
// Retry Audio Fix
//---------------------------------------------------------------------------
Scene_Gameover.prototype.updateRetryInput = function() {
// Get Input Data
const input = this._inputData;
// If Input is Active
if (input.active) {
// If Ok input is triggered
if (Input.isTriggered('ok')) {
input.active = false;
// Play Load sound
SoundManager.playLoad();
// Get Animation Object
const anim = this._animData;
if (input.index === 0) {
if (anim.phase == 3) {
anim.phase = 4;
};
} else {
anim.phase = 8;
this.fadeOutAll()
anim.delay = 70;
}
return;
};
if (Input.isRepeated('left')) {
SoundManager.playCursor();
input.index = Math.abs((input.index - 1) % input.max);
this.updateRetryInputCursorPosition(input.index);
return
};
if (Input.isRepeated('right')) {
SoundManager.playCursor();
input.index = (input.index + 1) % input.max;
this.updateRetryInputCursorPosition(input.index);
return
};
};
};
//---------------------------------------------------------------------------
// More Retry Fixes
//---------------------------------------------------------------------------
var yin_gameover_createRetryWindows = Scene_Gameover.prototype.createRetryWindows;
Scene_Gameover.prototype.createRetryWindows = function() {
this._retryQuestion = new Window_Base(0, 0, 0, 0);
this._retryQuestion.standardPadding = function() { return 4; };
this._retryQuestion.initialize(0, 0, Graphics.boxWidth, 32);
this._retryQuestion.contents.fontSize = 26;
this._retryQuestion.x = 0;
this._retryQuestion.y = 380 - 48;
this._retryQuestion.drawOpacity = 0;
this._retryQuestion.opacity = 0;
this._retryQuestion.textToDraw = this._isFinalBattle && this._finalBattlePhase >= 5 ? "Você deseja continuar?" : "Você deseja tentar novamente?";
this._retryQuestion.textDrawn = "";
this._retryQuestion.textIndex = -1;
this._retryQuestion.isTextComplete = function() {
return this.textDrawn === this.textToDraw;
}
this._retryQuestion.textDelay = 100;
// Making the text already visible;
this._retryQuestion.drawOpacity = 255;
this._retryQuestion.update = function(animPhase) {
if (animPhase == 2 || animPhase == 3) {
if(!!this.isTextComplete()) {return;}
if(this.textDelay > 0) {return this.textDelay--;}
if (!this.isTextComplete()) {
this.contents.clear();
this.textIndex = Math.min(this.textIndex + 1, this.textToDraw.length);
this.textDrawn += this.textToDraw[this.textIndex];
this.contents.paintOpacity = this.drawOpacity;
this.contents.drawText(this.textDrawn, 0, -4, this.contents.width, this.contents.height, 'center');
SoundManager.playMessageSound();
this.textDelay = 4;
}
} else if (animPhase == 4) {
this.contents.clear();
this.drawOpacity -= 4;
this.contents.paintOpacity = this.drawOpacity;
this.contents.drawText(this.textDrawn, 0, -4, this.contents.width, this.contents.height, 'center');
}
};
this.addChild(this._retryQuestion);
yin_gameover_createRetryWindows.call(this);
};
var yin_gameover_updatetransitionAnimation = Scene_Gameover.prototype.updateTransitionAnimation;
Scene_Gameover.prototype.updateTransitionAnimation = function() {
yin_gameover_updatetransitionAnimation.call(this);
let anim = this._animData;
switch (anim.phase) {
case 2:
case 3:
this._retryQuestion.update(anim.phase);
break;
case 4:
this._retryQuestion.update(anim.phase);
break;
}
}
//=============================================================================
// Black Letter Crash Title Screen Load
//=============================================================================
var yin_titlecrashload_initialize = Scene_Boot.prototype.start;
Scene_Boot.prototype.start = function(index) {
yin_titlecrashload_initialize.call(this);
if (StorageManager.exists(44)) {
// LOAD SAVE 44
if (DataManager.loadGame(44)) {
// AudioManager.playSe({name: 'SE_red_hands', volume: 100, pitch: 100})
this.fadeOutAll();
// Reload Map if Updated
if ($gameSystem.versionId() !== $dataSystem.versionId) {
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
$gamePlayer.requestMapReload();
};
Graphics.frameCount = $gameSystem._framesOnSave || Graphics.frameCount;
SceneManager.goto(Scene_Map);
this._loadSuccess = true;
StorageManager.remove(44);
}
return;
}
}
//=============================================================================
// Cursor on continue when save games are available
//=============================================================================
var yin_titleContinue_create = Scene_OmoriTitleScreen.prototype.create;
Scene_OmoriTitleScreen.prototype.create = function() {
// Super Call
yin_titleContinue_create.call(this);
if (this._canContinue) {
this._commandIndex = 1;
}
// Update Command Window Selection
this.updateCommandWindowSelection();
};