In developing Manifest, I strive to create fun, interesting abilities that support turn-based tactics. "Support" isn't specific enough a term, actually; what I want is to motivate turn-based tactics, to motivate movement. Supporting your design isn't good enough. You need to go a step further and energize your design, breathe life into your design philosophy to create that magical feeling only the best of games evoke.
Two abilities I've created for Manifest to facilitate my design pillar of movement are Shield Bash and Typhoon. Both abilities force units to move from their present position. But I'm seeking a unique, diverse ability palette; I want each ability to have its own style and effect. While Shield Bash and Typhoon both force units to move, each offers its own means of tactical influence.
Let's start with Shield Bash, since its the more straightforward of the two. Using Shield Bash, the Archlegionnaire pushes a single ally or enemy unit away from him. Both the cast range and the push range increase as Shield Bash levels up. Check out the video (recorded with WeGame).
The ability can have its uses, as you might imagine (especially when I finally get around to explaining the gameplay objective). Pushing away a really slow melee unit, like the Quetzal (Ancient of the Wind), is extremely useful, as he may be too far to actually reach his target the following turn. The code for Shield Bash was fun to write. Shield Bash forces the targeted unit to turn 180 degrees away from the Archlegionnaire, and to jump to a set distance in line with the Archlegionnaire and the unit. Take a look.
Shield Bash
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Shield Bash
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Shield Bash for (Casting unit)) Equal to 1
Then - Actions
Unit - Make (Target unit of ability being cast) face (Angle from (Position of (Casting unit)) to (Position of (Target unit of ability being cast))) over 0.00 seconds
Unit - Move (Target unit of ability being cast) instantly to ((Position of (Target unit of ability being cast)) offset by 400.00 towards (Angle from (Position of (Casting unit)) to (Position of (Target unit of ability being cast))) degrees)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Shield Bash for (Casting unit)) Equal to 2
Then - Actions
Unit - Make (Target unit of ability being cast) face (Angle from (Position of (Casting unit)) to (Position of (Target unit of ability being cast))) over 0.00 seconds
Unit - Move (Target unit of ability being cast) instantly to ((Position of (Target unit of ability being cast)) offset by 500.00 towards (Angle from (Position of (Casting unit)) to (Position of (Target unit of ability being cast))) degrees)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Shield Bash for (Casting unit)) Equal to 3
Then - Actions
Unit - Make (Target unit of ability being cast) face (Angle from (Position of (Casting unit)) to (Position of (Target unit of ability being cast))) over 0.00 seconds
Unit - Move (Target unit of ability being cast) instantly to ((Position of (Target unit of ability being cast)) offset by 600.00 towards (Angle from (Position of (Casting unit)) to (Position of (Target unit of ability being cast))) degrees)
Else - Actions
Do nothing
The code first checks the level of Shield Bash, then forces the targeted unit to turn and move.
The Tempest's Typhoon, contrarily, pulls in random nearby enemy units towards the Tempest. The range of effect and number of units pulled increases as the ability is leveled. Nifty video time!
Fun stuff. I tried to make Shield Bash and Typhoon thematically interesting, in addition to tactically useful, hence the Shield Bash effect of the Archlegionnaire's ability and the tornado effect of Typhoon. Typhoon's coding works by randomly selecting a nearby enemy unit, attaching the tornado affect to the unit, and jumping that unit to the Tempest. For level 2 and level 3 versions of Typhoon, I simply run the code through a loop, which has a nice staggering effect of grabbing the units. Check out the Typhoon trigger code.
Typhoon Pull
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Typhoon [Roar]
Actions
Set TornadoTarget = No unit
Unit Group - Remove all units from TornadoAreaGroup
Unit Group - Remove all units from TornadoUnitGroup
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Typhoon [Roar] for (Casting unit)) Equal to 1
Then - Actions
Set TornadoAreaGroup = (Units within 400.00 of (Position of (Casting unit)) matching (((Owner of (Matching unit)) Not equal to (Owner of (Casting unit))) and ((Owner of (Matching unit)) Not equal to Neutral Passive)))
Set TornadoTarget = (Random unit from TornadoAreaGroup)
Special Effect - Create a special effect attached to the origin of TornadoTarget using Abilities\Spells\Other\Tornado\TornadoElementalSmall.mdl
Special Effect - Destroy (Last created special effect)
Unit - Make TornadoTarget face (Casting unit) over 1.00 seconds
Wait 1.50 seconds
Unit - Move TornadoTarget instantly to ((Position of (Casting unit)) offset by 50.00 towards 0.00 degrees)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Typhoon [Roar] for (Casting unit)) Equal to 2
Then - Actions
Set TornadoAreaGroup = (Units within 500.00 of (Position of (Casting unit)) matching (((Owner of (Matching unit)) Not equal to (Owner of (Casting unit))) and ((Owner of (Matching unit)) Not equal to Neutral Passive)))
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
Set TornadoTarget = (Random unit from TornadoAreaGroup)
Special Effect - Create a special effect attached to the origin of TornadoTarget using Abilities\Spells\Other\Tornado\TornadoElementalSmall.mdl
Special Effect - Destroy (Last created special effect)
Unit - Make TornadoTarget face (Casting unit) over 1.00 seconds
Wait 1.50 seconds
Unit - Move TornadoTarget instantly to ((Position of (Casting unit)) offset by 50.00 towards 0.00 degrees)
Unit Group - Remove TornadoTarget from TornadoAreaGroup
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Typhoon [Roar] for (Casting unit)) Equal to 3
Then - Actions
Set TornadoAreaGroup = (Units within 600.00 of (Position of (Casting unit)) matching (((Owner of (Matching unit)) Not equal to (Owner of (Casting unit))) and ((Owner of (Matching unit)) Not equal to Neutral Passive)))
For each (Integer A) from 1 to 3, do (Actions)
Loop - Actions
Set TornadoTarget = (Random unit from TornadoAreaGroup)
Special Effect - Create a special effect attached to the origin of TornadoTarget using Abilities\Spells\Other\Tornado\TornadoElementalSmall.mdl
Special Effect - Destroy (Last created special effect)
Unit - Make TornadoTarget face (Casting unit) over 1.00 seconds
Wait 1.50 seconds
Unit - Move TornadoTarget instantly to ((Position of (Casting unit)) offset by 50.00 towards 0.00 degrees)
Unit Group - Remove TornadoTarget from TornadoAreaGroup
Else - Actions
Do nothing
Set TornadoTarget = No unit
If your wondering, I destroy the tornado special effect as soon as its created because it takes exactly that long for the special effect to actually disappear (it's not instant).
Typhoon and Shield Bash two very fun abilities to design and implement. And more importantly, they're wicked fun to play with.
Dont use wait in triggers! The spells are leaking alot (locations, groups)!
Use Loops because it's weird that the units are instantly moved to the location of the caster