(Yanfly Skill Core) Removing HP cost of skills ONLY for enemies?

thecursedcometh

Veteran
Veteran
Joined
Dec 4, 2018
Messages
35
Reaction score
17
First Language
English
Primarily Uses
RMMV
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?
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,695
Reaction score
1,113
First Language
Portuguese - Br
Primarily Uses
RMMZ
I think it would help if you send a screenshot of your skill in the database and also his note tags.
 

thecursedcometh

Veteran
Veteran
Joined
Dec 4, 2018
Messages
35
Reaction score
17
First Language
English
Primarily Uses
RMMV
An example:
database1.pngdatabase2.png

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?
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,695
Reaction score
1,113
First Language
Portuguese - Br
Primarily Uses
RMMZ
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.
 

thecursedcometh

Veteran
Veteran
Joined
Dec 4, 2018
Messages
35
Reaction score
17
First Language
English
Primarily Uses
RMMV
@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!
 

Doktor_Q

I'm not a real doktor, but I am a real Q
Veteran
Joined
Aug 1, 2016
Messages
873
Reaction score
562
First Language
English
Primarily Uses
RMMV
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
Code:
<Custom HP Cost>
  if (user.isEnemy()) cost = 0;
  else cost = whateverTheCostShouldBe;
</Custom HP Cost>
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,523
Reaction score
1,415
First Language
English
Primarily Uses
RMMV
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.
 

thecursedcometh

Veteran
Veteran
Joined
Dec 4, 2018
Messages
35
Reaction score
17
First Language
English
Primarily Uses
RMMV
@Doktor_Q I'll use this for some skills, but unfortunately it doesn't look like there's a way to set a percentage of max HP as the cost. But thanks anyway!

@Aesica Thanks for the tip. I have to do this for some skills, however, because there is a blue mage in my game.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,523
Reaction score
1,415
First Language
English
Primarily Uses
RMMV
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.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA

I've moved this thread to Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top