本帖最后由 夏末渐离 于 2016-1-3 01:24 编辑 最醒目的processEscape方法[pre lang="javascript"] BattleManager.processEscape=function() { ……//代表省略 this.displayEscapeSuccessMessage(); this._escaped = true; this.processAbort(); //线索 …… } [/pre] 然后从processAbort出发[pre lang="javascript"] BattleManager.processAbort = function() { this.replayBgmAndBgs(); //回归地图背景音乐 this.endBattle(1); //线索 }; [/pre] 来到了用于判定的endBattle方法[pre lang="javascript"] BattleManager.endBattle= function(result) { this._phase = 'battleEnd'; //线索 if (this._eventCallback) { this._eventCallback(result); } if (result === 0) { $gameSystem.onBattleWin(); } else if (this._escaped) { $gameSystem.onBattleEscape(); //由于传入的是1,而且之前的processEscape已设为true,然而这个只是计数的…… } };[/pre] 找到了关键字battleEnd[pre lang="javascript"] BattleManager.update = function() { if (!this.isBusy() && !this.updateEvent()) { switch (this._phase) { …… case 'battleEnd': this.updateBattleEnd(); break; } } [/pre] 最后新人表示被戏耍了,真正作用竟然是SceneManager.pop().……[pre lang="javascript"] BattleManager.updateBattleEnd=function() { …… SceneManager.pop(); this._phase = null; …… } [/pre] |
|
感谢您的建议 目前我自己也找到折衷的办法,配合你的写法就比较完美了 首先是「烟雾弹」的道具效果有两个∶「添加状态∶烟雾逃跑100%」&「公共事件∶逃跑」 然後在状态那边新增一个「烟雾逃跑」的状态,这个状态纯粹是拿来放战斗LOG的 我是打上了「(目标名称) 放出大量烟雾遮盖敌人视线!」 然後再接上你那个脚本逃跑时的「某某某的队伍成功逃跑了」的句子就很完美了。 |
|
本帖最后由 夏末渐离 于 2016-1-2 23:59 编辑 [pre lang="javascript"]/*: * @author XMJL * 如在公共事件使用脚本:escape_event('Loading'); * 将此公共事件添加到道具的效果上,在战斗中使用该道具即可逃跑。 */ var escape_event=function(BitmapName) { var LOGO=new Sprite(ImageManager.loadSystem(BitmapName)); LOGO.anchor.x=0.5; LOGO.anchor.y=0.5; LOGO.x=Graphics.width/2; LOGO.y=Graphics.height/2; $gameParty.removeBattleStates(); $gameParty.performEscape(); SoundManager.playEscape(); var viewport=Scene_Battle.prototype.update; Scene_Battle.prototype.update=function() { viewport.call(this); if(this.isActive()) this.removeChild(LOGO); else { this.addChild(LOGO); } }; BattleManager.processAbort();//中断战斗成功 }; [/pre] |
公共事件执行脚本:
我想知道特殊效果那个逃跑到底什么意思。。。 |
|
本帖最后由 trentswd 于 2016-1-2 16:38 编辑 加战斗日志必须使用脚本了 另外我得吐槽一下,“一般剧情”是公共事件,虽然我觉得机翻也不会吧Common Event翻译成一般剧情,实在是很神奇……呃,我是说楼主可能去巴哈找个繁体翻译修正比较好 效果里面的逃跑是仅用于“逃跑”指令 用公共事件配合脚本能做,不过我自己不是原生工程,是用了YEP的,不知道不用会不会有问题 在公共事件里面加入
|