Mercurial > mm7
comparison mm7_5.cpp @ 822:c232f160e6f3
Named SpriteObject spell-related fields.
author | Nomad |
---|---|
date | Tue, 26 Mar 2013 17:56:24 +0200 |
parents | 9359c114f98c |
children | fe4c8b113548 |
comparison
equal
deleted
inserted
replaced
820:522591080ac5 | 822:c232f160e6f3 |
---|---|
4538 v39 = (signed int)*((short *)v1 - 300) >> 3; | 4538 v39 = (signed int)*((short *)v1 - 300) >> 3; |
4539 if ( v2 == 2 ) | 4539 if ( v2 == 2 ) |
4540 { | 4540 { |
4541 v4 = &pSpriteObjects[v3]; | 4541 v4 = &pSpriteObjects[v3]; |
4542 v36 = v4; | 4542 v36 = v4; |
4543 v5 = v4->field_58_pid; | 4543 v5 = v4->spell_caster_pid; |
4544 v2 = v5 & 7; | 4544 v2 = v5 & 7; |
4545 v3 = v5 >> 3; | 4545 v3 = v5 >> 3; |
4546 } | 4546 } |
4547 v41 = v2; | 4547 v41 = v2; |
4548 v37 = v3; | 4548 v37 = v3; |
4779 if ( (a1 & 7) == OBJECT_Item) | 4779 if ( (a1 & 7) == OBJECT_Item) |
4780 { | 4780 { |
4781 v4 = &pSpriteObjects[a1 >> 3]; | 4781 v4 = &pSpriteObjects[a1 >> 3]; |
4782 //uDamageAmount = (int)v4; | 4782 //uDamageAmount = (int)v4; |
4783 v61 = v4->field_60_distance_related_prolly_lod; | 4783 v61 = v4->field_60_distance_related_prolly_lod; |
4784 a1 = v4->field_58_pid; | 4784 a1 = v4->spell_caster_pid; |
4785 //v54 = v4->field_58_pid; | 4785 //v54 = v4->field_58_pid; |
4786 } | 4786 } |
4787 //v5 = a1 & 7; | 4787 //v5 = a1 & 7; |
4788 //uPlayerID = a1 >> 3; | 4788 //uPlayerID = a1 >> 3; |
4789 if ((a1 & 7) != OBJECT_Player) | 4789 if ((a1 & 7) != OBJECT_Player) |
4848 goto LABEL_67; | 4848 goto LABEL_67; |
4849 //goto LABEL_69; | 4849 //goto LABEL_69; |
4850 } | 4850 } |
4851 | 4851 |
4852 | 4852 |
4853 v19 = v4->field_48 == 99; | 4853 v19 = v4->spell_id == SPELL_DARK_SOULDRINKER; |
4854 v61 = v4->field_60_distance_related_prolly_lod; | 4854 v61 = v4->field_60_distance_related_prolly_lod; |
4855 if ( !v19 ) | 4855 if ( !v19 ) |
4856 { | 4856 { |
4857 v9 = (SpriteObject *)uDamageAmount; | 4857 v9 = (SpriteObject *)uDamageAmount; |
4858 v50 = pParty->vPosition.x - *(int *)(uDamageAmount + 4); | 4858 v50 = pParty->vPosition.x - *(int *)(uDamageAmount + 4); |
4895 v61 = 1; | 4895 v61 = 1; |
4896 } | 4896 } |
4897 v4 = (SpriteObject *)uDamageAmount; | 4897 v4 = (SpriteObject *)uDamageAmount; |
4898 } | 4898 } |
4899 | 4899 |
4900 v15 = v4->field_48; | 4900 v15 = v4->spell_id; |
4901 if ( v15 == 102 ) | 4901 if ( v15 == SPELL_LASER_PROJECTILE ) |
4902 { | 4902 { |
4903 v16 = player->pActiveSkills[7]; | 4903 v16 = player->pActiveSkills[7]; |
4904 v61 = 1; | 4904 v61 = 1; |
4905 if ( (signed int)SkillToMastery(v16) >= 3 ) | 4905 if ( (signed int)SkillToMastery(v16) >= 3 ) |
4906 a4 = player->pActiveSkills[7] & 0x3F; | 4906 a4 = player->pActiveSkills[7] & 0x3F; |
4907 a2 = 4; | 4907 a2 = 4; |
4908 uDamageAmount = player->CalculateMeleeDamageTo(1, 1, 0); | 4908 uDamageAmount = player->CalculateMeleeDamageTo(1, 1, 0); |
4909 goto LABEL_67; | 4909 goto LABEL_67; |
4910 } | 4910 } |
4911 if ( v15 != 100 ) | 4911 if ( v15 != SPELL_BOW_ARROW ) |
4912 { | 4912 { |
4913 if ( v15 == 101 ) | 4913 if ( v15 == SPELL_101 ) |
4914 { | 4914 { |
4915 a2 = 0; | 4915 a2 = 0; |
4916 v18 = player->CalculateRangedDamageTo(0); | 4916 v18 = player->CalculateRangedDamageTo(0); |
4917 v19 = HIDWORD(pMonster->pActorBuffs[15].uExpireTime) == 0; | 4917 v19 = HIDWORD(pMonster->pActorBuffs[15].uExpireTime) == 0; |
4918 v20 = SHIDWORD(pMonster->pActorBuffs[15].uExpireTime) < 0; | 4918 v20 = SHIDWORD(pMonster->pActorBuffs[15].uExpireTime) < 0; |
4920 if ( !v20 && (!(v20 | v19) || LODWORD(pMonster->pActorBuffs[15].uExpireTime)) ) | 4920 if ( !v20 && (!(v20 | v19) || LODWORD(pMonster->pActorBuffs[15].uExpireTime)) ) |
4921 uDamageAmount >>= 1; | 4921 uDamageAmount >>= 1; |
4922 v59 = 1; | 4922 v59 = 1; |
4923 goto LABEL_67; | 4923 goto LABEL_67; |
4924 } | 4924 } |
4925 if ( v15 == 39 ) | 4925 if ( v15 == SPELL_EARTH_BLADES ) |
4926 { | 4926 { |
4927 a4 = 5 * v4->field_4C; | 4927 a4 = 5 * v4->spell_level; |
4928 a2 = player->GetSpellSchool(0x27u); | 4928 a2 = player->GetSpellSchool(0x27u); |
4929 v21 = v4->field_4C; | 4929 v21 = v4->spell_level; |
4930 v50 = pMonster->sCurrentHP; | 4930 v50 = pMonster->sCurrentHP; |
4931 pMonsterName = (char *)v4->field_50; | 4931 pMonsterName = (char *)v4->spell_skill; |
4932 v22 = _43AFE3_calc_spell_damage(39, v21, (signed int)pMonsterName, v50); | 4932 v22 = _43AFE3_calc_spell_damage(39, v21, v4->spell_skill, v50); |
4933 v23 = HIDWORD(pMonster->pActorBuffs[15].uExpireTime) == 0; | 4933 v23 = HIDWORD(pMonster->pActorBuffs[15].uExpireTime) == 0; |
4934 v24 = SHIDWORD(pMonster->pActorBuffs[15].uExpireTime) < 0; | 4934 v24 = SHIDWORD(pMonster->pActorBuffs[15].uExpireTime) < 0; |
4935 uDamageAmount = v22; | 4935 uDamageAmount = v22; |
4936 if ( !v24 && (!(v24 | v23) || LODWORD(pMonster->pActorBuffs[15].uExpireTime)) ) | 4936 if ( !v24 && (!(v24 | v23) || LODWORD(pMonster->pActorBuffs[15].uExpireTime)) ) |
4937 uDamageAmount >>= 1; | 4937 uDamageAmount >>= 1; |
4943 player->PlaySound(SPEECH_52, 0); | 4943 player->PlaySound(SPEECH_52, 0); |
4944 return; | 4944 return; |
4945 } | 4945 } |
4946 goto LABEL_69; | 4946 goto LABEL_69; |
4947 } | 4947 } |
4948 if ( v15 == 34 ) | 4948 if ( v15 == SPELL_EARTH_STUN ) |
4949 { | 4949 { |
4950 uDamageAmount = 0; | 4950 uDamageAmount = 0; |
4951 a2 = 4; | 4951 a2 = 4; |
4952 hit_will_stun = 1; | 4952 hit_will_stun = 1; |
4953 goto LABEL_67; | 4953 goto LABEL_67; |
4954 } | 4954 } |
4955 v50 = v4->field_48; | 4955 a2 = player->GetSpellSchool(v4->spell_id); |
4956 a2 = player->GetSpellSchool(v50); | 4956 v25 = v4->spell_level; |
4957 v25 = v4->field_4C; | 4957 v26 = v4->spell_id; |
4958 v26 = v4->field_48; | |
4959 v50 = pMonster->sCurrentHP; | 4958 v50 = pMonster->sCurrentHP; |
4960 pMonsterName = (char *)v4->field_50; | 4959 pMonsterName = (char *)v4->spell_skill; |
4961 //v27 = _43AFE3_calc_spell_damage(v26, v25, (signed int)pMonsterName, v50); | 4960 //v27 = _43AFE3_calc_spell_damage(v26, v25, (signed int)pMonsterName, v50); |
4962 v59 = 0; | 4961 v59 = 0; |
4963 //v57 = (PlayerEquipment *)1; | 4962 //v57 = (PlayerEquipment *)1; |
4964 //LABEL_65: | 4963 //LABEL_65: |
4965 uDamageAmount = _43AFE3_calc_spell_damage(v26, v25, (signed int)pMonsterName, v50); | 4964 uDamageAmount = _43AFE3_calc_spell_damage(v26, v25, v4->spell_skill, v50); |
4966 //if ( !v57 ) | 4965 //if ( !v57 ) |
4967 // goto LABEL_67; | 4966 // goto LABEL_67; |
4968 goto LABEL_69; | 4967 goto LABEL_69; |
4969 } | 4968 } |
4970 v50 = pMonster->word_000086_some_monster_id; | 4969 v50 = pMonster->word_000086_some_monster_id; |
5448 } | 5447 } |
5449 viewparams->bRedrawGameUI = 1; | 5448 viewparams->bRedrawGameUI = 1; |
5450 return; | 5449 return; |
5451 } | 5450 } |
5452 v37 = &pSpriteObjects[uActorID]; | 5451 v37 = &pSpriteObjects[uActorID]; |
5453 v38 = v37->field_58_pid & 7; | 5452 v38 = v37->spell_caster_pid & 7; |
5454 v39 = v37->field_58_pid >> 3; | 5453 v39 = v37->spell_caster_pid >> 3; |
5455 v40 = v37->field_58_pid & 7; | 5454 v40 = v37->spell_caster_pid & 7; |
5456 uActorID = v37->field_58_pid >> 3; | 5455 uActorID = v37->spell_caster_pid >> 3; |
5457 v41 = v40 - 2; | 5456 v41 = v40 - 2; |
5458 if ( !v41 ) | 5457 if ( !v41 ) |
5459 goto LABEL_80; | 5458 goto LABEL_80; |
5460 v42 = v41 - 1; | 5459 v42 = v41 - 1; |
5461 if ( !v42 ) | 5460 if ( !v42 ) |
5637 if ( a4 != -1 ) | 5636 if ( a4 != -1 ) |
5638 { | 5637 { |
5639 v43 = &pParty->pPlayers[a4]; | 5638 v43 = &pParty->pPlayers[a4]; |
5640 LABEL_168: | 5639 LABEL_168: |
5641 a4b = v43; | 5640 a4b = v43; |
5642 if ( v38 != OBJECT_Player || v37->field_48 != 100 ) | 5641 if ( v38 != OBJECT_Player || v37->spell_id != SPELL_BOW_ARROW) |
5643 { | 5642 { |
5644 v70 = v43->GetMaxHealth(); | 5643 v70 = v43->GetMaxHealth(); |
5645 v68 = _43AFE3_calc_spell_damage(v37->field_48, v37->field_4C, v37->field_50, v70); | 5644 v68 = _43AFE3_calc_spell_damage(v37->spell_id, v37->spell_level, v37->spell_skill, v70); |
5646 v69 = LOBYTE(pSpellStats->pInfos[v37->field_48].uSchool); | 5645 v69 = LOBYTE(pSpellStats->pInfos[v37->spell_id].uSchool); |
5647 } | 5646 } |
5648 else | 5647 else |
5649 { | 5648 { |
5650 v68 = pParty->pPlayers[uActorID].CalculateRangedDamageTo(0); | 5649 v68 = pParty->pPlayers[uActorID].CalculateRangedDamageTo(0); |
5651 v69 = 0; | 5650 v69 = 0; |
5688 unsigned int v6; // [sp+10h] [bp-4h]@1 | 5687 unsigned int v6; // [sp+10h] [bp-4h]@1 |
5689 | 5688 |
5690 v6 = uLayingItemID; | 5689 v6 = uLayingItemID; |
5691 v2 = uLayingItemID; | 5690 v2 = uLayingItemID; |
5692 v3 = a2 >> 3; | 5691 v3 = a2 >> 3; |
5693 v4 = pSpriteObjects[uLayingItemID].field_58_pid & 7; | 5692 v4 = pSpriteObjects[uLayingItemID].spell_caster_pid & 7; |
5694 v5 = (a2 & 7) - 3; | 5693 v5 = (a2 & 7) - 3; |
5695 if ( v5 ) | 5694 if ( v5 ) |
5696 { | 5695 { |
5697 if ( v5 == 1 ) | 5696 if ( v5 == 1 ) |
5698 { | 5697 { |
5862 if ( !pActors[uActorID].IsNotAlive() ) | 5861 if ( !pActors[uActorID].IsNotAlive() ) |
5863 { | 5862 { |
5864 if ( (a2 & 7) == OBJECT_Item) | 5863 if ( (a2 & 7) == OBJECT_Item) |
5865 { | 5864 { |
5866 v4 = &pSpriteObjects[(signed int)a2 >> 3]; | 5865 v4 = &pSpriteObjects[(signed int)a2 >> 3]; |
5867 v5 = v4->field_48; | 5866 v5 = v4->spell_id; |
5868 if ( v5 ) | 5867 if ( v5 ) |
5869 { | 5868 { |
5870 v6 = _43AFE3_calc_spell_damage(v5, v4->field_4C, v4->field_50, pActor->sCurrentHP); | 5869 v6 = _43AFE3_calc_spell_damage(v5, v4->spell_level, v4->spell_skill, pActor->sCurrentHP); |
5871 v7 = stru_50C198.CalcMagicalDamageToActor(pActor, 0, v6); | 5870 v7 = stru_50C198.CalcMagicalDamageToActor(pActor, 0, v6); |
5872 pActor->sCurrentHP -= v7; | 5871 pActor->sCurrentHP -= v7; |
5873 if ( v7 ) | 5872 if ( v7 ) |
5874 { | 5873 { |
5875 if ( pActor->sCurrentHP > 0 ) | 5874 if ( pActor->sCurrentHP > 0 ) |
5922 v17 = a1; | 5921 v17 = a1; |
5923 if ( (a1 & 7) == OBJECT_Item) | 5922 if ( (a1 & 7) == OBJECT_Item) |
5924 { | 5923 { |
5925 v5 = &pSpriteObjects[a1 >> 3]; | 5924 v5 = &pSpriteObjects[a1 >> 3]; |
5926 v4 = v5->field_60_distance_related_prolly_lod; | 5925 v4 = v5->field_60_distance_related_prolly_lod; |
5927 v17 = v5->field_58_pid; | 5926 v17 = v5->spell_caster_pid; |
5928 } | 5927 } |
5929 LOWORD(v6) = v17 & 7; | 5928 LOWORD(v6) = v17 & 7; |
5930 if ( v6 == OBJECT_Actor) | 5929 if ( v6 == OBJECT_Actor) |
5931 { | 5930 { |
5932 v7 = &pActors[a2]; | 5931 v7 = &pActors[a2]; |