World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Структура MapInfo

#include <MapInfo.h>

Открытые члены

int SpawnRandomTreasure (struct SpawnPointMM7 *a2)
 

Открытые атрибуты

String pName
 
String pFilename
 
String pEncounterMonster1Texture
 
String pEncounterMonster2Texture
 
String pEncounterMonster3Texture
 
unsigned int uNumResets
 
unsigned int uFirstVisitedAt
 
unsigned int uRespawnIntervalDays
 
int _alert_days
 
int _steal_perm
 
int _per
 
char field_2C
 
char LockX5
 
char Trap_D20
 
char Treasure_prob
 
char Encounter_percent
 
char EncM1percent
 
char EncM2percent
 
char EncM3percent
 
char Dif_M1
 
uint8_t uEncounterMonster1AtLeast
 
uint8_t uEncounterMonster1AtMost
 
char Dif_M2
 
uint8_t uEncounterMonster2AtLeast
 
uint8_t uEncounterMonster2AtMost
 
char Dif_M3
 
uint8_t uEncounterMonster3AtLeast
 
uint8_t uEncounterMonster3AtMost
 
char field_3D
 
char field_3E
 
char field_3F
 
uint8_t uRedbookTrackID
 
uint8_t uEAXEnv
 
char field_42
 
char field_43
 

Подробное описание

См. определение в файле MapInfo.h строка 35

Методы

◆ SpawnRandomTreasure()

int MapInfo::SpawnRandomTreasure ( struct SpawnPointMM7 a2)

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

240  {
241  SpriteObject a1a;
242  a1a.containing_item.Reset();
243 
244  int v34 = 0;
245  int v5 = rand() % 100;
246  int v7 = (uint8_t)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob];
247  int v8 = (uint8_t)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob + 1];
248  int v9 = rand();
249  int v10 = v8 - v7 + 1;
250  int64_t v12 = v9;
251  int result = v9 / v10;
252  int v13 = v7 + (uint64_t)(v12 % v10);
253  if (v13 < 7) {
254  if (v5 < 20) return result;
255  if (v5 >= 60) {
256  return sub_450521_ProllyDropItemAt(v13, rand() % 27 + 20,
257  a2->vPosition.x,
258  a2->vPosition.y,
259  a2->vPosition.z, 0);
260  }
261  if (a2->uIndex == 1) {
263  v34 = rand() % 51 + 50;
264  } else if (a2->uIndex == 2) {
266  v34 = rand() % 101 + 100;
267  } else if (a2->uIndex == 3) {
269  v34 = rand() % 301 + 200;
270  } else if (a2->uIndex == 4) {
272  v34 = rand() % 501 + 500;
273  } else if (a2->uIndex == 5) {
275  v34 = rand() % 1001 + 1000;
276  } else if (a2->uIndex == 6) {
278  v34 = rand() % 3001 + 2000;
279  }
284  } else {
286  if (!result) return result;
289  a1a.containing_item.Reset(); // ?? this needs checking
290  }
291  a1a.vPosition.y = a2->vPosition.y;
292  a1a.uAttributes = 0;
293  a1a.uSoundID = 0;
294  a1a.uFacing = 0;
295  a1a.vPosition.z = a2->vPosition.z;
296  a1a.vPosition.x = a2->vPosition.x;
297  a1a.spell_skill = 0;
298  a1a.spell_level = 0;
299  a1a.spell_id = 0;
300  a1a.spell_target_pid = 0;
301  a1a.spell_caster_pid = 0;
302  a1a.uSpriteFrameID = 0;
303  a1a.uSectorID = pIndoor->GetSector(a2->vPosition.x, a2->vPosition.y, a2->vPosition.z);
304 
305  return a1a.Create(0, 0, 0, 0);
306 }

Перекрестные ссылки byte_4E8168, SpriteObject::containing_item, SpriteObject::Create(), ItemGen::GenerateArtifact(), IndoorLocation::GetSector(), ITEM_GOLD_LARGE, ITEM_GOLD_MEDIUM, ITEM_GOLD_SMALL, ObjectList::ObjectIDByItemID(), pIndoor, ItemsTable::pItems, pItemsTable, pObjectList, ItemGen::Reset(), ItemGen::SetIdentified(), ItemGen::special_enchantment, SpriteObject::spell_caster_pid, SpriteObject::spell_id, SpriteObject::spell_level, SpriteObject::spell_skill, SpriteObject::spell_target_pid, sub_450521_ProllyDropItemAt(), Treasure_prob, SpriteObject::uAttributes, SpriteObject::uFacing, SpawnPointMM7::uIndex, ItemGen::uItemID, SpriteObject::uObjectDescID, SpriteObject::uSectorID, SpriteObject::uSoundID, SpriteObject::uSpriteFrameID, SpriteObject::uType, SpriteObject::vPosition и SpawnPointMM7::vPosition.

Используется в ODM_LoadAndInitialize() и PrepareToLoadBLV().

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

Данные класса

◆ pName

◆ pFilename

String MapInfo::pFilename

См. определение в файле MapInfo.h строка 39

Используется в Application::Game::EventLoop(), MapStats::Initialize(), MapStats::sub_410D99_get_map_index() и TravelByTransport().

◆ pEncounterMonster1Texture

String MapInfo::pEncounterMonster1Texture

См. определение в файле MapInfo.h строка 40

Используется в MapStats::Initialize() и SpawnEncounter().

◆ pEncounterMonster2Texture

String MapInfo::pEncounterMonster2Texture

См. определение в файле MapInfo.h строка 41

Используется в MapStats::Initialize() и SpawnEncounter().

◆ pEncounterMonster3Texture

String MapInfo::pEncounterMonster3Texture

См. определение в файле MapInfo.h строка 42

Используется в MapStats::Initialize() и SpawnEncounter().

◆ uNumResets

unsigned int MapInfo::uNumResets

См. определение в файле MapInfo.h строка 43

Используется в MapStats::Initialize().

◆ uFirstVisitedAt

unsigned int MapInfo::uFirstVisitedAt

См. определение в файле MapInfo.h строка 44

Используется в MapStats::Initialize().

◆ uRespawnIntervalDays

unsigned int MapInfo::uRespawnIntervalDays

См. определение в файле MapInfo.h строка 45

Используется в MapStats::Initialize(), ODM_LoadAndInitialize() и PrepareToLoadBLV().

◆ _alert_days

int MapInfo::_alert_days

См. определение в файле MapInfo.h строка 46

Используется в MapStats::Initialize().

◆ _steal_perm

int MapInfo::_steal_perm

См. определение в файле MapInfo.h строка 47

Используется в Actor::ApplyFineForKillingPeasant(), MapStats::Initialize(), Actor::StealFrom() и UIShop_Buy_Identify_Repair().

◆ _per

int MapInfo::_per

См. определение в файле MapInfo.h строка 48

Используется в Party::_497FC5_check_party_perception_against_level() и MapStats::Initialize().

◆ field_2C

char MapInfo::field_2C

См. определение в файле MapInfo.h строка 49

◆ LockX5

char MapInfo::LockX5

См. определение в файле MapInfo.h строка 50

Используется в MapStats::Initialize() и Chest::Open().

◆ Trap_D20

char MapInfo::Trap_D20

См. определение в файле MapInfo.h строка 51

Используется в SpriteObject::ExplosionTraps() и MapStats::Initialize().

◆ Treasure_prob

char MapInfo::Treasure_prob

См. определение в файле MapInfo.h строка 52

Используется в GenerateItemsInChest(), MapStats::Initialize() и SpawnRandomTreasure().

◆ Encounter_percent

char MapInfo::Encounter_percent

См. определение в файле MapInfo.h строка 53

Используется в Application::Game::EventLoop() и MapStats::Initialize().

◆ EncM1percent

char MapInfo::EncM1percent

См. определение в файле MapInfo.h строка 54

Используется в Application::Game::EventLoop() и MapStats::Initialize().

◆ EncM2percent

char MapInfo::EncM2percent

См. определение в файле MapInfo.h строка 55

Используется в Application::Game::EventLoop() и MapStats::Initialize().

◆ EncM3percent

char MapInfo::EncM3percent

См. определение в файле MapInfo.h строка 56

Используется в MapStats::Initialize().

◆ Dif_M1

char MapInfo::Dif_M1

См. определение в файле MapInfo.h строка 57

Используется в MapStats::Initialize() и SpawnEncounter().

◆ uEncounterMonster1AtLeast

uint8_t MapInfo::uEncounterMonster1AtLeast

См. определение в файле MapInfo.h строка 58

Используется в MapStats::Initialize() и SpawnEncounter().

◆ uEncounterMonster1AtMost

uint8_t MapInfo::uEncounterMonster1AtMost

См. определение в файле MapInfo.h строка 59

Используется в MapStats::Initialize() и SpawnEncounter().

◆ Dif_M2

char MapInfo::Dif_M2

См. определение в файле MapInfo.h строка 60

Используется в MapStats::Initialize() и SpawnEncounter().

◆ uEncounterMonster2AtLeast

uint8_t MapInfo::uEncounterMonster2AtLeast

См. определение в файле MapInfo.h строка 61

Используется в MapStats::Initialize() и SpawnEncounter().

◆ uEncounterMonster2AtMost

uint8_t MapInfo::uEncounterMonster2AtMost

См. определение в файле MapInfo.h строка 62

Используется в MapStats::Initialize() и SpawnEncounter().

◆ Dif_M3

char MapInfo::Dif_M3

См. определение в файле MapInfo.h строка 63

Используется в MapStats::Initialize() и SpawnEncounter().

◆ uEncounterMonster3AtLeast

uint8_t MapInfo::uEncounterMonster3AtLeast

См. определение в файле MapInfo.h строка 64

Используется в MapStats::Initialize() и SpawnEncounter().

◆ uEncounterMonster3AtMost

uint8_t MapInfo::uEncounterMonster3AtMost

См. определение в файле MapInfo.h строка 65

Используется в MapStats::Initialize() и SpawnEncounter().

◆ field_3D

char MapInfo::field_3D

См. определение в файле MapInfo.h строка 66

◆ field_3E

char MapInfo::field_3E

См. определение в файле MapInfo.h строка 67

◆ field_3F

char MapInfo::field_3F

См. определение в файле MapInfo.h строка 68

◆ uRedbookTrackID

uint8_t MapInfo::uRedbookTrackID

См. определение в файле MapInfo.h строка 69

Используется в MapStats::Initialize() и PlayLevelMusic().

◆ uEAXEnv

uint8_t MapInfo::uEAXEnv

См. определение в файле MapInfo.h строка 70

Используется в MapStats::Initialize().

◆ field_42

char MapInfo::field_42

См. определение в файле MapInfo.h строка 71

◆ field_43

char MapInfo::field_43

См. определение в файле MapInfo.h строка 72


Объявления и описания членов структур находятся в файлах:
SpriteObject
Definition: SpriteObject.h:189
SpriteObject::uFacing
unsigned __int16 uFacing
Definition: SpriteObject.h:220
ItemGen::SetIdentified
void SetIdentified()
Definition: Items.h:307
SpriteObject::uSectorID
__int16 uSectorID
Definition: SpriteObject.h:223
ObjectList::ObjectIDByItemID
unsigned int ObjectIDByItemID(unsigned int uItemID)
Definition: ObjectList.cpp:7
int64_t
__int64 int64_t
Definition: alext.h:31
SpriteObject::uType
SPRITE_OBJECT_TYPE uType
Definition: SpriteObject.h:215
ItemGen::Reset
void Reset()
Definition: Items.cpp:133
uint64_t
unsigned __int64 uint64_t
Definition: alext.h:32
SpriteObject::uSpriteFrameID
unsigned __int16 uSpriteFrameID
Definition: SpriteObject.h:224
pIndoor
IndoorLocation * pIndoor
Definition: Indoor.cpp:49
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
SpriteObject::uObjectDescID
unsigned __int16 uObjectDescID
Definition: SpriteObject.h:217
pItemsTable
struct ItemsTable * pItemsTable
Definition: Items.cpp:37
ItemGen::special_enchantment
ITEM_ENCHANTMENT special_enchantment
Definition: Items.h:330
sub_450521_ProllyDropItemAt
int sub_450521_ProllyDropItemAt(int ecx0, int a2, int a3, int a4, int a5, uint16_t a6)
Definition: Indoor.cpp:5409
SpriteObject::vPosition
struct Vec3_int_ vPosition
Definition: SpriteObject.h:218
ITEM_GOLD_LARGE
@ ITEM_GOLD_LARGE
Definition: Items.h:99
ItemGen::uItemID
int uItemID
Definition: Items.h:326
SpriteObject::spell_id
int spell_id
Definition: SpriteObject.h:228
ITEM_GOLD_SMALL
@ ITEM_GOLD_SMALL
Definition: Items.h:97
ITEM_ENCHANTMENT
ITEM_ENCHANTMENT
Definition: Items.h:38
SpriteObject::Create
int Create(int yaw, int pitch, int a4, int a5)
Definition: SpriteObject.cpp:56
SpriteObject::containing_item
struct ItemGen containing_item
Definition: SpriteObject.h:227
byte_4E8168
std::array< std::array< char, 14 >, 7 > byte_4E8168
Definition: Items.cpp:25
SPRITE_OBJECT_TYPE
SPRITE_OBJECT_TYPE
Definition: SpriteObject.h:5
SpriteObject::uSoundID
unsigned __int16 uSoundID
Definition: SpriteObject.h:221
uint8_t
unsigned __int8 uint8_t
Definition: SDL_config.h:35
SpriteObject::spell_level
int spell_level
Definition: SpriteObject.h:229
SpriteObject::spell_target_pid
int spell_target_pid
Definition: SpriteObject.h:233
SpriteObject::spell_skill
int spell_skill
Definition: SpriteObject.h:230
SpawnPointMM7::vPosition
Vec3_int_ vPosition
Definition: Indoor.h:314
ItemGen::GenerateArtifact
bool GenerateArtifact()
Definition: Items.cpp:978
IndoorLocation::GetSector
int GetSector(int sX, int sY, int sZ)
Definition: Indoor.cpp:1279
SpawnPointMM7::uIndex
uint16_t uIndex
Definition: Indoor.h:317
MapInfo::Treasure_prob
char Treasure_prob
Definition: MapInfo.h:52
SpriteObject::uAttributes
unsigned __int16 uAttributes
Definition: SpriteObject.h:222
ITEM_GOLD_MEDIUM
@ ITEM_GOLD_MEDIUM
Definition: Items.h:98
pObjectList
struct ObjectList * pObjectList
Definition: ObjectList.cpp:5
ItemsTable::pItems
NZIArray< ItemDesc, 800 > pItems
Definition: Items.h:460
SpriteObject::spell_caster_pid
int spell_caster_pid
Definition: SpriteObject.h:232