comparison mm7_5.cpp @ 1336:3358b59b8fe8

m
author Ritor1
date Thu, 04 Jul 2013 09:21:40 +0600
parents e70fe5d77928
children c6695ebd8fe6
comparison
equal deleted inserted replaced
1335:ee2672b14d75 1336:3358b59b8fe8
5581 } 5581 }
5582 5582
5583 //----- (00406A63) -------------------------------------------------------- 5583 //----- (00406A63) --------------------------------------------------------
5584 void stru262_TurnBased::_406A63() 5584 void stru262_TurnBased::_406A63()
5585 { 5585 {
5586 stru262_TurnBased *v1; // ebx@1 5586 //stru262_TurnBased *v1; // ebx@1
5587 int v2; // esi@1 5587 //int v2; // esi@1
5588 unsigned __int8 v3; // zf@1 5588 //unsigned __int8 v3; // zf@1
5589 unsigned __int8 v4; // sf@1 5589 //unsigned __int8 v4; // sf@1
5590 signed int v5; // ecx@4 5590 //signed int v5; // ecx@4
5591 AIDirection a3; // [sp+8h] [bp-44h]@5 5591 AIDirection a3; // [sp+8h] [bp-44h]@5
5592 AIDirection v7; // [sp+24h] [bp-28h]@5 5592 AIDirection v7; // [sp+24h] [bp-28h]@5
5593 unsigned int v8; // [sp+40h] [bp-Ch]@5 5593 unsigned int v8; // [sp+40h] [bp-Ch]@5
5594 signed int a2; // [sp+44h] [bp-8h]@1 5594 signed int a2; // [sp+44h] [bp-8h]@1
5595 TurnBased_QueueElem *v10; // [sp+48h] [bp-4h]@2 5595 //TurnBased_QueueElem *v10; // [sp+48h] [bp-4h]@2
5596 5596
5597 v1 = this; 5597 //v1 = this;
5598 v2 = 0; 5598 //v2 = 0;
5599 this->field_8 = 64; 5599 this->field_8 = 64;
5600 dword_50C994 = 0; 5600 dword_50C994 = 0;
5601 uActiveCharacter = 0; 5601 uActiveCharacter = 0;
5602 v3 = this->uActorQueueSize == 0; 5602 //v3 = this->uActorQueueSize == 0;
5603 v4 = this->uActorQueueSize < 0; 5603 //v4 = this->uActorQueueSize < 0;
5604 a2 = 0; 5604
5605 if ( !(v4 | v3) ) 5605 if ( this->uActorQueueSize )
5606 { 5606 {
5607 v10 = this->pQueue; 5607 //v10 = this->pQueue;
5608 while ( 1 ) 5608
5609 { 5609 for ( a2 = 0; a2 < this->uActorQueueSize; ++a2 )
5610 v5 = v10->uPackedID; 5610 {
5611 if (PID_TYPE(v10->uPackedID) == OBJECT_Actor) 5611 //v5 = this->pQueue[a2].uPackedID;
5612 if (PID_TYPE(this->pQueue[a2].uPackedID) == OBJECT_Actor)
5612 { 5613 {
5613 v8 = ai_near_actors_targets_pid[PID_ID(v5)]; 5614 v8 = ai_near_actors_targets_pid[PID_ID(this->pQueue[a2].uPackedID)];
5614 memcpy(&v7, Actor::GetDirectionInfo(v5, v8, &a3, v2), sizeof(v7)); 5615 memcpy(&v7, Actor::GetDirectionInfo(this->pQueue[a2].uPackedID, v8, &a3, 0), sizeof(v7));
5615 if ( !v1->_406D10(a2) ) 5616 if ( !this->_406D10(a2) )
5616 Actor::AI_Stand(PID_ID(v10->uPackedID), v8, 0x20u, &v7); 5617 Actor::AI_Stand(PID_ID(this->pQueue[a2].uPackedID), v8, 0x20u, &v7);//actors move
5617 } 5618 }
5618 ++a2; 5619 //++v10;
5619 ++v10; 5620 //v2 = 0;
5620 if ( a2 >= v1->uActorQueueSize )
5621 break;
5622 v2 = 0;
5623 } 5621 }
5622
5624 } 5623 }
5625 } 5624 }
5626 // 50C994: using guessed type int dword_50C994; 5625 // 50C994: using guessed type int dword_50C994;
5627 5626
5628 //----- (00406AFE) -------------------------------------------------------- 5627 //----- (00406AFE) --------------------------------------------------------
5673 5672
5674 //----- (00406B9F) -------------------------------------------------------- 5673 //----- (00406B9F) --------------------------------------------------------
5675 int stru262_TurnBased::_406B9F() 5674 int stru262_TurnBased::_406B9F()
5676 { 5675 {
5677 signed int result; // eax@1 5676 signed int result; // eax@1
5678 unsigned __int8 v2; // zf@1 5677 Actor *pCurrentActor; // ebx@5
5679 unsigned __int8 v3; // sf@1
5680 int v4; // esi@4
5681 unsigned int v5; // esi@5
5682 Actor *v6; // ebx@5
5683 unsigned __int16 v7; // cx@15
5684 AIDirection a3; // [sp+0h] [bp-50h]@15 5678 AIDirection a3; // [sp+0h] [bp-50h]@15
5685 AIDirection v9; // [sp+1Ch] [bp-34h]@15 5679 AIDirection v9; // [sp+1Ch] [bp-34h]@15
5686 signed int a1; // [sp+38h] [bp-18h]@4
5687 stru262_TurnBased *thisa; // [sp+3Ch] [bp-14h]@1
5688 unsigned int v12; // [sp+40h] [bp-10h]@5 5680 unsigned int v12; // [sp+40h] [bp-10h]@5
5689 unsigned int v13; // [sp+44h] [bp-Ch]@8 5681 unsigned int v13; // [sp+44h] [bp-Ch]@8
5690 TurnBased_QueueElem *v14; // [sp+48h] [bp-8h]@2
5691 signed int a2; // [sp+4Ch] [bp-4h]@1 5682 signed int a2; // [sp+4Ch] [bp-4h]@1
5692 5683
5693 result = 0; 5684 result = 0;
5694 thisa = this; 5685 if ( this->uActorQueueSize )
5695 v2 = this->uActorQueueSize == 0; 5686 {
5696 v3 = this->uActorQueueSize < 0; 5687
5697 a2 = 0; 5688 for ( a2 = 0; a2 < this->uActorQueueSize; ++a2 )
5698 if ( !(v3 | v2) ) 5689 {
5699 { 5690 if (PID_TYPE(this->pQueue[a2].uPackedID) != OBJECT_Player)
5700 v14 = this->pQueue;
5701 while ( 1 )
5702 {
5703 v4 = v14->uPackedID;
5704 a1 = v14->uPackedID;
5705 if (PID_TYPE(a1) != OBJECT_Player)
5706 { 5691 {
5707 v5 = PID_ID(v4); 5692 pCurrentActor = &pActors[PID_ID(this->pQueue[a2].uPackedID)];
5708 v12 = v5; 5693 if ( pCurrentActor->pActorBuffs[5].uExpireTime <= 0 )
5709 v6 = &pActors[v5]; 5694 v13 = 0;
5710 if ( SHIDWORD(v6->pActorBuffs[5].uExpireTime) < result
5711 || SHIDWORD(v6->pActorBuffs[5].uExpireTime) <= result && LODWORD(v6->pActorBuffs[5].uExpireTime) <= result )
5712 v13 = result;
5713 else 5695 else
5714 v13 = 1; 5696 v13 = 1;
5715 if ( SHIDWORD(v6->pActorBuffs[6].uExpireTime) >= result 5697 if ( pCurrentActor->pActorBuffs[6].uExpireTime >= 0 )
5716 && (SHIDWORD(v6->pActorBuffs[6].uExpireTime) > result || LODWORD(v6->pActorBuffs[6].uExpireTime) > result) ) 5698 v12 = 1;
5717 result = 1; 5699 if ( !(v13 != 0 || v12 || pCurrentActor->uAIState == Dead || pCurrentActor->uAIState == Removed || pCurrentActor->uAIState == Disabled) )
5718 if ( !(v13 != 0 || result || v6->uAIState == 5 || v6->uAIState == 11 || v6->uAIState == 19) )
5719 { 5700 {
5720 v13 = ai_near_actors_targets_pid[v5]; 5701 v13 = ai_near_actors_targets_pid[PID_ID(this->pQueue[a2].uPackedID)];
5721 memcpy(&v9, Actor::GetDirectionInfo(a1, v13, &a3, 0), sizeof(v9)); 5702 memcpy(&v9, Actor::GetDirectionInfo(this->pQueue[a2].uPackedID, v13, &a3, 0), sizeof(v9));
5722 v7 = v6->uAIState; 5703 if ( pCurrentActor->uAIState == Pursuing || pCurrentActor->uAIState == Tethered )
5723 if ( v7 == 6 || v7 == 1 )
5724 { 5704 {
5725 if ( (double)(signed int)v9.uDistance < 307.2 ) 5705 if ( (double)(signed int)v9.uDistance < 307.2 )
5726 goto LABEL_26; 5706 {
5727 } 5707 Actor::AI_Stand(PID_ID(this->pQueue[a2].uPackedID), v13, 0x20u, &v9);
5728 v6->uCurrentActionTime += pEventTimer->uTimeElapsed; 5708 continue;
5729 if ( (signed int)v6->uCurrentActionTime > v6->uCurrentActionLength ) 5709 }
5730 { 5710 }
5731 if ( v7 == 4 ) 5711 pCurrentActor->uCurrentActionTime += pEventTimer->uTimeElapsed;
5732 { 5712 if ( (signed int)pCurrentActor->uCurrentActionTime > pCurrentActor->uCurrentActionLength )
5733 v6->uCurrentActionTime = 0; 5713 {
5734 v6->uCurrentActionLength = 0; 5714 if ( pCurrentActor->uAIState == Dying )
5735 v6->uAIState = Dead; 5715 {
5736 v6->UpdateAnimation(); 5716 pCurrentActor->uCurrentActionTime = 0;
5737 } 5717 pCurrentActor->uCurrentActionLength = 0;
5738 if ( !thisa->_406D10(a2) ) 5718 pCurrentActor->uAIState = Dead;
5739 LABEL_26: 5719 pCurrentActor->UpdateAnimation();
5740 Actor::AI_Stand(v12, v13, 0x20u, &v9); 5720 }
5721 if ( !this->_406D10(a2) )
5722 Actor::AI_Stand(PID_ID(this->pQueue[a2].uPackedID), v13, 0x20u, &v9);
5741 } 5723 }
5742 } 5724 }
5743 } 5725 }
5744 ++a2;
5745 result = (signed int)thisa;
5746 ++v14;
5747 if ( a2 >= thisa->uActorQueueSize )
5748 break;
5749 result = 0; 5726 result = 0;
5750 } 5727 }
5728
5751 } 5729 }
5752 return result; 5730 return result;
5753 } 5731 }
5754 5732
5755 //----- (00406D10) -------------------------------------------------------- 5733 //----- (00406D10) --------------------------------------------------------
5783 unsigned int v28; // [sp+48h] [bp-Ch]@10 5761 unsigned int v28; // [sp+48h] [bp-Ch]@10
5784 TurnBased_QueueElem *v29; // [sp+4Ch] [bp-8h]@7 5762 TurnBased_QueueElem *v29; // [sp+4Ch] [bp-8h]@7
5785 unsigned int uActorID; // [sp+50h] [bp-4h]@2 5763 unsigned int uActorID; // [sp+50h] [bp-4h]@2
5786 unsigned int a2a; // [sp+5Ch] [bp+8h]@7 5764 unsigned int a2a; // [sp+5Ch] [bp+8h]@7
5787 5765
5788 __debugbreak();//срабатывает при пошаговом режиме после пяти шагов 5766 //__debugbreak();//срабатывает при пошаговом режиме после пяти шагов
5789 v2 = *(&this->field_0 + 4 * (a2 + 2)); 5767 v2 = *(&this->field_0 + 4 * (a2 + 2));
5790 if (PID_TYPE(v2) == OBJECT_Player) 5768 if (PID_TYPE(v2) == OBJECT_Player)
5791 return 0; 5769 return 0;
5792 uActorID = PID_ID(v2); 5770 uActorID = PID_ID(v2);
5793 //uActorID = v3; 5771 //uActorID = v3;