changeset 2192:c13ae8d8471f

PLAYER_SKILL_BLASTER
author Ritor1
date Thu, 30 Jan 2014 20:13:23 +0600
parents 48a28fe1f32f
children d0e321190c86
files CastSpellInfo.cpp UI/UIPopup.cpp
diffstat 2 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/CastSpellInfo.cpp	Thu Jan 30 17:41:54 2014 +0600
+++ b/CastSpellInfo.cpp	Thu Jan 30 20:13:23 2014 +0600
@@ -205,6 +205,8 @@
         v667 = PLAYER_SKILL_DARK;
       else if (pCastSpell->uSpellID == SPELL_BOW_ARROW)
         v667 = PLAYER_SKILL_BOW;
+      else if (pCastSpell->uSpellID == SPELL_101 || pCastSpell->uSpellID == SPELL_LASER_PROJECTILE )
+        v667 = PLAYER_SKILL_BLASTER;
       else assert(false && "Unknown spell");
 
       v725 = v667;
@@ -214,12 +216,14 @@
     }
 
     skill_level = SkillToMastery(v11);
-
-    if (pCastSpell->forced_spell_skill_level)
-      uRequiredMana = 0;
-    else 
-      uRequiredMana = pSpellDatas[pCastSpell->uSpellID - 1].mana_per_skill[skill_level - 1];
-    sRecoveryTime = pSpellDatas[pCastSpell->uSpellID - 1].recovery_per_skill[skill_level - 1];
+    if (pCastSpell->uSpellID < SPELL_BOW_ARROW )
+    {
+      if (pCastSpell->forced_spell_skill_level)
+        uRequiredMana = 0;
+      else 
+        uRequiredMana = pSpellDatas[pCastSpell->uSpellID].mana_per_skill[skill_level - 1];
+      sRecoveryTime = pSpellDatas[pCastSpell->uSpellID].recovery_per_skill[skill_level - 1];
+    }
 
     if (v725 == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 ||
         v725 == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0)
--- a/UI/UIPopup.cpp	Thu Jan 30 17:41:54 2014 +0600
+++ b/UI/UIPopup.cpp	Thu Jan 30 20:13:23 2014 +0600
@@ -1278,10 +1278,11 @@
   spell_info_window.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0);
   spell_info_window.uFrameWidth = 108;
   spell_info_window.uFrameZ = spell_info_window.uFrameX + 107;
-  spell_info_window.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12], 3);
+  int skill_level = SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12]);
+  spell_info_window.DrawTitleText(pFontComic, 12, 75, 0, pSkillNames[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12], 3);
   sprintf( pTmpBuf.data(),  "%s\n%d",    pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST],
-       pSpellDatas[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1].mana_per_skill[pPlayers[uActiveCharacter]->pActiveSkills[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + PLAYER_SKILL_FIRE]]);
-  spell_info_window.DrawTitleText(pFontComic, 0xCu, spell_info_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3);
+       pSpellDatas[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1].mana_per_skill[skill_level - 1]);
+  spell_info_window.DrawTitleText(pFontComic, 12, spell_info_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3);
   dword_507B00_spell_info_to_draw_in_popup = 0;
 }
     // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup;