DiceyScript.attack Method

attack(damage:Int, ?element: String):Void

Definition

Attacks the opposing fighter for the specified amount of damage. If an element is specified, does elemental damage; otherwise, uses the neutral (sword) damage type.

This damage is blocked by Shields, and if the effects of Curse? trigger, the attack will target the user instead.

If damage is negative, the opposing fighter is healed instead of damaged. This healing does not affect shields.

Parameters

damage: Int

The damage done to the fighter. If negative, the target is healed.

element: String (Optional)

The element of the damage. If the opposing fighter is weak to that element, they will take 2*damage instead. However, if they are strong against that element, they will take (damage+1)/2 instead, which is half the damage but rounded up.

Returns

Void

This function does not return a value.


User Tools