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

Project1

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

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

[复制链接]

Lv5.捕梦者

梦石
0
星屑
33243
在线时间
10502 小时
注册时间
2009-3-15
帖子
4757
跳转到指定楼层
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 我很赞同

查看全部评分

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

本版积分规则

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

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

GMT+8, 2024-5-9 03:54

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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