I am making a game with a ton of different abilities that do varying amounts of damage, what would be a good method to handle damage and taking damage without much clutter? More details can be provided if needed, thank you in advance.
Really depends, what makes up your systems? Is damaged reduced by some stats like defense/wisdom or multiplied by strength/intelligence?
What patterns are you using, do you have health components? State machines?
What problems are you running into? Is it hard to balance the game, or enter data?
there’s damage reduction and damage multipliers. Im just trying to find out how I would implement a health and damage system into a game like this. As of now there is no system in place. The game is very early into development
Use a area 2d. Player layer 1 for example, make the mask of the area 2d on mask 2.
Enemy is layer2. Connect signal body enter in a area 2D script…
Also add the enemy and player to the proper groups…
var damage: = 10
If body.is_in_group(“enemy”)
if body.has_method(“Take_damage”)
body.Take_damage(damage)
This is generally how I would tackle this…
However with multiple damage I would send the damage what you doing to the player or enemy as cur_give_damage, then pass it to your area2D as a injection. good luck