Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

Monster Class Reference

Intelligent opponents. More...

#include <monsters_common.h>

Inheritance diagram for Monster:

Inheritance graph
[legend]
Collaboration diagram for Monster:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Monster (Sint16 xpos=0, Sint16 ypos=0, const ParameterMap &param=ParameterMap())
virtual void removedObject (Object *)
 Remove the specified object from all internal accountings.
virtual void updateAnimState ()
 Updates the current animation.
virtual void idle (Uint16)
virtual void fall (Uint16)
virtual Uint16 hit (Uint16 direction, Weapon &weap)
 Weapon hits.

Static Public Attributes

ParameterMap default_parameters

Protected Member Functions

virtual void addTouch (std::set< Object * > &)
virtual void addEnter (std::set< Object * > &)
 Adds the specified set to the enter set.
virtual void removeTouch (std::set< Object * > &)
 Removes the specified sets from the touch set.
virtual void removeEnter (std::set< Object * > &)
 Removes the specified sets from the enter set.
virtual void crash (Uint16 dir=DIR_DOWN)
virtual void die ()
virtual Hit move (Uint16 dt, bool check=false)
virtual void runAI (Uint16)
virtual void ai_left (Uint16)
virtual void ai_right (Uint16)
virtual void ai_attack (Player *, Uint16)

Protected Attributes

std::set< Player * > targets
Mix_Chunk * au_hit
Sint16 Dai
Sint16 Dattack
EmptyAnimationPtr anim_left
EmptyAnimationPtr anim_right

Detailed Description

Intelligent opponents.

Todo:
Clean up the mess of AI functions.


Member Function Documentation

virtual void Monster::removedObject Object  )  [virtual]
 

Remove the specified object from all internal accountings.

Clean up the internal accountings of the specified object. Usually called when an object leaves the map (dies).

Reimplemented from Character.

virtual void Monster::updateAnimState  )  [virtual]
 

Updates the current animation.

Checks the state and changes the animation correpspondingly

Reimplemented from Character.

virtual void Monster::idle Uint16   )  [virtual]
 

What should the object do all the time? This is run first of all.

Remarks:
This should be called downwards by all derived classes

Reimplemented from Character.

Reimplemented in Plant, and Zombie.

virtual void Monster::fall Uint16   )  [virtual]
 

Calculates the speed of the character

Todo:
clean up this mess with fall/move

Reimplemented from Character.

virtual Uint16 Monster::hit Uint16  direction,
Weapon weap
[virtual]
 

Weapon hits.

Called when hit by a weapon. Depending on the direction and weapon used, certain effects/events are run.

Parameters:
direction Direction from which the weapon deals damage
weap Weapon used in the attack/hit
Returns:
New health of the character

Reimplemented from Character.

Reimplemented in Plant.

virtual void Monster::addTouch std::set< Object * > &   )  [protected, virtual]
 

Runs Character::addTouch() and updates the targets

Todo:
Clean up this mess

Reimplemented from Character.

virtual Hit Monster::move Uint16  dt,
bool  check = false
[protected, virtual]
 

Updates the position of the character depending on it's velocity, checks for crashes

Todo:
clean up this mess with move and fall

Reimplemented from Character.


The documentation for this class was generated from the following file:
Generated on Sun Feb 5 13:02:37 2006 for Lost Penguins by doxygen 1.3.8