World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Класс ConditionProcessor

#include <Conditions.h>

Открытые члены

 ConditionProcessor (int, bool isblocked, bool needsGm, int enchantment, ITEM_TYPE itemtype1=(ITEM_TYPE) 0, ITEM_EQUIP_TYPE itemslot1=(ITEM_EQUIP_TYPE) 0, ITEM_TYPE itemtype2=(ITEM_TYPE) 0, ITEM_EQUIP_TYPE itemslot2=(ITEM_EQUIP_TYPE) 0, ITEM_TYPE itemtype3=(ITEM_TYPE) 0, ITEM_EQUIP_TYPE itemslot3=(ITEM_EQUIP_TYPE) 0)
 

Открытые статические члены

static bool IsPlayerAffected (Player *, int, int)
 

Открытые атрибуты

bool m_IsBlockedByProtFromMagic
 
bool m_DoesNeedGmProtFromMagic
 
int m_WorkingEnchantment
 
std::array< EquipemntPair, 3 > m_equipmentPairs
 

Подробное описание

См. определение в файле Conditions.h строка 45

Конструктор(ы)

◆ ConditionProcessor()

ConditionProcessor::ConditionProcessor ( int  ,
bool  isblocked,
bool  needsGm,
int  enchantment,
ITEM_TYPE  itemtype1 = (ITEM_TYPE)0,
ITEM_EQUIP_TYPE  itemslot1 = (ITEM_EQUIP_TYPE)0,
ITEM_TYPE  itemtype2 = (ITEM_TYPE)0,
ITEM_EQUIP_TYPE  itemslot2 = (ITEM_EQUIP_TYPE)0,
ITEM_TYPE  itemtype3 = (ITEM_TYPE)0,
ITEM_EQUIP_TYPE  itemslot3 = (ITEM_EQUIP_TYPE)0 
)
inline

См. определение в файле Conditions.h строка 51

57  {
58  m_IsBlockedByProtFromMagic = isblocked;
59  m_DoesNeedGmProtFromMagic = needsGm;
60  m_WorkingEnchantment = enchantment;
61  m_equipmentPairs[0].m_ItemId = itemtype1;
62  m_equipmentPairs[0].m_EquipSlot = itemslot1;
63  m_equipmentPairs[1].m_ItemId = itemtype2;
64  m_equipmentPairs[1].m_EquipSlot = itemslot2;
65  m_equipmentPairs[2].m_ItemId = itemtype3;
66  m_equipmentPairs[2].m_EquipSlot = itemslot3;
67  }

Перекрестные ссылки m_DoesNeedGmProtFromMagic, m_equipmentPairs, m_IsBlockedByProtFromMagic и m_WorkingEnchantment.

Методы

◆ IsPlayerAffected()

bool ConditionProcessor::IsPlayerAffected ( Player inPlayer,
int  condToCheck,
int  blockable 
)
static

См. определение в файле Conditions.cpp строка 50

51  {
52  if (!blockable) return true;
53  ConditionProcessor* thisProc = &conditionArray[condToCheck];
54  if (thisProc->m_IsBlockedByProtFromMagic &&
56  if (!(thisProc->m_DoesNeedGmProtFromMagic &&
58  4)) {
61  1)
63  return false;
64  }
65  }
66  if (thisProc->m_WorkingEnchantment != 0) {
67  if (inPlayer->HasEnchantedItemEquipped(thisProc->m_WorkingEnchantment))
68  return false;
69  }
70  for (unsigned int i = 0; i < thisProc->m_equipmentPairs.size() / 2; i++) {
71  if (thisProc->m_equipmentPairs[i * 2].m_ItemId == (ITEM_TYPE)0)
72  return true;
73  ITEM_TYPE itemId = thisProc->m_equipmentPairs[i * 2].m_ItemId;
74  ITEM_EQUIP_TYPE slot =
75  thisProc->m_equipmentPairs[i * 2 + 1].m_EquipSlot;
76  if (slot == EQIUP_ANY) {
77  if (inPlayer->WearsItemAnyWhere(itemId)) return false;
78  } else {
79  if (inPlayer->WearsItem(itemId, slot)) return false;
80  }
81  }
82  return true;
83 }

Перекрестные ссылки conditionArray, EQIUP_ANY, Player::HasEnchantedItemEquipped(), m_DoesNeedGmProtFromMagic, m_equipmentPairs, m_IsBlockedByProtFromMagic, m_WorkingEnchantment, PARTY_BUFF_PROTECTION_FROM_MAGIC, pParty, Party::pPartyBuffs, Player::WearsItem() и Player::WearsItemAnyWhere().

Используется в Player::SetCondition().

+ Граф вызовов:
+ Граф вызова функции:

Данные класса

◆ m_IsBlockedByProtFromMagic

bool ConditionProcessor::m_IsBlockedByProtFromMagic

См. определение в файле Conditions.h строка 47

Используется в ConditionProcessor() и IsPlayerAffected().

◆ m_DoesNeedGmProtFromMagic

bool ConditionProcessor::m_DoesNeedGmProtFromMagic

См. определение в файле Conditions.h строка 48

Используется в ConditionProcessor() и IsPlayerAffected().

◆ m_WorkingEnchantment

int ConditionProcessor::m_WorkingEnchantment

См. определение в файле Conditions.h строка 49

Используется в ConditionProcessor() и IsPlayerAffected().

◆ m_equipmentPairs

std::array<EquipemntPair, 3> ConditionProcessor::m_equipmentPairs

См. определение в файле Conditions.h строка 50

Используется в ConditionProcessor() и IsPlayerAffected().


Объявления и описания членов классов находятся в файлах:
ConditionProcessor::m_IsBlockedByProtFromMagic
bool m_IsBlockedByProtFromMagic
Definition: Conditions.h:47
ConditionProcessor::m_equipmentPairs
std::array< EquipemntPair, 3 > m_equipmentPairs
Definition: Conditions.h:50
ITEM_TYPE
ITEM_TYPE
Definition: Items.h:73
PARTY_BUFF_PROTECTION_FROM_MAGIC
@ PARTY_BUFF_PROTECTION_FROM_MAGIC
Definition: Party.h:84
EQIUP_ANY
@ EQIUP_ANY
Definition: Items.h:244
conditionArray
std::array< ConditionProcessor, 18 > conditionArray
Definition: Conditions.cpp:7
ITEM_EQUIP_TYPE
ITEM_EQUIP_TYPE
Definition: Items.h:226
ConditionProcessor::m_DoesNeedGmProtFromMagic
bool m_DoesNeedGmProtFromMagic
Definition: Conditions.h:48
Party::pPartyBuffs
std::array< SpellBuff, 20 > pPartyBuffs
Definition: Party.h:309
Player::WearsItemAnyWhere
bool WearsItemAnyWhere(int item_id)
Definition: Player.cpp:1609
pParty
Party * pParty
Definition: Party.cpp:30
Player::WearsItem
bool WearsItem(int item_id, ITEM_EQUIP_TYPE equip_type)
Definition: Player.cpp:1603
ConditionProcessor::m_WorkingEnchantment
int m_WorkingEnchantment
Definition: Conditions.h:49
ConditionProcessor
Definition: Conditions.h:45
Player::HasEnchantedItemEquipped
bool HasEnchantedItemEquipped(int uEnchantment)
Definition: Player.cpp:1592