Hello!
I'm working on a "Tame" skill, which would allows you to befriend a monster.
I wanted to show to the player what was the chance for that to happen when you scrolled on the enemies, something like "MonsterName (43% chance)". So i used Yanfly's TargetCore plugin to show that info:
But i soon found out, sadly, that the "target" variable here has the same function as "user", giving me info on the actor using that skill instead of who's targeting. Is there a way i could reference the enemy the player is selecting at the moment instead?
I'm working on a "Tame" skill, which would allows you to befriend a monster.
I wanted to show to the player what was the chance for that to happen when you scrolled on the enemies, something like "MonsterName (43% chance)". So i used Yanfly's TargetCore plugin to show that info:
Code:
<Custom Target Text>
text = target._name + ' (';
if($dataEnemies[target.enemyId()].meta.monsterSkill)
{
if(!user.hasSkill(parseInt($dataEnemies[target.enemyId()].meta.monsterSkill)))
{
var actorSkill = Math.floor((user.level+2) / 3) + Math.floor((user.luk - 10) / 2);
var monsterChance = parseInt($dataEnemies[target.enemyId()].meta.captureChance) + (parseInt($dataEnemies[target.enemyId()].meta.captureChance) * ((target.mhp - target.hp) / target.mhp));
var chance = String(actorSkill+monsterChance) + '%';
text+=chance;
}
else
{
text+='DOUBLE';
}
}
else
{
text+='NOT BEFRIENDABLE';
}
text+= ')';
</Custom Target Text>
But i soon found out, sadly, that the "target" variable here has the same function as "user", giving me info on the actor using that skill instead of who's targeting. Is there a way i could reference the enemy the player is selecting at the moment instead?