Forgive a noob a silly question, but is there an event solution for an attack that deals a little bit of blowback to the character using it? Or would I need a plugin for that?
I'm trying to create a "Black Powder" skillset, and one of the abilities I want to give my characters a double-damage shot (that now deals partial fire damage) that deals singes the character a bit. That way, I can introduce it a bit earlier without being too unbalancing. The dream would be to have the player take exactly one-quarter of what the enemy takes, but I have a feeling that would be delving into plugin/scripting territory. I'll settle for assigning a set amount of damage if it means being able to put off learning scripting a little while longer.
Thanks in advance to any help you are able to provide!
Not sure what you want but given my interpretations of what you want
Single skill doing recoil damage
Chuck this into the damage formula of the skill
a.gainHp(Math.floor(-0.25*(damage_formula))); damage_formula
eg. a.gainHp(Math.floor(-0.25*(a.luk - b.def + 300))); a.luk - b.def + 300
Explanation
a = user
b = enemy
Math.floor function prevents decimals (losing 35.3 hp instead of 35hp)
gain.Hp function causes the target (in this case a or user) to gain Hp
Negative in front of damage formula causes gainHp to become gain negative Hp (damage)
===========================
State that applies black powder effect to all applicable skills
Add a state that causes particular skills to cause recoil damage
So in database make a "black powder" state (lets call it state x) that does nothing but wears off at x number of turns
Then in each skill that utilises black power state, change the damage formula to:
if (a.isStateAffected(x)) { a.gainHp(Math.floor(-0.25*(2 * damage_formula))); 2 * damage_formula; } else { damage_formula; }
Explanation
a = user
b = enemy
isStateAffected(x) checks if the user has a state on them
If they do have it, apply recoil damage and double damage
If not then apply normal damage
Yeah, it would require a (fairly easy) plug-in to do exactly what you want, but you can have the user take a set amount of damage (or even damage based on stats and a formula) by using the Skill's Damage Formula.
The syntax in VX Ace would be a.hp -= ([a.mat * 2 - a.mdf, 0].max); a.mat * 4 - b.mdf * 2 where the part in orange is the amount of damage the user would take and the part in green is the normal damage formula that the target takes. However, there are slight differences with the syntax for Javascript, which MV uses, which is why in the future you should post "how-to" questions in the Help subforum for the Maker you're asking about instead of in Game Mechanics Design (don't worry, very common mistake).
"How do I ..." questions belong in the appropriate Support forum, not in Game Mechanics Design (which, funnily enough, is for discussion of game mechanic designs). I will move it now. Please post in the correct areas in future. Thank you.
I must have done something wrong down the line because I can't get those formulas to work.
HOWEVER (and I know I'm already using a suboptimal solution by avoiding scripts and this makes the work even cruder by failing to get everything in one nice package), I managed to make it work with a "Load Double Black Powder" skill that takes a turn to reflect my character spending extra time to stuff extra powder in his gun and triggers a "Black Powder Loaded" State that adds the skill Double Powder shot. I adjusted the damage to double there, made the damage physical AND fire, and attached a common event that triggers another skill, Singe, that uses deals me 1/4 of the same damage.
Clumsy but it got me there for now.
It's not like I'm making an actual game. I'm just testing ideas in my Playground before implementing them in my game idea. My Playground game file is literally just a bunch of random things I want to see if I can do. It's my "beginner RPGMV" game before stepping it up to something I'd share.