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

[转载发布] Yanfly Gab Windows State Status Alert Extension

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

    连续签到: 2 天

    [LV.7]常住居民III

    8038

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 5 天前 | 显示全部楼层 |阅读模式
    Yanfly Gab Windows State Status Alert Extension
    Created by Ritter


    Introduction
    This extension to Yanfly's Gab Windows plugin allows for the use of gab windows upon adding/removing a state outside of battle. Simply use note tags in your state database for each state to display a gab window!
    This plugin requires you to own Yanfly Gab Windows, without that plugin this extension will not function at all.
    This plugin only calls to and does not modify Yanfly Gab Windows plugin in any way.


    Idea from this thread Here

    Download plugin: Click Here

    Features
    - Display gab windows when evented 'Change State' is used.
    - Display gab window when state is removed from walking distance.

    How to Use
    Download the plugin and place it in your projects js/plugins folder, add the plugin to the plugin manager. Place the following note tags in each state you want to display a gab window for.

    <addGab:text>
    <removeGab:text>

    Example usage:

    <addGab:Suffering from Poison!>
    <removeGab:No longer suffering from Poison!>
    This would show a gab window when an actor gets the poison state and when the poison state is removed.

    You can also use the word actor to display the actors name in the gab window.

    Example usage:

    <addGab:actor is suffering from Poison!>
    <removeGab:actor is no longer Poisoned!>

    This would pop up a gab window with the following messages when state is added or removed.
    Harold is suffering from Poison!
    Harold is no longer Poisoned!

    Script
    Spoiler: Plugin code
                    JavaScript:       
    1. /*:
    2. *
    3. * @plugindesc Yanfly Gab Windows State Status Alert Ext
    4. *
    5. * @author Ritter
    6. *
    7. * @help
    8. *
    9. * Add state notetags to display a gab window for add/remove states!
    10. * Works with evented 'Change State' command and step removal.
    11. *
    12. * Just add both note tags for each state you want to display a gab
    13. * window for.
    14. *
    15. * note tags:
    16. *
    17. * <addGab:text>
    18. * <removeGab:text>
    19. *
    20. * Example usage:
    21. *
    22. * <addGab:Suffering from Poison>
    23. * <removeGab:No longer suffering from Poison>
    24. *
    25. * You can also use the word actor to display actors name.
    26. *
    27. * <addGab:actor is suffering from Poison>
    28. * <removeGab:actor is no longer suffering from Poison>
    29. *
    30. * This would make it say Harold is suffering from Poison
    31. * Harold is no longer suffering from Poison
    32. *
    33. *-----------------------------------------------------------------
    34. *
    35. * Terms of use:
    36. *
    37. * Free to use for commercial and non-commercial games provided you
    38. * own Yanfly Gab Windows plugin.
    39. * You are free to edit, chop, delete, copy, paste, destroy, burn, take
    40. * code from, or toss this plugin in the river as much as you please.
    41. * (Plugin not tested for buoyancy)
    42. * Feel free to credit me if you wish, this is optional but appreciated.
    43. *
    44. *
    45. */
    46. (function() {
    47. // Aliased functions to display gabs when needed.
    48. // Change State
    49. var alias_Game_Interpreter_command313 = Game_Interpreter.prototype.command313;
    50. Game_Interpreter.prototype.command313 = function() {
    51.     this.iterateActorEx(this._params[0], this._params[1], function(actor) {
    52.         var alreadyDead = actor.isDead();
    53.         if (this._params[2] === 0) {
    54.             if ($dataStates[this._params[3]].meta.addGab) {
    55.                 this.addStateGab(this._params[3], actor);
    56.                 this.showGab();
    57.             }
    58.         } else {
    59.             if ($dataStates[this._params[3]].meta.removeGab) {
    60.                 this.removeStateGab(this._params[3], actor);
    61.                 this.showGab();
    62.             }
    63.         }
    64.     }.bind(this));
    65.     return alias_Game_Interpreter_command313.call(this);
    66. };
    67. // show added states on steps, not sure how this works but added it anyway?
    68. var alias_Game_Actor_showAddedStates = Game_Actor.prototype.showAddedStates;
    69. Game_Actor.prototype.showAddedStates = function() {
    70.     this.result().addedStateObjects().forEach(function(state) {
    71.        if ($dataStates[state.id].meta.addGab) {
    72.             Game_Interpreter.prototype.addStateGab(state.id, this);
    73.             Game_Interpreter.prototype.showGab();
    74.         } else {
    75.             alias_Game_Actor_showAddedStates.call(this);
    76.         }
    77.     }, this);
    78. };
    79. // show removed states on steps
    80. var alias_Game_actor_showRemovedStates = Game_Actor.prototype.showRemovedStates;
    81. Game_Actor.prototype.showRemovedStates = function() {
    82.     this.result().removedStateObjects().forEach(function(state) {
    83.         if ($dataStates[state.id].meta.removeGab) {
    84.             Game_Interpreter.prototype.removeStateGab(state.id, this);
    85.             Game_Interpreter.prototype.showGab();
    86.         } else {
    87.             alias_Game_Actor_showRemovedStates.call(this);
    88.         }
    89.     }, this);
    90. };
    91. // Functions for handling gabs.
    92. // create gab text for added state
    93. Game_Interpreter.prototype.addStateGab = function(state, actor) {
    94.     text = this.gabMeta(state, 1);
    95.     if (text.contains("actor")) text = text.replace("actor", actor._name);
    96.     this._gabText = text;
    97. };
    98. // create gab text for removed state
    99. Game_Interpreter.prototype.removeStateGab = function(state, actor) {
    100.     text = this.gabMeta(state, 0);
    101.     if (text.contains("actor")) text = text.replace("actor", actor._name);
    102.     this._gabText = text;
    103. };
    104. // get state meta data
    105. Game_Interpreter.prototype.gabMeta = function(state, value) {
    106.     if (value == 1) return $dataStates[state].meta.addGab;
    107.     if (value == 0) return $dataStates[state].meta.removeGab;
    108. };
    109. })();
    复制代码


    Credit and Thanks
    - Extension plugin created by Ritter.
    - Gab Windows plugin created by Yanfly.

    FAQ
    Q: Why isn't (this) feature included?
    A: If you need a feature added make a request and if its reasonable I'll see about doing it!~

    Terms of use
    Free to use for commercial and non-commercial games provided you own Yanfly Gab Windows plugin.
    You are free to edit, chop, delete, copy, paste, destroy, burn, take
    code from, or toss this plugin in the river as much as you please.
    (Plugin not tested for buoyancy)
    Feel free to credit me if you wish, this is optional but appreciated.


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 10:45 , Processed in 0.098772 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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