Hello I'm trying to make an Armor for my drone character. When it gets attacked it's supposed to convert the damage into mp (EP). I'm using this code below in the state. What's happening is that no matter who my party attacks the enemy gets 10 mp. When I do equip the Armor it works properly. But how to stop my characters giving the enemy mp.
<Custom Respond Effect>
target.gainMp(10)
</Custom Respond Effect>
Moved to: Plugin Support(Plugin Requests is for when you need a new plugin made to fulfill a certain need.)
This looks to me like a correct tag - I'm not 100% sure, but I think that target is indeed the correct way to call the battler who has the state whenever they are the target of a move.
I'm confused when you say that "When I do equip the Armor it works properly." What is it doing correctly, what is it doing incorrectly, and what behavior are you seeing that you believe you shouldn't see? Also, do you have any notetags on the Armor itself? (I assume the notetag you specified is on the State). My first instinct, if I understand you correctly, is that you might have a second, incorrect notetag on another entry (such as an enemy or an equip) in your database.
Respond effect plays when the afflicted battler takes an action. In your example, you're giving MP (via the gainMp function) to the target of the afflicted battler. You want the user to gain Mp, not the target.
user.gainMp(10)
edit:
You probably also want the mp gain to show up on the screen as well, so throw in a user.startDamagePopup() as well.
second edit:
I messed up respond effect, I never use that one. I'd personally go with a react effect instead. In either case, restoring mp to user rather than target is probably what should fix this for you.
So if the drone character has a state on them, they are the afflicted battler. That means respond and react effects are correct to use here. And technically, the 'target' in that case should also be the drone character, so they should be the one restoring Mp when they get hit.
That would imply that the state for the mp restoration isn't on the drone character at all, but on the enemy, and that's why the enemy is restoring mp whenever it gets hit.