Dragon Quest Boomerang Formula Help

WheatTon

Villager
Member
Joined
Nov 14, 2017
Messages
14
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

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
839
Reaction score
467
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
399
Reaction score
221
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
14
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

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,574
Latest member
nikisknight
Top