Data/Abilities/Battery

## Battery

### Description

Shield battery concept of Starcraft 1, or Moonwell in Warcraft 3. Getting a unit to right click a unit with this ability or the unit clicking itself gets the ability to be cast on the clicking unit. The unit being targeted by this ability will be stunned/stoped at a rate of 1.5x per second (or at least seize if attempting to take any action) while under the direct effect of the ability.

### Hint and rules

* Is probably best, ONLY if the modder wishes to have an ability on which the unit who receives can "Right Click" the structure for the ability. Also note that the clicking unit can use stop to interrupt the effect (unless it is auto-cast), and also, not the other way around. Only the affected units command the effect off.
* Units "Right Clicking" it must have a move ability. This explains why a barracks cannot use it, but a flying barracks can. However, it will work the other way around, if the caster "Right Clicks" on the structure. Using that logic, it was discovered that when a unit is "Clicking at it" is in fact moving to it, and its movement is halted at the moment it is using it. This cannot be used for immobile structures however.
* If right clicking a unit from withing caster, seems to be only able to apply one effect on structures, but non-stop on units.
* Works oddly with effects, since it has its own casting rate, putting a Create Healer for example might be re-casted over again (at the battery periodic rate) which forces the modder to put a validator based on markers or such. Otherwise, imagine the ability spamming a creater healer effect at every 1.5 time per second... there you dont have the effect's rate respected. In the end, the modder is forced to base the ability only by its default timer, which doesn't offer much variety. Also note that putting an initial and final effect will repeat as often as the effect is launched, so if, for example you put an apply behavior and a remove behavior in the end, it will appear as nothing has been put, because the behavior just keeps being put and removed at the same time.
* Does not have a cost field. The only solution is to put a modify unit effect, and a validator that checks the caster's energy in the effects tree. Or, one can use a Creater Healer effect, with validators preventing spam, and put a cost factor on it. The periodic effect of the Creater heal will be used as well.
* A suggested method for healing for using it is to use an apply behavior effect that leads to a behavior limited at 1 stack. Not only this will prevent stacking, but you can work the cost from there and many other things. Set the duration at 0.01 (this won't work for structures since the battery only hit them once, the behavior won't stick for 0.01 sec.).
* Sadly, does not display the effect tree.
* Should be easier to use an Effect-Target ability, even Blizzard seem to have given up on that ability.

#### Non suited for structures and immobile units

* After running a test where the ability should create an actor on the target (when casting the effect on it), it appears that only units could trigger that model decently. Altho structures can too, even auto-cast that keeps spamming on the structure keeps delcaring to the actor start/stop/start/stop... to a point where the actor is never created. Summary, this ability works for structures, but so badly that it is a pity that structures are even allowed to "click it" or be auto-casted on them.

* Another test has shown that a unit that doesn't move (even with a move ability) cannot trigger the battery to cast, and that even if it did possess the move ability. Only giving that unit acceleration and speed made it work, which indicates that building a big mode would exclude a lot of fun custom units, and this where stand the worst limitations of that ability.

## Example Usage

### Battery Example

Shield battery concept of Starcraft 1, or Moonwell in Warcraft 3.

### Symbiont Demonstration

An exp generator is provided in the demo map to allow fast leveling so exp based features can be tested. The generator uses a Battery ability which applies a Modify Unit effect to give experience to the Veterancy behaviour of the units.

## Fields Description

### Ability: Alignment

* Determines if the ability is known as positive neutral or negative
* Determines target prioritization.
* **Negative:** Targets enemies preferentially
* **Neutral:** Targets both friends and foes
* **Positive:** Targets friends preferentially

### Ability: Search Filters

Quote: "When using this ability, what types of unit can it be cast upon".

* Unknown use.

### Ability\* Target Filters

* Determines which attributes the target must have in order to use the ability on it
* Even if structures are allowed the ability will not be able to channel on them

### Effect: Effect

* The effect used on the target while channeling
* Cast at approximately 1.5x per second
* Only applied once on units with the structure attribute

### Stats: Range

* The range over which the effect can be cast

### Stats: Search Range

Quote: "How far away from the casting unit this ability be cast".

* Unknown use.

## Related

* Effects
* Modify Unit