Mercurial > mm7
comparison Conditions.h @ 1361:b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
author | Grumpy7 |
---|---|
date | Sun, 14 Jul 2013 23:22:43 +0200 |
parents | |
children | 9856c2f8f918 |
comparison
equal
deleted
inserted
replaced
1360:a47d9282ea7c | 1361:b3ac17fd12de |
---|---|
1 #pragma once | |
2 #include "Items.h" | |
3 #include <array> | |
4 enum Condition: unsigned __int32 | |
5 { | |
6 Condition_Cursed = 0, | |
7 Condition_Weak = 1, | |
8 Condition_Sleep = 2, | |
9 Condition_Fear = 3, | |
10 Condition_Drunk = 4, | |
11 Condition_Insane = 5, | |
12 Condition_Poison1 = 6, | |
13 Condition_Disease1 = 7, | |
14 Condition_Poison2 = 8, | |
15 Condition_Disease2 = 9, | |
16 Condition_Poison3 = 10, | |
17 Condition_Disease3 = 11, | |
18 Condition_Paralyzed = 12, | |
19 Condition_Unconcious = 13, | |
20 Condition_Dead = 14, | |
21 Condition_Pertified = 15, | |
22 Condition_Eradicated = 16, | |
23 Condition_Zombie = 17, | |
24 Condition_Good = 18 | |
25 }; | |
26 | |
27 | |
28 class EquipemntPair | |
29 { | |
30 public: | |
31 ITEM_TYPE m_ItemId; | |
32 ITEM_EQUIP_TYPE m_EquipSlot; | |
33 EquipemntPair(ITEM_TYPE type, ITEM_EQUIP_TYPE slot) | |
34 { | |
35 m_ItemId = type; | |
36 m_EquipSlot = slot; | |
37 } | |
38 EquipemntPair() | |
39 { | |
40 m_ItemId = (ITEM_TYPE)0; | |
41 m_EquipSlot = (ITEM_EQUIP_TYPE)0; | |
42 } | |
43 }; | |
44 | |
45 struct Player; | |
46 | |
47 class ConditionProcessor | |
48 { | |
49 public: | |
50 bool m_IsBlockedByProtFromMagic; | |
51 bool m_DoesNeedGmProtFromMagic; | |
52 int m_WorkingEnchantment; | |
53 std::array<EquipemntPair, 3> m_equipmentPairs; | |
54 ConditionProcessor(int, bool isblocked, bool needsGm, int enchantment, | |
55 ITEM_TYPE itemtype1 = (ITEM_TYPE)0, ITEM_EQUIP_TYPE itemslot1 = (ITEM_EQUIP_TYPE)0, | |
56 ITEM_TYPE itemtype2 = (ITEM_TYPE)0, ITEM_EQUIP_TYPE itemslot2 = (ITEM_EQUIP_TYPE)0, | |
57 ITEM_TYPE itemtype3 = (ITEM_TYPE)0, ITEM_EQUIP_TYPE itemslot3 = (ITEM_EQUIP_TYPE)0) | |
58 { | |
59 m_IsBlockedByProtFromMagic = isblocked; | |
60 m_DoesNeedGmProtFromMagic = needsGm; | |
61 m_WorkingEnchantment = enchantment; | |
62 m_equipmentPairs[0].m_ItemId = itemtype1; | |
63 m_equipmentPairs[0].m_EquipSlot = itemslot1; | |
64 m_equipmentPairs[1].m_ItemId = itemtype2; | |
65 m_equipmentPairs[1].m_EquipSlot = itemslot2; | |
66 m_equipmentPairs[2].m_ItemId = itemtype3; | |
67 m_equipmentPairs[2].m_EquipSlot = itemslot3; | |
68 } | |
69 | |
70 static bool IsPlayerAffected(Player*, int, int); | |
71 }; | |
72 | |
73 extern std::array<ConditionProcessor, 18> conditionArray; |