じ☆ve冰风 发表于 2026-7-24 16:37:41

DoubleX RMMV Item Triggers

Note


        This plugin's available for commercial use


Purpose


        Sets some items to trigger some actions when conditions are met


Games using this plugin


        None so far


Notetags

SpoilerSpoiler






*    # Skill/Item Notetags:                                                
*      1. <timing item trigger: ITCX, ITAX>                                 
*         - Sets a skill/item to trigger ITAX when timing and ITCX are met   
*         - timing can be pre, post or custom timings set by you            
*         - preBattle means right before using the skill/item in battles   
*         - postBattle means right after using the skill/item in battles   
*         - preMap means right before using the skill/item outside battles   
*         - postMap means right after using the skill/item outside battles   
*         - timing must only consist of alphanumeric characters            
*         - ITCX can be set in Item Trigger Condition Functions            
*         - ITAX can be set in Item Trigger Action Functions








Plugin Calls

SpoilerSpoiler






*    # Configuration manipulations                                          
*      1. DoubleX_RMMV.Item_Triggers.prop                                    
*         - Returns the property prop under DoubleX_RMMV.Item_Triggers      
*      2. DoubleX_RMMV.Item_Triggers.prop = function                        
*         - Sets the property prop under DoubleX_RMMV.Item_Triggers as      
*         function which will be bound to the battler upon use            
*         - No DoubleX_RMMV.Item_Triggers.prop change will be saved         
*    # Item manipulations                                                   
*      All meta.itemTriggers changes can be saved if                        
*      DoubleX RMMV Dynamic Data is used                                    
*      1. meta.itemTriggers                                          
*         - Returns the array of all ITCX-ITAX pairs of timing timing      
*      2. meta.itemTriggers = [, , ...]      
*         - Adds a new timing with some ITCX-ITAX pairs or overwrites all the
*         existing ones with those pairs if timing is an existing timing   
*      3. meta.itemTriggers =                         
*         - Set the ith ITCX-ITAX pair as the new ITCX-ITAX pair            
*    # Battler manipulations                                                
*      1. GBB.execItemTriggers.call(battler, item, timing)                  
*         - Executes all item triggers with timing timing of item of battler
*         battler                                                         
*         - GBB is DoubleX_RMMV.Item_Triggers.Game_BattlerBase








Configurations

SpoilerSpoiler



                            /*------------------------------------------------------------------------
                             *    Item Trigger Condition Functions                                    
                             *    - Setups ITCX used by <timing item trigger: ITCX, ITAX>             
                             *------------------------------------------------------------------------*/
                            /* ITCX are used at:
                               1. DoubleX_RMMV.Item_Triggers.Game_BattlerBase
                                  - if (IT].call(this)) { IT].call(this); } in
                                  - execItemTriggers
                               ITCX are Javascript functions which will be bound to the battler upon use
                               ITCX names can only use alphanumeric characters
                               item is the skill/item using the ITCX
                               The below ITCX are examples added to help you set your ITCX
                               You can freely use, rewrite and/or delete these examples */


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


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


                            // Adds new ITCX here
                            


                            /*------------------------------------------------------------------------
                             *    Item Trigger Action Values                                          
                             *    - Setups ITAX used by <timing item trigger: ITCX, ITAX>             
                             *------------------------------------------------------------------------*/
                            /* ITAX are used at:
                               1. DoubleX_RMMV.Item_Triggers.Game_BattlerBase
                                  - if (IT].call(this)) { IT].call(this); } in
                                  - execItemTriggers
                               ITAX are Javascript functions which will be bound to the battler upon use
                               ITAX names can only use alphanumeric characters
                               item is the skill/item using the ITAX
                               The below ITAX are examples added to help you set your ITAX
                               You can freely use, rewrite and/or delete these examples */


                            // Sets the item trigger action as what Special Effect Escape does
                            ITA1: function(item) { this.hide(); },


                            // Sets the item trigger action as setting the battler's hp to full
                            ITA2: function(item) { this._hp = this.mhp; },


                            // Adds new ITAX 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.01a(GMT 1300 26-2-2016):                                           
 *      1. ITCX and ITAX take the skill/item using them as an argument as well
 *      v1.00b(GMT 1400 27-1-2016):                                           
 *      1. Fixed calling current action via battler function upon action end 
*      v1.00a(GMT 1500 17-12-2015):                                          
*      1. 1st version of this plugin finished






View attachment DoubleX RMMV Item Triggers v101a.rar


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