Want to create a damage and armour mechanic similar to warcraft III.

For the game, I’m working on I wanted to implement a damage and armour mechanic like the one in warcraft III.

For example, it had different damage types like Normal, Piercing, Magic, Siege. they would do different amounts of damage depending on the enemies armour type, so if the enemy had the light armour type they would take 150% damage from normal attacks but only 50% damage from siege attacks.
They also had it that armour the stat would give a % damage reduction based on its number so if you had 3 armour it would reduce total damage by 15.25%

I’m rather new to coding so am not sure how to start this really, but its something I’d really like to add.

Thank you for any help.

What you’re asking is a hugely complicated lift. I would NOT recommend it for your first attempt.

Instead start small: make one object fire a projectile at another object, and when the project hits, deal damage and take away the other object’s life. You can even start from a Unity Asset Store asset for this, like the TANKS project.

When you have that going and you fully understand how it works, instead of saying “take this amount of damage,” make an object that contains all the information about the damage being dealt, such as what type it is. Now change your damage receiver to accept one of those objects and apply damage accordingly.

When you get that going, give the receiver a new type of damage mitigation description object that lets it describe how much it takes of each type of damage, and then connect it up to the “take damage” method you made above.

From that you will quickly get a grasp on what you’re trying to do, and it will come in nice easy-to-succeed engineering steps.

1 Like

Thank you so much for the help, I have been way to ambitious for my first project and have since learned that I need to learn to swim before I jump into the deep end. I’ve only been doing this for a few weeks as you could probably tell from my question. but I have been learning a lot, and I hope that one day soon I can come back with a better and more refined question or gain the knowledge to do it myself. again thank you for taking the time to reply.

wish you all the best

Just to check: are you saying you already have a working system that deals damage, and you want to extend that system so that the amount of damage changes depending on armor?