bdickason/stormsword — pull request #40 by bdickason (2014-08-01 20:37:49+00:00)
Title: Give characters the ability to Charge

This branch grew a bit larger than expected because I didn't have solid internet for a few days.

* Adds a new ability slot with a new ability: **Charge**
* Characters can equip multiple abilities and each has its own icon that displays properly
* Refactored the relationship between Abilities and AbilitySlot to remove one level of abstraction. Abilities now exist as a transform on the AbilitySlot. This could allow you to easily equip/unequip different abilities on the fly (in the near future). It also makes it much easier to create an ability from a code-perspective.
* Created a base 'AbilityScript' class that all abilities extend so you have to write much less code to start an ability.

Here's the basic idea behind the current architecture:
* AbilitySlot - Has a cooldown and checks if the ability can be used. The ability equipped is a transform that is instantiated when the ability can be 'cast.' Also has the UIscript to display the ability in that slot.
* Ability - Ability is a prefab that contains an AbilityScript which has a virtual function `UseAbility(GameObject character)`which is overridden by each ability that is created. For example, this could be used to adjust the player's movespeed for a Charge. Ability can (optionally) have a Rigidbody2D which triggers a SpellEffect transform when it meets a character.
* SpellEffect - This could be a DoT, a Snare, a Knockback, a Stun, etc.