Mercurial > mm7
comparison mm7_6.cpp @ 303:3dcc9d945eeb
DamageMonsterFromParty
author | Nomad |
---|---|
date | Tue, 19 Feb 2013 15:39:50 +0200 |
parents | 640a176c030f |
children | cc8e4dc397ec |
comparison
equal
deleted
inserted
replaced
296:af7e848d6def | 303:3dcc9d945eeb |
---|---|
3510 a1.vPosition.y = pParty->vPosition.y; | 3510 a1.vPosition.y = pParty->vPosition.y; |
3511 a1.uAttributes = 0; | 3511 a1.uAttributes = 0; |
3512 a1.uSpriteFrameID = 0; | 3512 a1.uSpriteFrameID = 0; |
3513 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 3513 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3514 v19 = 8 * v3->uPlayerID; | 3514 v19 = 8 * v3->uPlayerID; |
3515 LOBYTE(v19) = v19 | 4; | 3515 LOBYTE(v19) = v19 | OBJECT_Player; |
3516 a1.field_58 = v19; | 3516 a1.field_58_pid = v19; |
3517 a1.field_5C = a2; | 3517 a1.field_5C = a2; |
3518 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3518 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3519 a1.uFacing = LOWORD(v715.uYawAngle); | 3519 a1.uFacing = LOWORD(v715.uYawAngle); |
3520 a1.uSoundID = LOWORD(v3->field_10); | 3520 a1.uSoundID = LOWORD(v3->field_10); |
3521 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; | 3521 v20 = (char *)&pParty->pPlayers[v3->uPlayerID]; |
3548 a1.vPosition.y = pParty->vPosition.y; | 3548 a1.vPosition.y = pParty->vPosition.y; |
3549 a1.uAttributes = 0; | 3549 a1.uAttributes = 0; |
3550 a1.uSpriteFrameID = 0; | 3550 a1.uSpriteFrameID = 0; |
3551 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | 3551 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; |
3552 v22 = 8 * v3->uPlayerID; | 3552 v22 = 8 * v3->uPlayerID; |
3553 LOBYTE(v22) = v22 | 4; | 3553 LOBYTE(v22) = v22 | OBJECT_Player; |
3554 a1.field_58 = v22; | 3554 a1.field_58_pid = v22; |
3555 a1.field_5C = a2; | 3555 a1.field_5C = a2; |
3556 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3556 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3557 a1.uFacing = LOWORD(v715.uYawAngle); | 3557 a1.uFacing = LOWORD(v715.uYawAngle); |
3558 a1.uSoundID = LOWORD(v3->field_10); | 3558 a1.uSoundID = LOWORD(v3->field_10); |
3559 memcpy( | 3559 memcpy( |
3654 pParty->vPosition.x, | 3654 pParty->vPosition.x, |
3655 pParty->vPosition.y, | 3655 pParty->vPosition.y, |
3656 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 3656 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
3657 a1.uSpriteFrameID = v1; | 3657 a1.uSpriteFrameID = v1; |
3658 v34 = 8 * v3->uPlayerID; | 3658 v34 = 8 * v3->uPlayerID; |
3659 LOBYTE(v34) = v34 | 4; | 3659 LOBYTE(v34) = v34 | OBJECT_Player; |
3660 a1.field_58 = v34; | 3660 a1.field_58_pid = v34; |
3661 a1.field_5C = a2; | 3661 a1.field_5C = a2; |
3662 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3662 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3663 a1.uFacing = LOWORD(v715.uYawAngle); | 3663 a1.uFacing = LOWORD(v715.uYawAngle); |
3664 a1.uSoundID = LOWORD(v3->field_10); | 3664 a1.uSoundID = LOWORD(v3->field_10); |
3665 if ( pParty->bTurnBasedModeOn == 1 ) | 3665 if ( pParty->bTurnBasedModeOn == 1 ) |
3687 a1.uSectorID = v1; | 3687 a1.uSectorID = v1; |
3688 a1.uSpriteFrameID = v1; | 3688 a1.uSpriteFrameID = v1; |
3689 v37 = v3->uPlayerID; | 3689 v37 = v3->uPlayerID; |
3690 a1.field_60_distance_related_prolly_lod = 0; | 3690 a1.field_60_distance_related_prolly_lod = 0; |
3691 v37 *= 8; | 3691 v37 *= 8; |
3692 LOBYTE(v37) = v37 | 4; | 3692 LOBYTE(v37) = v37 | OBJECT_Player; |
3693 a1.uFacing = v1; | 3693 a1.uFacing = v1; |
3694 a1.field_58 = v37; | 3694 a1.field_58_pid = v37; |
3695 v38 = a2 >> 3; | 3695 v38 = a2 >> 3; |
3696 a1.uSoundID = LOWORD(v3->field_10); | 3696 a1.uSoundID = LOWORD(v3->field_10); |
3697 v39 = a2 >> 3; | 3697 v39 = a2 >> 3; |
3698 a1.vPosition.x = pActors[v39].vPosition.x; | 3698 a1.vPosition.x = pActors[v39].vPosition.x; |
3699 v40 = pActors[v39].vPosition.y; | 3699 v40 = pActors[v39].vPosition.y; |
3731 a1.uSpriteFrameID = v1; | 3731 a1.uSpriteFrameID = v1; |
3732 v44 = v3->uPlayerID; | 3732 v44 = v3->uPlayerID; |
3733 a1.field_60_distance_related_prolly_lod = 0; | 3733 a1.field_60_distance_related_prolly_lod = 0; |
3734 a1.uFacing = v1; | 3734 a1.uFacing = v1; |
3735 v44 *= 8; | 3735 v44 *= 8; |
3736 LOBYTE(v44) = v44 | 4; | 3736 LOBYTE(v44) = v44 | OBJECT_Player; |
3737 v38 = (signed int)v726; | 3737 v38 = (signed int)v726; |
3738 a1.field_58 = v44; | 3738 a1.field_58_pid = v44; |
3739 a1.uSoundID = LOWORD(v3->field_10); | 3739 a1.uSoundID = LOWORD(v3->field_10); |
3740 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | 3740 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); |
3741 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | 3741 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); |
3742 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | 3742 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); |
3743 v46 = 8 * (int)v726; | 3743 v46 = 8 * (int)v726; |
3769 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | 3769 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); |
3770 a1.uAttributes = v1; | 3770 a1.uAttributes = v1; |
3771 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); | 3771 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); |
3772 a1.uSpriteFrameID = v1; | 3772 a1.uSpriteFrameID = v1; |
3773 v49 = 8 * v3->uPlayerID; | 3773 v49 = 8 * v3->uPlayerID; |
3774 LOBYTE(v49) = v49 | 4; | 3774 LOBYTE(v49) = v49 | OBJECT_Player; |
3775 a1.field_58 = v49; | 3775 a1.field_58_pid = v49; |
3776 a1.field_5C = a2; | 3776 a1.field_5C = a2; |
3777 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3777 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3778 a1.uFacing = LOWORD(v715.uYawAngle); | 3778 a1.uFacing = LOWORD(v715.uYawAngle); |
3779 LOWORD(v49) = LOWORD(v3->field_10); | 3779 LOWORD(v49) = LOWORD(v3->field_10); |
3780 LOBYTE(a1.uAttributes) |= 0x80u; | 3780 LOBYTE(a1.uAttributes) |= 0x80u; |
3816 pParty->vPosition.x, | 3816 pParty->vPosition.x, |
3817 pParty->vPosition.y, | 3817 pParty->vPosition.y, |
3818 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 3818 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
3819 a1.uSpriteFrameID = v1; | 3819 a1.uSpriteFrameID = v1; |
3820 v50 = 8 * v3->uPlayerID; | 3820 v50 = 8 * v3->uPlayerID; |
3821 LOBYTE(v50) = v50 | 4; | 3821 LOBYTE(v50) = v50 | OBJECT_Player; |
3822 a1.field_58 = v50; | 3822 a1.field_58_pid = v50; |
3823 a1.field_5C = a2; | 3823 a1.field_5C = a2; |
3824 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3824 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3825 a1.uFacing = LOWORD(v715.uYawAngle); | 3825 a1.uFacing = LOWORD(v715.uYawAngle); |
3826 a1.uSoundID = LOWORD(v3->field_10); | 3826 a1.uSoundID = LOWORD(v3->field_10); |
3827 if ( pParty->bTurnBasedModeOn == 1 ) | 3827 if ( pParty->bTurnBasedModeOn == 1 ) |
3965 pParty->vPosition.x, | 3965 pParty->vPosition.x, |
3966 pParty->vPosition.y, | 3966 pParty->vPosition.y, |
3967 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 3967 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
3968 a1.uSpriteFrameID = v1; | 3968 a1.uSpriteFrameID = v1; |
3969 v62 = 8 * v3->uPlayerID; | 3969 v62 = 8 * v3->uPlayerID; |
3970 LOBYTE(v62) = v62 | 4; | 3970 LOBYTE(v62) = v62 | OBJECT_Player; |
3971 a1.field_58 = v62; | 3971 a1.field_58_pid = v62; |
3972 a1.field_5C = a2; | 3972 a1.field_5C = a2; |
3973 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3973 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3974 a1.uFacing = LOWORD(v715.uYawAngle); | 3974 a1.uFacing = LOWORD(v715.uYawAngle); |
3975 a1.uSoundID = LOWORD(v3->field_10); | 3975 a1.uSoundID = LOWORD(v3->field_10); |
3976 a1.field_50 = v731; | 3976 a1.field_50 = v731; |
4367 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 4367 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
4368 a1.uAttributes = 0; | 4368 a1.uAttributes = 0; |
4369 a1.uSectorID = 0; | 4369 a1.uSectorID = 0; |
4370 a1.uSpriteFrameID = 0; | 4370 a1.uSpriteFrameID = 0; |
4371 v120 = 8 * *(short *)(v119 + 2); | 4371 v120 = 8 * *(short *)(v119 + 2); |
4372 LOBYTE(v120) = v120 | 4; | 4372 LOBYTE(v120) = v120 | OBJECT_Player; |
4373 a1.field_60_distance_related_prolly_lod = 0; | 4373 a1.field_60_distance_related_prolly_lod = 0; |
4374 a1.field_58 = v120; | 4374 a1.field_58_pid = v120; |
4375 a1.uFacing = 0; | 4375 a1.uFacing = 0; |
4376 a1.uSoundID = *(short *)(v119 + 16); | 4376 a1.uSoundID = *(short *)(v119 + 16); |
4377 a1.vPosition.x = v112->vPosition.x; | 4377 a1.vPosition.x = v112->vPosition.x; |
4378 a1.vPosition.y = v112->vPosition.y; | 4378 a1.vPosition.y = v112->vPosition.y; |
4379 v726 = (Player *)v112->uActorHeight; | 4379 v726 = (Player *)v112->uActorHeight; |
4570 a1.vPosition.x = uRequiredMana; | 4570 a1.vPosition.x = uRequiredMana; |
4571 a1.vPosition.y = LODWORD(v727); | 4571 a1.vPosition.y = LODWORD(v727); |
4572 a1.uSectorID = v1; | 4572 a1.uSectorID = v1; |
4573 a1.vPosition.z = a2 + v713; | 4573 a1.vPosition.z = a2 + v713; |
4574 a1.uSpriteFrameID = v1; | 4574 a1.uSpriteFrameID = v1; |
4575 a1.field_58 = 8 * v3->uPlayerID | 4; | 4575 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
4576 a1.field_5C = v730; | 4576 a1.field_5C = v730; |
4577 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | 4577 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); |
4578 a1.uFacing = v687; | 4578 a1.uFacing = v687; |
4579 a1.uSoundID = LOWORD(v3->field_10); | 4579 a1.uSoundID = LOWORD(v3->field_10); |
4580 if ( pParty->bTurnBasedModeOn == 1 ) | 4580 if ( pParty->bTurnBasedModeOn == 1 ) |
4618 a1.uSpriteFrameID = v1; | 4618 a1.uSpriteFrameID = v1; |
4619 v161 = v3->uPlayerID; | 4619 v161 = v3->uPlayerID; |
4620 a1.field_60_distance_related_prolly_lod = 0; | 4620 a1.field_60_distance_related_prolly_lod = 0; |
4621 a1.uFacing = v1; | 4621 a1.uFacing = v1; |
4622 v161 *= 8; | 4622 v161 *= 8; |
4623 LOBYTE(v161) = v161 | 4; | 4623 LOBYTE(v161) = v161 | OBJECT_Player; |
4624 a1.field_58 = v161; | 4624 a1.field_58_pid = v161; |
4625 a1.uSoundID = LOWORD(v3->field_10); | 4625 a1.uSoundID = LOWORD(v3->field_10); |
4626 a2 = v1; | 4626 a2 = v1; |
4627 if ( (signed int)v726 > v1 ) | 4627 if ( (signed int)v726 > v1 ) |
4628 { | 4628 { |
4629 do | 4629 do |
4757 pParty->vPosition.x, | 4757 pParty->vPosition.x, |
4758 pParty->vPosition.y, | 4758 pParty->vPosition.y, |
4759 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 4759 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
4760 a1.uSpriteFrameID = v1; | 4760 a1.uSpriteFrameID = v1; |
4761 v187 = 8 * v3->uPlayerID; | 4761 v187 = 8 * v3->uPlayerID; |
4762 LOBYTE(v187) = v187 | 4; | 4762 LOBYTE(v187) = v187 | OBJECT_Player; |
4763 a1.field_58 = v187; | 4763 a1.field_58_pid = v187; |
4764 a1.field_5C = a2; | 4764 a1.field_5C = a2; |
4765 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 4765 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
4766 a1.uSoundID = LOWORD(v3->field_10); | 4766 a1.uSoundID = LOWORD(v3->field_10); |
4767 if ( pParty->bTurnBasedModeOn == 1 ) | 4767 if ( pParty->bTurnBasedModeOn == 1 ) |
4768 LOBYTE(a1.uAttributes) |= 4u; | 4768 LOBYTE(a1.uAttributes) |= 4u; |
4974 a1.vPosition.x = LODWORD(v718); | 4974 a1.vPosition.x = LODWORD(v718); |
4975 a1.vPosition.y = v713; | 4975 a1.vPosition.y = v713; |
4976 a1.uSectorID = v1; | 4976 a1.uSectorID = v1; |
4977 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); | 4977 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); |
4978 a1.uSpriteFrameID = v1; | 4978 a1.uSpriteFrameID = v1; |
4979 a1.field_58 = 8 * v3->uPlayerID | 4; | 4979 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
4980 a1.field_5C = v730; | 4980 a1.field_5C = v730; |
4981 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | 4981 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); |
4982 a1.uFacing = v685; | 4982 a1.uFacing = v685; |
4983 a1.uSoundID = LOWORD(v3->field_10); | 4983 a1.uSoundID = LOWORD(v3->field_10); |
4984 if ( pParty->bTurnBasedModeOn == 1 ) | 4984 if ( pParty->bTurnBasedModeOn == 1 ) |
5069 a1.vPosition.z = v51; | 5069 a1.vPosition.z = v51; |
5070 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | 5070 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); |
5071 a1.uSpriteFrameID = v1; | 5071 a1.uSpriteFrameID = v1; |
5072 a1.uSectorID = v52; | 5072 a1.uSectorID = v52; |
5073 v53 = 8 * v3->uPlayerID; | 5073 v53 = 8 * v3->uPlayerID; |
5074 LOBYTE(v53) = v53 | 4; | 5074 LOBYTE(v53) = v53 | OBJECT_Player; |
5075 a1.field_58 = v53; | 5075 a1.field_58_pid = v53; |
5076 a1.field_5C = a2; | 5076 a1.field_5C = a2; |
5077 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 5077 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
5078 a1.uFacing = LOWORD(v715.uYawAngle); | 5078 a1.uFacing = LOWORD(v715.uYawAngle); |
5079 a1.uSoundID = LOWORD(v3->field_10); | 5079 a1.uSoundID = LOWORD(v3->field_10); |
5080 LABEL_154: | 5080 LABEL_154: |
5105 pParty->vPosition.x, | 5105 pParty->vPosition.x, |
5106 pParty->vPosition.y, | 5106 pParty->vPosition.y, |
5107 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 5107 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
5108 a1.uSpriteFrameID = v1; | 5108 a1.uSpriteFrameID = v1; |
5109 v226 = 8 * v3->uPlayerID; | 5109 v226 = 8 * v3->uPlayerID; |
5110 LOBYTE(v226) = v226 | 4; | 5110 LOBYTE(v226) = v226 | OBJECT_Player; |
5111 a1.field_58 = v226; | 5111 a1.field_58_pid = v226; |
5112 a1.field_5C = a2; | 5112 a1.field_5C = a2; |
5113 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 5113 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
5114 a1.uSoundID = LOWORD(v3->field_10); | 5114 a1.uSoundID = LOWORD(v3->field_10); |
5115 if ( pParty->bTurnBasedModeOn == 1 ) | 5115 if ( pParty->bTurnBasedModeOn == 1 ) |
5116 LOBYTE(a1.uAttributes) |= 4u; | 5116 LOBYTE(a1.uAttributes) |= 4u; |
5691 pParty->vPosition.x, | 5691 pParty->vPosition.x, |
5692 pParty->vPosition.y, | 5692 pParty->vPosition.y, |
5693 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 5693 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
5694 a1.uSpriteFrameID = v1; | 5694 a1.uSpriteFrameID = v1; |
5695 v326 = 8 * v3->uPlayerID; | 5695 v326 = 8 * v3->uPlayerID; |
5696 LOBYTE(v326) = v326 | 4; | 5696 LOBYTE(v326) = v326 | OBJECT_Player; |
5697 a1.field_58 = v326; | 5697 a1.field_58_pid = v326; |
5698 a1.field_5C = a2; | 5698 a1.field_5C = a2; |
5699 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 5699 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
5700 a1.uFacing = LOWORD(pParty->sRotationY); | 5700 a1.uFacing = LOWORD(pParty->sRotationY); |
5701 a1.uSoundID = LOWORD(v3->field_10); | 5701 a1.uSoundID = LOWORD(v3->field_10); |
5702 if ( pParty->bTurnBasedModeOn == 1 ) | 5702 if ( pParty->bTurnBasedModeOn == 1 ) |
5721 a1.uAttributes = v1; | 5721 a1.uAttributes = v1; |
5722 a1.uSectorID = v1; | 5722 a1.uSectorID = v1; |
5723 a1.uSpriteFrameID = v1; | 5723 a1.uSpriteFrameID = v1; |
5724 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 5724 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5725 v327 = 8 * v3->uPlayerID; | 5725 v327 = 8 * v3->uPlayerID; |
5726 LOBYTE(v327) = v327 | 4; | 5726 LOBYTE(v327) = v327 | OBJECT_Player; |
5727 a1.field_60_distance_related_prolly_lod = 0; | 5727 a1.field_60_distance_related_prolly_lod = 0; |
5728 a1.field_58 = v327; | 5728 a1.field_58_pid = v327; |
5729 a1.field_5C = a2; | 5729 a1.field_5C = a2; |
5730 a1.uFacing = LOWORD(pParty->sRotationY); | 5730 a1.uFacing = LOWORD(pParty->sRotationY); |
5731 a1.uSoundID = LOWORD(v3->field_10); | 5731 a1.uSoundID = LOWORD(v3->field_10); |
5732 if ( pParty->bTurnBasedModeOn == 1 ) | 5732 if ( pParty->bTurnBasedModeOn == 1 ) |
5733 a1.uAttributes = 4; | 5733 a1.uAttributes = 4; |
5938 a1.uSpriteFrameID = v1; | 5938 a1.uSpriteFrameID = v1; |
5939 v368 = v3->uPlayerID; | 5939 v368 = v3->uPlayerID; |
5940 a1.field_60_distance_related_prolly_lod = 0; | 5940 a1.field_60_distance_related_prolly_lod = 0; |
5941 a1.uFacing = v1; | 5941 a1.uFacing = v1; |
5942 v368 *= 8; | 5942 v368 *= 8; |
5943 LOBYTE(v368) = v368 | 4; | 5943 LOBYTE(v368) = v368 | OBJECT_Player; |
5944 a1.field_58 = v368; | 5944 a1.field_58_pid = v368; |
5945 a1.uSoundID = LOWORD(v3->field_10); | 5945 a1.uSoundID = LOWORD(v3->field_10); |
5946 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | 5946 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) |
5947 { | 5947 { |
5948 v369 = &pActors[dword_50BF30[a2]]; | 5948 v369 = &pActors[dword_50BF30[a2]]; |
5949 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | 5949 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) |
6379 a1.uSpriteFrameID = v1; | 6379 a1.uSpriteFrameID = v1; |
6380 v432 = v3->uPlayerID; | 6380 v432 = v3->uPlayerID; |
6381 a1.field_60_distance_related_prolly_lod = 0; | 6381 a1.field_60_distance_related_prolly_lod = 0; |
6382 a1.uFacing = v1; | 6382 a1.uFacing = v1; |
6383 v432 *= 8; | 6383 v432 *= 8; |
6384 LOBYTE(v432) = v432 | 4; | 6384 LOBYTE(v432) = v432 | OBJECT_Player; |
6385 a1.field_58 = v432; | 6385 a1.field_58_pid = v432; |
6386 a1.uSoundID = LOWORD(v3->field_10); | 6386 a1.uSoundID = LOWORD(v3->field_10); |
6387 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | 6387 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) |
6388 { | 6388 { |
6389 v433 = &pActors[dword_50BF30[a2]]; | 6389 v433 = &pActors[dword_50BF30[a2]]; |
6390 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | 6390 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) |
6840 a1.uSpriteFrameID = v1; | 6840 a1.uSpriteFrameID = v1; |
6841 v506 = v3->uPlayerID; | 6841 v506 = v3->uPlayerID; |
6842 a1.field_60_distance_related_prolly_lod = 0; | 6842 a1.field_60_distance_related_prolly_lod = 0; |
6843 a1.uFacing = v1; | 6843 a1.uFacing = v1; |
6844 v506 *= 8; | 6844 v506 *= 8; |
6845 LOBYTE(v506) = v506 | 4; | 6845 LOBYTE(v506) = v506 | OBJECT_Player; |
6846 a1.field_58 = v506; | 6846 a1.field_58_pid = v506; |
6847 a1.uSoundID = LOWORD(v3->field_10); | 6847 a1.uSoundID = LOWORD(v3->field_10); |
6848 a2 = v1; | 6848 a2 = v1; |
6849 if ( SHIDWORD(v733) > v1 ) | 6849 if ( SHIDWORD(v733) > v1 ) |
6850 { | 6850 { |
6851 do | 6851 do |
7010 a1.uSpriteFrameID = v1; | 7010 a1.uSpriteFrameID = v1; |
7011 v532 = v3->uPlayerID; | 7011 v532 = v3->uPlayerID; |
7012 a1.field_60_distance_related_prolly_lod = 0; | 7012 a1.field_60_distance_related_prolly_lod = 0; |
7013 a1.uFacing = v1; | 7013 a1.uFacing = v1; |
7014 v532 *= 8; | 7014 v532 *= 8; |
7015 LOBYTE(v532) = v532 | 4; | 7015 LOBYTE(v532) = v532 | OBJECT_Player; |
7016 a1.field_58 = v532; | 7016 a1.field_58_pid = v532; |
7017 a1.uSoundID = LOWORD(v3->field_10); | 7017 a1.uSoundID = LOWORD(v3->field_10); |
7018 a2 = v1; | 7018 a2 = v1; |
7019 if ( (signed int)v726 > v1 ) | 7019 if ( (signed int)v726 > v1 ) |
7020 { | 7020 { |
7021 do | 7021 do |
7282 a1.uSpriteFrameID = v1; | 7282 a1.uSpriteFrameID = v1; |
7283 v580 = v3->uPlayerID; | 7283 v580 = v3->uPlayerID; |
7284 a1.field_60_distance_related_prolly_lod = 0; | 7284 a1.field_60_distance_related_prolly_lod = 0; |
7285 v581 = v721; | 7285 v581 = v721; |
7286 v580 *= 8; | 7286 v580 *= 8; |
7287 LOBYTE(v580) = v580 | 4; | 7287 LOBYTE(v580) = v580 | OBJECT_Player; |
7288 a1.uFacing = v1; | 7288 a1.uFacing = v1; |
7289 a1.field_58 = v580; | 7289 a1.field_58_pid = v580; |
7290 a1.uSoundID = LOWORD(v3->field_10); | 7290 a1.uSoundID = LOWORD(v3->field_10); |
7291 a1.vPosition.x = *(short *)(v721 + 142); | 7291 a1.vPosition.x = *(short *)(v721 + 142); |
7292 a1.vPosition.y = *(short *)(v721 + 144); | 7292 a1.vPosition.y = *(short *)(v721 + 144); |
7293 v732 = *(short *)(v721 + 138); | 7293 v732 = *(short *)(v721 + 138); |
7294 v582 = 8 * (int)v726; | 7294 v582 = 8 * (int)v726; |
7384 pParty->vPosition.x, | 7384 pParty->vPosition.x, |
7385 pParty->vPosition.y, | 7385 pParty->vPosition.y, |
7386 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | 7386 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); |
7387 a1.uSpriteFrameID = v1; | 7387 a1.uSpriteFrameID = v1; |
7388 v595 = 8 * v3->uPlayerID; | 7388 v595 = 8 * v3->uPlayerID; |
7389 LOBYTE(v595) = v595 | 4; | 7389 LOBYTE(v595) = v595 | OBJECT_Player; |
7390 a1.field_58 = v595; | 7390 a1.field_58_pid = v595; |
7391 a1.field_5C = a2; | 7391 a1.field_5C = a2; |
7392 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 7392 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
7393 a1.uSoundID = LOWORD(v3->field_10); | 7393 a1.uSoundID = LOWORD(v3->field_10); |
7394 if ( pParty->bTurnBasedModeOn == 1 ) | 7394 if ( pParty->bTurnBasedModeOn == 1 ) |
7395 LOBYTE(a1.uAttributes) |= 4u; | 7395 LOBYTE(a1.uAttributes) |= 4u; |
7469 LABEL_1087: | 7469 LABEL_1087: |
7470 a1.uAttributes = v1; | 7470 a1.uAttributes = v1; |
7471 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); | 7471 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); |
7472 a1.uSpriteFrameID = v1; | 7472 a1.uSpriteFrameID = v1; |
7473 v604 = 8 * v3->uPlayerID; | 7473 v604 = 8 * v3->uPlayerID; |
7474 LOBYTE(v604) = v604 | 4; | 7474 LOBYTE(v604) = v604 | OBJECT_Player; |
7475 a1.field_58 = v604; | 7475 a1.field_58_pid = v604; |
7476 a1.field_5C = a2; | 7476 a1.field_5C = a2; |
7477 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 7477 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
7478 a1.uFacing = LOWORD(v715.uYawAngle); | 7478 a1.uFacing = LOWORD(v715.uYawAngle); |
7479 LOWORD(v604) = LOWORD(v3->field_10); | 7479 LOWORD(v604) = LOWORD(v3->field_10); |
7480 LOBYTE(a1.uAttributes) |= 0x80u; | 7480 LOBYTE(a1.uAttributes) |= 0x80u; |
7617 a1.uSpriteFrameID = v1; | 7617 a1.uSpriteFrameID = v1; |
7618 v624 = v3->uPlayerID; | 7618 v624 = v3->uPlayerID; |
7619 a1.field_60_distance_related_prolly_lod = 0; | 7619 a1.field_60_distance_related_prolly_lod = 0; |
7620 a1.uFacing = v1; | 7620 a1.uFacing = v1; |
7621 v624 *= 8; | 7621 v624 *= 8; |
7622 LOBYTE(v624) = v624 | 4; | 7622 LOBYTE(v624) = v624 | OBJECT_Player; |
7623 a1.field_58 = v624; | 7623 a1.field_58_pid = v624; |
7624 a1.uSoundID = LOWORD(v3->field_10); | 7624 a1.uSoundID = LOWORD(v3->field_10); |
7625 a2 = v1; | 7625 a2 = v1; |
7626 if ( SHIDWORD(v733) > v1 ) | 7626 if ( SHIDWORD(v733) > v1 ) |
7627 { | 7627 { |
7628 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | 7628 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); |
7959 _42777D_CastSpell_UseWand_ShootArrow(*((int *)&pSpellDatas[66].field_8 + player->pInventoryItems[main_hand_idx - 1].uItemID), uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); | 7959 _42777D_CastSpell_UseWand_ShootArrow(*((int *)&pSpellDatas[66].field_8 + player->pInventoryItems[main_hand_idx - 1].uItemID), uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); |
7960 | 7960 |
7961 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) | 7961 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) |
7962 player->pEquipment.uMainHand = 0; | 7962 player->pEquipment.uMainHand = 0; |
7963 } | 7963 } |
7964 else if (target_type == OBJECT_Actor) | 7964 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
7965 { | 7965 { |
7966 if (actor_distance <= 407.2) | 7966 Vec3_int_ a3; |
7967 { | 7967 a3.x = actor->vPosition.x - pParty->vPosition.x; |
7968 Vec3_int_ a3; | 7968 a3.y = actor->vPosition.y - pParty->vPosition.y; |
7969 a3.x = actor->vPosition.x - pParty->vPosition.x; | 7969 a3.z = actor->vPosition.z - pParty->vPosition.z; |
7970 a3.y = actor->vPosition.y - pParty->vPosition.y; | 7970 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); |
7971 a3.z = actor->vPosition.z - pParty->vPosition.z; | 7971 |
7972 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | 7972 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); |
7973 | 7973 if (player->WearsItem(506, 1) || player->WearsItem(506, 0)) |
7974 DamageMonsterFromParty((8 * uActiveCharacter - 8) | OBJECT_Player, target_id, &a3); | |
7975 if (player->WearsItem(506, 1) || player->WearsItem(506, 0)) | |
7976 _42FA66_do_explosive_impact( | 7974 _42FA66_do_explosive_impact( |
7977 actor->vPosition.x, | 7975 actor->vPosition.x, |
7978 actor->vPosition.y, | 7976 actor->vPosition.y, |
7979 actor->vPosition.z + actor->uActorHeight / 2, | 7977 actor->vPosition.z + actor->uActorHeight / 2, |
7980 0, 512, uActiveCharacter); | 7978 0, 512, uActiveCharacter); |
7981 } | 7979 } |
7982 else if (bow_idx) | 7980 else if (bow_idx) |
7983 { | 7981 { |
7984 shooting_bow = true; | 7982 shooting_bow = true; |
7985 | 7983 _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0); |
7986 _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0); | |
7987 if (!pParty->bTurnBasedModeOn) | |
7988 { | |
7989 int recovery = player->GetAttackRecoveryTime(0); | |
7990 if (recovery < 30) | |
7991 recovery = 30; | |
7992 player->SetRecoveryTime(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333); | |
7993 } | |
7994 } | |
7995 } | 7984 } |
7996 else | 7985 else |
7997 { | 7986 { |
7998 if (bow_idx) | 7987 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
7999 { | 7988 } |
8000 shooting_bow = true; | 7989 |
8001 _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0); | 7990 if (!pParty->bTurnBasedModeOn) |
8002 } | 7991 { |
8003 else | 7992 int recovery = player->GetAttackRecoveryTime(0); |
8004 { | 7993 if (recovery < 30 ) |
8005 if (!pParty->bTurnBasedModeOn) | 7994 recovery = 30; |
8006 { | 7995 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); |
8007 int recovery = player->GetAttackRecoveryTime(0); | |
8008 if (recovery < 30 ) | |
8009 recovery = 30; | |
8010 player->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333)); | |
8011 } | |
8012 } | |
8013 } | 7996 } |
8014 | 7997 |
8015 | 7998 |
8016 int v34 = 0; | 7999 int v34 = 0; |
8017 if (shooting_wand) | 8000 if (shooting_wand) |
8506 a1a.vPosition.y = y; | 8489 a1a.vPosition.y = y; |
8507 a1a.uSoundID = 0; | 8490 a1a.uSoundID = 0; |
8508 a1a.uAttributes = attributes; | 8491 a1a.uAttributes = attributes; |
8509 a1a.uSectorID = pIndoor->GetSector(v21, y, z); | 8492 a1a.uSectorID = pIndoor->GetSector(v21, y, z); |
8510 a1a.uSpriteFrameID = 0; | 8493 a1a.uSpriteFrameID = 0; |
8511 a1a.field_58 = 0; | 8494 a1a.field_58_pid = 0; |
8512 a1a.field_5C = 0; | 8495 a1a.field_5C = 0; |
8513 if ( !(a1a.uAttributes & 0x10) ) | 8496 if ( !(a1a.uAttributes & 0x10) ) |
8514 { | 8497 { |
8515 v13 = 0; | 8498 v13 = 0; |
8516 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) | 8499 if ( (signed int)pItemsTable->uAllItemsCount > 0 ) |
8612 a1.vPosition.z = z; | 8595 a1.vPosition.z = z; |
8613 a1.uSoundID = 0; | 8596 a1.uSoundID = 0; |
8614 a1.uAttributes = 0; | 8597 a1.uAttributes = 0; |
8615 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | 8598 a1.uSectorID = pIndoor->GetSector(v3, v4, z); |
8616 a1.uSpriteFrameID = 0; | 8599 a1.uSpriteFrameID = 0; |
8617 a1.field_58 = 0; | 8600 a1.field_58_pid = 0; |
8618 a1.field_5C = 0; | 8601 a1.field_5C = 0; |
8619 v8 = a1.Create(0, 0, 0, 0); | 8602 v8 = a1.Create(0, 0, 0, 0); |
8620 if ( v8 != -1 ) | 8603 if ( v8 != -1 ) |
8621 { | 8604 { |
8622 v9 = 8 * v8; | 8605 v9 = 8 * v8; |
8712 a1a.uFacing = 0; | 8695 a1a.uFacing = 0; |
8713 a1a.uSoundID = 0; | 8696 a1a.uSoundID = 0; |
8714 if ( a6 >= 1 || a6 <= 4 ) | 8697 if ( a6 >= 1 || a6 <= 4 ) |
8715 { | 8698 { |
8716 v10 = 8 * a6 - 8; | 8699 v10 = 8 * a6 - 8; |
8717 LOBYTE(v10) = v10 | 4; | 8700 LOBYTE(v10) = v10 | OBJECT_Player; |
8718 a1a.field_58 = v10; | 8701 a1a.field_58_pid = v10; |
8719 } | 8702 } |
8720 else | 8703 else |
8721 { | 8704 { |
8722 a1a.field_58 = 0; | 8705 a1a.field_58_pid = 0; |
8723 } | 8706 } |
8724 result = a1a.Create(0, 0, 0, 0); | 8707 result = a1a.Create(0, 0, 0, 0); |
8725 if ( result != -1 ) | 8708 if ( result != -1 ) |
8726 { | 8709 { |
8727 v12 = 8 * result; | 8710 v12 = 8 * result; |