How to make a 50/50 ability.

Budderhydra

Villager
In the game that I am trying to make, I am attempting to make it so that one of the characters has a starting move called "exuberant strike", which has a fifty percent chance to do two times the amount of damage that a regular strike would, but also has a fifty percent chance to stun the user.

I think it would be an interesting ability, but I have no idea how to make this in RMMV. If any of you have an idea on how to do this, I would be extremely grateful if you informed me.

Kes

Veteran
'Game Mechanics Design' is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions go in the Support forum for the engine you are using.
[move]RPGMaker MV[/move]

Budderhydra

Villager
'Game Mechanics Design' is for looking at aspects of game play at a more conceptual level. "How do I...?" (implementation) questions go in the Support forum for the engine you are using.
[move]RPGMaker MV[/move]

Thank you. Im new here, and I had no idea where to place this question. Again, thanks.

Kevin Hirst

Veteran
I’m not sure. You would have to create a state that has the stun and then the formula would look something like

If (Math.random() > 0.5) {formula} else {b.addState(stateId); formula*2}

Budderhydra

Villager
Alright, got it. Thanks
Now, do I just leave it as Math.random, or do I put something in there, because I am assuming it is just Math.random

Kevin Hirst

Veteran
The only things you need to change here are the parts in bold

If (Math.random() > 0.5) {formula} else {b.addState(stateId); formula*2}

You can change the 0.5 to be any percentage you want. 0.5 being 50%. Note that the higher the percentage the less chance of double damage and stun. [Ex. 0.1, 10%, means that 10% of the time you will deal normal damage, and 90% of the time you will stun and do double damage].

The 2 at the end can be changed to whatever multiplier you want to use. 2 being double. 3 would be triple. 1.5 can be used. Any multiplier you like.

Budderhydra

Villager
Got it, thank you.
You are a saint.

xem

Warper
Not sure if anyone's going to reply to this, but how would I set this up in the database? I haven't had any luck so far.

Wavelength

MSD Strong
@xem I approved your post and I'll leave this topic open since you seem a bit unsure of how to use the answers given to set up your database; however, we do frown on bumping support threads (help questions or "how do I"-type questions) that have been inactive for over a month (and this has been inactive for 3 years!). In the future, please just create a new topic (and link back to this old one if you need to reference it) - that helps avoid a lot of forum confusion. Thanks!

Latest Profile Posts

A side story is almost getting into the next stage. Almost everything in this game has real-life references.

Everyday life is full of absurdity. This is just a reflection.
TFW you discover how the script batching works in VNMaker... after you've had the program for almost 3 years.

Writes that the characters have to climb a mountain.

Realized that I have to draw six sets of models where characters are climbing.

At least I know how to draw something.
I'm currently scratching my head on how to design plains. What do I even put in plains? Some trees (but not too many or it turns into a forest)? Grass? A few bushes? That's a bit dull.
I'm looking for tutorials but Google didn't seem to find much (or maybe I have the wrong keywords). I don't know how to map plains and I don't know how to learn.