00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef INCL_SPELLBOOK
00026 #define INCL_SPELLBOOK 1
00027
00028 #include "iregobjs.h"
00029
00030 const int NREAGENTS = 11;
00031
00032
00033
00034
00035 class Spellbook_object : public Ireg_game_object
00036 {
00037
00038 static unsigned short bg_reagents[9*8], si_reagents[9*8];
00039 unsigned short *reagents;
00040 unsigned char circles[9];
00041 int bookmark;
00042 public:
00043 friend class Bookmark_button;
00044 friend class Spellbook_gump;
00045
00046 Spellbook_object(int shapenum, int framenum, unsigned int shapex,
00047 unsigned int shapey, unsigned int lft, unsigned char *c,
00048 unsigned char bmark);
00049 int add_spell(int spell);
00050 bool has_ring(Actor *act);
00051
00052 bool can_do_spell(Actor *act, int spell);
00053 bool can_do_spell(Actor *act)
00054 { return bookmark >= 0 ? can_do_spell(act, bookmark) : false; }
00055
00056 bool do_spell(Actor *act, int spell, bool can_do = false,
00057 bool in_combat = false);
00058
00059 bool do_spell(Actor *act, bool in_combat = false)
00060 { return bookmark >= 0 ?
00061 do_spell(act, bookmark, false, in_combat) : false; }
00062 static void execute_spell(Actor *act, int spell,
00063 bool in_combat = false);
00064
00065 virtual void activate(int event = 1);
00066
00067 virtual void write_ireg(DataSource* out);
00068
00069
00070 virtual int get_ireg_size();
00071 };
00072
00073 #endif