Dynamic Buff
Author: Vyndicate
There's a part that you want to give a buff to allies or enemy gain a buff
But you also want to make it dynamic instead of 25% of each buff (or other value from plugins)
You can make it dynamic with this plugin
Description:
This plugin to make buff increase dynamically
Create a dynamic buff based on state you use
Notetag (States):
<BUFFS: [
{"paramId": 0, "buff": 2, "based": true, "type": 0},
{"paramId": 1, "buff": 1.3}
]>
paramId (Mandatory) => parameter id (Refer to game data)
buff (Optional) => Multiplier or Flat, depends on type, default will
multiplied by 1 or added by 0. Can use negative value
based (Optional) => Whether you want multiply from base only or with other calc
type (Optional) => between 0 and 1 (Only when based = false)
if 0, The buff will do multiplication
if 1, The buff will do addition
Default value:
based = false
type = 0
In that example, paramId 0 and 1 is Max HP and Max MP
Example of using based = true:
Def from stats = 10, def from other source (Armor, weapon, etc) = 20
Total def = 30
Buff = 2x
Total def after buff = 10 * 2 + 20 = 40
if based false, it will like this => (10 + 20) * 2 = 60
You can write either in one line or like example above
You can also write string like:
<BUFFS: [
{"paramId": 0, "buff": "v[3] + value / 200 + this.paramOrigin(4) / 5"},
{"paramId": 1, "buff": 1.3}
]>
v => variable value
value => param value of that id (in this case is mhp)
this.paramOrigin(x) => parameter value, same as param but in other function
to avoid recursive loop
You can use other like this.paramBase, this.paramPlus, etc. But avoid
this.param(), use this.paramOrigin() instead
Notetag (Weapon, Armor):
<BUFFS: [
{"paramId": 2, "buff": 0.5, "type": 0, "armorId": 2, "armorSlot": 2},
{"paramId": 2, "buff": -0.5, "type": 0, "armorId": 2, "armorSlot": 3}
]>
Pretty much similar to states but without based, with addition armorId,
armorSlot, weaponId, and weaponSlot
Buff value 0 is neutral, buff value 1 will double the value (Ex: atk +15,
buff: 1 will become atk +30). Remove the upgrade, set to -1. Assuming all
of this using type: 0
armorId can exist alone, but armorSlot need armorId. Similar to weapon
So far, the usage between armor and weapon separated. So it will like this
<BUFFS: [
{"paramId": 2, "buff": 0.5, "type": 0, "armorId": 2, "armorSlot": 2},
{"paramId": 2, "buff": -0.5, "type": 0, "weaponId": 2, "weaponSlot": 3}
]>
I'm yet to create if armor and weapon must exist, buff applied
Regarding how big the value is, you can go crazy whatever you want
From changelog 1.3.3: Thank you for someone mentioned me in Discord regarding this bug
Terms of Use:
Free for commercial and non commercial use with credits
Changelog:
v1.3.3
Simplified code
Fix multiple state use the latest one
v1.3.1
Fix when get .equips() cause error for enemies
v1.3.0
Add notetag for weapon and armor
v1.2.0
Add type, change buff between flat add or multiply it, and this.paramOrigin() function
v1.1.0
Add custom value, multiplier based on what you need, with variable and value
v1.0.0
Init plugin
Showcase:
In this case, allies who get Emergency Defense gets Max HP buff by 2x, def by 10x, and magical def by 10x
Stats before getting buff:
Stats when getting buff:
Showcase regarding weapon and armor notetag:
Notetag used for this showcase:
Code:
- <BUFFS: [
- {"paramId": 2, "buff": 0.5, "type": 0, "armorId": 2, "armorSlot": 2},
- {"paramId": 2, "buff": -0.5, "type": 0, "armorId": 2, "armorSlot": 3}
- ]>
复制代码
本贴来自国际rpgmaker官方论坛作者:Vyndicate处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/dynamic-buff.176805/