In my game, many skills cost a percentage of HP rather than MP. However, this has created an issue where bosses will drain their own health very quickly with only a couple skills. Right now, my solution has been to make a duplicate of every skill, one that costs HP (for the player), and one that doesn't (enemy). However, I feel that there may be an easier solution (maybe a script change or tag?). Could anyone help me on this?
(Yanfly Skill Core) Removing HP cost of skills ONLY for enemies?
Javascript/Plugin SupportI think it would help if you send a screenshot of your skill in the database and also his note tags.
An example:
To clarify, what I mean is: is there a way to eliminate the HP cost of the Trisect skill for enemies only without having to make a duplicate?
To clarify, what I mean is: is there a way to eliminate the HP cost of the Trisect skill for enemies only without having to make a duplicate?
Hi!
I'm not really experienced in using yanfly plugins. But I believe you have to use the custom code note tag:
<Custom HP Cost>
code here
</Custom HP Cost>
Then inside the code, you can use something to identify the user and target.
Like, if(this.subsject() === actor){
// do the hp cost
}
So this way, it will only cost the hp if the user is an actor.
But I don't really know what is the code to find that. I don't know if it is 'user' or 'this.subject()' etc...
Guess you have to find that out or wait for someone that really knows for sure about that.
I'm not really experienced in using yanfly plugins. But I believe you have to use the custom code note tag:
<Custom HP Cost>
code here
</Custom HP Cost>
Then inside the code, you can use something to identify the user and target.
Like, if(this.subsject() === actor){
// do the hp cost
}
So this way, it will only cost the hp if the user is an actor.
But I don't really know what is the code to find that. I don't know if it is 'user' or 'this.subject()' etc...
Guess you have to find that out or wait for someone that really knows for sure about that.
@Eliaquim Thanks! I'll play around with that, see what I can do. And yes, if anyone else knows, it'd be a great help!
I looked through the documentation, and @Eliaquim has the right idea. There's no built-in way to modify the HP cost of a skill per-character, like there is with mp cost rate.
Your best bet is probably something like
Your best bet is probably something like
Code:
<Custom HP Cost>
if (user.isEnemy()) cost = 0;
else cost = whateverTheCostShouldBe;
</Custom HP Cost>
Just gonna offer a good design tip in general: Don't have your enemy skills be the same as your actor skills, even if if you want both enemies and actors to be able to cast, say "Firaga" or "Meteor." This way, you can tweak one for actors, and another (with different costs, perhaps no cooldown, etc) for enemies. Should the need arise, it also lets you buff an actor skill without also unintentionally buffing it for the enemies as well.
Depending on how you have blue magic implemented, there's nothing that says the skill used by the enemy has to be the same skill learned by the player. One of my blue magic skills in particular, Counterspell, is learned by eating the counterattack.
Moved to: Plugin Support
Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skill-core-removing-hp-cost-of-skills-only-for-enemies.124252/