comparison mm7_5.cpp @ 955:21cc2b274220

m
author Ritor1
date Thu, 02 May 2013 11:02:48 +0600
parents 34ed2d5e7cfb
children e9292c58644a
comparison
equal deleted inserted replaced
954:27bfe64b13b5 955:21cc2b274220
4542 SpriteObject *v4; // ebx@1 4542 SpriteObject *v4; // ebx@1
4543 //int v5; // edx@3 4543 //int v5; // edx@3
4544 //bool uPlayerID; // eax@3 4544 //bool uPlayerID; // eax@3
4545 //Player *pPlayer; // edi@4 4545 //Player *pPlayer; // edi@4
4546 Actor *pMonster; // esi@7 4546 Actor *pMonster; // esi@7
4547 SpriteObject *v9; // ebx@12 4547 //SpriteObject *v9; // ebx@12
4548 int v10; // eax@12 4548 int v10; // eax@12
4549 int v11; // ebx@12 4549 int v11; // ebx@12
4550 unsigned int v12; // ecx@12 4550 unsigned int v12; // ecx@12
4551 int v13; // edx@15 4551 int v13; // edx@15
4552 int v14; // edx@17 4552 int v14; // edx@17
4593 //int v55; // [sp+40h] [bp-2Ch]@12 4593 //int v55; // [sp+40h] [bp-2Ch]@12
4594 signed int a4; // [sp+44h] [bp-28h]@1 4594 signed int a4; // [sp+44h] [bp-28h]@1
4595 PlayerEquipment *v57; // [sp+48h] [bp-24h]@10 4595 PlayerEquipment *v57; // [sp+48h] [bp-24h]@10
4596 //int v58; // [sp+4Ch] [bp-20h]@10 4596 //int v58; // [sp+4Ch] [bp-20h]@10
4597 int v59; // [sp+50h] [bp-1Ch]@1 4597 int v59; // [sp+50h] [bp-1Ch]@1
4598 unsigned int uActorID_Monster_; // [sp+54h] [bp-18h]@1 4598 //unsigned int uActorID_Monster_; // [sp+54h] [bp-18h]@1
4599 int v61; // [sp+58h] [bp-14h]@1 4599 int v61; // [sp+58h] [bp-14h]@1
4600 bool v62; // [sp+5Ch] [bp-10h]@1 4600 bool v62; // [sp+5Ch] [bp-10h]@1
4601 int uDamageAmount; // [sp+60h] [bp-Ch]@1 4601 int uDamageAmount; // [sp+60h] [bp-Ch]@1
4602 int a2; // [sp+64h] [bp-8h]@27 4602 int a2; // [sp+64h] [bp-8h]@27
4603 int a3; // [sp+6Bh] [bp-1h]@6 4603 int a3; // [sp+6Bh] [bp-1h]@6
4604 4604
4605 //v3 = a1; 4605 //v3 = a1;
4606 v4 = 0; 4606 v4 = 0;
4607 uActorID_Monster_ = uActorID_Monster; 4607 //uActorID_Monster_ = uActorID_Monster;
4608 //v54 = a1; 4608 //v54 = a1;
4609 uDamageAmount = 0; 4609 uDamageAmount = 0;
4610 a4 = 0; 4610 a4 = 0;
4611 v61 = 0; 4611 v61 = 0;
4612 v59 = 0; 4612 v59 = 0;
4624 if (PID_TYPE(a1) != OBJECT_Player) 4624 if (PID_TYPE(a1) != OBJECT_Player)
4625 return; 4625 return;
4626 4626
4627 assert(PID_ID(abs(a1)) < 4); 4627 assert(PID_ID(abs(a1)) < 4);
4628 auto player = &pParty->pPlayers[PID_ID(a1)]; 4628 auto player = &pParty->pPlayers[PID_ID(a1)];
4629 pMonster = &pActors[uActorID_Monster_]; 4629 pMonster = &pActors[uActorID_Monster];
4630 //uPlayerID = pMonster->IsAlive(); 4630 //uPlayerID = pMonster->IsAlive();
4631 if (pMonster->IsNotAlive()) 4631 if (pMonster->IsNotAlive())
4632 return; 4632 return;
4633 4633
4634 BYTE1(pMonster->uAttributes) |= 0xC0u; 4634 BYTE1(pMonster->uAttributes) |= 0xC0u;
4673 hit_will_paralyze = true; 4673 hit_will_paralyze = true;
4674 } 4674 }
4675 break; 4675 break;
4676 } 4676 }
4677 } 4677 }
4678 v50 = pMonster->pMonsterInfo.uID; 4678 //v50 = pMonster->pMonsterInfo.uID;
4679 a2 = 4; 4679 a2 = 4;
4680 //v27 = player->CalculateMeleeDamageTo(0, 0, v50); 4680 //v27 = player->CalculateMeleeDamageTo(0, 0, v50);
4681 uDamageAmount = player->CalculateMeleeDamageTo(0, 0, v50); 4681 uDamageAmount = player->CalculateMeleeDamageTo(0, 0, pMonster->pMonsterInfo.uID);
4682 //if ( !v57 ) 4682 //if ( !v57 )
4683 goto LABEL_67; 4683 goto LABEL_67;
4684 //goto LABEL_69; 4684 //goto LABEL_69;
4685 } 4685 }
4686 4686
4687 4687
4688 v19 = v4->spell_id == SPELL_DARK_SOULDRINKER; 4688 v19 = v4->spell_id == SPELL_DARK_SOULDRINKER;
4689 v61 = v4->field_60_distance_related_prolly_lod; 4689 v61 = v4->field_60_distance_related_prolly_lod;
4690 if ( !v19 ) 4690 if ( !v19 )
4691 { 4691 {
4692 v9 = (SpriteObject *)uDamageAmount; 4692 //v9 = v4;
4693 v50 = pParty->vPosition.x - *(int *)(uDamageAmount + 4); 4693 v50 = pParty->vPosition.x - v4->vPosition.x;
4694 //v55 = abs(v50); 4694 //v55 = abs(v50);
4695 pMonsterName = (char *)(pParty->vPosition.y - v9->vPosition.y); 4695 pMonsterName = (char *)(pParty->vPosition.y - v4->vPosition.y);
4696 //v51 = (unsigned __int64 *)abs((int)pMonsterName); 4696 //v51 = (unsigned __int64 *)abs((int)pMonsterName);
4697 pPlayerName = (char *)(pParty->vPosition.z - v9->vPosition.z); 4697 pPlayerName = (char *)(pParty->vPosition.z - v4->vPosition.z);
4698 v52 = abs((int)pPlayerName); 4698 v52 = abs((int)pPlayerName);
4699 v61 = abs(v50); 4699 v61 = abs(v50);
4700 v10 = abs(v50); 4700 v10 = abs(v50);
4701 v11 = (int)abs((int)pMonsterName); 4701 v11 = (int)abs((int)pMonsterName);
4702 v12 = v52; 4702 v12 = v52;
4727 } 4727 }
4728 else 4728 else
4729 { 4729 {
4730 v61 = 1; 4730 v61 = 1;
4731 } 4731 }
4732 v4 = (SpriteObject *)uDamageAmount; 4732 //v4 = (SpriteObject *)uDamageAmount;
4733 } 4733 }
4734 4734
4735 v15 = v4->spell_id; 4735 v15 = v4->spell_id;
4736 if ( v15 == SPELL_LASER_PROJECTILE ) 4736 if ( v15 == SPELL_LASER_PROJECTILE )
4737 { 4737 {
4880 player->PlaySound(SPEECH_52, 0); 4880 player->PlaySound(SPEECH_52, 0);
4881 return; 4881 return;
4882 } 4882 }
4883 if ( pMonster->sCurrentHP > 0 ) 4883 if ( pMonster->sCurrentHP > 0 )
4884 { 4884 {
4885 Actor::Stun(uActorID_Monster_, a1, 0); 4885 Actor::Stun(uActorID_Monster, a1, 0);
4886 Actor::AggroSurroundingPeasants(uActorID_Monster_, 1); 4886 Actor::AggroSurroundingPeasants(uActorID_Monster, 1);
4887 if ( bShowDamage ) 4887 if ( bShowDamage )
4888 { 4888 {
4889 v50 = uDamageAmount; 4889 v50 = uDamageAmount;
4890 pMonsterName = (char *)pMonster; 4890 pMonsterName = (char *)pMonster;
4891 pPlayerName = player->pName; 4891 pPlayerName = player->pName;
4925 v39 = (double)(signed int)pMonster->vPosition.x; 4925 v39 = (double)(signed int)pMonster->vPosition.x;
4926 pDecalBuilder->AddBloodsplat(v39, v38, v37, 1.0, 0.0, 0.0, *(float *)&pPlayerName, 0, 0); 4926 pDecalBuilder->AddBloodsplat(v39, v38, v37, 1.0, 0.0, 0.0, *(float *)&pPlayerName, 0, 0);
4927 } 4927 }
4928 } 4928 }
4929 } 4929 }
4930 Actor::Die(uActorID_Monster_); 4930 Actor::Die(uActorID_Monster);
4931 Actor::ApplyFineForKillingPeasant(uActorID_Monster_); 4931 Actor::ApplyFineForKillingPeasant(uActorID_Monster);
4932 Actor::AggroSurroundingPeasants(uActorID_Monster_, 1); 4932 Actor::AggroSurroundingPeasants(uActorID_Monster, 1);
4933 if ( pMonster->pMonsterInfo.uExp ) 4933 if ( pMonster->pMonsterInfo.uExp )
4934 GivePartyExp(pMonsterStats->pInfos[pMonster->pMonsterInfo.uID].uExp); 4934 GivePartyExp(pMonsterStats->pInfos[pMonster->pMonsterInfo.uID].uExp);
4935 v40 = SPEECH_51; 4935 v40 = SPEECH_51;
4936 if ( rand() % 100 < 20 ) 4936 if ( rand() % 100 < 20 )
4937 v40 = ((signed int)pMonster->pMonsterInfo.uHP >= 100) + 1; 4937 v40 = ((signed int)pMonster->pMonsterInfo.uHP >= 100) + 1;
5000 pVelocity->z = (unsigned __int64)(v59 * (signed __int64)pVelocity->z) >> 16; 5000 pVelocity->z = (unsigned __int64)(v59 * (signed __int64)pVelocity->z) >> 16;
5001 pMonster->vVelocity.x = 50 * LOWORD(pVelocity->x); 5001 pMonster->vVelocity.x = 50 * LOWORD(pVelocity->x);
5002 pMonster->vVelocity.y = 50 * LOWORD(pVelocity->y); 5002 pMonster->vVelocity.y = 50 * LOWORD(pVelocity->y);
5003 pMonster->vVelocity.z = 50 * LOWORD(pVelocity->z); 5003 pMonster->vVelocity.z = 50 * LOWORD(pVelocity->z);
5004 } 5004 }
5005 Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster_, 1, v61); 5005 Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster, 1, v61);
5006 } 5006 }
5007 // 4D864C: using guessed type char byte_4D864C; 5007 // 4D864C: using guessed type char byte_4D864C;
5008 5008
5009 //----- (00439FCB) -------------------------------------------------------- 5009 //----- (00439FCB) --------------------------------------------------------
5010 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, Vec3_int_ *pPos, unsigned int a4) 5010 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, Vec3_int_ *pPos, unsigned int a4)