| 1 | /* |
| 2 | * LegacyClonk |
| 3 | * |
| 4 | * Copyright (c) 1998-2000, Matthes Bender (RedWolf Design) |
| 5 | * Copyright (c) 2017-2020, The LegacyClonk Team and contributors |
| 6 | * |
| 7 | * Distributed under the terms of the ISC license; see accompanying file |
| 8 | * "COPYING" for details. |
| 9 | * |
| 10 | * "Clonk" is a registered trademark of Matthes Bender, used with permission. |
| 11 | * See accompanying file "TRADEMARK" for details. |
| 12 | * |
| 13 | * To redistribute this file separately, substitute the full license texts |
| 14 | * for the above references. |
| 15 | */ |
| 16 | |
| 17 | /* Holds crew member information */ |
| 18 | |
| 19 | #pragma once |
| 20 | |
| 21 | #include <C4Surface.h> |
| 22 | #include <C4InfoCore.h> |
| 23 | #include <C4DefGraphics.h> |
| 24 | #include <C4FacetEx.h> |
| 25 | #include "StdFile.h" |
| 26 | |
| 27 | class C4Object; |
| 28 | |
| 29 | class C4ObjectInfo : public C4ObjectInfoCore |
| 30 | { |
| 31 | public: |
| 32 | C4ObjectInfo(); |
| 33 | ~C4ObjectInfo(); |
| 34 | |
| 35 | public: |
| 36 | bool WasInAction; |
| 37 | bool InAction; |
| 38 | int32_t InActionTime; |
| 39 | bool HasDied; |
| 40 | int32_t ControlCount; |
| 41 | class C4Def *pDef; // definition to ID - only eresolved if defs were loaded at object info loading time |
| 42 | C4Portrait Portrait; // portrait link (usually to def graphics) |
| 43 | C4Portrait *pNewPortrait; // new permanent portrait link (usually to def graphics) |
| 44 | C4Portrait *pCustomPortrait; // if assigned, the Clonk has a custom portrait to be set via SetPortrait("custom") |
| 45 | char Filename[_MAX_PATH + 1]; |
| 46 | C4ObjectInfo *Next; |
| 47 | |
| 48 | public: |
| 49 | void Default(); |
| 50 | void Clear(); |
| 51 | void Evaluate(); |
| 52 | void Retire(); |
| 53 | void Recruit(); |
| 54 | void Draw(C4Facet &cgo, bool fShowPortrait, bool fShowCaptain, C4Object *pOfObj); |
| 55 | bool Save(C4Group &hGroup, bool fStoreTiny, C4DefList *pDefs); |
| 56 | bool Load(C4Group &hGroup, bool fLoadPortrait); |
| 57 | bool Load(C4Group &hMother, const char *szEntryname, bool fLoadPortrait); |
| 58 | bool SetRandomPortrait(C4ID idSourceDef, bool fAssignPermanently, bool fCopyFile); |
| 59 | bool SetPortrait(const char *szPortraitName, C4Def *pSourceDef, bool fAssignPermanently, bool fCopyFile); |
| 60 | bool SetPortrait(C4PortraitGraphics *pNewPortraitGfx, bool fAssignPermanently, bool fCopyFile); |
| 61 | bool ClearPortrait(bool fPermanently); |
| 62 | }; |
| 63 | |