WEBVTT

00:06.890 --> 00:08.150
Welcome back.

00:08.150 --> 00:14.900
Now we have our ability types which now contains an effect context that's been souped up.

00:14.900 --> 00:17.810
It's a great deal better new and improved.

00:17.810 --> 00:23.510
And now we're going to use it well we're already kind of using it but not really.

00:23.540 --> 00:31.160
You see we're not using it with our new capabilities, these new variables I'd like to set those.

00:31.250 --> 00:32.840
So where are we going to do that.

00:32.840 --> 00:35.600
Well if we go back to our exec calc.

00:36.340 --> 00:38.080
Notice we left a to do there.

00:38.080 --> 00:44.620
Let's go to exit calc damage cpp and we'll scroll until we find.

00:45.350 --> 00:47.330
Determine debuff.

00:47.360 --> 00:53.810
We have this function that determines whether we got a debuff and we have that information in be debuff.

00:53.810 --> 00:55.010
But here's our to do.

00:55.040 --> 00:57.110
What do we do.

00:57.530 --> 01:01.760
Well we'd like to set some parameters on our effect context right.

01:01.910 --> 01:04.880
So how can we get that effect context.

01:04.910 --> 01:06.770
Well we have the spec here.

01:07.040 --> 01:08.720
It's called spec.

01:08.750 --> 01:16.940
Why don't we take that spec and just call get context that returns an gameplay effect context handle.

01:17.270 --> 01:20.930
So we can store that in gameplay effect.

01:21.620 --> 01:23.150
Context handle.

01:23.540 --> 01:25.520
We'll call it context handle.

01:27.050 --> 01:34.970
So now that we have the context we can call functions like you or ability system library is successful

01:34.970 --> 01:35.850
debuff.

01:35.870 --> 01:38.690
Well we also want a setter.

01:38.840 --> 01:42.160
And I'm remembering now I just made the getters.

01:42.170 --> 01:45.860
I didn't make the setter functions for these new variables.

01:45.860 --> 01:51.050
So I'm really going to have to go back and do what I forgot to do the first time when we made these

01:51.050 --> 01:53.390
getters, we should have made the setters.

01:53.390 --> 01:54.780
You probably did.

01:54.800 --> 01:59.170
So right down here under set is blocked hit.

01:59.180 --> 02:01.340
I'm going to go ahead and make a setter.

02:01.340 --> 02:07.460
I'll make it under set as critical hit and this will be for set is successful debuff.

02:09.680 --> 02:13.520
So set is successful debuff.

02:14.150 --> 02:20.210
And just like the other setters, we're going to have an gameplay effect context handle as an input,

02:20.210 --> 02:27.980
but it's a reference, a non-const reference, and the new param ref allows us to put that as an input

02:27.980 --> 02:31.520
parameter in this blueprint callable node.

02:31.550 --> 02:39.020
Otherwise, Unreal Engine makes Non-const references out parameters in nodes, so the boolean will be

02:39.020 --> 02:40.400
called be in.

02:40.550 --> 02:42.350
We'll just say successful.

02:44.180 --> 02:44.810
Debuff.

02:47.090 --> 02:51.770
And we'll have other functions for setting the other parameters.

02:51.920 --> 02:59.210
So I'm going to go ahead and just make the definition here for set is successful debuff.

02:59.760 --> 03:03.660
And this is going to be similar to the other centers that we have.

03:03.720 --> 03:05.610
Like set is critical hit.

03:05.640 --> 03:07.470
I'm going to copy the contents of that.

03:07.470 --> 03:08.430
Paste it here.

03:08.460 --> 03:14.250
The difference is we're calling set is successful debuff on the effect context.

03:14.250 --> 03:21.030
So we'll say set is successful debuff and pass in be in is successful debuff.

03:21.510 --> 03:25.650
And now that this function exists our exec calc can call it.

03:25.650 --> 03:35.970
So we can take your ability system library call set is successful debuff and pass in the context handle

03:37.530 --> 03:38.700
and then pass in.

03:38.700 --> 03:42.630
True because we know that it is a successful debuff.

03:42.720 --> 03:47.790
So we're going to follow this pattern for the other key variables for debuff.

03:47.790 --> 03:54.510
So we'll take Aura Ability System Library take set as successful debuff and make the functions for setting

03:54.540 --> 04:00.330
debuff damage, debuff duration, debuff frequency and damage type.

04:00.780 --> 04:06.480
So I'm going to go ahead and time lapse the creation of at least the three floats.

04:06.480 --> 04:09.600
And then we'll talk about the gameplay tag damage type.

04:45.520 --> 04:50.200
Okay, so pretty simple just setting floats instead of booleans.

04:50.200 --> 04:52.270
But same principle here.

04:52.300 --> 04:58.320
Now for the gameplay tag I want a function that can receive a gameplay tag.

04:58.330 --> 05:03.910
So it's going to be a static void function called Set damage type.

05:04.840 --> 05:11.890
It's going to take a u param passing in ref here, and that's for the context handle.

05:13.170 --> 05:15.330
So we'll put that there.

05:15.330 --> 05:23.820
But then I'd like to pass in a const f gameplay tag reference called n damage type.

05:24.240 --> 05:26.160
So let's see how we'll handle this one.

05:26.160 --> 05:29.580
Let's go ahead and generate the definition.

05:29.580 --> 05:33.450
I'm going to copy the contents of set debuff frequency.

05:33.570 --> 05:38.550
And once we get inside here where we have aura effect context.

05:38.940 --> 05:43.740
If we type set damage type we don't have the function for it.

05:43.800 --> 05:46.260
So let's take a look at aura ability types.

05:46.260 --> 05:50.220
You might have handled this, but I didn't add a setter for it.

05:50.250 --> 05:54.180
So I'm going to make a void function here called set damage type.

05:55.050 --> 05:59.700
That takes in a shared pointer of type gameplay tag.

05:59.700 --> 06:10.980
So f gameplay tag called in damage type and we'll simply set damage type to end damage type.

06:12.740 --> 06:18.890
And now that we have this function in our ability system blueprint library, we're going to call set

06:18.890 --> 06:19.970
damage type.

06:21.680 --> 06:24.740
And what are we going to pass in to set damage type?

06:24.830 --> 06:26.960
It needs to be a shared pointer.

06:26.990 --> 06:28.400
Well, we can make one.

06:28.400 --> 06:36.440
We can make one from the in damage type we can say t shared pointer using F gameplay tag.

06:37.770 --> 06:44.100
I'll just call this damage type and we can use make shared not make shareable.

06:44.130 --> 06:47.220
Make shared which requires the type.

06:47.220 --> 06:51.900
So gameplay tag and we can initialize it within damage type.

06:52.590 --> 06:56.580
So this will make a new shared pointer that we can pass in right here.

06:57.240 --> 07:04.380
So now we have a function that can take in the damage tag, and we can pass it right in to set damage

07:04.380 --> 07:04.780
type.

07:04.800 --> 07:07.770
This can even be a const shared pointer.

07:08.070 --> 07:16.200
So now that we have this we can go back and use our aura ability system library function or a ability

07:16.200 --> 07:17.430
system library.

07:17.460 --> 07:24.570
Set damage type passing in the context handle and damage type which we have access to here.

07:24.840 --> 07:29.340
Now in addition to those we want to set those three float values.

07:29.580 --> 07:31.110
So we got the setters.

07:31.110 --> 07:32.610
Set debuff damage.

07:32.610 --> 07:33.900
Set debuff duration.

07:33.900 --> 07:35.520
Set debuff frequency.

07:35.550 --> 07:37.680
We need to pass those in.

07:37.680 --> 07:39.150
But where are those.

07:39.180 --> 07:41.340
Well if you'll recall we set those.

07:41.340 --> 07:45.370
We set them as tag set by caller magnitudes.

07:45.390 --> 07:48.480
We did that in Aura Ability system library.

07:49.480 --> 07:51.070
If we scroll all the way down.

07:51.070 --> 07:52.970
At least mine's all the way at the bottom.

07:52.990 --> 08:00.760
We assign tags set by color magnitude for all the debuff things in the spec handle here, so we can

08:00.760 --> 08:04.630
actually get set by color magnitudes from the spec.

08:04.750 --> 08:07.270
And that's what I'm going to do here.

08:08.570 --> 08:13.400
I'm going to take this back and call get set by color magnitude.

08:13.700 --> 08:19.100
Now we can pass in the game play tag and I need the game play tag.

08:19.640 --> 08:22.100
Game play tags dot.

08:22.100 --> 08:23.870
And it's going to be debuff.

08:23.900 --> 08:27.050
We have damage duration and frequency.

08:27.080 --> 08:28.850
We need to set those three.

08:29.510 --> 08:30.950
So we're going to get those three.

08:30.950 --> 08:36.860
I'm going to make a const float called Debuff Damage.

08:37.820 --> 08:40.640
And we'll pass in the gameplay tag.

08:40.640 --> 08:45.050
Debuff damage I don't want to warn if not found.

08:45.050 --> 08:46.790
So I'm passing in false for that.

08:46.790 --> 08:51.650
And the default if not found can be negative one point f.

08:52.730 --> 08:54.470
So I have debuff damage.

08:54.470 --> 08:56.030
I need duration and frequency.

08:56.030 --> 08:59.300
So const float debuff duration.

09:00.860 --> 09:09.080
And I'm just going to copy the function call paste it here, change that tag to debuff duration.

09:10.260 --> 09:12.750
And I'll just copy the whole thing.

09:13.640 --> 09:21.440
And paste it and this one will be debuff frequency and the tag will be debuff frequency.

09:22.070 --> 09:26.930
Now that we have those three values now we can set them on the effect context.

09:26.930 --> 09:35.780
So we're going to say you or a ability system library set debuff damage passing in the context handle

09:35.780 --> 09:37.250
and debuff damage.

09:37.250 --> 09:44.570
And we'll also call the other two functions set Debuff duration.

09:46.070 --> 09:51.650
We'll pass in context Handle and debuff Duration and frequency.

09:52.820 --> 09:59.750
So set Debuff frequency passing in the handle and debuff frequency.

10:01.370 --> 10:04.300
So that's what we do to do.

10:04.310 --> 10:05.260
That's what we do.

10:05.270 --> 10:07.310
So we fixed our to do.

10:07.340 --> 10:08.630
We've done it.

10:08.630 --> 10:15.350
And now this effect context handle associated with this gameplay effect is carrying this information

10:15.350 --> 10:16.100
through.

10:16.100 --> 10:22.640
And we can get it by the time we get all the way back into our attribute set.

10:22.760 --> 10:30.260
So I'm going to go into the attribute set or attribute set and we can handle debuff.

10:30.350 --> 10:36.200
So right here when we're getting our incoming we'll go to the incoming damage attribute.

10:37.120 --> 10:40.970
We're doing lots of things, including show floating text, right?

10:40.990 --> 10:42.400
We can also handle debuffs.

10:42.400 --> 10:44.890
We can check the effect context.

10:44.920 --> 10:51.220
We can say if and we can call you or ability system library is successful.

10:51.250 --> 10:55.360
Debuff passing in props dot effect context handle.

10:55.390 --> 11:01.120
Because we have that then we can say handle debuff.

11:02.140 --> 11:08.080
And with that I'd like to make a function because this is getting out of hand as well.

11:08.080 --> 11:09.910
So actually look around.

11:09.910 --> 11:11.100
This place is filthy.

11:11.110 --> 11:13.300
Let's clean it up right.

11:13.390 --> 11:15.310
Handling health and mana.

11:15.310 --> 11:20.770
We're only doing one thing each, but handling the incoming damage.

11:20.770 --> 11:23.140
We're doing kind of a lot of stuff.

11:23.140 --> 11:26.710
This is something that could be its own function.

11:26.710 --> 11:35.980
So what I'd like to do is handle incoming damage in its own function and handle incoming exp in its

11:35.980 --> 11:37.060
own function.

11:37.060 --> 11:40.630
So I'm going to close all but this.

11:41.580 --> 11:41.880
Oops.

11:41.880 --> 11:42.870
I closed all tabs.

11:42.870 --> 11:43.770
That's okay.

11:43.920 --> 11:48.600
Go back to the aura attribute set and open the H file.

11:48.600 --> 11:52.380
Scroll all the way down and I'm going to have a couple more functions here.

11:52.410 --> 11:53.910
I'll put them in the private section.

11:53.910 --> 11:55.530
They're internal to this class.

11:55.530 --> 12:01.080
And I'm going to call this first one handle incoming damage.

12:01.080 --> 12:05.670
And this can just take a const f effect properties reference called props.

12:05.850 --> 12:08.250
All the information I need is in props.

12:08.250 --> 12:14.640
I'm also going to make a void handle incoming exp that takes the same input.

12:14.670 --> 12:15.810
Props.

12:17.270 --> 12:20.780
So I can go ahead and generate two function definitions.

12:22.090 --> 12:23.230
Here they are.

12:24.280 --> 12:30.370
And I'm going to cut and paste them so that they're closer to post gameplay effect execute.

12:30.370 --> 12:31.840
So I'm going to search for post.

12:32.640 --> 12:33.510
Here it is.

12:33.510 --> 12:35.520
I'm going to put them right under it.

12:38.540 --> 12:40.670
Now handle incoming damage.

12:41.030 --> 12:44.720
That's going to be these lines of code here.

12:47.380 --> 12:49.120
So I'm going to paste them in here.

12:49.570 --> 12:53.260
Now we shouldn't have to change anything because we're calling it props.

12:53.530 --> 12:57.160
And we can replace those lines of code.

12:57.780 --> 12:59.010
By calling.

12:59.850 --> 13:01.560
Handle incoming damage.

13:01.560 --> 13:02.820
Passing in props.

13:04.340 --> 13:05.870
Handle incoming XP.

13:06.770 --> 13:14.930
I could be even more Uber and Control X instead of control C, control V and paste it in to handle incoming

13:14.930 --> 13:19.610
XP, and I can call handle incoming XP passing in.

13:19.790 --> 13:21.530
You guessed it props.

13:22.160 --> 13:29.450
So post gameplay effect execute looks better, and we're handling incoming damage in XP in these functions,

13:29.450 --> 13:32.030
which are more isolated now.

13:32.630 --> 13:39.290
So when we handle incoming damage, if we got a successful debuff, I want to handle the debuff.

13:39.290 --> 13:42.200
So I want a debuff function.

13:42.200 --> 13:45.520
And I'd like that function to take some props as well.

13:45.530 --> 13:54.410
So I'm going to go in to the private section make void debuff which takes in some props.

13:55.560 --> 13:58.770
And it's going to handle what we do when we debuff.

13:58.800 --> 14:00.540
So we're getting closer.

14:00.570 --> 14:02.700
Ryder gave me an inline definition.

14:02.730 --> 14:04.980
Thanks, Ryder for nothing.

14:05.070 --> 14:08.820
I'm going to put it back in the cpp file where I want it.

14:09.520 --> 14:12.700
And I'm going to call debuff right here.

14:14.320 --> 14:16.750
Passing in props.

14:16.780 --> 14:18.160
Debuff handled.

14:18.160 --> 14:19.840
Actually, no, it's not because it's an empty.

14:19.870 --> 14:20.470
Function.

14:20.470 --> 14:22.900
But now we're ready to.

14:22.930 --> 14:24.160
Handle it right.

14:24.160 --> 14:26.170
We're ready to handle debuffs.

14:26.170 --> 14:28.540
And that's going to be the next thing we do.

14:28.570 --> 14:32.290
Now I want you to start thinking about how we're going to handle debuffs.

14:32.290 --> 14:33.670
What exactly are we going to do?

14:33.700 --> 14:35.470
How are we going to handle debuffs?

14:35.470 --> 14:37.120
What are debuffs?

14:37.150 --> 14:42.970
Well, I know that when I cause fire damage, I want to burn my enemies.

14:42.970 --> 14:48.820
I want them to take fire damage every second for a duration, right?

14:48.820 --> 14:52.270
Every debuff frequency until we're done.

14:52.270 --> 14:56.320
So I want to apply a gameplay effect is what I'm trying to say.

14:56.440 --> 14:57.970
So think about it.

14:57.970 --> 15:01.960
How can we apply a gameplay effect from right here in this line of code?

15:01.960 --> 15:07.690
Well, don't go and implement it just yet, because the way we're going to do this is different than

15:07.690 --> 15:09.640
anything else we've done so far.

15:09.640 --> 15:13.990
And you'll find out in the next video of this course.

15:13.990 --> 15:15.940
So I'll see you then.
