快捷导航
返回列表
查看: 594|回复: 4

技能拓展(冷却、使用代码、限制次数等)(不依靠YEP、MOG)

[复制链接]
会员等级

积分信息
金币:725
元宝:20
活跃:187
发电:0

荣誉勋章
热心会员优秀版主首批会员最佳新人

TA的形象
UID: 6 发表于 2023-5-17 15:18:35 | 显示全部楼层 |阅读模式
  • 插件作者: 其他作者   Fomar0153
  • 插件分类: 战斗 
  • 适用版本: RPG MAKER MZ
  • 获得方式: 金币购买
  • 版权说明: 可商用 
  • 下载地址: 点击传送   /   密 码:             
  • 原始地址: 无权限查看内容
  • 失效反馈 投诉举报 侵权联系 左键点住封面图拉下即可看大图


现在很多游戏都使用了YEP、VS等战斗系统,虽然功能强大,但”捆绑“也导致了各种冲突不断。这个插件有技能CD、限制次数、血量消耗等,以及可以通过在备注栏设置代码来提高多样性。具体使用方法贴在下面参考。

[JavaScript] 纯文本查看 复制代码
/*:
 * @target MZ
 * @plugindesc Extends Skills providing more options.
 * @author Fomar0153
 *
 * @param Cooldown Text Colour
 * @type integer
 * @desc Enter a number that refers to the colour on the windoskin that you would like.
 * @default 15
 *
 * @param Cooldown Abbreviation
 * @type string
 * @desc This will be displayed when a skill is on cooldown.
 * @default CD
 *
 * @help Fomar0153_SkillExtension.js
 * This plugin implements a series of notetags allowing you to customise skills.
 *
 * Notetags:
 * <usable-rep: condition>
 * This replaces the usable requirements with your condition, MP requirements etc
 * will not need to be met in order for the skill to be usable.
 * <usable-add: condition>
 * This adds your condition to the usable requirements, MP requirements etc
 * will still need to be met in order for the skill to be usable.
 * <payment: code>
 * This code will be executed when MP, TP would be deducted etc.
 *
 * <hpcost: n>
 * Allows you to assign a HP cost to the skill.
 *
 * <preskill: code>
 * This code runs just before the skill is used.
 *
 * <damage: code>
 * This code runs during the damage calculation, value is a variable that holds
 * the damage value.
 *
 * <postskill: code>
 * This code runs just after the skill is used.
 *
 * <cooldown: n>
 * This makes the skill have a cooldown between uses.
 *
 * <limited: n>
 * The skill is only usable n times between the recover all event being called.
 * <limitedbattle>
 * Will make the skill only have limited uses per battle as opposed to the
 * recover all event.
 *
 */


值得注意的是,如果你的游戏中使用了其他可以消耗血量的技能插件,而且均是在备注栏书写hpcost的形式(包括Hp Cost、hp_cost之类的写法),在使用技能时会造成双倍的扣血。因为执行了两遍扣除操作。解决方法是 将此插件中所有的”hpcost“替换成其他的字符(比如”血量消耗“),如果想通过此插件来实现扣血效果,则在修改后,于备注栏填写<血量消耗: n>

Fomar0153_SkillExtension.js

9.11 KB, 下载次数: 4

售价: 2 金币  [记录]

评分

参与人数 1金币 +9 收起 理由
民族精神 + 9 666666

查看全部评分

帖子的最近访客

回复 论坛版权

使用道具 举报

会员等级

积分信息
金币:725
元宝:20
活跃:187
发电:0

荣誉勋章
热心会员优秀版主首批会员最佳新人

TA的形象
 楼主| 发表于 2023-5-17 15:28:34 | 显示全部楼层
这段代码有趣的地方在于,它解除【冷却】【限制次数】的方式是通过清空数组来实现,并将这个功能复写在”完全恢复“中。


[JavaScript] 纯文本查看 复制代码
  Game_BattlerBase.prototype.recoverAll = function() {
    Fomar.SkillExtension.Game_BattlerBase_recoverAll.call(this);
    this._cooldowns = {};
    this._limitedSkills = {};
  };


如果想自由地恢复限制,我们可以自行追加一个函数,比如:
[JavaScript] 纯文本查看 复制代码
Game_BattlerBase.prototype.recoverSkillLimit = function() {
    this._cooldowns = {};
    this._limitedSkills = {};
  };
  
function recover_skill_limit(){
	for(var i= $gameParty.size()-1;i>=0;i--){
		var actor_ID = $gameParty._actors[i];
		$gameActors.actor(actor_ID).recoverSkillLimit();
	}
}  

想要恢复单个角色,只需要执行:$gameActors.actor(角色ID).recoverSkillLimit();
想要全部恢复,只需要执行:recover_skill_limit()

有了这个基础,就可以制作出诸如”瞬间清除CD、限制“之类的有趣操作。

回复

使用道具 举报

经验  6%

会员等级

积分信息
金币:3
元宝:0
活跃:14
发电:0

荣誉勋章

TA的形象

Rank: 1

UID: 251 发表于 2023-6-17 23:43:54 | 显示全部楼层
感谢分享~
回复

使用道具 举报

经验  96%

会员等级

积分信息
金币:98
元宝:0
活跃:114
发电:0

荣誉勋章

TA的形象

Rank: 2Rank: 2

金币狮

UID: 56 发表于 2023-6-25 09:24:41 | 显示全部楼层
感谢分享 楼主辛苦了
回复

使用道具 举报

ahome_bigavatar:guest
ahome_bigavatar:welcomelogin
您需要登录后才可以回帖 登录 | 加入民族

本版积分规则

论坛用工具

蓝凑云 hello图床 聚合图床 TinyPNG remove 代码测试 颜色代码 颜色代码2

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

实用工具

AI人工智能图片放大 图片无损放大 Deepl翻译器 百宝箱 孟坤工具箱 在线压缩图片 图片切圆角

您一共访问了本站 加载中...

Archiver|小黑屋|RPG民族

GMT+8, 2024-10-23 06:19 , Processed in 0.216344 second(s), 86 queries .

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