じ☆ve冰风 发表于 2026-7-28 21:48:01

State Add/Remove Commands

State Add/Remove Commands

2015.11.24

by Shaz

Introduction

This plugin allows you to run commands when a state is added or removed.

How to use

Add to your plugins folder (file name is irrelevant but I use StateAddRemoveCommands.js). There are no parameters to set or plugin commands to call.

Add the following to the State note box:

onadd: commandonremove: command to execute command when the state is added or removed.

command is any Javascript command that will be executed in the context of a battler (actor or enemy). Use this to refer to the current battler.

Examples

onadd: this.gainHp(50)- add 50 HP to the battler when the state is added

                Code:       
onremove: this.gainMp(-100)

- deduct 100 MP from the battler when the state is removed

                Code:       
onremove: this.addState(15)

- adds state 15 to the battler when the current state (the one with the note tag) is removedPlugin

Download from pastebin

Credit

- Shaz

Terms

- free for use in commercial games

Notes

This is a port of my State Add/Remove Commands script for Ace.  Some people previously reported issues with that script that I have not yet been able to reproduce or solve.  If you encounter any issues please list them and I'll attempt to resolve.


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