ScummVM API documentation
inventory.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Based on the Reverse Engineering work of Christophe Fontanel,
24  * maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/)
25  */
26 
27 #ifndef DM_INVENTORY_H
28 #define DM_INVENTORY_H
29 
30 #include "dm/dm.h"
31 #include "dm/gfx.h"
32 #include "dm/champion.h"
33 #include "dm/dungeonman.h"
34 
35 namespace DM {
36 
37 enum DescriptionMask {
38  kDMDescriptionMaskConsumable = 0x0001, // @ MASK0x0001_DESCRIPTION_CONSUMABLE
39  kDMDescriptionMaskPoisoned = 0x0002, // @ MASK0x0002_DESCRIPTION_POISONED
40  kDMDescriptionMaskBroken = 0x0004, // @ MASK0x0004_DESCRIPTION_BROKEN
41  kDMDescriptionMaskCursed = 0x0008 // @ MASK0x0008_DESCRIPTION_CURSED
42 };
43 
44 enum PanelContent {
45  kDMPanelContentFoodWaterPoisoned = 0, // @ C00_PANEL_FOOD_WATER_POISONED
46  kDMPanelContentScroll = 2, // @ C02_PANEL_SCROLL
47  kDMPanelContentChest = 4, // @ C04_PANEL_CHEST
48  kDMPanelContentResurrectReincarnate = 5 // @ C05_PANEL_RESURRECT_REINCARNATE
49 };
50 
51 #define kDMChampionStatusBoxSpacing 69 // @ C69_CHAMPION_STATUS_BOX_SPACING
52 
53 class InventoryMan {
54  DMEngine *_vm;
55 
56  void initConstants();
57 
58 public:
59  explicit InventoryMan(DMEngine *vm);
60 
61  int16 _inventoryChampionOrdinal; // @ G0423_i_InventoryChampionOrdinal
62  PanelContent _panelContent; // @ G0424_i_PanelContent
63  Thing _chestSlots[8]; // @ G0425_aT_ChestSlots
64  Thing _openChest; // @ G0426_T_OpenChest
65  int16 _objDescTextXpos; // @ G0421_i_ObjectDescriptionTextX
66  int16 _objDescTextYpos; // @ G0422_i_ObjectDescriptionTextY
67  Box _boxPanel;
68  const char *_skillLevelNames[15];
69 
70  void toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE
71  void drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait
72  void drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar
73  void drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color); // @ F0344_INVENTORY_DrawPanel_FoodOrWaterBar
74  void drawPanelFoodWaterPoisoned(); // @ F0345_INVENTORY_DrawPanel_FoodWaterPoisoned
75  void drawPanelResurrectReincarnate(); // @ F0346_INVENTORY_DrawPanel_ResurrectReincarnate
76  void drawPanel(); // @ F0347_INVENTORY_DrawPanel
77  void closeChest(); // @ F0334_INVENTORY_CloseChest
78  void drawPanelScrollTextLine(int16 yPos, char *text); // @ F0340_INVENTORY_DrawPanel_ScrollTextLine
79  void drawPanelScroll(Scroll *scoll); // @ F0341_INVENTORY_DrawPanel_Scroll
80  void openAndDrawChest(Thing thingToOpen, Container *chest, bool isPressingEye); // @ F0333_INVENTORY_OpenAndDrawChest
81  void drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos); // @ F0332_INVENTORY_DrawIconToViewport
82  void buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, const char ** attribStrings,
83  char *destString, const char *prefixString, const char *suffixString); // @ F0336_INVENTORY_DrawPanel_BuildObjectAttributesString
84  void drawPanelObjectDescriptionString(const char *descString); // @ F0335_INVENTORY_DrawPanel_ObjectDescriptionString
85  void drawPanelArrowOrEye(bool pressingEye); // @ F0339_INVENTORY_DrawPanel_ArrowOrEye
86  void drawPanelObject(Thing thingToDraw, bool pressingEye); // @ F0342_INVENTORY_DrawPanel_Object
87  void setDungeonViewPalette(); // @ F0337_INVENTORY_SetDungeonViewPalette
88  void decreaseTorchesLightPower(); // @ F0338_INVENTORY_DecreaseTorchesLightPower_CPSE
89  void drawChampionSkillsAndStatistics(); // @ F0351_INVENTORY_DrawChampionSkillsAndStatistics
90  void drawStopPressingMouth(); // @ F0350_INVENTORY_DrawStopPressingMouth
91  void drawStopPressingEye();// @ F0353_INVENTORY_DrawStopPressingEye
92  void clickOnMouth(); // @ F0349_INVENTORY_ProcessCommand70_ClickOnMouth
93  void adjustStatisticCurrentValue(Champion *champ, uint16 statIndex, int16 valueDelta); // @ F0348_INVENTORY_AdjustStatisticCurrentValue
94  void clickOnEye(); // @ F0352_INVENTORY_ProcessCommand71_ClickOnEye
95 };
96 }
97 
98 #endif
Definition: dm.h:117
Definition: dungeonman.h:491
Definition: dungeonman.h:457
Definition: gfx.h:372
Definition: champion.h:35
Definition: dm.h:155
Definition: inventory.h:53
Definition: champion.h:398