Yanfly Engine Plugins is a plugin library made for RPG Maker MV, a wonderful piece of software to help you make that role playing game of your dreams. You can find out more about RPG Maker MV here.
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!
You can grab the copy/paste code here: Insert the following Lunatic Mode code into your Subjugate skill’s notebox. Change the values in red to reflect your game’s settings.
<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>
Insert the following Lunatic Mode code into your Subjugate Drain state’s notebox. Change the values in red to reflect the settings of your game.
<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!
Please wait while you are redirected...or Click Here if you do not want to wait.