cosmetix
[k8-i-v-a-n.git] / src / game / char.h
blob1b5887d753365cdd54b68cacc59fb2922c2e4aa3
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 EventHandlerMap 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 &, character * =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 (character *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 MarkAdjacentItemsAsSeen (v2 pos);
458 void GoOn (go *Go, truth FirstStep=false);
459 virtual truth CheckKick () const;
460 virtual int OpenMultiplier () const { return 2; }
461 virtual int CloseMultiplier () const { return 2; }
462 virtual truth CheckThrow () const;
463 virtual truth CheckOffer () const { return true; }
464 int GetTemporaryStateCounter (sLong) const;
465 void EditTemporaryStateCounter (sLong, int);
466 static truth AllowDamageTypeBloodSpill (int);
467 int GetResistance (int) const;
468 virtual int GetGlobalResistance (int Type) const { return GetResistance(Type); }
469 virtual cchar *GetEquipmentName (int) const;
470 virtual bodypart *GetBodyPartOfEquipment (int) const { return 0; }
471 virtual item *GetEquipment (int) const { return 0; }
472 virtual int GetEquipments () const { return 0; }
473 virtual sorter EquipmentSorter (int) const { return 0; }
474 virtual void SetEquipment (int, item *) {}
475 truth IsESPBlockedByEquipment () const;
476 void AddHealingLiquidConsumeEndMessage () const;
477 void AddSchoolFoodConsumeEndMessage () const;
478 void AddSchoolFoodHitMessage () const;
479 void AddOmmelConsumeEndMessage () const;
480 void AddPepsiConsumeEndMessage () const;
481 void AddFrogFleshConsumeEndMessage () const;
482 void AddKoboldFleshConsumeEndMessage () const;
483 void AddKoboldFleshHitMessage () const;
484 void AddBoneConsumeEndMessage () const;
485 void AddBlackUnicornConsumeEndMessage () const;
486 void AddGrayUnicornConsumeEndMessage () const;
487 void AddWhiteUnicornConsumeEndMessage () const;
488 void AddOmmelBoneConsumeEndMessage () const;
489 void AddLiquidHorrorConsumeEndMessage() const;
490 void AddAlienFleshConsumeEndMessage() const;
491 void PrintInfo () const;
492 virtual item *SevereBodyPart (int, truth = false, stack * = 0);
493 virtual truth TryToRiseFromTheDead ();
494 virtual truth RaiseTheDead (character *);
495 bodypart *CreateBodyPart (int, int = 0);
496 virtual truth EquipmentIsAllowed (int) const { return true; }
497 truth CanUseEquipment (int) const;
498 const database *GetDataBase () const { return DataBase; }
499 void SetParameters (int) {}
500 virtual double GetNaturalExperience (int) const;
501 DATA_BASE_VALUE(const prototype *, ProtoType);
502 DATA_BASE_VALUE(int, Config);
503 DATA_BASE_VALUE(int, DefaultEndurance);
504 DATA_BASE_VALUE(int, DefaultPerception);
505 DATA_BASE_VALUE(int, DefaultIntelligence);
506 DATA_BASE_VALUE(int, DefaultWisdom);
507 DATA_BASE_VALUE(int, DefaultWillPower);
508 DATA_BASE_VALUE(int, DefaultCharisma);
509 DATA_BASE_VALUE(int, DefaultMana);
510 DATA_BASE_VALUE(int, DefaultArmStrength);
511 DATA_BASE_VALUE(int, DefaultLegStrength);
512 DATA_BASE_VALUE(int, DefaultDexterity);
513 DATA_BASE_VALUE(int, DefaultAgility);
514 DATA_BASE_VALUE(sLong, DefaultMoney);
515 DATA_BASE_VALUE(int, TotalSize);
516 DATA_BASE_TRUTH(CanRead);
517 DATA_BASE_VALUE(int, Sex);
518 DATA_BASE_TRUTH(CanBeGenerated);
519 DATA_BASE_VALUE(int, CriticalModifier);
520 DATA_BASE_TRUTH(CanOpen);
521 DATA_BASE_VALUE(int, EnergyResistance);
522 DATA_BASE_VALUE(int, FireResistance);
523 DATA_BASE_VALUE(int, PoisonResistance);
524 DATA_BASE_VALUE(int, ElectricityResistance);
525 DATA_BASE_VALUE(int, AcidResistance);
526 DATA_BASE_VALUE(int, SoundResistance);
527 DATA_BASE_VALUE(int, ConsumeFlags);
528 DATA_BASE_VALUE(sLong, TotalVolume);
529 virtual DATA_BASE_VALUE(v2, HeadBitmapPos);
530 virtual DATA_BASE_VALUE(v2, TorsoBitmapPos);
531 virtual DATA_BASE_VALUE(v2, ArmBitmapPos);
532 virtual DATA_BASE_VALUE(v2, LegBitmapPos);
533 virtual DATA_BASE_VALUE(v2, RightArmBitmapPos);
534 virtual DATA_BASE_VALUE(v2, LeftArmBitmapPos);
535 virtual DATA_BASE_VALUE(v2, RightLegBitmapPos);
536 virtual DATA_BASE_VALUE(v2, LeftLegBitmapPos);
537 virtual DATA_BASE_VALUE(v2, GroinBitmapPos);
538 virtual DATA_BASE_VALUE(col16, ClothColor);
539 virtual DATA_BASE_VALUE(col16, SkinColor);
540 virtual DATA_BASE_VALUE(col16, CapColor);
541 virtual DATA_BASE_VALUE(col16, HairColor);
542 virtual DATA_BASE_VALUE(col16, EyeColor);
543 virtual DATA_BASE_VALUE(col16, TorsoMainColor);
544 virtual DATA_BASE_VALUE(col16, BeltColor);
545 virtual DATA_BASE_VALUE(col16, BootColor);
546 virtual DATA_BASE_VALUE(col16, TorsoSpecialColor);
547 virtual DATA_BASE_VALUE(col16, ArmMainColor);
548 virtual DATA_BASE_VALUE(col16, GauntletColor);
549 virtual DATA_BASE_VALUE(col16, ArmSpecialColor);
550 virtual DATA_BASE_VALUE(col16, LegMainColor);
551 virtual DATA_BASE_VALUE(col16, LegSpecialColor);
552 virtual DATA_BASE_TRUTH(IsNameable);
553 virtual DATA_BASE_VALUE(col24, BaseEmitation); // devirtualize ASAP
554 DATA_BASE_TRUTH(UsesLongArticle);
555 DATA_BASE_VALUE(cfestring&, Adjective);
556 DATA_BASE_TRUTH(UsesLongAdjectiveArticle);
557 DATA_BASE_VALUE(cfestring&, NameSingular);
558 DATA_BASE_VALUE(cfestring&, NamePlural);
559 DATA_BASE_VALUE(cfestring&, PostFix);
560 DATA_BASE_VALUE(int, ArticleMode);
561 DATA_BASE_TRUTH(CanZap);
562 virtual DATA_BASE_TRUTH(IsPolymorphable);
563 DATA_BASE_VALUE(int, BaseUnarmedStrength);
564 DATA_BASE_VALUE(int, BaseBiteStrength);
565 DATA_BASE_VALUE(int, BaseKickStrength);
566 DATA_BASE_VALUE(int, AttackStyle);
567 DATA_BASE_TRUTH(CanUseEquipment);
568 DATA_BASE_TRUTH(CanKick);
569 DATA_BASE_TRUTH(CanTalk);
570 DATA_BASE_TRUTH(CanBeWished);
571 DATA_BASE_VALUE(sLong, ClassStates);
572 DATA_BASE_VALUE(sLong, WhatThrowItemTypesToThrow);
573 DATA_BASE_VALUE(const fearray<festring>&, Alias);
574 DATA_BASE_TRUTH(CreateGolemMaterialConfigurations);
575 DATA_BASE_VALUE(const fearray<sLong>&, KnownCWeaponSkills);
576 DATA_BASE_VALUE(const fearray<sLong>&, CWeaponSkillHits);
577 DATA_BASE_VALUE(int, RightSWeaponSkillHits);
578 DATA_BASE_VALUE(int, LeftSWeaponSkillHits);
579 DATA_BASE_VALUE(int, PanicLevel);
580 DATA_BASE_TRUTH(CanBeCloned);
581 DATA_BASE_VALUE(cfestring&, DefaultName);
582 DATA_BASE_VALUE(const fearray<festring>&, FriendlyReplies);
583 DATA_BASE_VALUE(const fearray<festring>&, HostileReplies);
584 DATA_BASE_VALUE(int, FleshMaterial);
585 virtual DATA_BASE_TRUTH(HasALeg);
586 virtual DATA_BASE_VALUE(cfestring&, DeathMessage);
587 DATA_BASE_VALUE(int, HPRequirementForGeneration);
588 DATA_BASE_TRUTH(IsExtraCoward);
589 DATA_BASE_TRUTH(SpillsBlood);
590 DATA_BASE_TRUTH(HasEyes);
591 virtual DATA_BASE_TRUTH(HasHead);
592 DATA_BASE_TRUTH(CanThrow);
593 DATA_BASE_TRUTH(UsesNutrition);
594 DATA_BASE_VALUE(int, AttackWisdomLimit);
595 DATA_BASE_TRUTH(IsUnique);
596 DATA_BASE_VALUE(int, AttachedGod);
597 DATA_BASE_TRUTH(BodyPartsDisappearWhenSevered);
598 DATA_BASE_VALUE(int, Frequency);
599 DATA_BASE_TRUTH(CanBeConfused);
600 DATA_BASE_TRUTH(CanApply);
601 DATA_BASE_VALUE(v2, WieldedPosition);
602 virtual DATA_BASE_VALUE(int, NaturalSparkleFlags);
603 DATA_BASE_TRUTH(IgnoreDanger);
604 DATA_BASE_TRUTH(BiteCapturesBodyPart);
605 DATA_BASE_TRUTH(IsPlant);
606 DATA_BASE_TRUTH(DestroysWalls);
607 DATA_BASE_TRUTH(IsRooted);
608 DATA_BASE_VALUE(int, BloodMaterial);
609 DATA_BASE_VALUE(int, VomitMaterial);
610 DATA_BASE_TRUTH(AutomaticallySeen);
611 DATA_BASE_VALUE(feuLong, DefaultCommandFlags);
612 DATA_BASE_TRUTH(WillCarryItems);
613 DATA_BASE_VALUE(int, SweatMaterial);
614 DATA_BASE_TRUTH(Sweats);
615 DATA_BASE_TRUTH(IsImmuneToItemTeleport);
616 DATA_BASE_TRUTH(AlwaysUseMaterialAttributes);
617 DATA_BASE_TRUTH(IsEnormous);
618 DATA_BASE_VALUE(const fearray<festring>&, ScienceTalkAdjectiveAttribute);
619 DATA_BASE_VALUE(const fearray<festring>&, ScienceTalkSubstantiveAttribute);
620 DATA_BASE_VALUE(const fearray<festring>&, ScienceTalkPrefix);
621 DATA_BASE_VALUE(const fearray<festring>&, ScienceTalkName);
622 DATA_BASE_VALUE(int, ScienceTalkPossibility);
623 DATA_BASE_VALUE(int, ScienceTalkIntelligenceModifier);
624 DATA_BASE_VALUE(int, ScienceTalkWisdomModifier);
625 DATA_BASE_VALUE(int, ScienceTalkCharismaModifier);
626 DATA_BASE_VALUE(int, ScienceTalkIntelligenceRequirement);
627 DATA_BASE_VALUE(int, ScienceTalkWisdomRequirement);
628 DATA_BASE_VALUE(int, ScienceTalkCharismaRequirement);
629 DATA_BASE_TRUTH(IsExtraFragile);
630 DATA_BASE_TRUTH(IsImmuneToStickiness);
631 DATA_BASE_VALUE(festring, ForceVomitMessage);
632 DATA_BASE_TRUTH(CanChoke);
633 DATA_BASE_VALUE(int, DisplacePriority);
634 DATA_BASE_VALUE(cfestring&, RunDescriptionLineOne);
635 DATA_BASE_VALUE(cfestring&, RunDescriptionLineTwo);
636 DATA_BASE_TRUTH(ForceCustomStandVerb);
637 DATA_BASE_TRUTH(VomittingIsUnhealthy);
638 DATA_BASE_TRUTH(AllowPlayerToChangeEquipment);
639 DATA_BASE_VALUE(int, TamingDifficulty);
640 DATA_BASE_TRUTH(IsMasochist);
641 DATA_BASE_TRUTH(IsSadist);
642 DATA_BASE_TRUTH(IsCatacombCreature);
643 DATA_BASE_TRUTH(CreateUndeadConfigurations);
644 DATA_BASE_TRUTH(UndeadVersions);
645 DATA_BASE_VALUE(int, UndeadAttributeModifier);
646 DATA_BASE_VALUE(int, UndeadVolumeModifier);
647 DATA_BASE_TRUTH(UndeadCopyMaterials);
648 DATA_BASE_TRUTH(CanBeGeneratedOnlyInTheCatacombs);
649 DATA_BASE_TRUTH(IsAlcoholic);
650 DATA_BASE_TRUTH(IsImmuneToWhipOfThievery);
651 DATA_BASE_TRUTH(IsRangedAttacker);
652 DATA_BASE_VALUE(int, WhatCategoryToThrow);
653 DATA_BASE_VALUE(int, WhatWeaponConfigToThrow);
654 DATA_BASE_VALUE(const fearray<int>&, AllowedDungeons);
655 DATA_BASE_VALUE(const fearray<festring>&, LevelTags);
656 DATA_BASE_VALUE(const fearray<festring>&, HomeLevel);
657 DATA_BASE_VALUE(int, NaturalTeam);
658 int GetType () const { return GetProtoType()->GetIndex(); }
659 void TeleportRandomly (truth = false);
660 truth TeleportNear (character *);
661 virtual void InitSpecialAttributes () {}
662 virtual void Kick (lsquare *, int, truth = false) = 0;
663 virtual int GetAttribute (int, truth = true) const;
664 virtual truth EditAttribute (int, int);
665 virtual void EditExperience (int, double, double);
666 truth RawEditAttribute (double &, int) const;
667 void DrawPanel (truth) const;
668 virtual int DrawStats (truth) const = 0;
669 virtual int GetCarryingStrength () const = 0;
670 static truth DamageTypeAffectsInventory (int);
671 virtual int GetRandomStepperBodyPart () const;
672 entity *GetMotherEntity () const { return MotherEntity; }
673 void SetMotherEntity (entity *What) { MotherEntity = What; }
674 virtual int CheckForBlock (character *, item *, double, int, int, int);
675 int CheckForBlockWithArm (character *, item *, arm *, double, int, int, int);
676 void AddBlockMessage (ccharacter *, citem *, cfestring &, truth) const;
677 character *GetPolymorphBackup () const { return PolymorphBackup; }
678 void SetPolymorphBackup (character *What) { PolymorphBackup = What; }
679 cweaponskill *GetCWeaponSkill (int I) const { return &CWeaponSkill[I]; }
680 virtual truth AddSpecialSkillInfo (felist &) const { return false; }
681 virtual truth CheckBalance (double);
682 sLong GetStateAPGain (sLong) const;
683 virtual sLong GetMoveAPRequirement (int) const;
684 virtual void SignalEquipmentAdd (int);
685 virtual void SignalEquipmentRemoval (int, citem *);
686 void BeginTemporaryState (sLong, int);
687 void GainIntrinsic (sLong);
688 void HandleStates ();
689 void PrintBeginPolymorphControlMessage () const;
690 void PrintEndPolymorphControlMessage () const;
691 void PrintBeginLifeSaveMessage () const;
692 void PrintEndLifeSaveMessage () const;
693 void PrintBeginLycanthropyMessage () const;
694 void PrintEndLycanthropyMessage () const;
695 void PrintBeginVampirismMessage () const;
696 void PrintEndVampirismMessage () const;
697 void PrintBeginHasteMessage () const;
698 void PrintEndHasteMessage () const;
699 void PrintBeginSlowMessage () const;
700 void PrintEndSlowMessage () const;
701 void PrintBeginSearchingMessage () const;
702 void PrintEndSearchingMessage () const;
703 void PrintBeginHiccupsMessage () const;
704 void PrintEndHiccupsMessage () const;
705 void EndPolymorph ();
706 void PrintBeginPolymorphLockMessage () const;
707 void PrintEndPolymorphLockMessage () const;
708 void PolymorphLockHandler ();
709 void PrintBeginRegenerationMessage () const;
710 void PrintEndRegenerationMessage () const;
711 void PrintBeginDiseaseImmunityMessage () const;
712 void PrintEndDiseaseImmunityMessage () const;
713 void PrintBeginTeleportLockMessage () const;
714 void PrintEndTeleportLockMessage () const;
715 void PrintBeginSwimmingMessage () const;
716 void PrintEndSwimmingMessage () const;
717 void TeleportLockHandler ();
718 character *ForceEndPolymorph ();
719 void LycanthropyHandler ();
720 void SearchingHandler ();
721 void SaveLife ();
722 void BeginInvisibility ();
723 void BeginInfraVision ();
724 void BeginESP ();
725 void EndInvisibility ();
726 void EndInfraVision ();
727 void EndESP ();
728 void HiccupsHandler ();
729 void VampirismHandler ();
730 void BeginEthereality();
731 void EndEthereality ();
732 void BeginSwimming ();
733 void EndSwimming ();
734 character *PolymorphRandomly (int, int, int);
735 virtual truth EquipmentEasilyRecognized (int) const { return true; }
736 void StartReading (item *, sLong);
737 void DexterityAction (int);
738 void IntelligenceAction (int);
739 virtual void SWeaponSkillTick () {}
740 void PrintBeginInvisibilityMessage () const;
741 void PrintEndInvisibilityMessage () const;
742 void PrintBeginInfraVisionMessage () const;
743 void PrintEndInfraVisionMessage () const;
744 void PrintBeginESPMessage () const;
745 void PrintEndESPMessage () const;
746 void PrintBeginEtherealityMessage() const;
747 void PrintEndEtherealityMessage() const;
748 truth CanBeSeenByPlayer (truth = false, truth = false) const;
749 truth CanBeSeenBy (ccharacter *, truth = false, truth = false) const;
750 void AttachBodyPart (bodypart *);
751 truth HasAllBodyParts () const;
752 bodypart *FindRandomOwnBodyPart (truth) const;
753 bodypart *GenerateRandomBodyPart ();
754 void PrintBeginPoisonedMessage () const;
755 void PrintEndPoisonedMessage () const;
756 truth IsWarm () const;
757 truth IsWarmBlooded() const;
758 void CalculateEquipmentState ();
759 void Draw (blitdata &) const;
760 virtual void DrawBodyParts (blitdata &) const;
761 god *GetMasterGod () const;
762 void PoisonedHandler ();
763 void PrintBeginTeleportMessage () const;
764 void PrintEndTeleportMessage () const;
765 void TeleportHandler ();
766 void DetectHandler ();
767 void PrintEndTeleportControlMessage () const;
768 void PrintBeginTeleportControlMessage () const;
769 void PrintBeginDetectMessage () const;
770 void PrintEndDetectMessage () const;
771 void PolymorphHandler ();
772 void PrintEndPolymorphMessage () const;
773 void PrintBeginPolymorphMessage () const;
774 virtual void DisplayStethoscopeInfo (character *) const;
775 virtual truth CanUseStethoscope (truth) const;
776 virtual truth IsUsingArms () const;
777 virtual truth IsUsingLegs () const;
778 virtual truth IsUsingHead () const;
779 dungeon *GetDungeon () const { return static_cast<level *>(GetSquareUnder()->GetArea())->GetDungeon(); }
780 level *GetLevel () const { return static_cast<level *>(GetSquareUnder()->GetArea()); }
781 area *GetArea () const { return GetSquareUnder()->GetArea(); }
782 virtual square *GetNeighbourSquare (int) const;
783 virtual lsquare *GetNeighbourLSquare (int) const;
784 //virtual wsquare *GetNeighbourWSquare (int) const;
785 stack *GetStackUnder (int I = 0) const { return static_cast<lsquare *>(GetSquareUnder(I))->GetStack(); }
786 square *GetNearSquare (v2 Pos) const { return GetSquareUnder()->GetArea()->GetSquare(Pos); }
787 square *GetNearSquare (int x, int y) const { return GetSquareUnder()->GetArea()->GetSquare(x, y); }
788 lsquare *GetNearLSquare (v2 Pos) const { return static_cast<lsquare *>(GetSquareUnder()->GetArea()->GetSquare(Pos)); }
789 lsquare *GetNearLSquare (int x, int y) const { return static_cast<lsquare *>(GetSquareUnder()->GetArea()->GetSquare(x, y)); }
790 wsquare *GetNearWSquare (v2) const;
791 wsquare *GetNearWSquare (int, int) const;
792 v2 GetPos (int I = 0) const { return GetSquareUnder(I)->GetPos(); }
793 square *GetSquareUnder (int I = 0) const { return !MotherEntity ? SquareUnder[I] : MotherEntity->GetSquareUnderEntity(I); }
794 virtual square *GetSquareUnderEntity (int I = 0) const { return GetSquareUnder(I); }
795 lsquare *GetLSquareUnder (int I = 0) const { return static_cast<lsquare *>(GetSquareUnder(I)); }
796 int GetRandomNonVitalBodyPart () const;
797 void TeleportSomePartsAway (int);
798 virtual void SignalVolumeAndWeightChange ();
799 virtual void SignalBodyPartVolumeAndWeightChange () {}
800 void CalculateVolumeAndWeight ();
801 sLong GetVolume () const { return Volume; }
802 sLong GetBodyVolume () const { return BodyVolume; }
803 sLong GetWeight () const { return Weight; }
804 sLong GetCarriedWeight () const { return CarriedWeight; }
805 virtual void SignalEmitationIncrease (col24);
806 virtual void SignalEmitationDecrease (col24);
807 void CalculateEmitation ();
808 void CalculateAll ();
809 void CalculateHP ();
810 void CalculateMaxHP ();
811 int GetHP () const { return HP; }
812 int GetMaxHP () const { return MaxHP; }
813 void CalculateBodyPartMaxHPs (feuLong = MAY_CHANGE_HPS|CHECK_USABILITY);
814 truth IsInitializing () const { return Flags & C_INITIALIZING; }
815 truth IsInNoMsgMode () const { return Flags & C_IN_NO_MSG_MODE; }
816 truth ActivateRandomState (int, int, sLong = 0);
817 sLong GetRandomState (int) const;
818 truth GainRandomIntrinsic (int);
819 virtual void CalculateBattleInfo () = 0;
820 void CalculateBurdenState ();
821 virtual void CalculateDodgeValue ();
822 virtual void CalculateBodyParts () { BodyParts = 1; }
823 virtual void CalculateAllowedWeaponSkillCategories ();
824 int GetBodyParts () const { return BodyParts; }
825 int GetAllowedWeaponSkillCategories () const { return AllowedWeaponSkillCategories; }
826 double GetRelativeDanger (ccharacter *, truth = false) const;
827 double GetTimeToDie (ccharacter *, int, double, truth, truth) const;
828 virtual double GetTimeToKill (ccharacter *, truth) const = 0;
829 virtual void AddSpecialEquipmentInfo (festring &, int) const {}
830 virtual festring GetBodyPartName (int, truth = false) const;
831 item *SearchForItem (feuLong) const;
832 truth SearchForItem (citem *) const;
833 item *SearchForItem (const sweaponskill *) const;
834 truth ContentsCanBeSeenBy (ccharacter *) const;
835 festring GetBeVerb () const;
836 virtual void CreateBlockPossibilityVector (blockvector &, double) const {}
837 virtual truth SpecialUnarmedEffect (character *, v2, int, int, truth) { return false; }
838 virtual truth SpecialKickEffect (character *, v2, int, int, truth) { return false; }
839 virtual truth SpecialBiteEffect (character* Victim, v2 HitPos, int BodyPartIndex, int Direction, truth BlockedByArmour, truth Critical, int DoneDamage) { return false; }
840 truth HitEffect (character *, item *, v2, int, int, int, truth, truth Critical, int DoneDamage);
841 void WeaponSkillHit (item *, int, int);
842 character *Duplicate (feuLong = 0);
843 room *GetRoom (int I=0) const { return GetLSquareUnder(I)->GetRoom(); }
844 truth TryToEquip (item *);
845 truth TryToConsume (item *);
846 void UpdateESPLOS () const;
847 int GetCWeaponSkillLevel (citem *) const;
848 virtual int GetSWeaponSkillLevel (citem *) const { return 0; }
849 void PrintBeginPanicMessage () const;
850 void PrintEndPanicMessage () const;
851 void CheckPanic (int);
852 character *DuplicateToNearestSquare (character *, feuLong = 0);
853 virtual void SignalSpoil (material *m = 0);
854 virtual void SignalSpoilLevelChange (material *m = 0);
855 virtual truth UseMaterialAttributes () const = 0;
856 truth IsPolymorphed () const { return Flags & C_POLYMORPHED; }
857 truth IsInBadCondition () const { return HP * 3 < MaxHP; }
858 truth IsInBadCondition (int HP) const { return HP * 3 < MaxHP; }
859 int GetCondition () const;
860 void UpdatePictures ();
861 truth CanHeal () const;
862 void SetGoingTo (v2);
863 int GetRelation (ccharacter *) const;
864 truth CalculateAttributeBonuses ();
865 void ApplyEquipmentAttributeBonuses (item *);
866 void ReceiveAntidote (sLong);
867 void AddAntidoteConsumeEndMessage () const;
868 truth IsDead () const;
869 void AddOriginalBodyPartID (int, feuLong);
870 void AddToInventory (const fearray<contentscript<item> > &, int);
871 truth HasHadBodyPart (citem *) const;
872 void ProcessAndAddMessage (festring) const;
873 virtual truth CheckZap ();
874 void SetEndurance (int);
875 void SetPerception (int);
876 void SetIntelligence (int);
877 void SetWisdom (int);
878 void SetWillPower (int);
879 void SetCharisma (int);
880 void SetMana (int);
881 void DamageAllItems (character *, int, int);
882 truth Equips (citem *) const;
883 void PrintBeginConfuseMessage () const;
884 void PrintEndConfuseMessage () const;
885 v2 ApplyStateModification (v2) const;
886 void AddConfuseHitMessage () const;
887 item *SelectFromPossessions (cfestring &, sorter = 0);
888 truth SelectFromPossessions (itemvector &, cfestring &, int, sorter = 0);
889 truth EquipsSomething (sorter = 0);
890 truth CheckTalk ();
891 virtual truth CanCreateBodyPart (int) const { return true; }
892 virtual truth HandleCharacterBlockingTheWay (character *, v2, int) { return false; }
893 virtual festring& ProcessMessage (festring &) const;
894 virtual truth IsHumanoid () const { return false; }
895 virtual truth IsHuman () const { return false; }
896 truth IsOnGround () const;
897 virtual truth CheckIfEquipmentIsNotUsable (int) const { return false; }
898 virtual truth MoveTowardsHomePos ();
899 virtual void SetWayPoints (const fearray<packv2> &) {}
900 int HasSomethingToEquipAt (int chosen, truth equippedIsTrue); // counter
901 feuLong HasSomethingToEquipAtRecentTime (int chosen, truth equippedIsTrue); // returns 0, 1 or pickup time
902 int TryToChangeEquipment (stack *, stack *, int); // number of items worn (is this the right word?)
903 void PrintBeginParasitizedMessage () const;
904 void PrintEndParasitizedMessage () const;
905 void ParasitizedHandler ();
906 truth CanFollow () const;
907 truth LeftOversAreUnique () const;
908 virtual festring GetKillName () const;
909 festring GetPanelName () const;
910 virtual void AddSpecialStethoscopeInfo (felist &) const = 0;
911 virtual item *GetPairEquipment (int) const { return 0; }
912 bodypart *HealHitPoint ();
913 void CreateHomeData ();
914 room *GetHomeRoom () const;
915 truth HomeDataIsValid () const;
916 void SetHomePos (v2);
917 void RemoveHomeData ();
918 feuLong GetID () const { return ID; }
919 void AddESPConsumeMessage () const;
920 const std::list<feuLong> &GetOriginalBodyPartID (int) const;
921 void GetHitByExplosion (const explosion *, int);
922 truth CanBePoisoned () const { return TorsoIsAlive(); }
923 truth CanBeParasitized () const { return TorsoIsAlive(); }
924 void SortAllItems (const sortdata &);
925 character *GetRandomNeighbourEnemy () const;
926 void Search(int);
927 character *GetRandomNeighbour (int = (HOSTILE|UNCARING|FRIEND)) const;
928 virtual truth IsRetreating () const;
929 virtual truth IsMushroom () const { return false; }
930 void ResetStates ();
931 virtual head *Behead () { return 0; }
932 void PrintBeginGasImmunityMessage () const;
933 void PrintEndGasImmunityMessage () const;
934 void ShowAdventureInfo () const;
935 virtual truth BoundToUse (citem *, int) const { return false; }
936 virtual truth IsBananaGrower () const { return false; }
937 virtual int GetRandomApplyBodyPart () const;
938 #ifdef WIZARD
939 virtual void AddAttributeInfo (festring &) const;
940 virtual void AddAttackInfo (felist &) const = 0;
941 virtual void AddDefenceInfo (felist &) const;
942 virtual void DetachBodyPart ();
943 #endif
944 void ReceiveHolyBanana (sLong);
945 void AddHolyBananaConsumeEndMessage () const;
946 void ReceiveHolyMango (sLong);
947 void AddHolyMangoConsumeEndMessage () const;
948 truth IsHomeLevel (level *lvl) const;
949 virtual truth PreProcessForBone ();
950 truth PostProcessForBone (double &, int &);
951 truth PostProcessForBone ();
952 virtual void FinalProcessForBone ();
953 virtual truth EditAllAttributes (int);
954 virtual void SetSoulID (feuLong);
955 virtual truth SuckSoul (character *) { return false; }
956 virtual truth MustBeRemovedFromBone () const;
957 truth TorsoIsAlive () const { return GetTorso()->IsAlive(); }
958 truth PictureUpdatesAreForbidden () const { return Flags & C_PICTURE_UPDATES_FORBIDDEN; }
959 virtual int GetUsableArms () const { return 0; }
960 truth IsPet () const;
961 virtual void PutTo (v2);
962 void PutTo (lsquare *);
963 void PutNear (v2);
964 void PutToOrNear (v2);
965 virtual void Remove ();
966 truth IsSmall () const { return SquaresUnder == 1; }
967 truth IsOver (v2) const;
968 truth IsOver (citem *) const;
969 truth SquareUnderCanBeSeenByPlayer (truth) const;
970 truth SquareUnderCanBeSeenBy (ccharacter *, truth) const;
971 int GetDistanceSquareFrom (ccharacter *) const;
972 virtual truth CanTheoreticallyMoveOn (const lsquare *) const;
973 virtual truth CanMoveOn (const lsquare *) const;
974 virtual truth CanMoveOn (const square *) const;
975 truth CanMoveOn (const olterrain *) const;
976 truth CanMoveOn (const oterrain *) const;
977 truth IsMainPos (v2 What) const { return GetPos() == What; }
978 virtual void CalculateSquaresUnder () { SquaresUnder = 1; }
979 int GetSquaresUnder () const { return SquaresUnder; }
980 virtual int GetSquareIndex (v2) const { return 0; }
981 virtual int GetNeighbourSquares () const { return 8; }
982 virtual int GetExtendedNeighbourSquares () const { return 9; }
983 virtual int CalculateNewSquaresUnder (lsquare **, v2) const;
984 virtual truth IsFreeForMe (square *) const;
985 void SendNewDrawRequest () const;
986 square *GetNaturalNeighbourSquare (int I) const { return character::GetNeighbourSquare(I); }
987 lsquare *GetNaturalNeighbourLSquare (int I) const { return character::GetNeighbourLSquare(I); }
988 void SignalStepFrom (lsquare **);
989 virtual void SpecialBodyDefenceEffect (character *, bodypart *, int) {}
990 virtual int GetSumOfAttributes () const;
991 truth IsGoingSomeWhere () const { return GoingTo != ERROR_V2; }
992 virtual truth CreateRoute ();
993 void TerminateGoingTo ();
994 virtual truth IsSpy () const { return false; } // does CallForAttention() if true
995 truth CheckForFood (int);
996 truth CheckForFoodInSquare (v2);
997 virtual truth CheckIfSatiated () { return GetNP() > SATIATED_LEVEL; }
998 virtual void SignalNaturalGeneration () {}
999 virtual truth IsBunny () const { return false; }
1000 virtual truth IsSpider () const { return false; }
1001 void SetConfig (int, int = 0);
1002 bodypartslot *GetBodyPartSlot (int I) { return &BodyPartSlot[I]; }
1003 virtual truth CheckConsume (cfestring &) const;
1004 virtual int GetTameSymbolSquareIndex () const { return 0; }
1005 virtual int GetFlySymbolSquareIndex () const { return 0; }
1006 virtual int GetSwimmingSymbolSquareIndex () const { return 0; }
1007 virtual int GetUnconsciousSymbolSquareIndex () const { return 0; }
1008 virtual truth PlaceIsIllegal (v2 Pos, v2 Illegal) const { return Pos == Illegal; }
1009 liquid *CreateBlood (sLong) const;
1010 void SpillFluid (character *, liquid*, int = 0);
1011 virtual void StayOn (liquid *);
1012 virtual head *GetVirtualHead () const { return 0; }
1013 truth IsAlly (ccharacter *) const;
1014 virtual truth CanVomit () const { return TorsoIsAlive(); }
1015 feuLong GetLastAcidMsgMin () const { return LastAcidMsgMin; }
1016 void SetLastAcidMsgMin (feuLong What) { LastAcidMsgMin = What; }
1017 virtual truth AllowSpoil () const { return false; }
1018 void Disappear (corpse *, cchar *, truth (item::*)() const);
1019 void ResetSpoiling ();
1020 virtual character *GetLeader () const;
1021 int GetMoveType () const;
1022 virtual truth IsSumoWrestler () const { return false; }
1023 void InitMaterials (const materialscript *, const materialscript *, truth) {}
1024 item *SearchForItem (ccharacter *, sorter) const;
1025 virtual character *CreateZombie () const { return 0; }
1026 virtual festring GetZombieDescription () const;
1027 virtual truth CanAttack () const { return true; }
1028 truth DetectMaterial (cmaterial *) const;
1029 truth CheckIfTooScaredToHit (ccharacter *) const;
1030 void PrintBeginLevitationMessage () const;
1031 void PrintEndLevitationMessage () const;
1032 void EditDealExperience (sLong);
1033 int RawEditExperience (double &, double, double, double) const;
1034 virtual void LeprosyHandler ();
1035 virtual void TryToInfectWithLeprosy (ccharacter *);
1036 void PrintBeginLeprosyMessage () const;
1037 void PrintEndLeprosyMessage () const;
1038 void SignalGeneration ();
1039 void CheckIfSeen ();
1040 void SignalSeen ();
1041 truth HasBeenSeen () const;
1042 int GetPolymorphIntelligenceRequirement () const;
1043 void RemoveAllItems ();
1044 int CalculateWeaponSkillHits (ccharacter *) const;
1045 void DonateEquipmentTo (character *);
1046 void ReceivePeaSoup (sLong);
1047 void AddPeaSoupConsumeEndMessage () const;
1048 void CalculateMaxStamina ();
1049 void EditStamina (int, truth);
1050 void RegenerateStamina ();
1051 void BeginPanic ();
1052 void EndPanic ();
1053 int GetTirednessState () const;
1054 int GetStamina () const { return Stamina; }
1055 int GetMaxStamina () const { return MaxStamina; }
1056 void SetGenerationDanger (double What) { GenerationDanger = What; }
1057 double GetGenerationDanger () const { return GenerationDanger; }
1058 void ReceiveBlackUnicorn (sLong);
1059 void ReceiveGrayUnicorn (sLong);
1060 void ReceiveWhiteUnicorn (sLong);
1061 void DecreaseStateCounter (sLong, int);
1062 truth IsImmuneToLeprosy () const;
1063 bodypart *SearchForOriginalBodyPart (int) const;
1064 void SetLifeExpectancy (int, int);
1065 virtual void DuplicateEquipment (character *, feuLong);
1066 virtual void SignalDisappearance ();
1067 virtual truth HornOfFearWorks () const;
1068 virtual truth CanHear () const;
1069 void BeginLeprosy ();
1070 void EndLeprosy ();
1071 void ReceiveOmmelCerumen (sLong);
1072 void ReceiveOmmelSweat (sLong);
1073 void ReceiveOmmelTears (sLong);
1074 void ReceiveOmmelSnot (sLong);
1075 void ReceiveOmmelBone (sLong);
1076 truth IsSameAs (ccharacter *) const;
1077 feuLong GetCommandFlags () const;
1078 void SetCommandFlags (feuLong What) { CommandFlags = What; }
1079 feuLong GetPossibleCommandFlags () const;
1080 feuLong GetConstantCommandFlags () const;
1081 virtual truth AllowEquipment (citem *, int) const { return true; }
1082 truth ChatMenu ();
1083 truth ChangePetEquipment ();
1084 truth TakePetItems ();
1085 truth GivePetItems ();
1086 truth IssuePetCommands ();
1087 truth ChatIdly ();
1088 truth EquipmentScreen (stack *, stack *);
1089 feuLong GetManagementFlags () const;
1090 cchar *GetVerbalBurdenState () const;
1091 col16 GetVerbalBurdenStateColor () const;
1092 virtual int GetAttributeAverage () const;
1093 virtual cfestring& GetStandVerb () const;
1094 virtual truth CheckApply () const;
1095 virtual truth CanForceVomit () const { return CanVomit(); }
1096 void EndLevitation ();
1097 virtual truth CanMove () const;
1098 void CalculateEnchantments ();
1099 truth GetNewFormForPolymorphWithControl (character *&);
1100 liquid *CreateSweat (sLong) const;
1101 truth IsTemporary () const;
1102 truth TeleportRandomItem (truth);
1103 truth HasClearRouteTo (v2) const;
1104 virtual truth IsTransparent () const;
1105 void SignalPossibleTransparencyChange ();
1106 int GetCursorData () const;
1107 void TryToName ();
1108 double GetSituationDanger (ccharacter *, v2, v2, truth) const;
1109 virtual void ModifySituationDanger (double &) const;
1110 void LycanthropySituationDangerModifier (double &) const;
1111 void PoisonedSituationDangerModifier (double &) const;
1112 void PolymorphingSituationDangerModifier (double &) const;
1113 void PanicSituationDangerModifier (double &) const;
1114 void ConfusedSituationDangerModifier (double &) const;
1115 void ParasitizedSituationDangerModifier (double &) const;
1116 void LeprosySituationDangerModifier (double &) const;
1117 void HiccupsSituationDangerModifier (double &) const;
1118 void VampirismSituationDangerModifier (double &) const;
1119 truth TryToTalkAboutScience ();
1120 truth IsUsingWeaponOfCategory (int) const;
1121 virtual truth IsKamikazeDwarf () const { return false; }
1122 void AddRandomScienceName (festring &) const;
1123 truth IsStuck () const { return !!TrapData; }
1124 festring GetTrapDescription () const;
1125 truth TryToUnStickTraps (v2);
1126 void RemoveTrap (feuLong);
1127 void AddTrap (feuLong, feuLong);
1128 truth IsStuckToTrap (feuLong) const;
1129 void RemoveTraps ();
1130 void RemoveTraps (int);
1131 int RandomizeHurtBodyPart (feuLong) const;
1132 virtual int RandomizeTryToUnStickBodyPart (feuLong) const { return NONE_INDEX; }
1133 truth BodyPartIsStuck (int) const;
1134 void PrintAttribute (cchar *, int, int, int) const;
1135 virtual truth AllowUnconsciousness () const;
1136 truth CanPanic () const;
1137 int GetRandomBodyPart (feuLong = ALL_BODYPART_FLAGS) const;
1138 virtual truth CanChokeOnWeb (web *) const { return CanChoke(); }
1139 virtual truth BrainsHurt () const { return false; }
1140 truth IsSwimming () const;
1141 truth IsAnimated () const;
1142 virtual truth IsPlayerKind () const { return false; }
1143 truth HasBodyPart (sorter) const;
1144 truth PossessesItem (sorter) const;
1145 truth MoreThanOnePossessesItem (sorter) const;
1146 item *FirstPossessesItem (sorter Sorter) const;
1147 truth IsFlying () const { return GetMoveType() & FLY; }
1148 virtual cchar *GetRunDescriptionLine (int) const;
1149 void VomitAtRandomDirection (int);
1150 virtual truth SpecialSaveLife () { return false; }
1151 void RemoveLifeSavers ();
1152 virtual ccharacter *FindCarrier () const;
1153 virtual cchar *GetNormalDeathMessage () const;
1154 virtual bool IsConscious () const;
1155 void ForcePutNear (v2);
1156 void PrintBeginFearlessMessage() const;
1157 void PrintEndFearlessMessage() const;
1158 void BeginFearless();
1159 void EndFearless();
1160 virtual void ApplySpecialAttributeBonuses () {}
1161 void ReceiveMustardGas (int, sLong);
1162 void ReceiveMustardGasLiquid (int, sLong);
1163 truth IsBadPath (v2) const;
1164 double &GetExpModifierRef (expid);
1165 truth ForgetRandomThing ();
1166 void ApplyAllGodsKnownBonus ();
1167 item *GiveMostExpensiveItem (character *);
1168 void ReceiveItemAsPresent (item *);
1169 item *FindMostExpensiveItem () const;
1170 void ReceiveSirenSong (character *Siren);
1171 character *GetNearestEnemy () const;
1172 truth IsInfectedByMindWorm () const { return !CounterToMindWormHatch; }
1173 void SetCounterToMindWormHatch (int What) { CounterToMindWormHatch = What; }
1174 truth MindWormCanPenetrateSkull (mindworm *) const;
1175 truth CanTameWithDulcis (const character *) const;
1176 truth CanTameWithLyre (const character *) const;
1177 truth CanTameWithScroll (const character *) const;
1178 truth CanTameWithResurrection (const character*) const;
1179 truth IsCharmable () const { return GetTamingDifficulty() != NO_TAMING; }
1180 truth CheckSadism ();
1181 virtual truth CheckThrowItemOpportunity ();
1182 virtual truth CheckAIZapOpportunity ();
1183 virtual truth CheckInventoryForItemToThrow (item *);
1184 virtual truth HasSadistAttackMode () const { return IsUsingLegs(); }
1185 truth CheckForBeverage ();
1186 void Haste ();
1187 void Slow ();
1188 virtual void SurgicallyDetachBodyPart ();
1189 truth IsAllowedInDungeon (int dunIndex);
1191 inline cchar *GetClassID () const { return (FindProtoType() ? FindProtoType()->GetClassID() : ""); }
1192 virtual const prototype *FindProtoType () const { return &ProtoType; }
1194 // aconfig == -1: any
1195 virtual item *findFirstEquippedItem (cfestring &aclassname, int aconfig=-1) const;
1196 virtual item *findFirstInventoryItem (cfestring &aclassname, int aconfig=-1) const;
1197 virtual item *findFirstItem (cfestring &aclassname, int aconfig=-1) const;
1199 protected:
1200 static truth DamageTypeDestroysBodyPart (int);
1201 virtual void LoadSquaresUnder ();
1202 virtual bodypart *MakeBodyPart (int) const;
1203 virtual void SpecialTurnHandler () {}
1204 void Initialize (int, int);
1205 virtual void PostConstruct () {}
1206 void LoadDataBaseStats ();
1207 virtual v2 GetBodyPartBitmapPos (int, truth = false) const;
1208 virtual col16 GetBodyPartColorA (int, truth = false) const;
1209 virtual col16 GetBodyPartColorB (int, truth = false) const;
1210 virtual col16 GetBodyPartColorC (int, truth = false) const;
1211 virtual col16 GetBodyPartColorD (int, truth = false) const;
1212 virtual int GetBodyPartSparkleFlags (int) const;
1213 virtual sLong GetBodyPartSize (int, int) const;
1214 virtual sLong GetBodyPartVolume (int) const;
1215 void UpdateBodyPartPicture (int I, truth);
1216 int ChooseBodyPartToReceiveHit (double, double);
1217 virtual void CreateBodyParts (int);
1218 virtual material *CreateBodyPartMaterial (int, sLong) const;
1219 virtual truth ShowClassDescription () const { return true; }
1220 void SeekLeader (ccharacter *);
1221 virtual truth CheckForUsefulItemsOnGround (truth = true);
1222 truth CheckForDoors ();
1223 truth CheckForEnemies (truth, truth, truth, truth = false);
1224 truth FollowLeader (character *);
1225 void StandIdleAI ();
1226 virtual void CreateCorpse (lsquare *);
1227 void GetPlayerCommand ();
1228 virtual void GetAICommand ();
1229 truth MoveTowardsTarget (truth);
1230 virtual cchar *FirstPersonUnarmedHitVerb () const;
1231 virtual cchar *FirstPersonCriticalUnarmedHitVerb () const;
1232 virtual cchar *ThirdPersonUnarmedHitVerb () const;
1233 virtual cchar *ThirdPersonCriticalUnarmedHitVerb () const;
1234 virtual cchar *FirstPersonKickVerb () const;
1235 virtual cchar *FirstPersonCriticalKickVerb () const;
1236 virtual cchar *ThirdPersonKickVerb () const;
1237 virtual cchar *ThirdPersonCriticalKickVerb () const;
1238 virtual cchar *FirstPersonBiteVerb () const;
1239 virtual cchar *FirstPersonCriticalBiteVerb () const;
1240 virtual cchar *ThirdPersonBiteVerb () const;
1241 virtual cchar *ThirdPersonCriticalBiteVerb () const;
1242 virtual cchar *UnarmedHitNoun () const;
1243 virtual cchar *KickNoun () const;
1244 virtual cchar *BiteNoun () const;
1245 virtual truth AttackIsBlockable (int) const { return true; }
1246 virtual truth AttackMayDamageArmor () const { return true; }
1247 virtual int GetSpecialBodyPartFlags (int) const { return ST_NORMAL; }
1248 virtual int GetBodyPartWobbleData (int) const { return 0; }
1249 virtual int ModifyBodyPartHitPreference (int, int Modifier) const { return Modifier; }
1250 virtual int ModifyBodyPartToHitChance (int, int Chance) const { return Chance; }
1251 virtual truth CanPanicFromSeveredBodyPart () const { return true; }
1252 virtual void SpecialBodyPartSeverReaction () {}
1253 truth AttackAdjacentEnemyAI ();
1254 double RandomizeBabyExperience (double);
1255 static truth IsLimbIndex (int);
1256 virtual truth AllowExperience () const { return true; }
1258 item *GeneralFindItem (ItemCheckerCB chk) const;
1259 int GeneralRemoveItem (ItemCheckerCB chk, truth allItems=false); // return count
1261 public:
1262 static const prototype ProtoType;
1263 stack *Stack;
1264 sLong NP, AP;
1265 sLong TemporaryState;
1266 int TemporaryStateCounter[STATES];
1267 team *Team;
1268 v2 GoingTo;
1269 sLong Money;
1270 int CurrentSweatMaterial;
1271 bodypartslot *BodyPartSlot;
1272 festring AssignedName;
1273 action *Action;
1274 const database *DataBase;
1275 double BaseExperience[BASE_ATTRIBUTES];
1276 std::list<feuLong> *OriginalBodyPartID;
1277 entity *MotherEntity;
1278 character *PolymorphBackup;
1279 cweaponskill *CWeaponSkill;
1280 sLong EquipmentState;
1281 square **SquareUnder;
1282 sLong Volume;
1283 sLong Weight;
1284 sLong CarriedWeight;
1285 sLong BodyVolume;
1286 int HP;
1287 int MaxHP;
1288 int BurdenState;
1289 double DodgeValue;
1290 int AllowedWeaponSkillCategories;
1291 int BodyParts;
1292 sLong RegenerationCounter;
1293 int AttributeBonus[BASE_ATTRIBUTES];
1294 int CarryingBonus;
1295 homedata *HomeData;
1296 feuLong ID;
1297 int SquaresUnder;
1298 std::vector<v2> Route;
1299 std::set<v2> Illegal;
1300 feuLong LastAcidMsgMin;
1301 int Stamina;
1302 int MaxStamina;
1303 int BlocksSinceLastTurn;
1304 double GenerationDanger;
1305 feuLong CommandFlags;
1306 feuLong WarnFlags;
1307 int ScienceTalks;
1308 trapdata *TrapData;
1309 expmodifiermap ExpModifierMap;
1310 int CounterToMindWormHatch;
1312 int mPrevMoveDir;
1316 #ifdef __FILE_OF_STATIC_CHARACTER_PROTOTYPE_DEFINITIONS__
1317 #define CHARACTER_PROTO(name, base)\
1318 template<> const characterprototype\
1319 name##sysbase::ProtoType(&base::ProtoType,\
1320 (characterspawner)(&name##sysbase::Spawn),\
1321 (charactercloner)(&name##sysbase::Clone), #name);
1322 #else
1323 #define CHARACTER_PROTO(name, base)
1324 #endif
1327 #define CHARACTER(name, base)\
1328 class name;\
1329 typedef sysbase<name, base, characterprototype> name##sysbase;\
1330 CHARACTER_PROTO(name, base)\
1331 class name : public name##sysbase
1334 #endif