Mercurial > mm7
changeset 1343:f0b95fb02b83
TE m
author | Gloval |
---|---|
date | Tue, 09 Jul 2013 18:01:15 +0400 |
parents | bdf0cc8620ad |
children | b99aeb077d4f e33188605eeb |
files | TurnEngine.cpp |
diffstat | 1 files changed, 43 insertions(+), 85 deletions(-) [+] |
line wrap: on
line diff
--- a/TurnEngine.cpp Mon Jul 08 01:04:42 2013 +0400 +++ b/TurnEngine.cpp Tue Jul 09 18:01:15 2013 +0400 @@ -742,10 +742,10 @@ v1 = &pQueue[queue_index]; v28 = v1; v3 = v1->uPackedID; - if (PID_TYPE(v1->uPackedID) != OBJECT_Player) + if (PID_TYPE(pQueue[queue_index].uPackedID) == OBJECT_Actor) { v4 = PID_ID(v3); - a2a = ai_near_actors_targets_pid[PID_ID(v3)]; + a2a = ai_near_actors_targets_pid[PID_ID(pQueue[queue_index].uPackedID)]; memcpy(&a3, Actor::GetDirectionInfo(v1->uPackedID, ai_near_actors_targets_pid[PID_ID(v3)], &a3, 0), sizeof(a3)); memcpy(&a4, &a3, sizeof(a4)); v5 = &pActors[PID_ID(v3)]; @@ -755,89 +755,47 @@ v5->uCurrentActionTime += pEventTimer->uTimeElapsed; if ( (signed int)v5->uCurrentActionTime >= v5->uCurrentActionLength ) { - v7 = (signed __int16)v3; - v8 = (signed __int16)v3 - 2; - if ( !v8 ) - { - v19 = stru_50C198.special_ability_use_check(&pActors[v4], v4); - stru_50FE08.Add( v28->uPackedID, 5120, - v5->vPosition.x, v5->vPosition.y, - v5->vPosition.z + ((signed int)v5->uActorHeight >> 1), - v19, 1); - Actor::AI_Stand(v4, a2a, 0,&a4); - return; - } - v9 = v8 - 1; - if ( v9 ) - { - v10 = v9 - 1; - if ( !v10 ) - { - v5->uCurrentActionTime = 0; - v5->uCurrentActionLength = 0; - v5->uAIState = Dead; - pActors[v4].UpdateAnimation(); - return; - } - v11 = v10 - 4; - if ( !v11 ) - { - Actor::AI_Stand(v4, a2a, 0,&a4); - return; - } - v12 = v11 - 4; - if ( v12 ) - { - v13 = v12 - 1; - if ( v13 ) - { - if ( v13 != 5 ) - { - if ( v7 != 4 ) - { - v14 = rand(); - if ( !(v14 % 2) ) - { - Actor::AI_Bored(v4, a2a, &a4); - return; - } - Actor::AI_Stand(v4, a2a, 64,&a4); - return; - } - v5->uCurrentActionTime = 0; - v5->uCurrentActionLength = 0; - v5->uAIState = Dead; - pActors[v4].UpdateAnimation(); - return; - } - v24 = v5->pMonsterInfo.uSpellSkillAndMastery2; - v22 = 3; - v17 = v5->pMonsterInfo.uSpell2ID; - } - else - { - v24 = v5->pMonsterInfo.uSpellSkillAndMastery1; - v22 = 2; - v17 = v5->pMonsterInfo.uSpell1ID; - } - Actor::AI_SpellAttack(v4, &a4, v17, v22, v24); - Actor::AI_Stand(v4, a2a, 0, &a4); - return; - } - v18 = v5->pMonsterInfo.uMissleAttack2Type; - v25 = 1; - } - else - { - v18 = v5->pMonsterInfo.uMissleAttack1Type; - v25 = 0; - } - Actor::AI_RangedAttack(v4, &a4, v18, v25); - Actor::AI_Stand(v4, a2a, 0,&a4); - return; - } + switch (v3) + { + case AIState::AttackingMelee: + v19 = stru_50C198.special_ability_use_check(&pActors[v4], v4); + stru_50FE08.Add( v28->uPackedID, 5120, v5->vPosition.x, v5->vPosition.y, v5->vPosition.z + ((signed int)v5->uActorHeight >> 1), v19, 1); + Actor::AI_Stand(v4, a2a, 0, &a4); + break; + case AIState::AttackingRanged1: + Actor::AI_RangedAttack(v4, &a4, v5->pMonsterInfo.uMissleAttack1Type, 0); + Actor::AI_Stand(v4, a2a, 0,&a4); + break; + case AIState::Dying: + v5->uCurrentActionTime = 0; + v5->uCurrentActionLength = 0; + v5->uAIState = Dead; + pActors[v4].UpdateAnimation(); + break; + case AIState::Stunned: + Actor::AI_Stand(v4, a2a, 0,&a4); + break; + case AIState::AttackingRanged2: + Actor::AI_RangedAttack(v4, &a4, v5->pMonsterInfo.uMissleAttack2Type, 1); + Actor::AI_Stand(v4, a2a, 0,&a4); + break; + case AIState::AttackingRanged3: + Actor::AI_SpellAttack(v4, &a4, v5->pMonsterInfo.uSpell1ID, 2, v5->pMonsterInfo.uSpellSkillAndMastery1); + Actor::AI_Stand(v4, a2a, 0, &a4); + break; + case AIState::AttackingRanged4: + Actor::AI_SpellAttack(v4, &a4, v5->pMonsterInfo.uSpell2ID, 3, v5->pMonsterInfo.uSpellSkillAndMastery2); + Actor::AI_Stand(v4, a2a, 0, &a4); + break; + default: + if ( !(rand() % 2) ) + Actor::AI_Bored(v4, a2a, &a4); + else + Actor::AI_Stand(v4, a2a, 64,&a4); + } } - + } + } } @@ -992,7 +950,7 @@ goto LABEL_48; } LABEL_47: - Actor::AI_Stand(v13, v22, 0x40u, &v18); + Actor::AI_Stand(v13, v22, 64, &v18); //v3 = v21; v21->field_C = 0; goto LABEL_48;