The closest analogue to what I’m trying to do is create a rock, paper, scissors damage system a la Pokemon. Fire is weak to water, etc.
I have each TurnBasedCharacter sending it’s current “SelfDamageType” through the ApplyDamage function. On the Event AnyDamage I compare the SENDERs and the RECEIVERs DamageTypes.
I wanna keep this on my TurnBaseCharacter parent that way all the children inherit this functionality. At this point I’m thinking it might be easier to create “type” children and override the damage logic within them…
First I’m going to assume the thing you want to know if your SelfDamageType is weak against the incoming damage type
One way to do something like this is:
Create a new DataAssetType by creating a new Blueprint that inherets from PrimaryDataAsset, lets call it DamageSettings
In DamageSettings you add a new Variable of type DamageType->ClassReference Map with value also DamageType->ClassReference
The map will hold information about which type is weak against which other type
Add a function in DamageSettings which takes two parameters as input of type DamageType->ClassReference IncomingDamage and SelfDamage, use the SelfDamage to get the damage it’s weak against out of the map and return a bool of the result of comparing the damage that it’s weak against with the incoming damage