annotate Engine/Conditions.h @ 2553:48708da03b7f

Party Creation UI logic separated from MainMenu
author a.parshin
date Wed, 13 May 2015 02:20:05 +0200
parents 68cdef6879a0
children
rev   line source
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1 #pragma once
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2 #include "Engine/Objects/Items.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3 #include <array>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
4 enum Condition: unsigned __int32
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
5 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
6 Condition_Cursed = 0,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
7 Condition_Weak = 1,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
8 Condition_Sleep = 2,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
9 Condition_Fear = 3,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
10 Condition_Drunk = 4,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
11 Condition_Insane = 5,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
12 Condition_Poison_Weak = 6,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
13 Condition_Disease_Weak = 7,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
14 Condition_Poison_Medium = 8,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
15 Condition_Disease_Medium = 9,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
16 Condition_Poison_Severe = 10,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
17 Condition_Disease_Severe = 11,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
18 Condition_Paralyzed = 12,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
19 Condition_Unconcious = 13,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
20 Condition_Dead = 14,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
21 Condition_Pertified = 15,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
22 Condition_Eradicated = 16,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
23 Condition_Zombie = 17,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
24 Condition_Good = 18
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
25 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
26
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
27
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
28 class EquipemntPair
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
29 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
30 public:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
31 ITEM_TYPE m_ItemId;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
32 ITEM_EQUIP_TYPE m_EquipSlot;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
33 EquipemntPair(ITEM_TYPE type, ITEM_EQUIP_TYPE slot)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
34 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
35 m_ItemId = type;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
36 m_EquipSlot = slot;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
37 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
38 EquipemntPair()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
39 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
40 m_ItemId = (ITEM_TYPE)0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
41 m_EquipSlot = (ITEM_EQUIP_TYPE)0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
42 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
43 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
44
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
45 struct Player;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
46
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
47 class ConditionProcessor
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
48 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
49 public:
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
50 bool m_IsBlockedByProtFromMagic;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
51 bool m_DoesNeedGmProtFromMagic;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
52 int m_WorkingEnchantment;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
53 std::array<EquipemntPair, 3> m_equipmentPairs;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
54 ConditionProcessor(int, bool isblocked, bool needsGm, int enchantment,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
55 ITEM_TYPE itemtype1 = (ITEM_TYPE)0, ITEM_EQUIP_TYPE itemslot1 = (ITEM_EQUIP_TYPE)0,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
56 ITEM_TYPE itemtype2 = (ITEM_TYPE)0, ITEM_EQUIP_TYPE itemslot2 = (ITEM_EQUIP_TYPE)0,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
57 ITEM_TYPE itemtype3 = (ITEM_TYPE)0, ITEM_EQUIP_TYPE itemslot3 = (ITEM_EQUIP_TYPE)0)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
58 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
59 m_IsBlockedByProtFromMagic = isblocked;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
60 m_DoesNeedGmProtFromMagic = needsGm;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
61 m_WorkingEnchantment = enchantment;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
62 m_equipmentPairs[0].m_ItemId = itemtype1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
63 m_equipmentPairs[0].m_EquipSlot = itemslot1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
64 m_equipmentPairs[1].m_ItemId = itemtype2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
65 m_equipmentPairs[1].m_EquipSlot = itemslot2;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
66 m_equipmentPairs[2].m_ItemId = itemtype3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
67 m_equipmentPairs[2].m_EquipSlot = itemslot3;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
68 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
69
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
70 static bool IsPlayerAffected(Player*, int, int);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
71 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
72
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
73 extern std::array<ConditionProcessor, 18> conditionArray;