Libra (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.


Want to make an ability to scan your enemy and reveal its HP? Now you can! This tips & tricks utilizes two plugins:

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.

For those who would like the copy and paste version~

<Before Eval>
if (target.isEnemy()) {
  var id = target._enemyId;
  $gameSystem.addHpGaugeEnemy(id);
}
</Before Eval>

This part requires Message Core to look nice. And for those who want a more expansive Libra that reveals the enemy’s stats and elemental weaknesses, resistances etc. Keep in mind, this is for those with larger screen resolutions to be able to show everything:

<Before Eval>
if (target.isEnemy()) {
  var id = target._enemyId;
  $gameSystem.addHpGaugeEnemy(id);

  var text = target.name() + '\n';
  text += '\\px[100]\\c[4]HP:\\c[0] ' + target.hp;
  text += '/' + target.mhp;
  text += '\\px[400]\\c[4]MP:\\c[0] ' + target.mp;
  text += '/' + target.mmp;
  text += '\\px[700]\\c[4]TP:\\c[0] ' + target.tp;
  text += '\n';
  text += '\\px[100]\\c[4]ATK:\\c[0] ' + target.atk;
  text += '\\px[400]\\c[4]MAT:\\c[0] ' + target.mat;
  text += '\\px[700]\\c[4]AGI:\\c[0] ' + target.agi;
  text += '\n';
  text += '\\px[100]\\c[4]DEF:\\c[0] ' + target.def;
  text += '\\px[400]\\c[4]MDF:\\c[0] ' + target.mdf;
  text += '\\px[700]\\c[4]LUK:\\c[0] ' + target.luk;
  $gameMessage.add(text);
 
  var weakness = '';
  var resist = '';
  var immune = '';
  var absorb = '';
  var elements = $dataSystem.elements;
  for (var i = 1; i < elements.length; ++i) {
    var name = elements[i];
    var rate = target.elementRate(i);
    if (rate > 1) {
      weakness += name + ' ';
    } else if (rate < 0) {
      absorb += name + ' ';
    } else if (rate === 0) {
      immune += name + ' ';
    } else if (rate < 1) {
      resist += name + ' ';
    }
  }
  if (weakness === '') weakness = 'None';
  if (resist === '') resist = 'None';
  if (immune === '') immune = 'None';
  if (absorb === '') absorb = 'None';
  weakness = '\\c[4]Weakness:\\c[0] ' + weakness + '\n';
  resist = '\\c[4]Resist:\\c[0] ' + resist + '\n';
  immune = '\\c[4]Immune:\\c[0] ' + immune + '\n';
  absorb = '\\c[4]Absorb:\\c[0] ' + absorb;
  text = weakness + resist + immune + absorb;
  $gameMessage.add(text);
}
</Before Eval>

Here's how it would look like: