Hello, I'm trying to create an accessory which works similarly the phoenix ring, but which works once per battle, as opposed to breaking it, since it is an equipment piece which grants other benefits. What would be the best way to do it, even using other VS plugins?
How to implement every possible Yanfly Tips & Tricks effect in MZ with VisuStella plugins
● ARCHIVED · READ-ONLY
-
-
I'd just use a switch.Hello, I'm trying to create an accessory which works similarly the phoenix ring, but which works once per battle, as opposed to breaking it
Code:<JS On Add State> if (target.isActor()) { const ring = $dataArmors[101]; if (target.hasArmor(ring) && !$gameSwitches.value(X)) { $gameSwitches.setValue(X, true); $gameTemp.requestAnimation([target], 42); const hp = Math.floor(target.mhp * 0.25); target.gainHp(hp); } } </JS On Add State>
You'd have to replace the two instances of "X" with the ID of an available switch in your game, then have a turn 0 troop event in every troop that sets the switch to OFF. Or add a post-battle common event that does so, I think the VisuStella Battle Core lets you do that.
This only works correctly if the ring is a unique item. If more than one actor can have it equipped, and it should work once per battle for each of them, I'd change the code entirely and put it into a passive state granted by the ring. -
Could you please elaborate on that, this sounds a bit more flexible and less conflictual with "normal" phoenix rings!This only works correctly if the ring is a unique item. If more than one actor can have it equipped, and it should work once per battle for each of them, I'd change the code entirely and put it into a passive state granted by the ring.
-
It sounds less conflictual, does it? :wink::guffaw:less conflictual
Just use mostly the code for Auto-Life with a boolean on the actor.
Code:<JS Pre-Start Battle> user.resurrected=false; </JS Pre-Start Battle> <JS Post-Apply As Target> if ((target.hp <= 0 || target.isDead()) && !target.resurrected) { $gameTemp.requestAnimation([target], 49); const rate = 0.1; const heal = Math.floor(target.mhp * rate); target.gainHp(heal); target.startDamagePopup(); target.resurrected=true; } </JS Post-Apply As Target>
Adjust the animation ID and healing math as desired. -
It's a real word!It sounds less conflictual, does it? :wink::guffaw:
Just use mostly the code for Auto-Life with a boolean on the actor.
Code:<JS Pre-Start Battle> user.resurrected=false; </JS Pre-Start Battle> <JS Post-Apply As Target> if ((target.hp <= 0 || target.isDead()) && !target.resurrected) { $gameTemp.requestAnimation([target], 49); const rate = 0.1; const heal = Math.floor(target.mhp * rate); target.gainHp(heal); target.startDamagePopup(); target.resurrected=true; } </JS Post-Apply As Target>
Adjust the animation ID and healing math as desired.
Thank you very much. Let me save it, thanks a lot. -
Looking at this I think I implemented it right. But how can I tell if the buff worked? Is there an icon or something?JavaScript:Mind Charge:
<JS Post-Start Action> if (action.isPhysical() && action.isAttack() && action.isHpEffect()) { $gameTemp.requestAnimation([user], 2); } </JS Post-Start Action> <JS Pre-Damage As User> if (this.isPhysical() && this.isAttack() && this.isHpEffect() && value > 0) { value *= 2; value = Math.ceil(value); user.removeState(state.id); } </JS Pre-Damage As User>
JavaScript:<JS Post-Start Action> if (action.isMagical() && action.isHpEffect()) { $gameTemp.requestAnimation([user], 2); } </JS Post-Start Action> <JS Pre-Damage As User> if (this.isMagical() && this.isHpEffect() && value > 0) { value *= 2; value = Math.ceil(value); user.removeState(state.id); } </JS Pre-Damage As User> -
When asking for help, it's a good idea to be precise in your terminology - "buff" means a specific thing in RPG Maker that isn't related to what you're asking about.Looking at this I think I implemented it right. But how can I tell if the buff worked? Is there an icon or something?
Are you using the above code but also following the full instructions from Yanfly's original Tip & Trick video?
Power Charge & Mind Charge (MV Plugin Tips & Tricks) - Yanfly.moe Wiki
If so, the code is going into a state that you apply via a skill. If you give that state an icon, then that icon will show on the actor while they have it. -
The Runic (State) is only for a magic taunt, magic damage and MP. I am trying to create a version where it is a physical taunt, physical damage and TP. Have I got the code right? (Probably not, but I live in hope that one day...)
Code:<Physical Taunt> <JS Pre-Damage As Target> if (this.isPhysical() && this.isHpEffect() && value > 0) { value = 0; if (DataManager.isSkill(this.item())) { const tp = user.skillTpCost(this.item()); // Recover the TP. target.gainTp(tp); } target.startAnimation(58); } </JS Pre-Damage as Target>
Thank you -
Does the Tricks & Tips Meajai's Soulstealer work without a Battle Statistics Plugin from VISUSTELLA? Assuming there isn't one, if there is then I missed it somewhere.
I tried using it with the sample core plugins, and it doesn't seem to work at all. I know the original version for MV required the Battle Statistics plugin from Yanfly.
Mainly for the user._killCount. -
Please go back and read the first post in this thread, where you found Mejai's Soulstealer. Your question is addressed at the top :wink:Does the Tricks & Tips Meajai's Soulstealer work without a Battle Statistics Plugin from VISUSTELLA?
-
So, I've had a small try and it appears that one Tip which can now be created is Holy Prism - the new selection control works of battle core just fine and the script can work right as it is? What is a tad problematic is the damage formula (for me).
The ones that require definitely more work are Jump (not attempted) and Void shift - as the scripting language seems a bit different in MZ? -
In what way? You can take the damage formula from Yanfly's Tip, delete the comment lines, and delete the line breaks so it's all on one line and goes into the damage formula. For that matter, you can even delete the braces, they're superfluous.So, I've had a small try and it appears that one Tip which can now be created is Holy Prism...What is a tad problematic is the damage formula (for me).
MV and MZ both use JavaScript. I see Trihan described Jump as a hack but I don't know which part of it actually is wonky at all.The ones that require definitely more work are Jump (not attempted) and Void shift - as the scripting language seems a bit different in MZ?
For Void Shift, I see listed in the Battle Core instructions a notetag <Cannot Target User> that you can add. What else doesn't Trihan's version do? -
oh, ok then, then even the damage formula is fine, so it can officially be added to the list.In what way? You can take the damage formula from Yanfly's Tip, delete the comment lines, and delete the line breaks so it's all on one line and goes into the damage formula. For that matter, you can even delete the braces, they're superfluous.
MV and MZ both use JavaScript. I see Trihan described Jump as a hack but I don't know which part of it actually is wonky at all.I thought those two weren't even attempted?For Void Shift, I see listed in the Battle Core instructions a notetag <Cannot Target User> that you can add. What else doesn't Trihan's version do? -
I'd like to change kyrie eleison in a way that the amount kyrieHp it has scales up with the number of enemies that has a specific state. Something like: user.def * 0.04 * enemies with state.
Is that possible? And if so how? -
user.def * 0.04 * $gameTroop.members().filter(member => member.isStateAffected(stateId)).lengthI'd like to change kyrie eleison in a way that the amount kyrieHp it has scales up with the number of enemies that has a specific state. Something like: user.def * 0.04 * enemies with state.
Is that possible? And if so how? -
Working! Thank you!user.def * 0.04 * $gameTroop.members().filter(member => member.isStateAffected(stateId)).length
-
So, this is a variation of the Tsunami script that is meant to interrupt when the enemy gets hit by a disabling state like stun or berserk
JavaScript:<JS On Add State> user.clearActions(); let text = '<CENTER>' + user.name() + ' will unleash \\c[4]Tsunami\\c[0] in 3 turns.'; SceneManager._scene._logWindow._lines.push(text); text = '<CENTER>Inflict a state that imposes a restriction on ' + user.name() + ' to cancel it!'; SceneManager._scene._logWindow._lines.push(text); SceneManager._scene._logWindow.refresh(); </JS On Add State> <JS On Erase State> if (user === origin) { const skill = 267; const target = -2; user.forceAction(skill, target); } </JS On Erase State> <JS Post-Damage As Target> let hasRestrictiveState = this.states().some(state => state.restriction !== 'None'); if (hasRestrictiveState) { this.removeState(state.id); const text = '<CENTER>' + this.name() + "'s \\c[4]Tsunami\\c[0] is interrupted!"; SceneManager._scene._logWindow._lines.push(text); } </JS Post-Damage As Target>
But I'm not sure, I think it is redundant? and oops, did I even use the right notetag? -
I can't currently think of a better implementation for it.So, this is a variation of the Tsunami script that is meant to interrupt when the enemy gets hit by a disabling state like stun or berserk
JavaScript:<JS On Add State> user.clearActions(); let text = '<CENTER>' + user.name() + ' will unleash \\c[4]Tsunami\\c[0] in 3 turns.'; SceneManager._scene._logWindow._lines.push(text); text = '<CENTER>Inflict a state that imposes a restriction on ' + user.name() + ' to cancel it!'; SceneManager._scene._logWindow._lines.push(text); SceneManager._scene._logWindow.refresh(); </JS On Add State> <JS On Erase State> if (user === origin) { const skill = 267; const target = -2; user.forceAction(skill, target); } </JS On Erase State> <JS Post-Damage As Target> let hasRestrictiveState = this.states().some(state => state.restriction !== 'None'); if (hasRestrictiveState) { this.removeState(state.id); const text = '<CENTER>' + this.name() + "'s \\c[4]Tsunami\\c[0] is interrupted!"; SceneManager._scene._logWindow._lines.push(text); } </JS Post-Damage As Target>
But I'm not sure, I think it is redundant? and oops, did I even use the right notetag? -
Maybe <JS Post-Apply> would work better to ensure it is not tied to damage?I can't currently think of a better implementation for it.
-
Probably.Maybe <JS Post-Apply> would work better to ensure it is not tied to damage?