设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 62|回复: 0

[转载发布] ave369's Damage Control (now 1.1)

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    8066

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    30139
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    39099

    灌水之王

    发表于 5 天前 | 显示全部楼层 |阅读模式
    ave369's Damage Control
    by ave369

    Version 1.1

    Introduction
    This plugin allows controlling skill and item damage by introducing a bottom and a cap, a la classic Final Fantasy games. Remember doing the 9999 with your attacks? This plugin will allow you to do the same and more.

    Features
    - Allows to set up caps and bottoms for both damage and healing;
    - Allows to designate Uncapped skills and items that can break the limit (but are still subject to bottom);
    - Allows to designate Unbound skills that ignore both cap and bottom.

    Changelog

    * 1.1: 100% Elemental Defense exception added. The plugin will now always allow 0 Damage if the cause of it is an elemental attack against 100% defense.
    * 1.0: plugin released

    How to Use
    Use the standard Plugin Manager, set up your caps, bottoms, capless and unbound skills, and enjoy!

    Code:

                    Code:       
    1. //==============================================================================
    2. // ave369s_DamageControl.js
    3. //==============================================================================
    4. /*:
    5. * @plugindesc Allows controlling skill and item damage by introducing a bottom and a cap, a la classic Final Fantasy games
    6. * @author ave369
    7. *
    8. * @param Damage Bottom
    9. * @desc The smallest damage possible. Default is 1. Negative damage (healing, absorbtion, etc) ignores this parameter.
    10. * @default 1
    11. *
    12. * @param Healing Bottom
    13. * @desc The smallest amount of healing/absorption possible. Default is 1.
    14. * @default 1
    15. *
    16. * @param Damage Cap
    17. * @desc The greatest damage possible for skills and items unless specified otherwise in the Capless params.
    18. * @default 9999
    19. *
    20. * @param Healing Cap
    21. * @desc The greatest amount of healing/absorption possible unless specified otherwise in the Capless params.
    22. * @default 9999
    23. *
    24. * @param Capless Skills
    25. * @desc IDs of skills that can exceed the cap. Input a list of numerals separated by commas. Default is 3,4,5
    26. * @default 3,4,5
    27. *
    28. * @param Capless Items
    29. * @desc IDs of items that can exceed the cap. Input a list of numerals separated by commas. Default is 2,3
    30. * @default 2,3
    31. *
    32. * @param Unbound Skills
    33. * @desc IDs of skills that ignore both cap and bottom. Input a list of numerals separated by commas. Default is 6,7,8
    34. * @default 6,7,8
    35. *
    36. * @param Unbound Items
    37. * @desc IDs of items that ignore both cap and bottom. Input a list of numerals separated by commas. Default is 4,5
    38. * @default 4,5
    39. *
    40. *
    41. * @help
    42. * --------------------------------------------------------------------------------
    43. * This plugin has eight parameters.
    44. *
    45. * Damage Bottom: The smallest damage possible. Default is 1. Negative damage
    46. * (healing, absorbtion, etc) ignores this parameter and uses Healing Bottom instead.
    47. *
    48. * Healing Bottom: The smallest amount of healing/absorption possible. Default is 1.
    49. *
    50. * Damage Cap: The greatest damage possible for skills and items unless specified
    51. * otherwise in the Capless / Unbound params. Negative damage ignores this parameter
    52. * and uses Healing Cap instead.
    53. *
    54. * Healing Cap: The greatest amount of healing/absorption possible unless specified
    55. * otherwise in the Capless / Unbound params.
    56. *
    57. * Capless Skills and Capless Items: these skills and items ignore the cap but not
    58. * the bottom. Use it for extra strong techniques that break the limit.
    59. *
    60. * Unbound Skills and Unbound Items: these skills and items ignore both cap and
    61. * bottom. It is recommended to use the Unbound parameter for skills and items
    62. * that can do 0 damage or healing. Note that if your skill/item does 0 healing
    63. * and is not marked as unbound, the game treats it as damage, and the Bottom
    64. * damage is applied.
    65. *
    66. * Terms of Use
    67. * --------------------------------------------------------------------------------
    68. * This plugin is Forever Free. If I, ave369, ever charge money for this plugin,
    69. * you have the right to call me the most deplorable of human beings.
    70. * Credit ave369 if using this plugin in your project.
    71. * Free for commercial and non-commercial projects.
    72. * --------------------------------------------------------------------------------
    73. * Version 1.1
    74. * Special thanks to:
    75. * Mr. Trivel for his Minimum Damage plugin that inspired mine;
    76. * iavra for a tip how to include arrays as plugin params.
    77. *
    78. * --------------------------------------------------------------------------------
    79. */
    80. (function() {
    81.     var parameters = PluginManager.parameters('ave369s_DamageControl');
    82.     var minDamage = Number(parameters['Damage Bottom'] || 1);
    83.     var minHealing = Number(parameters['Healing Bottom'] || 1);
    84.     var maxDamage = Number(parameters['Damage Cap'] || 9999);
    85.     var maxHealing = Number(parameters['Healing Cap'] || 9999);
    86.     var limitBrokenRaw = String(parameters['Capless Skills'] || '3,4,5');
    87.     var limitBroken = limitBrokenRaw.split(/\s*,\s*/).filter(function(value){ return !!value; });
    88.     var limitBrokenItemsRaw = String(parameters['Capless Items'] || '2,3');
    89.     var limitBrokenItems = limitBrokenItemsRaw.split(/\s*,\s*/).filter(function(value){ return !!value; });
    90.     var limitUnboundRaw = String(parameters['Unbound Skills'] || '6,7,8');
    91.     var limitUnbound = limitUnboundRaw.split(/\s*,\s*/).filter(function(value){ return !!value; });
    92.     var limitUnboundItemsRaw = String(parameters['Unbound Items'] || '4,5');
    93.     var limitUnboundItems = limitUnboundItemsRaw.split(/\s*,\s*/).filter(function(value){ return !!value; });
    94.     //var thisIsAnItem = false;
    95.     var _Game_Action_makeDamageValue = Game_Action.prototype.makeDamageValue;
    96.     Game_Action.prototype.makeDamageValue = function(target, critical) {
    97.         var do_damage = _Game_Action_makeDamageValue.call(this, target, critical);
    98.         var id_check = String(this.item().id);
    99.         // Only apply bottom restrictions for uncapped skills & items
    100.         if (limitBroken.includes(id_check) && this.isSkill()) {
    101.             return (do_damage >= 0 ? Math.max(do_damage, minDamage) : Math.min (do_damage, -minHealing));
    102.         }
    103.         else if (limitBrokenItems.includes(id_check) && this.isItem()) {
    104.             return (do_damage >= 0 ? Math.max(do_damage, minDamage) : Math.min (do_damage, -minHealing));
    105.         }
    106.         // Apply no restrictions at all for unbound items
    107.         else if (limitUnbound.includes(id_check) && this.isSkill()) {
    108.             return do_damage;
    109.         }
    110.         else if (limitUnboundItems.includes(id_check) && this.isItem()) {
    111.             return do_damage;
    112.         }
    113.         else if (this.calcElementRate(target) == 0) return 0; //special exception, 100% elemental resist is always a 0
    114.         // Apply all restrictions
    115.         else return (do_damage >= 0 ? Math.min (maxDamage, Math.max(do_damage, minDamage)) : Math.max (-maxHealing, Math.min (do_damage, -minHealing)));
    116.     };
    117. })();
    复制代码


    FAQ
    Q: This plugin is sloppily written! How so?
    A: This is my first plugin. Please do not be mean. I'm just learning.

    Q: Who should i credit?
    A: ave369, or Arinwende (that's me).

    Q: Is it available for commercial projects? For non-commercial projects? Is it free?
    A: This plugin is Forever Free for both commercial and non-commercial projects. Paid plugins suck! If I, ave369, ever charge money for this plugin, or a future version thereof, you have the right to call me the most deplorable of human beings.

    Q: What to expect in future versions?
    A: Notetags. 2.0 will feature them. Versions further than that will have more features such as secondary caps.

    Credit and Thanks
    - Mr. Trivel for his Minimum Damage plugin that inspired mine. I saw his tiny plugin and wanted a bigger, better version of it with more functions. There was none (except for the paid plugin by Yanfly), so I had to write my own.
    - iavra for the hint how to make arrays from plugin params.

    Author's Notes
    Have fun!


    本贴来自国际rpgmaker官方论坛作者:ave36处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/ave369s-damage-control-now-1-1.122280/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-1 11:43 , Processed in 0.066532 second(s), 57 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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