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