快捷导航
新手引导关于我们满天星繁体中文 🌓
12下一页
返回列表
查看: 1467|回复: 13

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

[复制链接]
会员等级

积分信息
金币:852
金钱:0
钻石:0
活跃:205
发电:0

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

TA的灵将
 UID: 6 发表于 2023-5-17 15:18:35 | 显示全部楼层 |阅读模式

现在很多游戏都使用了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>

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入民族

x

评分

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

查看全部评分

最近访客

  • lss
    2026-11-25
  • 坤门弟子
    2026-09-22
  • yax
    2026-07-23
  • 咸鱼AlanP
    2026-06-30
  • Nemo
    2026-06-02
  • S_Ga_Zn
    2026-05-15
  • 伤心猪脚饭
    2026-05-14
  • pp765054302
    2026-05-09
  • 菠菜好大
    2026-04-27
回复 论坛版权

使用道具 举报

会员等级

积分信息
金币:852
金钱:0
钻石:0
活跃:205
发电: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
钻石:0
活跃:14
发电:0

荣誉勋章

TA的灵将

Rank: 1

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

使用道具 举报

经验  91%

会员等级

积分信息
金币:160
金钱:100
钻石:0
活跃:170
发电:0

荣誉勋章

TA的灵将

Rank: 3Rank: 3Rank: 3

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

使用道具 举报

经验  44%

会员等级

积分信息
金币:1
金钱:0
钻石:0
活跃:22
发电:9

荣誉勋章

TA的灵将

Rank: 1

 UID: 480 发表于 2024-11-1 16:03:18 | 显示全部楼层
66666666666
回复

使用道具 举报

经验  4%

会员等级

积分信息
金币:0
金钱:0
钻石:0
活跃:8
发电:0

荣誉勋章

TA的灵将

Rank: 1

 UID: 710 发表于 2024-12-13 17:33:26 | 显示全部楼层
感谢楼主分享的好资源666 {:6_211:}
回复

使用道具 举报

经验  4%

会员等级

积分信息
金币:0
金钱:1000
钻石:0
活跃:2
发电:0

荣誉勋章

TA的灵将

Rank: 1

 UID: 817 发表于 2024-12-14 19:35:09 | 显示全部楼层
感谢大佬
回复

使用道具 举报

经验  40%

会员等级

积分信息
金币:6
金钱:0
钻石:0
活跃:26
发电:0

荣誉勋章

TA的灵将

Rank: 1

 UID: 721 发表于 2024-12-17 14:02:32 | 显示全部楼层
感谢大佬分享!
回复

使用道具 举报

经验  16%

会员等级

积分信息
金币:2
金钱:1000
钻石:0
活跃:10
发电:0

荣誉勋章

TA的灵将

Rank: 1

 UID: 841 发表于 2024-12-19 00:11:09 | 显示全部楼层
感谢大佬分享!
回复

使用道具 举报

经验  46%

会员等级

积分信息
金币:5
金钱:0
钻石:0
活跃:54
发电:2

荣誉勋章

TA的灵将

Rank: 1

 UID: 408 发表于 2025-1-2 09:00:04 | 显示全部楼层
感恩无私的分享与奉献 {:6_222:}
回复

使用道具 举报

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

本版积分规则

论坛用工具

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

Powered by Discuz! Comsenz Inc.

© 本站成立于2022-11-17

实用工具

AI人工智能图片放大 图片无损放大 百宝箱 孟坤工具箱 在线压缩图片 RPG游戏展

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

Archiver|小黑屋|RPG民族

GMT+8, 2026-11-29 15:34 , Processed in 1.726563 second(s), 49 queries .

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