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

Project1

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

[有事请教] 如何给插件加一个注释开关

[复制链接]

Lv3.寻梦者

不活君

梦石
0
星屑
1182
在线时间
1221 小时
注册时间
2011-2-16
帖子
680
跳转到指定楼层
1
发表于 2024-2-6 02:00:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
//=============================================================================
// DisplayAllResults.js
//=============================================================================

/*:
* @plugindesc 全体范围技能一次性展示所有结果
* @author Siabo
*
* @help
*/

(function() {

var _Window_BattleLog_displayActionResults = Window_BattleLog.prototype.displayActionResults;
Window_BattleLog.prototype.displayActionResults = function(subject, target) {
    _Window_BattleLog_displayActionResults.call(this, subject, target)
   
    while (this._methods.length > 0) {
        this.callNextMethod();
    }
};

BattleManager.updateAction = function() {
    while (this._targets.length > 0) {
        var target = this._targets.shift();
        if (target) {
            this.invokeAction(this._subject, target);
        }
    }
    this.endAction();
};

})();


上面的插件是让MV技能全体攻击逐个触发伤害变成一次性攻击全部敌人触发伤害 如何做个开关 比如在我想要变成一次性触发伤害的技能的注释里写上<XXXX:>之类的才能作用到这个技能
不知不觉就几百天过去了 经历无数个雨夜 清晨 黎明 先是兴奋 厌倦 释然 会觉得很有趣 然后又会觉得无趣 最后有一种归属感 满足感

Lv3.寻梦者

梦石
0
星屑
3784
在线时间
982 小时
注册时间
2016-12-6
帖子
367
2
发表于 2024-2-6 09:41:25 | 只看该作者
  1. (function() {

  2.     var _Window_BattleLog_displayActionResults = Window_BattleLog.prototype.displayActionResults;
  3.     Window_BattleLog.prototype.displayActionResults = function(subject, target) {
  4.         _Window_BattleLog_displayActionResults.call(this, subject, target);

  5.         //追加条件检测
  6.         if (this.shouldDisplayAllResults(subject)) {
  7.             while (this._methods.length > 0) {
  8.                 this.callNextMethod();
  9.             }
  10.         }
  11.     };

  12.     Window_BattleLog.prototype.shouldDisplayAllResults = function(subject) {
  13.         var action = subject.currentAction();
  14.         if (action && action.item()) {
  15.             // 检查技能注释中是否有 <AllResults> 标签
  16.             return !!action.item().meta.AllResults;
  17.         }
  18.         return false;
  19.     };

  20.     BattleManager.updateAction = function() {
  21.         while (this._targets.length > 0) {
  22.             var target = this._targets.shift();
  23.             if (target) {
  24.                 this.invokeAction(this._subject, target);
  25.             }
  26.         }
  27.         this.endAction();
  28.     };

  29. })();
复制代码


试试看,注释格式是<AllResults>
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-28 00:45

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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