EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
EffectsProcessor.h
Go to the documentation of this file.
1 
12 #ifndef _EVE_FX_PROC_H__
13 #define _EVE_FX_PROC_H__
14 
15 #include "effects/EffectsDataMgr.h"
17 
18 class Character;
19 class GenericModule;
20 class ShipItem;
21 
22 class FxProc
23 : public Singleton<FxProc>
24 {
25 public:
26  FxProc() { /* do nothing here */ }
27  ~FxProc() { /* do nothing here */ }
28 
29  // pItem is modifier container
30  void ApplyEffects(InventoryItem* pItem, Character* pChar, ShipItem* pShip, bool update=false);
31  // pItem is modifier container
32  void ParseExpression(InventoryItem* pItem, Expression expression, fxData& data, GenericModule* pMod=nullptr);
33  int8 GetEnvironmentEnum(const std::string& domain);
34  int8 GetAssociationEnum(const std::string& association);
35 
36  const char* GetSourceName(int8 id);
37  const char* GetMathMethodName(int8 id);
38  const char* GetTargLocName(int8 id);
39  const char* GetStateName(int8 id);
40 
41  EvilNumber CalculateAttributeValue(EvilNumber val1, EvilNumber val2, /*FX::Math*/int8 method);
42 
43  void DecodeEffects(const uint16 fxID);
44 protected:
45  void EvaluateExpression(const uint16 expID, const char* type);
46  void DecodeExpression(Expression expression, fxData& data);
47 
48 private:
49 
50 };
51 
52 #define sFxProc \
53 ( FxProc::get() )
54 
55 #endif // _EVE_FX_PROC_H__
56 
64 /*
65  if operand.operandID in (
66  const.operandALRSM,
67  const.operandRLRSM,
68  const.operandALGM,
69  const.operandRLGM,
70  const.operandAORSM,
71  const.operandRORSM):
72  return 'dogmaLM.%s(%s, %s, %s, %s, itemID, %s)' % (funcName,
73  arg1[0],
74  arg1[1][0][0],
75  arg1[1][0][1],
76  arg1[1][1],
77  arg2)
78  if operand.operandID in (const.operandAGRSM, const.operandRGRSM):
79  return 'dogmaLM.%s(shipID, %s, %s, %s, itemID, %s)' % (funcName,
80  arg1[0],
81  arg1[1][0],
82  arg1[1][1],
83  arg2)
84  if operand.operandID in (const.operandAGIM, const.operandRGIM):
85  return 'dogmaLM.%s(shipID, %s, %s, itemID, %s)' % (funcName,
86  arg1[0],
87  arg1[1],
88  arg2)
89  if operand.operandID in (const.operandALM, const.operandRLM):
90  return 'dogmaLM.%s(%s, %s, %s, itemID, %s)' % (funcName,
91  arg1[0],
92  arg1[1][0],
93  arg1[1][1],
94  arg2)
95 
96 */
97 
98 /*
99  def AddOwnerRequiredSkillModifier(self, env, arg1, arg2):
100  affectingModuleID = env.itemID
101  affectingAttributeID = arg2
102  affectedOwnerID = arg1[1][0][0]
103  affectedSkillID = arg1[1][0][1]
104  affectedAttributeID = arg1[1][1]
105  affectType = arg1[0]
106 
107  def AddLocationRequiredSkillModifier(self, env, arg1, arg2):
108  affectingModuleID = env.itemID
109  affectingAttributeID = arg2
110  affectedLocationID = arg1[1][0][0]
111  affectedSkillID = arg1[1][0][1]
112  affectedAttributeID = arg1[1][1]
113  affectType = arg1[0]
114 
115  def AddGangRequiredSkillModifier(self, env, arg1, arg2):
116  affectingModuleID = env.itemID
117  affectingAttributeID = arg2
118  affectingCharID = env.charID
119  affectingShipID = env.shipID
120  affectedSkillID = arg1[1][0]
121  affectedAttributeID = arg1[1][1]
122  affectType = arg1[0]
123 
124  def AddGangGroupModifier(self, env, arg1, arg2):
125  affectingModuleID = env.itemID
126  affectingAttributeID = arg2
127  affectingCharID = env.charID
128  affectingShipID = env.shipID
129  affectedGroupID = arg1[1][0]
130  affectedAttributeID = arg1[1][1]
131  affectType = arg1[0]
132 
133  def AddGangShipModifier(self, env, arg1, arg2):
134  affectingModuleID = env.itemID
135  affectingAttributeID = arg2
136  affectingCharID = env.charID
137  affectingShipID = env.shipID
138  affectedAttributeID = arg1[1]
139  affectType = arg1[0]
140 
141  def AddItemModifier(self, env, arg1, arg2):
142  affectingModuleID = env.itemID
143  if not arg2:
144  raise RuntimeError('Expression is wrong. AIM(%s, %s) - NULL/None value is not allowed' % (arg1, arg2))
145  affectingAttributeID = arg2
146  affectedModuleID = arg1[1][0]
147  affectedAttributeID = arg1[1][1]
148  affectType = arg1[0]
149  if affectedModuleID == 0:
150  return 1
151  if affectedModuleID is None:
152  self.LogWarn('AffectedModuleID is None. Env:', env)
153  return
154 
155  def AddLocationModifier(self, env, arg1, arg2):
156  affectingModuleID = env.itemID
157  affectingAttributeID = arg2
158  affectedLocationID = arg1[1][0]
159  affectedAttributeID = arg1[1][1]
160  affectType = arg1[0]
161 
162  def AddLocationGroupModifier(self, env, arg1, arg2):
163  affectingModuleID = env.itemID
164  affectingAttributeID = arg2
165  affectedLocationID = arg1[1][0][0]
166  affectedGroupID = arg1[1][0][1]
167  affectedAttributeID = arg1[1][1]
168  affectType = arg1[0]
169 
170 */
void DecodeExpression(Expression expression, fxData &data)
int8 GetAssociationEnum(const std::string &association)
const char * GetTargLocName(int8 id)
void ApplyEffects(InventoryItem *pItem, Character *pChar, ShipItem *pShip, bool update=false)
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
signed __int8 int8
Definition: eve-compat.h:45
const char * GetStateName(int8 id)
const char * GetMathMethodName(int8 id)
const char * GetSourceName(int8 id)
EvilNumber CalculateAttributeValue(EvilNumber val1, EvilNumber val2, int8 method)
int8 GetEnvironmentEnum(const std::string &domain)
Definition: Ship.h:46
void ParseExpression(InventoryItem *pItem, Expression expression, fxData &data, GenericModule *pMod=nullptr)
void DecodeEffects(const uint16 fxID)
Template used for singleton classes.
Definition: Singleton.h:43
unsigned __int16 uint16
Definition: eve-compat.h:48
void EvaluateExpression(const uint16 expID, const char *type)