Sorry for the vague title, but it really is kind of difficult to explain.
So this is what I'd like to happen: Let's say I have three cards, - kind of like in a deck building game - a light attack, a heavy attack, and a card that makes the enemy miss a turn.
We also have two enemies, with different properties. One has armor, the other doesn't. One is agile, the other isn't.
Is it possible to define the enemies and the cards as "Objects" or "Classes", give them properties, and then "let things play out", if say I chose an enemy, and then clicked a card to attack it?
I don't have a lot of experience with Classes, I've mostly achieved things by setting values and using '"If" statements. You could do almost anything with "If" statements, however, very quickly things can turn incredibly convoluted, and a lot problems arise, some might be just simply insurmountable using that - very primitive, I know - method.
So I guess my question is, is it doable? To make Classes (Or Objects, if that's a thing) interact, based on predetermined properties, and then yield the expected results.
Let me just close with an example:
I click/attack Enemy #2, who has the properties of being agile, and wears armor. Then I choose the card I'm attacking with, say a Light Attack. The Light Attack has the properties of 25% chance of extra piercing damage, but NOT against armored enemies, and if used against an enemy who has the "agile" property, there is a 25% chance of a miss. But if I used it against Enemy #1 instead, who doesn't have the "agile" property, it would hit, 100%.
Could this be done in some way? To have all these properties check against each other, and yield the correct/expected result?
I hope I've managed to explain what I'm looking for at least a little bit. If someone could confirm if it's doable, perhaps even give a little hint as to how, it'd be greatly appreciated. Feel free to go into details as much as you'd like!
Thank you for reading!