moved almost all hardcoded constants to "define.dat"
[k8-i-v-a-n.git] / src / game / entity.h
blobb43d2509585a56099392616abe2c0fa2b5d0a960
1 /*
3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
6 * Public License
8 * See LICENSING which should be included
9 * along with this file for more details
12 #ifndef __ENTITY_H__
13 #define __ENTITY_H__
15 #include "ivancommon.h"
17 #include <list>
19 #include "ivandef.h"
20 #include "festring.h"
23 #define EXISTS 1
24 #define HAS_BE 2
25 #define ENTITY_FLAGS 3
28 class square;
29 struct v2;
32 class entity {
33 friend class pool;
35 public:
36 static void *operator new (size_t size);
37 static void operator delete (void *p);
39 public:
40 static int GetUniqueMemoryMark (entity *e);
41 static void DumpDeadSet ();
43 public:
44 entity (int);
45 entity (const entity &);
46 virtual ~entity ();
48 virtual void Be () {}
49 virtual square *GetSquareUnderEntity (int = 0) const = 0;
50 virtual void SignalVolumeAndWeightChange () {}
51 col24 GetEmitation () const { return Emitation; }
52 virtual void SignalEmitationIncrease (col24) {}
53 virtual void SignalEmitationDecrease (col24) {}
54 virtual truth ContentsCanBeSeenBy (ccharacter *) const { return false; }
55 virtual truth AllowSpoil () const { return false; }
56 virtual void SignalSpoil (material *) {}
57 virtual void SignalSpoilLevelChange (material *) {}
58 virtual truth IsOnGround () const = 0;
59 virtual truth AllowContentEmitation () const { return true; }
60 virtual void SignalRustLevelChange () {}
61 virtual material *RemoveMaterial (material*) { return 0; }
62 virtual character *TryNecromancy (character*) { return 0; }
63 virtual void SignalDisappearance () {}
64 virtual void SpecialEatEffect (character *, int) {}
65 virtual feuLong GetTrapID () const { return 0; }
66 virtual feuLong GetVictimID () const { return 0; }
67 virtual void AddTrapName (festring &, int) const {}
68 virtual void UnStick () {}
69 virtual void UnStick (int) {}
70 virtual truth TryToUnStick (character *, v2) { return false; }
71 virtual int GetTrapType () const { return 0; }
72 virtual truth IsStuckTo (ccharacter *) const { return false; }
73 virtual ccharacter *FindCarrier () const { return 0; }
75 truth Exists () const { return Flags & EXISTS; }
76 void SendToHell ();
77 truth IsEnabled () const { return Flags & HAS_BE; }
78 void Enable ();
79 void Disable ();
80 void AddFlags (feuLong What) { Flags |= What; }
81 void RemoveFlags (feuLong What) { Flags &= ~What; }
83 protected:
84 col24 Emitation;
85 feuLong Flags;
87 private:
88 entity (); // no such constructor
90 public:
91 festring mOnEvents;
95 #endif