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

Type PowerAttackPajamaPiece

 object --+    
          |    
PajamaPiece --+
              |
             PowerAttackPajamaPiece

Known Subclasses:
FireShirt, SpideyShirt

A pajama piece that fires an attack whose power depends on how long the user holds down the pajama activation key.
Method Summary
  __init__(self, avatar)
  attack(self, attack_type, power)
This is the method that should actually fire the attack.
  start(self)
This method is called whenever the player presses the key to use this pajama piece's power.
  stop(self)
This method is called whenever the player releases the key to use this pajama piece's power.
  update(self, duration)
Called periodically
    Inherited from PajamaPiece
  current_animation(self)
  disrobe(self)
This method is called whenever the avatar takes off this pajama piece.
  handle_collision(self, obstacle, side)
Called when the avatar collides with something
  handle_lose_support(self, old_support)
Called when the avatar loses support
  icon(cls)
(Class method)
  play_animation(self, name, speed)
  register(cls)
(Class method)
  wear(self)
This method is called whenever the avatar puts on this pajama piece.
    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
NoneType _activation_timer: Records the time since the player pressed the activation key; the longer they hold it down, the more power the attack will have.
int _cooldown_timer: A timer that is set whenever the avatar fires an attack; another attack can't be started until this timer gets to zero.
NoneType _suspend_mana_regen_effect: A SuspendManaRegen effect used to suspend mana regeneration for as long as they hold down the activation key.
    Inherited from PajamaPiece
bool active: True when the user is pressing the key for this pajama.
NoneType animation: The name of the animation mode that is currently being played; this will override the default animation modes (eg walk and jump).
NoneType animation_speed: The speed for the animation mode that is currently being played; this will override the default animation speed.

Class Variable Summary
NoneType attack_type: Which attack should be used? (Defined as a string by the class; and replaced by an AttackType object when the pj is instantiated.)
bool suspend_mana_regen: If true, then mana regeneration will be suspended as long as the user holds down the pajama activation key.
    Inherited from PajamaPiece
dict classes = {'BlueTShirt': <class 'pajammin.entity.agent.a...
NoneType descr = None                                                                  
NoneType is_shirt: If true, then it's a pajama shirt; if false, then it's a pajama pants.
NoneType name = None                                                                  
NoneType sprite_category = None                                                                  

Instance Method Details

__init__(self, avatar)
(Constructor)

Overrides:
pajammin.entity.agent.avatar.PajamaPiece.__init__

attack(self, attack_type, power)

This is the method that should actually fire the attack. Subclasses should override this method.

start(self)

This method is called whenever the player presses the key to use this pajama piece's power.
Overrides:
pajammin.entity.agent.avatar.PajamaPiece.start (inherited documentation)

stop(self)

This method is called whenever the player releases the key to use this pajama piece's power.
Overrides:
pajammin.entity.agent.avatar.PajamaPiece.stop (inherited documentation)

update(self, duration)

Called periodically
Overrides:
pajammin.entity.agent.avatar.PajamaPiece.update (inherited documentation)

Instance Variable Details

_activation_timer

Records the time since the player pressed the activation key; the longer they hold it down, the more power the attack will have.
Type:
NoneType
Value:
None                                                                  

_cooldown_timer

A timer that is set whenever the avatar fires an attack; another attack can't be started until this timer gets to zero.
Type:
int
Value:
0                                                                     

_suspend_mana_regen_effect

A SuspendManaRegen effect used to suspend mana regeneration for as long as they hold down the activation key.
Type:
NoneType
Value:
None                                                                  

Class Variable Details

attack_type

Which attack should be used? (Defined as a string by the class; and replaced by an AttackType object when the pj is instantiated.)
Type:
NoneType
Value:
None                                                                  

suspend_mana_regen

If true, then mana regeneration will be suspended as long as the user holds down the pajama activation key.
Type:
bool
Value:
True