Scene_Map.prototype.start = function() { Scene_MenuBase.prototype.start.call(this); SceneManager.clearStack(); if (this._transfer) { this.fadeInForTransfer(); this._mapNameWindow.open(); this._ningjingWindow.open(); $gameMap.autoplay(); } else if (this.needsFadeIn()) { this.startFadeIn(this.fadeSpeed(), false); } this.menuCalling = false; }; Scene_Map.prototype.stop = function() { Scene_MenuBase.prototype.stop.call(this); $gamePlayer.straighten(); this._mapNameWindow.close(); this._ningjingWindow.close(); if (this.needsSlowFadeOut()) { this.startFadeOut(this.slowFadeSpeed(), false); } else if (SceneManager.isNextScene(Scene_Map)) { this.fadeOutForTransfer(); } else if (SceneManager.isNextScene(Scene_Battle)) { this.launchBattle(); } }; Scene_Map.prototype.terminate = function() { Scene_MenuBase.prototype.terminate.call(this); if (!SceneManager.isNextScene(Scene_Battle)) { this._spriteset.update(); this._mapNameWindow.hide(); this._ningjingWindow.hide(); SceneManager.snapForBackground(); } $gameScreen.clearZoom(); }; Scene_Map.prototype.createDisplayObjects = function() { this.createSpriteset(); this.createMapNameWindow(); this.createNingJingWindow(); this.createWindowLayer(); this.createAllWindows(); }; Scene_Map.prototype.createNingJingWindow = function(){ this._ningjingWindow = new Window_Testing(550,580,260,40); this.addChild(this._ningjingWindow); }; Scene_Map.prototype.callMenu = function() { SoundManager.playOk(); SceneManager.push(Scene_Menu); Window_MenuCommand.initCommandPosition(); $gameTemp.clearDestination(); this._ningjingWindow.hide(); this._mapNameWindow.hide(); this._waitCount = 2; }; Scene_Map.prototype.launchBattle = function() { BattleManager.saveBgmAndBgs(); this.stopAudioOnBattleStart(); SoundManager.playBattleStart(); this.startEncounterEffect(); this._ningjingWindow.hide(); this._mapNameWindow.hide(); }; function Window_Testing() { this.initialize.apply(this, arguments); } Window_Testing.prototype = Object.create(Window_Base.prototype); Window_Testing.prototype.initialize = function(x, y, width, height) { Window_Base.prototype.initialize.call(this, x, y, width, height); this.contents.fontSize = 20; } Window_Testing.prototype.standardPadding = function() { return 8; }; Window_Testing.prototype.update = function() { Window_Base.prototype.update.call(this); if ($gameVariables.value(1)==0){ $gameVariables._data[1]=1 $gameVariables._data[2]=1 $gameVariables._data[3]=1 $gameVariables._data[4]=1 }else if($gameVariables.value(5)>=4){ $gameVariables._data[5]-=4 $gameVariables._data[2]+=1 }else if($gameVariables.value(2)>=25){ $gameVariables._data[2]-=24 $gameVariables._data[1]+=1 }else if($gameVariables.value(1)>=31){ $gameVariables._data[1]-=30 $gameVariables._data[3]+=1 }else if($gameVariables.value(3)>=13){ $gameVariables._data[3]-=12 $gameVariables._data[14]+=1 } var textW = 270; var textH = 0; this.contents.clear(); this.drawText($gameVariables.value(1) + "日", -180, -6, textW, 'right'); textH += this.lineHeight(); this.drawText($gameVariables.value(2) + "时", -130, -6, textW, 'right'); textH += this.lineHeight(); this.drawText($gameVariables.value(3) + "月", -80, -6, textW, 'right'); textH += this.lineHeight(); this.drawText($gameVariables.value(4) + "年", -30, -6, textW, 'right'); textH += this.lineHeight(); 我觉得这条代码这样改会好用一点 |
everlose 发表于 2016-8-7 23:12 能不能分享来看看 |
我自己写了个事件的时间系统 会连动 资源的刷新 天气 天色 比如早5点会出现黄昏 6点天亮 晚5点 落日 6点天黑 每1个小时 随机进行1次天气变化 85%以上是晴天 10%是雨天 5是风雪 下雪只会出现在10~12月这样 然后下雨的时候屋外特效 房内只能听到声音 不会有特效 每隔多少小时 刷新挖矿点 资源点 早8点到晚5点之外的时间 商店会打烊 人物进不去 之前进去的人会被赶出来 时间系统光靠脚本意义不大 要和其他联动 才是完美 |
时间会自动增长吗?还是只能用改变量的方法更改? |
继续努力吧 |
keyi,我顶 |
在变量里1-5分别是年、月、日、时、刻,互相之间的进率是1年=12月 1月=30天 1天=24时 1时=4刻 |
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-2 13:34
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.