Subjugate (MV Plugin Tips & Tricks)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.
The Subjugate ability is used by Trundle in League of Legends. It drains a percentage of the target’s HP as well as drains DEF/MDF from the target and for the next few seconds, continues draining HP. We’ll be modifying this effect to fit the turn-based structure for RPG Maker MV! Here’s how we’ll go about it! Required PluginsThe following plugin(s) is required to create this Tips & Tricks effect: For help on how to install plugins, click here. For help on how to update plugins, click here. AboutThis is a Tips & Tricks effect created for RPG Maker MV. Tips & Tricks are not to be confused with plugins. Instead, they are usually customized code created for the sake of producing unique features/effects that do not require an entire plugin to do. Yanfly Engine PluginsThis Tips & Tricks effect is made possible due to the Yanfly Engine Plugins library. Click here if you want to help support Team Yanfly on Patreon. Warning for RPG Maker MZ UsersIf you are using RPG Maker MZ and VisuStella MZ, the following code may or MAY NOT work as this Tips & Tricks is made for RPG Maker MV. VisuStella MZ is NOT responsible if this Tips & Trick does not work because the code base for RPG Maker MV and RPG Maker MZ are different and the code base between Yanfly Engine Plugins and VisuStella MZ is even more drastically different. InstructionsFollow video instructions. You can grab the copy/paste code here:
<Pre-Damage Eval> // Set the damage to cap at 9999 value = Math.min(value, 9999); </Pre-Damage Eval> <Post-Damage Eval> // Set the turn duration for buffs var turns = 4; // Add DEF buff to user user.addBuff(3, turns); // Add MDF buff to user user.addBuff(5, turns); // Check if the target was dealt HP damage if (target.result().hpDamage > 0) { // Make the user gain the damage dealt user.gainHp(target.result().hpDamage); // Start a damage popup on the user. user.startDamagePopup(); // Clear the results user.clearResult(); } // Check if the target's HP is above 0 if (target.hp > 0) { // Get the Subjugate Drain state's ID var drainStateId = 251; // Debuff the target's DEF target.addDebuff(3, turns); // Debuff the target's MDF target.addDebuff(5, turns); // Add the drain state to the target target.addState(drainStateId); // Default the target's subjugate damage to 0. target._subjugateDmg = target._subjugateDmg || 0; // Set the damage to be dealt across subjugate's duration target._subjugateDmg += target.result().hpDamage; } </Post-Damage Eval>
<Custom Regenerate Effect> // Default the subjugate damage to 0. user._subjugateDmg = user._subjugateDmg || 0; // Check if the user is alive and the subjugate damage is above 0. if (user.isAlive() && user._subjugateDmg > 0) { // Get the current turn count for this state. var turns = Math.max(1, user.stateTurns(stateId)); // Calculate the damage to be dealt. var dmg = Math.ceil(user._subjugateDmg / turns); // Reduce the stored subjugate damage. user._subjugateDmg -= dmg; // Make the user take the damage. user.gainHp(-dmg); // Play an animation user.startAnimation(4); // Show the damage popup user.startDamagePopup(); // Check if the user is dead if (user.isDead()) { // Then collapse the user user.performCollapse(); } // Clear the user's results user.clearResult(); // Check if the origin isn't the user and the origin is alive if (origin !== user && origin.isAlive()) { // Make the origin gain the HP from subjugate origin.gainHp(dmg); // Start an animation on the origin origin.startAnimation(46); // Show a damage popup origin.startDamagePopup(); // Clear the results origin.clearResult(); } } </Custom Regenerate Effect> <Custom Remove Effect> // Reset the subjugate damage user._subjugateDmg = 0; </Custom Remove Effect> Enjoy! |