annotate Conditions.h @ 1779:50e91a820f6f

Player::SetVariable helper function for award sound
author Grumpy7
date Wed, 02 Oct 2013 08:51:43 +0200
parents b3ac17fd12de
children 9856c2f8f918
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,
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
diff changeset
12 Condition_Poison1 = 6,
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
diff changeset
13 Condition_Disease1 = 7,
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
diff changeset
14 Condition_Poison2 = 8,
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
diff changeset
15 Condition_Disease2 = 9,
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
diff changeset
16 Condition_Poison3 = 10,
b3ac17fd12de Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
diff changeset
17 Condition_Disease3 = 11,
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;