In my game's battle system there are skills that will damage your opponent's HP but also damage yours. I'm not sure how to do this though. Anyone know how?
Announcement
Collapse
No announcement yet.
Skills that decrease HP too?
Collapse
X
-
Re: Skills that decrease HP too?
If you mean skills that cost HP to use, the quick and dirty way is to put a line of code in the damage formula bar for the skill. For example:
Upon use, this would subtract 5 HP from "a" (the user), and then return 100 as the damage value to deal to the target.Code:a.hp -= 5 ; 100
But if you want more control, like displaying the HP cost to use the skill, or preventing a player from using the skill if they don't have enough HP, etc., these must be programmed separately. But there's a Yanfly script that can do it for you: https://yanflychannel.wordpress.com/...-cost-manager/
Comment
-
Re: Skills that decrease HP too?
Pretty much everything Ryu just said. Yanfly's Skill Cost Manager is very popular and very good too (though it can be dicey if you're using lots of other scripts too).
Only one thing to add - you can also use formulas to decide how much HP to take away from the user, such as a.hp -= (a.atk * 2 - a.def) but just keep in mind that no matter how you do it things like Variance or Elemental Weakness won't be taken into account since you're directly reducing the user's HP. This shouldn't matter too much to your player, though.
How Badly Do You Want It? (VX Ace) is now available for download! - no outside software necessary.
"I live and love in God's peculiar light." - Michelangelo
Comment
-
Re: Skills that decrease HP too?
If you would like to have variable damage though, you could create another ability called Recoil or some such that damages the user by whatever formula you want. Then for the original skill have it run a common event that forces the character to use Recoil on itself.Originally posted by Wavelength View Post
just keep in mind that no matter how you do it things like Variance or Elemental Weakness won't be taken into account since you're directly reducing the user's HP. This shouldn't matter too much to your player, though.Ryner's Games
Simple Man's Quest for the Playground* - Winner: Pavilionite Biography Contest - Click Here!
Monster Must Die - Winner: Halloween Horror Contest - Click Here!
All you need to play is a computer, no outside program necessary!
Comment
-
Re: Skills that decrease HP too?
Good idea, Ryner!
How Badly Do You Want It? (VX Ace) is now available for download! - no outside software necessary.
"I live and love in God's peculiar light." - Michelangelo
Comment


Comment