Tips & Tricks – Death Injuries (Dragon Age) – RPG Maker MV

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

In Dragon Age, upon dying, characters don’t simply become unable to act. They also acquire injuries that persist even after they’ve been revived. These injuries will stick around until treated. Here’s how you can create such an effect in RPG Maker MV!

Get the copy/paste code here: 

Be sure to place this into the noteboxes of your injuries:

<Category: Bypass Death Removal>

Place this code into your Death state’s notebox. Change the values in red to reflect your game.

<Custom Apply Effect>
// Create the pool of possible injuries.
var possibleInjuries = [];
// Add the injury state ID's into the pool.
possibleInjuries.push(89, 90, 91, 92);
possibleInjuries.push(93, 94, 95, 96);
possibleInjuries.push(97, 98, 99, 100);
possibleInjuries.push(101, 102, 103, 104);
// Loop through each of the possible pools and randomize the pool.
for (var i = 0; i < possibleInjuries.length; ++i) {
  var j = Math.floor(Math.random() * (i + 1));
  var temp = possibleInjuries[i];
  possibleInjuries[i] = possibleInjuries[j];
  possibleInjuries[j] = temp;
}
// This is the number of injuries received each time a battler dies.
var received = 2;
// Create a loop until the number received is 0.
while (received) {
  // Check if there are still injuries left in the pool.
  if (possibleInjuries.length > 0) {
    // If there are, get an injury in the randomized pool.
    var stateId = possibleInjuries.shift();
    // If the target is not affected by the injury...
    if (!target.isStateAffected(stateId)) {
      // Then add the injury to the target.
      target.addState(stateId);
      // Reduce the number of received injuries by 1.
      received -= 1;
    }
  // If there are no injuries left...
  } else {
    // Then break the loop.
    break;
  }
}
</Custom Apply Effect>

Happy treating!

Please wait while you are redirected...or Click Here if you do not want to wait.