3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
8 * See LICENSING which should be included
9 * along with this file for more details
27 typedef room
* (*roomspawner
)();
32 roomprototype(roomspawner
, cchar
*);
33 room
* Spawn() const { return Spawner(); }
34 room
* SpawnAndLoad(inputfile
&) const;
35 cchar
* GetClassID() const { return ClassID
; }
36 int GetIndex() const { return Index
; }
46 typedef roomprototype prototype
;
47 room() : LastMasterSearchTick(0), MasterID(0), LastWardSearchTick(0) { }
49 virtual void Save(outputfile
&) const;
50 virtual void Load(inputfile
&);
51 virtual void Enter(character
*) { }
52 v2
GetPos() const { return Pos
; }
53 void SetPos(v2 What
) { Pos
= What
; }
54 v2
GetSize() const { return Size
; }
55 void SetSize(v2 What
) { Size
= What
; }
56 void SetIndex(int What
) { Index
= What
; }
57 int GetIndex() const { return Index
; }
58 character
* GetMaster() const;
59 void SetMasterID(uLong What
) { MasterID
= What
; }
60 virtual truth
PickupItem(character
*, item
*, int) { return true; }
61 virtual truth
DropItem(character
*, item
*, int) { return true; }
62 int GetDivineMaster() const { return DivineMaster
; }
63 void SetDivineMaster(int What
) { DivineMaster
= What
; }
64 virtual void KickSquare(character
*, lsquare
*) { }
65 virtual truth
ConsumeItem(character
*, item
*, int) { return true; }
66 virtual truth
AllowDropGifts() const { return true; }
67 virtual truth
Drink(character
*) const { return true; }
68 virtual truth
HasDrinkHandler() const { return false; }
69 virtual truth
Dip(character
*) const { return true; }
70 virtual truth
HasDipHandler() const { return false; }
71 virtual void TeleportSquare(character
*, lsquare
*) { }
72 virtual const prototype
* GetProtoType() const = 0;
73 int GetType() const { return GetProtoType()->GetIndex(); }
74 virtual void DestroyTerrain(character
*);
75 virtual truth
AllowSpoil(citem
*) const { return true; }
76 virtual truth
CheckDestroyTerrain(character
*);
77 virtual int GetGodRelationAdjustment() const { return -50; }
78 virtual truth
AllowKick(ccharacter
*, const lsquare
*) const { return true; }
79 truth
MasterIsActive() const;
80 truth
CheckKickSquare(ccharacter
*, const lsquare
*) const;
81 virtual void HostileAction(character
*) const { }
82 virtual truth
AllowAltarPolymorph() const { return true; }
83 virtual truth
AllowFoodSearch() const { return true; }
84 virtual void ReceiveVomit(character
*) { }
85 virtual truth
IsOKToDestroyWalls(ccharacter
*) const;
86 virtual void AddItemEffect(item
*) { };
87 void FinalProcessForBone();
88 void SetFlags(uLong What
) { Flags
= What
; }
89 truth
DontGenerateMonsters() const { return Flags
& NO_MONSTER_GENERATION
; }
90 olterrain
* GetWard() const;
91 truth
WardIsActive() const;
92 virtual truth
IsOKToTeleportInto() const;
94 mutable character
* Master
;
95 mutable uLong LastMasterSearchTick
;
102 mutable olterrain
* Ward
;
103 mutable ulong LastWardSearchTick
;
106 #ifdef __FILE_OF_STATIC_ROOM_PROTOTYPE_DEFINITIONS__
107 #define ROOM_PROTO(name)\
108 template<> const roomprototype\
109 name##sysbase::ProtoType((roomspawner)(&name##sysbase::Spawn), #name);
111 #define ROOM_PROTO(name)
114 #define ROOM(name, base)\
116 typedef simplesysbase<name, base, roomprototype> name##sysbase;\
118 class name : public name##sysbase