World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию.
51 std::array<class UIAnimation *, 4>
136 for (
int i = 0; i < 4; i++) {
138 v5 = this->
pPlayers[i].GetPerception();
139 if (v5 > uMaxPerception) uMaxPerception = v5;
157 for (
int i = 0; i < 4; ++i) {
158 if (this->
pPlayers[i].CanAct())
return i + 1;
189 for (
int i = 0; i < 4; i++) {
191 this->
pPlayers[i].uTimeToRecovery > 0) {
203 for (
int i = 0; i < 4; i++) {
205 this->
pPlayers[i].uTimeToRecovery == 0) {
206 if (v12 == 0 || this->
pPlayers[i].uSpeedBonus > v8) {
217 for (
int player = 0; player < 4; player++) {
218 for (
int itemPos = 0; itemPos < 138; itemPos++) {
219 if (
pParty->
pPlayers[player].pOwnItems[itemPos].uItemID == uItemID)
265 if (
engine->config->debug_infinite_gold) {
273 if (
engine->config->debug_infinite_food) {
303 unsigned __int64 total_exp = 0;
304 for (
uint i = 0; i < 4; ++i) total_exp +=
pPlayers[i].uExperience;
306 (
unsigned int)(total_exp / 1000),
315 signed int uNumPlayers;
325 this->
pPlayers[0].uCurrentFace = 17;
326 this->
pPlayers[0].uPrevVoiceID = 17;
329 this->
pPlayers[0].uIntelligence = 5;
346 this->
pPlayers[1].uIntelligence = 9;
359 this->
pPlayers[2].uCurrentFace = 14;
360 this->
pPlayers[2].uPrevVoiceID = 14;
363 this->
pPlayers[2].uIntelligence = 9;
376 this->
pPlayers[3].uCurrentFace = 10;
380 this->
pPlayers[3].uPrevVoiceID = 10;
383 this->
pPlayers[3].uIntelligence = 30;
391 for (uNumPlayers = 0; uNumPlayers < 4; uNumPlayers++) {
398 for (
int i = 0; i < 9; i++) {
399 if (
pPlayers[uNumPlayers].pActiveSkills[12 + i]) {
407 if (bDebugGiveItems) {
411 for (uSkillIdx = 0; uSkillIdx < 36; uSkillIdx++) {
481 v16 = 5 * (rand() % 3 + 40);
495 for (
int i = 0; i < 138; i++) {
566 for (
uint i = 0; i < 4; ++i) {
573 pPlayers[i].uExpressionTimePassed = 0;
574 pPlayers[i].uExpressionTimeLength = rand() % 256 + 128;
609 for (
unsigned int i = 0; i <
uNumActors; i++) {
611 if (
v0->Actor::CanAct() &&
612 v0->pMonsterInfo.uHostilityType !=
614 v0->pMonsterInfo.uMovementType !=
646 for (
int playerId = 0; playerId < 4; playerId++) {
647 for (
int buffId = 0; buffId < 24; buffId++) {
648 this->
pPlayers[playerId].pPlayerBuffs[buffId].Reset();
651 for (
int buffId = 0; buffId < 20; buffId++) {
662 for (
int i = 0; i < 4; ++i) {
767 Error(
"Invalid condition: %u",
condition);
772 for (
int i = 0; i < 2; ++i) {
774 if (!hireling->
evt_C)
continue;
782 Assert(
sizeof(
NPCData) == 0x4C);
783 memset(hireling, 0,
sizeof(*hireling));
795 bool have_vessels_soul;
799 for (
int pPlayerID = 0; pPlayerID < 4; ++pPlayerID) {
820 have_vessels_soul =
false;
821 for (
uint i = 0; i < 126; i++) {
826 have_vessels_soul =
true;
828 if (!have_vessels_soul) {
857 void Rest(
unsigned int uMinsToRest) {
858 auto rest_time =
GameTime(0, uMinsToRest);
864 for (
int i = 1; i <= 4; i++) {
888 for (
int i = 0; i < 4; i++) {
939 signed int pActivePlayerCount;
940 int pLearningPercent;
944 pActivePlayerCount = 0;
945 for (
uint i = 0; i < 4; ++i) {
950 pActivePlayerCount++;
953 if (pActivePlayerCount) {
954 pEXPNum = pEXPNum / pActivePlayerCount;
955 for (
uint i = 0; i < 4; ++i) {
964 playermodexp = pEXPNum + pEXPNum * pLearningPercent / 100;
978 int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal) {
983 int hirelingSalaries = 0;
984 unsigned int goldToGain = amount;
987 if (_1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal ==
990 _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal ==
995 unsigned char buf[1024];
997 for (
int i = 0; i < 2; i++) {
1000 buf[hirelingCount] = i;
1005 (!this->pHirelings[0].pName ||
1007 this->pHirelings[0].pName)) &&
1008 (!this->pHirelings[1].pName ||
1010 this->pHirelings[1].pName))) {
1012 buf[hirelingCount] = i + 2;
1015 for (
int i = 0; i < hirelingCount; i++) {
1028 goldToGain += (
signed int)(10 * goldToGain) / 100;
1030 goldToGain += (
signed int)(20 * goldToGain) / 100;
1032 goldToGain += (
signed int)(10 * goldToGain) / 100;
1033 if (hirelingSalaries) {
1035 (
signed int)(goldToGain * hirelingSalaries / 100) / 100;
1036 if (hirelingSalaries < 1) hirelingSalaries = 1;
1044 AddGold(goldToGain - hirelingSalaries);
1061 for (v12 = 0; v12 < 4; v12++) {
1077 object.uSoundID = 0;
1079 object.uAttributes = 8;
1080 object.uSpriteFrameID = 0;
1083 memcpy(&
object.containing_item, &
pParty->
pPickedItem,
sizeof(
object.containing_item));
1113 for (
int i = 0; i < 4; i++) {
1114 current_player = current_player + i;
1115 if (current_player > 4) current_player = current_player - 4;
1134 logger->
Warning(L
"Invalid picture_name detected ::addItem()");
1161 affected[affectedCount] = i;
1163 if (affectedCount >= affectedArrSize)
break;
1167 return affectedCount;
1172 signed int new_travel_time;
1179 if (new_travel_time < 1) new_travel_time = 1;
1180 return new_travel_time;
1186 return (a1[(a2 - 1) >> 3] & (0x80 >> (a2 - 1) % 8)) != 0;
1191 unsigned __int16 bToggle) {
1193 unsigned char set_bit;
1196 set_bit = 0x80 >>
v3 % 8;
1198 pArray[
v3 / 8] |= set_bit;
1200 pArray[
v3 / 8] &= ~set_bit;
1208 for (
unsigned int i = 0; i <
uNumActions - 1; ++i)
@ ITEM_SPELLBOOK_BODY_FIRST_AID
@ CHARACTER_EXPRESSION_PERTIFIED
unsigned int uCurrentTimeSecond
UIAnimation _pUIAnim_WizardEye
void ResetPosMiscAndSpellBuffs()
unsigned int uNumBountiesCollected
@ CHARACTER_EXPRESSION_17
uint32_t int_get_vector_length(int32_t x, int32_t y, int32_t z)
@ Condition_Poison_Medium
const char * GetString(unsigned int index) const
int y_rotation_granularity
static void TakeFood(int amount)
@ CHARACTER_EXPRESSION_30
unsigned int uTimeElapsed
unsigned int uCurrentMonth
void SetUserInterface(PartyAlignment align, bool bReplace)
GameTime & GetPlayingTime()
std::array< char, 29 > pIsArtifactFound
unsigned int uCurrentMinute
UIAnimation _pUIAnum_Torchlight
static void SetFood(int amount)
int GetNextActiveCharacter()
struct PlayerFrame * pFrames
bool _449B57_test_bit(unsigned __int8 *a1, __int16 a2)
@ CHARACTER_EXPRESSION_55
UIAnimation _pUIAnim_Food
unsigned __int8 hirelingScrollPosition
int uDefaultTravelTime_ByFoot
void PlaySound(SoundID eSoundID, int pid, unsigned int uNumRepeats, int x, int y, int a7)
@ CHARACTER_EXPRESSION_DMGRECVD_MAJOR
unsigned int GetAnimLength() const
@ CHARACTER_EXPRESSION_16
std::shared_ptr< Engine > engine
uint16_t pGroups_copy[51]
int GetDaysOfMonth() const
unsigned int uDefaultPartyHeight
unsigned __int8 _quest_bits[64]
Localization * localization
@ CHARACTER_EXPRESSION_DEAD
@ CHARACTER_EXPRESSION_SLEEP
unsigned int uCurrentHour
unsigned int ObjectIDByItemID(unsigned int uItemID)
@ CHARACTER_EXPRESSION_INSANE
char lastOpenedSpellbookPage
CHARACTER_EXPRESSION_ID expression
std::array< Player, 4 > pPlayers
@ CHARACTER_EXPRESSION_DMGRECVD_MINOR
void UpdatePlayersAndHirelingsEmotions()
void sub_421B2C_PlaceInInventory_or_DropPickedItem()
GLenum GLenum GLuint texture
@ CHARACTER_EXPRESSION_CURSED
unsigned int uCurrentMonthWeek
void _494035_timed_effects__water_walking_damage__etc()
@ CHARACTER_EXPRESSION_UNCONCIOUS
std::array< unsigned __int16, 37 > pActiveSkills
void WearItem(unsigned int uItemID)
NZIArray< struct Player *, 5 > pPlayers
std::array< bool, 4 > playerAlreadyPicked
@ ITEM_SPELLBOOK_FIRE_STRIKE
GameTime last_regenerated
unsigned int GetPartyFame()
PartyTimeStruct PartyTimes
struct stru262_TurnBased * pTurnEngine
static void Sleep8Hours()
@ ITEM_SPELLBOOK_AIR_FEATHER_FALL
struct MapStats * pMapStats
std::array< SpellBuff, 20 > pPartyBuffs
unsigned int uLevelMapStatsID
int GetMinutesFraction() const
@ CHARACTER_EXPRESSION_13
int _506F14_resting_stage
bool AddItemToParty(ItemGen *pItem)
struct ItemsTable * pItemsTable
void PartyFindsGold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal)
enum WindowType current_character_screen_window
UIAnimation * pUIAnum_Torchlight
unsigned __int16 uExpressionTimeLength
int GetSecondsFraction() const
@ PLAYER_SKILL_PERCEPTION
@ CHARACTER_EXPRESSION_29
GLenum GLuint GLenum GLsizei const GLchar * buf
@ CHARACTER_EXPRESSION_WEAK
bool _497FC5_check_party_perception_against_level()
std::array< class UIAnimation *, 4 > pUIAnims
@ CHARACTER_EXPRESSION_19
@ CHARACTER_EXPRESSION_PARALYZED
unsigned char days_played_without_rest
int _506F18_num_minutes_to_sleep
unsigned __int16 uExpressionTimePassed
int _6FC_water_lava_timer
NPCProfession pProfessions[59]
struct ViewingParams * viewparams
void GenerateItem(int treasure_level, unsigned int uTreasureType, ItemGen *pItem)
CHARACTER_EXPRESSION_ID expression
@ CHARACTER_EXPRESSION_14
@ PLAYER_SKILL_MEDITATION
int _46A89E_immolation_effect(int *affected, int affectedArrSize, int effectRange)
Texture * GetImage_ColorKey(const String &name, uint16_t colorkey)
TurnBased_QueueElem pQueue[530]
@ ITEM_SPELLBOOK_WATER_POISON_SPRAY
static Mouse * ResolveMouse()
struct DDM_DLV_Header dlv
static void TakeGold(int amount)
void Warning(const wchar_t *pFormat,...)
@ ITEM_SPELLBOOK_EARTH_SLOW
std::array< Actor, 500 > pActors
struct PlayerFrameTable * pPlayerFrameTable
char PickedPlayer2_unused
@ CHARACTER_EXPRESSION_56
@ PLAYER_SKILL_TRAP_DISARM
unsigned __int16 uTimeToRecovery
int GetHoursOfDay() const
@ CHARACTER_EXPRESSION_DMGRECVD_MODERATE
UIAnimation _pUIAnim_Gold
struct ActionQueue * pPartyActionQueue
int AddItem2(int uSlot, ItemGen *Src)
void CreateDefaultParty(bool bDebugGiveItems=false)
@ Condition_Poison_Severe
ItemGen pInventoryItemList[126]
int GetWeeksOfMonth() const
bool TestPartyQuestBit(PARTY_QUEST_BITS bit)
UIAnimation * pUIAnim_Gold
struct DDM_DLV_Header ddm
void Add(PartyAction action)
std::array< unsigned __int8, 16 > pArcomageWins
void GivePartyExp(unsigned int pEXPNum)
std::array< NPCData, 2 > pHirelings
unsigned int uNumGoldInBank
@ ITEM_SPELLBOOK_MIND_MIND_BLAST
void RestAndHeal(int minutes)
int GetMonthsOfYear() const
std::array< GameTime, 20 > conditions_times
void Rest(unsigned int uMinsToRest)
bool HasItem(unsigned int uItemID)
void AddMinutes(int minutes)
@ PARTY_BUFF_INVISIBILITY
unsigned int uCurrentDayOfMonth
char PickedPlayer4_unused
@ CHARACTER_EXPRESSION_DISEASED
PLAYER_CLASS_TYPE classType
bool AddItem(struct ItemGen *pItem)
@ CHARACTER_EXPRESSION_ERADICATED
unsigned int GetMajorConditionIdx()
@ MONSTER_MOVEMENT_TYPE_STAIONARY
GLfloat GLfloat GLfloat v2
@ CHARACTER_EXPRESSION_18
unsigned int uActiveCharacter
GLfloat GLfloat GLfloat GLfloat v3
String FormatString(unsigned int index,...) const
UIAnimation * pUIAnim_Food
@ CHARACTER_EXPRESSION_57
void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle)
void __cdecl __debugbreak(void)
static void AI_Flee(unsigned int uActorID, signed int edx0, int uActionLength, struct AIDirection *a4)
struct NPCStats * pNPCStats
static void LoadActualSkyFrame()
@ CHARACTER_EXPRESSION_15
void GameUI_StatusBar_OnEvent(const String &str, unsigned int num_seconds)
void SetHoldingItem(ItemGen *pItem)
void PlaySound(PlayerSpeech speech, int a3)
char PickedPlayer3_unused
@ WINDOW_CharacterWindow_Stats
void SetCursorBitmapFromItemID(unsigned int uItemID)
@ CHARACTER_EXPRESSION_54
std::array< GameTime, 53 > _shop_ban_times
unsigned char _autonote_bits[26]
unsigned int uNumFoodRations
LEVEL_TYPE uCurrentlyLoadedLevelType
int GetSector(int sX, int sY, int sZ)
UIAnimation * pUIAnim_WizardEye
bool CheckHiredNPCSpeciality(unsigned int uProfession)
AudioPlayer * pAudioPlayer
@ Condition_Disease_Severe
@ CHARACTER_EXPRESSION_POISONED
struct GUIMessageQueue * pMessageQueue_50CBD0
@ PLAYER_SKILL_ARMSMASTER
OutdoorLocation * pOutdoor
@ ITEM_SPELLBOOK_SPIRIT_BLESS
unsigned int uCurrentYear
static void AddGold(int amount)
@ CHARACTER_EXPRESSION_20
@ CHARACTER_EXPRESSION_DRUNK
@ CHARACTER_EXPRESSION_FEAR
std::array< __int16, 5 > monster_for_hunting_killed
std::array< SpellBuff, 24 > pPlayerBuffs
static void InitializeActors()
struct ObjectList * pObjectList
std::array< __int16, 5 > monster_id_for_hunting
NZIArray< ItemDesc, 800 > pItems
static void SetGold(int amount)
@ Condition_Disease_Medium
static void GiveFood(int amount)