Mercurial > mm7
comparison mm7_6.cpp @ 490:cc4b7981c1bb
Wands
author | Nomad |
---|---|
date | Wed, 27 Feb 2013 23:13:02 +0200 |
parents | a3939d5067c4 |
children | cb0ad52d6a26 |
comparison
equal
deleted
inserted
replaced
489:c92dd0242fb6 | 490:cc4b7981c1bb |
---|---|
2558 //__int16 v8; // ax@24 | 2558 //__int16 v8; // ax@24 |
2559 //char v9; // al@44 | 2559 //char v9; // al@44 |
2560 //int v10; // eax@45 | 2560 //int v10; // eax@45 |
2561 unsigned __int16 v11; // cx@45 | 2561 unsigned __int16 v11; // cx@45 |
2562 signed int v12; // ecx@48 | 2562 signed int v12; // ecx@48 |
2563 int v13; // eax@53 | 2563 //int v13; // eax@53 |
2564 unsigned __int8 v14; // zf@53 | 2564 unsigned __int8 v14; // zf@53 |
2565 //unsigned int v15; // edx@53 | 2565 //unsigned int v15; // edx@53 |
2566 //signed int v16; // eax@53 | 2566 //signed int v16; // eax@53 |
2567 Player *v17; // esi@70 | 2567 Player *v17; // esi@70 |
2568 int v18; // eax@72 | 2568 int v18; // eax@72 |
3407 } | 3407 } |
3408 v12 = v731; | 3408 v12 = v731; |
3409 } | 3409 } |
3410 | 3410 |
3411 v730 = v3->spellnum; | 3411 v730 = v3->spellnum; |
3412 v13 = v12 + 10 * v3->spellnum; | |
3413 if (v3->forced_spell_skill_level) | 3412 if (v3->forced_spell_skill_level) |
3414 uRequiredMana = 0; | 3413 uRequiredMana = 0; |
3415 else | 3414 else |
3416 uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v12 - 1]; | 3415 uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v12 - 1]; |
3417 sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v12 - 1]; | 3416 sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v12 - 1]; |
3418 | 3417 |
3419 if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || | 3418 if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || |
3420 LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute) | 3419 LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0) |
3421 uRequiredMana = 0; | 3420 uRequiredMana = 0; |
3422 | 3421 |
3423 if (v3->spellnum >= PLAYER_SKILL_BOW || pPlayer->sMana >= uRequiredMana) | 3422 if (v3->spellnum >= PLAYER_SKILL_BOW || pPlayer->sMana >= uRequiredMana) |
3424 break; | 3423 break; |
3425 | 3424 |
3506 && pParty->bTurnBasedModeOn == 1 ) | 3505 && pParty->bTurnBasedModeOn == 1 ) |
3507 ++pTurnEngine->field_1C; | 3506 ++pTurnEngine->field_1C; |
3508 } | 3507 } |
3509 goto play_sound_and_continue; | 3508 goto play_sound_and_continue; |
3510 | 3509 |
3511 case SPELL_102: | 3510 case SPELL_LASER_PROJECTILE: |
3512 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); | 3511 sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); |
3513 a1.stru_24.Reset(); | 3512 a1.stru_24.Reset(); |
3514 a1.field_48 = v3->spellnum; | 3513 a1.field_48 = v3->spellnum; |
3515 a1.field_4C = v723; | 3514 a1.field_4C = v723; |
3516 a1.field_50 = v731; | 3515 a1.field_50 = v731; |
7757 shotting_laser = false, | 7756 shotting_laser = false, |
7758 shooting_wand = false; | 7757 shooting_wand = false; |
7759 if (laser_weapon_item_id) | 7758 if (laser_weapon_item_id) |
7760 { | 7759 { |
7761 shotting_laser = true; | 7760 shotting_laser = true; |
7762 _42777D_CastSpell_UseWand_ShootArrow(102, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); | 7761 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); |
7763 } | 7762 } |
7764 else if (wand_item_id) | 7763 else if (wand_item_id) |
7765 { | 7764 { |
7766 shooting_wand = true; | 7765 shooting_wand = true; |
7767 | 7766 |
7768 int main_hand_idx = player->pEquipment.uMainHand; | 7767 int main_hand_idx = player->pEquipment.uMainHand; |
7769 _42777D_CastSpell_UseWand_ShootArrow(*((int *)&pSpellDatas[66].uNormalLevelRecovery + player->pInventoryItems[main_hand_idx - 1].uItemID), uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); | 7768 _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItems[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); |
7770 | 7769 |
7771 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) | 7770 if (!--player->pInventoryItems[main_hand_idx - 1].uNumCharges) |
7772 player->pEquipment.uMainHand = 0; | 7771 player->pEquipment.uMainHand = 0; |
7773 } | 7772 } |
7774 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) | 7773 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
7788 0, 512, uActiveCharacter); | 7787 0, 512, uActiveCharacter); |
7789 } | 7788 } |
7790 else if (bow_idx) | 7789 else if (bow_idx) |
7791 { | 7790 { |
7792 shooting_bow = true; | 7791 shooting_bow = true; |
7793 _42777D_CastSpell_UseWand_ShootArrow(100, uActiveCharacter - 1, 0, 0, 0); | 7792 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0); |
7794 } | 7793 } |
7795 else | 7794 else |
7796 { | 7795 { |
7797 ; // actor out of range or no actor; no ranged weapon so melee attacking air | 7796 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
7798 } | 7797 } |