World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл Viewport.cpp

См. исходные тексты.

Функции

void ItemInteraction (unsigned int item_id)
 
bool ActorInteraction (unsigned int id)
 
void DecorationInteraction (unsigned int id, unsigned int pid)
 

Функции

◆ ItemInteraction()

void ItemInteraction ( unsigned int  item_id)

См. определение в файле Viewport.cpp строка 224

224  {
225  if (pItemsTable->pItems[pSpriteObjects[item_id].containing_item.uItemID]
226  .uEquipType == EQUIP_GOLD) {
228  pSpriteObjects[item_id].containing_item.special_enchantment, 0);
230  } else {
231  if (pParty->pPickedItem.uItemID) return;
232 
234  471,
235  pItemsTable->pItems[pSpriteObjects[item_id].containing_item.uItemID]
236  .pUnidentifiedName)); // You found an item (%s)!
237 
238  if (pSpriteObjects[item_id].containing_item.uItemID ==
241  if (pSpriteObjects[item_id].containing_item.uItemID ==
244  if (!pParty->AddItemToParty(&pSpriteObjects[item_id].containing_item))
245  pParty->SetHoldingItem(&pSpriteObjects[item_id].containing_item);
246  }
248 }

Перекрестные ссылки _449B7E_toggle_bit(), Party::_quest_bits, Party::AddItemToParty(), ViewingParams::bRedrawGameUI, EQUIP_GOLD, Localization::FormatString(), GameUI_StatusBar_OnEvent(), ITEM_ARTIFACT_SPLITTER, ITEM_SPELLBOOK_MIND_REMOVE_FEAR, localization, SpriteObject::OnInteraction(), Party::PartyFindsGold(), ItemsTable::pItems, pItemsTable, pParty, Party::pPickedItem, pSpriteObjects, Party::SetHoldingItem(), ItemGen::uItemID и viewparams.

Используется в DoInteractionWithTopmostZObject() и Engine::OnGameViewportClick().

+ Граф вызовов:
+ Граф вызова функции:

◆ ActorInteraction()

bool ActorInteraction ( unsigned int  id)

См. определение в файле Viewport.cpp строка 250

250  {
251  if (!pActors[id].GetActorsRelation(0) && pActors[id].ActorFriend() &&
252  pActors[id].CanAct()) {
253  Actor::AI_FaceObject(id, 4, 0, 0);
254  if (pActors[id].sNPC_ID) {
255  pMessageQueue_50CBD0->AddGUIMessage(UIMSG_StartNPCDialogue, id, 0);
256  } else {
257  if (pNPCStats->pGroups_copy[pActors[id].uGroup]) {
259  [pNPCStats->pGroups_copy[pActors[id].uGroup]]) {
260  pParty->uFlags |= 2;
262  sub_4451A8_press_any_key(0, 0, 0);
263  }
264  }
265  }
266  return true;
267  }
268  return false;
269 }

Перекрестные ссылки Actor::AI_FaceObject(), branchless_dialogue_str, pActors, NPCStats::pCatchPhrases, NPCStats::pGroups_copy, pMessageQueue_50CBD0, pNPCStats, pParty, sub_4451A8_press_any_key(), Party::uFlags и UIMSG_StartNPCDialogue.

Используется в DoInteractionWithTopmostZObject() и Engine::OnGameViewportClick().

+ Граф вызовов:
+ Граф вызова функции:

◆ DecorationInteraction()

void DecorationInteraction ( unsigned int  id,
unsigned int  pid 
)

См. определение в файле Viewport.cpp строка 271

271  {
272  if (pLevelDecorations[id].uEventID) {
273  EventProcessor(pLevelDecorations[id].uEventID, pid, 1);
275  } else {
276  if (pLevelDecorations[id].IsInteractive()) {
280  ._decor_events[pLevelDecorations[id]._idx_in_stru123 -
281  75] +
282  380,
283  0, 1);
284  activeLevelDecoration = nullptr;
285  }
286  }
287 }

Перекрестные ссылки activeLevelDecoration, EventProcessor(), LEVEL_DECORATION_VISIBLE_ON_MAP, pLevelDecorations и stru_5E4C90_MapPersistVars.

Используется в DoInteractionWithTopmostZObject() и Engine::OnGameViewportClick().

+ Граф вызовов:
+ Граф вызова функции:
Party::pPickedItem
ItemGen pPickedItem
Definition: Party.h:312
pLevelDecorations
std::array< LevelDecoration, 3000 > pLevelDecorations
Definition: Decoration.cpp:8
pSpriteObjects
std::array< SpriteObject, MAX_SPRITE_OBJECTS > pSpriteObjects
Definition: SpriteObject.cpp:34
sub_4451A8_press_any_key
void sub_4451A8_press_any_key(int a1, int a2, int a4)
Definition: UIDialogue.cpp:615
NPCStats::pGroups_copy
uint16_t pGroups_copy[51]
Definition: NPC.h:177
Actor::AI_FaceObject
static void AI_FaceObject(unsigned int uActorID, unsigned int uObjID, int UNUSED, struct AIDirection *Dir_In)
Definition: Actor.cpp:1072
UIMSG_StartNPCDialogue
@ UIMSG_StartNPCDialogue
Definition: GUIWindow.h:128
Party::_quest_bits
unsigned __int8 _quest_bits[64]
Definition: Party.h:291
localization
Localization * localization
Definition: Localization.cpp:11
EQUIP_GOLD
@ EQUIP_GOLD
Definition: Items.h:246
Party::AddItemToParty
bool AddItemToParty(ItemGen *pItem)
Definition: Party.cpp:1096
pItemsTable
struct ItemsTable * pItemsTable
Definition: Items.cpp:37
Party::PartyFindsGold
void PartyFindsGold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal)
Definition: Party.cpp:976
LEVEL_DECORATION_VISIBLE_ON_MAP
@ LEVEL_DECORATION_VISIBLE_ON_MAP
Definition: Decoration.h:12
NPCStats::pCatchPhrases
char * pCatchPhrases[52]
Definition: NPC.h:169
activeLevelDecoration
LevelDecoration * activeLevelDecoration
Definition: Decoration.cpp:10
pParty
Party * pParty
Definition: Party.cpp:30
viewparams
struct ViewingParams * viewparams
Definition: mm7_data.cpp:22
ItemGen::uItemID
int uItemID
Definition: Items.h:326
pActors
std::array< Actor, 500 > pActors
Definition: Actor.cpp:38
Party::uFlags
unsigned int uFlags
Definition: Party.h:313
branchless_dialogue_str
String branchless_dialogue_str
Definition: mm7_data.cpp:619
id
GLuint id
Definition: SDL_opengl_glext.h:531
Localization::FormatString
String FormatString(unsigned int index,...) const
Definition: Localization.cpp:17
_449B7E_toggle_bit
void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle)
Definition: Party.cpp:1190
pNPCStats
struct NPCStats * pNPCStats
Definition: NPC.cpp:29
GameUI_StatusBar_OnEvent
void GameUI_StatusBar_OnEvent(const String &str, unsigned int num_seconds)
Definition: UIStatusBar.cpp:33
Party::SetHoldingItem
void SetHoldingItem(ItemGen *pItem)
Definition: Party.cpp:150
ViewingParams::bRedrawGameUI
int bRedrawGameUI
Definition: Viewport.h:74
EventProcessor
void EventProcessor(int uEventID, int targetObj, int canShowMessages, int entry_line)
Definition: Events.cpp:260
ITEM_ARTIFACT_SPLITTER
@ ITEM_ARTIFACT_SPLITTER
Definition: Items.h:159
SpriteObject::OnInteraction
static void OnInteraction(unsigned int uLayingItemID)
Definition: SpriteObject.cpp:872
pMessageQueue_50CBD0
struct GUIMessageQueue * pMessageQueue_50CBD0
Definition: GUIWindow.cpp:86
stru_5E4C90_MapPersistVars
stru123 stru_5E4C90_MapPersistVars
Definition: mm7_data.cpp:23
ITEM_SPELLBOOK_MIND_REMOVE_FEAR
@ ITEM_SPELLBOOK_MIND_REMOVE_FEAR
Definition: Items.h:145
ItemsTable::pItems
NZIArray< ItemDesc, 800 > pItems
Definition: Items.h:460