moved almost all hardcoded constants to "define.dat"
[k8-i-v-a-n.git] / src / game / char.h
blob9bf6b29a289c1dd51d527aea145c02673331e9d7
1 /*
2 * Iter Vehemens ad Necem (IVAN)
3 * Copyright (C) Timo Kiviluoto
4 * Released under the GNU General
5 * Public License
7 * See LICENSING which should be included
8 * along with this file for more details
11 #ifndef __CHAR_H__
12 #define __CHAR_H__
14 #include "bodypart.h"
15 #include "script.h"
16 #include "wskill.h"
17 #include "fesave.h"
18 #include "feparse.h"
19 #include "festring.h"
22 #define CHAR_PERSONAL_PRONOUN GetPersonalPronoun(true).CStr()
23 #define CHAR_POSSESSIVE_PRONOUN GetPossessivePronoun(true).CStr()
24 #define CHAR_OBJECT_PRONOUN GetObjectPronoun(true).CStr()
25 #define CHAR_PERSONAL_PRONOUN_THIRD_PERSON_VIEW GetPersonalPronoun(false).CStr()
26 #define CHAR_POSSESSIVE_PRONOUN_THIRD_PERSON_VIEW GetPossessivePronoun(false).CStr()
27 #define CHAR_OBJECT_PRONOUN_THIRD_PERSON_VIEW GetObjectPronoun(false).CStr()
29 class go;
30 class team;
31 class wsquare;
32 class cweaponskill;
33 class action;
34 class characterprototype;
35 class web;
36 class mindworm;
38 struct homedata;
39 struct trapdata;
40 struct blitdata;
43 typedef std::vector<std::pair<double, int> > blockvector;
44 typedef truth (item::*sorter)(ccharacter *) const;
45 typedef truth (character::*petmanagementfunction) ();
46 typedef character *(*characterspawner) (int, int);
47 typedef character *(*charactercloner) (ccharacter *);
49 // for GeneralFindItem
50 typedef truth (*ItemCheckerCB) (item *i);
53 inline int APBonus (int Attribute) { return Attribute >= 10 ? 90 + Attribute : 50 + Attribute * 5; }
55 struct expid {
56 bool operator < (expid) const;
57 int ActID, SrcID;
61 inline bool expid::operator < (expid E) const { return ActID != E.ActID ? ActID < E.ActID : SrcID < E.SrcID; }
63 RAW_SAVE_LOAD(expid);
65 typedef std::map<expid, double> expmodifiermap;
68 struct characterdatabase : public databasebase {
69 typedef characterprototype prototype;
70 void InitDefaults (const characterprototype *NewProtoType, int NewConfig, cfestring &acfgstrname);
71 truth AllowRandomInstantiation () const { return CanBeGenerated && !IsUnique; }
72 void PostProcess ();
73 const prototype *ProtoType;
74 double NaturalExperience[ATTRIBUTES];
75 feuLong Flags;
76 truth IsAbstract;
77 truth CanRead;
78 truth CanBeGenerated;
79 truth CanOpen;
80 truth IsUnique;
81 truth IsNameable;
82 truth IsPolymorphable;
83 truth CanUseEquipment;
84 truth CanKick;
85 truth CanTalk;
86 truth CanBeWished;
87 truth CreateDivineConfigurations;
88 truth CreateGolemMaterialConfigurations;
89 truth CanBeCloned;
90 truth CanZap;
91 truth HasALeg;
92 truth IgnoreDanger;
93 truth IsExtraCoward;
94 truth SpillsBlood;
95 truth HasEyes;
96 truth HasHead;
97 truth CanThrow;
98 truth UsesNutrition;
99 truth BodyPartsDisappearWhenSevered;
100 truth CanBeConfused;
101 truth CanApply;
102 truth BiteCapturesBodyPart;
103 truth IsPlant;
104 truth DestroysWalls;
105 truth IsRooted;
106 truth HasSecondaryMaterial;
107 truth IsImmuneToLeprosy;
108 truth AutomaticallySeen;
109 truth CanHear;
110 truth WillCarryItems;
111 truth Sweats;
112 truth IsImmuneToItemTeleport;
113 truth AlwaysUseMaterialAttributes;
114 truth IsEnormous;
115 truth IsExtraFragile;
116 truth AllowUnconsciousness;
117 truth CanChoke;
118 truth IsImmuneToStickiness;
119 truth ForceCustomStandVerb;
120 truth VomittingIsUnhealthy;
121 int DefaultEndurance;
122 int DefaultPerception;
123 int DefaultIntelligence;
124 int DefaultWisdom;
125 int DefaultWillPower;
126 int DefaultCharisma;
127 int DefaultMana;
128 int DefaultArmStrength;
129 int DefaultLegStrength;
130 int DefaultDexterity;
131 int DefaultAgility;
132 sLong DefaultMoney;
133 int TotalSize;
134 int Sex;
135 int CriticalModifier;
136 festring StandVerb;
137 int Frequency;
138 int EnergyResistance;
139 int FireResistance;
140 int PoisonResistance;
141 int ElectricityResistance;
142 int AcidResistance;
143 int SoundResistance;
144 int ConsumeFlags;
145 sLong TotalVolume;
146 packv2 HeadBitmapPos;
147 packv2 TorsoBitmapPos;
148 packv2 ArmBitmapPos;
149 packv2 LegBitmapPos;
150 packv2 RightArmBitmapPos;
151 packv2 LeftArmBitmapPos;
152 packv2 RightLegBitmapPos;
153 packv2 LeftLegBitmapPos;
154 packv2 GroinBitmapPos;
155 packcol16 ClothColor;
156 packcol16 SkinColor;
157 packcol16 CapColor;
158 packcol16 HairColor;
159 packcol16 EyeColor;
160 packcol16 TorsoMainColor;
161 packcol16 BeltColor;
162 packcol16 BootColor;
163 packcol16 TorsoSpecialColor;
164 packcol16 ArmMainColor;
165 packcol16 GauntletColor;
166 packcol16 ArmSpecialColor;
167 packcol16 LegMainColor;
168 packcol16 LegSpecialColor;
169 col24 BaseEmitation;
170 truth UsesLongArticle;
171 festring Adjective;
172 truth UsesLongAdjectiveArticle;
173 festring NameSingular;
174 festring NamePlural;
175 festring PostFix;
176 int ArticleMode;
177 int BaseUnarmedStrength;
178 int BaseBiteStrength;
179 int BaseKickStrength;
180 int AttackStyle;
181 sLong ClassStates;
182 sLong WhatThrowItemTypesToThrow;
183 fearray<festring> Alias;
184 contentscript<item> Helmet;
185 contentscript<item> Amulet;
186 contentscript<item> Cloak;
187 contentscript<item> BodyArmor;
188 contentscript<item> Belt;
189 contentscript<item> RightWielded;
190 contentscript<item> LeftWielded;
191 contentscript<item> RightRing;
192 contentscript<item> LeftRing;
193 contentscript<item> RightGauntlet;
194 contentscript<item> LeftGauntlet;
195 contentscript<item> RightBoot;
196 contentscript<item> LeftBoot;
197 int AttributeBonus;
198 fearray<sLong> KnownCWeaponSkills;
199 fearray<sLong> CWeaponSkillHits;
200 int RightSWeaponSkillHits;
201 int LeftSWeaponSkillHits;
202 int PanicLevel;
203 fearray<contentscript<item> > Inventory;
204 int DangerModifier;
205 festring DefaultName;
206 fearray<festring> FriendlyReplies;
207 fearray<festring> HostileReplies;
208 int FleshMaterial;
209 festring DeathMessage;
210 int HPRequirementForGeneration;
211 int DayRequirementForGeneration;
212 int AttackWisdomLimit;
213 int AttachedGod;
214 packv2 WieldedPosition;
215 int NaturalSparkleFlags;
216 int MoveType;
217 int BloodMaterial;
218 int VomitMaterial;
219 int PolymorphIntelligenceRequirement;
220 feuLong DefaultCommandFlags;
221 feuLong ConstantCommandFlags;
222 festring ForceVomitMessage;
223 int SweatMaterial;
224 fearray<festring> ScienceTalkAdjectiveAttribute;
225 fearray<festring> ScienceTalkSubstantiveAttribute;
226 fearray<festring> ScienceTalkPrefix;
227 fearray<festring> ScienceTalkName;
228 int ScienceTalkPossibility;
229 int ScienceTalkIntelligenceModifier;
230 int ScienceTalkWisdomModifier;
231 int ScienceTalkCharismaModifier;
232 int ScienceTalkIntelligenceRequirement;
233 int ScienceTalkWisdomRequirement;
234 int ScienceTalkCharismaRequirement;
235 int DisplacePriority;
236 festring RunDescriptionLineOne;
237 festring RunDescriptionLineTwo;
238 truth AllowPlayerToChangeEquipment;
239 int TamingDifficulty;
240 truth IsMasochist;
241 truth IsSadist;
242 truth IsCatacombCreature;
243 truth CreateUndeadConfigurations;
244 truth UndeadVersions;
245 int UndeadAttributeModifier;
246 int UndeadVolumeModifier;
247 truth UndeadCopyMaterials;
248 truth CanBeGeneratedOnlyInTheCatacombs;
249 truth IsAlcoholic;
250 truth IsImmuneToWhipOfThievery;
251 truth IsRangedAttacker;
252 int WhatCategoryToThrow;
253 int WhatWeaponConfigToThrow;
254 fearray<int> AllowedDungeons;
255 fearray<festring> LevelTags;
256 fearray<festring> HomeLevel;
257 int NaturalTeam;
261 class characterprototype {
262 friend class databasecreator<character>;
263 friend class protosystem;
264 public:
265 characterprototype (const characterprototype *, characterspawner, charactercloner, cchar *);
266 virtual ~characterprototype () {}
268 character *Spawn (int Config=0, int SpecialFlags=0) const { return Spawner(Config, SpecialFlags); }
269 character *SpawnAndLoad(inputfile &) const;
270 character *Clone(ccharacter *Char) const { return Cloner(Char); }
271 int GetIndex () const { return Index; }
272 const characterprototype *GetBase() const { return Base; }
273 cchar *GetClassID () const { return ClassID; }
274 int CreateSpecialConfigurations (characterdatabase **, int, int);
275 const characterdatabase *ChooseBaseForConfig (characterdatabase ** TempConfig, int, int) { return *TempConfig; }
276 const characterdatabase *const *GetConfigData () const { return ConfigData; }
277 int GetConfigSize () const { return ConfigSize; }
279 private:
280 int Index;
281 const characterprototype *Base;
282 characterdatabase **ConfigData;
283 characterdatabase **ConfigTable[CONFIG_TABLE_SIZE];
284 int ConfigSize;
285 characterspawner Spawner;
286 charactercloner Cloner;
287 cchar *ClassID;
289 public:
290 festring mOnEvents;
294 class character : public entity, public id {
295 friend class databasecreator<character>;
296 friend class corpse;
298 public:
299 typedef characterprototype prototype;
300 typedef characterdatabase database;
302 public:
303 character ();
304 character (ccharacter &);
305 virtual ~character ();
307 public:
308 virtual void Save (outputfile &) const;
309 virtual void Load (inputfile &);
310 virtual truth CanWield () const { return false; }
311 virtual truth Catches(item *) { return false; }
312 truth CheckDeath (cfestring &, ccharacter * =0, feuLong =0);
313 truth DodgesFlyingItem (item *, double);
314 virtual truth Hit (character *, v2, int, int=0)=0;
315 truth ReadItem (item *);
316 truth TestForPickup (item *) const;
317 void ThrowItem (int, item *);
318 truth TryMove (v2, truth, truth);
319 truth TryToAddToInventory (item *);
320 truth HasEncryptedScroll () const;
321 truth HasHeadOfElpuri () const;
322 truth HasGoldenEagleShirt () const;
323 truth HasPetrussNut () const;
324 truth HasCurdledBlood() const;
325 truth HasOmmelBlood() const;
326 truth CurdleOmmelBlood() const;
327 truth RemoveCurdledOmmelBlood();
328 truth RemoveEncryptedScroll ();
329 truth RemoveMondedrPass ();
330 truth RemoveRingOfThieves ();
331 truth RemoveShadowVeil();
332 truth HasShadowVeil() const;
333 truth HasLostRubyFlamingSword() const;
334 truth IsPlayer () const { return Flags & C_PLAYER; }
335 truth Engrave (cfestring &What);
336 void AddScoreEntry (cfestring &, double = 1.0, truth = true) const;
337 sLong GetAP () const { return AP; }
338 sLong GetNP () const { return NP; }
339 stack *GetStack () const { return Stack; }
340 int GetBurdenState () const { return BurdenState; }
341 truth MakesBurdened (sLong What) const { return sLong(GetCarryingStrength()) * 2500 < What; }
342 virtual int TakeHit (character *, item *, bodypart *, v2, double, double, int, int, int, truth, truth);
343 int GetLOSRange () const;
344 int GetLOSRangeSquare () const { return GetLOSRange() * GetLOSRange(); }
345 int GetESPRange () const { return GetAttribute(INTELLIGENCE) / 3; }
346 int GetESPRangeSquare () const { return GetESPRange() * GetESPRange(); }
347 int GetTeleportRange () const { return GetAttribute(INTELLIGENCE); }
348 int GetTeleportRangeSquare () const { return GetTeleportRange() * GetTeleportRange(); }
349 void AddMissMessage (ccharacter *) const;
350 void AddPrimitiveHitMessage (ccharacter *, cfestring &, cfestring &, int) const;
351 void AddWeaponHitMessage (ccharacter *, citem *, int, truth = false) const;
352 virtual void BeTalkedTo ();
353 void ReceiveDarkness (sLong);
354 void Die (ccharacter *Killer=0, cfestring &Msg=CONST_S(""), feuLong DeathFlags=0);
355 void HasBeenHitByItem (character *, item *, int, double, int);
356 void Hunger ();
357 void Move (v2, truth, truth = false);
358 virtual truth MoveRandomly ();
359 void ReceiveNutrition (sLong);
360 void ReceiveOmmelUrine (sLong);
361 void ReceivePepsi (sLong);
362 void ReceiveSchoolFood (sLong);
363 void Regenerate ();
364 void SetAP (sLong What) { AP = What; }
365 void SetNP (sLong);
366 void Vomit (v2, int, truth = true);
367 virtual void Be ();
368 truth Polymorph (character *, int);
369 void BeKicked (character *, item *, bodypart *, v2, double, double, int, int, truth, truth);
370 void FallTo (character *, v2);
371 truth CheckCannibalism (cmaterial *) const;
372 void ActivateTemporaryState (sLong What) { TemporaryState |= What; }
373 void DeActivateTemporaryState (sLong What) { TemporaryState &= ~What; }
374 void ActivateEquipmentState (sLong What) { EquipmentState |= What; }
375 void DeActivateEquipmentState (sLong What) { EquipmentState &= ~What; }
376 truth TemporaryStateIsActivated (sLong What) const;
377 truth EquipmentStateIsActivated (sLong What) const { return EquipmentState & What; }
378 truth StateIsActivated (sLong What) const;
379 truth LoseConsciousness (int, truth = false);
380 void SetTemporaryStateCounter (sLong, int);
381 void DeActivateVoluntaryAction (cfestring & = CONST_S(""));
382 void ActionAutoTermination ();
383 team *GetTeam () const { return Team; }
384 void SetTeam (team *);
385 void ChangeTeam (team *);
386 virtual int GetMoveEase () const;
387 double GetDodgeValue () const { return DodgeValue; }
388 sLong GetMoney () const { return Money; }
389 void SetMoney (sLong What) { Money = What; }
390 void EditMoney (sLong What) { Money += What; }
391 int GetCurrentSweatMaterial() const { return CurrentSweatMaterial; }
392 void SetInitialSweatMaterial(int What) { CurrentSweatMaterial = What; }
393 void EditCurrentSweatMaterial(int What) { CurrentSweatMaterial = What; }
394 truth Displace (character *, truth = false);
395 truth CheckStarvationDeath (cfestring &);
396 void ShowNewPosInfo () const;
397 void Hostility (character *);
398 stack *GetGiftStack () const;
399 truth MoveRandomlyInRoom ();
400 void ReceiveKoboldFlesh (sLong);
401 truth ChangeRandomAttribute (int);
402 int RandomizeReply (sLong &, int);
403 virtual void CreateInitialEquipment (int);
404 void DisplayInfo (festring &);
405 virtual truth SpecialEnemySightedReaction (character *) { return false; }
406 void TestWalkability ();
407 void EditAP (sLong);
408 void EditNP (sLong);
409 void SetSize (int);
410 virtual int GetSize () const;
411 torso *GetTorso () const { return static_cast<torso *>(*BodyPartSlot[TORSO_INDEX]); }
412 humanoidtorso *GetHumanoidTorso() const { return static_cast<humanoidtorso *>(*BodyPartSlot[TORSO_INDEX]); }
413 void SetTorso (torso *What) { SetBodyPart(TORSO_INDEX, What); }
414 bodypart *GetBodyPart (int I) const { return static_cast<bodypart *>(*BodyPartSlot[I]); }
415 void SetBodyPart (int, bodypart *);
416 void SetMainMaterial (material *, int = 0);
417 void ChangeMainMaterial (material *, int = 0);
418 void SetSecondaryMaterial (material *, int = 0);
419 void ChangeSecondaryMaterial (material *, int = 0);
420 void DoDetecting ();
421 void RestoreHP ();
422 void RestoreLivingHP ();
423 void RestoreStamina () { Stamina = MaxStamina; }
424 virtual truth ReceiveDamage (character *, int, int, int = ALL, int = 8, truth = false, truth = false, truth = false, truth = true);
425 virtual int ReceiveBodyPartDamage (character *, int, int, int, int = 8, truth = false, truth = false, truth = true, truth = false);
426 virtual truth BodyPartIsVital (int) const { return true; }
427 void RestoreBodyParts ();
428 cfestring &GetAssignedName () const { return AssignedName; }
429 void SetAssignedName (cfestring &What) { AssignedName = What; }
430 festring GetDescription (int) const;
431 festring GetPersonalPronoun (truth = true) const;
432 festring GetPossessivePronoun (truth = true) const;
433 festring GetObjectPronoun (truth = true) const;
434 virtual truth BodyPartCanBeSevered (int) const;
435 virtual void AddName (festring &, int) const;
436 void ReceiveHeal (sLong);
437 virtual item *GetMainWielded () const { return 0; }
438 virtual item *GetSecondaryWielded () const { return 0; }
439 int GetHungerState () const;
440 truth ConsumeItem (item *, cfestring &);
441 virtual truth CanConsume (material *) const;
442 action *GetAction () const { return Action; }
443 void SetAction (action *What) { Action = What; }
444 virtual void SwitchToDig (item *, v2) {}
445 virtual void SetRightWielded (item *) {}
446 virtual void SetLeftWielded (item *) {}
447 truth IsPassableSquare (int x, int y) const;
448 truth IsPassableSquare (cv2 xy) const { return IsPassableSquare(xy.X, xy.Y); }
449 truth IsInCorridor (int x, int y, int moveDir) const;
450 inline truth IsInCorridor (cv2 pos, int moveDir) const { return IsInCorridor(pos.X, pos.Y, moveDir); }
451 inline truth IsInCorridor (int moveDir) const { return IsInCorridor(GetPos(), moveDir); }
452 void CountPossibleMoveDirs (cv2 pos, int *odirs, int *ndirs, int exclideDir=-1) const;
453 int CheckCorridorMove (v2 &moveVector, cv2 pos, int moveDir, truth *markAsTurn) const; // -1: not in corridor; return new moveDir and moveVector
454 cv2 GetDiagonalForDirs (int moveDir, int newDir) const;
455 truth IsInTunnelDeadEnd () const;
456 truth IsDangerousSquare (v2 pos) const;
457 void GoOn (go *, truth = false);
458 virtual truth CheckKick () const;
459 virtual int OpenMultiplier () const { return 2; }
460 virtual int CloseMultiplier () const { return 2; }
461 virtual truth CheckThrow () const;
462 virtual truth CheckOffer () const { return true; }
463 int GetTemporaryStateCounter (sLong) const;
464 void EditTemporaryStateCounter (sLong, int);
465 static truth AllowDamageTypeBloodSpill (int);
466 int GetResistance (int) const;
467 virtual int GetGlobalResistance (int Type) const { return GetResistance(Type); }
468 virtual cchar *GetEquipmentName (int) const;
469 virtual bodypart *GetBodyPartOfEquipment (int) const { return 0; }
470 virtual item *GetEquipment (int) const { return 0; }
471 virtual int GetEquipments () const { return 0; }
472 virtual sorter EquipmentSorter (int) const { return 0; }
473 virtual void SetEquipment (int, item *) {}
474 truth IsESPBlockedByEquipment () const;
475 void AddHealingLiquidConsumeEndMessage () const;
476 void AddSchoolFoodConsumeEndMessage () const;
477 void AddSchoolFoodHitMessage () const;
478 void AddOmmelConsumeEndMessage () const;
479 void AddPepsiConsumeEndMessage () const;
480 void AddFrogFleshConsumeEndMessage () const;
481 void AddKoboldFleshConsumeEndMessage () const;
482 void AddKoboldFleshHitMessage () const;
483 void AddBoneConsumeEndMessage () const;
484 void AddBlackUnicornConsumeEndMessage () const;
485 void AddGrayUnicornConsumeEndMessage () const;
486 void AddWhiteUnicornConsumeEndMessage () const;
487 void AddOmmelBoneConsumeEndMessage () const;
488 void AddLiquidHorrorConsumeEndMessage() const;
489 void AddAlienFleshConsumeEndMessage() const;
490 void PrintInfo () const;
491 virtual item *SevereBodyPart (int, truth = false, stack * = 0);
492 virtual truth TryToRiseFromTheDead ();
493 virtual truth RaiseTheDead (character *);
494 bodypart *CreateBodyPart (int, int = 0);
495 virtual truth EquipmentIsAllowed (int) const { return true; }
496 truth CanUseEquipment (int) const;
497 const database *GetDataBase () const { return DataBase; }
498 void SetParameters (int) {}
499 virtual double GetNaturalExperience (int) const;
500 DATA_BASE_VALUE(const prototype *, ProtoType);
501 DATA_BASE_VALUE(int, Config);
502 DATA_BASE_VALUE(int, DefaultEndurance);
503 DATA_BASE_VALUE(int, DefaultPerception);
504 DATA_BASE_VALUE(int, DefaultIntelligence);
505 DATA_BASE_VALUE(int, DefaultWisdom);
506 DATA_BASE_VALUE(int, DefaultWillPower);
507 DATA_BASE_VALUE(int, DefaultCharisma);
508 DATA_BASE_VALUE(int, DefaultMana);
509 DATA_BASE_VALUE(int, DefaultArmStrength);
510 DATA_BASE_VALUE(int, DefaultLegStrength);
511 DATA_BASE_VALUE(int, DefaultDexterity);
512 DATA_BASE_VALUE(int, DefaultAgility);
513 DATA_BASE_VALUE(sLong, DefaultMoney);
514 DATA_BASE_VALUE(int, TotalSize);
515 DATA_BASE_TRUTH(CanRead);
516 DATA_BASE_VALUE(int, Sex);
517 DATA_BASE_TRUTH(CanBeGenerated);
518 DATA_BASE_VALUE(int, CriticalModifier);
519 DATA_BASE_TRUTH(CanOpen);
520 DATA_BASE_VALUE(int, EnergyResistance);
521 DATA_BASE_VALUE(int, FireResistance);
522 DATA_BASE_VALUE(int, PoisonResistance);
523 DATA_BASE_VALUE(int, ElectricityResistance);
524 DATA_BASE_VALUE(int, AcidResistance);
525 DATA_BASE_VALUE(int, SoundResistance);
526 DATA_BASE_VALUE(int, ConsumeFlags);
527 DATA_BASE_VALUE(sLong, TotalVolume);
528 virtual DATA_BASE_VALUE(v2, HeadBitmapPos);
529 virtual DATA_BASE_VALUE(v2, TorsoBitmapPos);
530 virtual DATA_BASE_VALUE(v2, ArmBitmapPos);
531 virtual DATA_BASE_VALUE(v2, LegBitmapPos);
532 virtual DATA_BASE_VALUE(v2, RightArmBitmapPos);
533 virtual DATA_BASE_VALUE(v2, LeftArmBitmapPos);
534 virtual DATA_BASE_VALUE(v2, RightLegBitmapPos);
535 virtual DATA_BASE_VALUE(v2, LeftLegBitmapPos);
536 virtual DATA_BASE_VALUE(v2, GroinBitmapPos);
537 virtual DATA_BASE_VALUE(col16, ClothColor);
538 virtual DATA_BASE_VALUE(col16, SkinColor);
539 virtual DATA_BASE_VALUE(col16, CapColor);
540 virtual DATA_BASE_VALUE(col16, HairColor);
541 virtual DATA_BASE_VALUE(col16, EyeColor);
542 virtual DATA_BASE_VALUE(col16, TorsoMainColor);
543 virtual DATA_BASE_VALUE(col16, BeltColor);
544 virtual DATA_BASE_VALUE(col16, BootColor);
545 virtual DATA_BASE_VALUE(col16, TorsoSpecialColor);
546 virtual DATA_BASE_VALUE(col16, ArmMainColor);
547 virtual DATA_BASE_VALUE(col16, GauntletColor);
548 virtual DATA_BASE_VALUE(col16, ArmSpecialColor);
549 virtual DATA_BASE_VALUE(col16, LegMainColor);
550 virtual DATA_BASE_VALUE(col16, LegSpecialColor);
551 virtual DATA_BASE_TRUTH(IsNameable);
552 virtual DATA_BASE_VALUE(col24, BaseEmitation); // devirtualize ASAP
553 DATA_BASE_TRUTH(UsesLongArticle);
554 DATA_BASE_VALUE(cfestring&, Adjective);
555 DATA_BASE_TRUTH(UsesLongAdjectiveArticle);
556 DATA_BASE_VALUE(cfestring&, NameSingular);
557 DATA_BASE_VALUE(cfestring&, NamePlural);
558 DATA_BASE_VALUE(cfestring&, PostFix);
559 DATA_BASE_VALUE(int, ArticleMode);
560 DATA_BASE_TRUTH(CanZap);
561 virtual DATA_BASE_TRUTH(IsPolymorphable);
562 DATA_BASE_VALUE(int, BaseUnarmedStrength);
563 DATA_BASE_VALUE(int, BaseBiteStrength);
564 DATA_BASE_VALUE(int, BaseKickStrength);
565 DATA_BASE_VALUE(int, AttackStyle);
566 DATA_BASE_TRUTH(CanUseEquipment);
567 DATA_BASE_TRUTH(CanKick);
568 DATA_BASE_TRUTH(CanTalk);
569 DATA_BASE_TRUTH(CanBeWished);
570 DATA_BASE_VALUE(sLong, ClassStates);
571 DATA_BASE_VALUE(sLong, WhatThrowItemTypesToThrow);
572 DATA_BASE_VALUE(const fearray<festring>&, Alias);
573 DATA_BASE_TRUTH(CreateGolemMaterialConfigurations);
574 DATA_BASE_VALUE(const fearray<sLong>&, KnownCWeaponSkills);
575 DATA_BASE_VALUE(const fearray<sLong>&, CWeaponSkillHits);
576 DATA_BASE_VALUE(int, RightSWeaponSkillHits);
577 DATA_BASE_VALUE(int, LeftSWeaponSkillHits);
578 DATA_BASE_VALUE(int, PanicLevel);
579 DATA_BASE_TRUTH(CanBeCloned);
580 DATA_BASE_VALUE(cfestring&, DefaultName);
581 DATA_BASE_VALUE(const fearray<festring>&, FriendlyReplies);
582 DATA_BASE_VALUE(const fearray<festring>&, HostileReplies);
583 DATA_BASE_VALUE(int, FleshMaterial);
584 virtual DATA_BASE_TRUTH(HasALeg);
585 virtual DATA_BASE_VALUE(cfestring&, DeathMessage);
586 DATA_BASE_VALUE(int, HPRequirementForGeneration);
587 DATA_BASE_TRUTH(IsExtraCoward);
588 DATA_BASE_TRUTH(SpillsBlood);
589 DATA_BASE_TRUTH(HasEyes);
590 virtual DATA_BASE_TRUTH(HasHead);
591 DATA_BASE_TRUTH(CanThrow);
592 DATA_BASE_TRUTH(UsesNutrition);
593 DATA_BASE_VALUE(int, AttackWisdomLimit);
594 DATA_BASE_TRUTH(IsUnique);
595 DATA_BASE_VALUE(int, AttachedGod);
596 DATA_BASE_TRUTH(BodyPartsDisappearWhenSevered);
597 DATA_BASE_VALUE(int, Frequency);
598 DATA_BASE_TRUTH(CanBeConfused);
599 DATA_BASE_TRUTH(CanApply);
600 DATA_BASE_VALUE(v2, WieldedPosition);
601 virtual DATA_BASE_VALUE(int, NaturalSparkleFlags);
602 DATA_BASE_TRUTH(IgnoreDanger);
603 DATA_BASE_TRUTH(BiteCapturesBodyPart);
604 DATA_BASE_TRUTH(IsPlant);
605 DATA_BASE_TRUTH(DestroysWalls);
606 DATA_BASE_TRUTH(IsRooted);
607 DATA_BASE_VALUE(int, BloodMaterial);
608 DATA_BASE_VALUE(int, VomitMaterial);
609 DATA_BASE_TRUTH(AutomaticallySeen);
610 DATA_BASE_VALUE(feuLong, DefaultCommandFlags);
611 DATA_BASE_TRUTH(WillCarryItems);
612 DATA_BASE_VALUE(int, SweatMaterial);
613 DATA_BASE_TRUTH(Sweats);
614 DATA_BASE_TRUTH(IsImmuneToItemTeleport);
615 DATA_BASE_TRUTH(AlwaysUseMaterialAttributes);
616 DATA_BASE_TRUTH(IsEnormous);
617 DATA_BASE_VALUE(const fearray<festring>&, ScienceTalkAdjectiveAttribute);
618 DATA_BASE_VALUE(const fearray<festring>&, ScienceTalkSubstantiveAttribute);
619 DATA_BASE_VALUE(const fearray<festring>&, ScienceTalkPrefix);
620 DATA_BASE_VALUE(const fearray<festring>&, ScienceTalkName);
621 DATA_BASE_VALUE(int, ScienceTalkPossibility);
622 DATA_BASE_VALUE(int, ScienceTalkIntelligenceModifier);
623 DATA_BASE_VALUE(int, ScienceTalkWisdomModifier);
624 DATA_BASE_VALUE(int, ScienceTalkCharismaModifier);
625 DATA_BASE_VALUE(int, ScienceTalkIntelligenceRequirement);
626 DATA_BASE_VALUE(int, ScienceTalkWisdomRequirement);
627 DATA_BASE_VALUE(int, ScienceTalkCharismaRequirement);
628 DATA_BASE_TRUTH(IsExtraFragile);
629 DATA_BASE_TRUTH(IsImmuneToStickiness);
630 DATA_BASE_VALUE(festring, ForceVomitMessage);
631 DATA_BASE_TRUTH(CanChoke);
632 DATA_BASE_VALUE(int, DisplacePriority);
633 DATA_BASE_VALUE(cfestring&, RunDescriptionLineOne);
634 DATA_BASE_VALUE(cfestring&, RunDescriptionLineTwo);
635 DATA_BASE_TRUTH(ForceCustomStandVerb);
636 DATA_BASE_TRUTH(VomittingIsUnhealthy);
637 DATA_BASE_TRUTH(AllowPlayerToChangeEquipment);
638 DATA_BASE_VALUE(int, TamingDifficulty);
639 DATA_BASE_TRUTH(IsMasochist);
640 DATA_BASE_TRUTH(IsSadist);
641 DATA_BASE_TRUTH(IsCatacombCreature);
642 DATA_BASE_TRUTH(CreateUndeadConfigurations);
643 DATA_BASE_TRUTH(UndeadVersions);
644 DATA_BASE_VALUE(int, UndeadAttributeModifier);
645 DATA_BASE_VALUE(int, UndeadVolumeModifier);
646 DATA_BASE_TRUTH(UndeadCopyMaterials);
647 DATA_BASE_TRUTH(CanBeGeneratedOnlyInTheCatacombs);
648 DATA_BASE_TRUTH(IsAlcoholic);
649 DATA_BASE_TRUTH(IsImmuneToWhipOfThievery);
650 DATA_BASE_TRUTH(IsRangedAttacker);
651 DATA_BASE_VALUE(int, WhatCategoryToThrow);
652 DATA_BASE_VALUE(int, WhatWeaponConfigToThrow);
653 DATA_BASE_VALUE(const fearray<int>&, AllowedDungeons);
654 DATA_BASE_VALUE(const fearray<festring>&, LevelTags);
655 DATA_BASE_VALUE(const fearray<festring>&, HomeLevel);
656 DATA_BASE_VALUE(int, NaturalTeam);
657 int GetType () const { return GetProtoType()->GetIndex(); }
658 void TeleportRandomly (truth = false);
659 truth TeleportNear (character *);
660 virtual void InitSpecialAttributes () {}
661 virtual void Kick (lsquare *, int, truth = false) = 0;
662 virtual int GetAttribute (int, truth = true) const;
663 virtual truth EditAttribute (int, int);
664 virtual void EditExperience (int, double, double);
665 truth RawEditAttribute (double &, int) const;
666 void DrawPanel (truth) const;
667 virtual int DrawStats (truth) const = 0;
668 virtual int GetCarryingStrength () const = 0;
669 static truth DamageTypeAffectsInventory (int);
670 virtual int GetRandomStepperBodyPart () const;
671 entity *GetMotherEntity () const { return MotherEntity; }
672 void SetMotherEntity (entity *What) { MotherEntity = What; }
673 virtual int CheckForBlock (character *, item *, double, int, int, int);
674 int CheckForBlockWithArm (character *, item *, arm *, double, int, int, int);
675 void AddBlockMessage (ccharacter *, citem *, cfestring &, truth) const;
676 character *GetPolymorphBackup () const { return PolymorphBackup; }
677 void SetPolymorphBackup (character *What) { PolymorphBackup = What; }
678 cweaponskill *GetCWeaponSkill (int I) const { return &CWeaponSkill[I]; }
679 virtual truth AddSpecialSkillInfo (felist &) const { return false; }
680 virtual truth CheckBalance (double);
681 sLong GetStateAPGain (sLong) const;
682 virtual sLong GetMoveAPRequirement (int) const;
683 virtual void SignalEquipmentAdd (int);
684 virtual void SignalEquipmentRemoval (int, citem *);
685 void BeginTemporaryState (sLong, int);
686 void GainIntrinsic (sLong);
687 void HandleStates ();
688 void PrintBeginPolymorphControlMessage () const;
689 void PrintEndPolymorphControlMessage () const;
690 void PrintBeginLifeSaveMessage () const;
691 void PrintEndLifeSaveMessage () const;
692 void PrintBeginLycanthropyMessage () const;
693 void PrintEndLycanthropyMessage () const;
694 void PrintBeginVampirismMessage () const;
695 void PrintEndVampirismMessage () const;
696 void PrintBeginHasteMessage () const;
697 void PrintEndHasteMessage () const;
698 void PrintBeginSlowMessage () const;
699 void PrintEndSlowMessage () const;
700 void PrintBeginSearchingMessage () const;
701 void PrintEndSearchingMessage () const;
702 void PrintBeginHiccupsMessage () const;
703 void PrintEndHiccupsMessage () const;
704 void EndPolymorph ();
705 void PrintBeginPolymorphLockMessage () const;
706 void PrintEndPolymorphLockMessage () const;
707 void PolymorphLockHandler ();
708 void PrintBeginRegenerationMessage () const;
709 void PrintEndRegenerationMessage () const;
710 void PrintBeginDiseaseImmunityMessage () const;
711 void PrintEndDiseaseImmunityMessage () const;
712 void PrintBeginTeleportLockMessage () const;
713 void PrintEndTeleportLockMessage () const;
714 void PrintBeginSwimmingMessage () const;
715 void PrintEndSwimmingMessage () const;
716 void TeleportLockHandler ();
717 character *ForceEndPolymorph ();
718 void LycanthropyHandler ();
719 void SearchingHandler ();
720 void SaveLife ();
721 void BeginInvisibility ();
722 void BeginInfraVision ();
723 void BeginESP ();
724 void EndInvisibility ();
725 void EndInfraVision ();
726 void EndESP ();
727 void HiccupsHandler ();
728 void VampirismHandler ();
729 void BeginEthereality();
730 void EndEthereality ();
731 void BeginSwimming ();
732 void EndSwimming ();
733 character *PolymorphRandomly (int, int, int);
734 virtual truth EquipmentEasilyRecognized (int) const { return true; }
735 void StartReading (item *, sLong);
736 void DexterityAction (int);
737 void IntelligenceAction (int);
738 virtual void SWeaponSkillTick () {}
739 void PrintBeginInvisibilityMessage () const;
740 void PrintEndInvisibilityMessage () const;
741 void PrintBeginInfraVisionMessage () const;
742 void PrintEndInfraVisionMessage () const;
743 void PrintBeginESPMessage () const;
744 void PrintEndESPMessage () const;
745 void PrintBeginEtherealityMessage() const;
746 void PrintEndEtherealityMessage() const;
747 truth CanBeSeenByPlayer (truth = false, truth = false) const;
748 truth CanBeSeenBy (ccharacter *, truth = false, truth = false) const;
749 void AttachBodyPart (bodypart *);
750 truth HasAllBodyParts () const;
751 bodypart *FindRandomOwnBodyPart (truth) const;
752 bodypart *GenerateRandomBodyPart ();
753 void PrintBeginPoisonedMessage () const;
754 void PrintEndPoisonedMessage () const;
755 truth IsWarm () const;
756 truth IsWarmBlooded() const;
757 void CalculateEquipmentState ();
758 void Draw (blitdata &) const;
759 virtual void DrawBodyParts (blitdata &) const;
760 god *GetMasterGod () const;
761 void PoisonedHandler ();
762 void PrintBeginTeleportMessage () const;
763 void PrintEndTeleportMessage () const;
764 void TeleportHandler ();
765 void DetectHandler ();
766 void PrintEndTeleportControlMessage () const;
767 void PrintBeginTeleportControlMessage () const;
768 void PrintBeginDetectMessage () const;
769 void PrintEndDetectMessage () const;
770 void PolymorphHandler ();
771 void PrintEndPolymorphMessage () const;
772 void PrintBeginPolymorphMessage () const;
773 virtual void DisplayStethoscopeInfo (character *) const;
774 virtual truth CanUseStethoscope (truth) const;
775 virtual truth IsUsingArms () const;
776 virtual truth IsUsingLegs () const;
777 virtual truth IsUsingHead () const;
778 dungeon *GetDungeon () const { return static_cast<level *>(GetSquareUnder()->GetArea())->GetDungeon(); }
779 level *GetLevel () const { return static_cast<level *>(GetSquareUnder()->GetArea()); }
780 area *GetArea () const { return GetSquareUnder()->GetArea(); }
781 virtual square *GetNeighbourSquare (int) const;
782 virtual lsquare *GetNeighbourLSquare (int) const;
783 virtual wsquare *GetNeighbourWSquare (int) const;
784 stack *GetStackUnder (int I = 0) const { return static_cast<lsquare *>(GetSquareUnder(I))->GetStack(); }
785 square *GetNearSquare (v2 Pos) const { return GetSquareUnder()->GetArea()->GetSquare(Pos); }
786 square *GetNearSquare (int x, int y) const { return GetSquareUnder()->GetArea()->GetSquare(x, y); }
787 lsquare *GetNearLSquare (v2 Pos) const { return static_cast<lsquare *>(GetSquareUnder()->GetArea()->GetSquare(Pos)); }
788 lsquare *GetNearLSquare (int x, int y) const { return static_cast<lsquare *>(GetSquareUnder()->GetArea()->GetSquare(x, y)); }
789 wsquare *GetNearWSquare (v2) const;
790 wsquare *GetNearWSquare (int, int) const;
791 v2 GetPos (int I = 0) const { return GetSquareUnder(I)->GetPos(); }
792 square *GetSquareUnder (int I = 0) const { return !MotherEntity ? SquareUnder[I] : MotherEntity->GetSquareUnderEntity(I); }
793 virtual square *GetSquareUnderEntity (int I = 0) const { return GetSquareUnder(I); }
794 lsquare *GetLSquareUnder (int I = 0) const { return static_cast<lsquare *>(GetSquareUnder(I)); }
795 int GetRandomNonVitalBodyPart () const;
796 void TeleportSomePartsAway (int);
797 virtual void SignalVolumeAndWeightChange ();
798 virtual void SignalBodyPartVolumeAndWeightChange () {}
799 void CalculateVolumeAndWeight ();
800 sLong GetVolume () const { return Volume; }
801 sLong GetBodyVolume () const { return BodyVolume; }
802 sLong GetWeight () const { return Weight; }
803 sLong GetCarriedWeight () const { return CarriedWeight; }
804 virtual void SignalEmitationIncrease (col24);
805 virtual void SignalEmitationDecrease (col24);
806 void CalculateEmitation ();
807 void CalculateAll ();
808 void CalculateHP ();
809 void CalculateMaxHP ();
810 int GetHP () const { return HP; }
811 int GetMaxHP () const { return MaxHP; }
812 void CalculateBodyPartMaxHPs (feuLong = MAY_CHANGE_HPS|CHECK_USABILITY);
813 truth IsInitializing () const { return Flags & C_INITIALIZING; }
814 truth IsInNoMsgMode () const { return Flags & C_IN_NO_MSG_MODE; }
815 truth ActivateRandomState (int, int, sLong = 0);
816 sLong GetRandomState (int) const;
817 truth GainRandomIntrinsic (int);
818 virtual void CalculateBattleInfo () = 0;
819 void CalculateBurdenState ();
820 virtual void CalculateDodgeValue ();
821 virtual void CalculateBodyParts () { BodyParts = 1; }
822 virtual void CalculateAllowedWeaponSkillCategories ();
823 int GetBodyParts () const { return BodyParts; }
824 int GetAllowedWeaponSkillCategories () const { return AllowedWeaponSkillCategories; }
825 double GetRelativeDanger (ccharacter *, truth = false) const;
826 double GetTimeToDie (ccharacter *, int, double, truth, truth) const;
827 virtual double GetTimeToKill (ccharacter *, truth) const = 0;
828 virtual void AddSpecialEquipmentInfo (festring &, int) const {}
829 virtual festring GetBodyPartName (int, truth = false) const;
830 item *SearchForItem (feuLong) const;
831 truth SearchForItem (citem *) const;
832 item *SearchForItem (const sweaponskill *) const;
833 truth ContentsCanBeSeenBy (ccharacter *) const;
834 festring GetBeVerb () const;
835 virtual void CreateBlockPossibilityVector (blockvector &, double) const {}
836 virtual truth SpecialUnarmedEffect (character *, v2, int, int, truth) { return false; }
837 virtual truth SpecialKickEffect (character *, v2, int, int, truth) { return false; }
838 virtual truth SpecialBiteEffect (character* Victim, v2 HitPos, int BodyPartIndex, int Direction, truth BlockedByArmour, truth Critical, int DoneDamage) { return false; }
839 truth HitEffect (character *, item *, v2, int, int, int, truth, truth Critical, int DoneDamage);
840 void WeaponSkillHit (item *, int, int);
841 character *Duplicate (feuLong = 0);
842 room *GetRoom (int I=0) const { return GetLSquareUnder(I)->GetRoom(); }
843 truth TryToEquip (item *);
844 truth TryToConsume (item *);
845 void UpdateESPLOS () const;
846 int GetCWeaponSkillLevel (citem *) const;
847 virtual int GetSWeaponSkillLevel (citem *) const { return 0; }
848 void PrintBeginPanicMessage () const;
849 void PrintEndPanicMessage () const;
850 void CheckPanic (int);
851 character *DuplicateToNearestSquare (character *, feuLong = 0);
852 virtual void SignalSpoil (material *m = 0);
853 virtual void SignalSpoilLevelChange (material *m = 0);
854 virtual truth UseMaterialAttributes () const = 0;
855 truth IsPolymorphed () const { return Flags & C_POLYMORPHED; }
856 truth IsInBadCondition () const { return HP * 3 < MaxHP; }
857 truth IsInBadCondition (int HP) const { return HP * 3 < MaxHP; }
858 int GetCondition () const;
859 void UpdatePictures ();
860 truth CanHeal () const;
861 void SetGoingTo (v2);
862 int GetRelation (ccharacter *) const;
863 truth CalculateAttributeBonuses ();
864 void ApplyEquipmentAttributeBonuses (item *);
865 void ReceiveAntidote (sLong);
866 void AddAntidoteConsumeEndMessage () const;
867 truth IsDead () const;
868 void AddOriginalBodyPartID (int, feuLong);
869 void AddToInventory (const fearray<contentscript<item> > &, int);
870 truth HasHadBodyPart (citem *) const;
871 void ProcessAndAddMessage (festring) const;
872 virtual truth CheckZap ();
873 void SetEndurance (int);
874 void SetPerception (int);
875 void SetIntelligence (int);
876 void SetWisdom (int);
877 void SetWillPower (int);
878 void SetCharisma (int);
879 void SetMana (int);
880 void DamageAllItems (character *, int, int);
881 truth Equips (citem *) const;
882 void PrintBeginConfuseMessage () const;
883 void PrintEndConfuseMessage () const;
884 v2 ApplyStateModification (v2) const;
885 void AddConfuseHitMessage () const;
886 item *SelectFromPossessions (cfestring &, sorter = 0);
887 truth SelectFromPossessions (itemvector &, cfestring &, int, sorter = 0);
888 truth EquipsSomething (sorter = 0);
889 truth CheckTalk ();
890 virtual truth CanCreateBodyPart (int) const { return true; }
891 virtual truth HandleCharacterBlockingTheWay (character *, v2, int) { return false; }
892 virtual festring& ProcessMessage (festring &) const;
893 virtual truth IsHumanoid () const { return false; }
894 virtual truth IsHuman () const { return false; }
895 truth IsOnGround () const;
896 virtual truth CheckIfEquipmentIsNotUsable (int) const { return false; }
897 virtual truth MoveTowardsHomePos ();
898 virtual void SetWayPoints (const fearray<packv2> &) {}
899 int HasSomethingToEquipAt (int chosen, truth equippedIsTrue); // counter
900 feuLong HasSomethingToEquipAtRecentTime (int chosen, truth equippedIsTrue); // returns 0, 1 or pickup time
901 truth TryToChangeEquipment (stack *, stack *, int);
902 void PrintBeginParasitizedMessage () const;
903 void PrintEndParasitizedMessage () const;
904 void ParasitizedHandler ();
905 truth CanFollow () const;
906 truth LeftOversAreUnique () const;
907 virtual festring GetKillName () const;
908 festring GetPanelName () const;
909 virtual void AddSpecialStethoscopeInfo (felist &) const = 0;
910 virtual item *GetPairEquipment (int) const { return 0; }
911 bodypart *HealHitPoint ();
912 void CreateHomeData ();
913 room *GetHomeRoom () const;
914 truth HomeDataIsValid () const;
915 void SetHomePos (v2);
916 void RemoveHomeData ();
917 feuLong GetID () const { return ID; }
918 void AddESPConsumeMessage () const;
919 const std::list<feuLong> &GetOriginalBodyPartID (int) const;
920 void GetHitByExplosion (const explosion *, int);
921 truth CanBePoisoned () const { return TorsoIsAlive(); }
922 truth CanBeParasitized () const { return TorsoIsAlive(); }
923 void SortAllItems (const sortdata &);
924 character *GetRandomNeighbourEnemy () const;
925 void Search(int);
926 character *GetRandomNeighbour (int = (HOSTILE|UNCARING|FRIEND)) const;
927 virtual truth IsRetreating () const;
928 virtual truth IsMushroom () const { return false; }
929 void ResetStates ();
930 virtual head *Behead () { return 0; }
931 void PrintBeginGasImmunityMessage () const;
932 void PrintEndGasImmunityMessage () const;
933 void ShowAdventureInfo () const;
934 virtual truth BoundToUse (citem *, int) const { return false; }
935 virtual truth IsBananaGrower () const { return false; }
936 virtual int GetRandomApplyBodyPart () const;
937 #ifdef WIZARD
938 virtual void AddAttributeInfo (festring &) const;
939 virtual void AddAttackInfo (felist &) const = 0;
940 virtual void AddDefenceInfo (felist &) const;
941 virtual void DetachBodyPart ();
942 #endif
943 void ReceiveHolyBanana (sLong);
944 void AddHolyBananaConsumeEndMessage () const;
945 void ReceiveHolyMango (sLong);
946 void AddHolyMangoConsumeEndMessage () const;
947 truth IsHomeLevel (level *lvl) const;
948 virtual truth PreProcessForBone ();
949 truth PostProcessForBone (double &, int &);
950 truth PostProcessForBone ();
951 virtual void FinalProcessForBone ();
952 virtual truth EditAllAttributes (int);
953 virtual void SetSoulID (feuLong);
954 virtual truth SuckSoul (character *) { return false; }
955 virtual truth MustBeRemovedFromBone () const;
956 truth TorsoIsAlive () const { return GetTorso()->IsAlive(); }
957 truth PictureUpdatesAreForbidden () const { return Flags & C_PICTURE_UPDATES_FORBIDDEN; }
958 virtual int GetUsableArms () const { return 0; }
959 truth IsPet () const;
960 virtual void PutTo (v2);
961 void PutTo (lsquare *);
962 void PutNear (v2);
963 void PutToOrNear (v2);
964 virtual void Remove ();
965 truth IsSmall () const { return SquaresUnder == 1; }
966 truth IsOver (v2) const;
967 truth IsOver (citem *) const;
968 truth SquareUnderCanBeSeenByPlayer (truth) const;
969 truth SquareUnderCanBeSeenBy (ccharacter *, truth) const;
970 int GetDistanceSquareFrom (ccharacter *) const;
971 virtual truth CanTheoreticallyMoveOn (const lsquare *) const;
972 virtual truth CanMoveOn (const lsquare *) const;
973 virtual truth CanMoveOn (const square *) const;
974 truth CanMoveOn (const olterrain *) const;
975 truth CanMoveOn (const oterrain *) const;
976 truth IsMainPos (v2 What) const { return GetPos() == What; }
977 virtual void CalculateSquaresUnder () { SquaresUnder = 1; }
978 int GetSquaresUnder () const { return SquaresUnder; }
979 virtual int GetSquareIndex (v2) const { return 0; }
980 virtual int GetNeighbourSquares () const { return 8; }
981 virtual int GetExtendedNeighbourSquares () const { return 9; }
982 virtual int CalculateNewSquaresUnder (lsquare **, v2) const;
983 virtual truth IsFreeForMe (square *) const;
984 void SendNewDrawRequest () const;
985 square *GetNaturalNeighbourSquare (int I) const { return character::GetNeighbourSquare(I); }
986 lsquare *GetNaturalNeighbourLSquare (int I) const { return character::GetNeighbourLSquare(I); }
987 void SignalStepFrom (lsquare **);
988 virtual void SpecialBodyDefenceEffect (character *, bodypart *, int) {}
989 virtual int GetSumOfAttributes () const;
990 truth IsGoingSomeWhere () const { return GoingTo != ERROR_V2; }
991 virtual truth CreateRoute ();
992 void TerminateGoingTo ();
993 virtual truth IsSpy () const { return false; } // does CallForAttention() if true
994 truth CheckForFood (int);
995 truth CheckForFoodInSquare (v2);
996 virtual truth CheckIfSatiated () { return GetNP() > SATIATED_LEVEL; }
997 virtual void SignalNaturalGeneration () {}
998 virtual truth IsBunny () const { return false; }
999 void SetConfig (int, int = 0);
1000 bodypartslot *GetBodyPartSlot (int I) { return &BodyPartSlot[I]; }
1001 virtual truth CheckConsume (cfestring &) const;
1002 virtual int GetTameSymbolSquareIndex () const { return 0; }
1003 virtual int GetFlySymbolSquareIndex () const { return 0; }
1004 virtual int GetSwimmingSymbolSquareIndex () const { return 0; }
1005 virtual int GetUnconsciousSymbolSquareIndex () const { return 0; }
1006 virtual truth PlaceIsIllegal (v2 Pos, v2 Illegal) const { return Pos == Illegal; }
1007 liquid *CreateBlood (sLong) const;
1008 void SpillFluid (character *, liquid*, int = 0);
1009 virtual void StayOn (liquid *);
1010 virtual head *GetVirtualHead () const { return 0; }
1011 truth IsAlly (ccharacter *) const;
1012 virtual truth CanVomit () const { return TorsoIsAlive(); }
1013 feuLong GetLastAcidMsgMin () const { return LastAcidMsgMin; }
1014 void SetLastAcidMsgMin (feuLong What) { LastAcidMsgMin = What; }
1015 virtual truth AllowSpoil () const { return false; }
1016 void Disappear (corpse *, cchar *, truth (item::*)() const);
1017 void ResetSpoiling ();
1018 virtual character *GetLeader () const;
1019 int GetMoveType () const;
1020 virtual truth IsSumoWrestler () const { return false; }
1021 void InitMaterials (const materialscript *, const materialscript *, truth) {}
1022 item *SearchForItem (ccharacter *, sorter) const;
1023 virtual character *CreateZombie () const { return 0; }
1024 virtual festring GetZombieDescription () const;
1025 virtual truth CanAttack () const { return true; }
1026 truth DetectMaterial (cmaterial *) const;
1027 truth CheckIfTooScaredToHit (ccharacter *) const;
1028 void PrintBeginLevitationMessage () const;
1029 void PrintEndLevitationMessage () const;
1030 void EditDealExperience (sLong);
1031 int RawEditExperience (double &, double, double, double) const;
1032 virtual void LeprosyHandler ();
1033 virtual void TryToInfectWithLeprosy (ccharacter *);
1034 void PrintBeginLeprosyMessage () const;
1035 void PrintEndLeprosyMessage () const;
1036 void SignalGeneration ();
1037 void CheckIfSeen ();
1038 void SignalSeen ();
1039 truth HasBeenSeen () const;
1040 int GetPolymorphIntelligenceRequirement () const;
1041 void RemoveAllItems ();
1042 int CalculateWeaponSkillHits (ccharacter *) const;
1043 void DonateEquipmentTo (character *);
1044 void ReceivePeaSoup (sLong);
1045 void AddPeaSoupConsumeEndMessage () const;
1046 void CalculateMaxStamina ();
1047 void EditStamina (int, truth);
1048 void RegenerateStamina ();
1049 void BeginPanic ();
1050 void EndPanic ();
1051 int GetTirednessState () const;
1052 int GetStamina () const { return Stamina; }
1053 int GetMaxStamina () const { return MaxStamina; }
1054 void SetGenerationDanger (double What) { GenerationDanger = What; }
1055 double GetGenerationDanger () const { return GenerationDanger; }
1056 void ReceiveBlackUnicorn (sLong);
1057 void ReceiveGrayUnicorn (sLong);
1058 void ReceiveWhiteUnicorn (sLong);
1059 void DecreaseStateCounter (sLong, int);
1060 truth IsImmuneToLeprosy () const;
1061 bodypart *SearchForOriginalBodyPart (int) const;
1062 void SetLifeExpectancy (int, int);
1063 virtual void DuplicateEquipment (character *, feuLong);
1064 virtual void SignalDisappearance ();
1065 virtual truth HornOfFearWorks () const;
1066 virtual truth CanHear () const;
1067 void BeginLeprosy ();
1068 void EndLeprosy ();
1069 void ReceiveOmmelCerumen (sLong);
1070 void ReceiveOmmelSweat (sLong);
1071 void ReceiveOmmelTears (sLong);
1072 void ReceiveOmmelSnot (sLong);
1073 void ReceiveOmmelBone (sLong);
1074 truth IsSameAs (ccharacter *) const;
1075 feuLong GetCommandFlags () const;
1076 void SetCommandFlags (feuLong What) { CommandFlags = What; }
1077 feuLong GetPossibleCommandFlags () const;
1078 feuLong GetConstantCommandFlags () const;
1079 virtual truth AllowEquipment (citem *, int) const { return true; }
1080 truth ChatMenu ();
1081 truth ChangePetEquipment ();
1082 truth TakePetItems ();
1083 truth GivePetItems ();
1084 truth IssuePetCommands ();
1085 truth ChatIdly ();
1086 truth EquipmentScreen (stack *, stack *);
1087 feuLong GetManagementFlags () const;
1088 cchar *GetVerbalBurdenState () const;
1089 col16 GetVerbalBurdenStateColor () const;
1090 virtual int GetAttributeAverage () const;
1091 virtual cfestring& GetStandVerb () const;
1092 virtual truth CheckApply () const;
1093 virtual truth CanForceVomit () const { return CanVomit(); }
1094 void EndLevitation ();
1095 virtual truth CanMove () const;
1096 void CalculateEnchantments ();
1097 truth GetNewFormForPolymorphWithControl (character *&);
1098 liquid *CreateSweat (sLong) const;
1099 truth IsTemporary () const;
1100 truth TeleportRandomItem (truth);
1101 truth HasClearRouteTo (v2) const;
1102 virtual truth IsTransparent () const;
1103 void SignalPossibleTransparencyChange ();
1104 int GetCursorData () const;
1105 void TryToName ();
1106 double GetSituationDanger (ccharacter *, v2, v2, truth) const;
1107 virtual void ModifySituationDanger (double &) const;
1108 void LycanthropySituationDangerModifier (double &) const;
1109 void PoisonedSituationDangerModifier (double &) const;
1110 void PolymorphingSituationDangerModifier (double &) const;
1111 void PanicSituationDangerModifier (double &) const;
1112 void ConfusedSituationDangerModifier (double &) const;
1113 void ParasitizedSituationDangerModifier (double &) const;
1114 void LeprosySituationDangerModifier (double &) const;
1115 void HiccupsSituationDangerModifier (double &) const;
1116 void VampirismSituationDangerModifier (double &) const;
1117 truth TryToTalkAboutScience ();
1118 truth IsUsingWeaponOfCategory (int) const;
1119 virtual truth IsKamikazeDwarf () const { return false; }
1120 void AddRandomScienceName (festring &) const;
1121 truth IsStuck () const { return truth(TrapData); }
1122 festring GetTrapDescription () const;
1123 truth TryToUnStickTraps (v2);
1124 void RemoveTrap (feuLong);
1125 void AddTrap (feuLong, feuLong);
1126 truth IsStuckToTrap (feuLong) const;
1127 void RemoveTraps ();
1128 void RemoveTraps (int);
1129 int RandomizeHurtBodyPart (feuLong) const;
1130 virtual int RandomizeTryToUnStickBodyPart (feuLong) const { return NONE_INDEX; }
1131 truth BodyPartIsStuck (int) const;
1132 void PrintAttribute (cchar *, int, int, int) const;
1133 virtual truth AllowUnconsciousness () const;
1134 truth CanPanic () const;
1135 int GetRandomBodyPart (feuLong = ALL_BODYPART_FLAGS) const;
1136 virtual truth CanChokeOnWeb (web *) const { return CanChoke(); }
1137 virtual truth BrainsHurt () const { return false; }
1138 truth IsSwimming () const;
1139 truth IsAnimated () const;
1140 virtual truth IsPlayerKind () const { return false; }
1141 truth HasBodyPart (sorter) const;
1142 truth PossessesItem (sorter) const;
1143 truth MoreThanOnePossessesItem (sorter) const;
1144 item *FirstPossessesItem (sorter Sorter) const;
1145 truth IsFlying () const { return GetMoveType() & FLY; }
1146 virtual cchar *GetRunDescriptionLine (int) const;
1147 void VomitAtRandomDirection (int);
1148 virtual truth SpecialSaveLife () { return false; }
1149 void RemoveLifeSavers ();
1150 virtual ccharacter *FindCarrier () const;
1151 virtual cchar *GetNormalDeathMessage () const;
1152 virtual bool IsConscious () const;
1153 void ForcePutNear (v2);
1154 void PrintBeginFearlessMessage() const;
1155 void PrintEndFearlessMessage() const;
1156 void BeginFearless();
1157 void EndFearless();
1158 virtual void ApplySpecialAttributeBonuses () {}
1159 void ReceiveMustardGas (int, sLong);
1160 void ReceiveMustardGasLiquid (int, sLong);
1161 truth IsBadPath (v2) const;
1162 double &GetExpModifierRef (expid);
1163 truth ForgetRandomThing ();
1164 void ApplyAllGodsKnownBonus ();
1165 item *GiveMostExpensiveItem (character *);
1166 void ReceiveItemAsPresent (item *);
1167 item *FindMostExpensiveItem () const;
1168 void ReceiveSirenSong (character *Siren);
1169 character *GetNearestEnemy () const;
1170 truth IsInfectedByMindWorm () const { return !CounterToMindWormHatch; }
1171 void SetCounterToMindWormHatch (int What) { CounterToMindWormHatch = What; }
1172 truth MindWormCanPenetrateSkull (mindworm *) const;
1173 truth CanTameWithDulcis (const character *) const;
1174 truth CanTameWithLyre (const character *) const;
1175 truth CanTameWithScroll (const character *) const;
1176 truth IsCharmable () const { return GetTamingDifficulty() != NO_TAMING; }
1177 truth CheckSadism ();
1178 virtual truth CheckThrowItemOpportunity ();
1179 virtual truth CheckAIZapOpportunity ();
1180 virtual truth CheckInventoryForItemToThrow (item *);
1181 virtual truth HasSadistAttackMode () const { return IsUsingLegs(); }
1182 truth CheckForBeverage ();
1183 void Haste ();
1184 void Slow ();
1185 virtual void SurgicallyDetachBodyPart ();
1186 truth IsAllowedInDungeon (int dunIndex);
1188 protected:
1189 static truth DamageTypeDestroysBodyPart (int);
1190 virtual void LoadSquaresUnder ();
1191 virtual bodypart *MakeBodyPart (int) const;
1192 virtual void SpecialTurnHandler () {}
1193 void Initialize (int, int);
1194 virtual void PostConstruct () {}
1195 void LoadDataBaseStats ();
1196 virtual v2 GetBodyPartBitmapPos (int, truth = false) const;
1197 virtual col16 GetBodyPartColorA (int, truth = false) const;
1198 virtual col16 GetBodyPartColorB (int, truth = false) const;
1199 virtual col16 GetBodyPartColorC (int, truth = false) const;
1200 virtual col16 GetBodyPartColorD (int, truth = false) const;
1201 virtual int GetBodyPartSparkleFlags (int) const;
1202 virtual sLong GetBodyPartSize (int, int) const;
1203 virtual sLong GetBodyPartVolume (int) const;
1204 void UpdateBodyPartPicture (int I, truth);
1205 int ChooseBodyPartToReceiveHit (double, double);
1206 virtual void CreateBodyParts (int);
1207 virtual material *CreateBodyPartMaterial (int, sLong) const;
1208 virtual truth ShowClassDescription () const { return true; }
1209 void SeekLeader (ccharacter *);
1210 virtual truth CheckForUsefulItemsOnGround (truth = true);
1211 truth CheckForDoors ();
1212 truth CheckForEnemies (truth, truth, truth, truth = false);
1213 truth FollowLeader (character *);
1214 void StandIdleAI ();
1215 virtual void CreateCorpse (lsquare *);
1216 void GetPlayerCommand ();
1217 virtual void GetAICommand ();
1218 truth MoveTowardsTarget (truth);
1219 virtual cchar *FirstPersonUnarmedHitVerb () const;
1220 virtual cchar *FirstPersonCriticalUnarmedHitVerb () const;
1221 virtual cchar *ThirdPersonUnarmedHitVerb () const;
1222 virtual cchar *ThirdPersonCriticalUnarmedHitVerb () const;
1223 virtual cchar *FirstPersonKickVerb () const;
1224 virtual cchar *FirstPersonCriticalKickVerb () const;
1225 virtual cchar *ThirdPersonKickVerb () const;
1226 virtual cchar *ThirdPersonCriticalKickVerb () const;
1227 virtual cchar *FirstPersonBiteVerb () const;
1228 virtual cchar *FirstPersonCriticalBiteVerb () const;
1229 virtual cchar *ThirdPersonBiteVerb () const;
1230 virtual cchar *ThirdPersonCriticalBiteVerb () const;
1231 virtual cchar *UnarmedHitNoun () const;
1232 virtual cchar *KickNoun () const;
1233 virtual cchar *BiteNoun () const;
1234 virtual truth AttackIsBlockable (int) const { return true; }
1235 virtual truth AttackMayDamageArmor () const { return true; }
1236 virtual int GetSpecialBodyPartFlags (int) const { return ST_NORMAL; }
1237 virtual int GetBodyPartWobbleData (int) const { return 0; }
1238 virtual int ModifyBodyPartHitPreference (int, int Modifier) const { return Modifier; }
1239 virtual int ModifyBodyPartToHitChance (int, int Chance) const { return Chance; }
1240 virtual truth CanPanicFromSeveredBodyPart () const { return true; }
1241 virtual void SpecialBodyPartSeverReaction () {}
1242 truth AttackAdjacentEnemyAI ();
1243 double RandomizeBabyExperience (double);
1244 static truth IsLimbIndex (int);
1245 virtual truth AllowExperience () const { return true; }
1246 virtual const prototype *FindProtoType () const { return &ProtoType; }
1248 item *GeneralFindItem (ItemCheckerCB chk) const;
1249 int GeneralRemoveItem (ItemCheckerCB chk, truth allItems=false); // return count
1251 public:
1252 static const prototype ProtoType;
1253 stack *Stack;
1254 sLong NP, AP;
1255 sLong TemporaryState;
1256 int TemporaryStateCounter[STATES];
1257 team *Team;
1258 v2 GoingTo;
1259 sLong Money;
1260 int CurrentSweatMaterial;
1261 bodypartslot *BodyPartSlot;
1262 festring AssignedName;
1263 action *Action;
1264 const database *DataBase;
1265 double BaseExperience[BASE_ATTRIBUTES];
1266 std::list<feuLong> *OriginalBodyPartID;
1267 entity *MotherEntity;
1268 character *PolymorphBackup;
1269 cweaponskill *CWeaponSkill;
1270 sLong EquipmentState;
1271 square **SquareUnder;
1272 sLong Volume;
1273 sLong Weight;
1274 sLong CarriedWeight;
1275 sLong BodyVolume;
1276 int HP;
1277 int MaxHP;
1278 int BurdenState;
1279 double DodgeValue;
1280 int AllowedWeaponSkillCategories;
1281 int BodyParts;
1282 sLong RegenerationCounter;
1283 int AttributeBonus[BASE_ATTRIBUTES];
1284 int CarryingBonus;
1285 homedata *HomeData;
1286 feuLong ID;
1287 int SquaresUnder;
1288 std::vector<v2> Route;
1289 std::set<v2> Illegal;
1290 feuLong LastAcidMsgMin;
1291 int Stamina;
1292 int MaxStamina;
1293 int BlocksSinceLastTurn;
1294 double GenerationDanger;
1295 feuLong CommandFlags;
1296 feuLong WarnFlags;
1297 int ScienceTalks;
1298 trapdata *TrapData;
1299 expmodifiermap ExpModifierMap;
1300 int CounterToMindWormHatch;
1302 int mPrevMoveDir;
1306 #ifdef __FILE_OF_STATIC_CHARACTER_PROTOTYPE_DEFINITIONS__
1307 #define CHARACTER_PROTO(name, base)\
1308 template<> const characterprototype\
1309 name##sysbase::ProtoType(&base::ProtoType,\
1310 (characterspawner)(&name##sysbase::Spawn),\
1311 (charactercloner)(&name##sysbase::Clone), #name);
1312 #else
1313 #define CHARACTER_PROTO(name, base)
1314 #endif
1317 #define CHARACTER(name, base)\
1318 class name;\
1319 typedef sysbase<name, base, characterprototype> name##sysbase;\
1320 CHARACTER_PROTO(name, base)\
1321 class name : public name##sysbase
1324 #endif