nonhumans separation
[k8-i-v-a-n.git] / src / game / entity.h
blob81cd4d2ced476c979d73121969873f32adf7de13
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 <list>
17 #include "ivandef.h"
18 #include "festring.h"
21 #define EXISTS 1
22 #define HAS_BE 2
23 #define ENTITY_FLAGS 3
26 class square;
27 struct v2;
30 class entity {
31 friend class pool;
32 public:
33 entity(int);
34 entity(const entity&);
35 virtual ~entity();
36 virtual void Be() { }
37 truth Exists() const { return Flags & EXISTS; }
38 void SendToHell();
39 truth IsEnabled() const { return Flags & HAS_BE; }
40 void Enable();
41 void Disable();
42 virtual square* GetSquareUnderEntity(int = 0) const = 0;
43 virtual void SignalVolumeAndWeightChange() { }
44 col24 GetEmitation() const { return Emitation; }
45 virtual void SignalEmitationIncrease(col24) { }
46 virtual void SignalEmitationDecrease(col24) { }
47 virtual truth ContentsCanBeSeenBy(ccharacter*) const { return false; }
48 virtual truth AllowSpoil() const { return false; }
49 virtual void SignalSpoil(material*) { }
50 virtual void SignalSpoilLevelChange(material*) { }
51 virtual truth IsOnGround() const = 0;
52 virtual truth AllowContentEmitation() const { return true; }
53 virtual void SignalRustLevelChange() { }
54 virtual material* RemoveMaterial(material*) { return 0; }
55 virtual character* TryNecromancy(character*) { return 0; }
56 virtual void SignalDisappearance() { }
57 virtual void SpecialEatEffect(character*, int) { }
58 virtual feuLong GetTrapID() const { return 0; }
59 virtual feuLong GetVictimID() const { return 0; }
60 virtual void AddTrapName(festring&, int) const { }
61 virtual void UnStick() { }
62 virtual void UnStick(int) { }
63 virtual truth TryToUnStick(character*, v2);
64 virtual int GetTrapType() const { return 0; }
65 void AddFlags(feuLong What) { Flags |= What; }
66 void RemoveFlags(feuLong What) { Flags &= ~What; }
67 virtual truth IsStuckTo(ccharacter*) const { return false; }
68 virtual ccharacter* FindCarrier() const { return 0; }
70 protected:
71 col24 Emitation;
72 feuLong Flags;
74 private:
75 entity *Last;
76 entity *Next;
78 public:
79 festring mOnEvents;
83 #endif