WEBVTT

00:06.820 --> 00:07.930
Welcome back.

00:07.960 --> 00:09.670
Now things are looking pretty cool.

00:09.670 --> 00:15.190
We have a spell description that shows us how much damage we can do, what level we're at.

00:15.190 --> 00:24.070
And this is nice, but recall that we added more styles to our rich text block data table if we go to

00:24.100 --> 00:31.630
UI data rich text style here in our styles, we have all these different styles and it'd be nice to

00:31.630 --> 00:33.160
make use of more of them.

00:33.160 --> 00:40.600
In this video we're concerned with manacost and cooldown and how to get Ahold of those when we're constructing

00:40.600 --> 00:42.280
our spell descriptions.

00:42.280 --> 00:44.890
So that's what we're going to get started on.

00:44.920 --> 00:45.670
Now.

00:45.670 --> 00:50.170
We added our spell description for Firebolt here in Aura Projectile spell.

00:50.200 --> 00:55.090
But Aura projectile spell is just a generic projectile spell.

00:55.210 --> 01:02.770
I think having a description is reason enough to derive aura projectile spell into an aura.

01:02.770 --> 01:03.790
Firebolt.

01:03.970 --> 01:10.850
That way we can have multiple projectiles, each of which has their own implementation of jet description

01:10.850 --> 01:12.980
and get next level description.

01:13.130 --> 01:20.750
So we're going to move this into a child class and reparent the aura Firebolt Gameplay ability Blueprint.

01:22.160 --> 01:23.990
So here's what we're going to do.

01:24.140 --> 01:26.480
Let's make a new C plus plus class.

01:27.620 --> 01:32.990
And it'll go into abilities and it's going to be based on Aura projectile spell.

01:33.720 --> 01:35.700
So let's make that child class.

01:35.700 --> 01:38.190
And this can be called aura.

01:39.440 --> 01:40.550
Firebolt.

01:41.910 --> 01:48.720
And we'll create the class, we'll close the editor, and all we need to do is implement, get description

01:48.720 --> 01:50.700
and get next level description.

01:51.000 --> 01:55.590
So I'm going to close all other tabs keeping Aura projectile spell open.

01:55.590 --> 01:57.420
I'm going to get the header file too.

01:57.420 --> 02:03.330
And let's get Aura Firebolt open and it's CPP file as well.

02:03.330 --> 02:08.730
And we're going to move some things from aura projectile spell into aura Firebolt.

02:09.270 --> 02:15.150
So aura projectile spell doesn't even need to override, get description and get next level description.

02:15.150 --> 02:21.450
We're just going to cut those out and move them over to Aura Firebolt and we'll implement them here.

02:21.540 --> 02:26.070
So I'm going to get those definitions, both of them.

02:27.190 --> 02:33.610
Cut them out of or a projectile spell and paste them here in aura.

02:33.640 --> 02:34.780
Firebolt.

02:34.810 --> 02:37.900
We do have to change those spell signatures.

02:37.900 --> 02:42.790
They have to say you or a firebolt not projectile spell.

02:43.940 --> 02:50.330
Now we're getting gameplay tags, so we need that include we don't really need it anymore in or a projectile

02:50.330 --> 02:51.560
spell, do we?

02:51.890 --> 02:53.450
I don't think we do.

02:53.450 --> 02:55.630
Oh it looks like we're using it down here.

02:55.640 --> 02:56.030
Yeah.

02:56.030 --> 03:01.970
So we're going to have to leave it in, but we still need to get it over to Aura Firebolt.

03:02.840 --> 03:10.370
So with that or a Firebolt is now implementing these description functions and now we can just reparent

03:10.370 --> 03:16.310
our gameplay ability blueprint to aura Firebolt and it still should all work as aura.

03:16.310 --> 03:20.360
Firebolt inherits everything from aura projectile spell.

03:21.700 --> 03:28.000
So we're going to go into the ability and blueprints, ability, system or abilities.

03:28.000 --> 03:31.780
Fire Firebolt Gar Firebolt.

03:31.840 --> 03:34.060
We're going to open the class settings.

03:34.060 --> 03:36.490
Oh, and I just noticed we had a print string here.

03:36.490 --> 03:37.960
I don't need that anymore.

03:38.710 --> 03:45.670
And we'll go to class settings and it's based on aura projectile spell, but we can now base this on

03:45.670 --> 03:48.130
Aura Firebolt.

03:48.910 --> 03:52.750
Now that we've reparented it, we can just make sure everything still works.

03:52.750 --> 03:53.590
It should.

03:54.660 --> 03:56.700
Including our spell description.

03:56.700 --> 03:57.990
It still works.

03:59.410 --> 04:08.200
This is great because now we can have our firebolt specific description on the Firebolt class specifically.

04:08.200 --> 04:15.550
So I'm going to close Aura projectile spell and here in Aura Firebolt in this video, we're concerned

04:15.550 --> 04:18.610
with getting the manacost and the cooldown.

04:19.610 --> 04:27.160
Now getting the manacost and the cooldown, I think is something that all spells should be able to do.

04:27.170 --> 04:34.370
So I'm going to make some functions on aura gameplay ability to retrieve the manacost and the cooldown

04:34.760 --> 04:37.250
and these can be protected.

04:39.260 --> 04:41.570
And they can return floats.

04:41.570 --> 04:48.320
So I'm going to make a git manacost function and it'll take a float called n level, but I'm going to

04:48.320 --> 04:51.590
set its default value to one point F just in case.

04:51.590 --> 04:55.220
We don't care about passing in a level for any reason.

04:55.310 --> 04:57.650
I'm also going to have a get cooldown.

04:59.310 --> 05:05.100
And this will take in a float called in level as well, but it'll be set to one by default.

05:05.130 --> 05:09.180
Also now I'm going to generate definitions for these.

05:13.270 --> 05:19.240
And now we need to start thinking about how we can get the manacost for any given gameplay ability because

05:19.240 --> 05:26.590
here in Aura, Firebolt and Getdescription, I'd like to format this string to have the manacost inside

05:26.590 --> 05:27.850
the string here.

05:28.640 --> 05:30.410
So let's think about this.

05:30.650 --> 05:33.800
Here in aura gameplay ability.

05:34.100 --> 05:36.590
Just trying to organize my tabs.

05:36.770 --> 05:39.440
How are we going to get our manacost?

05:39.650 --> 05:43.040
Well, first of all, our manacost is a gameplay effect.

05:43.040 --> 05:45.110
It's our cost gameplay effect.

05:45.140 --> 05:49.520
Abilities have a cost gameplay effect that is special, right?

05:49.520 --> 05:53.900
We can always get it if we call get cost gameplay effect.

05:54.260 --> 05:56.570
So that's kind of good to know, right?

05:56.570 --> 05:59.990
And get cost gameplay effect being a new gameplay effect.

05:59.990 --> 06:09.380
Pointer has modifiers so we can access its modifiers by just getting modifiers from the gameplay effect.

06:09.380 --> 06:15.560
But this is a pointer and not all gameplay abilities may necessarily have their cost gameplay effect

06:15.560 --> 06:16.280
set.

06:16.280 --> 06:20.900
So what we'll do is check that pointer.

06:20.900 --> 06:25.520
We'll see if that cost gameplay effect is indeed valid.

06:26.390 --> 06:27.830
I'm going to make a const.

06:27.860 --> 06:36.450
You gameplay effect pointer called cost effect and it's going to be set to get cost gameplay effect

06:36.570 --> 06:41.070
and I'm going to check it in an if statement first thing.

06:42.390 --> 06:45.480
Now that I have cost effect, I don't need to call it again.

06:45.750 --> 06:49.410
And I'm going to get its modifiers and I'm going to loop over them.

06:49.410 --> 07:00.280
So I'm going to say for auto mod and cost effect modifiers and what is mod?

07:00.300 --> 07:02.970
It's an gameplay modifier info.

07:06.770 --> 07:11.820
Now an gameplay modifier info has a lot of things.

07:11.840 --> 07:12.820
Look at this.

07:12.830 --> 07:19.910
We can check its attribute and see if it's the specific attribute we're looking for, such as manacost.

07:19.940 --> 07:20.480
Right.

07:20.480 --> 07:30.830
So if we take that attribute, we can compare it with, say, u or attribute set double colon get mana

07:30.860 --> 07:31.910
attribute.

07:32.210 --> 07:37.460
So if we were to place this in an if statement, then we'd make it inside this.

07:37.490 --> 07:43.240
If we looped through the modifiers on the cost gameplay effect, it should only have one.

07:43.250 --> 07:50.150
But if that cost is a mana cost, well then we'll arrive here.

07:50.510 --> 07:57.560
Now the modifier has a modifier magnitude and we know that modifier magnitudes can be one of several

07:57.560 --> 07:58.490
types.

07:58.670 --> 08:04.340
If it's a scalable float, we can get the magnitude without an effect spec.

08:04.490 --> 08:10.350
Otherwise, lots of these functions require an effect spec, but there's one that we can call called

08:10.350 --> 08:12.900
get static magnitude if possible.

08:12.900 --> 08:21.900
That only requires a level so we can pass in n level here and a float by reference that it will fill

08:21.900 --> 08:23.790
in with that magnitude.

08:23.790 --> 08:33.000
But this only works if it's a scalable float with either a hardcoded value or a value scaled by a curve.

08:33.030 --> 08:34.250
Tables curve.

08:34.260 --> 08:38.670
So if that's the case, then we can get the magnitude.

08:38.700 --> 08:47.880
So I'm going to create a float up at the top called Manacost, set it to zero and pass Manacost in here.

08:48.570 --> 08:52.500
And if we make it this far, then we have the manacost.

08:52.530 --> 08:58.140
We don't need to continue looping over any other modifiers that may or may not be there.

08:58.170 --> 09:05.280
They typically won't in a cost gameplay effect, but we can still break out of this for loop anyway

09:05.400 --> 09:07.620
once we've found the manacost.

09:08.740 --> 09:12.550
And at the very, very end, we can return Manacost.

09:13.800 --> 09:18.840
So now that we have this get manacost, which can be a const function.

09:19.290 --> 09:20.970
So we'll make it const.

09:22.400 --> 09:22.640
Like.

09:22.640 --> 09:29.570
So then we can call git manacost from within or Firebolt to get the manacost.

09:30.180 --> 09:34.410
So here in Aura Firebolt, we have our damage, right?

09:34.440 --> 09:36.640
We can also get our manacost.

09:36.660 --> 09:45.750
So I'm going to make a const float called Manacost and set it equal to get manacost and pass in our

09:45.750 --> 09:46.410
level.

09:47.340 --> 09:51.390
Now that we have manacost, we can format that into our string.

09:52.290 --> 09:53.610
Now, here's the thing.

09:53.610 --> 09:54.480
Look at our string.

09:54.480 --> 09:57.430
This is running off the screen and it's terrible.

09:57.450 --> 10:00.660
That's actually something that really irks me.

10:00.660 --> 10:02.970
I don't like it going off that far.

10:02.970 --> 10:04.300
I don't think anyone does.

10:04.320 --> 10:10.230
So one of the things we can do is, first of all, we can put the string itself on its own line.

10:10.260 --> 10:10.770
Tab.

10:10.800 --> 10:11.070
Tab.

10:11.100 --> 10:11.820
Tab.

10:12.060 --> 10:13.500
Well done, Stephen.

10:13.530 --> 10:15.690
You saved us two inches.

10:15.690 --> 10:16.310
Right.

10:16.320 --> 10:21.590
But we can also break this string up into individual parts, too.

10:21.600 --> 10:27.720
All we have to do is put double quotes and writer will give me two for the price of one.

10:27.720 --> 10:33.540
If I just hit that key to give me a quote, it gives me double quotes.

10:33.540 --> 10:40.080
So if we close off the quotes and open up new quotes, then all this other empty space is ignored.

10:40.080 --> 10:43.350
So really we could just break this up.

10:43.350 --> 10:45.960
So we have the title, right?

10:45.960 --> 10:50.490
And then if we wanted to, we could break the rest up.

10:51.150 --> 10:56.130
We say launch is a bolt of fire exploding on impact and dealing.

10:56.190 --> 10:57.720
I'm going to break it up there.

10:58.960 --> 11:02.460
Percent fire damage with a chance to burn.

11:02.500 --> 11:07.290
We can even break fire damage with a chance to burn in half.

11:07.300 --> 11:11.080
This isn't going to create a new line in the widget at all.

11:11.080 --> 11:14.980
It's just going to affect what we see here in the text.

11:14.980 --> 11:18.790
So that's why this is so nice to be able to do.

11:19.930 --> 11:24.460
And what I'd like to do is have each of these parameters on their own lines.

11:24.880 --> 11:26.860
That'll make it easier to read.

11:27.040 --> 11:29.740
So we have the title, it's firebolt.

11:29.740 --> 11:38.860
And really, if we really wanted, we could have this be a member variable, a string on the gameplay

11:38.860 --> 11:40.990
ability class if we really wanted.

11:40.990 --> 11:46.510
That would save us about four seconds of typing every time we create a new description.

11:46.540 --> 11:48.850
I don't care about four seconds of typing.

11:48.850 --> 11:53.380
I'm going to be typing out descriptions for these anyway, so I'm just going to leave it just saying.

11:53.740 --> 12:00.980
So we say launches a bolt of fire exploding on impact and dealing fire damage with a chance to burn.

12:01.000 --> 12:01.570
Okay.

12:01.570 --> 12:10.390
And we haven't implemented Burn yet any debuffs of that kind, but we could say X percent chance to

12:10.390 --> 12:13.000
burn if we wanted to if we wanted to.

12:13.000 --> 12:18.040
But we do have our level and I'm going to have level on its own.

12:18.040 --> 12:24.560
Line two, we're going to say level equals and we'll do it like this.

12:24.740 --> 12:31.760
And really, actually I think I'd like level and all the manacost and other stuff at the top above the

12:31.760 --> 12:32.690
description.

12:32.690 --> 12:41.090
So what I'm going to do is this I'm going to take this part of the string without taking the parentheses.

12:41.810 --> 12:42.890
I'm going to cut it.

12:42.920 --> 12:47.540
I'm going to paste it here and we're going to say level is level, right?

12:47.540 --> 12:50.030
And then we can do the manacost part.

12:50.030 --> 12:53.210
So we're going to say Manacost.

12:54.580 --> 13:00.760
Closing it right away and say, no, actually this is going to be small and we're going to say Manacost.

13:01.840 --> 13:05.700
Colon space and then we'll use the manacost.

13:05.710 --> 13:07.990
We'll say mana cost.

13:08.020 --> 13:17.200
We'll use that style and we're going to use percent F, but I don't want that many decimals.

13:17.200 --> 13:19.960
I only want one decimal to the right.

13:19.960 --> 13:22.210
I want to pad it to the right by one.

13:22.210 --> 13:25.600
So I'm going to say percent point one f.

13:25.630 --> 13:31.120
This will give me as many digits as I need to the left of the decimal, but just one to the right of

13:31.120 --> 13:31.330
it.

13:31.330 --> 13:32.530
That's what I want.

13:32.920 --> 13:40.690
So now that we have the mana cost percent 0.1 f needs to have a float provided and that's going to be

13:40.690 --> 13:41.620
our mana cost.

13:41.620 --> 13:44.410
So we're going to put that right there at the very end.

13:44.440 --> 13:47.710
Not cast cost like so.

13:48.530 --> 13:52.040
And actually, these are in the wrong order now, Right.

13:52.050 --> 13:54.950
I reordered them, so I have to be careful about that.

13:54.950 --> 13:58.010
First is level that goes first.

13:58.630 --> 14:01.540
Then Manacost is second.

14:01.690 --> 14:06.040
Glad Ryder told me about this with these squiggles, then damage.

14:06.040 --> 14:14.440
And we need to make sure that our commas and our parentheses are correct and this looks good.

14:14.440 --> 14:19.900
So we have firebolt level manacost followed by the description here.

14:19.930 --> 14:30.670
We could even make this easy on ourselves and say title deeds now, not deeds.

14:30.670 --> 14:35.500
We can say details and then description.

14:37.500 --> 14:42.120
We can even separate these parts with values, right?

14:42.120 --> 14:45.990
So we're taking up more space, but it looks a little bit more manageable.

14:45.990 --> 14:52.110
We have level, we have manacost, we have the actual description here.

14:52.110 --> 14:57.390
We can even separate where we have those values.

14:57.420 --> 15:04.800
It might actually be useful to just use our comments to indicate where these values are.

15:04.830 --> 15:17.400
So we can say level here, we can say Manacost here, we can just put a comment here that says damage,

15:17.400 --> 15:18.150
right?

15:18.570 --> 15:20.940
We can do it that way if we want it to.

15:21.270 --> 15:25.290
And that way we know this percent D is level, which is down here.

15:25.320 --> 15:28.920
This one is Manacost, which is down here.

15:28.950 --> 15:32.100
This one is damage which is down here.

15:32.130 --> 15:32.550
Right?

15:32.550 --> 15:35.640
So it's up to you how organized you want to get.

15:36.330 --> 15:40.410
But the point is that we got our manacost and we haven't even actually tested that yet.

15:40.410 --> 15:44.070
So why don't we just test this out before continuing?

15:44.070 --> 15:48.720
Let's see if we can see that manacost in our Firebolt.

15:50.480 --> 15:53.810
Oh, and get cooldown must return a value.

15:53.840 --> 15:56.480
Which means I forgot to return something, didn't I?

15:56.600 --> 15:58.070
Get cooldown?

15:58.070 --> 15:59.420
We didn't implement anything.

15:59.420 --> 16:01.490
I'm just going to return zero for now.

16:03.810 --> 16:09.150
Zero F And with that, now we can test our work.

16:11.260 --> 16:12.330
Okay.

16:12.340 --> 16:13.630
I always hit open.

16:13.630 --> 16:15.520
I don't think I needed to hit open.

16:15.520 --> 16:18.940
I'm going to close Firebolt and I'm going to open my spell.

16:18.940 --> 16:22.660
Select the Firebolt and we have level Manacost.

16:22.660 --> 16:26.680
Oh, and by the way, Manacost is a negative value, but that is correct.

16:26.680 --> 16:31.840
2.5 is the manacost for a level one Firebolt don't believe me.

16:31.840 --> 16:33.490
Let's verify.

16:33.490 --> 16:37.360
Let's go to ability system data CT cost.

16:37.360 --> 16:39.790
Open the firebolt and look at this.

16:39.790 --> 16:46.570
Level one is 2.5 and if we upgrade it to level two, we should see a -12.5.

16:46.570 --> 16:48.910
Let's prove it to ourselves.

16:49.470 --> 16:58.950
And let's spend a point and Oh, that's right, we can't because we only implemented it for if the level

16:58.950 --> 17:00.480
is one, that's fine.

17:00.510 --> 17:02.160
Just take my word for it.

17:02.190 --> 17:09.960
Now, we did put new lines after Firebolt, but we didn't put new lines after level manacost so it looked

17:09.960 --> 17:10.920
kind of ugly.

17:10.920 --> 17:14.790
Let's put a couple of new lines, at least one, right?

17:14.790 --> 17:16.140
We'll put a new line character.

17:16.140 --> 17:19.050
After we show the level, we'll put a new line.

17:19.050 --> 17:24.990
After we show the Manacost, we'll put two actually, and then we'll say the launches, a bolt of fire

17:24.990 --> 17:28.050
deal and that's it.

17:28.080 --> 17:30.300
We don't even need those two at the end there.

17:30.300 --> 17:35.250
And we can also do this for the next level.

17:35.280 --> 17:39.480
I'm just going to copy this and right here paste it.

17:40.520 --> 17:44.060
Only it needs to say some other stuff, right?

17:44.060 --> 17:48.400
It needs to say launches percent de bolts of fire.

17:48.410 --> 17:54.710
So we're going to say we're still going to have the level, the manacost, but we're going to have launches

17:54.710 --> 17:56.750
and we're going to have a percent de here.

17:58.050 --> 18:02.430
And this will be the number of firebolts our number of projectiles.

18:02.430 --> 18:02.640
Right?

18:02.640 --> 18:05.400
So number of firebolts.

18:06.570 --> 18:08.760
And that's going to come after Manacost.

18:08.790 --> 18:12.090
Wow, these comments are really coming in handy.

18:12.120 --> 18:19.920
So after Manacost, we're going to put what we had here, which was using F math min, taking the minimum

18:19.920 --> 18:24.450
between level and our number of projectiles that goes right there.

18:25.480 --> 18:27.880
And we get a comma at the end.

18:28.000 --> 18:32.200
And with that, we have that percent d.

18:32.470 --> 18:36.520
So launches percent de bolts.

18:36.520 --> 18:42.850
So it needs to say bolts of fire exploding on impact and dealing damage, fire damage with a chance

18:42.850 --> 18:45.580
to burn like so.

18:47.380 --> 18:49.120
Just getting rid of that space there.

18:49.360 --> 18:50.020
Cool.

18:50.020 --> 18:52.030
So we're showing level Manacost.

18:52.060 --> 18:53.220
Number of firebolts.

18:53.230 --> 18:53.760
There we go.

18:53.770 --> 18:54.430
Okay.

18:54.640 --> 18:59.220
And this is if our level is greater than one, right?

18:59.230 --> 19:02.710
But for next level description, we're going to have the same thing.

19:02.710 --> 19:06.100
So first of all, let's remove this dead line of code.

19:07.300 --> 19:13.870
And we'll take this return, copy it, and we'll use the same thing in get.

19:13.900 --> 19:15.460
Next level Description.

19:15.490 --> 19:17.740
Of course we're going to need to get that Manacost Right.

19:17.740 --> 19:24.610
So let's get our float, our const, local variable manacost and we'll get it here.

19:26.090 --> 19:26.710
Cool.

19:26.720 --> 19:27.770
Now that's going to work.

19:27.770 --> 19:34.790
We're going to test it very soon, but we also need to get our cool down as well.

19:34.790 --> 19:36.020
I'd like to get that.

19:36.020 --> 19:38.630
And we created a get cooldown function.

19:38.630 --> 19:40.100
So how do we get that?

19:40.430 --> 19:49.280
Well, for one, notice that we had a get cost gameplay effect you probably suspected and you'd be right

19:49.280 --> 19:57.080
that we have a get cooldown gameplay effect and we can make a local you gameplay effect pointer and

19:57.080 --> 19:57.980
set it equal to that.

19:57.980 --> 20:04.100
So we'll say cooldown effect equals get cooldown gameplay effect.

20:05.580 --> 20:06.540
So we have that.

20:06.540 --> 20:08.760
We can place that in an if, actually.

20:13.700 --> 20:23.300
And the cooldown gameplay effect is actually an effect with no modifiers, whereas the cost we put a

20:23.300 --> 20:30.920
modifier to specify the magnitude of how much mana to pay and also specified what resource choosing

20:30.920 --> 20:34.460
mana to pay and the cost cooldown effect.

20:34.460 --> 20:41.350
Remember, we don't have any modifiers in it, it's just a duration based gameplay effect with a magnitude.

20:41.360 --> 20:46.100
So if we take our cooldown effect, how do we get its magnitude?

20:46.280 --> 20:51.110
Well, if you thought duration magnitude, you'd think right.

20:51.110 --> 20:58.070
And if you take duration magnitude, you can get the magnitude with the same function that we used up

20:58.070 --> 20:59.930
here, get static magnitude.

20:59.930 --> 21:02.030
If possible, we can call that.

21:02.060 --> 21:02.330
Why?

21:02.360 --> 21:10.970
Because duration magnitude itself is also an gameplay effect modifier magnitude same as modifier magnitude

21:10.970 --> 21:12.500
on the mod up here.

21:12.620 --> 21:20.070
Now, if we get static magnitude, if possible, we can pass in in level now for our cooldown for Firebolt.

21:20.100 --> 21:21.600
It doesn't depend on level.

21:21.600 --> 21:24.270
We're not using a curved table or anything like that.

21:24.300 --> 21:25.440
That's fine.

21:25.560 --> 21:29.340
We'll still get that same value no matter what the level we pass in.

21:29.340 --> 21:37.080
But this function will accommodate for the level just in case any future cooldowns depend on level and

21:37.080 --> 21:44.130
we can pass in a float by reference that this function will fill in.

21:44.130 --> 21:53.010
So we can make a float up here called cooldown, set it equal to zero and pass in cooldown here.

21:54.570 --> 21:57.810
And by the end of the function we can return cooldown.

21:59.050 --> 21:59.920
Simple as that.

21:59.920 --> 22:02.020
We can also make this const.

22:02.050 --> 22:06.460
We can go back and make its declaration const, which we have to do now.

22:06.460 --> 22:09.580
And now we have a jet cooldown.

22:09.610 --> 22:10.550
Cool.

22:10.570 --> 22:13.240
Let's go back to Aura Firebolt and use it.

22:13.240 --> 22:21.490
Let's make a const float called cooldown and call jet cooldown and pass in in level.

22:21.490 --> 22:23.050
Well, just level.

22:25.220 --> 22:27.170
And we have the cooldown.

22:27.350 --> 22:29.120
So what we can do is show it.

22:29.150 --> 22:31.640
We can show after level and manacost.

22:31.670 --> 22:38.840
We can put another comment that says cooldown and we can use the small style.

22:41.230 --> 22:42.910
We'll say cool down.

22:43.180 --> 22:45.400
By the way, this should be in quotes.

22:48.810 --> 22:56.130
And cooldown gets a colon and a space and after cooldown, we're going to say cooldown.

22:56.130 --> 22:57.840
We're going to use the cooldown.

23:00.130 --> 23:05.530
Style and we're going to use a percent F with 0.1.

23:05.530 --> 23:08.890
So one space of padding just like we did for Manacost.

23:08.920 --> 23:10.570
We're going to do that too.

23:10.570 --> 23:15.430
And let's give it to new line characters.

23:15.430 --> 23:17.440
And now Manacost can just have one.

23:18.670 --> 23:20.910
And after Manacost we need cooldown.

23:20.920 --> 23:24.160
So right here after Manacost we'll put cooldown.

23:24.340 --> 23:30.940
And again, organizing it like this is super duper nice because when it was all one line before, it

23:30.940 --> 23:32.650
was just a nightmare, right?

23:32.680 --> 23:34.870
So this is really nice.

23:34.900 --> 23:39.070
And we can add this to the other descriptions.

23:39.070 --> 23:46.930
We'll put one right here after Manacost in the next one with cooldown down here, and we'll go to the

23:46.930 --> 23:51.120
next level description and show the cooldown then as well.

23:51.130 --> 23:58.840
Oh, and I'll remove a new line character so we don't have to two in a rows and we'll put cooldown right

23:58.840 --> 23:59.650
here.

24:02.140 --> 24:06.310
You could see if we were still using one liners, it would be really out of control.

24:06.310 --> 24:08.080
And by the way, it goes level Manacost.

24:08.110 --> 24:09.130
Cooldown.

24:09.170 --> 24:13.000
Oh, I accidentally let autocomplete screw me over.

24:13.030 --> 24:16.810
This should say cooldown, which means we need to get cooldown, don't we?

24:16.840 --> 24:21.940
So we'll get the cooldown the same way we did in our previous function.

24:21.940 --> 24:24.640
We'll get it right here and now.

24:24.640 --> 24:25.330
We can use it.

24:25.330 --> 24:26.350
All right.

24:26.380 --> 24:28.360
Now we have cooldown.

24:28.690 --> 24:36.370
The last thing before we test is I'd like our aura damage ability to have a simple damage function to

24:36.370 --> 24:40.930
get damage, rather than going through all this trouble here.

24:40.930 --> 24:44.440
And it can take in a gameplay tag for the damage type.

24:45.350 --> 24:47.630
So one last function to make.

24:47.630 --> 24:54.110
Let's go to aura damage gameplay ability and we'll make a float returning protected function that gets

24:54.110 --> 24:54.830
damage.

24:54.830 --> 24:59.330
So we're going to say float, get damage.

25:00.260 --> 25:02.930
It could be get damage by damage type.

25:05.720 --> 25:15.440
And it'll take a float called N-level and an F, Let's make it a const F gameplay tag reference called

25:15.440 --> 25:16.670
Damage type.

25:18.360 --> 25:24.060
And it's going to be a simple function, but I still want it to be a function anyway, and it's going

25:24.060 --> 25:26.340
to do what this was doing.

25:26.520 --> 25:27.690
So copy that.

25:27.690 --> 25:33.270
Go back to or damage gameplay ability and paste it only instead of.

25:33.900 --> 25:34.620
Damage.

25:34.650 --> 25:35.250
Fire.

25:35.280 --> 25:37.920
We're going to pass in the damage type here.

25:39.110 --> 25:45.680
And we're going to get the value at N level and we should also do a check.

25:48.170 --> 25:52.880
And make sure that damage types contains.

25:53.430 --> 25:54.870
The damage type.

25:55.770 --> 26:00.660
And if it doesn't, I want a specific message in our crash log.

26:00.660 --> 26:13.680
I want it to say percent s Actually, we'll say gameplay ability percent s does not contain damage type.

26:14.960 --> 26:28.940
Percent s and we'll have get name safe and pass in this and we'll have damage type dot to string and

26:28.970 --> 26:36.860
of course get name safe needs to have the asterisk on it because this is percent s let's be pretty and

26:36.860 --> 26:44.180
put some square brackets around these percent S's and to string this here needs an asterisk too.

26:44.660 --> 26:45.770
Okay.

26:46.370 --> 26:50.690
So we perform a check and then we can return this.

26:52.770 --> 26:57.870
We're getting damage types at damage type, getting the value at the level and returning it.

26:57.870 --> 27:04.800
So now we have get damage by damage type and we can use this an aura firebolt here.

27:05.990 --> 27:19.670
Get damage by damage type passing in level and or a gameplay tags get dot damage fire boom and we can

27:19.670 --> 27:23.870
take this line and replace it where we're getting damage down here.

27:24.590 --> 27:27.560
And with that we can test all these changes.

27:27.560 --> 27:34.250
So let's first of all see if we get a compiler error or not and then play test.

27:35.870 --> 27:37.730
Okay, I'm going to open.

27:37.730 --> 27:39.410
We don't need that cost.

27:39.440 --> 27:42.530
Let's go ahead and just test out what we get.

27:42.560 --> 27:45.980
Okay, so we have firebolt level one Manacost.

27:46.070 --> 27:48.770
Oh, we forgot about the negative cooldown.

27:48.770 --> 27:53.870
And I don't have I don't know why I put the slash n in there.

27:53.870 --> 27:58.520
Maybe I'm just being hasty here, but cooldown.

27:58.520 --> 28:00.710
It should be one of our styles.

28:06.770 --> 28:07.520
It is.

28:07.520 --> 28:10.730
So it's because of that slash in that shouldn't be there.

28:10.730 --> 28:11.690
So two things.

28:11.690 --> 28:16.250
I'm going to make sure that this is never negative and that our cooldown works.

28:16.640 --> 28:20.780
And then notice that our text is above our border there.

28:20.780 --> 28:21.590
We'll fix that too.

28:21.590 --> 28:28.370
But let's go ahead and fix the manacost and make sure that it's never negative.

28:28.370 --> 28:35.840
So we'll say F math abs, abs will get us some sick swole AB muscles.

28:35.840 --> 28:44.060
No, it'll give us the absolute value and we'll put that down here for manacost down on this one.

28:44.060 --> 28:47.750
But we do need to fix our typo for cooldown.

28:47.750 --> 28:55.880
We have cooldown and this should just have a slash, not a slash n And we made the mistake.

28:55.880 --> 28:57.920
We I say we made the mistake.

28:58.160 --> 29:00.620
I'm shifting the blame onto you now.

29:00.620 --> 29:01.850
It's my mistake.

29:01.850 --> 29:04.460
And let's see if we have it down here.

29:04.460 --> 29:04.940
We do.

29:04.940 --> 29:09.240
So we don't want slash n, we just want slash there.

29:09.570 --> 29:11.040
And I left it in there.

29:11.040 --> 29:12.030
Look at what I did.

29:14.190 --> 29:17.130
Okay, Let's see if that fixes it.

29:17.750 --> 29:20.990
And if we have a positive manacost.

29:22.800 --> 29:23.940
All right.

29:23.940 --> 29:26.490
And pressing play.

29:27.670 --> 29:28.630
There we go.

29:28.900 --> 29:30.370
Everything looks good.

29:30.370 --> 29:31.900
We have level one Manacost.

29:31.930 --> 29:33.360
2.5.

29:33.370 --> 29:38.430
Next level should be 12.5 cooldown, 0.5 launches a bolt of fire.

29:38.440 --> 29:40.150
Does nine damage fire.

29:40.150 --> 29:41.740
Bolt down here.

29:41.770 --> 29:43.810
Looks like it should say next level.

29:43.810 --> 29:44.710
Okay, we'll get that.

29:44.710 --> 29:47.800
But level two Manacost 12.5 looks good.

29:47.800 --> 29:51.010
Launches two bolts of fire dealing 17 damage.

29:51.010 --> 29:51.690
It looks good.

29:51.700 --> 29:53.110
All right, let's level up.

29:55.060 --> 29:56.710
And we'll spend a point.

29:56.740 --> 29:59.410
Now we see those values updated.

29:59.440 --> 30:01.180
Looks great.

30:03.160 --> 30:05.980
And next level is level three Manacost 25.

30:06.010 --> 30:07.630
The cooldown doesn't change for this one.

30:07.630 --> 30:10.570
It's constant, but we can see the damage.

30:10.600 --> 30:11.500
Excellent.

30:12.930 --> 30:13.560
Okay.

30:13.560 --> 30:16.620
Now, I'm not going to close the editor to make this next fix.

30:16.620 --> 30:18.690
We'll just get it next time we compile.

30:18.810 --> 30:26.670
But for the next level description, I wanted this to say next level, not firebolt and that comes from

30:26.670 --> 30:29.070
a copy paste laziness.

30:29.070 --> 30:30.710
We call that copypasta.

30:30.720 --> 30:32.610
We'll say next level.

30:33.540 --> 30:36.450
Do we want colon or No colon.

30:36.450 --> 30:37.260
Colon.

30:37.260 --> 30:38.220
No, colon.

30:38.700 --> 30:39.810
I want the colon.

30:40.380 --> 30:40.740
All right.

30:40.740 --> 30:43.170
So next time we compile, we'll get that.

30:43.170 --> 30:44.610
That's not a big deal.

30:44.700 --> 30:51.600
But before wrapping up, the last thing I'd like to take care of are these letters being on top of the

30:51.600 --> 30:52.080
border.

30:52.080 --> 30:53.730
I'd like them to be below.

30:53.730 --> 30:54.870
Behind the border.

30:55.460 --> 31:01.040
Now, if we put them behind the border, then this little scroll bar is going to be barely clickable,

31:01.040 --> 31:02.210
if at all.

31:02.210 --> 31:04.910
So we're going to need to put some padding on the right.

31:04.940 --> 31:06.260
Let's do that now.

31:06.260 --> 31:08.630
I'm going to open up my spell menu.

31:11.020 --> 31:13.930
And we'll get our scroll box.

31:13.930 --> 31:18.040
By the way, this doesn't need default text anymore.

31:18.250 --> 31:19.870
That was pretty ugly.

31:20.020 --> 31:25.990
So the scroll box itself can get some padding on the right, and whatever I do to the top one, I'm

31:25.990 --> 31:27.660
going to do to the bottom one.

31:27.670 --> 31:30.100
So let's get some padding on the right.

31:30.100 --> 31:32.200
I'm going to try about 12.

31:32.680 --> 31:34.180
That should do.

31:34.180 --> 31:35.100
Okay.

31:35.110 --> 31:39.250
And our border image can go on top of the scroll box.

31:39.250 --> 31:43.480
In other words, my scroll box can be put in between the two images.

31:43.480 --> 31:45.370
I'm going to do that for both of them.

31:46.350 --> 31:49.140
So now the scroll box is behind the border.

31:49.140 --> 31:53.700
But notice that we get a very interesting problem when that happens.

31:54.090 --> 31:56.010
We now can't scroll.

31:57.310 --> 32:00.640
And that's because this image is in the way.

32:00.850 --> 32:09.910
And to fix that, we take the image and take its visibility down here and change it to non-hit testable.

32:10.000 --> 32:12.370
Now, self in all children doesn't matter.

32:12.370 --> 32:13.600
It doesn't have any children.

32:13.600 --> 32:17.440
But we can just use self only and we'll do it for both of these.

32:17.440 --> 32:24.370
So this one too, we're going to take that border and we're going to make it non-hit testable.

32:24.640 --> 32:29.170
And then we should be able to still click and use that scroll box.

32:29.410 --> 32:30.730
And we can.

32:30.850 --> 32:38.260
And notice now that the border is covering up the text so the text isn't on top of it anymore.

32:38.260 --> 32:39.790
And that's what I wanted.

32:40.240 --> 32:41.200
Okay.

32:41.830 --> 32:44.530
So it's looking pretty nice.

32:44.680 --> 32:53.170
And just for grins, I'm going to level up and level up the ability and admire the nice work that we've

32:53.170 --> 32:54.220
accomplished.

32:55.050 --> 32:57.600
Everything is looking really, really good.

32:58.150 --> 33:00.490
And with that we have descriptions.

33:00.490 --> 33:07.180
And the only thing we need to do when we create new gameplay abilities is override their description

33:07.180 --> 33:08.050
functions.

33:08.050 --> 33:15.460
And if we just copy and paste this nice formula here with the multiple lines and we have these nice

33:15.460 --> 33:18.940
functions to get this info, it's going to be pretty easy.

33:18.940 --> 33:22.180
All we have to do is just kind of change the description a little bit.

33:22.180 --> 33:26.800
The rest of this stuff can basically remain the same and less.

33:26.800 --> 33:32.410
The gameplay ability is drastically different, but we'll cross that bridge when we get there.

33:32.680 --> 33:34.480
All right, So excellent job.

33:34.480 --> 33:39.130
I'm going to compile and we're going to continue in the next video.

33:39.160 --> 33:40.450
I'll see you soon.
