Welcome.
In this section.
We're concerned with making combat even more exciting as we're going to want more features while we're
implementing more complex gameplay abilities.
Now the features I'm talking about are things like debuffs and other effects that happen as a result
of different types of damage.
If I launch a fireball at one of these enemies, I'd like there to be a burn chance.
And based on that burn chance, I'd like to determine if there's a successful burn.
And I'm going to consider burn to be a debuff, which will last for a duration.
And during that duration, things will be happening to the victim, such as taking fire damage every
so often and so on.
Now we have another gameplay ability that so far is just empty and if I level up I can upgrade.
This ability.
We called it electrocute, and I can spend a point on it so that it's now unlocked and I can even equip
it.
But the thing about this ability is it's a different damage type.
It's going to be lightning.
So the lightning damage type, I'd like to be associated with a different kind of debuff.
So for this game project, each offensive ability is going to be associated with its element.
We'll have fire abilities, lightning abilities and a third type of element.
So for that reason, each of these abilities needs to have its own chance to do its particular type
of debuff, right?
So I'm going to do a little bit of a change to our design because each of our gameplay abilities has
a team map of damage types to an scalable float using a curve for that particular damage type.
Right.
Well, I'm going to make our gameplay abilities have one damage type that they can apply.
Now if you like, you could still keep the team map and have multiple damage types per ability.
That's fine.
But to simplify our design, I'm going to have one damage type per ability and then each ability that
causes damage will have its own chance to do a debuff.
Right.
And I think this way is a little bit simpler.
It allows us to avoid over complicating our code and encapsulate damage types into different abilities.
And if you really need it to a given gameplay ability could be specialized.
You could derive a new gameplay ability class and give it more than one damage type and damage parameters.
But the base aura damage ability class will have a single damage type.
So for that reason we're going to make a little bit of a change to the aura damage gameplay ability.
We're going to remove the map and just have a single scalable flow for damage.
And we're also going to have debuff parameters corresponding to each damage type.
So what I'm going to do in this video is remove the team map from our gameplay ability and just use
a single damage type for it.
Now what does that mean for our abilities in the editor here?
Well, we have a firebolt ability.
That's our only offensive ability so far.
Where do we actually apply damage?
Well, we don't apply damage until the projectile hits, right?
We don't apply the gameplay effect.
So we're going to have to go into the projectile and fix that as well.
So a couple things to do here.
First, I'm going to close the editor.
And we're going to go into our public ability system abilities folder and open aura damage gameplay
ability where we have the team map and instead of having a team map now I'd like to have just a single
gameplay tag for damage type and an F scalable float for base damage.
So first we'll have the gameplay tag for damage type.
So this will be damage type and we'll have the F scalable float for damage.
This will be damage.
And we'll make these both edit defaults only and we'll remove damage types altogether.
Now what complications does this create?
Well, there are a couple areas we'll have to change.
For one, we have to go into our projectile spell, which is using our map we removed.
So we can do that here in the private folder in abilities or a projectile spell.
And we can search for damage types.
Now what we're doing here is looping over damage types.
We're getting the scale damage based on that damage type in the pair.
But now we don't have to do that.
We can just use the damage.
So instead of looping now, we're just going to take the contents of that loop.
We're going to create a const float called scale Damage, and instead of using dot value, we can just
use our damage scalable float.
And for the set by color magnitude, we can just use our damage type gameplay tag.
And we can get rid of this loop altogether.
Now, this is going to make things a lot simpler and also allows us to stop looping over options that
are not going to be there most of the time.
And if we create specialized gameplay effects, say, one that causes lightning and fire damage, well
then we'd assign those set by color magnitudes just for fire and lightning.
No need to loop over all damage types.
Now, where are we retrieving this set by caller magnitude?
That's going to be in our exec calc damage.
Let's go into that and see what's happening here.
We're getting damage set by caller magnitudes and we're doing this by looping over all of the damage
types that exist in our project.
And we're checking resistances for all of them.
We can still do this because we may create gameplay abilities that set multiple damage types in their
effect.
It's just that now by default, the base damage gameplay ability just has one.
So we can leave the exact calc as is.
So with this we can compile and launch the editor.
And of course, that's going to allow us to find other errors resulting from our change.
For one or a damage gameplay ability does have a cause damage function, doesn't it?
And this, of course, loops over damage types.
This doesn't need to be a loop anymore as we're only going to have by default one so we can replace
the for loop with its contents.
So we're going to copy the contents of the for loop.
We're going to replace the for loop with the contents and instead of pair value, this would be the
damage.
Scalable float and the key was the damage type.
So we can replace pair key with damage type.
Now get damage by damage type is actually not necessary anymore.
So what we can do is remove this function altogether and we'll remove it from the header file as well.
Now, a quick compile is going to tell us if that breaks anything.
And or a firebolt also is going to need to change.
Right.
This is going to be a little bit simpler as well.
This is for get description.
We now no longer need get damage by damage type.
All we need to do is use our damage scalable float, evaluating it at a particular level, like we're
doing an aura projectile spell so we can copy those two lines where we're doing it and back in Aura
Firebolt, we can go ahead and paste those two lines.
Actually, we don't need that second line there.
We just need to get damage and get the value at the ability level.
Except since this is on the aura Firebolt spell itself, it doesn't know its ability level.
We have to use the level that was passed in.
So we have that scale damage.
And in fact, this is what we can replace this with here.
And because damage is now a member variable, this right here can be called scaled damage.
And we have to replace everywhere.
We're using damage with scale damage.
So I'm going to take this line scale damage and we're going to use that in our descriptions.
So I'm going to go down to the else case.
We're going to replace damage with scaled damage.
And replace the damage local variable with our scaled damage where we're getting the value from our
scalable float.
And replacing damage with scale damage.
So that takes care of those errors.
I'm going to compile again and see if we get any more.
And that seems to have called out all of them.
So now we can just make sure things work.
Make sure our damage is set for fire, bolt and so on.
So in the editor we can open up firebolt.
We need to go to our damage which is now unset because this used to be a team map.
Now we're going to have to set it.
So I'm going to set the damage value to one use CT damage and select abilities.
Dot Firebolt.
Take our damage type and set it to damage fire.
Like.
So now we also have melee and ranged damage.
So we're going to need to go into our enemies abilities.
So ability system, enemy abilities and we're going to have to go into gar enemy Firebolt and change
its damage, setting the value to one using CT damage and the firebolt curve and setting its damage
type to fire.
We should also go to GA melee attack and set its damage type.
We're going to set that to physical set damage to one and scale it by CT damage using the melee curve.
And we'll go to ranged attack and set this one.
This will be damage types physical damage one using the CT damage curve table and the abilities ranged
curve.
So with that now, all the abilities should be causing damage.
And my firebolt is causing damage.
And our spear goblins are causing damage.
And we can also check to make sure the slingshot goblins will cause damage.
I think they will, though.
I'm just going to bring in a goblin slingshot.
And it does cause damage.
Excellent.
So we have that change, right?
And we're now ready to start implementing debuffs.
And for debuffs, I'd like my gameplay ability at least, or a damage gameplay ability to have a number
of parameters for damage because damage will now be associated with debuffs and debuff chances and debuffs
and damage types will have a 1 to 1 relationship.
So we're going to have gameplay tags for each debuff type and those will correspond to our damage types.
We can add those to or gameplay tags which I see there's an include for here in aura firebolt.
We no longer need, so I'm going to close all the tabs and open aura gameplay tags.
And we'll have a set of debuff types that correspond to damage types, much like we have damage types
to resistances.
These will all be tied together.
So right here where we have damage types.
And up here we have resistances.
We're also going to have debuffs associated with each damage type.
Now, I think the resistances should now be right down here next to the damage types.
I'm going to drag them down.
And we're also going to have our debuff gameplay tags right here as well.
So I'm going to make an gameplay tag called debuff Underscore and we'll have one associated with fire.
I'm going to call it Burn.
I'm going to have another one associated with lightning called debuff underscore stun.
So lightning damage will have a chance to stun.
Now we have two more arcane and physical.
Now I don't have names for those, so I'm just going to call them debuff arcane and debuff physical.
And we can go ahead and make those tags.
Before we do, though, I'm going to make another T map here.
Just like damage types to resistances, we're going to have damage types to debuff tags.
We'll call it damage types to debuffs.
So let's do two things now.
Let's make those new debuff tags and let's add them to our map.
I'm going to find my resistances.
Here they are.
And I'm just going to make the four new debuff tags right here.
And I'll go ahead and make a comment that says debuffs.
So we're going to have first debuff.
We'll start with arcane and the tag will be debuff dot arcane.
And we're going to say debuff for arcane damage.
We'll just do it like that.
Next we'll have debuff underscore burn and this will be debuff dot burn and we'll say debuff for fire
damage.
Our next one will be debuff physical.
The f name will be debuff physical and the f string will say debuff for physical damage.
Looks like that one was the lightning gameplay tag, but that's fine.
Our next one is going to be debuff stun.
The tag will be debuff.
Dot stun and the string will say debuff for lightning damage.
So now we have the four debuff tags.
Now let's add those to our team map and we're going to do those.
We'll do it right here where we're associating damage types to resistances.
We can just copy these four lines.
Except instead of damage types to resistances, we're going to use damage types to debuffs.
And for arcane we'll map it to debuff arcane.
For lightning.
We'll map it to debuff stun.
For physical we'll map it to debuff physical.
And for fire we'll map it to debuff burn.
And with that now our gameplay tags not only has debuff tags, but it also has the ability to look up
the debuff by damage type, which is really useful.
So I'll go ahead and put this comment here that says Map of damage types to debuffs.
So now we have debuff gameplay tags.
So our next step is to associate our abilities with debuffs.
So an ability has a damage type.
It's now going to have statistics related to debuffs such as debuff chance and so on.
And we'll handle implementing that next.