Welcome back.
We're now ready to add cost and cooldown to our Fire Blast ability.
So I'm going to compile and launch up Unreal Engine.
All right, so we're back in the engine.
I'm done with offensive spell tree.
I'm done with ability info for now.
We'll get it back open soon.
But here's Fireblast I'm going to keep that open.
And I'm going to start with my cost my mana cost for fireblast.
So that means I can go to ability system and data and go to Spell cost and add a curve.
Rename this curve.
It's going to be Fireblast and I'm going to add two points to it.
So add key click add key.
The first one is going to be at one.
And I'll make its damage a little higher.
Let's make it 15 as this is a higher level spell.
And I'm going to take my second point.
And my second is actually this one down here, because I put that first one right here at one.
This one is going to be at level 40.
And I'm going to make its value 150 or so.
And with that, I'm going to make this a auto curve.
Flatten it out just a bit.
And that's my spell cost for this spell.
Now 15 Manacost at level one is okay.
150 is a little expensive, but we'll have to see with testing how that feels.
So I'm going to save this spell.
Cost is set now Fireblast needs a cost gameplay effect right?
So let's make one.
I'm going to browse to where Fireblast exists.
Create a new gameplay effect blueprint.
And call this GE underscore cost fireblast.
We're going to open it up.
And the cost is going to be an instant effect.
With one modifier.
It's going to require mana just like our other spells.
It's going to be add and the modifier magnitude will be negative one.
But we're going to use a curve table.
Spell cast and choose.
Fire blast.
We can compile, we can save, and we can take fireblast and set its cost gameplay effect to cost.
Fireblast.
Now when we activate the ability, we can commit ability cost.
Like so, and we should be able to see that cost if we save all.
If we press play, we level up.
We purchase our spell, we equip it to two, and then I can hit number two.
And we just did our cost commit there.
Okay.
So cost works I'm going to close CT spell cost.
Now we need a cooldown.
So I'm going to make a cooldown.
Right click.
We're going to add a gameplay effect.
We're going to call this gameplay effect GE cooldown underscore fireblast.
And this is going to be a duration based gameplay effect.
So has duration.
And I'm going to set the duration magnitude for this.
And I think we can make the duration for this about five seconds.
And we need a cooldown tag and the granted tags.
So we're going to go to Project Settings.
We're going to go to Gameplay Tags into cooldown.
We're going to add a new cooldown tag and call this cooldown dot fire dot Fire Blast.
And now we have a cooldown dot fire dot Fire Blast gameplay tag.
We're going to go to Cooldown Fire Blast and add that to the granted tags so it's cooldown fire fire
Blast, compile save, and we're going to get that into our Fire Blast gameplay ability.
In Class Defaults, we're going to set the cooldown to Cooldown Fire Blast like so.
And now if we end the ability, we should be able to activate it again, but not until our cooldown
is over.
As long as we commit the cooldown and we can commit cost and cooldown with commit ability.
So I'm going to do that now instead of just the cost.
Now before testing, I do want to go back into my data folder blueprints ability system data into ability
info, because now that I have a cooldown tag, I can set it here Fire Blast.
And with that I can press play.
I can level up.
And I can unlock Fireblast, and I can equip it to slot two, and I can press two.
And there's my cooldown going down.
And when it comes down, I can cast it again.
And I can spam the key.
I can't cast it until the cooldown is over.
So with that, we have cast and cooldown.
All that's left is to actually determine what happens when we cast Fireblast, and we'll do that next.
So I'm going to close project settings.
I'm done with my new effects.
I'm going to keep Fireblast open.
Save all and I'll see you soon.