monsters.h

Go to the documentation of this file.
00001 /*
00002  *  monsters.h - Monsters.
00003  *
00004  *  Copyright (C) 2000-2001  The Exult Team
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019  */
00020 
00021 #ifndef INCL_MONSTERS
00022 #define INCL_MONSTERS 1
00023 
00024 #include "actors.h"
00025 
00026 /*
00027  *  Monsters get their own class because they have a bigger footprint
00028  *  than humans.
00029  */
00030 class Monster_actor : public Npc_actor
00031   {
00032   static Monster_actor *in_world; // All monsters in the world.
00033           // Links for 'in_world' list.
00034   Monster_actor *next_monster, *prev_monster;
00035   Animator *animator;   // For wounded men.
00036   void link_in();     // Add to in_world list.
00037   void link_out();    // Remove from list.
00038 public:
00039   Monster_actor(const std::string &nm, int shapenum, int num = -1, 
00040               int uc = -1);
00041   virtual ~Monster_actor();
00042           // Create an instance.
00043   static Monster_actor *create(int shnum);
00044   static Monster_actor *create(int shnum, Tile_coord pos,
00045     int sched = -1, int align = (int) Actor::neutral, 
00046         bool tempoary = true, bool equipment = true);
00047           // Methods to retrieve them all:
00048   static Monster_actor *get_first_in_world()
00049     { return in_world; }
00050   Monster_actor *get_next_in_world()
00051     { return next_monster; }
00052   static void delete_all(); // Delete all monsters.
00053   static void give_up()   // For file errors only!
00054     { in_world = 0; }
00055   virtual int move_aside(Actor* for_actor, int dir)
00056     { return 0; }   // Monsters don't move aside.
00057           // Render.
00058   virtual void paint();
00059           // Step onto an (adjacent) tile.
00060   virtual int step(Tile_coord t, int frame);
00061           // Remove/delete this object.
00062   virtual void remove_this(int nodel = 0);
00063           // Move to new abs. location.
00064   virtual void move(int newtx, int newty, int newlift);
00065           // Add an object.
00066   virtual bool add(Game_object *obj, bool dont_check = false,
00067               bool combine = false);
00068   virtual int get_armor_points(); // Get total armor value.
00069           // Get total weapon value.
00070   virtual Weapon_info *get_weapon(int& points, int& shape);
00071   virtual int is_monster()
00072     { return 1; }
00073   virtual void die(Actor *attacker);    // We're dead.
00074   void write(DataSource* nfile);// Write out (to 'monsnpc.dat').
00075   };
00076 
00077 #endif

Generated on Mon Jul 9 14:42:48 2007 for ExultEngine by  doxygen 1.5.1