Package pajammin :: Package entity :: Package agent :: Module agent :: Class AttackType
[show private | hide private]
[frames | no frames]

Type AttackType

object --+
         |
        AttackType

Known Subclasses:
MeleeAttack, ProjectileAttack

A single type of attack that an agent can make. Each attack type defines several variables that provide basic information about the attack's animation and cooldown; and a fire() method, that performs the attack action itself.
Method Summary
  __init__(self, animation, delay, cooldown, mana_cost)
  fire(self, attacker, **attack_args)
Perform the actual attack action.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
Return repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Instance Variable Summary
  animation: The base name of the animation that the agent's sprite should display when using this attack.
  cooldown: The minimum amount of time that can elapse between using this attack and starting the next attack.
  delay: The amount of time that the agent should wait after it starts playing the animation before performing the attack action with fire.

Method Details

__init__(self, animation=None, delay=0, cooldown=0, mana_cost=0)
(Constructor)

Overrides:
__builtin__.object.__init__

fire(self, attacker, **attack_args)

Perform the actual attack action. This method does not perform any animations or start the agent's cooldown timer.
Parameters:
attack_args - Extra information about how the attack should be made, such as the angle for a projectile attack or the intended target of the attack.

Instance Variable Details

animation

The base name of the animation that the agent's sprite should display when using this attack. The actual animation name will be formed by combining basename with a suffix indicating which direction the agent is facing, such as '_left' or '_down'. If animation is None, then no animation will be displayed.

cooldown

The minimum amount of time that can elapse between using this attack and starting the next attack. The cooldown timer is started when the animation is started (and not when the actual attack action is performed with fire).

delay

The amount of time that the agent should wait after it starts playing the animation before performing the attack action with fire.