- Joined
- Jul 10, 2007
- Messages
- 6,306
I've been working on my combat suite of late.
Currently, I have it set up like this-
So what I'm wondering is how I would apply effects (modifications to damages, damage groups, and etc) to the above. I've been thinking about it a lot. I can't just change the values... effects are temporary modifications that may be caused by aura, buffs, and etc...
What I'm thinking is that perhaps I can just apply an effect to an attack and let the effect deal with it ; P.
Also, you guys think my above architecture is ok so far? I think it's quite open, quite modular, and pretty darn optimal and powerful ^_^.
So far everything above is pretty much coded except for effects.
Currently, I have it set up like this-
DamageType: damage types like fire so unit's can have resistances/absorptions for them
Damage: A simple struct with a damage type and a value.
DamageGroup: A group of damages with an apply damage method that takes a widget and applies all damages in group to it.
AttackType: Attack types do targeting. They take a target widget or location and run an algorithm, applying the damage group to all viable targets. Attack types may be timed as well. Stores a boolexpr.
Attack: A table that associates an attack type with a group of damage groups via attack[damageGroup].attackType = newAttackType. Primarily stores and runs a trigger with a set of triggerconditions. Using a timer to remove triggerconditions so as not to abruptly stop the trigger if it is running.
AttackTarget: A special attack target struct that boxes up targets and provides locking mechanisms so that a target is not destroyed until nothing is using it. Automatically removes locations upon destruction if it is boxing a location. Returns generic x,y,z, coordinates, widget, destructable, item, unit, or location. Can only be destroyed via unlocking (no actual destroy method).
So what I'm wondering is how I would apply effects (modifications to damages, damage groups, and etc) to the above. I've been thinking about it a lot. I can't just change the values... effects are temporary modifications that may be caused by aura, buffs, and etc...
What I'm thinking is that perhaps I can just apply an effect to an attack and let the effect deal with it ; P.
Also, you guys think my above architecture is ok so far? I think it's quite open, quite modular, and pretty darn optimal and powerful ^_^.
So far everything above is pretty much coded except for effects.