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

[转载发布] DoubleX RMMV State Triggers

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

    连续签到: 2 天

    [LV.7]常住居民III

    5778

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 14:10 | 显示全部楼层 |阅读模式
    Note


            This plugin's available for commercial use


    Purpose


            Sets some states to trigger additional effects when conditions are met


    Games using this plugin


            None so far


    Notetags

    SpoilerSpoiler




    *    # State Notetags:                                                      
    *      1. <timing state trigger: STCX, STAX>                                 
    *         - Sets a state to trigger STAX when timing and STCX are met        
    *         - timing can be add, turn, remove or custom timings set by you     
    *         - add means the state's just added                                 
    *         - turn means the state's remaining turn's just reduced by 1        
    *         - remove means the state's just removed                           
    *         - (v1.02a+)while means the STAX effects are active as long as the  
    *           state's active                                                   
    *         - timing must only consist of alphanumeric characters              
    *         - STCX can be set in State Trigger Condition Functions            
    *         - STAX can be set in State Trigger Action Functions






    Plugin Calls

    SpoilerSpoiler




    *    # Configuration manipulations                                          
    *      1. DoubleX_RMMV.State_Triggers.prop                                   
    *         - Returns the property prop under DoubleX_RMMV.State_Triggers      
    *      2. DoubleX_RMMV.State_Triggers.prop = val                             
    *         - Sets the property prop under DoubleX_RMMV.State_Triggers as a   
    *           function which will be bound to the battler upon use            
    *    # State manipulations                                                   
    *      All meta.stateTriggers changes can be saved if                        
    *      DoubleX RMMV Dynamic Data is used                                    
    *      1. meta.stateTriggers[timing]                                         
    *         - Returns the array of all STCX-STAX pairs of timing timing        
    *      2. meta.stateTriggers[timing] = [[STCX, STAX], [STCX, STAX], ...]     
    *         - Adds a new timing with some STCX-STAX pairs or overwrites all the
    *           existing ones with those pairs if timing is an existing timing   
    *      3. meta.stateTriggers[timing] = [STCX, STAX]                       
    *         - Set the ith STCX-STAX pair as the new STCX-STAX pair            
    *    # Battler manipulations                                                
    *      (v1.02a+)1. GBB.stateTriggerTraits.call(battler, state, timing)      
    *         - Collects all traits from all STAX meeting their corresponding   
    *           STCX with timing timing of state applied to battler              
    *         - GBB is DoubleX_RMMV.State_Triggers.Game_BattlerBase              
    *      2. GBB.execStateTriggers.call(battler, stateId, timing)               
    *         - Executes all state triggers with timing timing of state with id  
    *           stateId applied to battler                                       
    *         - GBB is DoubleX_RMMV.State_Triggers.Game_BattlerBase              









    Configurations

    SpoilerSpoiler




        /*------------------------------------------------------------------------
         *    State Trigger Condition Functions                                   
         *    - Setups STCX used by this plugin's notetags                        
         *------------------------------------------------------------------------*/
        /* STCX are used at:
         * 1. DoubleX_RMMV.State_Triggers.Game_BattlerBase
         *    - return ST[trigger[0]].call(battler, state); in stateTriggerTraits
         *    - if (ST[trigger[0]].call(this)) { ST[trigger[1]].call(this); } in
         *      execStateTriggers
         * STCX are Javascript functions which will be bound to the battler upon use
         * STCX names can only use alphanumeric characters
         * state is the state using the STCX
         * The below STCX are examples added to help you set your STCX
         * You can freely use, rewrite and/or delete these examples
         */

        // Sets the state trigger condition as always true
        STC1: function(state) { return true; },

        // Sets the state trigger condition as needing switch with id x to be on
        STC2: function(state) { return $gameSwitches.value(x); },

        // Sets the state trigger condition as always true
        STC3: function(state) { return false; },

        // Adds new STCX here


        /*------------------------------------------------------------------------
         *    State Trigger Action Values                                         
         *    - Setups STAX used by this plugin's notetags                        
         *------------------------------------------------------------------------*/
        /* STAX are used at:
         * 1. DoubleX_RMMV.State_Triggers.Game_BattlerBase
         *    - return r.concat(ST[trigger[1]].call(battler, state)); in
         *      stateTriggerTraits
         *    - if (ST[trigger[0]].call(this)) { ST[trigger[1]].call(this); } in
         *      execStateTriggers
         * STAX are Javascript functions which will be bound to the battler upon use
         * STAX names can only use alphanumeric characters
         * state is the state using the STAX
         * If the timing using the STAX is while, the STAX must return an array of
         * Trait Class
         * You can refer to Game_BattlerBase in rpg_objects.js and Trait Class in
         * the RMMV help html
         * The below STAX are examples added to help you set your STAX
         * You can freely use, rewrite and/or delete these examples
         */

        /* Sets the state trigger action as what Special Effect Escape does
         * This STAX's not supposed to work with the timing while as it doesn't
         * return an array of Trait Class
         */
        STA1: function(state) { this.hide(); },

        /* Sets the state trigger action as setting the battler's hp to full
         * This STAX's not supposed to work with the timing while as it doesn't
         * return an array of Trait Class
         */
        STA2: function(state) { this._hp = this.mhp; },

        /* Sets the state trigger action as ultiplying the battler's atk by x * 100%
         * This STAX's supposed to work with the timing while as it returns an array
         * of Trait Class
         */
        STA3: function(state) { return [{"code":21,"dataId":2,"value":x}]; }

        // Adds new STAX here






    Prerequisites


            1. Decent Javascript coding proficiency to fully utilize this plugin


    Terms Of Use


            You shall keep this plugin's Plugin Info part's contents intact


            You shalln't claim that this plugin's written by anyone other than DoubleX or his aliases


            None of the above applies to DoubleX or his/her aliases


    Changelog

    SpoilerSpoiler




    *      v1.02a(GMT 0200 14-5-2016):                                          
    *      1. Added the timing while to <timing state trigger: STCX, STAX>      
    *      v1.01a(GMT 1300 26-2-2016):                                          
    *      1. STCX and STAX take the state using them as an argument as well     
    *      v1.00g(GMT 0400 25-12-2015):                                          
    *      1. The aliased functions can be accessed by other custom plugins now  
    *      2. Exposed the state plugin calls that can access the notetag values  
    *      3. Increased this plugin's compactness, compatibility and readability
    *      v1.00f(GMT 1500 6-11-2015):                                          
    *      1. Fixed undefined this in forEach bug                                
    *      v1.00e(GMT 1400 6-11-2015):                                          
    *      1. Simplified the notetag reading mechanisms                          
    *      2. Fixed some typos                                                
    *      v1.00d(GMT 1100 5-11-2015):                                          
    *      1. Fixed undefined this under DoubleX_RMMV.State_Triggers bug         
    *      v1.00c(GMT 0000 5-11-2015):                                          
    *      1. Fixed failing to load notetags due to nil $dataStates bug         
    *      v1.00b(GMT 1000 4-11-2015):                                          
    *      1. Fixed several logic and syntax errors                              
    *      2. Increased this plugin's maintainability                           
    *      v1.00a(GMT 1500 30-10-2015):                                          
    *      1. 1st version of this plugin finished






    View attachment DoubleX RMMV State Triggers v102a.rar



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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-26 04:54 , Processed in 0.110757 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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