var Hayolee = window.Hayolee || {};
Hayolee.tintSpeed = 60;
Hayolee.dayLength = 5000000;
Hayolee.nightLength = 2500000;
function DayNight(){
this._currentTime = 0;
this._isDay = true;
}
DayNight.prototype = Object.create(DayNight.prototype);
DayNight.prototype.constructor = DayNight;
DayNight.prototype.update = function(){
if ( this._isDay == true){
if (this._currentTime >= Hayolee.dayLength){
$gameScreen.startTint([-136, -136, -35, 70], Hayolee.tintSpeed);
this._isDay = false;
this._currentTime = 0;
}
}
else {
if (this._currentTime >= Hayolee.nightLength){
$gameScreen.startTint([0, 0, 0, 0], Hayolee.tintSpeed);
this._isDay = true;
this._currentTime = 0;
}
}
this._currentTime ++;
}
//////////////////////////////////////////////
var clock = new DayNight();
const Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
Game_Interpreter_pluginCommand.call(this, command, args);
if (command.toLowerCase() === "run") {
//$gameMessage.add("In the run.");
clock.update();
}
};