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

[转载发布] Speed Eval v1.2

[复制链接]
累计送礼:
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 the use of formulas to adjust the invocation speed of skills and items, and adjusting base speed formula.

    How to use
    Save it as APHO_SpeedEval.js and put it in your plugin folder.
    If you are using YEP_BattleEngineCore.js, this needs to be placed below it.

    Use the following notetags in your skills/items:
                    JavaScript:       
    1. <speed>
    2. //Code goes here; perform operations on 'speed'.
    3. </speed>
    复制代码

    The code will be run after all the default speed calculations.
    You can use 'a' to reference the user.


    Examples
                    JavaScript:       
    1. <speed>
    2. speed += a.atk;
    3. </speed>
    复制代码

    This will increase the invocation speed by the user's Attack.

                    JavaScript:       
    1. <speed>
    2. speed = 0;
    3. </speed>
    复制代码

    This will set the invocation speed to 0, ignoring Agility or the invocation speed set in the editor.

    The base speed can also be adjusted from the plugin parameter 'Base speed'.
    By default, RMMV has some random variance added to base speed.
    This plugin's default settings will remove the random variance.

    Script
    Spoiler: CODE
                    JavaScript:       
    1. //==========================================
    2. // APHO_SpeedEval.js
    3. //==========================================
    4. /*:
    5. * @title Speed Eval
    6. * @author Apho
    7. * @plugindesc v1.1 Allows the use of formulas to adjust the invocation speed of skills and items, and adjusting base speed formula.
    8. *
    9. * @param Base speed
    10. * @desc Formula to determine base speed.
    11. * @default agi
    12. * @help
    13. *
    14. * This plugin allows the developer to use evals to adjust the invocation speed
    15. * of skills and items.
    16. * To do so, use the following notetags in your skills/items:
    17. *
    18. * <speed>
    19. * //Code goes here; perform operations on 'speed'.
    20. * </speed>
    21. *
    22. * The code will be run after all the default speed calculations.
    23. * You can use 'a' to reference the user.
    24. *
    25. * EXAMPLES:
    26. * <speed>
    27. * speed += a.atk;
    28. * </speed>
    29. * This will increase the invocation speed by the user's Attack.
    30. *
    31. * <speed>
    32. * speed = 0;
    33. * </speed>
    34. * This will set the invocation speed to 0, ignoring Agility or the invocation
    35. * speed set in the editor.
    36. *
    37. * The base speed can also be adjusted from the plugin parameter 'Base speed'.
    38. * By default, RMMV has some random variance added to base speed.
    39. * This plugin's default settings will remove the random variance.
    40. *
    41. * TERMS OF USE
    42. * - Free for commercial and non-commercial use, as long as I get a free copy
    43. *   of the game.
    44. * - Edits allowed for personal use.
    45. * - Do not repost or claim as your own, even if edited.
    46. *
    47. * VERSION HISTORY
    48. * v1.1 - 2022/9/10 - Optimized code to improve compatibility with other plugins.
    49. * v1.0 - 2022/9/9 - Initial release.
    50. */
    51. var Apho = Apho || {};
    52. Apho.SpeedEvalParams = PluginManager.parameters('APHO_SpeedEval');
    53. Apho.SpeedEvalParams.BaseSpeed = Apho.SpeedEvalParams['Base speed'];
    54. const AphoDataBaseLoaded = DataManager.isDatabaseLoaded;
    55. DataManager.isDatabaseLoaded = function()
    56. {
    57.     AphoDataBaseLoaded.call(this);
    58.     if (!AphoDataBaseLoaded.call(this)) return false;
    59.     if (!Apho.SpeedEvalLoaded)
    60.     {
    61.         Apho.CheckSpeedEval($dataSkills);
    62.         Apho.CheckSpeedEval($dataItems);
    63.         Apho.SpeedEvalLoaded = true;
    64.     }
    65.     return true;
    66. };
    67. Apho.CheckSpeedEval = function(group)
    68. {
    69.     const SpeedEvalOpen = '<speed>';
    70.     const SpeedEvalClose = '</speed>';
    71.     for (var n = 1; n < group.length; n++)
    72.     {
    73.         var obj = group[n];
    74.         var NoteData = obj.note.split(/[\r\n]+/);
    75.         var ReadSpeedEval = false;
    76.         obj.SpeedEval = '';
    77.         for (var i = 0; i < NoteData.length; i++)
    78.         {
    79.             var line = NoteData[i];
    80.             if (line.match(SpeedEvalOpen))
    81.             {
    82.                 ReadSpeedEval = true;
    83.             } else if (line.match(SpeedEvalClose))
    84.             {
    85.                 ReadSpeedEval = false;
    86.             }
    87.             else if (ReadSpeedEval == true)
    88.             {
    89.                 obj.SpeedEval = obj.SpeedEval + line + '\n';
    90.             }
    91.         }
    92.     }
    93. };
    94. Game_Action.prototype.speed = function()
    95. {
    96.     var agi = this.subject().agi;
    97.     var speed = eval(Apho.SpeedEvalParams.BaseSpeed);
    98.     if (this.item())
    99.     {
    100.         speed += this.item().speed;
    101.     }
    102.     if (this.isAttack())
    103.     {
    104.         speed += this.subject().attackSpeed();
    105.     }
    106.     if(this.item().SpeedEval)
    107.     {
    108.         var a = this.subject();
    109.         eval(this.item().SpeedEval);
    110.     }
    111.     return speed;
    112. };
    复制代码


    FAQ

    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.2 - 2023/6/1 - Fixed a bug that caused incompatibility issues with other turn order display plugins.
    • v1.1 - 2022/9/10 - Optimized code to improve compatibility with other plugins.
    • v1.0 - 2022/9/9 - Initial release.



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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 02:37 , Processed in 0.080198 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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