设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 5005|回复: 17
打印 上一主题 下一主题

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

[复制链接]

Lv5.捕梦者

梦石
0
星屑
33148
在线时间
10485 小时
注册时间
2009-3-15
帖子
4756
跳转到指定楼层
1
发表于 2019-6-12 17:37:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // - BattleParallelEvent
  3. // BattleParallelEvent.js
  4. //=============================================================================
  5.  
  6. //=============================================================================
  7. /*:
  8.  * @plugindesc 戦闘中でも「並列処理」のコモンイベントを実行する為のプラグインです。
  9.  * @author 名無し蛙
  10.  *
  11.  *
  12.  * Version 1.0:
  13.  * 2016/06/29 - リリース
  14.  */
  15. //=============================================================================
  16.  
  17. (function() {
  18.     //
  19.     var _Game_Switches_onChange = Game_Switches.prototype.onChange;
  20.     Game_Switches.prototype.onChange = function() {
  21.         _Game_Switches_onChange.call(this);
  22.         if ($gameParty.inBattle()) {
  23.             $gameTroop.refreshCommonEvents();
  24.         }
  25.     };
  26.  
  27.     //
  28.     var _Game_Troop_setup = Game_Troop.prototype.setup;
  29.     Game_Troop.prototype.setup = function(troopId) {
  30.         _Game_Troop_setup.call(this, troopId);
  31.         this._commonEvents = this.parallelCommonEvents().map(function(commonEvent) {
  32.             return new Game_CommonEvent(commonEvent.id);
  33.         });
  34.     };
  35.  
  36.     //
  37.     Game_Troop.prototype.parallelCommonEvents = function() {
  38.         return $dataCommonEvents.filter(function(commonEvent) {
  39.             return commonEvent && commonEvent.trigger === 2;
  40.         });
  41.     };
  42.  
  43.     //
  44.     Game_Troop.prototype.refreshCommonEvents = function() {
  45.         this._commonEvents.forEach(function(event) {
  46.             event.refresh();
  47.         });
  48.     };
  49.  
  50.     //
  51.     Game_Troop.prototype.updateCommonEvents = function() {
  52.         this._commonEvents.forEach(function(event) {
  53.             if ($dataCommonEvents[event._commonEventId].name.indexOf("战斗") == 0) {event.update()};
  54.         });
  55.     };
  56.  
  57.     //
  58.     var _Scene_Battle_update = Scene_Battle.prototype.update;
  59.     Scene_Battle.prototype.update = function() {
  60.         $gameTroop.updateCommonEvents();
  61.         _Scene_Battle_update.call(this);
  62.     };
  63. }());
  64.  
  65. //=============================================================================
  66. // End of File
  67. //=============================================================================
https://tm.lucky-duet.com/viewtopic.php?t=1495

评分

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

查看全部评分

Lv3.寻梦者

梦石
0
星屑
1654
在线时间
237 小时
注册时间
2018-7-5
帖子
77
2
发表于 2019-6-26 18:51:58 | 只看该作者
有点意思
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1075
在线时间
133 小时
注册时间
2019-5-1
帖子
59
3
发表于 2019-6-29 16:01:33 | 只看该作者
mark一记 这个看上去会用的到
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
21891
在线时间
8558 小时
注册时间
2011-12-31
帖子
3361
4
发表于 2020-2-22 23:07:08 | 只看该作者

錯輸入

点评

发表于 2020-2-23 09:12
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
712
在线时间
12 小时
注册时间
2014-5-19
帖子
2
5
发表于 2020-4-12 22:54:43 | 只看该作者
不会用呀!哈哈。 还有没有别的办法?  

点评

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

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
7013
在线时间
1358 小时
注册时间
2018-12-16
帖子
1939
6
发表于 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
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3859
在线时间
721 小时
注册时间
2016-2-28
帖子
147
7
发表于 2020-4-13 21:25:10 | 只看该作者
本帖最后由 hanyilun 于 2020-6-6 16:16 编辑

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

回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1213
在线时间
143 小时
注册时间
2021-2-11
帖子
19
8
发表于 2021-8-7 17:08:39 | 只看该作者
强大!非常有用啊!
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-20 04:31

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表