查看: 6079|回复: 17

[搬运汉化] 转日站的战斗中执行並行事件

[复制链接]
梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2019-6-12 17:37:03 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 soulsaga 于 2019-6-12 17:39 编辑

[pre lang="javascript"]//=============================================================================
// - BattleParallelEvent
// BattleParallelEvent.js
//=============================================================================

//=============================================================================
/*:
* @plugindesc 戦闘中でも「並列処理」のコモンイベントを実行する為のプラグインです。
* @author 名無し蛙
*
*
* Version 1.0:
* 2016/06/29 - リリース
*/
//=============================================================================

(function() {
    //
    var _Game_Switches_onChange = Game_Switches.prototype.onChange;
    Game_Switches.prototype.onChange = function() {
        _Game_Switches_onChange.call(this);
        if ($gameParty.inBattle()) {
            $gameTroop.refreshCommonEvents();
        }
    };

    //
    var _Game_Troop_setup = Game_Troop.prototype.setup;
    Game_Troop.prototype.setup = function(troopId) {
        _Game_Troop_setup.call(this, troopId);
        this._commonEvents = this.parallelCommonEvents().map(function(commonEvent) {
            return new Game_CommonEvent(commonEvent.id);
        });
    };

    //
    Game_Troop.prototype.parallelCommonEvents = function() {
        return $dataCommonEvents.filter(function(commonEvent) {
            return commonEvent && commonEvent.trigger === 2;
        });
    };

    //
    Game_Troop.prototype.refreshCommonEvents = function() {
        this._commonEvents.forEach(function(event) {
            event.refresh();
        });
    };

    //
    Game_Troop.prototype.updateCommonEvents = function() {
        this._commonEvents.forEach(function(event) {
            if ($dataCommonEvents[event._commonEventId].name.indexOf("战斗") == 0) {event.update()};
        });
    };

    //
    var _Scene_Battle_update = Scene_Battle.prototype.update;
    Scene_Battle.prototype.update = function() {
        $gameTroop.updateCommonEvents();
        _Scene_Battle_update.call(this);
    };
}());

//=============================================================================
// End of File
//=============================================================================
[/pre]https://tm.lucky-duet.com/viewtopic.php?t=1495

评分

参与人数 1赞 +1 收起 理由
wudimuteng + 1 我很赞同

查看全部评分

梦石
0
星屑
1864
在线时间
255 小时
注册时间
2018-7-5
回帖
62
发表于 2019-6-26 18:51:58 | 显示全部楼层
有点意思
回复

使用道具 举报

梦石
0
星屑
1075
在线时间
133 小时
注册时间
2019-5-1
回帖
57
发表于 2019-6-29 16:01:33 | 显示全部楼层
mark一记 这个看上去会用的到
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2020-2-22 23:07:08 | 显示全部楼层

錯輸入

点评

?  发表于 2020-2-23 09:12
回复

使用道具 举报

梦石
0
星屑
712
在线时间
12 小时
注册时间
2014-5-19
回帖
1
发表于 2020-4-12 22:54:43 | 显示全部楼层
不会用呀!哈哈。 还有没有别的办法?  

点评

並行公共事件如果有战斗两个字包含在内才会执行吧..好像是这样..  发表于 2020-4-13 22:22
即插即用..不会用?那你从基础学起吧  发表于 2020-4-12 23:00
回复

使用道具 举报

梦石
0
星屑
7997
在线时间
1442 小时
注册时间
2018-12-16
回帖
1843
发表于 2020-4-13 19:51:23 | 显示全部楼层
這個有人在用嗎?
因為我研究了半天...也沒有範例可以參考...不知道如何使用 很頭大

点评

666666 ^_________^  发表于 2020-4-14 00:02
我也想不到有什么用啊..  发表于 2020-4-13 23:42
那再請教一下.戰鬥中有甚麼並行事件可以執行的呢?因為想來想去.好像沒有甚麼需要在戰鬥中執行的並行事件.源是戰鬥設定不是都有了嗎?  发表于 2020-4-13 23:18
並行公共事件如果有战斗两个字包含在内才会执行吧..好像是这样..  发表于 2020-4-13 22:11
只要战斗中就有效..不过这样会有点麻烦呢..  发表于 2020-4-13 22:10
回复

使用道具 举报

梦石
0
星屑
3528
在线时间
743 小时
注册时间
2016-2-28
回帖
129
发表于 2020-4-13 21:25:10 | 显示全部楼层
本帖最后由 hanyilun 于 2020-6-6 16:16 编辑

感谢大佬分享,这个对我的游戏系统帮助很大!

回复

使用道具 举报

梦石
0
星屑
1213
在线时间
143 小时
注册时间
2021-2-11
回帖
19
发表于 2021-8-7 17:08:39 | 显示全部楼层
强大!非常有用啊!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部