Mercurial > mm7
comparison Actor.cpp @ 1906:768590235c2c
UpdateActorAI getting rid of unnecessary memcpys
author | Grumpy7 |
---|---|
date | Sun, 20 Oct 2013 23:50:19 -0700 |
parents | 436553b0603c |
children | 1eb0515ff54b |
comparison
equal
deleted
inserted
replaced
1898:dd9d4b7c1199 | 1906:768590235c2c |
---|---|
2920 AIDirection v74; // [sp+38h] [bp-78h]@246 | 2920 AIDirection v74; // [sp+38h] [bp-78h]@246 |
2921 AIDirection v75; // [sp+54h] [bp-5Ch]@129 | 2921 AIDirection v75; // [sp+54h] [bp-5Ch]@129 |
2922 int target_pid_type; // [sp+70h] [bp-40h]@83 | 2922 int target_pid_type; // [sp+70h] [bp-40h]@83 |
2923 signed int a1; // [sp+74h] [bp-3Ch]@129 | 2923 signed int a1; // [sp+74h] [bp-3Ch]@129 |
2924 int v78; // [sp+78h] [bp-38h]@79 | 2924 int v78; // [sp+78h] [bp-38h]@79 |
2925 AIDirection pDir; // [sp+7Ch] [bp-34h]@129 | 2925 AIDirection* pDir; // [sp+7Ch] [bp-34h]@129 |
2926 float v80; // [sp+98h] [bp-18h]@33 | 2926 float v80; // [sp+98h] [bp-18h]@33 |
2927 int v81; // [sp+9Ch] [bp-14h]@100 | 2927 int v81; // [sp+9Ch] [bp-14h]@100 |
2928 //int v82; // [sp+A0h] [bp-10h]@45 | 2928 //int v82; // [sp+A0h] [bp-10h]@45 |
2929 //unsigned int uActorID; // [sp+A4h] [bp-Ch]@32 | 2929 //unsigned int uActorID; // [sp+A4h] [bp-Ch]@32 |
2930 unsigned int v84; // [sp+A8h] [bp-8h]@11 | 2930 unsigned int v84; // [sp+A8h] [bp-8h]@11 |
2953 else if ( pParty->sRotationX < -128 ) | 2953 else if ( pParty->sRotationX < -128 ) |
2954 pParty->sRotationX = -128; | 2954 pParty->sRotationX = -128; |
2955 | 2955 |
2956 pParty->uFlags |= 2u; | 2956 pParty->uFlags |= 2u; |
2957 pParty->armageddon_timer -= pMiscTimer->uTimeElapsed; | 2957 pParty->armageddon_timer -= pMiscTimer->uTimeElapsed; |
2958 v4 = pParty->field_16140 + 50; | 2958 v4 = pParty->armageddonDamage + 50; |
2959 if ( pParty->armageddon_timer <= 0 ) | 2959 if ( pParty->armageddon_timer <= 0 ) |
2960 { | 2960 { |
2961 pParty->armageddon_timer = 0; | 2961 pParty->armageddon_timer = 0; |
2962 for(int i = 0; i < uNumActors; i++) | 2962 for(size_t i = 0; i < uNumActors; i++) |
2963 { | 2963 { |
2964 pActor=&pActors[i]; | 2964 pActor=&pActors[i]; |
2965 if ( pActor->CanAct() ) | 2965 if ( pActor->CanAct() ) |
2966 { | 2966 { |
2967 sDmg = stru_50C198.CalcMagicalDamageToActor(pActor, 5, v4); | 2967 sDmg = stru_50C198.CalcMagicalDamageToActor(pActor, 5, v4); |
2982 } | 2982 } |
2983 } | 2983 } |
2984 for(int i = 1; i <= 4; i++) | 2984 for(int i = 1; i <= 4; i++) |
2985 { | 2985 { |
2986 pPlayer = pPlayers[i]; | 2986 pPlayer = pPlayers[i]; |
2987 if ( !pPlayer->pConditions[14] && !pPlayer->pConditions[15] && !pPlayer->pConditions[16] ) | 2987 if ( !pPlayer->pConditions[Condition_Dead] && !pPlayer->pConditions[Condition_Pertified] && !pPlayer->pConditions[Condition_Eradicated] ) |
2988 pPlayer->ReceiveDamage(v4, DMGT_5); | 2988 pPlayer->ReceiveDamage(v4, DMGT_5); |
2989 } | 2989 } |
2990 } | 2990 } |
2991 if (pTurnEngine->pending_actions) | 2991 if (pTurnEngine->pending_actions) |
2992 --pTurnEngine->pending_actions; | 2992 --pTurnEngine->pending_actions; |
3125 if ( i != 10 ) | 3125 if ( i != 10 ) |
3126 { | 3126 { |
3127 pActor->pActorBuffs[i].IsBuffExpiredToTime(pParty->uTimePlayed); | 3127 pActor->pActorBuffs[i].IsBuffExpiredToTime(pParty->uTimePlayed); |
3128 } | 3128 } |
3129 } | 3129 } |
3130 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime < 0 ) | 3130 if ( pActor->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime < 0 ) |
3131 pActor->uActorHeight = pMonsterList->pMonsters[pActor->pMonsterInfo.uID - 1].uMonsterHeight; | 3131 pActor->uActorHeight = pMonsterList->pMonsters[pActor->pMonsterInfo.uID - 1].uMonsterHeight; |
3132 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 ) | 3132 if ( pActor->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 ) |
3133 pActor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; | 3133 pActor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; |
3134 // not sure | 3134 // not sure |
3135 else if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime < 0 ) | 3135 else if ( pActor->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime < 0 ) |
3136 pActor->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].uHostilityType; | 3136 pActor->pMonsterInfo.uHostilityType = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].uHostilityType; |
3137 if ( (signed __int64)pActor->pActorBuffs[2].uExpireTime < 0 ) | 3137 if ( pActor->pActorBuffs[2].uExpireTime < 0 ) |
3138 { | 3138 { |
3139 pActor->uAIState = Removed; | 3139 pActor->uAIState = Removed; |
3140 continue; | 3140 continue; |
3141 } | 3141 } |
3142 if ( (signed __int64)pActor->pActorBuffs[5].uExpireTime > 0 | 3142 if ( (signed __int64)pActor->pActorBuffs[5].uExpireTime > 0 |
3152 if ( pActor->pMonsterInfo.uRecoveryTime < 0 ) | 3152 if ( pActor->pMonsterInfo.uRecoveryTime < 0 ) |
3153 pActor->pMonsterInfo.uRecoveryTime = 0; | 3153 pActor->pMonsterInfo.uRecoveryTime = 0; |
3154 if ( !(pActor->uAttributes & 0x8000) ) | 3154 if ( !(pActor->uAttributes & 0x8000) ) |
3155 pActor->uAttributes |= 0x8000; | 3155 pActor->uAttributes |= 0x8000; |
3156 a1 = PID(OBJECT_Actor,actor_id); | 3156 a1 = PID(OBJECT_Actor,actor_id); |
3157 v30 = Actor::GetDirectionInfo(PID(OBJECT_Actor,actor_id), target_pid, &a3, 0); | 3157 pDir = Actor::GetDirectionInfo(PID(OBJECT_Actor,actor_id), target_pid, &a3, 0); |
3158 memcpy(&v75, v30, sizeof(v75)); | |
3159 memcpy(&pDir, &v75, sizeof(pDir)); | |
3160 uAIState = pActor->uAIState; | 3158 uAIState = pActor->uAIState; |
3161 /*if ( v21->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Friendly | 3159 /*if ( v21->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Friendly |
3162 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 | 3160 && (signed int)v21->pMonsterInfo.uRecoveryTime <= 0 |
3163 && v80 * 307.2 >= (double)(signed int)v75.uDistance | 3161 && v80 * 307.2 >= (double)(signed int)v75.uDistance |
3164 && (uAIState == Pursuing || uAIState == Standing || uAIState == Tethered || uAIState == Fidgeting) | 3162 && (uAIState == Pursuing || uAIState == Standing || uAIState == Tethered || uAIState == Fidgeting) |
3168 } | 3166 } |
3169 else | 3167 else |
3170 */ | 3168 */ |
3171 if ( pActor->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Friendly | 3169 if ( pActor->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Friendly |
3172 || (signed int)pActor->pMonsterInfo.uRecoveryTime > 0 | 3170 || (signed int)pActor->pMonsterInfo.uRecoveryTime > 0 |
3173 || v80 * 307.2 < (double)(signed int)v75.uDistance | 3171 || v80 * 307.2 < pDir->uDistance |
3174 || uAIState != Pursuing && uAIState != Standing && uAIState != Tethered && uAIState != Fidgeting | 3172 || uAIState != Pursuing && uAIState != Standing && uAIState != Tethered && uAIState != Fidgeting |
3175 && !pActor->pMonsterInfo.uMissleAttack1Type || uAIState != Stunned ) | 3173 && !pActor->pMonsterInfo.uMissleAttack1Type || uAIState != Stunned ) |
3176 { | 3174 { |
3177 if ( (signed int)pActor->uCurrentActionTime < pActor->uCurrentActionLength ) | 3175 if ( (signed int)pActor->uCurrentActionTime < pActor->uCurrentActionLength ) |
3178 { | 3176 { |
3192 ); | 3190 ); |
3193 } | 3191 } |
3194 else if ( pActor->uAIState == AttackingRanged1 ) | 3192 else if ( pActor->uAIState == AttackingRanged1 ) |
3195 { | 3193 { |
3196 v34 = pActor->pMonsterInfo.uMissleAttack1Type; | 3194 v34 = pActor->pMonsterInfo.uMissleAttack1Type; |
3197 Actor::AI_RangedAttack(actor_id, &pDir, v34, 0); | 3195 Actor::AI_RangedAttack(actor_id, pDir, v34, 0); |
3198 } | 3196 } |
3199 else if ( pActor->uAIState == AttackingRanged2 ) | 3197 else if ( pActor->uAIState == AttackingRanged2 ) |
3200 { | 3198 { |
3201 v34 = pActor->pMonsterInfo.uMissleAttack2Type; | 3199 v34 = pActor->pMonsterInfo.uMissleAttack2Type; |
3202 Actor::AI_RangedAttack(actor_id, &pDir, v34, 1); | 3200 Actor::AI_RangedAttack(actor_id, pDir, v34, 1); |
3203 } | 3201 } |
3204 else if ( pActor->uAIState == AttackingRanged3 ) | 3202 else if ( pActor->uAIState == AttackingRanged3 ) |
3205 { | 3203 { |
3206 v65 = pActor->pMonsterInfo.uSpellSkillAndMastery1; | 3204 v65 = pActor->pMonsterInfo.uSpellSkillAndMastery1; |
3207 v33 = pActor->pMonsterInfo.uSpell1ID; | 3205 v33 = pActor->pMonsterInfo.uSpell1ID; |
3208 Actor::AI_SpellAttack(actor_id, &pDir, v33, 2, v65); | 3206 Actor::AI_SpellAttack(actor_id, pDir, v33, 2, v65); |
3209 } | 3207 } |
3210 else if ( pActor->uAIState == AttackingRanged4 ) | 3208 else if ( pActor->uAIState == AttackingRanged4 ) |
3211 { | 3209 { |
3212 v65 = pActor->pMonsterInfo.uSpellSkillAndMastery2; | 3210 v65 = pActor->pMonsterInfo.uSpellSkillAndMastery2; |
3213 v33 = pActor->pMonsterInfo.uSpell2ID; | 3211 v33 = pActor->pMonsterInfo.uSpell2ID; |
3214 Actor::AI_SpellAttack(actor_id, &pDir, v33, 3, v65); | 3212 Actor::AI_SpellAttack(actor_id, pDir, v33, 3, v65); |
3215 } | 3213 } |
3216 } | 3214 } |
3217 | 3215 |
3218 v36 = v75.uDistance; | 3216 v36 = pDir->uDistance; |
3219 if ( pActor->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Friendly) | 3217 if ( pActor->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Friendly) |
3220 { | 3218 { |
3221 if ( target_pid_type == OBJECT_Actor ) | 3219 if ( target_pid_type == OBJECT_Actor ) |
3222 { | 3220 { |
3223 v36 = v75.uDistance; | 3221 v36 = pDir->uDistance; |
3224 //v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (pActor->pMonsterInfo.uID - 1) / 3] | 3222 //v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (pActor->pMonsterInfo.uID - 1) / 3] |
3225 // + (pActors[PID_ID(target_pid)].pMonsterInfo.uID - 1) / 3); | 3223 // + (pActors[PID_ID(target_pid)].pMonsterInfo.uID - 1) / 3); |
3226 v37 =pFactionTable->relations[(pActor->pMonsterInfo.uID-1) / 3 + 1][(pActors[PID_ID(target_pid)].pMonsterInfo.uID - 1) / 3 + 1]; | 3224 v37 =pFactionTable->relations[(pActor->pMonsterInfo.uID-1) / 3 + 1][(pActors[PID_ID(target_pid)].pMonsterInfo.uID - 1) / 3 + 1]; |
3227 } | 3225 } |
3228 else | 3226 else |
3260 } | 3258 } |
3261 else | 3259 else |
3262 { | 3260 { |
3263 //peasents after attacked | 3261 //peasents after attacked |
3264 //guard after attacked | 3262 //guard after attacked |
3265 Actor::AI_Flee(actor_id, target_pid, 0, &pDir); | 3263 Actor::AI_Flee(actor_id, target_pid, 0, pDir); |
3266 } | 3264 } |
3267 continue; | 3265 continue; |
3268 } | 3266 } |
3269 | 3267 |
3270 if ( pActor->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Long && target_pid ) | 3268 if ( pActor->pMonsterInfo.uHostilityType == MonsterInfo::Hostility_Long && target_pid ) |
3272 | 3270 |
3273 if ( pActor->pMonsterInfo.uAIType == 1 ) | 3271 if ( pActor->pMonsterInfo.uAIType == 1 ) |
3274 { | 3272 { |
3275 if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3273 if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3276 { | 3274 { |
3277 Actor::AI_Stand(actor_id, target_pid, pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333, &pDir); | 3275 Actor::AI_Stand(actor_id, target_pid, pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333, pDir); |
3278 } | 3276 } |
3279 else | 3277 else |
3280 { | 3278 { |
3281 Actor::AI_Flee(actor_id, target_pid, 0, &pDir); | 3279 Actor::AI_Flee(actor_id, target_pid, 0, pDir); |
3282 continue; | 3280 continue; |
3283 } | 3281 } |
3284 | 3282 |
3285 } | 3283 } |
3286 if ( !(pActor->uAttributes & 0x020000) ) | 3284 if ( !(pActor->uAttributes & 0x020000) ) |
3293 v43 = (double)(signed int)pActor->pMonsterInfo.uHP * 0.1; | 3291 v43 = (double)(signed int)pActor->pMonsterInfo.uHP * 0.1; |
3294 v84 = pActor->sCurrentHP; | 3292 v84 = pActor->sCurrentHP; |
3295 v42 = (double)(signed int)v84; | 3293 v42 = (double)(signed int)v84; |
3296 if ( v43 > v42 && (signed int)v36 < 10240 ) | 3294 if ( v43 > v42 && (signed int)v36 < 10240 ) |
3297 { | 3295 { |
3298 Actor::AI_Flee(actor_id, target_pid, 0, &pDir); | 3296 Actor::AI_Flee(actor_id, target_pid, 0, pDir); |
3299 continue; | 3297 continue; |
3300 } | 3298 } |
3301 } | 3299 } |
3302 } | 3300 } |
3303 | 3301 |
3315 { | 3313 { |
3316 if ( pActor->pMonsterInfo.uMissleAttack1Type ) | 3314 if ( pActor->pMonsterInfo.uMissleAttack1Type ) |
3317 { | 3315 { |
3318 if ( (signed int)pActor->pMonsterInfo.uRecoveryTime <= 0 ) | 3316 if ( (signed int)pActor->pMonsterInfo.uRecoveryTime <= 0 ) |
3319 { | 3317 { |
3320 Actor::AI_MissileAttack1(actor_id, target_pid, &pDir); | 3318 Actor::AI_MissileAttack1(actor_id, target_pid, pDir); |
3321 } | 3319 } |
3322 else if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3320 else if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3323 { | 3321 { |
3324 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3322 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3325 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3323 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3326 } | 3324 } |
3327 else | 3325 else |
3328 { | 3326 { |
3329 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3327 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3330 if ( v80 * 307.2 > (double)v81 ) | 3328 if ( v80 * 307.2 > (double)v81 ) |
3331 { | 3329 { |
3332 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3330 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3333 } | 3331 } |
3334 else | 3332 else |
3335 { | 3333 { |
3336 Actor::AI_Pursue1(actor_id, target_pid, actor_id, v47, &pDir); | 3334 Actor::AI_Pursue1(actor_id, target_pid, actor_id, v47, pDir); |
3337 } | 3335 } |
3338 } | 3336 } |
3339 } | 3337 } |
3340 else | 3338 else |
3341 { | 3339 { |
3344 if ( v81 >= 1024 ) | 3342 if ( v81 >= 1024 ) |
3345 { | 3343 { |
3346 if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3344 if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3347 { | 3345 { |
3348 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3346 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3349 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3347 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3350 } | 3348 } |
3351 else | 3349 else |
3352 { | 3350 { |
3353 //monsters | 3351 //monsters |
3354 Actor::AI_Pursue3(actor_id, target_pid, 0, &pDir); | 3352 Actor::AI_Pursue3(actor_id, target_pid, 0, pDir); |
3355 } | 3353 } |
3356 } | 3354 } |
3357 else if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3355 else if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3358 { | 3356 { |
3359 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3357 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3360 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3358 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3361 } | 3359 } |
3362 else | 3360 else |
3363 { | 3361 { |
3364 v70 = (signed __int64)v80 * 307.2; | 3362 v70 = (signed __int64)v80 * 307.2; |
3365 //monsters | 3363 //monsters |
3366 //guard after player runs away | 3364 //guard after player runs away |
3367 // follow player | 3365 // follow player |
3368 Actor::AI_Pursue2(actor_id, target_pid, 0, &pDir, v70); | 3366 Actor::AI_Pursue2(actor_id, target_pid, 0, pDir, v70); |
3369 } | 3367 } |
3370 } | 3368 } |
3371 else if ( (signed int)pActor->pMonsterInfo.uRecoveryTime > 0 ) | 3369 else if ( (signed int)pActor->pMonsterInfo.uRecoveryTime > 0 ) |
3372 { | 3370 { |
3373 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3371 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3374 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3372 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3375 } | 3373 } |
3376 else | 3374 else |
3377 { | 3375 { |
3378 //monsters | 3376 //monsters |
3379 Actor::AI_MeleeAttack(actor_id, target_pid, &pDir); | 3377 Actor::AI_MeleeAttack(actor_id, target_pid, pDir); |
3380 } | 3378 } |
3381 } | 3379 } |
3382 continue; | 3380 continue; |
3383 } | 3381 } |
3384 else if ( v45 == 2 || v45 == 3 ) | 3382 else if ( v45 == 2 || v45 == 3 ) |
3390 if ( v46 ) | 3388 if ( v46 ) |
3391 { | 3389 { |
3392 if ( (signed int)pActor->pMonsterInfo.uRecoveryTime <= 0 ) | 3390 if ( (signed int)pActor->pMonsterInfo.uRecoveryTime <= 0 ) |
3393 { | 3391 { |
3394 if ( v45 == 2 ) | 3392 if ( v45 == 2 ) |
3395 Actor::AI_SpellAttack1(actor_id, target_pid, &pDir); | 3393 Actor::AI_SpellAttack1(actor_id, target_pid, pDir); |
3396 else | 3394 else |
3397 Actor::AI_SpellAttack2(actor_id, target_pid, &pDir); | 3395 Actor::AI_SpellAttack2(actor_id, target_pid, pDir); |
3398 } | 3396 } |
3399 else if ( v80 * 307.2 > (double)v81 || pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3397 else if ( v80 * 307.2 > (double)v81 || pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3400 { | 3398 { |
3401 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3399 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3402 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3400 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3403 } | 3401 } |
3404 else | 3402 else |
3405 { | 3403 { |
3406 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3404 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3407 Actor::AI_Pursue1(actor_id, target_pid, actor_id, v47, &pDir); | 3405 Actor::AI_Pursue1(actor_id, target_pid, actor_id, v47, pDir); |
3408 } | 3406 } |
3409 } | 3407 } |
3410 else | 3408 else |
3411 { | 3409 { |
3412 if ( (double)v81 >= v80 * 307.2 ) | 3410 if ( (double)v81 >= v80 * 307.2 ) |
3414 if ( v81 >= 1024 ) | 3412 if ( v81 >= 1024 ) |
3415 { | 3413 { |
3416 if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3414 if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3417 { | 3415 { |
3418 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3416 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3419 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3417 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3420 } | 3418 } |
3421 else | 3419 else |
3422 { | 3420 { |
3423 Actor::AI_Pursue3(actor_id, target_pid, 256, &pDir); | 3421 Actor::AI_Pursue3(actor_id, target_pid, 256, pDir); |
3424 } | 3422 } |
3425 } | 3423 } |
3426 else if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3424 else if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3427 { | 3425 { |
3428 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3426 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3429 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3427 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3430 } | 3428 } |
3431 else | 3429 else |
3432 { | 3430 { |
3433 v70 = (signed __int64)v80 * 307.2; | 3431 v70 = (signed __int64)v80 * 307.2; |
3434 Actor::AI_Pursue2(actor_id, target_pid, 0, &pDir, v70); | 3432 Actor::AI_Pursue2(actor_id, target_pid, 0, pDir, v70); |
3435 } | 3433 } |
3436 } | 3434 } |
3437 else if ( (signed int)pActor->pMonsterInfo.uRecoveryTime > 0 ) | 3435 else if ( (signed int)pActor->pMonsterInfo.uRecoveryTime > 0 ) |
3438 { | 3436 { |
3439 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3437 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3440 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3438 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3441 } | 3439 } |
3442 else | 3440 else |
3443 { | 3441 { |
3444 Actor::AI_MeleeAttack(actor_id, target_pid, &pDir); | 3442 Actor::AI_MeleeAttack(actor_id, target_pid, pDir); |
3445 } | 3443 } |
3446 } | 3444 } |
3447 continue; | 3445 continue; |
3448 } | 3446 } |
3449 } | 3447 } |
3469 } | 3467 } |
3470 else if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3468 else if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3471 { | 3469 { |
3472 v57 = Actor::GetDirectionInfo(a1, 4u, &v72, 0); | 3470 v57 = Actor::GetDirectionInfo(a1, 4u, &v72, 0); |
3473 v58 = (double)(signed int)pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3471 v58 = (double)(signed int)pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3474 memcpy(&v74, v57, sizeof(v74)); | 3472 Actor::AI_Stand(actor_id, 4, v58, pDir); |
3475 memcpy(&pDir, &v74, sizeof(pDir)); | |
3476 Actor::AI_Stand(actor_id, 4, v58, &pDir); | |
3477 } | 3473 } |
3478 } | 3474 } |
3479 else if ( !pActor->pMonsterInfo.uMissleAttack2Type ) | 3475 else if ( !pActor->pMonsterInfo.uMissleAttack2Type ) |
3480 { | 3476 { |
3481 if ( (double)v81 >= v80 * 307.2 ) | 3477 if ( (double)v81 >= v80 * 307.2 ) |
3483 if ( v81 >= 1024 ) | 3479 if ( v81 >= 1024 ) |
3484 { | 3480 { |
3485 if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3481 if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3486 { | 3482 { |
3487 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3483 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3488 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3484 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3489 } | 3485 } |
3490 else | 3486 else |
3491 { | 3487 { |
3492 Actor::AI_Pursue3(actor_id, target_pid, 256, &pDir); | 3488 Actor::AI_Pursue3(actor_id, target_pid, 256, pDir); |
3493 } | 3489 } |
3494 } | 3490 } |
3495 else if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3491 else if ( pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3496 { | 3492 { |
3497 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3493 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3498 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3494 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3499 } | 3495 } |
3500 else | 3496 else |
3501 { | 3497 { |
3502 v70 = (signed __int64)v80 * 307.2; | 3498 v70 = (signed __int64)v80 * 307.2; |
3503 Actor::AI_Pursue2(actor_id, target_pid, 0, &pDir, v70); | 3499 Actor::AI_Pursue2(actor_id, target_pid, 0, pDir, v70); |
3504 } | 3500 } |
3505 } | 3501 } |
3506 else if ( (signed int)pActor->pMonsterInfo.uRecoveryTime > 0 ) | 3502 else if ( (signed int)pActor->pMonsterInfo.uRecoveryTime > 0 ) |
3507 { | 3503 { |
3508 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3504 v47 = pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3509 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3505 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3510 } | 3506 } |
3511 else | 3507 else |
3512 { | 3508 { |
3513 Actor::AI_MeleeAttack(actor_id, target_pid, &pDir); | 3509 Actor::AI_MeleeAttack(actor_id, target_pid, pDir); |
3514 } | 3510 } |
3515 } | 3511 } |
3516 else if ( (signed int)pActor->pMonsterInfo.uRecoveryTime > 0 ) | 3512 else if ( (signed int)pActor->pMonsterInfo.uRecoveryTime > 0 ) |
3517 { | 3513 { |
3518 v47 = (double)(signed int)pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; | 3514 v47 = (double)(signed int)pActor->pMonsterInfo.uRecoveryTime * 2.133333333333333; |
3519 if ( v80 * 307.2 > (double)v81 || pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) | 3515 if ( v80 * 307.2 > (double)v81 || pActor->pMonsterInfo.uMovementType == MONSTER_MOVEMENT_TYPE_STAIONARY ) |
3520 Actor::AI_Stand(actor_id, target_pid, v47, &pDir); | 3516 Actor::AI_Stand(actor_id, target_pid, v47, pDir); |
3521 else | 3517 else |
3522 Actor::AI_Pursue1(actor_id, target_pid, actor_id, v47, &pDir); | 3518 Actor::AI_Pursue1(actor_id, target_pid, actor_id, v47, pDir); |
3523 } | 3519 } |
3524 else | 3520 else |
3525 { | 3521 { |
3526 Actor::AI_MissileAttack2(actor_id, target_pid, &pDir); | 3522 Actor::AI_MissileAttack2(actor_id, target_pid, pDir); |
3527 } | 3523 } |
3528 } | 3524 } |
3529 } | 3525 } |
3530 } | 3526 } |
3531 //----- (0044665D) -------------------------------------------------------- | 3527 //----- (0044665D) -------------------------------------------------------- |