Mercurial > mm7
diff Engine/Spells/CastSpellInfo.cpp @ 2567:d569340b05ff
Few constants changed into enum values
author | a.parshin |
---|---|
date | Thu, 21 May 2015 01:50:59 +0200 |
parents | 30eb6dcac768 |
children | dd36326a9994 |
line wrap: on
line diff
--- a/Engine/Spells/CastSpellInfo.cpp Wed May 20 21:05:07 2015 +0200 +++ b/Engine/Spells/CastSpellInfo.cpp Thu May 21 01:50:59 2015 +0200 @@ -1,16 +1,15 @@ #define _CRTDBG_MAP_ALLOC +#define _CRT_SECURE_NO_WARNINGS #include <stdlib.h> #include <crtdbg.h> -#define _CRT_SECURE_NO_WARNINGS - #include "Engine/Engine.h" #include "CastSpellInfo.h" #include "../Objects/Actor.h" #include "../Party.h" #include "IO/Mouse.h" -#include "../../stru6.h" +#include "Engine/stru6.h" #include "GUI/GUIWindow.h" #include "Media/Audio/AudioPlayer.h" #include "../Graphics/Outdoor.h" @@ -745,12 +744,12 @@ v730c->UpdateTempBonus(pParty->uTimePlayed); if ( v730c->uItemID < 64 || v730c->uItemID > 65 && !v730c->IsBroken() - && !v730c->uSpecEnchantmentType + && !v730c->special_enchantment && !v730c->uEnchantmentType && ( _item->uEquipType == EQUIP_SINGLE_HANDED || _item->uEquipType == EQUIP_TWO_HANDED || _item->uEquipType == EQUIP_BOW) && !pItemsTable->IsMaterialNonCommon(v730c) ) { - v730c->uSpecEnchantmentType = amount; + v730c->special_enchantment = (ITEM_ENCHANTMENT)amount; if ( skill_level != 4 ) { v730c->uExpireTime = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335); @@ -1542,7 +1541,7 @@ ItemDesc *_v725 = &pItemsTable->pItems[v245->uItemID]; if ((skill_level == 1 || skill_level == 2 /*&& _v725->uEquipType > EQUIP_BOW*/ || skill_level == 3 || skill_level == 4) && v245->uItemID <= 134 && - v245->uSpecEnchantmentType == 0 && v245->uEnchantmentType == 0 && + v245->special_enchantment == 0 && v245->uEnchantmentType == 0 && v245->m_enchantmentStrength== 0 && !v245->IsBroken() ) //требования к предмету { if ( (v245->GetValue() < 450 && ( skill_level == 1 || skill_level == 2 )) @@ -1618,7 +1617,7 @@ } v262 = rand() % v725; v263 = v679; - v245->uSpecEnchantmentType = v679[0]; + v245->special_enchantment = (ITEM_ENCHANTMENT)v679[0]; v264 = pItemsTable->pSpecialEnchantments[*v263].to_item_apply[v245->GetItemEquipType() + 4]; v265 = v262 + 1; if ( v264 < v265 ) @@ -1658,15 +1657,15 @@ } v282 = rand() % _v733; v283 = v679; - v245->uSpecEnchantmentType = v679[0]; + v245->special_enchantment = (ITEM_ENCHANTMENT)v679[0]; v284 = pItemsTable->pSpecialEnchantments[*v283].to_item_apply[v245->GetItemEquipType() ]; v285 = v282 + 1; for ( l = v679; v284 < v285; ++l ) { - v245->uSpecEnchantmentType = *(l+1); + v245->special_enchantment = (ITEM_ENCHANTMENT)*(l + 1); v284 += pItemsTable->pSpecialEnchantments[*(l+1)].to_item_apply[v245->GetItemEquipType()]; } - ++v245->uSpecEnchantmentType; + v245->special_enchantment = (ITEM_ENCHANTMENT)(v245->special_enchantment + 1); v245->uAttributes |= 0x20u; _50C9A8_item_enchantment_timer = 256; spell_sound_flag = true; @@ -2150,7 +2149,7 @@ pActors[mon_id].SetRandomGoldIfTheresNoItem(); int gold_num = 0; if ( pItemsTable->pItems[pActors[mon_id].ActorHasItems[3].uItemID].uEquipType == EQUIP_GOLD ) - gold_num = pActors[mon_id].ActorHasItems[3].uSpecEnchantmentType; + gold_num = pActors[mon_id].ActorHasItems[3].special_enchantment; ItemGen item; item.Reset(); if (pActors[mon_id].uCarriedItemID) @@ -2375,7 +2374,7 @@ { if (pItemsTable->pItems[pSpriteObjects[obj_id].containing_item.uItemID].uEquipType == EQUIP_GOLD) { - pParty->PartyFindsGold(pSpriteObjects[obj_id].containing_item.uSpecEnchantmentType, 0); + pParty->PartyFindsGold(pSpriteObjects[obj_id].containing_item.special_enchantment, 0); viewparams->bRedrawGameUI = true; } else @@ -2920,7 +2919,7 @@ item->UpdateTempBonus(pParty->uTimePlayed); if ( item->uItemID >= 64 && item->uItemID <= 65//blasters || LOBYTE(item->uAttributes) & 2 - || item->uSpecEnchantmentType != 0 + || item->special_enchantment != 0 || item->uEnchantmentType != 0 || pItemsTable->pItems[item->uItemID].uEquipType != EQUIP_SINGLE_HANDED && pItemsTable->pItems[item->uItemID].uEquipType != EQUIP_TWO_HANDED @@ -2935,7 +2934,7 @@ pCastSpell->uSpellID = 0; continue; } - item->uSpecEnchantmentType = 16; + item->special_enchantment = ITEM_ENCHANTMENT_VAMPIRIC; if ( skill_level != 4 ) { item->uExpireTime = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335);