Mercurial > mm7
diff Indoor.cpp @ 2376:bcd7fadbf7d2
Слияние
author | Ritor1 |
---|---|
date | Mon, 12 May 2014 12:28:06 +0600 |
parents | bddcaf5d5db2 |
children | cb84b457527c |
line wrap: on
line diff
--- a/Indoor.cpp Mon May 12 12:27:50 2014 +0600 +++ b/Indoor.cpp Mon May 12 12:28:06 2014 +0600 @@ -4903,7 +4903,7 @@ return 1; activeLevelDecoration = &pLevelDecorations[v17]; EventProcessor(stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[v17]._idx_in_stru123 - 75] + 380, 0, 1); - activeLevelDecoration = NULL; + activeLevelDecoration = nullptr; } break; @@ -6301,4 +6301,174 @@ if ( result ) result = abs(((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / result); return result; +} + +//----- (00450DA3) -------------------------------------------------------- +int GetAlertStatus() +{ + int result; // eax@2 + + if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) + result = pOutdoor->ddm.field_C_alert; + else + result = uCurrentlyLoadedLevelType == LEVEL_Outdoor ? pIndoor->dlv.field_C_alert : 0; + return result; +} + + +//----- (0045063B) -------------------------------------------------------- +int __fastcall _45063B_spawn_some_monster(MapInfo *a1, int a2) +{ + int result; // eax@8 + int v6; // edi@11 + int v7; // ebx@11 + int v8; // edi@11 + int v9; // ebx@12 + int v10; // eax@12 + char v11; // zf@16 + int v12; // edi@20 + int v13; // eax@20 + int v14; // ebx@20 + int v15; // eax@20 + int v16; // eax@20 + int v17; // eax@20 + int v18; // eax@21 + SpawnPointMM7 v19; // [sp+Ch] [bp-38h]@1 + int v22; // [sp+2Ch] [bp-18h]@3 + unsigned int uFaceID; // [sp+38h] [bp-Ch]@10 + int v26; // [sp+3Ch] [bp-8h]@11 + int v27; // [sp+40h] [bp-4h]@11 + + if (!uNumActors) + return 0; + + for ( uint mon_id = 0; mon_id < uNumActors; ++mon_id ) + { + if ((pActors[mon_id].pMonsterInfo.uID < 121 || pActors[mon_id].pMonsterInfo.uID > 123) && // Dwarf FemaleC A-C + (pActors[mon_id].pMonsterInfo.uID < 124 || pActors[mon_id].pMonsterInfo.uID > 126) && // Dwarf MaleA A-C + (pActors[mon_id].pMonsterInfo.uID < 133 || pActors[mon_id].pMonsterInfo.uID > 135) && // Peasant Elf FemaleA A-C + pActors[mon_id].CanAct()) + { + if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) + { + v22 = 0; + uint face_id = 0; + for ( face_id; face_id < 100; ++face_id ) + { + v6 = rand() % 1024 + 512; + v7 = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; + v19.vPosition.x = pParty->vPosition.x + fixpoint_mul(stru_5C6E00->Cos(v7), v6); + v8 = 0; + v19.uIndex = a2; + v19.vPosition.y = fixpoint_mul(stru_5C6E00->Sin(v7), v6) + pParty->vPosition.y; + v19.vPosition.z = pParty->vPosition.z; + v26 = 0; + v27 = 0; + v19.vPosition.z = ODM_GetFloorLevel(v19.vPosition.x, v19.vPosition.y, pParty->vPosition.z, 0, &v26, &v27, 0); + for( int i = 0; i < pOutdoor->uNumBModels; i++ ) + { + v9 = abs(v19.vPosition.y - pOutdoor->pBModels[i].vBoundingCenter.y); + v10 = abs(v19.vPosition.x - pOutdoor->pBModels[i].vBoundingCenter.x); + if ( int_get_vector_length(v10, v9, 0) < pOutdoor->pBModels[i].sBoundingRadius + 256 ) + { + v22 = 1; + break; + } + } + if ( v22 ) + { + v11 = face_id == 100; + break; + } + } + v11 = face_id == 100; + } + else if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) + { + v22 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); + for ( uint i = 0; i < 100; ++i ) + { + v12 = rand() % 512 + 256; + v13 = rand(); + v14 = v13 % (signed int)stru_5C6E00->uIntegerDoublePi; + v15 = stru_5C6E00->Cos(v13 % (signed int)stru_5C6E00->uIntegerDoublePi); + v19.vPosition.x = pParty->vPosition.x + fixpoint_mul(v15, v12); + v16 = stru_5C6E00->Sin(v13 % (signed int)stru_5C6E00->uIntegerDoublePi); + v19.vPosition.y = fixpoint_mul(v16, v12) + pParty->vPosition.y; + v19.vPosition.z = pParty->vPosition.z; + v19.uIndex = a2; + v17 = pIndoor->GetSector(v19.vPosition.x, v19.vPosition.y, pParty->vPosition.z); + if ( v17 == v22 ) + { + v18 = BLV_GetFloorLevel(v19.vPosition.x, v19.vPosition.y, v19.vPosition.z, v17, &uFaceID); + v19.vPosition.z = v18; + if ( v18 != -30000 ) + { + if ( abs(v18 - pParty->vPosition.z) <= 1024 ) + break; + } + } + } + v11 = v26 == 100; + } + if ( v11 ) + result = 0; + else + { + SpawnEncounter(a1, &v19, 0, 0, 1); + result = a2; + } + } + + //break; + //v22 = v3->pMonsterInfo.uID - 1; + //v4 = (signed __int64)((double)v22 * 0.3333333333333333); + //if ( (int)v4 != 40 ) + //{ + // if ( (int)v4 != 41 && (int)v4 != 44 && v3->CanAct() ) + // break; + //} + //++v2; + //++v3; + //if ( v2 >= (signed int)uNumActors ) + // goto LABEL_8; + } + return result; +} + +//----- (00450521) -------------------------------------------------------- +int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6) +{ + int v6; // edi@1 + int v7; // esi@1 + signed int v8; // edi@1 + unsigned __int16 v9; // cx@1 + // char *v10; // edx@2 + unsigned __int16 v11; // ax@5 + SpriteObject a1; // [sp+8h] [bp-70h]@1 + + v6 = ecx0; + v7 = a2; + pItemsTable->GenerateItem(v6, v7, &a1.stru_24); + v8 = 0; + v9 = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID; + a1.uType = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID; + v11 = 0; + for( int i = 0; i < pObjectList->uNumObjects; i++ ) + { + if( v9 == pObjectList->pObjects[i].uObjectID ) + { + v11 = i; + break; + } + } + a1.uObjectDescID = v11; + a1.vPosition.y = a4; + a1.vPosition.x = a3; + a1.vPosition.z = a5; + a1.uFacing = a6; + a1.uAttributes = 0; + a1.uSectorID = pIndoor->GetSector(a3, a4, a5); + a1.uSpriteFrameID = 0; + return a1.Create(0, 0, 0, 0); } \ No newline at end of file