EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SuperWeapon Class Reference

#include "SuperWeapon.h"

Collaboration diagram for SuperWeapon:

Public Member Functions

 SuperWeapon (InventoryItemRef item, ShipItemRef ship)
 
virtual ~SuperWeapon ()
 
virtual void Activate (SystemEntity *pSE)
 
virtual double DoCycle ()
 
virtual void StopCycle (bool abort=false)
 

Protected Member Functions

void _ProcessCycle ()
 
void _ShowCycle ()
 
void _SetCapNeed ()
 

Protected Attributes

Timer m_buildUpTimer
 
Timer m_effectDurationTimer
 

Detailed Description

Definition at line 30 of file SuperWeapon.h.

Constructor & Destructor Documentation

SuperWeapon::SuperWeapon ( InventoryItemRef  item,
ShipItemRef  ship 
)
Todo:
this entire file needs rework to update with current code

Definition at line 36 of file SuperWeapon.cpp.

37 :
39 {
40 }
Timer m_buildUpTimer
Definition: SuperWeapon.h:47
Timer m_effectDurationTimer
Definition: SuperWeapon.h:48
virtual SuperWeapon::~SuperWeapon ( )
inlinevirtual

Definition at line 34 of file SuperWeapon.h.

34 { }

Member Function Documentation

void SuperWeapon::_ProcessCycle ( )
inlineprotected

Definition at line 42 of file SuperWeapon.h.

42 {}
void SuperWeapon::_SetCapNeed ( )
protected

Definition at line 250 of file SuperWeapon.cpp.

251 {
252  // this will be needed for modules and rigs that affect cap need for mining modules
253  //double need = GetAttribute(AttrCapacitorNeed);
254 
255 }
void SuperWeapon::_ShowCycle ( )
protected

Definition at line 180 of file SuperWeapon.cpp.

References sDataMgr, and Win32TimeNow().

Referenced by DoCycle().

181 {
182  std::string effectString = "";
183  uint32 effectID = 0;
184  switch (m_modRef->typeID())
185  {
186  case 24550:
187  effectString = "effects.SuperWeaponAmarr";
188  effectID = effectSuperWeaponAmarr;
189  break;
190 
191  case 24552:
192  effectString = "effects.SuperWeaponCaldari";
193  effectID = effectSuperWeaponCaldari;
194  break;
195 
196  case 24554:
197  effectString = "effects.SuperWeaponGallente";
198  effectID = effectSuperWeaponGallente;
199  break;
200 
201  case 23674:
202  effectString = "effects.SuperWeaponMinmatar";
203  effectID = effectSuperWeaponMinmatar;
204  break;
205  }
206 
207  // Create Special Effect:
208  m_shipRef->GetPilot()->GetShipSE()->DestinyMgr()->SendSpecialEffect
209  (
210  m_shipRef,
211  m_modRef->itemID(),
212  m_modRef->typeID(),
213  0,
214  0,
215  effectString,
216  1,
217  1,
218  1,
219  m_cycleTime,
220  1
221  );
222 
223  // Create Destiny Updates:
224  GodmaEnvironment ge;
225  ge.selfID = m_modRef->itemID();
226  ge.charID = m_shipRef->ownerID();
227  ge.shipID = m_shipRef->itemID();;
228  ge.targetID = 0;
229  ge.subLoc = sDataMgr.NewNone();
230  ge.area = new PyList;
231  ge.effectID = effectID;
232  Notify_OnGodmaShipEffect shipEff;
233  shipEff.itemID = ge.selfID;
234  shipEff.effectID = ge.effectID;
235  shipEff.timeNow = Win32TimeNow();
236  shipEff.start = 1;
237  shipEff.active = 1;
238  shipEff.environment = ge.Encode();
239  shipEff.startTime = shipEff.timeNow;
240  shipEff.duration = m_cycleTime;
241  shipEff.repeat = m_repeat;
242  shipEff.error = sDataMgr.NewNone();
243  std::vector<PyTuple*> events;
244  events.push_back(shipEff.Encode());
245  std::vector<PyTuple*> updates;
246  m_shipRef->GetPilot()->GetShipSE()->DestinyMgr()->SendDestinyUpdate(updates, events, false);
247  //m_shipRef->GetPilot()->QueueDestinyEvent(&tup);
248 }
int64 Win32TimeNow()
Definition: utils_time.cpp:70
unsigned __int32 uint32
Definition: eve-compat.h:50
Python list.
Definition: PyRep.h:639
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void SuperWeapon::Activate ( SystemEntity pSE)
virtual

Definition at line 42 of file SuperWeapon.cpp.

References ActiveModule::Activate(), and SystemEntity::GetID().

43 {
44  // TODO:
45  // 1. Prevent activation on certain targets: asteroids, NPC stations, ice, clouds... Perhaps restrict to ships and structures.
46  // 2. Check for minimum qty of consumable materials needed according to the 'consumptionType' attribute value in appropriate cargo bay on board the ship
47 
48  m_targetSE = pSE;
49  m_targetID = pSE->GetID();
50 
51  // Activate active processing component timer:
53  //_ShowCycle();
54  //m_ActiveModuleProc->ProcessActiveCycle();
55 }
uint32 GetID()
Definition: SystemEntity.h:207
virtual void Activate(uint16 effectID, uint32 targetID=0, int16 repeat=0)

Here is the call graph for this function:

double SuperWeapon::DoCycle ( )
virtual

Definition at line 134 of file SuperWeapon.cpp.

References _ShowCycle(), AttrEmDamage, AttrExplosiveDamage, AttrKineticDamage, and AttrThermalDamage.

135 {
136  if ((!m_shipRef->GetPilot()->GetShipSE()->SysBubble())
137  || (!m_shipRef->GetPilot()->GetShipSE()->SysBubble()->GetEntity(m_targetID))
138  /*|| (!m_chargeLoaded) || (!m_chargeRef)*/ )
139  {
140  Deactivate();
141  return 0;
142  }
143 
144  _ShowCycle();
145 
146  // Do massive, crazy damage to targets within a sphere of damage, screw CCP and their 'this can only target capital ships' junk ;)
147  // NOTE: due to the small bit of time to "build up" the weapon firing action, we need a timer to delay application of damage to the target(s)
148  // Avatar: 5 seconds to build after activation, 5 seconds duration, instant reach to target
149  // Erebus: 6 seconds to build after activation, 6 seconds duration, instant reach to target
150  // Leviathan: range to target 124km, 6 seconds to launch after activation, 9 seconds flight time
151  // Ragnarok: range to target 125km, 6 seconds to build after activation, 4 seconds duration, instant reach to target
152  //
153  // TODO:
154  // 0. Somehow disable warping and jump drive until deactivated
155  // 1. Set 'm_buildUpTimer' to the "build up time"
156  // 2. Set 'm_effectDurationTimer' to the "duration/flight time" of the super weapon effect
157  // 3. Move Damage action to SuperWeapon::Process() function and check for timer expirations before applying damage
158  // 4. Consider applying damage in increments, such as 5 stages of the 2 million hp (400,000 hp per stage, once per second)
159  // 5. Loop through all entities in the bubble, filtering on dynamic entities that are ships, drones, structures, cans
160  // and calculate distance from target to calculate area-of-effect damage using some 1/x formula, where damage sustained
161  // drops off the further away from the primary target.
162 
163  Damage d(m_shipRef->GetPilot()->GetShipSE(),
164  m_modRef,
165  m_chargeRef->GetAttribute(AttrKineticDamage).get_float(), // kinetic damage
166  m_chargeRef->GetAttribute(AttrThermalDamage).get_float(), // thermal damage
167  m_chargeRef->GetAttribute(AttrEmDamage).get_float(), // em damage
168  m_chargeRef->GetAttribute(AttrExplosiveDamage).get_float(), // explosive damage
169  1,
170  effectProjectileFired // from EVEEffectID::
171  );
172 
173  m_targetSE->ApplyDamage(d);
174 
175  // Reduce consumable in cargo:
176  // TODO
177  return m_cycleTime;
178 }
void _ShowCycle()
Definition: Damage.h:33

Here is the call graph for this function:

void SuperWeapon::StopCycle ( bool  abort = false)
virtual

Definition at line 57 of file SuperWeapon.cpp.

References PyStatic, EvE::Time::Second, and Win32TimeNow().

58 {
59  // TODO:
60  // 1. Enable warping and jump drive
61 
62  std::string effectString = "";
63  uint32 effectID = 0;
64  switch (m_modRef->typeID())
65  {
66  case 24550:
67  effectString = "effects.SuperWeaponAmarr";
68  effectID = effectSuperWeaponAmarr;
69  break;
70 
71  case 24552:
72  effectString = "effects.SuperWeaponCaldari";
73  effectID = effectSuperWeaponCaldari;
74  break;
75 
76  case 24554:
77  effectString = "effects.SuperWeaponGallente";
78  effectID = effectSuperWeaponGallente;
79  break;
80 
81  case 23674:
82  effectString = "effects.SuperWeaponMinmatar";
83  effectID = effectSuperWeaponMinmatar;
84  break;
85  }
86 
87  uint32 timeLeft = GetRemainingCycleTimeMS();
88  timeLeft /= 1000;
89 
90  // Create Special Effect:
91  m_shipRef->GetPilot()->GetShipSE()->DestinyMgr()->SendSpecialEffect
92  (
93  m_shipRef,
94  m_modRef->itemID(),
95  m_modRef->typeID(),
96  0,
97  0,
98  effectString,
99  1,
100  0,
101  0,
102  timeLeft,
103  0
104  );
105 
106  GodmaEnvironment ge;
107  ge.selfID = m_modRef->itemID();
108  ge.charID = m_shipRef->ownerID();
109  ge.shipID = m_shipRef->itemID();
110  ge.target = PyStatic.NewNone();
111  ge.subLoc = PyStatic.NewNone();
112  ge.area = new PyList;
113  ge.effectID = effectID;
114  Notify_OnGodmaShipEffect shipEff;
115  shipEff.itemID = ge.selfID;
116  shipEff.effectID = ge.effectID;
117  shipEff.timeNow = Win32TimeNow();
118  shipEff.start = 0;
119  shipEff.active = 0;
120  shipEff.environment = ge.Encode();
121  shipEff.startTime = (shipEff.timeNow + (timeLeft * EvE::Time::Second));
122  shipEff.duration = timeLeft;
123  shipEff.repeat = 0;
124  shipEff.error = PyStatic.NewNone();
125 
126  PyTuple* tuple = shipEff.Encode();
127 
128  if (m_destinyMgr->IsWarping() or (m_bubble == nullptr))
129  m_shipRef->GetPilot()->QueueDestinyEvent(&tuple);
130  else
131  m_bubble->BubblecastDestinyEvent(&tuple, "destiny");
132 }
Python tuple.
Definition: PyRep.h:567
#define PyStatic
Definition: PyRep.h:1209
int64 Win32TimeNow()
Definition: utils_time.cpp:70
unsigned __int32 uint32
Definition: eve-compat.h:50
Python list.
Definition: PyRep.h:639

Here is the call graph for this function:

Member Data Documentation

Timer SuperWeapon::m_buildUpTimer
protected

Definition at line 47 of file SuperWeapon.h.

Timer SuperWeapon::m_effectDurationTimer
protected

Definition at line 48 of file SuperWeapon.h.


The documentation for this class was generated from the following files: