void_of_the_mind

Villager
Member
Joined
Jun 9, 2018
Messages
26
Reaction score
6
First Language
English
Primarily Uses
RMMV
So, this is in regards to the situations where a surprise attack occurs.
I wanted to give one of my party members a skill that deals more damage if your party is ambushed.
Similarily, I wanted to give a few enemies the power to counter preemptive strikes that your party can get as well by having a skill that increases in strength if you get the edge. I tried finding a proper script for it and fiddled with some things but I honestly am stumped. In my game I use a lot of Yanfly plugins, if that helps.

Any suggestions on the matter would be a big help, thanks!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,718
Reaction score
6,537
First Language
English
Primarily Uses
RMMV
You should be able to reference BattleManager._surprise and BattleManager._preemptive to determine if the battle was either of those.

They're both set to false at the end of the turn, so you'll have to use a Turn 0 troop event that checks them and sets a game switch accordingly (or something like that).

Then you can simply reference those switches in your damage formulae.
 

void_of_the_mind

Villager
Member
Joined
Jun 9, 2018
Messages
26
Reaction score
6
First Language
English
Primarily Uses
RMMV
You should be able to reference BattleManager._surprise and BattleManager._preemptive to determine if the battle was either of those.

They're both set to false at the end of the turn, so you'll have to use a Turn 0 troop event that checks them and sets a game switch accordingly (or something like that).

Then you can simply reference those switches in your damage formulae.
Interesting, I'll test that out then, thank you!
 

Latest Threads

Latest Profile Posts

TSR
One last screen shot for the weekend. An interior map for a change...
May you all have a nice week.Capture d’écran, le 2023-05-26 à 09.19.06.png
I've been working furiously on a small demo slice. But with King Slime so busy assets have been slow to form. No matter! I've got the demo for rpgmaker MZ and I'm using the 20 days to make a short and sweet demo game of fighting alongside your rival/boyfriend hehe Kind of like a mini challenge to myself
Yes my images are back ^^, hopefully they won't disappear again.:kaoangry:
It's Sunday. Stop working and take a break. Relax a little.

Forum statistics

Threads
131,488
Messages
1,220,241
Members
173,225
Latest member
ZecaVn
Top