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

[转载发布] Equip Optimize Grade v1.1

[复制链接]
累计送礼:
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

    灌水之王

    发表于 4 天前 | 显示全部楼层 |阅读模式
    Introduction
    By default, 'optimize' will select equipment with the highest total stats. This might not be ideal if some of the better equipment provide non-stat related benefits, and that's where this plugin comes in.

    Features

    • Allows optimize to utilize a grading system defined by the developer.
    • Can optionally change the optimize command to use item price.
    • Can set equipment as unique, preventing optimize from selecting the same item twice. (Ideal for equipment with effects that can't be stacked)
    How to use
    Save it as APHO_EquipOptimizeGrade.js and put it in your plugin folder.
    Set grades with the notetag
    1. <grade:n>
    复制代码
    'n' must be a number greater than -1000. Decimals may be used.

    If you have multiple slots for the same equip type (added via plugins like YEP_EquipCore), and you do not want the same item to be equipped twice, use the notetag
    1. <unique>
    复制代码

    If a grade is not specified, optimize will follow the ruling set by the plugin parameter 'ungraded equip ruling'.

    • 0 - Use the value set in the 'default grade' parameter.
    • 1 - Use stat totals, just like vanilla RMMV.
    • 2 - Use the item's price.
    If using anything other than default grade, it is highly recommended to either grade all equips of a specific equipment type, or none.

    Script
    Spoiler: CODE
                    JavaScript:       
    1. //==========================================
    2. // APHO_EquipOptimizeGrade.js
    3. //==========================================
    4. /*:
    5. * @title Equip Optimize Grade
    6. * @author Apho
    7. * @plugindesc v1.1 Allows the 'Optimize' command in the equip menu to utilize a grading system defined by the developer.
    8. *
    9. * @param Ungraded equip ruling
    10. * @type select
    11. * @option Use default grade
    12. * @value 0
    13. * @option Use stat totals (Default RMMV rules)
    14. * @value 1
    15. * @option Use item price
    16. * @value 2
    17. * @desc Ruling for optimizing equips when no grade is defined.
    18. * @default 0
    19. *
    20. * @param Default grade
    21. * @type number
    22. * @min -999
    23. * @desc If 'use default grade' ruling is selected, ungraded equips will have this grade.
    24. * @default 0
    25. *
    26. * @help
    27. * This plugin changes the way optimize works, by allowing the developer to set
    28. * grades for equipment.
    29. * Higher grades will be prioritized over lower ones when optimizing equipment.
    30. * If multiple equips have the same grade, the one with a lower ID will be
    31. * prioritized.
    32. *
    33. * Set grades with the notetag <grade:n>
    34. * 'n' must be a number greater than -1000. Decimals may be used.
    35. *
    36. * If you have multiple slots for the same equip type (added via plugins like
    37. * YEP_EquipCore), and you do not want the same item to be equipped twice, use
    38. * the notetag <unique>
    39. * (This will still equip twice if you have nothing else to equip.)
    40. *
    41. * If a grade is not specified, optimize will follow the ruling set by the plugin
    42. * parameter 'ungraded equip ruling'.
    43. * 0 - Use the value set in the 'default grade' parameter.
    44. * 1 - Use stat totals, just like vanilla RMMV.
    45. * 2 - Use the item's price.
    46. *
    47. * If using anything other than default grade, it is highly recommended to
    48. * either grade all equips of a specific equipment type, or none.
    49. *
    50. * TERMS OF USE
    51. * - Free for commercial and non-commercial use, as long as I get a free copy
    52. *   of the game.
    53. * - Edits allowed for personal use.
    54. * - Do not repost or claim as your own, even if edited.
    55. *
    56. * VERSION HISTORY
    57. * v1.1 - 2022/8/2 - Optimize code
    58. * v1.0 - 2022/8/1 - Initial release.
    59. */
    60. var parameters = PluginManager.parameters('APHO_EquipOptimizeGrade');
    61. var UngradedRuling = parseInt(parameters['Ungraded equip ruling']);
    62. var DefaultGrade = parseFloat(parameters['Default grade']);
    63. Game_Actor.prototype.calcEquipItemPerformance = function(item)
    64. {
    65.     if(item.meta.unique)
    66.     {
    67.         var who = this.actorId();
    68.         var what = item.id;
    69.         if(item.wtypeId && $gameActors.actor(who).hasWeapon($dataWeapons[what]))
    70.         {
    71.             return -1000;
    72.         }
    73.         else if(item.atypeId && $gameActors.actor(who).hasArmor($dataArmors[what]))
    74.         {
    75.             return -1000;
    76.         }
    77.     }
    78.     if(item.meta.grade)
    79.     {
    80.         return parseFloat(item.meta.grade);
    81.     }
    82.     else
    83.     {
    84.         switch(UngradedRuling)
    85.         {
    86.             case 0:
    87.                 return DefaultGrade;
    88.                 break;
    89.             case 1:
    90.                 return item.params.reduce(function(a, b){return a + b;});
    91.                 break;
    92.             case 2:
    93.                 return item.price;
    94.                 break;
    95.         }
    96.     }   
    97. }
    复制代码


    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.1 - 2022/8/1 - Optimized code.
    • v1.0 - 2022/8/1 - Initial release.



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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 06:40 , Processed in 0.087904 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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