EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ActiveModule.h
Go to the documentation of this file.
1 
10 #ifndef _EVE_SHIP_MODULES_ACTIVE_MODULE_H_
11 #define _EVE_SHIP_MODULES_ACTIVE_MODULE_H_
12 
13 #include "Client.h"
15 #include "system/SystemBubble.h"
16 #include "system/SystemManager.h"
17 
18 class MiningLaser;
19 
21 {
22 public:
24  virtual ~ActiveModule() { /* Do nothing here */ }
25 
26  /* class type pointer querys, public for anyone to access. */
27  virtual ActiveModule* GetActiveModule() { return this; }
28  /* class type helpers. public for anyone to access. */
29  virtual bool IsActiveModule() const { return true; }
30 
31  /* GenericModule overrides */
32  virtual void Process();
33  // this will not move charge item.
34  // must NOT throw
35  virtual void LoadCharge(InventoryItemRef charge);
36  // this will not move charge item.
37  // must NOT throw
38  virtual void UnloadCharge();
39  virtual void Overload();
40  virtual void AbortCycle();
41  virtual void DeOverload();
42  virtual void Deactivate(std::string effect="");
43  /* cancel current cycle after timer ends. */
44  virtual void DeactivateCycle(bool abort=false); // this needs state=Deactivating for normal op. set abort=true to cancel current cycle
45  virtual void Activate(uint16 effectID, uint32 targetID=0, int16 repeat=0);
46  virtual void RemoveTarget(SystemEntity* pSE);
47 
48  /* generic DoCycle() for active modules that only affect ship on Activate/Deactivate (not recurring on each cycle)
49  * for modules that perform action on each DoCycle(), they will override this call in their class implementation
50  */
51  virtual uint32 DoCycle();
52 
53  /* functions to be handled in derived classes as needed */
54  virtual void Update(); // this is used to set char mods on active modules created before pilot entered ship
55  virtual void ApplyDamage() { /* do nothing here */ }
56  virtual uint16 GetReloadTime() { return m_reloadTime; }
57  // this is a check for those active modules that need it (mining, weapons) and overridden as needed
58  virtual bool CanActivate();
59  /* apply charge effects when undocking, as they are reset and not called anywhere else */
60  virtual void ReprocessCharge();
61 
62  /* ActiveModule methods */
63  virtual uint32 GetTargetID() { return m_targetID; }
65 
66  void LaunchProbe();
67  void LaunchMissile();
68  void LaunchSnowBall();
69 
70  /* new effects processing code and updates */
71  void ApplyEffect(int8 state, bool active=false);
72  /* common method for all modules that have a visual effect when active */
73  void ShowEffect(bool active=false, bool abort=false);
74 
75 protected:
76  // we do not own any of these next 5
82 
83  void Clear();
84  void ProcessActiveCycle(); // checks and sets cap use
85  void UpdateCharge(uint16 attrID, uint16 testAttrID, uint16 srcAttrID, InventoryItemRef iRef);
86  void UpdateDamage(uint16 attrID, uint16 srcAttrID, InventoryItemRef iRef);
87 
88  /* for linked weapons */
89  void SetSlaveData(ShipSE* pShip);
90 
91  /* for modules that use charges */
92  void ConsumeCharge(); // common code to reduce ammo by one unit.
93 
95 
96  void SetTimer(uint32 time);
97  void StopTimer() { m_timer.Disable(); }
98 
100  uint16 m_effectID; //passed to us by activate
101  uint32 m_targetID; //passed to us by activate
102 
103  // protected to allow derived usage
104  bool m_Stop :1;
105  bool m_usesCharge :1;
106  bool m_needsCharge :1;
107  bool m_needsTarget :1;
108 
109 private:
112 
113 };
114 
115 
116 #endif // _EVE_SHIP_MODULES_ACTIVE_MODULE_H_
117 
118 /* {'messageKey': 'DeniedActivateCloaked', 'dataID': 17883388, 'suppressable': False, 'bodyID': 259487, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 771}
119  * {'messageKey': 'DeniedActivateControlling', 'dataID': 17880010, 'suppressable': False, 'bodyID': 258228, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 2230}
120  * {'messageKey': 'DeniedActivateFrozen', 'dataID': 17883391, 'suppressable': False, 'bodyID': 259488, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 772}
121  * {'messageKey': 'DeniedActivateInJump', 'dataID': 17883394, 'suppressable': False, 'bodyID': 259489, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 773}
122  * {'messageKey': 'DeniedActivateInWarp', 'dataID': 17883704, 'suppressable': False, 'bodyID': 259597, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 774}
123  * {'messageKey': 'DeniedActivateTargetAssistDisallowed', 'dataID': 17883397, 'suppressable': False, 'bodyID': 259490, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 775}
124  * {'messageKey': 'DeniedActivateTargetModuleDisallowed', 'dataID': 17883400, 'suppressable': False, 'bodyID': 259491, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 776}
125  * {'messageKey': 'DeniedActivateTargetNotPresent', 'dataID': 17883403, 'suppressable': False, 'bodyID': 259492, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 777}
126  * {'messageKey': 'DeniedActivateTargetOffModDisallowed', 'dataID': 17883406, 'suppressable': False, 'bodyID': 259493, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 778}
127  * {'FullPath': u'UI/Messages', 'messageID': 259487, 'label': u'DeniedActivateCloakedBody'}(u'Interference from the cloaking you are doing is preventing your systems from functioning at this time.', None, None)
128  * {'FullPath': u'UI/Messages', 'messageID': 259488, 'label': u'DeniedActivateFrozenBody'}(u'You are unable to activate any modules because you have been frozen by a GM.', None, None)
129  * {'FullPath': u'UI/Messages', 'messageID': 259489, 'label': u'DeniedActivateInJumpBody'}(u'Interference from the jump you are doing is preventing your systems from functioning at this time.', None, None)
130  * {'FullPath': u'UI/Messages', 'messageID': 259490, 'label': u'DeniedActivateTargetAssistDisallowedBody'}(u'You cannot activate that module on the target as interference prevents assistance from being given to them.', None, None)
131  * {'FullPath': u'UI/Messages', 'messageID': 259491, 'label': u'DeniedActivateTargetModuleDisallowedBody'}(u'You cannot activate that module on the target as interference prevents modules of that type from being used on them.', None, None)
132  * {'FullPath': u'UI/Messages', 'messageID': 259492, 'label': u'DeniedActivateTargetNotPresentBody'}(u'You cannot activate that module as the target is no longer present.', None, None)
133  * {'FullPath': u'UI/Messages', 'messageID': 259493, 'label': u'DeniedActivateTargetOffModDisallowedBody'}(u'You cannot activate that module on the target as interference prevents modules of that type from being used on them.', None, None)
134  * {'FullPath': u'UI/Messages', 'messageID': 259597, 'label': u'DeniedActivateInWarpBody'}(u'Interference from your warp prevents your systems from functioning at this time.', None, None)
135  * {'FullPath': u'UI/Messages', 'messageID': 258228, 'label': u'DeniedActivateControllingBody'}(u'You are unable to activate any modules while you are controlling some other objects.', None, None)
136  */
virtual bool IsActiveModule() const
Definition: ActiveModule.h:29
void Disable()
Definition: timer.h:39
void ConsumeCharge()
uint16 m_effectID
Definition: ActiveModule.h:100
bool m_needsCharge
Definition: ActiveModule.h:106
ActiveModule(ModuleItemRef mRef, ShipItemRef sRef)
virtual void RemoveTarget(SystemEntity *pSE)
SystemManager * m_sysMgr
Definition: ActiveModule.h:80
uint32 GetRemainingCycleTimeMS()
Definition: ActiveModule.h:94
Timer m_reloadTimer
Definition: ActiveModule.h:111
Definition: Ship.h:301
uint32 GetRemainingTime() const
Definition: timer.cpp:114
signed __int8 int8
Definition: eve-compat.h:45
void UpdateDamage(uint16 attrID, uint16 srcAttrID, InventoryItemRef iRef)
virtual uint32 GetTargetID()
Definition: ActiveModule.h:63
TargetManager * m_targMgr
Definition: ActiveModule.h:81
void LaunchMissile()
SystemEntity * m_targetSE
Definition: ActiveModule.h:78
uint16 m_reloadTime
Definition: ActiveModule.h:99
DestinyManager * m_destinyMgr
Definition: ActiveModule.h:79
virtual void UnloadCharge()
void ShowEffect(bool active=false, bool abort=false)
virtual void Process()
virtual void ApplyDamage()
Definition: ActiveModule.h:55
void LaunchSnowBall()
virtual void AbortCycle()
virtual void Overload()
void SetTimer(uint32 time)
virtual bool CanActivate()
unsigned __int32 uint32
Definition: eve-compat.h:50
void ApplyEffect(int8 state, bool active=false)
virtual void Update()
void UpdateCharge(uint16 attrID, uint16 testAttrID, uint16 srcAttrID, InventoryItemRef iRef)
void ProcessActiveCycle()
SystemEntity * GetTargetSE()
Definition: ActiveModule.h:64
uint32 m_targetID
Definition: ActiveModule.h:101
signed __int16 int16
Definition: eve-compat.h:47
void SetSlaveData(ShipSE *pShip)
virtual void LoadCharge(InventoryItemRef charge)
virtual ~ActiveModule()
Definition: ActiveModule.h:24
virtual ActiveModule * GetActiveModule()
Definition: ActiveModule.h:27
virtual void DeOverload()
bool m_needsTarget
Definition: ActiveModule.h:107
SystemBubble * m_bubble
Definition: ActiveModule.h:77
virtual uint32 DoCycle()
Definition: timer.h:30
virtual void Deactivate(std::string effect="")
unsigned __int16 uint16
Definition: eve-compat.h:48
entityID heal the character with the entityID note giving you detailed ship status information gives a list of all dynamic entities and players and their destinyState in this bubble shows some current destiny variables save all kick all and halt server immediate command list all items in current location s gives list of cargo contents and volumes in all holds list current session values show current ship DNA show current objects in their destiny state
virtual void DeactivateCycle(bool abort=false)
virtual void ReprocessCharge()
void StopTimer()
Definition: ActiveModule.h:97
virtual void Activate(uint16 effectID, uint32 targetID=0, int16 repeat=0)
virtual uint16 GetReloadTime()
Definition: ActiveModule.h:56