Author: yoshavandaele

Abilities

A big part of our unit and item identity will be defined by their abilities. Most importantly in the current design our “Specialist” units will each have three. To address the need of a large amount of abilities I have tried to implement them in a flexible and expandable way.

Subclass Sandbox

I based my approach on a design pattern where a subclass implements most of its behavior with functionality provided by the base class. This patternĀ is called subclass sandbox. In our case the base class provides several functions to apply stat-altering effects to units in different ways (target unit, target area, units in an area,… ). The effects provide the unit with the correct information on how to alter its stats and what particle effects to spawn, each unit handles its own effects.

The base class has an Activate() method, the subclass overrides this one to implement its behavior with base class operations. More specific functionality needs to be coded inside the subclass. Because we’re using Unreal Engine, the Activate() is an event to be used in subclass blueprint. The base class also has Select() and Deselect() functions to be called by the player to toggle the correct ability casting feedback such as a cursor change or decal to indicate the affected area.

 

ApplyEffectToUnitsInArea.PNG

BlueprintCallable function to apply effects to units in an area

DecalGreysOut.gif

This decal is enabled on ability selection. It indicates affected area and becomes grey when out of casting range

AOEEffecTToUnits.gif

Healing effect applied to units in area

TargetedDot.gif

Apply damage over time on target

PBAOE_Heal.gif

Point blank area of effect healing

PassiveSwap.gif

Point blank area of effect that can be swapped for a different one

Advertisements