One of my characters is an engineer who has a skill called drone repair. It will only work on one of my actors who is a drone. How would I set this up?
Skill that only work on a specific ally
RPG Maker MV SupportI may have a solution. Try putting this in the skill's damage formula:
b.isStateAffected(x) ? 200 : 0;
It checks if the targeted unit has a specific state or not. So you want the drone to permanently have a specific state. Change the "x" in the formula to the state id.
So this formula heals by 200 HP if the targeted unit has the specific state, else 0 HP.
b.isStateAffected(x) ? 200 : 0;
It checks if the targeted unit has a specific state or not. So you want the drone to permanently have a specific state. Change the "x" in the formula to the state id.
So this formula heals by 200 HP if the targeted unit has the specific state, else 0 HP.
Without any plugins, I'd try it like this:
- Add a note tag to any "drone" actors. Something like <Drone> is fine.
- In your damage/healing formula: c = b.isActor() ? b.actor() : b.enemy(); c.meta.Drone ? YOUR_FORMULA_HERE : 0
Would it not be simpler to just use the actor id as the identifier in the skill? As there is only one character to which this applies, the note tag option (I do like it, btw, for other things) seems a bit too much, and it would save having to create a state just for this.
To illustrate what I mean, in Ace the syntax would be (using actor 3 as an example):
b.id==3? your damage formula : 0
I hesitate to give the Javascript equivalent, because I am much less familiar with it, but I hope that is enough to make clear what I am suggesting as an option.
EDIT
It occurs to me that if, in fact, the OP ends up with more than one drone actor, it still might be possible to just use the damage formula using the class id instead of the actor id. Just a thought.
To illustrate what I mean, in Ace the syntax would be (using actor 3 as an example):
b.id==3? your damage formula : 0
I hesitate to give the Javascript equivalent, because I am much less familiar with it, but I hope that is enough to make clear what I am suggesting as an option.
EDIT
It occurs to me that if, in fact, the OP ends up with more than one drone actor, it still might be possible to just use the damage formula using the class id instead of the actor id. Just a thought.
That only works if all drone actors are using the same class (or previously, just that one actor). The note tag approach I suggested will allow any number of actors with any number of different classes to all be treated as valid targets for this skill, although I'm pretty sure that goes beyond what the OP is trying to do. Figured I'd throw it out there anyway since its the most flexible approach.
Ok that works. Thanks.
Original thread: https://forums.rpgmakerweb.com/threads/skill-that-only-work-on-a-specific-ally.117679/