comparison TurnEngine.cpp @ 2245:8817c398b792

for RasterLine2D
author Ritor1
date Tue, 25 Feb 2014 20:02:06 +0600
parents 66c509997062
children aff7a7b072b7
comparison
equal deleted inserted replaced
2244:66c509997062 2245:8817c398b792
916 } 916 }
917 917
918 //----- (00406D10) -------------------------------------------------------- 918 //----- (00406D10) --------------------------------------------------------
919 bool stru262_TurnBased::ActorMove(signed int queue_position) 919 bool stru262_TurnBased::ActorMove(signed int queue_position)
920 { 920 {
921 //int v2; // ecx@1
922 //int v3; // ecx@2
923 //Actor *actor; // ebx@2
924 AIDirection v9; // esi@10 921 AIDirection v9; // esi@10
925 //int v10; // eax@10
926 int v11; // ecx@10 922 int v11; // ecx@10
927 unsigned __int8 pHostileType; // al@12 923 unsigned __int8 pHostileType; // al@12
928 AIDirection a3; // [sp+Ch] [bp-48h]@10 924 AIDirection a3; // [sp+Ch] [bp-48h]@10
929 AIDirection pDir; // [sp+28h] [bp-2Ch]@10 925 AIDirection pDir; // [sp+28h] [bp-2Ch]@10
930 //int v28; // [sp+48h] [bp-Ch]@10
931 //TurnBased_QueueElem *v29; // [sp+4Ch] [bp-8h]@7
932 unsigned int uActorID; // [sp+50h] [bp-4h]@2 926 unsigned int uActorID; // [sp+50h] [bp-4h]@2
933 //unsigned int a2a; // [sp+5Ch] [bp+8h]@7 927
934
935 // __debugbreak();//срабатывает при пошаговом режиме после пяти шагов
936 //v2 = pQueue[queue_position].uPackedID;
937 if (PID_TYPE(pQueue[queue_position].uPackedID) == OBJECT_Player) 928 if (PID_TYPE(pQueue[queue_position].uPackedID) == OBJECT_Player)
938 return 0; 929 return 0;
939 uActorID = PID_ID(pQueue[queue_position].uPackedID); 930 uActorID = PID_ID(pQueue[queue_position].uPackedID);
940 //uActorID = v3;
941 //actor = &pActors[uActorID];
942 //v5 = v4->uAIState;
943 if ( pActors[uActorID].uAIState == AIState::Dead || pActors[uActorID].uAIState == AIState::Dying || 931 if ( pActors[uActorID].uAIState == AIState::Dead || pActors[uActorID].uAIState == AIState::Dying ||
944 pActors[uActorID].uAIState == AIState::Removed|| pActors[uActorID].uAIState == AIState::Disabled || 932 pActors[uActorID].uAIState == AIState::Removed|| pActors[uActorID].uAIState == AIState::Disabled ||
945 pActors[uActorID].uAIState == AIState::Summoned ) 933 pActors[uActorID].uAIState == AIState::Summoned )
946 return 1; 934 return 1;
947 //v29 = &pTurnEngine->pQueue[queue_position];
948 //a2a = ai_near_actors_targets_pid[uActorID];
949 Actor::_SelectTarget(uActorID, &ai_near_actors_targets_pid[uActorID], true); 935 Actor::_SelectTarget(uActorID, &ai_near_actors_targets_pid[uActorID], true);
950 if ( pActors[uActorID].pMonsterInfo.uHostilityType && !ai_near_actors_targets_pid[uActorID] ) 936 if ( pActors[uActorID].pMonsterInfo.uHostilityType && !ai_near_actors_targets_pid[uActorID] )
951 pActors[uActorID].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; 937 pActors[uActorID].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
952 Actor::GetDirectionInfo(pQueue[queue_position].uPackedID, ai_near_actors_targets_pid[uActorID], &v9, 0); 938 Actor::GetDirectionInfo(pQueue[queue_position].uPackedID, ai_near_actors_targets_pid[uActorID], &v9, 0);
953 //v10 = pActors[uActorID].uActorRadius;
954 memcpy(&a3, &v9, sizeof(AIDirection)); 939 memcpy(&a3, &v9, sizeof(AIDirection));
955 memcpy(&pDir, &a3, sizeof(AIDirection)); 940 memcpy(&pDir, &a3, sizeof(AIDirection));
956 v11 = a3.uDistance - pActors[uActorID].uActorRadius; 941 v11 = a3.uDistance - pActors[uActorID].uActorRadius;
957 //v28 = a3.uDistance - pActors[uActorID].uActorRadius;
958 if ( v11 < 0 ) 942 if ( v11 < 0 )
959 {
960 v11 = 0; 943 v11 = 0;
961 //v28 = 0;
962 }
963 pHostileType = pActors[uActorID].pMonsterInfo.uHostilityType; 944 pHostileType = pActors[uActorID].pMonsterInfo.uHostilityType;
964 switch (pHostileType) 945 switch (pHostileType)
965 { 946 {
966 case 1: 947 case 1:
967 if ( (double)v11 < 307.2 ) 948 if ( (double)v11 < 307.2 )