Damage formula help

Status
Not open for further replies.

Sword_of_Dusk

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
247
Reaction score
290
First Language
English
Primarily Uses
RMMV
I'm trying to get a boomerang weapon working, which hits all foes, but I don't know how to go about making the attack do less damage to each subsequent enemy struck after the first one. Need some assistance on this.

EDIT: Should probably note what my damage formula is, eh?

a.atk *3/2 - (b.agi/2 + b.def *2)
 
Last edited:

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,477
Reaction score
1,369
First Language
English
Primarily Uses
RMMV
If you have Yanfly's action sequence packs, you can do something like this:

<Whole Action>
eval: user._boomerangModifier = 1;
perform action
</Whole Action>
<Target Action>
action animation: target
wait: 15
action effect: target
eval: user._boomerangModifier *= 0.9;
</Target Action>
<Follow Action>
wait for animation
eval: delete user._boomerangModifier;
death break
perform finish
</Follow Action>

Then, modify your damage formula as follows:

(a.atk *3/2 - (b.agi/2 + b.def *2)) * (a._boomerangModifier || 1)

Now, when used, it'll hit the first enemy for full damage, then that damage will decrease by 10% with each additional foe struck. If you want the decrease to be more drastic, change the 0.9 to something else, like 0.8 for 20%, 0.7 for 30%, etc.
 

Sword_of_Dusk

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
247
Reaction score
290
First Language
English
Primarily Uses
RMMV
@Aesica You are absolutely brilliant! Works like a charm. Thanks a bunch.
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,486
Reaction score
5,314
First Language
english
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Say, does anyone know any other indie game development forums? Progress on my uni survey has been a little slow, so I wanna look into posting it around a bit more.
Due to the bullies' resurgence on Facebook and Twitter against my friend (and I since I defend), we've decided to move over to tumblr to try to obscure our presence, where we might finally be at peace working on games. If anyone wants my/our game's tumblrs to follow lmk. :kaojoy:
Is there anyone need help with anything except art and music?
is Gotcha Gotcha Games Inc. = KADOKAWA CORPORATION? I haven't found this topic yet, Want to know for credits on my game. Thanks.

Forum statistics

Threads
104,300
Messages
1,005,394
Members
135,825
Latest member
uniteditcare
Top