Mercurial > mm7
diff mm7_5.cpp @ 2313:b75a8f15568d
Слияние
author | Ritor1 |
---|---|
date | Tue, 18 Mar 2014 17:34:33 +0600 |
parents | 43af6c819e88 |
children | ddb803517a48 |
line wrap: on
line diff
--- a/mm7_5.cpp Tue Mar 18 17:34:26 2014 +0600 +++ b/mm7_5.cpp Tue Mar 18 17:34:33 2014 +0600 @@ -126,7 +126,7 @@ AttackerInfo.vec_4B4[attacker_id].x = a1; AttackerInfo.vec_4B4[attacker_id].y = v48; AttackerInfo.vec_4B4[attacker_id].z = v44; - ActorDamageFromMonster(AttackerInfo.pIDs[attacker_id], target_id, &AttackerInfo.vec_4B4[attacker_id], AttackerInfo.field_450[attacker_id]); + Actor::ActorDamageFromMonster(AttackerInfo.pIDs[attacker_id], target_id, &AttackerInfo.vec_4B4[attacker_id], AttackerInfo.field_450[attacker_id]); } } } @@ -184,7 +184,7 @@ break; case OBJECT_Actor: if ( v36 && pActors[v3].GetActorsRelation(&pActors[actorID]) ) - ActorDamageFromMonster(AttackerInfo.pIDs[attacker_id], actorID, &AttackerInfo.vec_4B4[attacker_id], v36->field_61); + Actor::ActorDamageFromMonster(AttackerInfo.pIDs[attacker_id], actorID, &AttackerInfo.vec_4B4[attacker_id], v36->field_61); break; case OBJECT_Item: ItemDamageFromActor(AttackerInfo.pIDs[attacker_id], actorID, &AttackerInfo.vec_4B4[attacker_id]); @@ -223,7 +223,7 @@ switch (PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid)) { case OBJECT_Actor: - ActorDamageFromMonster(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC, pSpriteObjects[uLayingItemID].field_61); + Actor::ActorDamageFromMonster(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC, pSpriteObjects[uLayingItemID].field_61); break; case OBJECT_Player: DamageMonsterFromParty(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC); @@ -304,93 +304,6 @@ } } -//----- (0043B1B0) -------------------------------------------------------- -void ActorDamageFromMonster(signed int attacker_id, unsigned int actor_id, Vec3_int_ *pVelocity, signed int a4) -{ - int v4; // ebx@1 - int v6; // eax@3 - __int64 v10; // qax@8 - signed int v12; // ecx@20 - int v13; // ecx@22 - int v14; // edi@30 - signed int v17; // [sp+10h] [bp-4h]@1 - int v18; // [sp+20h] [bp+Ch]@34 - - v4 = 0; - v17 = attacker_id; - if ( PID_TYPE(attacker_id) == OBJECT_Item) - { - v4 = pSpriteObjects[PID_ID(attacker_id)].field_60_distance_related_prolly_lod; - v17 = pSpriteObjects[PID_ID(attacker_id)].spell_caster_pid; - } - if ( PID_TYPE(v17) == OBJECT_Actor) - { - v6 = pActors[actor_id].IsNotAlive(); - if ( !v6 ) - { - pActors[actor_id].uLastCharacterIDToHit = v17; - if ( pActors[actor_id].uAIState == Fleeing ) - pActors[actor_id].uAttributes |= FACE_UNKNOW7; - if ( pActors[PID_ID(v17)]._4273BB_DoesHitOtherActor(&pActors[actor_id], v4, 0) ) - { - v10 = (unsigned int)pActors[PID_ID(v17)]._43B3E0_CalcDamage(a4); - if ( (signed __int64)pActors[PID_ID(v17)].pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime > 0 ) - { - if ( pActors[PID_ID(v17)].pActorBuffs[ACTOR_BUFF_SHRINK].uPower ) - v10 = (signed int)v10 / (unsigned __int16)pActors[PID_ID(v17)].pActorBuffs[ACTOR_BUFF_SHRINK].uPower; - } - if ( SHIDWORD(pActors[actor_id].pActorBuffs[ACTOR_BUFF_STONED].uExpireTime) >= SHIDWORD(v10) - && (SHIDWORD(pActors[actor_id].pActorBuffs[ACTOR_BUFF_STONED].uExpireTime) > SHIDWORD(v10) - || LODWORD(pActors[actor_id].pActorBuffs[ACTOR_BUFF_STONED].uExpireTime) > HIDWORD(v10)) ) - LODWORD(v10) = 0; - if ( a4 == HIDWORD(v10) ) - v12 = pActors[PID_ID(v17)].pMonsterInfo.uAttack1Type; - else if ( a4 - HIDWORD(v10) == 1 ) - { - v12 = pActors[PID_ID(v17)].pMonsterInfo.uAttack2Type; - if ( SHIDWORD(pActors[actor_id].pActorBuffs[ACTOR_BUFF_SHIELD].uExpireTime) >= SHIDWORD(v10) - && (SHIDWORD(pActors[actor_id].pActorBuffs[ACTOR_BUFF_SHIELD].uExpireTime) > SHIDWORD(v10) - || LODWORD(pActors[actor_id].pActorBuffs[ACTOR_BUFF_SHIELD].uExpireTime) > HIDWORD(v10)) ) - LODWORD(v10) = (signed int)v10 / 2; - } - else if ( a4 - HIDWORD(v10) == 2 ) - v12 = LOBYTE(pSpellStats->pInfos[pActors[actor_id].pMonsterInfo.uSpell1ID].uSchool); - else if ( a4 - HIDWORD(v10) == 3 ) - v12 = LOBYTE(pSpellStats->pInfos[pActors[actor_id].pMonsterInfo.uSpell2ID].uSchool); - else if ( a4 - HIDWORD(v10) == 4 ) - v12 = pActors[PID_ID(v17)].pMonsterInfo.field_3C_some_special_attack; - else - v12 = 4; - v14 = pActors[actor_id].CalcMagicalDamageToActor((DAMAGE_TYPE)v12, v10); - pActors[actor_id].sCurrentHP -= v14; - if ( v14 ) - { - if ( pActors[actor_id].sCurrentHP > 0 ) - Actor::AI_Stun(actor_id, v17, 0); - else - Actor::Die(actor_id); - Actor::AggroSurroundingPeasants(actor_id, 0); - v18 = 20 * v14 / (signed int)pActors[actor_id].pMonsterInfo.uHP; - if ( 20 * v14 / (signed int)pActors[actor_id].pMonsterInfo.uHP > 10 ) - v18 = 10; - if ( !MonsterStats::BelongsToSupertype(pActors[actor_id].pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) ) - { - pVelocity->x = fixpoint_mul(v18, pVelocity->x); - pVelocity->y = fixpoint_mul(v18, pVelocity->y); - pVelocity->z = fixpoint_mul(v18, pVelocity->z); - pActors[actor_id].vVelocity.x = 50 * LOWORD(pVelocity->x); - pActors[actor_id].vVelocity.y = 50 * LOWORD(pVelocity->y); - pActors[actor_id].vVelocity.z = 50 * LOWORD(pVelocity->z); - } - Actor::AddBloodsplatOnDamageOverlay(actor_id, 1, v14); - } - else - Actor::AI_Stun(actor_id, v17, 0); - return; - } - } - } -} //----- (0043F515) -------------------------------------------------------- void FindBillboardsLightLevels_BLV()