Welcome In this video.
I'm going to challenge you to fill out the Firebolt description, and I'd like you to use our different
styles in our rich text data asset.
I'd like you to show the name of the ability for firebolt.
Just say Firebolt.
And I'd like you to say launches a bolt of fire exploding on impact and dealing nine fire damage with
a chance to burn and make sure nine uses the damage style.
If you like, you can show the level at the bottom too.
And for the next level description.
Say next level and say launches two bolts of fire exploding on impact and dealing 17 damage with a chance
to burn.
Now this is going to be not hard coded, but see if you can figure out how to get the damage based on
the level.
Now, notice I said launches two bolts of fire.
I'd like this to be the level.
So if it's level two, I'd like to see two and notice if I level up.
And I spend a point on my Firebolt notice now that my firebolt description says launches two bolts of
fire and next level launches three.
Now I'd like this to be capped off at five, so I never want to see five there.
So that's your challenge to fill out the description for Firebolt with these qualities.
So get as far as you can with this.
So for this quest, I'd like you to override Git description in Aura projectile spell.
Go ahead and set that message there as if this were for aura firebolt and override git next level description
as well and take it as a bonus challenge to show the damage amount.
See if you can figure out how to do that based on the level.
Pause the video and conquer this quest now.
Okay, so we need a description for Firebolt.
I'm going to close the editor.
I'm going to go ahead and just open ability system abilities or a projectile spell.
And I'm going to get its H file open as well.
And I'm going to override two public functions.
So we'll get a public section in here.
I'm going to say virtual F string Getdescription override, and we'll also override the next level.
So virtual F string, get next level description override.
Let's generate definitions.
And I'm not going to call super.
So let's think about our description here.
Now it's going to be different if it's level one versus a number greater than one.
If it's one, I'm going to say launches a Firebolt.
But if it's more than one, I'm going to say launches a number of firebolts because I want the number
of fireballs to be the level up to a cap.
So what I'll say here is if level equals one and then I'll have an else case.
Now, if the level is one, I'm going to return an F string using print f.
It's going to have text comma followed by parameters.
Now the text is going to use the title, so I'm going to use title and I'm also going to have the end
pointy brackets for title and it's going to say in all caps.
Firebolt.
And after this I'm going to have to new line characters forward slash n forward slash n, and then I
can have stuff on the next line.
So I'm going to use the default.
Style.
I'll go ahead and close it.
I like to close them first before I put text between them.
And the text is going to say launches a bolt of fire exploding on impact and dealing.
And then I want to use my damage style.
So I'm going to use damage.
And it looks like this is really easy to mess up.
I need this end style one.
This one.
Over here.
Looks like I put a typo in launches, but title is opening and closed here.
Default is opening and needs to close here.
Like that.
And then damage is opening and needs to close and the amount of damage is actually going to depend.
Right.
How did we get the damage from the ability in this class before?
Let's remind ourselves.
We have scaled damage here.
Now, we could have multiple damage types, but I'm just going to get the damage type for fire because
this is fire bolt and I'll make a new one.
If I have a different or a projectile spell that Aura wants to use.
So I'm just going to get my damage types t map and index it at fire and call get value at level.
That's what I'm going to do.
So I'm going to say.
Const float damage equals.
Damage types indexed at the fire damage type.
So I'm going to say for a gameplay tags get dot damage underscore fire.
And from this scalable float, I'm going to get value at level passing in level.
And now I have damage.
And so for damage I'm going to use percent D and I'm going to go ahead and just round this to an integer.
I'll let it give me a float and just implicitly convert to an int 32 and that's going to be the first
format parameter here.
It's going to be damage.
Now, after we say that, I'm going to use the default style again, so I'm going to say default, closing
it off and inside of the default again, I'm going to say space fire damage with a chance to burn.
And after that, I'm going to have two new lines.
So new line, new line.
And I'm going to show some stats.
So with the stats, I'm going to use the small style.
And I'm going to say in the small style level, colon space.
And I'm going to show the level using the level style level.
I'm going to open and close it.
By the way, if this gets really confusing, just look at the GitHub.
Commit for this so you can get a closer look.
Okay, that's enough for now.
We have our description for level one and the description for any level over one is going to almost
be the same.
I'm just going to copy it.
And we're going to paste.
The same thing, only we're going to change this to say launches and we'll have percent de percent de
bolts, plural of fire exploding on impact and dealing.
We'll have damage there.
Fire on damage with a chance to burn.
Now we're going to show the level after that.
So we have a percent de before damage and that's going to be the number of fire bolts.
Now, that's not something that we've coded yet.
So we can make our projectile spell, have a integer for the number of projectiles.
So we're going to say int 32 num projectiles equals five with a new property.
Edit defaults only and we'll just use num projectiles here.
And what we're going to do is we're going to take the minimum between the level and Num projectiles,
whichever is lowest.
So we're going to take f math min passing in our level and num projectiles and f math needs a double
colon there.
So we'll take the min between level and projectiles.
So we're showing how many projectiles will be launched this level.
Now, next level is just going to be the same.
So we're going to take what we did here and paste it Next level will say Firebolt launches percent de
bolts of fire using that level there.
But we're taking the min.
And we also need to calculate the damage again.
So we'll go ahead and copy this line and paste it there.
And then everything else should be the same.
So now Firebolt has a description.
So let's go ahead and launch and see how it works.
All right, So we're back open.
We shouldn't have to change anything.
We should be able to just open our spells menu.
And we should be able to now see a description.
And we do.
We see Firebolt here launches a bolt of fire exploding on impact and dealing nine fire damage with a
chance to burn.
And we see that it's level one and the next level description says launches two bolts of fire exploding
on impact and dealing 40 damage with a chance to burn.
And that says level two.
All right.
Excellent.
Next one says spell locked until level two, which is exactly what I wanted to see.
Let's also see what happens if we level up our fire ability.
All right, We leveled up.
Let's take that fire ability, spend a point on it, and we see that launches two bolts of fire now
causing 40 damage at level two.
And then for next level, we see launches, three bolts of fire exploding on impact and dealing, 49
fire damage with a chance to burn.
Cool.
All right.
Now, the last thing I'm noticing is that Firebolt right here should actually say next level.
So I'm going to change that real quick.
So for Jet next level description, this will say next level.
I'll make it all caps.
And with that, we have a firebolt description.
Looks great.
Okay.
Now it says next level and shows us what happens at next level.
That makes more sense.
We'll go ahead and upgrade it again just because we can.
And it's looking great.
All right.
Now I think I can take my damaged curve table down just a bit because a jump from 10 to 40 is kind of
drastic.
So I'm going to go to ability system data, CT damage, open firebolt, and I'm actually going to just
remove these curve points and make this a little bit more linear.
We can go up a little faster than this, but.
I'd like a smoother curve.
So at level two, we'll see a value of 16.
So we'll go from 10 to 16.
At level three, we'll go to 34.
Level six is 50.
So that's looking pretty good.
And as I change that curve table, the cool thing is I'll see that reflected when I take a look at the
description.
So I see that it causes nine, but next level causes 17.
If I upgrade it, it causes 17.
Next level, it causes 26.
Cool.
Now we just need a description for our electrocute, which we don't have.
Excellent.
Awesome job and I'll see you in the next video.