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

[转载发布] Random Critical Animation v1.0

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

    连续签到: 2 天

    [LV.7]常住居民III

    7959

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    Introduction
    Allows for playing a random animation when landing a crit.

    How to use
    Save it as APHO_RandomCriticalAnimation.js and put it in your plugin folder.
    Fill the Animation List with a list of animations you'd like to play on crit, separated by a comma. (e.g.
    1. 1,2,4
    复制代码
    )
    Specify when you want the animations to be mirrored.

    • Never mirror - never mirrors the critical animation
    • Mirror if target is actor - the animation will be mirrored only if the target is an actor (default RMMV behaviour)
    • Mirror at random - the animation has a 50% chance of being mirrored.
    You may also opt to use a different pool of animations for critical heals; if so you'll need to fill the heal animation list.

    Script
    Spoiler: code
                    JavaScript:       
    1. //==========================================
    2. // APHO_RandomCriticalAnimation.js
    3. //==========================================
    4. /*:
    5. * @title Random Critical Animation
    6. * @author Apho
    7. * @plugindesc v1.0 Allows for playing a random animation when landing a crit.
    8. *
    9. * @param AnimList
    10. * @text Animation List
    11. * @type string
    12. * @desc Pool of animation IDs to play on crit. Separate values with a comma.
    13. *
    14. * @param MirrorAnim
    15. * @text Mirror Animations
    16. * @type select
    17. * @option Never mirror
    18. * @value 0
    19. * @option Mirror if target is actor
    20. * @value 1
    21. * @option Mirror randomly
    22. * @value 2
    23. * @desc When should critical animations be mirrored?
    24. * @default 0
    25. *
    26. * @param AnimDelay
    27. * @text Animation Delay
    28. * @type number
    29. * @desc Delay before the animation is played, in frames.
    30. * @default 0
    31. *
    32. * @param HealAnim
    33. * @text Crit Heal Animations
    34. * @type select
    35. * @option No animation
    36. * @value 0
    37. * @option Same as regular crits
    38. * @value 1
    39. * @option Use custom pool (defined below)
    40. * @value 2
    41. * @desc Should critical heals have an animation?
    42. * @default 2
    43. *
    44. * @param HealAnimList
    45. * @text Animation List (Heal)
    46. * @type string
    47. * @desc Pool of animation IDs to use for a crit heal. Separate values with a comma.
    48. *
    49. * @help
    50. * Allows for playing a random animation on the target when landing a crit.
    51. * Critical heals may optionally have their own animation pool.
    52. *
    53. * TERMS OF USE
    54. * - Free for commercial and non-commercial use, as long as I get a free copy
    55. *   of the game.
    56. * - Edits allowed for personal use.
    57. * - Do not repost or claim as your own, even if edited.
    58. *
    59. * VERSION HISTORY
    60. * v1.0 - 2023/7/10 - Initial release.
    61. */
    62. (function(){
    63.     var parameters = PluginManager.parameters('APHO_RandomCriticalAnimation');
    64.     var AnimList = parameters['AnimList'].split(",").map(Number);
    65.     var MirrorAnim = parseInt(parameters['MirrorAnim']);
    66.     var AnimDelay = parseInt(parameters['AnimDelay']);
    67.     var HealAnim = parseInt(parameters['HealAnim']);
    68.     var HealAnimList = parameters['HealAnimList'].split(",").map(Number);
    69.     const Game_Action_apply = Game_Action.prototype.apply;
    70.     Game_Action.prototype.apply = function(target){
    71.         Game_Action_apply.call(this, target);
    72.         if(target.result().critical && $gameParty.inBattle())
    73.         {
    74.             let AnimToPlay = 0;
    75.             if(!this.isRecover() || HealAnim == 1)
    76.             {
    77.                 AnimToPlay = AnimList[Math.randomInt(AnimList.length)]
    78.             }else if(this.isRecover() && HealAnim == 2)
    79.             {
    80.                 AnimToPlay = HealAnimList[Math.randomInt(HealAnimList.length)]
    81.             }
    82.             if(AnimToPlay > 0)
    83.             {
    84.                 let Mirror;
    85.                 switch(MirrorAnim)
    86.                 {
    87.                     case 0:
    88.                         Mirror = target.isActor();
    89.                         break;
    90.                     case 1:
    91.                         Mirror = false;
    92.                         break;
    93.                     case 2:
    94.                         Mirror = Math.random() < 0.5;
    95.                         break;
    96.                 }
    97.                 target.startAnimation(AnimToPlay, Mirror, AnimDelay);
    98.             }
    99.         }
    100.     }
    101. })();
    复制代码


    Terms of use

    • Free for commercial and non-commercial use, as long as I get a free copy of the game.
    • Edits allowed for personal use.
    • Do not repost or claim as your own, even if edited.
    • Do not use for training AI models. This includes, but is not limited to, inputting the plugin contents or part thereof into AI models that train on user input.
    Version history
    v1.0 - 2023/7/10- Initial release.

    Download link
    GitHub


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 05:53 , Processed in 0.144329 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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