//=============================================================================
// RPG Maker MZ - MyPlugin
//=============================================================================

/*:
 * @target MZ
 * @plugindesc w
 * @author Stenblood
 *
 * @help MyPlugin.js
 *
 * Crazyplagin
 *
 * wsssseeeeee
 */


(() => {
/* 	function menuer(){
		
		
		
		
	};
		   menuer.prototype.tests = function() {

	   aaanuoindogag = 0;
	   effmenu = true;
	   effects = new Array(3);
	   effects[0] = "adga";
	    effects[1] = 2;
		
	   	    menuy = 0;

	   	 //     this._backSprite = new Sprite();
    //this._backSprite.bitmap = ImageManager.loadSystem("GameOver");
   };
	
	   menuer.prototype.opene = function() {
	   
	   aaanuoindogag = 0;
	   effmenu = true;
	   effect[0] = "Present";
	   	    menuy = 0;

	   
   };
   	   menuer.prototype.closee = function() {
	   effmenu = false;
	

	   
   };
   menuer.prototype.run = function() {
	   

//if

	   
   }; */

Scene_Title.prototype.start = function() {
		//document.styleSheets[0].insertRule('canvas{ image-rendering: pixelated; }');
	
	
if (DataManager.savefileExists(0)) {
	
	DataManager.loadGame(0);

	$gamePlayer.reserveTransfer($gameMap._mapId,$gamePlayer.x,$gamePlayer.y,$gamePlayer._direction,0)
	};
	$gamePlayer._needsMapReload = true;
	//$dataSystem.tileSize = 32;
	//menuer.prototype.tests()
	
	//  boolean effmenu = false;
	//if 

			SceneManager.push(Scene_Load);
		    DataManager.setupNewGame();
    this._commandWindow.close();
    this.fadeOutAll();
    SceneManager.goto(Scene_Map);
    Scene_Base.prototype.start.call(this);
    SceneManager.clearStack();
  //  this.adjustBackground();
    //this.playTitleMusic();
    this.startFadeIn(this.fadeSpeed(), false);
	
	
	Scene_Map.prototype.processMapTouch = function() { 
    /* if (TouchInput.isTriggered() || this._touchCount > 0) {
        if (TouchInput.isPressed() && !this.isAnyButtonPressed()) {
            if (this._touchCount === 0 || this._touchCount >= 15) {
                this.onMapTouch();
            }
            this._touchCount++;
        } else {
            this._touchCount = 0;
        }
    } */
};
	
	
	
};

/* Window_Message.prototype.update = function() {
    this.checkToNotClose();
    Window_Base.prototype.update.call(this);
    this.synchronizeNameBox();
    while (!this.isOpening() && !this.isClosing()) {
        if (this.updateWait()) {
            return;
        } else if (this.updateLoading()) {
            return;
        } else if (this.updateInput()) {
            return;
        } else if (this.updateMessage()) {
            return;
        } else if (this.canStart()) {
            this.startMessage();
        } else {
            this.startInput();
            return;
        }
    }
	$gameVariables.setValue(60,2);
	
	this.terminateMessage();
}; */



/* Scene_Map.prototype.updateMain = function() {
    $gameMap.update(this.isActive());
    $gamePlayer.update(this.isPlayerActive());
    $gameTimer.update(this.isActive());
    $gameScreen.update();
	  //Graphics.drawCircle(66,66,111)
};

 */

//var wawa = PIXI.Sprite.FromImage("img/pictures/RUIN.png");
   
/* var app = new PIXI.Application(480, 270, { backgroundColor: 0x1099bb });
document.body.appendChild(app.view); var container = new PIXI.Container();

app.stage.addChild(container);
var texture = PIXI.Texture.fromImage('img/pictures/RUIN.png');     var bunny = new PIXI.Sprite(texture);
    bunny.anchor.set(0.5);
    bunny.x = (1 % 5) * 40;
    bunny.y = Math.floor(1 / 5) * 40;
    container.addChild(bunny); container.x = app.screen.width / 2;
container.y = app.screen.height / 2;

// Center bunny sprite in local container coordinates
container.pivot.x = container.width / 2;
container.pivot.y = container.height / 2;

 */











/* 
Game_Actor.prototype.expForLevel = function(level) {
    const c = this.currentClass();
    const basis = 1;
    const extra = 1;
    const acc_a = 1;
    const acc_b = 1;
    return Math.round(
        (basis * Math.pow(level - 1, 0.9 + acc_a / 250) * level * (level + 1)) /
            (6 + Math.pow(level, 2) / 50 / acc_b) +
            (level - 1) * extra
    );
};





Game_Actor.prototype.initSkills = function() {
    this._skills = [];

};


Game_BattlerBase.prototype.allTraits = function() {
    return this.traitObjects().reduce((r, obj) => r.concat(obj.traits), []);
};




//Scene_Title.prototype.create = function() {
//this.commandNewGame();
    //this.createBackground( */
  //  this.createForeground();
//Scene_Boot.prototype.start();
  //this.createWindowLayer();
    //this.createCommandWindow();
//};

})()
;