Spell System using Unity ScriptableObjects, Part 2 – The Action System

Welcome to part 2 of our 2(?) part series on the Spell & Ability creation system in Heal Plz. If you missed part one, you can read it here. Once again, while this was mostly written with other Unity developers in mind, it’s also a chance to get a glimpse into what is possible with our system if you’re interested in the actual game.

The Action System

This is where the magic happen. (Haw haw.) The Action List is made up of a series of actions that are executed in order. An ability can consist of a single Modify Health action to create a simple no-frills direct heal spell, or a more complex attack that deals melee damage, leaves a damage over time effect on the victim, and interrupts spellcasting:

Action Types

Each individual Action consists of several dropdowns. The first is the type of Action to take.

Modify Health- Change the target’s health pool. Can be positive or negative, and the system automatically recognizes it as hostile or friendly. Treated as a Magic source, so it’s increased by the Spell Power stat, but it’s smart enough to not apply Spell Resist to heals. Well, it is now, at least.

Melee Damage- The main difference here is that it’s reduced by Armor, and that the Value is a multiplier of the attacker’s Melee damage. So if a base auto-attack is 30, a Melee Damage Action with a value of 1.5 will deal 45 base damage.

Apply Effect- Buffs, Debuffs, Damage and Heal Over Time, and Status Effects are all applied through here. Effects probably need their own blog post, because that’s another major system with a similar system of their own.

Ground Effect- This is the “Fire” in “Don’t stand in the fire.” Basically creates an area that can deal damage, apply affects, or basically anything else our Spell system is capable of.

Interrupt- If the target is casting a spell, now they’re not.

Modify Resource- Like Modify Health, but for Resource Pools. Mana drains, burns, and infusions, all possible here.

Dispel- Remove a Hostile effect from a friendly, or a beneficial Effect from an enemy. I’m sure you’re noticing a trend, but it’s its own special system, too. Each Effect has a Dispel Resist stat, and each Dispel Action has Dispel Power. This means that an Effect with a Dispel Resist of 3 would either need three casts from a Dispel Power 1 spell, or one cast from a Dispel Power 3 spell. Yes, that also means that a Dispel Power 3 spell could dispel three separate 1 Spell Resist Effects in a single cast!

Aggro- Modify’s an enemy’s threat table. A Tank might have abilities that have a positive value, whereas the Rogue might have attacks that reduce her aggro.

Wait- It’s exactly what it sounds like. Allows you to temporarily pause execution of the spell. 

Custom- We figured we wouldn’t want this dropdown cluttered with every little one-off Action, so if we want an Action that turns the enemy purple, we write some custom code and plug it in here.

Resurrect- Does what it says, but this probably should have been a Custom action.

Summon- Creates a temporary guardian for the caster! Just drag in the character you want to summon and go!

Teleport- Teleports the caster. You can choose between teleporting “On Target” which is great for teleporting to the cursor, To Target which lands you right in front of them, Behind Target which places you behind where the target is facing, or Through Target, which places you on the opposite side of them relative to where you started.

Action Modifiers

The next drop-down allows us to change the way an Action is targeted.

  • Single only affects the selected target.
  • Area of Effect allows the Action to affect everything in a certain radius, and a second drop-down allows it to be restricted to Enemies, Friendlies, or either. It can also be centered on the caster, or on the target.
  • Cone has all the same functionality as AOE, but allows an angle to be specified.

The Single modifier also includes a Target Override option. By default, an ability is used on whatever the player/NPC/enemy’s spell target is. But maybe we want a melee attack to also heal the attacker, vampire stylez? Then we can add a Modify Health action with the Self target Override.

Or maybe we want a heal spell that heals the target for a large amount, and two extra random targets for smaller amounts? Random Ally will get the job done.

Tune in next time…

As you can see, the Action List enables all sorts of interesting behaviors and interactions. In the conclusion (I hope) to this series, I’ll talk about the Value Calculation system and the Conditional system. These systems are what take the Spell Action system from simply being “powerful” and make it “kinda confusing.”

As always, we’re happy to answer questions on Twitter.

Heal Plz is an MMO-inspired dungeon crawling RPG where you play as the healer of an AI-controlled group. Wishlist on Steam and follow us on Twitter for development updates!

Share This!

Share on reddit
Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp

Leave a Reply

Close Menu