00001 /************************************************************************* 00002 fgitem.h 00003 Project Piedmont game 00004 ------------------------- 00005 00006 Date Created: 11/08/00 Last Modified: 05/08/08 00007 Programmer: David Foster 00008 Copyright: (C) 2000 David Foster (see file COPYING) 00009 E-mail: dfoster@computer.org 00010 00011 Description: class for all non-movable foreground objects 00012 (doors, keys, teleporters, scrolls, gold, powerup, etc) 00013 00014 This program is free software; you can redistribute it and/or modify 00015 it under the terms of the GNU General Public License as published by 00016 the Free Software Foundation; either version 2 of the License, or 00017 (at your option) any later version. 00018 00019 This program is distributed in the hope that it will be useful, 00020 but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 GNU General Public License for more details. 00023 00024 You should have received a copy of the GNU General Public License 00025 along with this program; if not, write to the Free Software 00026 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00027 00028 ************************************************************************/ 00029 00030 #ifndef FGITEM_H 00031 #define FGITEM_H 00032 #define FGITEM_DEBUG 0 //1 allows debug statements to be output 00033 00034 #include <stdio.h> 00035 #include <iostream> 00036 #include <stdlib.h> 00037 #include <string> 00038 #include <stddef.h> 00039 #include <unistd.h> 00040 #include <SDL/SDL.h> 00041 #include "screen.h" 00042 #include "tiles.h" 00043 #include "fgentitylist.h" 00044 00045 class FGItem : public FGEntity{ 00046 private: 00047 int x, y; // tile coordinate to teleport to 00048 int next_level; // next level number 00049 int num_frames; // For items with animation 00050 int direction; // Orient the image in the proper direction 00051 int need_key; // Attribute for door items 00052 int point_change; // Powerup attribute 00053 int score_change; // Gold 00054 int monster_index; // Generator attribute 00055 int hitpoints; // Generator attribute 00056 int damage; // Trap attribute 00057 int rate_div; // Frame rate divider 00058 int rate_count; // Frame rate divider counter 00059 public: 00060 FGItem(); 00061 ~FGItem(); 00062 void set_nextlevel (int first_prop); 00063 void set_needkey (int first_prop); 00064 void set_pointchange (int first_prop); 00065 void set_scorechange (int first_prop); 00066 void set_damage (int first_prop); 00067 void set_teleporterinfo (int first_prop, int second_prop); 00068 void set_generatorinfo (int first_prop, int second_prop); 00069 void set_numframes (int first_prop); 00070 void set_rate_div (int rate); 00071 void update (); 00072 int activate (); 00073 }; 00074 00075 #endif 00076 00077 00078