Dragon Quest Boomerang Formula Help

WheatTon

Villager
Member
Joined
Nov 14, 2017
Messages
11
Reaction score
2
First Language
English
Primarily Uses
RMMV
I am attempting to make a damage formula that hits all enemies and does less the more enemies are alive. The problem has to lie with my formula as it does 0 damage no matter how low the enemies defense is.

The formula I am using is as follows:
((a.agi * 4 - b.def * 2) / 3)) - ((((a.agi * 4 - b.def * 2) / 3))) * ($gameTroop.aliveMembers().length - 1)) * 0.1)

The boomerang is one of the 7 main weapons in the game, and so I thank anyone who takes the time to look at this.
Have a nice day.
 

Soulrender

Veteran
Veteran
Joined
Jan 12, 2019
Messages
470
Reaction score
263
First Language
Poland
Primarily Uses
RMMV
Brackets!

Code:
((a.agi * 4 - b.def * 2) / 3) - (((a.agi * 4 - b.def * 2) / 3) * (($gameTroop.aliveMembers().length - 1) * 0.1))
 

Silva

Scoobityboo
Veteran
Joined
Nov 5, 2018
Messages
394
Reaction score
214
First Language
English
Primarily Uses
RMMV
I'll second what @Soulrender has said, it's very difficult to see what you're actually trying to do because adding or removing brackets could change your result in a way you haven't intended.

Code:
(a.agi * 4 - b.def * 2)/3 - (a.agi * 4-b.def * 2)/3 * ($gameTroop.aliveMembers().length-1) * 0.1
This achieves what you've described and doesn't require any double/triple/quadruple nest brackets - keep it simple. :)

As a side note, the below also does the same:

Code:
(a.agi * 4 - b.def * 2)/3 - (a.agi * 4-b.def * 2)/30 * ($gameTroop.aliveMembers().length-1)
 
Last edited:

WheatTon

Villager
Member
Joined
Nov 14, 2017
Messages
11
Reaction score
2
First Language
English
Primarily Uses
RMMV
Thanks guys! I guess I got too into my head and couldn't see the simple solution. These work great.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Remember, you can enter up to THREE effects for a chance to win a copy of MZ! Only 11 submissions so far, the chances of winning is high! :D https://itch.io/jam/elfkisser
wake me up when Photoshop stop crashing everytime
Brioche with a crème patissiere filling is so tasty!
A group of Game creators and others who trying to revive the Feel of Multiplayer and TOWN/ROLEPLAY games

Forum statistics

Threads
99,387
Messages
964,702
Members
131,009
Latest member
gamerchix
Top