Sacrificial Bolt (MV Plugin Tips & Tricks)

From Yanfly.moe Wiki
Jump to navigation Jump to search

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.


From Dragon’s Dogma, the Sacrificial Bolt is a skill that kills off a random pawn to deal damage to a foe. If that were to be remade in RPG Maker MV, the skill effect would be to sacrifice a random ally to deal damage to a foe. The damage dealt and such would be based off of the sacrificed ally’s stats!

Required Plugins

The 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.

About

This 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 Plugins

This 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.

Instructions

Follow video instructions.

You can find the copy and paste version of the code here:

<Custom Requirement>
// Get the group that the user belongs to.
var group = user.friendsUnit();
// Get the alive members of the group.
var allies = group.aliveMembers();
// Check to see if there are more than 1 allied members (user + ally).
value = allies.length > 1;
</Custom Requirement>

<Custom Cost Display>
\i[1]Ally
</Custom Cost Display>

<Custom Execution>
// Get the group that the user belongs to.
var group = user.friendsUnit();
// Get the alive members of the group.
var allies = group.aliveMembers();
// Remove the user from the group.
allies.splice(allies.indexOf(user), 1);
// Pick a random ally.
var ally = allies[Math.floor(Math.random() * allies.length)];
// Store the ally's current HP value with the user.
user._allyHp = ally.hp;
// Store the ally's current MAT value with the user.
user._allyMat = ally.mat;
// Play animation 65 on the ally.
ally.startAnimation(65);
// Time to kill off the ally.
ally.gainHp(-1 * ally.hp);
// Perform the collapse effect on the ally.
ally.performCollapse();
</Custom Execution>

<Damage Formula>
// Damage Formula used for the skill.
value = user._allyHp + user._allyMat * 14;
// Remove stored ally HP value.
user._allyHp = undefined;
// Remove stored ally MAT value.
user._allyMat = undefined;
</Damage Formula>

Enjoy!