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

[转载发布] DoubleX RMMV Status Bars

[复制链接]
累计送礼:
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 天前 | 显示全部楼层 |阅读模式
    Purpose
    Lets you use bars to show battler statuses on their sprites

    Games using this plugin
    None so far

    Parameters
    Spoiler                Code:       
    1. * @param isEnabled
    2. * @desc Sets whether this plugin will be enabled
    3. *       It'll be stored as a boolean, and will be regarded as true if and only
    4. *       if it's true
    5. *       Don't change this during the same battle unless you really know what
    6. *       you're truly foing
    7. *       E.g.: Setting isEnabled as false will disable this plugin
    8. * @default true
    复制代码






    Notetags
    Spoiler                Code:       
    1. *    # Actor/Class/Weapon/Armor/Enemy/State Notetags:
    2. *      State notetags take the highest priority, followed by enemy, weapon,
    3. *      armor, class and actor
    4. *      1. <status status bar: SBX>
    5. *         - Sets the battler to setup a status bar of status using
    6. *           configurations set in function name SBX, which can only be edited
    7. *           in this plugin js file directly
    8. *         - status must be included in STATUSES, which can only be edited in
    9. *           this plugin js file directly
    10. *         - E.g.:
    11. *           <hp status bar: HP> will set the battler to setup a hp status bar
    12. *           using configurations set in HP, which can only be edited in this
    13. *           plugin js file directly
    14. *         - Only the 1st effective notetag among all having the same status
    15. *           will be used(Reference tag: NOTETAG_MONO)
    复制代码






    Plugin Calls
    Spoiler                Code:       
    1. *    # Configuration manipulations
    2. *      1. $gameSystem.statusBars.param
    3. *         - Returns the stored value of param listed in the plugin manager
    4. *         - E.g.:
    5. *           $gameSystem.statusBars.isEnabled will return a Boolean indicating
    6. *           whether this plugin's enabled
    7. *      2. $gameSystem.statusBars.param = val
    8. *         - Sets the stored value of param listed in plugin manager as val
    9. *         - E.g.:
    10. *           $gameSystem.statusBars.isEnabled = false will set the stored
    11. *           value of parameter isEnabled shown on the plugin manager as false
    12. *         - All $gameSystem.statusBars.param changes will be saved
    13. *    # Actor/Class/Weapon/Armor/Enemy/State notetag manipulations
    14. *      1. meta.statusBars[status]
    15. *         - Returns the function name SBX for String status specified in
    16. *           <status status bar: SBX> if there's any
    17. *         - E.g.:
    18. *           $dataStates[1].meta.statusBars[hp] will return the function SBX
    19. *           specified in <hp status bar: SBX> notetag of state with id 1
    20. *      2. meta.statusBars[status] = SBX
    21. *         - Sets the String status in <status status bar: SBX> notetag to use
    22. *           the function with name SBX which is a String
    23. *         - E.g.:
    24. *           $dataEnemies[2].meta.statusBars['mp'] = 'MP' will set the SBX
    25. *           specified in <mp status bar: SBX> notetag of enemy with id 2 as
    26. *           MP
    27. *         - All meta.statusBars changes can be saved if
    28. *           DoubleX RMMV Dynamic Data is used
    29. *    # Battler manipulations
    30. *      1. isStatusBarChanged[status] = true
    31. *         - Notifys the status status bar of the battler to use a new
    32. *           configuration object
    33. *         - It'll be reset as false once a new configuration object's used
    34. *         - E.g.:
    35. *           $gameParty.aliveMembers()[0].isStatusBarChanged['tp'] = true will
    36. *           notify the tp status bar of the battler to use a new
    37. *           configuration object
    38. *    # Status bar manipulations
    39. *      1. new Window_Status_Bar(battler, status)
    40. *         - Creates a new status bar showing the status status of battler
    41. *           battler
    42. *         - E.g.:
    43. *           new Window_Status_Bar($gameTroop.aliveMembers()[0], 'hp') will
    44. *           create a new status bar showing the hp status of the 1st troop
    45. *           member
    复制代码






    Configurations
    Spoiler                Code:       
    1.     /* Setups the list of statuses that can have their status bars drawn
    2.      * Each status must be represented by the name of its battler getter
    3.      */
    4.     STATUSES: [
    5.         'hp',
    6.         'mp',
    7.         'tp'
    8.     ],
    9.     /*------------------------------------------------------------------------
    10.      *    Status Bar Functions
    11.      *    - Setups SBX used by <status bar: SBX>
    12.      *------------------------------------------------------------------------*/
    13.     /* SBX are used by Window_Status_Bar at this._cfg = SB[this._cfgName](); in
    14.      * _updateCfg
    15.      * SBX are Javascript functions which must return an Object having at least
    16.      * the following:
    17.      * {
    18.      *     visible: function(battler), // Hotspot
    19.      *     opacity: function(battler), // Hotspot
    20.      *     backColor: function(battler), // Hotspot
    21.      *     color1: function(battler), // Hotspot
    22.      *     color2: function(battler), // Hotspot
    23.      *     x: function(battler), // Hotspot
    24.      *     y: function(battler), // Hotspot
    25.      *     w: function(battler), // Hotspot
    26.      *     h, function(battler), // Hotspot
    27.      *     text, function(battler), // Hotspot
    28.      *     textX: function(battler), // Hotspot
    29.      *     textY: function(battler), // Hotspot
    30.      *     textSize: function(battler), // Hotspot
    31.      *     textColor: function(battler), // Hotspot
    32.      *     min: function(battler), // Hotspot
    33.      *     max: function(battler), // Hotspot
    34.      *     (v1.01a+)showProc: function(battler), // Hotspot
    35.      *     (v1.01a+)procUpdateRate: function(battler) // Hotspot
    36.      * }
    37.      * All functions will be bound to the Window_Status_Bar upon its creation
    38.      * and must take the battler and database item using the SBX as their
    39.      * arguments
    40.      *
    41.      * Status bar configuration functions:
    42.      * The function result of visible, which is the status bar visibility, will
    43.      * be interpreted as truthy or falsy only
    44.      * The function of opacity, which is the status bar opacity, must return a
    45.      * Number between 0 and 255
    46.      * The functions of backColor, color1 and color2, which are the status bar
    47.      * back, 1st and 2nd colors respectively, must return a Number between
    48.      * #00000000 and #FFFFFFFF
    49.      * The functions of x and y, which are the status bar x and y offsets from
    50.      * the battler sprites respectively, must return a Number
    51.      * The functions of w and h, which are the status bar width and height
    52.      * respectively, must return a positive Number
    53.      * The function of text, which is the status bar description text, must
    54.      * return a String
    55.      * The functions of textX, textY and textSize, which are the status bar
    56.      * description text x and y offset from the status bar, and size
    57.      * respectively, must return a positive Number
    58.      * The functions of min and max, which are the minimum and maximum value of
    59.      * the status respiectively, must return a Number that must be not greater
    60.      * than and not less than all the possible values of the current value
    61.      * respectively
    62.      * (v1.01a+)The functions of showProc, which is whether the stat change
    63.      * processes will be shown on the status bars, will be interpreted as truthy
    64.      * or falsy only
    65.      * (v1.01a+)The functions of procUpdateRate, which is the rate relative to
    66.      * the max length of the stat bar per second, must return a Number between 0
    67.      * and 1
    68.      * (v1.01a+)The functions of procColor1 and procColor2, which are the status
    69.      * bar 1st and 2nd stat change colors respectively, must return a Number
    70.      * between #00000000 and #FFFFFFFF
    71.      *
    72.      * SBX names can only use alphanumeric characters
    73.      * The below SBX are examples added to help you set your SBX
    74.      * You can freely use, rewrite and/or delete these examples
    75.      *
    76.      * Advanced:
    77.      * The status bar prototype's inherited from Window_Base.prototype
    78.      * All status bar configuration functions are used by Window_Status_Bar
    79.      * visible and opacity are used in _updateBarVisibility
    80.      * backColor, color1, color2, textColor, text, textX and textY are used in
    81.      * _updateSetting
    82.      * x, y, w and h are used in initialize
    83.      * x is also used in _updateX
    84.      * y is also used in _updateY
    85.      * w is also used in _updateW
    86.      * h is also used in _updateH
    87.      * min and max are used in _updateFillW
    88.      * (v1.01a+)showProc
    89.      */
    90.     // Sets the status bar to display the battler's hp statuses
    91.     HP: function() { // v1.00a - v1.01a; Potential Hotspot
    92.         return {
    93.             // Sets the hp bar to be always visible only for alive battlers
    94.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
    95.             // Sets the hp bar opacity to be always 255
    96.             opacity: function(battler) { return 255; }, // Hotspot
    97.             // Sets the hp bar color 1 to be always text color 15
    98.             backColor: function(battler) { // Hotspot
    99.                 return this.textColor(15);
    100.             },
    101.             // Sets the hp bar color 1 to be always text color 20
    102.             color1: function(battler) { return this.textColor(20); }, // Hotspot
    103.             // Sets the hp bar color 2 to be always text color 21
    104.             color2: function(battler) { return this.textColor(21); }, // Hotspot
    105.             // Sets the hp bar x offset from battler sprite to be always 0
    106.             x: function(battler) { return 0; }, // Hotspot
    107.             // Sets the hp bar y offset from battler sprite to be always 16
    108.             y: function(battler) { return 16; }, // Hotspot
    109.             // Sets the hp bar width to be always 87
    110.             w: function(battler) { return 87; }, // Hotspot
    111.             // Sets the hp bar height to be always 16
    112.             h: function(battler) { return 16; }, // Hotspot
    113.             // Sets the hp bar description text to be always hp/mhp
    114.             text: function(battler) { // Hotspot
    115.                 return battler.hp.toString() + '/' + battler.mhp.toString();
    116.             },
    117.             // Sets the hp bar description text size to be always 0
    118.             textX: function(battler) { return 0; }, // Hotspot
    119.             // Sets the hp bar description text size to be always 0
    120.             textY: function(battler) { return 0; }, // Hotspot
    121.             // Sets the hp bar description text size to be always 13
    122.             textSize: function(battler) { return 13; }, // Hotspot
    123.             // Sets hp bar description text color to be always text color 0
    124.             textColor: function(battler) { // Hotspot
    125.                 return this.textColor(0);
    126.             },
    127.             // Sets the minimum hp to be shown on the hp bar to be always 0
    128.             min: function(battler) { return 0; }, // Hotspot
    129.             // Sets the maximum hp to be shown on the hp bar to be always mhp
    130.             max: function(battler) { return battler.mhp; }, // Hotspot
    131.             // (v1.01a+)Sets the hp change processes to be always shown
    132.             showProc: function(battler) { return true; }, // Hotspot
    133.             // (v1.01a+)Sets the hp change processes rate to be 100% of the
    134.             // max length of the hp bar per second
    135.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
    136.             // Sets the hp change process color 1 to be always text color 6
    137.             procColor1: function(battler) { return this.textColor(6); },
    138.             // Hotspot
    139.             // Sets the hp change process color 2 to be always text color 17
    140.             procColor2: function(battler) { return this.textColor(17); }
    141.             // Hotspot
    142.         };
    143.     },
    144.     // Sets the status bar to display the battler's mp statuses
    145.     MP: function() { // v1.00a - v1.01a; Potential Hotspot
    146.         return {
    147.             // Sets the mp bar to be always visible only for alive battlers
    148.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
    149.             // Sets the mp bar opacity to be always 255
    150.             opacity: function(battler) { return 255; }, // Hotspot
    151.             // Sets the mp bar color 1 to be always text color 15
    152.             backColor: function(battler) { // Hotspot
    153.                 return this.textColor(15);
    154.             },
    155.             // Sets the mp bar color 1 to be always text color 22
    156.             color1: function(battler) { return this.textColor(22); }, // Hotspot
    157.             // Sets the mp bar color 2 to be always text color 23
    158.             color2: function(battler) { return this.textColor(23); }, // Hotspot
    159.             // Sets the mp bar x offset from battler sprite to be always 0
    160.             x: function(battler) { return 0; }, // Hotspot
    161.             // Sets the mp bar y offset from battler sprite to be always 32
    162.             y: function(battler) { return 32; }, // Hotspot
    163.             // Sets the mp bar width to be always 87
    164.             w: function(battler) { return 87; }, // Hotspot
    165.             // Sets the mp bar height to be always 16
    166.             h: function(battler) { return 16; }, // Hotspot
    167.             // Sets the mp bar description text to be always mp/mmp
    168.             text: function(battler) { // Hotspot
    169.                 return battler.mp.toString() + '/' + battler.mmp.toString();
    170.             },
    171.             // Sets the mp bar description text size to be always 0
    172.             textX: function(battler) { return 0; }, // Hotspot
    173.             // Sets the mp bar description text size to be always 0
    174.             textY: function(battler) { return 0; }, // Hotspot
    175.             // Sets the mp bar description text size to be always 13
    176.             textSize: function(battler) { return 13; }, // Hotspot
    177.             // Sets mp bar description text color to be always text color 0
    178.             textColor: function(battler) { // Hotspot
    179.                 return this.textColor(0);
    180.             },
    181.             // Sets the minimum mp to be shown on the hp bar to be always 0
    182.             min: function(battler) { return 0; }, // Hotspot
    183.             // Sets the maximum mp to be shown on the hp bar to be always mmp
    184.             max: function(battler) { return battler.mmp; }, // Hotspot
    185.             // (v1.01a+)Sets the mp change processes to be always shown
    186.             showProc: function(battler) { return true; }, // Hotspot
    187.             // (v1.01a+)Sets the mp change processes rate to be 100% of the
    188.             // max length of the mp bar per second
    189.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
    190.             // Sets the mp change process color 1 to be always text color 1
    191.             procColor1: function(battler) { return this.textColor(1); },
    192.             // Hotspot
    193.             // Sets the mp change process color 2 to be always text color 4
    194.             procColor2: function(battler) { return this.textColor(4); }
    195.             // Hotspot
    196.         };
    197.     },
    198.     // Sets the status bar to display the battler's tp statuses
    199.     TP: function() { // v1.00a - v1.01a; Potential Hotspot
    200.         return {
    201.             // Sets the tp bar to be always visible
    202.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
    203.             // Sets the tp bar opacity to be always 255
    204.             opacity: function(battler) { return 255; }, // Hotspot
    205.             // Sets the tp bar color 1 to be always text color 15
    206.             backColor: function(battler) { // Hotspot
    207.                 return this.textColor(15);
    208.             },
    209.             // Sets the tp bar color 1 to be always text color 28
    210.             color1: function(battler) { return this.textColor(28); }, // Hotspot
    211.             // Sets the tp bar color 2 to be always text color 29
    212.             color2: function(battler) { return this.textColor(29); }, // Hotspot
    213.             // Sets the tp bar x offset from battler sprite to be always 0
    214.             x: function(battler) { return 0; }, // Hotspot
    215.             // Sets the tp bar y offset from battler sprite to be always 48
    216.             y: function(battler) { return 48; }, // Hotspot
    217.             // Sets the tp bar width to be always 87
    218.             w: function(battler) { return 87; }, // Hotspot
    219.             // Sets the tp bar height to be always 16
    220.             h: function(battler) { return 16; }, // Hotspot
    221.             // Sets the tp bar description text to be always tp/maxTp()
    222.             text: function(battler) { // Hotspot
    223.                 return battler.tp.toString() + '/' + battler.maxTp().toString();
    224.             },
    225.             // Sets the tp bar description text size to be always 0
    226.             textX: function(battler) { return 0; }, // Hotspot
    227.             // Sets the tp bar description text size to be always 0
    228.             textY: function(battler) { return 0; }, // Hotspot
    229.             // Sets the tp bar description text size to be always 13
    230.             textSize: function(battler) { return 13; }, // Hotspot
    231.             // Sets tp bar description text color to be always text color 0
    232.             textColor: function(battler) { // Hotspot
    233.                 return this.textColor(0);
    234.             },
    235.             // Sets the minimum tp to be shown on the hp bar to be always 0
    236.             min: function(battler) { return 0; }, // Hotspot
    237.             // Sets maximum tp to be shown on the hp bar to be always maxTp()
    238.             max: function(battler) { return battler.maxTp(); }, // Hotspot
    239.             // (v1.01a+)Sets the tp change processes to be always shown
    240.             showProc: function(battler) { return true; }, // Hotspot
    241.             // (v1.01a+)Sets the mp change processes rate to be 100% of the
    242.             // max length of the mp bar per second
    243.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
    244.             // Sets the tp change process color 1 to be always text color 3
    245.             procColor1: function(battler) { return this.textColor(3); },
    246.             // Hotspot
    247.             // Sets the tp change process color 2 to be always text color 24
    248.             procColor2: function(battler) { return this.textColor(24); }
    249.             // Hotspot
    250.         };
    251.     },
    252.     // Adds new SBX here
    复制代码






    Video

    https://www.youtube.com/embed/92fOe1PS3gY

    Prerequisites
    Abilities:
    1. Nothing special for most rudimetary use cases
    2. Little RMMV plugin development proficiency for most ordinary uses
    3. Some RMMV plugin development proficiency to fully utilize this

    Instructions
    Spoiler                Code:       
    1. * You're supposed to open this plugin js file to edit its configurations
    复制代码






    Terms Of Use
    Spoiler                Code:       
    1. *      1. Commercial use's always allowed and crediting me's always optional.
    2. *      2. You shall keep this plugin's Plugin Info part's contents intact.
    3. *      3. You shalln't claim that this plugin's written by anyone other than
    4. *         DoubleX or my aliases. I always reserve the right to deny you from
    5. *         using any of my plugins anymore if you've violated this.
    6. *      4. CC BY 4.0, except those conflicting with any of the above, applies
    7. *         to this plugin, unless you've my permissions not needing follow so.
    8. *      5. I always reserve the right to deny you from using this plugin
    9. *         anymore if you've violated any of the above.
    复制代码






    Changelog
    Spoiler                Code:       
    1. *      v1.01c(GMT 1300 21-2-2025):
    2. *      1. Fixed the stat change processes not working when the values
    3. *         increase from 0 bug
    4. *      2. You no longer have to edit the value of
    5. *         DoubleX_RMMV.Status_Bars_File when changing the plugin file name
    6. *      v1.01b(GMT 1200 7-7-2019):
    7. *      1. Fixed the invisible status bars not being able to be visible again
    8. *      2. Fixed the equips, classes and actors status bar data not being used
    9. *      v1.01a(GMT 1400 12-8-2017):
    10. *      1. Lets you set the status bars to show the stat change processes via
    11. *         showProc, procUpdateRate, procColor1 and procColor2 in SBX
    12. *      2. Fixed crashes for status bars having the same minimum and maximum
    13. *      v1.00a(GMT 1700 16-9-2016):
    14. *      1. 1st version of this plugin finished
    复制代码






    Download
    DoubleX RMMV Status Bars


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 01:33 , Processed in 0.098132 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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