Greetings!
This is my first post here, so quick introduction… I have been learning C# and Unity for the past little while, and I think I’ve got at least a decent grasp on things. That said, I am also not a programmer, in my day to day game dev I am an artist, so, please be gentle
On to my question… So, I was wondering if anyone could help me figure out a clean way to “bind” for lack of better term, a damage type to a resistance or armor type without having to do 100 different If() checks or switch statements with passed through arguments. With the amount of knowledge I have, I feel like there has to be a better way to do what I want, but I still lack enough knowledge to actually know what that would be, or of course I could just be entirely wrong lol.
The scenario: you attack an enemy (or an enemy attacks you), based on the damage type of the attack, I want to put that attack against a matching armor or resistance type and have the damage resolve. Currently I have two enums, one for DamageType, the other for ResistanceType, and I am just passing the damage type through as an argument for the Attack(). Which means I basically have to do a switch or if() check on the DamageType to put that against the ResistanceType, to reduce the damage done by the ResistanceType Value (which I already have as a variable), and as I said, doing it that way doesn’t feel like the “right” way to me.
Apologies for the long post, and thanks in advance for the help, I could really use some