var enemyAgi = $gameTroop.members()[id].agi
- takes agility of enemy in current troop wich you are fighting
var actorAgi = $gameParty.members()[id].agi
- takes agility of party member (0 is leader, >0 are rest of crew
Edit: I didn't catch "currently selected" that I don't know, but that what I gave you can use on targeted enemy. I had somewhere an entire function that allows to create a skill that reads all enemy stats. Gimme a minute...
Here it is:
JavaScript:
Game_System.prototype.eyeOfTruth = function(caster, target){
//setub basic variables wich we will use later
/* Current HP wich will be shown in format x / y" */
var currentHp = 0;
/* Current MP wich will be shown in format x / y" */
var currentMp = 0;
/* Current ATK value (states included) */
var currentAtk= 0;
/* Current DEF value (states included) */
var currentDef= 0;
/* Current Magic Attack value (states included) */
var currentMat= 0;
/* Current Magic Defence value (states included) */
var currentMdf= 0;
/* Current ATK value (states included) */
var currentAgi= 0;
/* Current ATK value (states included) */
var currentLuk= 0;
/* Enemy description if there is any (use notetag for enemy <enemy_desc:your desc>*/
var description = null;
/* ***** Start obtaining data ***** */
if (target.isEnemy() && target.isAlive()){
if (!target.isStateAffected(48)){
currentHp = target.hp + " / " + target.mhp;
currentMp = target.mp + " / " + target.mmp;
currentAtk = target.atk;
currentDef = target.def;
currentMat = target.mat;
currentMdf = target.mdf;
currentAgi = target.agi;
currentLuk = target.luk;
description = target.name() + ": " + $dataEnemies[target.enemyId()].meta['enemy_desc'] || "???";
/* ***** reading data completed ***** */
} else {
description = "???";
}
// ///// Render Data and display it ///// //
//target.customPopup("Mirror Force!", 0);
$gameMessage.add("<WordWrap>\\msgrows[5]\\c[6]" + description + "\\c[24]<br>" + TextManager.hp +": " + currentHp +
"<br>\\c[23]" + TextManager.mp + ": " + currentMp + "<br>\\c[0]" + TextManager.param(2) + ": " + currentAtk + " / " +
TextManager.param(4) + ": " + currentMat + "<br>" + TextManager.param(3) + ": " + currentDef + " / " +
TextManager.param(5) + ": " + currentMdf + "<br>" + TextManager.param(6) + ": " + currentAgi + " / " + TextManager.param(7) + ": " + currentLuk);
}
return 0;
}
Save this as JS file (any name), place it in plugins folder and add this to plugin manager.
In your skill in field "formula" add following code:
Code:
$gameSystem.eyeOfTruth(a,b)
Basicly this will just display info about targeted enemy, but if you wish to change it, feel free.
Also I will help you if you need to adjust this code to your needs, because right now it's using lot of Yanfly's message plugins.