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

#include "Ship.h"

Inheritance diagram for ShipItem:
Collaboration diagram for ShipItem:

Public Member Functions

virtual ShipItemGetShipItem ()
 
virtual bool IsShipItem ()
 
void Init ()
 
void InitPod ()
 
void InitAttribs ()
 
void LogOut ()
 
void UpdateMass ()
 
virtual void SetPlayer (Client *pClient)
 
virtual bool HasPilot ()
 
virtual ClientGetPilot ()
 
virtual void AddItem (InventoryItemRef iRef)
 
virtual void RemoveItem (InventoryItemRef iRef)
 
bool HasModuleManager ()
 
ModuleManagerGetModuleManager ()
 
virtual void Delete ()
 
float GetRemainingVolumeByFlag (EVEItemFlags flag) const
 
void VerifyHoldType (EVEItemFlags flag, InventoryItemRef iRef, Client *pClient=nullptr)
 
bool ValidateItemSpecifics (InventoryItemRef iRef)
 
bool IsPopped ()
 
void SetPopped (bool set=false)
 
std::string GetShipDNA ()
 
PyDictGetShipInfo ()
 
PyDictGetShipState ()
 
PyListShipGetModuleList ()
 
PyDictGetChargeState ()
 
bool ValidateBoardShip (CharacterRef who)
 
void SaveShip ()
 
void RepairShip (float fraction)
 
void Dock ()
 
void Heal ()
 
void Jump ()
 
void Warp ()
 
void Eject ()
 
void Undock ()
 
void AddModuleToOnlineVec (uint32 modID)
 
void ProcessModules ()
 
void Online (uint32 modID)
 
void Offline (uint32 modID)
 
void OnlineAll ()
 
void OfflineAll ()
 
void Activate (int32 itemID, std::string effectName, int32 targetID, int32 repeat)
 
void Deactivate (int32 itemID, std::string effectName)
 
void Overload (uint32 itemID)
 
void CancelOverloading (uint32 itemID)
 
void ReplaceCharges (EVEItemFlags flag, InventoryItemRef newCharge)
 
void RemoveRig (InventoryItemRef iRef)
 
void UpdateModules ()
 
void UpdateModules (EVEItemFlags flag)
 
void UnloadModule (uint32 itemID)
 
void UnloadModule (GenericModule *pMod)
 
void UnloadAllModules ()
 
void MoveModuleSlot (EVEItemFlags slot1, EVEItemFlags slot2)
 
void StripFitting ()
 
void EmptyCargo ()
 
void CargoFull ()
 
void RepairModules (std::vector< InventoryItemRef > &itemRefVec, float fraction)
 
void RepairModules ()
 
void AbortCycle ()
 
bool IsActive ()
 
bool IsDocking ()
 
bool IsUndocking ()
 
void SetDocked ()
 
void SetUndocking (bool set=false)
 
InventoryItemRef GetTargetRef ()
 
void ClearTargetRef ()
 
PyRepModuleRepair (uint32 modID)
 
void StopModuleRepair (uint32 modID)
 
void ProcessHeat ()
 
float GenerateHeat (uint16 attrID)
 
float DissipateHeat (uint16 attrID, float heat)
 
void HeatDamageCheck (GenericModule *pMod)
 
void DamageModule (uint32 modID, float amt=1)
 
void DamageRandModule ()
 
void GetModuleRefVec (std::vector< InventoryItemRef > &iRefVec)
 
void GetModuleItemVec (std::vector< InventoryItemRef > &iRefVec)
 
GenericModuleGetModule (EVEItemFlags flag)
 
InventoryItemRef GetModuleRef (EVEItemFlags flag)
 
InventoryItemRef GetModuleRef (uint32 modID)
 
void TryModuleLimitChecks (EVEItemFlags flag, InventoryItemRef iRef)
 
EVEItemFlags FindAvailableModuleSlot (InventoryItemRef iRef)
 
uint32 AddItemByFlag (EVEItemFlags flag, InventoryItemRef iRef, Client *pClient=nullptr)
 
void LoadCharge (InventoryItemRef cRef, EVEItemFlags flag)
 
void LoadChargesToBank (EVEItemFlags flag, std::vector< int32 > &chargeIDs)
 
void RemoveCharge (EVEItemFlags fromFlag)
 
void SetShipShield (float fraction)
 
void SetShipArmor (float fraction)
 
void SetShipHull (float fraction)
 
void SetShipCapacitorLevel (float fraction)
 
float GetShipHullHP ()
 
float GetShipArmorHP ()
 
float GetShipPGLevel ()
 
float GetShipCPULevel ()
 
float GetShipShieldHP ()
 
float GetShipCapacitorLevel ()
 
EvilNumber GetShipHullPercent ()
 
EvilNumber GetShipCPUPercent ()
 
EvilNumber GetShipPGPercent ()
 
EvilNumber GetShipArmorPercent ()
 
EvilNumber GetShipShieldPercent ()
 
EvilNumber GetShipCapacitorPercent ()
 
virtual bool _Load ()
 
void ClearModuleModifiers ()
 
void ResetEffects ()
 
void PrepForUndock ()
 
void ProcessEffects (bool add=false, bool update=false)
 
void CharacterBoardingShip ()
 
uint8 GetLinkedCount (GenericModule *pMod)
 
uint8 GetLoadedLinkedCount (GenericModule *pMod)
 
bool HasLinkedWeapons ()
 
void LinkAllWeapons ()
 
void LinkWeapon (uint32 masterID, uint32 slaveID)
 
void PeelAndLink (uint32 masterID, uint32 slaveID)
 
void MergeModuleGroups (uint32 masterID, uint32 slaveID)
 
uint32 UnlinkWeapon (uint32 moduleID)
 
void UnlinkGroup (uint32 memberID, bool update=false)
 
void UnlinkAllWeapons ()
 
PyRepGetLinkedWeapons ()
 
void OfflineGroup (GenericModule *pMod)
 
void DamageGroup (GenericModule *pMod)
 
void LoadLinkedWeapons (GenericModule *pMod, std::vector< int32 > &chargeIDs)
 
void GetLinkedWeaponMods (EVEItemFlags flag, std::vector< GenericModule * > &modules)
 
- Public Member Functions inherited from InventoryItem
 InventoryItem (uint32 _itemID, const ItemType &_type, const ItemData &_data)
 
 InventoryItem (const InventoryItem &oth)
 
 InventoryItem (InventoryItem &&oth) noexcept
 
InventoryItemoperator= (const InventoryItem &oth)=delete
 
InventoryItemoperator= (InventoryItem &&oth)=delete
 
virtual ~InventoryItem () noexcept
 
virtual ModuleItemGetModuleItem ()
 
virtual bool IsModuleItem ()
 
virtual void Rename (std::string name)
 
InventoryGetMyInventory ()
 
bool contraband () const
 
bool isSingleton () const
 
int32 quantity () const
 
uint32 itemID () const
 
uint32 ownerID () const
 
uint32 locationID () const
 
EVEItemFlags flag () const
 
const GPointposition () const
 
const ItemTypetype () const
 
const std::string & itemName () const
 
const std::string & customInfo () const
 
const char * name ()
 
uint16 typeID () const
 
uint16 groupID () const
 
double radius () const
 
uint8 categoryID () const
 
bool isGlobal () const
 
bool IsOnline ()
 
void SetPosition (const GPoint &pos)
 
void SetCustomInfo (const char *ci)
 
void ChangeOwner (uint32 new_owner, bool notify=false)
 
void Move (uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
 
void Donate (uint32 new_owner=ownerSystem, uint32 new_location=locTemp, EVEItemFlags new_flag=flagNone, bool notify=true)
 
void SendItemChange (uint32 toID, std::map< int32, PyRep * > &changes)
 
void MergeTypesInCargo (ShipItem *pShip, EVEItemFlags flag=flagNone)
 
bool ChangeSingleton (bool singleton, bool notify=false)
 
bool AlterQuantity (int32 qty, bool notify=false)
 
bool SetQuantity (int32 qty, bool notify=false, bool deleteOnZero=true)
 
bool SetFlag (EVEItemFlags flag, bool notify=false)
 
void SetOwner (uint32 ownerID)
 
void SaveItem ()
 
void UpdateLocation ()
 
void UpdateLocation (uint32 locID)
 
virtual InventoryItemRef Split (int32 qty=0, bool notify=true, bool silent=false)
 
virtual bool Merge (InventoryItemRef to_merge, int32 qty=0, bool notify=true)
 
virtual void Relocate (uint32 locID=0, EVEItemFlags flag=flagNone)
 
double GetPackagedVolume ()
 
void ToVirtual (uint32 locationID)
 
PyRepGetItem () const
 
void GetItemRow (PyPackedRow *into) const
 
void GetItemStatusRow (PyPackedRow *into) const
 
void GetChargeStatusRow (uint32 shipID, PyPackedRow *into) const
 
bool Populate (Rsp_CommonGetInfo_Entry &into)
 
PyListGetItemInfo () const
 
PyObjectItemGetInfo ()
 
PyPackedRowGetItemRow () const
 
PyPackedRowGetItemStatusRow () const
 
PyPackedRowGetChargeStatusRow (uint32 shipID) const
 
bool SkillCheck (InventoryItemRef refItem)
 
void ClearModifiers ()
 
void AddModifier (fxData &data)
 
void RemoveModifier (fxData &data)
 
void ResetAttributes ()
 
bool HasReqSkill (const uint16 skillID)
 
AttributeMapGetAttributeMap ()
 
int64 GetTimeStamp ()
 
void SetAttribute (uint16 attrID, int num, bool notify=true)
 
void SetAttribute (uint16 attrID, uint32 num, bool notify=true)
 
void SetAttribute (uint16 attrID, int64 num, bool notify=true)
 
void SetAttribute (uint16 attrID, float num, bool notify=true)
 
void SetAttribute (uint16 attrID, double num, bool notify=true)
 
void SetAttribute (uint16 attrID, EvilNumber num, bool notify=true)
 
void MultiplyAttribute (uint16 attrID, EvilNumber num, bool notify=false)
 
bool HasAttribute (const uint16 attrID) const
 
bool HasAttribute (const uint16 attrID, EvilNumber &value) const
 
bool SaveAttributes ()
 
void ResetAttribute (uint16 attrID, bool notify=false)
 
void DeleteAttribute (uint16 attrID)
 
EvilNumber GetAttribute (const uint16 attrID) const
 
EvilNumber GetDefaultAttribute (const uint16 attrID) const
 
- Public Member Functions inherited from RefObject
 RefObject (size_t initRefCount)
 Initializes reference count. More...
 
virtual ~RefObject ()
 Destructor; must be virtual. More...
 
size_t GetCount ()
 

Static Public Member Functions

static ShipItemRef Load (uint32 shipID)
 
static ShipItemRef Spawn (ItemData &data)
 
- Static Public Member Functions inherited from InventoryItem
static uint32 CreateItemID (ItemData &data)
 
static uint32 CreateTempItemID (ItemData &data)
 
static InventoryItemRef Load (uint32 itemID)
 
static InventoryItemRef SpawnItem (uint32 itemID, const ItemData &data)
 
static InventoryItemRef Spawn (ItemData &data)
 
static InventoryItemRef SpawnTemp (ItemData &data)
 

Protected Member Functions

 ShipItem (uint32 shipID, const ItemType &type, const ItemData &data)
 
 ~ShipItem () noexcept
 
void LinkWeapon (GenericModule *pMaster, GenericModule *pSlave)
 
void UnlinkWeapon (uint32 masterID, uint32 slaveID)
 
void LoadWeaponGroups ()
 
void SaveWeaponGroups ()
 
void LinkWeaponLoop (std::list< GenericModule * > &moduleVec)
 
- Protected Member Functions inherited from RefObject
void IncRef () const
 Increments reference count of object by one. More...
 
void DecRef () const
 Decrements reference count of object by one. More...
 

Static Protected Member Functions

template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 shipID, const ItemType &type, const ItemData &data)
 
static uint32 CreateItemID (ItemData &data)
 
- Static Protected Member Functions inherited from InventoryItem
template<class _Ty >
static RefPtr< _Ty > Load (uint32 itemID)
 
template<class _Ty >
static RefPtr< _Ty > _Load (uint32 itemID)
 
template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 itemID, const ItemType &type, const ItemData &data)
 

Protected Attributes

bool m_loaded
 
- Protected Attributes inherited from InventoryItem
InventorypInventory
 
uint32 m_itemID
 
AttributeMappAttributeMap
 
- Protected Attributes inherited from RefObject
size_t mRefCount
 Reference count of instance. More...
 
bool mDeleted
 

Private Member Functions

void ProcessShipEffects (bool update=false)
 

Private Attributes

Clientm_pilot
 
ModuleManagerm_ModuleManager
 
InventoryItemRef m_targetRef
 
std::vector< uint32m_onlineModuleVec
 
std::map< GenericModule
*, std::list< GenericModule * > > 
m_linkedWeapons
 
bool m_isActive:1
 
bool m_isPopped:1
 
bool m_isDocking:1
 
bool m_isUndocking:1
 

Friends

class InventoryItem
 

Additional Inherited Members

- Public Attributes inherited from InventoryItem
std::multimap< int8, fxDatam_modifiers
 

Detailed Description

Definition at line 46 of file Ship.h.

Constructor & Destructor Documentation

ShipItem::ShipItem ( uint32  shipID,
const ItemType type,
const ItemData data 
)
protected

Definition at line 23 of file Ship.cpp.

References _log, InventoryItem::itemID(), m_onlineModuleVec, InventoryItem::name(), and InventoryItem::pInventory.

Referenced by _LoadItem().

24 : InventoryItem(shipID, type, data),
25 m_pilot(nullptr),
28 m_loaded(false),
29 m_isActive(false),
30 m_isPopped(false),
31 m_isDocking(false),
32 m_isUndocking(false)
33 {
34  m_onlineModuleVec.clear();
36 
37  _log(ITEM__TRACE, "Created ShipItem for %s(%u).", name(), itemID());
38 }
#define _log(type, fmt,...)
Definition: logsys.h:124
friend class InventoryItem
Definition: Ship.h:49
std::vector< uint32 > m_onlineModuleVec
Definition: Ship.h:280
bool m_isDocking
Definition: Ship.h:287
const char * name()
ModuleManager * m_ModuleManager
Definition: Ship.h:276
bool m_isPopped
Definition: Ship.h:286
Client * m_pilot
Definition: Ship.h:273
Inventory * pInventory
bool m_loaded
Definition: Ship.h:227
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
bool m_isActive
Definition: Ship.h:285
InventoryItemRef m_targetRef
Definition: Ship.h:278
bool m_isUndocking
Definition: Ship.h:288
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

ShipItem::~ShipItem ( )
protectednoexcept

Definition at line 40 of file Ship.cpp.

References m_ModuleManager, InventoryItem::pInventory, and SafeDelete().

41 {
44 }
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
ModuleManager * m_ModuleManager
Definition: Ship.h:276
Inventory * pInventory

Here is the call graph for this function:

Member Function Documentation

bool ShipItem::_Load ( )
virtual

Reimplemented from InventoryItem.

Definition at line 63 of file Ship.cpp.

References InventoryItem::_Load(), AttrVolume, InventoryItem::GetPackagedVolume(), Client::IsCharCreation(), Inventory::LoadContents(), m_loaded, m_ModuleManager, InventoryItem::pInventory, InventoryItem::SetAttribute(), and sItemFactory.

64 {
65  if (m_loaded and (m_ModuleManager != nullptr))
66  return true;
67 
68  Client* pClient = sItemFactory.GetUsingClient();
69  // test for character creation (which throws errors on following *load() calls and not really needed)
70  if ((pClient != nullptr) and pClient->IsCharCreation())
71  return true;
72  // load attributes
73  if (!InventoryItem::_Load())
74  return false;
75  // load contents
76  if (!pInventory->LoadContents())
77  return false;
78 
80 
81  return (m_loaded = true);
82 }
bool IsCharCreation()
Definition: Client.h:433
virtual bool _Load()
ModuleManager * m_ModuleManager
Definition: Ship.h:276
double GetPackagedVolume()
Inventory * pInventory
void SetAttribute(uint16 attrID, int num, bool notify=true)
Definition: Client.h:66
bool m_loaded
Definition: Ship.h:227
bool LoadContents()
Definition: Inventory.cpp:113
#define sItemFactory
Definition: ItemFactory.h:165

Here is the call graph for this function:

template<class _Ty >
static RefPtr<_Ty> ShipItem::_LoadItem ( uint32  shipID,
const ItemType type,
const ItemData data 
)
inlinestaticprotected

Definition at line 216 of file Ship.h.

References _log, ItemType::categoryID(), sConfig, sDataMgr, EVEDB::invCategories::Ship, ShipItem(), and EvE::traceStack().

216  {
218  return ShipItemRef( new ShipItem(shipID, type, data ));
219 
220  _log(ITEM__ERROR, "Trying to load %s as Ship.", sDataMgr.GetCategoryName(type.categoryID()));
221  if (sConfig.debug.StackTrace)
222  EvE::traceStack();
223  return RefPtr<_Ty>();
224  }
#define sConfig
A macro for easier access to the singleton.
#define _log(type, fmt,...)
Definition: logsys.h:124
uint8 categoryID() const
Definition: ItemType.h:66
ShipItem(uint32 shipID, const ItemType &type, const ItemData &data)
Definition: Ship.cpp:23
RefPtr< ShipItem > ShipItemRef
Definition: ItemRef.h:54
void traceStack(void)
Definition: misc.cpp:169
Reference-counting-based smart pointer.
Definition: RefPtr.h:133
#define sDataMgr

Here is the call graph for this function:

void ShipItem::AbortCycle ( )
inline

Definition at line 146 of file Ship.h.

References ModuleManager::AbortCycle(), and m_ModuleManager.

Referenced by ShipSE::AbortCycle().

ModuleManager * m_ModuleManager
Definition: Ship.h:276

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::Activate ( int32  itemID,
std::string  effectName,
int32  targetID,
int32  repeat 
)

Definition at line 1039 of file Ship.cpp.

References ModuleManager::Activate(), IsValidTarget, m_ModuleManager, m_targetRef, sFxDataMgr, and sItemFactory.

1040 {
1041  if (IsValidTarget(targetID)) {
1042  m_targetRef = sItemFactory.GetItem(targetID);
1043  } else {
1044  m_targetRef = InventoryItemRef(nullptr);
1045  }
1046 
1047  m_ModuleManager->Activate( itemID, sFxDataMgr.GetEffectID(effectName), targetID, repeat);
1048 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
#define sFxDataMgr
#define IsValidTarget(itemID)
Definition: EVE_Defines.h:327
void Activate(int32 itemID, uint16 effectID, int32 targetID, int32 repeat)
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
#define sItemFactory
Definition: ItemFactory.h:165
InventoryItemRef m_targetRef
Definition: Ship.h:278
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void ShipItem::AddItem ( InventoryItemRef  iRef)
virtual
Todo:
update destiny mass after adding item

Reimplemented from InventoryItem.

Definition at line 468 of file Ship.cpp.

References InventoryItem::AddItem(), AttrMass, RefPtr< X >::get(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), HasPilot(), ItemType::mass(), InventoryItem::quantity(), sConfig, InventoryItem::SetAttribute(), and InventoryItem::type().

469 {
470  if (iRef.get() == nullptr)
471  return;
472 
474 
475  // add item mass to ship's mass if set in options (additive...loaded ship should be heavy)
476  if (sConfig.server.CargoMassAdditive) {
478  uint32 addition = iRef->type().mass() * iRef->quantity();
479  SetAttribute(AttrMass, mass + addition, HasPilot());
480  }
481 
483 }
#define sConfig
A macro for easier access to the singleton.
virtual void AddItem(InventoryItemRef iRef)
virtual bool HasPilot()
Definition: Ship.h:71
const ItemType & type() const
uint32 get_uint32()
Definition: EvilNumber.cpp:173
float mass() const
Definition: ItemType.h:69
void SetAttribute(uint16 attrID, int num, bool notify=true)
X * get() const
Definition: RefPtr.h:213
unsigned __int32 uint32
Definition: eve-compat.h:50
EvilNumber GetAttribute(const uint16 attrID) const
int32 quantity() const
Definition: InventoryItem.h:97

Here is the call graph for this function:

uint32 ShipItem::AddItemByFlag ( EVEItemFlags  flag,
InventoryItemRef  iRef,
Client pClient = nullptr 
)

Definition at line 486 of file Ship.cpp.

References ModuleManager::AddModule(), InventoryItem::categoryID(), InventoryItem::ChangeSingleton(), EVEDB::invCategories::Charge, codelog, flagCargoHold, flagNone, RefPtr< X >::get(), ModuleManager::GetLoadedChargeOnModule(), ModuleManager::InstallRig(), ModuleManager::InstallSubSystem(), IsModuleSlot, IsRigSlot, InventoryItem::itemID(), ModuleManager::LoadCharge(), InventoryItem::m_itemID, m_ModuleManager, EVEDB::invCategories::Module, InventoryItem::Move(), sConfig, RefPtr< X >::StaticCast(), EVEDB::invCategories::Subsystem, and EvE::traceStack().

Referenced by MiningLaser::AddOreAndDeactivate(), generic_createitem(), InventoryBound::MoveItems(), and MoveModuleSlot().

487 {
488  if (iRef.get() == nullptr)
489  return 0;
490 
491  if (flag == flagNone) {
492  // make error. nothing at this point should be "autoFit"
493  codelog(SHIP__ERROR, "ShipItem::AddItem() - flag = flagNone.");
494  if (sConfig.debug.IsTestServer)
495  EvE::traceStack();
496  flag = flagCargoHold; //default to cargo (cause this is a ship)
497  }
498  // CantFitModuleToThatShip
499  // u'CantFitModuleToThatShipBody'}(u"You can't fit {item} to {ship}", None, {u'{ship}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'ship'}, u'{item}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'item'}})
500 
501  if (IsModuleSlot(flag)) {
502  if (iRef->categoryID() == EVEDB::invCategories::Charge) {
503  iRef->ChangeSingleton(false, false);
506  if (iRef.get() == nullptr)
507  return 0;
508  return iRef->itemID();
509  } else if (iRef->categoryID() == EVEDB::invCategories::Module) {
511  mRef->ChangeSingleton(true, false);
512  // rigs are classed in the module category. check here and call appropriate method as needed.
513  if (IsRigSlot(flag)) {
514  if (!m_ModuleManager->InstallRig(mRef, flag))
515  return 0;
516  } else if (!m_ModuleManager->AddModule(mRef, flag))
517  return 0;
518  } else if (iRef->categoryID() == EVEDB::invCategories::Subsystem) {
520  //mRef->SetOnline(true); // is this needed here?
521  mRef->ChangeSingleton(true, false);
523  return 0;
524  }
525  //m_ModuleManager->UpdateModules(flag);
526  }
527 
528  iRef->Move(m_itemID, flag, true);
529  return iRef->itemID();
530 }
#define sConfig
A macro for easier access to the singleton.
InventoryItemRef GetLoadedChargeOnModule(EVEItemFlags flag)
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
bool InstallRig(ModuleItemRef mRef, EVEItemFlags flag)
#define codelog(type, fmt,...)
Definition: logsys.h:128
bool InstallSubSystem(ModuleItemRef mRef, EVEItemFlags flag)
X * get() const
Definition: RefPtr.h:213
bool ChangeSingleton(bool singleton, bool notify=false)
static RefPtr StaticCast(const RefPtr< Y > &oth)
Acts as static_cast from one RefPtr to another.
Definition: RefPtr.h:238
EVEItemFlags flag() const
#define IsModuleSlot(flag)
Definition: EVE_Defines.h:350
void LoadCharge(InventoryItemRef chargeRef, EVEItemFlags flag)
bool AddModule(ModuleItemRef mRef, EVEItemFlags flag)
#define IsRigSlot(flag)
Definition: EVE_Defines.h:367
void traceStack(void)
Definition: misc.cpp:169
uint8 categoryID() const
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::AddModuleToOnlineVec ( uint32  modID)

Definition at line 562 of file Ship.cpp.

References _log, and m_onlineModuleVec.

563 {
564  m_onlineModuleVec.push_back(modID);
565  _log(MODULE__INFO, "Added ModuleID %u to Online List", modID);
566 }
#define _log(type, fmt,...)
Definition: logsys.h:124
std::vector< uint32 > m_onlineModuleVec
Definition: Ship.h:280
void ShipItem::CancelOverloading ( uint32  itemID)
inline

Definition at line 125 of file Ship.h.

References ModuleManager::DeOverload(), and m_ModuleManager.

void DeOverload(uint32 itemID)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void ShipItem::CargoFull ( )

Definition at line 1335 of file Ship.cpp.

References ModuleManager::CargoFull(), and m_ModuleManager.

Referenced by MiningLaser::ProcessCycle().

1335  {
1336  // loop thru modules and deactivate any type of miner
1338  // tell drones cargo is full. this will command mining types to return and orbit
1339  // drones->return();
1340 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::CharacterBoardingShip ( )
inline

Definition at line 240 of file Ship.h.

References ModuleManager::CharacterBoardingShip(), and m_ModuleManager.

ModuleManager * m_ModuleManager
Definition: Ship.h:276
void CharacterBoardingShip()

Here is the call graph for this function:

void ShipItem::ClearModuleModifiers ( )

Definition at line 1858 of file Ship.cpp.

References _log, ModuleManager::GetLoadedCharges(), ModuleManager::GetModuleListOfRefsAsc(), and m_ModuleManager.

Referenced by ProcessEffects().

1859 {
1860  _log(EFFECTS__TRACE, "ShipItem::ClearModuleModifiers()");
1861  //m_ModuleManager->OfflineAll();
1862  std::vector< InventoryItemRef > modVec;
1864  for (auto cur : modVec)
1865  cur->ClearModifiers();
1866  std::map<EVEItemFlags, InventoryItemRef> charges;
1868  for (auto cur : charges)
1869  cur.second->ClearModifiers();
1870 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void GetLoadedCharges(std::map< EVEItemFlags, InventoryItemRef > &charges)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void GetModuleListOfRefsAsc(std::vector< InventoryItemRef > &modVec)

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::ClearTargetRef ( )
inline

Definition at line 153 of file Ship.h.

References m_targetRef.

Referenced by ActiveModule::Clear().

RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
InventoryItemRef m_targetRef
Definition: Ship.h:278

Here is the caller graph for this function:

uint32 ShipItem::CreateItemID ( ItemData data)
staticprotected

Definition at line 59 of file Ship.cpp.

References InventoryItem::CreateItemID().

59  {
60  return InventoryItem::CreateItemID(data);
61 }
static uint32 CreateItemID(ItemData &data)

Here is the call graph for this function:

void ShipItem::DamageGroup ( GenericModule pMod)

Definition at line 1246 of file Ship.cpp.

1247 {
1248  // not used yet
1249 }
void ShipItem::DamageModule ( uint32  modID,
float  amt = 1 
)
inline

Definition at line 166 of file Ship.h.

References ModuleManager::DamageModule(), and m_ModuleManager.

Referenced by ShipSE::DamageModule(), and HeatDamageCheck().

166 { m_ModuleManager->DamageModule(modID, amt); }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void DamageModule(uint32 itemID, float amount)

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::DamageRandModule ( )
inline

Definition at line 167 of file Ship.h.

References ModuleManager::DamageRandModule(), and m_ModuleManager.

Referenced by ShipSE::DamageRandModule().

ModuleManager * m_ModuleManager
Definition: Ship.h:276
void DamageRandModule()

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::Deactivate ( int32  itemID,
std::string  effectName 
)
inline

Definition at line 123 of file Ship.h.

References ModuleManager::Deactivate(), and m_ModuleManager.

123 { m_ModuleManager->Deactivate(itemID, effectName); }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void Deactivate(uint32 itemID, std::string effectName)
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void ShipItem::Delete ( )
virtual

Reimplemented from InventoryItem.

Definition at line 332 of file Ship.cpp.

References InventoryItem::Delete(), Inventory::DeleteContents(), and InventoryItem::pInventory.

332  {
335 }
void DeleteContents()
Definition: Inventory.cpp:273
Inventory * pInventory
virtual void Delete()

Here is the call graph for this function:

float ShipItem::DissipateHeat ( uint16  attrID,
float  heat 
)

Definition at line 1214 of file Ship.cpp.

References _log, AttrHeatHi, AttrHeatLow, AttrHeatMed, and InventoryItem::name().

Referenced by ProcessHeat().

1215 {
1216  //H = ln^t
1217  float t(1.0f + heat), newHeat(0.0f);
1218  std::string rack = "";
1219  switch(attrID) {
1220  case AttrHeatHi: {
1221  rack = "Hi";
1222  } break;
1223  case AttrHeatMed: {
1224  rack = "Mid";
1225  } break;
1226  case AttrHeatLow: {
1227  rack = "Low";
1228  } break;
1229  default: {
1230  _log(SHIP__HEAT, "DissipateHeat() - %s invalid rack sent (%u)", name(), attrID);
1231  return 0.0f;
1232  } break;
1233  }
1234 
1235  newHeat = log(t); //0.18 when t=1.2, 3.1 when t=21.9, 3.9 when t=51.9, 4.6 when t=99.9
1236 
1237  if (newHeat < 0)
1238  newHeat = 0.0f;
1239 
1240  _log(SHIP__HEAT, "%s dissipated %.2f heat points from the %s rack this tic. was %.1f, is %.1f, t = %.3f", \
1241  name(), newHeat, rack.c_str(), heat, (heat - newHeat), t);
1242 
1243  return newHeat;
1244 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const char * name()

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::Dock ( )

Definition at line 361 of file Ship.cpp.

References ModuleManager::DeactivateAllModules(), m_isDocking, m_ModuleManager, m_onlineModuleVec, and ProcessEffects().

Referenced by ShipSE::Dock().

361  {
362  m_isDocking = true;
363 
365  m_onlineModuleVec.clear();
366  // remove ship effects and char skill effects for docking.
367  ProcessEffects();
368 }
std::vector< uint32 > m_onlineModuleVec
Definition: Ship.h:280
bool m_isDocking
Definition: Ship.h:287
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void ProcessEffects(bool add=false, bool update=false)
Definition: Ship.cpp:1794
void DeactivateAllModules()

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::Eject ( )

Definition at line 350 of file Ship.cpp.

References ModuleManager::AbortCycle(), ModuleManager::CharacterLeavingShip(), m_ModuleManager, and SaveShip().

Referenced by Client::Board(), and Client::Eject().

351 {
352  if (m_ModuleManager != nullptr) {
355  }
356  SaveShip();
357  // linked weapons will be persistant here.
358  //UnlinkAllWeapons();
359 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void CharacterLeavingShip()
void SaveShip()
Definition: Ship.cpp:1060

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::EmptyCargo ( )

Definition at line 1327 of file Ship.cpp.

References flagHangar, Inventory::GetInventoryMap(), InventoryItem::locationID(), and InventoryItem::pInventory.

1328 {
1329  std::map<uint32, InventoryItemRef> invMap;
1330  pInventory->GetInventoryMap( invMap );
1331  for (auto cur : invMap )
1332  cur.second->Move(locationID(), flagHangar, true);
1333 }
Inventory * pInventory
uint32 locationID() const
void GetInventoryMap(std::map< uint32, InventoryItemRef > &invMap)
Definition: Inventory.cpp:453

Here is the call graph for this function:

EVEItemFlags ShipItem::FindAvailableModuleSlot ( InventoryItemRef  iRef)

Definition at line 797 of file Ship.cpp.

References codelog, flagIllegal, ModuleManager::GetAvailableSlotInBank(), ItemType::HasEffect(), hiPower, loPower, m_ModuleManager, medPower, InventoryItem::name(), rigSlot, subSystem, and InventoryItem::type().

Referenced by InventoryBound::MoveItems().

797  {
798  uint16 slotFound(flagIllegal);
799  if (iRef->type().HasEffect(EVEEffectID::loPower)) {
801  } else if (iRef->type().HasEffect(EVEEffectID::medPower)) {
803  } else if (iRef->type().HasEffect(EVEEffectID::hiPower)) {
805  } else if (iRef->type().HasEffect(EVEEffectID::subSystem)) {
807  } else if (iRef->type().HasEffect(EVEEffectID::rigSlot)) {
809  } else {
810  codelog(SHIP__ERROR, "ShipItem::FindAvailableModuleSlot() - iRef %s has no bank effect.", iRef->name());
811  }
812 
813  return (EVEItemFlags)slotFound;
814 }
EVEItemFlags
Definition: EVE_Flags.h:13
bool HasEffect(uint16 effectID) const
Definition: ItemType.cpp:208
const char * name()
ModuleManager * m_ModuleManager
Definition: Ship.h:276
const ItemType & type() const
#define codelog(type, fmt,...)
Definition: logsys.h:128
uint16 GetAvailableSlotInBank(EVEEffectID slotBank)
unsigned __int16 uint16
Definition: eve-compat.h:48

Here is the call graph for this function:

Here is the caller graph for this function:

float ShipItem::GenerateHeat ( uint16  attrID)
Note
still not sure how live builds heat, but here's how im gonna do it. during normal op, modules make heat that builds slowly normal module operation will not build excessive heat on ship...it was designed for it. the difference here is pilots will now be able to SEE the heat buildup (dont recall if it showed on HUD w/o OL) overloaded modules will build excessive heat, using a diff heat generation method, and will begin to damage it's rack from overheating (heat > rack heat capy).

Definition at line 1164 of file Ship.cpp.

References _log, AttrHeatGenerationMultiplier, AttrHeatHi, AttrHeatLow, AttrHeatMed, EvilNumber::get_float(), ModuleManager::GetActiveModulesHeat(), InventoryItem::GetAttribute(), hiPower, loPower, m_ModuleManager, medPower, and InventoryItem::name().

Referenced by ProcessHeat().

1165 {
1174  /* heat buildup
1175  * H = 3(e^t)
1176  * t = (sum of active module's heat damage / 10) + 1
1177  * t must be > 1.0 to avoid negatives. if no modules active, t=1.0 and log(1.0)=0
1178  * this may look funny, but is rather accurate generation of module heat from normal op.
1179  */
1180 
1181  float t(1.0f);
1182  std::string rack = "";
1183  //std::vector< GenericModule* > modVec;
1184  switch(attrID) {
1185  case AttrHeatHi: {
1186  rack = "Hi";
1187  //m_ModuleManager->GetActiveModules(EVEEffectID::hiPower, modVec);
1189  } break;
1190  case AttrHeatMed: {
1191  rack = "Mid";
1193  } break;
1194  case AttrHeatLow: {
1195  rack = "Low";
1197  } break;
1198  default: {
1199  _log(SHIP__HEAT, "GenerateHeat() - %s invalid rack sent (%u)", name(), attrID);
1200  return 0;
1201  } break;
1202  }
1203 
1204  if (t < 1.2)
1205  return 0;
1206 
1207  //log(t) *3; //0.28 when t=1.1, 1.2 when t=1.5, 4.1 when t=3.9 (highest i found), 6.8 when t=5.55
1208  float heat = log(t) *3 * GetAttribute(AttrHeatGenerationMultiplier).get_float();
1209 
1210  _log(SHIP__HEAT, "%s generated %.2f heat points from the %s rack this tic. t = %.3f", name(), heat, rack.c_str(), t);
1211  return heat;
1212 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const char * name()
ModuleManager * m_ModuleManager
Definition: Ship.h:276
EvilNumber GetAttribute(const uint16 attrID) const
void GetActiveModulesHeat(uint8 rack, float &heat)
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

Here is the caller graph for this function:

PyDict * ShipItem::GetChargeState ( )

Definition at line 2224 of file Ship.cpp.

References _log, Inventory::ContentsLoaded(), ModuleManager::GetLoadedCharges(), InventoryItem::itemID(), Inventory::LoadContents(), m_ModuleManager, InventoryItem::name(), InventoryItem::pInventory, and PyDict::SetItem().

2224  {
2225  if (!pInventory->ContentsLoaded()) {
2226  if (!pInventory->LoadContents()) {
2227  _log(INV__ERROR, "%s(%u): Failed to load contents for GetShipState", name(), itemID());
2228  return nullptr;
2229  }
2230  }
2231 
2232  /* get list of all charges loaded in modules */
2233  std::map< EVEItemFlags, InventoryItemRef > charges;
2235 
2236  PyDict *result = new PyDict();
2237  if (charges.empty())
2238  return result;
2239 
2240  // Create entries in "shipState" dictionary for loaded charges on ship:
2241  for (auto cur : charges)
2242  result->SetItem(new PyInt((uint16)cur.first), cur.second->GetChargeStatusRow(itemID()));
2243 
2244  return result;
2245 }
bool ContentsLoaded() const
Definition: Inventory.h:62
#define _log(type, fmt,...)
Definition: logsys.h:124
Python's dictionary.
Definition: PyRep.h:719
const char * name()
void GetLoadedCharges(std::map< EVEItemFlags, InventoryItemRef > &charges)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
Inventory * pInventory
Python integer.
Definition: PyRep.h:231
bool LoadContents()
Definition: Inventory.cpp:113
unsigned __int16 uint16
Definition: eve-compat.h:48
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

uint8 ShipItem::GetLinkedCount ( GenericModule pMod)

Definition at line 1668 of file Ship.cpp.

References m_linkedWeapons.

Referenced by Missile::Missile().

1669 {
1670  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.find(pMod);
1671  if (itr == m_linkedWeapons.end())
1672  return 1;
1673  return itr->second.size() + 1;
1674 }
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281

Here is the caller graph for this function:

void ShipItem::GetLinkedWeaponMods ( EVEItemFlags  flag,
std::vector< GenericModule * > &  modules 
)

Definition at line 1342 of file Ship.cpp.

References ModuleManager::GetModule(), m_linkedWeapons, m_ModuleManager, and Profile::modules.

Referenced by ActiveModule::Activate(), ActiveModule::ConsumeCharge(), and ActiveModule::DeactivateCycle().

1342  {
1344  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.find(pMod);
1345  if (itr != m_linkedWeapons.end()) {
1346  modules.push_back(pMod);
1347  for (auto cur : itr->second)
1348  modules.push_back(cur);
1349  } else {
1350  // this module isnt master... loop thru all links and see if we can find it
1351  for (auto cur : m_linkedWeapons) {
1352  std::list<GenericModule*>::iterator itr2 = cur.second.begin(), end = cur.second.end();
1353  while (itr2 != end) {
1354  if ((*itr2) == pMod) {
1355  GetLinkedWeaponMods(cur.first->flag(), modules);
1356  return;
1357  }
1358  ++itr2;
1359  }
1360  }
1361  }
1362 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
GenericModule * GetModule(EVEItemFlags flag)
void GetLinkedWeaponMods(EVEItemFlags flag, std::vector< GenericModule * > &modules)
Definition: Ship.cpp:1342
EVEItemFlags flag() const

Here is the call graph for this function:

Here is the caller graph for this function:

PyRep * ShipItem::GetLinkedWeapons ( )

Definition at line 1691 of file Ship.cpp.

References _log, PyList::AddItem(), PyRep::Dump(), is_log_enabled, m_linkedWeapons, PyStatic, and PyDict::SetItem().

1692 {
1693  if (m_linkedWeapons.empty())
1694  return PyStatic.NewNone();
1695 
1696  PyDict* result = new PyDict();
1697  for (auto cur : m_linkedWeapons) {
1698  PyList* slaves = new PyList();
1699  for (auto slave : cur.second)
1700  slaves->AddItem(new PyInt(slave->itemID()));
1701  result->SetItem(new PyInt(cur.first->itemID()), slaves);
1702  }
1703 
1704  if (is_log_enabled(MODULE__MESSAGE)) {
1705  _log(MODULE__MESSAGE, "GetLinkedWeapons()");
1706  result->Dump(MODULE__MESSAGE, " ");
1707  }
1708  return result;
1709 }
#define _log(type, fmt,...)
Definition: logsys.h:124
Python's dictionary.
Definition: PyRep.h:719
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
void AddItem(PyRep *i)
Definition: PyRep.h:701
#define is_log_enabled(type)
Definition: logsys.h:78
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
Python integer.
Definition: PyRep.h:231
#define PyStatic
Definition: PyRep.h:1209
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713
Python list.
Definition: PyRep.h:639

Here is the call graph for this function:

uint8 ShipItem::GetLoadedLinkedCount ( GenericModule pMod)

Definition at line 1676 of file Ship.cpp.

References m_linkedWeapons.

Referenced by TurretModule::ApplyDamage().

1677 {
1678  uint8 count(1);
1679  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.find(pMod);
1680  if (itr != m_linkedWeapons.end()) {
1681  std::list<GenericModule*>::iterator itr2 = itr->second.begin(), end = itr->second.end();
1682  while (itr2 != end) {
1683  if ((*itr2)->IsLoaded())
1684  ++count;
1685  ++itr2;
1686  }
1687  }
1688  return count;
1689 }
unsigned __int8 uint8
Definition: eve-compat.h:46
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281

Here is the caller graph for this function:

GenericModule* ShipItem::GetModule ( EVEItemFlags  flag)
inline

Definition at line 173 of file Ship.h.

References ModuleManager::GetModule(), and m_ModuleManager.

Referenced by SystemEntity::ApplyDamage(), InventoryBound::MoveItems(), and MoveModuleSlot().

173 { return m_ModuleManager->GetModule(flag); }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
GenericModule * GetModule(EVEItemFlags flag)
EVEItemFlags flag() const

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::GetModuleItemVec ( std::vector< InventoryItemRef > &  iRefVec)

Definition at line 568 of file Ship.cpp.

References Inventory::GetInventoryMap(), IsModuleSlot, and InventoryItem::pInventory.

Referenced by RepairService::GetDamageReports().

568  {
569  std::map<uint32, InventoryItemRef> invMap;
570  pInventory->GetInventoryMap( invMap );
571  for (auto cur : invMap )
572  if (IsModuleSlot(cur.second->flag()))
573  iRefVec.push_back(cur.second);
574 }
Inventory * pInventory
void GetInventoryMap(std::map< uint32, InventoryItemRef > &invMap)
Definition: Inventory.cpp:453
#define IsModuleSlot(flag)
Definition: EVE_Defines.h:350

Here is the call graph for this function:

Here is the caller graph for this function:

ModuleManager* ShipItem::GetModuleManager ( )
inline

Definition at line 80 of file Ship.h.

References m_ModuleManager.

Referenced by FxProc::ApplyEffects(), Client::BoardShip(), Command_unload(), ProbeSE::ProbeSE(), Client::ProcessClient(), and ShipSE::RemoveTarget().

80 { return m_ModuleManager; }
ModuleManager * m_ModuleManager
Definition: Ship.h:276

Here is the caller graph for this function:

InventoryItemRef ShipItem::GetModuleRef ( EVEItemFlags  flag)

Definition at line 582 of file Ship.cpp.

References ModuleManager::GetModule(), GenericModule::GetSelf(), and m_ModuleManager.

Referenced by MoveModuleSlot().

583 {
585  if (pMod != nullptr)
586  return pMod->GetSelf();
587 
588  return InventoryItemRef(nullptr);
589 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
GenericModule * GetModule(EVEItemFlags flag)
ModuleItemRef GetSelf()
Definition: GenericModule.h:42
EVEItemFlags flag() const
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52

Here is the call graph for this function:

Here is the caller graph for this function:

InventoryItemRef ShipItem::GetModuleRef ( uint32  modID)

Definition at line 591 of file Ship.cpp.

References ModuleManager::GetModule(), GenericModule::GetSelf(), and m_ModuleManager.

592 {
593  GenericModule* pMod(m_ModuleManager->GetModule(modID));
594  if (pMod != nullptr)
595  return pMod->GetSelf();
596 
597  return InventoryItemRef(nullptr);
598 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
GenericModule * GetModule(EVEItemFlags flag)
ModuleItemRef GetSelf()
Definition: GenericModule.h:42
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52

Here is the call graph for this function:

void ShipItem::GetModuleRefVec ( std::vector< InventoryItemRef > &  iRefVec)

Definition at line 577 of file Ship.cpp.

References ModuleManager::GetModuleListOfRefsAsc(), and m_ModuleManager.

Referenced by RepairService::GetDamageReports().

578 {
580 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void GetModuleListOfRefsAsc(std::vector< InventoryItemRef > &modVec)

Here is the call graph for this function:

Here is the caller graph for this function:

float ShipItem::GetRemainingVolumeByFlag ( EVEItemFlags  flag) const
Todo:
this will need more work to correctly check hold capacity for offline/unloaded ships

Definition at line 338 of file Ship.cpp.

References Inventory::GetRemainingCapacity(), and InventoryItem::pInventory.

Referenced by MiningLaser::CanActivate(), and MiningLaser::ProcessCycle().

338  {
339  // updated to use inventory -allan 26Jul16 -fixed 22Nov18 -updated to new call 08Aug20
341 }
float GetRemainingCapacity(EVEItemFlags flag) const
Definition: Inventory.h:72
Inventory * pInventory
EVEItemFlags flag() const

Here is the call graph for this function:

Here is the caller graph for this function:

float ShipItem::GetShipArmorHP ( )
inline

Definition at line 198 of file Ship.h.

References AttrArmorHP, EvilNumber::get_float(), and InventoryItem::GetAttribute().

Referenced by Command_status().

198 { return GetAttribute(AttrArmorHP).get_float(); }
EvilNumber GetAttribute(const uint16 attrID) const
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

Here is the caller graph for this function:

EvilNumber ShipItem::GetShipArmorPercent ( )
inline

Definition at line 206 of file Ship.h.

References AttrArmorDamage, AttrArmorHP, and InventoryItem::GetAttribute().

Referenced by Command_status().

EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

float ShipItem::GetShipCapacitorLevel ( )
inline

Definition at line 202 of file Ship.h.

References AttrCapacitorCharge, EvilNumber::get_float(), and InventoryItem::GetAttribute().

Referenced by Command_status().

EvilNumber GetAttribute(const uint16 attrID) const
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

Here is the caller graph for this function:

EvilNumber ShipItem::GetShipCapacitorPercent ( )
inline

Definition at line 208 of file Ship.h.

References AttrCapacitorCapacity, AttrCapacitorCharge, and InventoryItem::GetAttribute().

Referenced by Command_status().

Here is the call graph for this function:

Here is the caller graph for this function:

float ShipItem::GetShipCPULevel ( )
inline

Definition at line 200 of file Ship.h.

References AttrCpuOutput, EvilNumber::get_float(), and InventoryItem::GetAttribute().

Referenced by Command_status().

200 { return GetAttribute(AttrCpuOutput).get_float(); }
EvilNumber GetAttribute(const uint16 attrID) const
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

Here is the caller graph for this function:

EvilNumber ShipItem::GetShipCPUPercent ( )
inline

Definition at line 204 of file Ship.h.

References AttrCpuLoad, AttrCpuOutput, and InventoryItem::GetAttribute().

Referenced by Command_status().

EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

std::string ShipItem::GetShipDNA ( )
Todo:
update this for multiples of modules

Definition at line 1902 of file Ship.cpp.

References _log, EVEDB::invTypes::Capsule, ModuleManager::GetLoadedCharges(), ModuleManager::GetModuleListOfRefsAsc(), IsHiSlot, IsLowSlot, IsMidSlot, IsRigSlot, IsSubSystem, InventoryItem::itemID(), m_ModuleManager, InventoryItem::name(), and InventoryItem::typeID().

Referenced by Command_shipdna().

1903 {
1904  /* ship dna is shorthand notation to describe a ship and it's fittings purely thru the use of typeIDs and quantities
1905  *
1906  * the format is as follows:
1907  * <shipTypeID>:
1908  * <subsystemID>:
1909  * <moduleType-Highslot>;<quantity>:
1910  * <moduleType-Midslot>;<quantity>:
1911  * <moduleType-Lowslot>;<quantity>:
1912  * <moduleType-Rigslot>;<quantity>:
1913  * <chargeType>;<quantity>:
1914  * <droneType>;<quantity>
1915  *
1916  * Condensed version:
1917  * Ship:Subsystem:Highs:Mids:Lows:Rigs:Charges:Drones
1918  *
1919  * [PyString "<url=fitting:24698:3841;2:2531;1:19812;1:23527;1:2410;7:1422;4:2547;1:31802;3:2301;1:2454;5::>Anchor</url>"]
1920  *
1921  * current code returns this:
1922  * "587:8863;1:8863;1:8863;1:499;1:578;1:1798;1:6485;1:2046;1:8325;1:31788;1:31800;1:31788;1::"
1923  * need to figure out how to group modules for correct condensed counts
1924  */
1925  if (typeID() == EVEDB::invTypes::Capsule) {
1926  std::stringstream dna;
1927  dna << typeID() << ":";
1928  _log(SHIP__MESSAGE, "ShipDNA has compiled DNA of \"%s\" for %s(%u) ", dna.str().c_str(), name(), itemID());
1929  return dna.str();
1930  }
1931 
1932  /* find and encode the module typeIDs */
1933  std::stringstream modHi, modMid, modLow, subSys, modRig, charges, drones;
1934 
1935  std::vector<InventoryItemRef> moduleList;
1937 
1939  for (auto cur : moduleList) {
1940  if (IsRigSlot(cur->flag())) {
1941  modRig << cur->typeID() << ";" << cur->quantity() << ":";
1942  } else if (IsHiSlot(cur->flag())) {
1943  modHi << cur->typeID() << ";" << cur->quantity() << ":";
1944  } else if (IsMidSlot(cur->flag())) {
1945  modMid << cur->typeID() << ";" << cur->quantity() << ":";
1946  } else if (IsLowSlot(cur->flag())) {
1947  modLow << cur->typeID() << ";" << cur->quantity() << ":";
1948  } else if (IsSubSystem(cur->flag())) {
1949  subSys << cur->typeID() << ":";
1950  } else {
1951  ; // error?
1952  }
1953  }
1954 
1955  std::map<EVEItemFlags, InventoryItemRef> chargeList;
1956  m_ModuleManager->GetLoadedCharges(chargeList);
1957  for (auto cur : chargeList)
1958  charges << cur.second->typeID() << ";" << cur.second->quantity() << ":";
1959 
1960  /* not sure how to get drones yet. will work on later */
1961  drones << ":";
1962 
1963  /* build the dna stream */
1964  std::stringstream dna;
1965  dna << typeID() << ":";
1966  dna << subSys.str() << modHi.str() << modMid.str() << modLow.str() << modRig.str() << charges.str() << drones.str();
1967 
1968  _log(SHIP__MESSAGE, "ShipDNA has compiled \"%s\" for %s(%u) ", dna.str().c_str(), name(), itemID());
1969  return dna.str();
1970 }
#define _log(type, fmt,...)
Definition: logsys.h:124
#define IsMidSlot(flag)
Definition: EVE_Defines.h:361
const char * name()
#define IsLowSlot(flag)
Definition: EVE_Defines.h:364
void GetLoadedCharges(std::map< EVEItemFlags, InventoryItemRef > &charges)
#define IsHiSlot(flag)
Definition: EVE_Defines.h:358
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void GetModuleListOfRefsAsc(std::vector< InventoryItemRef > &modVec)
#define IsSubSystem(flag)
Definition: EVE_Defines.h:370
#define IsRigSlot(flag)
Definition: EVE_Defines.h:367
uint16 typeID() const
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

float ShipItem::GetShipHullHP ( )
inline

Definition at line 197 of file Ship.h.

References AttrHP, EvilNumber::get_float(), and InventoryItem::GetAttribute().

Referenced by Command_status().

197 { return GetAttribute(AttrHP).get_float(); }
EvilNumber GetAttribute(const uint16 attrID) const
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

Here is the caller graph for this function:

EvilNumber ShipItem::GetShipHullPercent ( )
inline

Definition at line 203 of file Ship.h.

References AttrDamage, AttrHP, and InventoryItem::GetAttribute().

Referenced by Command_status().

203 { return 1 -(GetAttribute(AttrDamage) / GetAttribute(AttrHP)); }
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

PyDict * ShipItem::GetShipInfo ( )

Definition at line 2153 of file Ship.cpp.

References _log, EVEDB::invCategories::Charge, PyRep::Dump(), flagHiSlot7, flagLowSlot0, flagRigSlot0, flagRigSlot2, flagSubSystem0, flagSubSystem4, Inventory::GetItemsByFlagRange(), is_log_enabled, InventoryItem::itemID(), Inventory::LoadContents(), InventoryItem::name(), InventoryItem::pInventory, InventoryItem::Populate(), PyTuple::SetItem(), and PyDict::SetItem().

2154 {
2155  if (!pInventory->LoadContents()) {
2156  _log( INV__ERROR, "%s(%u): Failed to load contents for ShipGetInfo", name(), itemID());
2157  return nullptr;
2158  }
2159 
2160  //first populate the ship...
2161  Rsp_CommonGetInfo_Entry entry;
2162  if (!Populate( entry))
2163  return nullptr;
2164 
2165  PyDict* result = new PyDict();
2166  result->SetItem(new PyInt( itemID()), new PyObject("util.KeyVal", entry.Encode()));
2167 
2168  //get modules and charges
2169  std::vector<InventoryItemRef> equipped;
2173  //encode each one...
2174  for (auto cur : equipped) {
2175  Rsp_CommonGetInfo_Entry entry2;
2176  if (cur->Populate(entry2)) {
2177  if (cur->categoryID() == EVEDB::invCategories::Charge) {
2178  PyTuple* tuple = new PyTuple(3);
2179  tuple->SetItem(0, new PyInt(cur->locationID()));
2180  tuple->SetItem(1, new PyInt(cur->flag()));
2181  tuple->SetItem(2, new PyInt(cur->typeID()));
2182  result->SetItem(tuple, new PyObject("util.KeyVal", entry2.Encode()));
2183  } else {
2184  result->SetItem(new PyInt(cur->itemID()), new PyObject("util.KeyVal", entry2.Encode()));
2185  }
2186  } else {
2187  _log( SHIP__ERROR, "%s(%u): Failed to Populate() %s(%u) for ShipGetInfo", \
2188  name(), itemID(), cur->name(), cur->itemID());
2189  }
2190  }
2191 
2192  if (is_log_enabled(SHIP__INFO)) {
2193  _log(SHIP__INFO, "ShipItem::GetShipInfo() decoded:");
2194  result->Dump(SHIP__INFO, " ");
2195  }
2196  return result;
2197 }
#define _log(type, fmt,...)
Definition: logsys.h:124
Python's dictionary.
Definition: PyRep.h:719
const char * name()
Python tuple.
Definition: PyRep.h:567
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
#define is_log_enabled(type)
Definition: logsys.h:78
Python object.
Definition: PyRep.h:826
Inventory * pInventory
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231
bool Populate(Rsp_CommonGetInfo_Entry &into)
bool LoadContents()
Definition: Inventory.cpp:113
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713
uint32 GetItemsByFlagRange(EVEItemFlags low_flag, EVEItemFlags high_flag, std::vector< InventoryItemRef > &items) const
Definition: Inventory.cpp:502
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

virtual ShipItem* ShipItem::GetShipItem ( )
inlinevirtual

Reimplemented from InventoryItem.

Definition at line 57 of file Ship.h.

57 { return this; }
float ShipItem::GetShipPGLevel ( )
inline

Definition at line 199 of file Ship.h.

References AttrPowerOutput, EvilNumber::get_float(), and InventoryItem::GetAttribute().

Referenced by Command_status().

EvilNumber GetAttribute(const uint16 attrID) const
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

Here is the caller graph for this function:

EvilNumber ShipItem::GetShipPGPercent ( )
inline

Definition at line 205 of file Ship.h.

References AttrPowerLoad, AttrPowerOutput, and InventoryItem::GetAttribute().

Referenced by Command_status().

EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

float ShipItem::GetShipShieldHP ( )
inline

Definition at line 201 of file Ship.h.

References AttrShieldCharge, EvilNumber::get_float(), and InventoryItem::GetAttribute().

Referenced by Command_status().

EvilNumber GetAttribute(const uint16 attrID) const
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

Here is the caller graph for this function:

EvilNumber ShipItem::GetShipShieldPercent ( )
inline

Definition at line 207 of file Ship.h.

References AttrShieldCapacity, AttrShieldCharge, and InventoryItem::GetAttribute().

Referenced by Command_status().

EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

PyDict * ShipItem::GetShipState ( )

Definition at line 2199 of file Ship.cpp.

References _log, Inventory::ContentsLoaded(), flagPilot, InventoryItem::GetItemStatusRow(), ModuleManager::GetModuleListOfRefsAsc(), Inventory::GetSingleItemByFlag(), InventoryItem::itemID(), Inventory::LoadContents(), m_ModuleManager, InventoryItem::name(), InventoryItem::pInventory, and PyDict::SetItem().

2199  {
2200  if (!pInventory->ContentsLoaded()) {
2201  if (!pInventory->LoadContents()) {
2202  _log(INV__ERROR, "%s(%u): Failed to load contents for GetShipState", name(), itemID());
2203  return nullptr;
2204  }
2205  }
2206  // Create new dictionary for shipState:
2207  PyDict *result = new PyDict();
2208  // Create entry for ShipItem itself:
2209  result->SetItem(new PyInt(itemID()), GetItemStatusRow());
2210  // Check for and Create entry for pilot:
2211  InventoryItemRef iRefPilot(nullptr);
2212  if (pInventory->GetSingleItemByFlag(flagPilot, iRefPilot))
2213  result->SetItem(new PyInt(iRefPilot->itemID()), iRefPilot->GetItemStatusRow());
2214 
2215  // Create entries for ALL modules, rigs, and subsystems present on ship:
2216  std::vector<InventoryItemRef> moduleList;
2218  for (auto cur : moduleList)
2219  result->SetItem(new PyInt(cur->itemID()), cur->GetItemStatusRow());
2220 
2221  return result;
2222 }
bool ContentsLoaded() const
Definition: Inventory.h:62
#define _log(type, fmt,...)
Definition: logsys.h:124
Python's dictionary.
Definition: PyRep.h:719
PyPackedRow * GetItemStatusRow() const
const char * name()
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void GetModuleListOfRefsAsc(std::vector< InventoryItemRef > &modVec)
Inventory * pInventory
Python integer.
Definition: PyRep.h:231
bool LoadContents()
Definition: Inventory.cpp:113
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713
uint32 itemID() const
Definition: InventoryItem.h:98
bool GetSingleItemByFlag(EVEItemFlags flag, InventoryItemRef &iRef) const
Definition: Inventory.cpp:489

Here is the call graph for this function:

InventoryItemRef ShipItem::GetTargetRef ( )
inline

Definition at line 152 of file Ship.h.

References m_targetRef.

Referenced by FxProc::ApplyEffects().

152 { return m_targetRef; }
InventoryItemRef m_targetRef
Definition: Ship.h:278

Here is the caller graph for this function:

bool ShipItem::HasLinkedWeapons ( )
inline

Definition at line 245 of file Ship.h.

References m_linkedWeapons.

245 { return (!m_linkedWeapons.empty()); }
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
bool ShipItem::HasModuleManager ( )
inline

Definition at line 79 of file Ship.h.

References m_ModuleManager.

79 { return (m_ModuleManager != nullptr); }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void ShipItem::Heal ( )

Definition at line 458 of file Ship.cpp.

References m_ModuleManager, ModuleManager::RepairModules(), SetShipArmor(), SetShipCapacitorLevel(), SetShipHull(), and SetShipShield().

Referenced by Command_heal(), Command_healtarget(), InitPod(), and Client::ResetAfterPopped().

459 {
460  // Repair Ship, Modules and Recharge Capacitor:
461  SetShipShield(1.0);
463  SetShipArmor(1.0);
464  SetShipHull(1.0);
466 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void SetShipHull(float fraction)
Definition: Ship.cpp:931
void SetShipCapacitorLevel(float fraction)
Definition: Ship.cpp:881
void SetShipArmor(float fraction)
Definition: Ship.cpp:913
void SetShipShield(float fraction)
Definition: Ship.cpp:897

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::HeatDamageCheck ( GenericModule pMod)

Definition at line 1272 of file Ship.cpp.

References AttrHeatAttenuationHi, AttrHeatAttenuationLow, AttrHeatAttenuationMed, AttrHeatHi, AttrHeatLow, AttrHeatMed, DamageModule(), GenericModule::flag(), InventoryItem::flag(), EvilNumber::get_float(), InventoryItem::GetAttribute(), GenericModule::isHighPower(), GenericModule::IsLinked(), GenericModule::isLowPower(), GenericModule::IsMaster(), and GenericModule::isMediumPower().

Referenced by ActiveModule::DoCycle().

1273 {
1274  if (pMod->IsLinked()) // linked slaves will contribute to heat calculation, but not individually.
1275  if (!pMod->IsMaster()) // heat is calculated by master and multiplied by #linked modules
1276  return;
1277 
1278  // check ship's current bank heat to determine chance for pMod to take heat damage.
1279  // damage to other modules based on table above.
1280  float curHeat(0.0f), damChance(0.0f);
1281  if (pMod->isHighPower()) {
1282  curHeat = GetAttribute(AttrHeatHi).get_float();
1284  } else if (pMod->isMediumPower()) {
1285  curHeat = GetAttribute(AttrHeatMed).get_float();
1287  } else if (pMod->isLowPower()) {
1288  curHeat = GetAttribute(AttrHeatLow).get_float();
1290  }
1291 
1292  std::vector<uint32> modVec;
1293  // if this module is grouped, all modules will take same damage.
1294  if (pMod->IsLinked()) {
1295  // not used yet
1296  } else {
1297  // module not linked. continue with default heat damage calc's
1298  // determine position and get adjacent modules
1299  uint8 flag = pMod->flag();
1300 
1301  // determine modules to damage and add to list
1302  uint32 moduleID(0);
1303 
1304  //modVec.push_back(moduleID);
1305  }
1306 
1307  for (auto cur : modVec)
1308  DamageModule(cur);
1309 }
bool isHighPower()
Definition: GenericModule.h:92
unsigned __int8 uint8
Definition: eve-compat.h:46
void DamageModule(uint32 modID, float amt=1)
Definition: Ship.h:166
bool isMediumPower()
Definition: GenericModule.h:93
bool isLowPower()
Definition: GenericModule.h:91
unsigned __int32 uint32
Definition: eve-compat.h:50
EVEItemFlags flag() const
EVEItemFlags flag()
EvilNumber GetAttribute(const uint16 attrID) const
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::Init ( )

Definition at line 150 of file Ship.cpp.

References EVEDB::invGroups::Capsule, InventoryItem::groupID(), InitAttribs(), ModuleManager::Initialize(), InitPod(), LoadWeaponGroups(), m_isActive, m_ModuleManager, sConfig, and UpdateMass().

Referenced by SetPlayer().

151 {
152  // pods have 57 attribs and 0 effects
154  InitPod();
155  return;
156  }
157 
158  InitAttribs();
159 
160  m_isActive = true;
161 
163 
164  // load linked weapons (if available)
166 
167  if (sConfig.server.CargoMassAdditive)
168  UpdateMass();
169 }
#define sConfig
A macro for easier access to the singleton.
void UpdateMass()
Definition: Ship.cpp:389
void InitAttribs()
Definition: Ship.cpp:191
void LoadWeaponGroups()
Definition: Ship.cpp:1745
uint16 groupID() const
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void InitPod()
Definition: Ship.cpp:171
bool m_isActive
Definition: Ship.h:285

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::InitAttribs ( )

Definition at line 191 of file Ship.cpp.

References AttrArmorDamage, AttrArmorMaxDamageResonance, AttrCapacitorCapacity, AttrCapacitorCharge, AttrCpuLoad, AttrDamage, AttrEmDamageResonance, AttrExplosiveDamageResonance, AttrHullEmDamageResonance, AttrHullExplosiveDamageResonance, AttrHullKineticDamageResonance, AttrHullThermalDamageResonance, AttrKineticDamageResonance, AttrMass, AttrMaximumRangeCap, AttrOnline, AttrPowerLoad, AttrShieldCapacity, AttrShieldCharge, AttrShieldMaxDamageResonance, AttrThermalDamageResonance, AttrUpgradeLoad, AttrVolume, AttrWarpScrambleStatus, AttrWarpSpeedMultiplier, BUBBLE_RADIUS_METERS, EvilOne, EvilZero, InventoryItem::GetAttribute(), InventoryItem::GetPackagedVolume(), InventoryItem::HasAttribute(), InventoryItem::SetAttribute(), and InventoryItem::type().

Referenced by Init().

192 {
193  // Create default dynamic attributes in the AttributeMap
196  SetAttribute(AttrMass, type().mass());
199  // rig shit
201 
202  // Check for existence of attributes. if not loaded then set them to default values:
205  // shield and cap are part of persistance, and loaded on attrib map initalization. check for and set to full if no saved value found
209  // Warp Scramble Status of the ship (most ships have zero warp scramble status, but some (t2 indy) already have it defined):
214  // hull res is stored in item type as AttrHull*Resonance for 6 ships. set accordingly
219 
220  // ship bonuses....are these set in ship fx?
221  /*
222  AttrMaxRangeBonus = 351,
223  AttrDroneRangeBonus = 459,
224  AttrExplosionRangeBonus = 558,
225  AttrMaxRangeBonus2 = 769,
226 
227  */
228 
229  // cap ships have bonuses to various systems....these may be set in ship fx
230  /*
231  AttrSurveyScannerRangeBonus = 1234,
232  AttrCargoScannerRangeBonus = 1235,
233  AttrCommandBonusEffective = 1236,
234  AttrCommandBonusAdd = 1237,
235  AttrCommandBonusEffectiveAdd = 1238,
236  AttrShipBonusORECapital1 = 1239,
237  AttrShipBonusORECapital2 = 1240,
238  AttrShipBonusORECapital3 = 1243,
239  AttrShipBonusORECapital4 = 1244,
240 
241  AttrEliteBonusHeavyInterdictors1 = 1246,
242  AttrEliteBonusHeavyInterdictors2 = 1247,
243  AttrEliteBonusElectronicAttackShip1 = 1249,
244  AttrEliteBonusElectronicAttackShip2 = 1250,
245  AttrEliteBonusViolators1 = 1265,
246  AttrEliteBonusViolators2 = 1266,
247  AttrEliteBonusJumpFreighter1 = 1311,
248  AttrEliteBonusJumpFreighter2 = 1312,
249  AttrMaxTargetRangeBonusBonus = 1313,
250  AttrScanResolutionBonusBonus = 1314,
251  AttrMaxRangeBonusBonus = 1315,
252  AttrTrackingSpeedBonusBonus = 1316,
253  AttrEliteBonusViolatorsRole1 = 1268,
254  AttrEliteBonusViolatorsRole2 = 1269,
255  AttrWarpScrambleRangeBonus = 1327,
256  AttrDroneBandwidthMultiplier = 1328,
257  AttrDroneBandwidthBonusAdd = 1329,
258  AttrShipOrcaTractorBeamRangeBonus1 = 1355,
259  AttrShipOrcaCargoBonusOrca1 = 1356,
260  AttrShipOrcaTractorBeamVelocityBonus2 = 1357,
261  AttrShipOrcaForemanBonus = 1358,
262  AttrShipOrcaSurveyScannerBonus = 1359,
263  AttrShipBonusHPExtender1 = 1360,
264  AttrEliteIndustrialCovertCloakBonus = 1361,
265 
266  AttrShipBonusOreIndustrial1 = 1669,
267  AttrShipBonusOreIndustrial2 = 1670,
268 
269  AttrtitanAmarrBonus5 = 1592,
270  AttrtitanGallenteBonus5 = 1593,
271  AttrtitanMinmatarBonus5 = 1594,
272  AttrtitanCaldariBonus5 = 1596,
273 
274  */
275 
276  // t3 ships
277  /*
278  AttrSubsystemBonusAmarrEngineering = 1431,
279  AttrSubsystemBonusAmarrElectronic = 1432,
280  AttrSubsystemBonusAmarrDefensive = 1433,
281  AttrSubsystemBonusAmarrOffensive = 1434,
282  AttrSubsystemBonusAmarrPropulsion = 1435,
283  AttrSubsystemBonusGallenteEngineering = 1436,
284  AttrSubsystemBonusGallenteElectronic = 1437,
285  AttrSubsystemBonusGallenteDefensive = 1438,
286  AttrSubsystemBonusGallenteOffensive = 1439,
287  AttrSubsystemBonusGallentePropulsion = 1440,
288  AttrSubsystemBonusCaldariEngineering = 1441,
289  AttrSubsystemBonusCaldariElectronic = 1442,
290  AttrSubsystemBonusCaldariDefensive = 1443,
291  AttrSubsystemBonusCaldariOffensive = 1444,
292  AttrSubsystemBonusCaldariPropulsion = 1445,
293  AttrSubsystemBonusMinmatarEngineering = 1446,
294  AttrSubsystemBonusMinmatarElectronic = 1447,
295  AttrSubsystemBonusMinmatarDefensive = 1448,
296  AttrSubsystemBonusMinmatarOffensive = 1449,
297  AttrSubsystemBonusMinmatarPropulsion = 1450,
298 
299  AttrShipBonusStrategicCruiserAmarr = 1503,
300  AttrShipBonusStrategicCruiserCaldari = 1504,
301  AttrShipBonusStrategicCruiserGallente = 1505,
302  AttrShipBonusStrategicCruiserMinmatar = 1506,
303 
304  AttrSubsystemBonusAmarrDefensive2 = 1507,
305  AttrSubsystemBonusAmarrElectronic2 = 1508,
306  AttrSubsystemBonusAmarrEngineering2 = 1509,
307  AttrSubsystemBonusCaldariOffensive2 = 1510,
308  AttrSubsystemBonusAmarrOffensive2 = 1511,
309  AttrSubsystemBonusAmarrPropulsion2 = 1512,
310  AttrSubsystemBonusCaldariPropulsion2 = 1513,
311  AttrSubsystemBonusCaldariElectronic2 = 1514,
312  AttrSubsystemBonusCaldariEngineering2 = 1515,
313  AttrSubsystemBonusCaldariDefensive2 = 1516,
314  AttrSubsystemBonusGallenteDefensive2 = 1517,
315  AttrSubsystemBonusGallenteElectronic2 = 1518,
316  AttrSubsystemBonusGallenteEngineering2 = 1519,
317  AttrSubsystemBonusGallentePropulsion2 = 1520,
318  AttrSubsystemBonusGallenteOffensive2 = 1521,
319  AttrSubsystemBonusMinmatarOffensive2 = 1522,
320  AttrSubsystemBonusMinmatarPropulsion2 = 1523,
321  AttrSubsystemBonusMinmatarElectronic2 = 1524,
322  AttrSubsystemBonusMinmatarEngineering2 = 1525,
323  AttrSubsystemBonusMinmatarDefensive2 = 1526,
324 
325  AttrSubsystemBonusAmarrOffensive3 = 1531,
326  AttrSubsystemBonusGallenteOffensive3 = 1532,
327  AttrSubsystemBonusCaldariOffensive3 = 1533,
328  AttrSubsystemBonusMinmatarOffensive3 = 1534,
329  */
330 }
bool HasAttribute(const uint16 attrID) const
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
const ItemType & type() const
double GetPackagedVolume()
void SetAttribute(uint16 attrID, int num, bool notify=true)
EvilNumber GetAttribute(const uint16 attrID) const
EvilNumber EvilOne
Definition: EvilNumber.cpp:34
static const float BUBBLE_RADIUS_METERS
Definition: BubbleManager.h:32

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::InitPod ( )

Definition at line 171 of file Ship.cpp.

References AttrArmorDamage, AttrCpuLoad, AttrDamage, AttrOnline, AttrPowerLoad, AttrShieldCapacity, AttrShieldCharge, AttrVolume, EvilOne, EvilZero, InventoryItem::GetAttribute(), InventoryItem::GetPackagedVolume(), InventoryItem::HasAttribute(), Heal(), ModuleManager::Initialize(), Client::IsInSpace(), m_ModuleManager, m_pilot, and InventoryItem::SetAttribute().

Referenced by Init().

171  {
176 
177  // Check for existence of attributes. if not loaded then set them to default values:
180  // shield and cap are part of persistance, and loaded on attrib map initalization. check for and set to full if no saved value found
182 
184 
185  // pod will always be full when activated
186  if (m_pilot != nullptr)
187  if (m_pilot->IsInSpace())
188  Heal();
189 }
bool HasAttribute(const uint16 attrID) const
bool IsInSpace()
Definition: Client.h:228
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
ModuleManager * m_ModuleManager
Definition: Ship.h:276
double GetPackagedVolume()
void Heal()
Definition: Ship.cpp:458
Client * m_pilot
Definition: Ship.h:273
void SetAttribute(uint16 attrID, int num, bool notify=true)
EvilNumber GetAttribute(const uint16 attrID) const
EvilNumber EvilOne
Definition: EvilNumber.cpp:34

Here is the call graph for this function:

Here is the caller graph for this function:

bool ShipItem::IsActive ( )
inline

Definition at line 147 of file Ship.h.

References m_isActive.

Referenced by RepairService::GetDamageReports().

147 { return m_isActive; }
bool m_isActive
Definition: Ship.h:285

Here is the caller graph for this function:

bool ShipItem::IsDocking ( )
inline

Definition at line 148 of file Ship.h.

References m_isDocking.

148 { return m_isDocking; }
bool m_isDocking
Definition: Ship.h:287
bool ShipItem::IsPopped ( )
inline

Definition at line 89 of file Ship.h.

References m_isPopped.

Referenced by ModuleManager::CharacterLeavingShip(), and GenericModule::Offline().

89 { return m_isPopped; }
bool m_isPopped
Definition: Ship.h:286

Here is the caller graph for this function:

virtual bool ShipItem::IsShipItem ( )
inlinevirtual

Reimplemented from InventoryItem.

Definition at line 59 of file Ship.h.

59 { return true; }
bool ShipItem::IsUndocking ( )
inline

Definition at line 149 of file Ship.h.

References m_isUndocking.

Referenced by GenericModule::Offline(), and GenericModule::Online().

149 { return m_isUndocking; }
bool m_isUndocking
Definition: Ship.h:288

Here is the caller graph for this function:

void ShipItem::Jump ( )

Definition at line 405 of file Ship.cpp.

References m_ModuleManager, and ModuleManager::ShipJumping().

Referenced by ShipSE::Jump().

405  {
407 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::LinkAllWeapons ( )

Definition at line 1416 of file Ship.cpp.

References _log, ModuleManager::GetWeapons(), is_log_enabled, LinkWeaponLoop(), m_linkedWeapons, m_ModuleManager, SaveWeaponGroups(), sConfig, sDataMgr, and ModuleManager::UnloadCharge().

1417 {
1418  std::list< GenericModule* > weaponList;
1419  m_ModuleManager->GetWeapons(weaponList);
1420 
1421  // remove current links
1422  for (auto cur : weaponList) {
1423  if (sConfig.server.UnloadOnLinkAll)
1425  cur->SetLinked(false);
1426  cur->SetLinkMaster(false);
1427  }
1428  m_linkedWeapons.clear();
1429 
1430  LinkWeaponLoop(weaponList);
1431 
1432  // remove empty masters from map
1433  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.begin();
1434  while (itr != m_linkedWeapons.end()) {
1435  if (itr->second.empty()) {
1436  if (is_log_enabled(MODULE__INFO))
1437  _log(MODULE__INFO, "ShipItem::LinkAllWeapons() - %s(%s) has empty link list. Removing.", \
1438  itr->first->GetSelf()->name(), sDataMgr.GetFlagName(itr->first->flag()));
1439  itr = m_linkedWeapons.erase(itr);
1440  } else {
1441  ++itr;
1442  }
1443  }
1444 
1445  SaveWeaponGroups();
1446 }
#define sConfig
A macro for easier access to the singleton.
#define _log(type, fmt,...)
Definition: logsys.h:124
void SaveWeaponGroups()
Definition: Ship.cpp:1733
void GetWeapons(std::list< GenericModule * > &weaponList)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
#define is_log_enabled(type)
Definition: logsys.h:78
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
void LinkWeaponLoop(std::list< GenericModule * > &moduleVec)
Definition: Ship.cpp:1448
void UnloadCharge(GenericModule *pMod)
#define sDataMgr

Here is the call graph for this function:

void ShipItem::LinkWeapon ( uint32  masterID,
uint32  slaveID 
)

Definition at line 1365 of file Ship.cpp.

References ModuleManager::GetModule(), m_ModuleManager, and SaveWeaponGroups().

Referenced by LinkWeaponLoop(), and UnlinkWeapon().

1366 {
1367  if (masterID == slaveID)
1368  return;
1369  GenericModule* pMod1 = m_ModuleManager->GetModule(masterID);
1370  GenericModule* pMod2 = m_ModuleManager->GetModule(slaveID);
1371  LinkWeapon(pMod1, pMod2);
1372 
1373  SaveWeaponGroups();
1374 }
void SaveWeaponGroups()
Definition: Ship.cpp:1733
ModuleManager * m_ModuleManager
Definition: Ship.h:276
GenericModule * GetModule(EVEItemFlags flag)
void LinkWeapon(uint32 masterID, uint32 slaveID)
Definition: Ship.cpp:1365

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::LinkWeapon ( GenericModule pMaster,
GenericModule pSlave 
)
protected

Definition at line 1376 of file Ship.cpp.

References GenericModule::IsActive(), GenericModule::IsDamaged(), GenericModule::IsLoaded(), GenericModule::IsLoading(), GenericModule::isOnline(), m_linkedWeapons, GenericModule::SetLinked(), and GenericModule::SetLinkMaster().

1377 {
1378  if ((pMaster == nullptr) or (pSlave == nullptr))
1379  return; // make error here?
1380  if (pMaster == pSlave)
1381  return; // make error here?
1382  if ((pMaster->IsLoaded()) or (pSlave->IsLoaded()))
1383  throw UserError ("CantLinkAmmoInWeapon");
1384  if ((pMaster->IsActive()) or (pSlave->IsActive()))
1385  throw UserError ("CantLinkModuleActive");
1386  if ((pMaster->IsDamaged()) or (pSlave->IsDamaged()))
1387  throw UserError ("CantLinkModuleDamaged");
1388  if ((pMaster->IsLoading()) or (pSlave->IsLoading()))
1389  throw UserError ("CantLinkModuleLoading");
1390  if ((!pMaster->isOnline()) or (!pSlave->isOnline()))
1391  throw UserError ("CantLinkModuleNotOnline");
1392 
1393  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.find(pMaster);
1394  if (itr == m_linkedWeapons.end()) {
1395  std::list<GenericModule*> slaves;
1396  slaves.push_back(pSlave);
1397  m_linkedWeapons[pMaster] = slaves;
1398  pMaster->SetLinked(true);
1399  pMaster->SetLinkMaster(true);
1400  } else {
1401  itr->second.push_back(pSlave);
1402  }
1403  pSlave->SetLinked(true);
1404 }
bool IsDamaged()
Definition: GenericModule.h:85
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
bool IsLoading()
Definition: GenericModule.h:87
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
void SetLinkMaster(bool set=false)
void SetLinked(bool set=false)

Here is the call graph for this function:

void ShipItem::LinkWeaponLoop ( std::list< GenericModule * > &  moduleVec)
protected

Definition at line 1448 of file Ship.cpp.

References _log, GenericModule::flag(), GetTimeUSeconds(), is_log_enabled, item(), GenericModule::itemID(), LinkWeapon(), m_linkedWeapons, m_pilot, sDataMgr, Client::SendErrorMsg(), and GenericModule::typeID().

Referenced by LinkAllWeapons().

1449 {
1450  double start = GetTimeUSeconds();
1451  GenericModule* master(nullptr);
1452  std::list< GenericModule*>::iterator itr = weaponList.begin();
1453  while (itr != weaponList.end()) {
1454  if ((*itr)->IsLoaded() or (*itr)->IsLoading()) {
1455  if (is_log_enabled(MODULE__INFO))
1456  _log(MODULE__INFO, "ShipItem::LinkWeaponLoop() - %s(%s-%u) IsLoaded. Skipping.", \
1457  (*itr)->GetSelf()->name(), sDataMgr.GetFlagName((*itr)->flag()), (*itr)->itemID());
1458  m_pilot->SendErrorMsg("You cannot group the %s while loaded with %s", (*itr)->GetSelf()->name(), (*itr)->GetLoadedChargeRef()->name());
1459  itr = weaponList.erase(itr);
1460  } else if (master == nullptr) {
1461  // lets check if this module will match a master already in list before making new master...
1462  bool match(false);
1463  for (auto item : m_linkedWeapons)
1464  if (item.first->typeID() == (*itr)->typeID()) {
1465  //master = item.first;
1466  if (is_log_enabled(MODULE__INFO))
1467  _log(MODULE__INFO, "ShipItem::LinkWeaponLoop() -(null master) %s(%s-%u) matches list master %s(%s-%u). Adding.", \
1468  (*itr)->GetSelf()->name(), sDataMgr.GetFlagName((*itr)->flag()), (*itr)->itemID(), \
1469  item.first->GetSelf()->name(), sDataMgr.GetFlagName(item.first->flag()), item.first->itemID());
1470  LinkWeapon(item.first, (*itr));
1471  itr = weaponList.erase(itr);
1472  match = true;
1473  break;
1474  }
1475  if (match)
1476  continue;
1477  // didnt match, or list empty. make new master.
1478  master = (*itr);
1479  if (is_log_enabled(MODULE__INFO))
1480  _log(MODULE__INFO, "ShipItem::LinkWeaponLoop() - Setting %s(%s-%u) to master.",\
1481  (*itr)->GetSelf()->name(), sDataMgr.GetFlagName((*itr)->flag()), (*itr)->itemID());
1482  // set blank list for this master.
1483  std::list<GenericModule*> slaves;
1484  m_linkedWeapons[master] = slaves;
1485  itr = weaponList.erase(itr);
1486  } else {
1487  if (master->typeID() == (*itr)->typeID()) { // this item can be slave
1488  if (is_log_enabled(MODULE__INFO))
1489  _log(MODULE__INFO, "ShipItem::LinkWeaponLoop() - %s(%s-%u) matches master %s(%s-%u). Adding.", \
1490  (*itr)->GetSelf()->name(), sDataMgr.GetFlagName((*itr)->flag()), (*itr)->itemID(), \
1491  master->GetSelf()->name(), sDataMgr.GetFlagName(master->flag()), master->itemID());
1492  LinkWeapon(master, (*itr));
1493  itr = weaponList.erase(itr);
1494  } else {
1495  for (auto item : m_linkedWeapons)
1496  if (item.first->typeID() == (*itr)->typeID()) {
1497  //master = item.first;
1498  if (is_log_enabled(MODULE__INFO))
1499  _log(MODULE__INFO, "ShipItem::LinkWeaponLoop() - %s(%s-%u) matches list master %s(%s-%u). Adding.", \
1500  (*itr)->GetSelf()->name(), sDataMgr.GetFlagName((*itr)->flag()), (*itr)->itemID(), \
1501  item.first->GetSelf()->name(), sDataMgr.GetFlagName(item.first->flag()), item.first->itemID());
1502  LinkWeapon(item.first, (*itr));
1503  itr = weaponList.erase(itr);
1504  break;
1505  }
1506  master = nullptr;
1507  }
1508  }
1509  }
1510  if (is_log_enabled(MODULE__INFO))
1511  _log(MODULE__INFO, "ShipItem::LinkWeaponLoop() - Completed loop in %.3fus.", GetTimeUSeconds() - start);
1512 }
void SendErrorMsg(const char *fmt,...)
Definition: Client.cpp:2719
#define _log(type, fmt,...)
Definition: logsys.h:124
itemID[count] Create count or of the specified item(from Insider)" ) COMMAND( goto
#define is_log_enabled(type)
Definition: logsys.h:78
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
double GetTimeUSeconds()
Definition: utils_time.cpp:116
Client * m_pilot
Definition: Ship.h:273
void LinkWeapon(uint32 masterID, uint32 slaveID)
Definition: Ship.cpp:1365
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

ShipItemRef ShipItem::Load ( uint32  shipID)
static

Definition at line 46 of file Ship.cpp.

Referenced by Spawn().

47 {
48  return InventoryItem::Load<ShipItem>( shipID);
49 }

Here is the caller graph for this function:

void ShipItem::LoadCharge ( InventoryItemRef  cRef,
EVEItemFlags  flag 
)

Definition at line 601 of file Ship.cpp.

References _log, UserError::AddFormatValue(), InventoryItem::flag(), RefPtr< X >::get(), ModuleManager::GetModule(), IsFittingSlot, ModuleManager::LoadCharge(), Module::State::Loading, m_ModuleManager, m_pilot, InventoryItem::name(), sDataMgr, InventoryItem::typeID(), and VerifyHoldType().

Referenced by LoadChargesToBank().

602 {
603  if (cRef.get() == nullptr)
604  throw UserError ("CantFindChargeToAdd");
605 
606  if (!IsFittingSlot(flag))
607  throw CustomError ("Destination is not weapon.");
608 
609  if (IsFittingSlot(cRef->flag())) {
610  _log(MODULE__TRACE, "ShipItem::LoadCharge - Trying to load %s from %s to %s.", \
611  cRef->name(), sDataMgr.GetFlagName(cRef->flag()), sDataMgr.GetFlagName(flag));
612  throw UserError ("CantMoveChargesBetweenModules");
613  }
614 
616  if (pMod == nullptr)
617  throw UserError ("ModuleNoLongerPresentForCharges");
618 
619  if (pMod->IsActive()) {
620  throw CustomError ("You cannot load active modules.");
621  /*
622  std::map<std::string, PyRep *> args;
623  args["chargeType"] = new PyInt(iRef->typeID());
624  throw PyException( MakeUserError("LoadingChargeSlotAlready", args)); */
625  /*LoadingChargeSlotAlreadyBody'}(u'You cannot load the {[item]chargeType.name} because the module is already involved in another loading operation.'
626  * , None, {u'{[item]chargeType.name}': {'conditionalValues': [], 'variableType': 2, 'propertyName': 'name', 'args': 0, 'kwargs': {}, 'variableName': 'chargeType'}})
627  */
628  }
629  if (pMod->GetModuleState() == Module::State::Loading) {
630  throw UserError ("LoadingChargeSlotAlready")
631  .AddFormatValue ("chargeType", new PyInt (cRef->typeID ()));
632  //throw PyException( MakeUserError("LoadingChargeAlready", args));
633  /*LoadingChargeAlreadyBody'}(u'Some or all of {[item]chargeType.name} is already being loaded into a module.
634  * If you wish to load what remains, you will have to wait until this is finished.',
635  * None, {u'{[item]chargeType.name}': {'conditionalValues': [], 'variableType': 2, 'propertyName': 'name', 'args': 0, 'kwargs': {}, 'variableName': 'chargeType'}})
636  */
637  }
638 
639  VerifyHoldType(flag, cRef, m_pilot);
640  /* this doesnt work right....comment for now.
641  std::map<std::string, PyRep *> args;
642  args["charge"] = new PyInt(iRef->itemID());
643  throw UserError ("ChargeLoadingFailedWithRefund");
644  */
645  /* ChargeLoadingFailedWithRefundBody'}(u'Your {[item]charge.name} failed to load and was returned to your cargo.',
646  * None, {u'{[item]charge.name}': {'conditionalValues': [], 'variableType': 2, 'propertyName': 'name', 'args': 0, 'kwargs': {}, 'variableName': 'charge'}})
647  */
649 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void VerifyHoldType(EVEItemFlags flag, InventoryItemRef iRef, Client *pClient=nullptr)
Definition: Ship.cpp:1972
UserError & AddFormatValue(const char *name, PyRep *value)
Fluent version of the protected AddKeyword, allows for adding a keyword to the exception.
const char * name()
Advanced version of UserError that allows to send a full custom message.
Definition: PyExceptions.h:453
ModuleManager * m_ModuleManager
Definition: Ship.h:276
GenericModule * GetModule(EVEItemFlags flag)
Client * m_pilot
Definition: Ship.h:273
Python integer.
Definition: PyRep.h:231
X * get() const
Definition: RefPtr.h:213
#define IsFittingSlot(flag)
Definition: EVE_Defines.h:355
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
EVEItemFlags flag() const
void LoadCharge(InventoryItemRef chargeRef, EVEItemFlags flag)
uint16 typeID() const
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::LoadChargesToBank ( EVEItemFlags  flag,
std::vector< int32 > &  chargeIDs 
)

Definition at line 661 of file Ship.cpp.

References InventoryItem::flag(), RefPtr< X >::get(), ModuleManager::GetModulesInBank(), IsCargoHoldFlag, IsHangarFlag, LoadCharge(), m_ModuleManager, and sItemFactory.

662 {
663  int8 pos = 0;
664  InventoryItemRef cRef(nullptr);
665  std::vector<GenericModule*> modVec;
667  for (auto cur : modVec) {
668  if (pos + 1 > chargeIDs.size())
669  return;
670  cRef = sItemFactory.GetItem(chargeIDs[pos]);
671  if (cRef.get() == nullptr) {
672  ++pos;
673  continue;
674  }
675  if (IsCargoHoldFlag(cRef->flag()) or IsHangarFlag(cRef->flag())) {
676  LoadCharge(cRef, cur->flag());
677  } else {
678  ++pos;
679  }
680  }
681 }
signed __int8 int8
Definition: eve-compat.h:45
void GetModulesInBank(EVEItemFlags flag, std::vector< GenericModule * > &modVec)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
EVEItemFlags flag() const
#define IsCargoHoldFlag(flag)
Definition: EVE_Defines.h:336
#define IsHangarFlag(flag)
Definition: EVE_Defines.h:344
#define sItemFactory
Definition: ItemFactory.h:165
void LoadCharge(InventoryItemRef cRef, EVEItemFlags flag)
Definition: Ship.cpp:601

Here is the call graph for this function:

void ShipItem::LoadLinkedWeapons ( GenericModule pMod,
std::vector< int32 > &  chargeIDs 
)

Definition at line 684 of file Ship.cpp.

References GenericModule::flag(), IsCargoHoldFlag, IsHangarFlag, ModuleManager::LoadCharge(), m_linkedWeapons, m_ModuleManager, m_pilot, sItemFactory, and VerifyHoldType().

685 {
686  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.find(pMod);
687  if (itr == m_linkedWeapons.end())
688  return;
689 
690  int8 pos = 0;
691  InventoryItemRef cRef(sItemFactory.GetItem(chargeIDs[pos]));
692  if (cRef.get() == nullptr)
693  throw UserError ("CantFindChargeToAdd");
694 
695  int8 size(chargeIDs.size());
696  //load charge in master
697  VerifyHoldType(pMod->flag(), cRef, m_pilot);
698  m_ModuleManager->LoadCharge(cRef, pMod->flag());
699  // loop thru slaves and load charge(s)
700  std::list<GenericModule*>::iterator itr2 = itr->second.begin();
701  while ((itr2 != itr->second.end()) and (pos <= size)) {
702  cRef = sItemFactory.GetItem(chargeIDs[pos]);
703  if (cRef.get() == nullptr){
704  ++pos;
705  } else if (IsCargoHoldFlag(cRef->flag()) or IsHangarFlag(cRef->flag())) {
706  VerifyHoldType((*itr2)->flag(), cRef, m_pilot);
707  m_ModuleManager->LoadCharge(cRef, (*itr2)->flag());
708  ++itr2;
709  } else {
710  ++pos;
711  }
712  }
713 }
void VerifyHoldType(EVEItemFlags flag, InventoryItemRef iRef, Client *pClient=nullptr)
Definition: Ship.cpp:1972
signed __int8 int8
Definition: eve-compat.h:45
ModuleManager * m_ModuleManager
Definition: Ship.h:276
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
Client * m_pilot
Definition: Ship.h:273
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
EVEItemFlags flag()
#define IsCargoHoldFlag(flag)
Definition: EVE_Defines.h:336
void LoadCharge(InventoryItemRef chargeRef, EVEItemFlags flag)
#define IsHangarFlag(flag)
Definition: EVE_Defines.h:344
#define sItemFactory
Definition: ItemFactory.h:165

Here is the call graph for this function:

void ShipItem::LoadWeaponGroups ( )
protected

Definition at line 1745 of file Ship.cpp.

References DBResultRow::GetInt(), ModuleManager::GetModule(), DBQueryResult::GetRow(), ShipDB::LoadWeaponGroups(), InventoryItem::m_itemID, m_linkedWeapons, m_ModuleManager, m_pilot, SafeDelete(), Client::SendErrorMsg(), GenericModule::SetLinked(), GenericModule::SetLinkMaster(), and UnlinkAllWeapons().

Referenced by Init().

1746 {
1747  // NOTE: there probably isnt a pilot at this point, so no sending of errors on load.
1748  if (m_ModuleManager == nullptr) {
1749  if (m_pilot != nullptr)
1750  m_pilot->SendErrorMsg("There was an error loading your weapon groups. Ref: ServerError 06071");
1751  return;
1752  }
1753  DBQueryResult* res = new DBQueryResult();
1755 
1756  bool error(false);
1757  GenericModule* pMaster(nullptr);
1758  GenericModule* pSlave(nullptr);
1759  DBResultRow row;
1760  // this is gonna be slow as shit...i dont like this, but best way to do it.
1761  while (res->GetRow(row)) {
1762  //SELECT masterID, slaveID FROM shipWeaponGroups
1763  pMaster = m_ModuleManager->GetModule(row.GetInt(0));
1764  pSlave = m_ModuleManager->GetModule(row.GetInt(1));
1765  if ((pMaster == nullptr) or (pSlave == nullptr)) {
1766  error = true;
1767  continue;
1768  }
1769  //LinkWeapon(pMaster, pSlave); <<<--- this will throw. DO NOT use here.
1770  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.find(pMaster);
1771  if (itr == m_linkedWeapons.end()) {
1772  std::list<GenericModule*> slaves;
1773  slaves.push_back(pSlave);
1774  m_linkedWeapons[pMaster] = slaves;
1775  } else {
1776  itr->second.push_back(pSlave);
1777  }
1778  pMaster->SetLinked(true);
1779  pMaster->SetLinkMaster(true);
1780  pSlave->SetLinked(true);
1781  }
1782 
1783  if (error) {
1784  UnlinkAllWeapons();
1785  if (m_pilot != nullptr)
1786  m_pilot->SendErrorMsg("There was an error loading a weapon group master. Ref: ServerError 06123");
1787  }
1788 
1789  SafeDelete(res);
1790 }
void SendErrorMsg(const char *fmt,...)
Definition: Client.cpp:2719
int32 GetInt(uint32 index) const
Definition: dbcore.cpp:635
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
ModuleManager * m_ModuleManager
Definition: Ship.h:276
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
GenericModule * GetModule(EVEItemFlags flag)
Client * m_pilot
Definition: Ship.h:273
static void LoadWeaponGroups(uint32 shipID, DBQueryResult &res)
Definition: ShipDB.cpp:98
void UnlinkAllWeapons()
Definition: Ship.cpp:1651

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::LogOut ( )

Definition at line 84 of file Ship.cpp.

References AttrOnline, EvilZero, InventoryItem::locationID(), InventoryItem::m_itemID, InventoryItem::pInventory, Inventory::RemoveItem(), SaveShip(), sDataMgr, InventoryItem::SetAttribute(), sItemFactory, and Inventory::Unload().

Referenced by SystemManager::UnloadSystem(), and Client::~Client().

85 {
87  SaveShip();
88 
89  pInventory->Unload();
90 
91  // remove ship item from factory master list here, as *something* changes ship position when saving from factory.
92  sItemFactory.RemoveItem(m_itemID);
93 
94  // remove ship item from its' container's inventory list also.
95  Inventory* pInv(nullptr);
96  if (sDataMgr.IsStation(locationID())) {
97  pInv = sItemFactory.GetStationItem(locationID())->GetMyInventory();
98  } else {
99  pInv = sItemFactory.GetSolarSystem(locationID())->GetMyInventory();
100  }
101 
102  if (pInv != nullptr)
103  pInv->RemoveItem(ShipItemRef(this));
104 }
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
void Unload()
Definition: Inventory.cpp:62
Inventory * pInventory
uint32 locationID() const
void SetAttribute(uint16 attrID, int num, bool notify=true)
RefPtr< ShipItem > ShipItemRef
Definition: ItemRef.h:54
#define sItemFactory
Definition: ItemFactory.h:165
void SaveShip()
Definition: Ship.cpp:1060
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::MergeModuleGroups ( uint32  masterID,
uint32  slaveID 
)

Definition at line 1406 of file Ship.cpp.

References _log, InventoryItem::itemID(), and InventoryItem::name().

1407 {
1408  _log(MODULE__ERROR, "MergeModuleGroups() called by %s(%u). It still needs to be written.", name(), itemID());
1409 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const char * name()
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

PyRep* ShipItem::ModuleRepair ( uint32  modID)
inline

Definition at line 155 of file Ship.h.

References m_ModuleManager, and ModuleManager::ModuleRepair().

155 { return m_ModuleManager->ModuleRepair(modID); }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
PyRep * ModuleRepair(uint32 modID)

Here is the call graph for this function:

void ShipItem::MoveModuleSlot ( EVEItemFlags  slot1,
EVEItemFlags  slot2 
)

Definition at line 818 of file Ship.cpp.

References _log, AddItemByFlag(), AttrOnline, RefPtr< X >::get(), EvilNumber::get_bool(), InventoryItem::GetAttribute(), ModuleManager::GetLoadedChargeOnModule(), GetModule(), GetModuleRef(), GenericModule::GetSelf(), GenericModule::IsActive(), ModuleManager::IsSlotOccupied(), ModuleManager::LoadCharge(), m_ModuleManager, InventoryItem::name(), ModuleManager::Online(), RemoveItem(), and ModuleManager::VerifySlotExchange().

Referenced by InventoryBound::MoveItems().

818  {
819  // this will never hit. client checks before call.
820  if (!m_ModuleManager->VerifySlotExchange(slot1, slot2))
821  throw CustomError ("Those locations are not compatible.");
822 
823  // test for active module(s) before moving
824  GenericModule* pMod(GetModule(slot1));
825  if (pMod->IsActive())
826  throw CustomError ("Your %s is currently active. You must wait for the cycle to complete before it can be removed.", pMod->GetSelf()->name());
827 
828  pMod = GetModule(slot2);
829  if (pMod != nullptr)
830  if (pMod->IsActive())
831  throw CustomError ("Your %s is currently active. You must wait for the cycle to complete before it can be removed.", pMod->GetSelf()->name());
832 
833  // slot1 is occupied, as this is where module is from.
834  InventoryItemRef modItemRef1(GetModuleRef(slot1));
835  if (modItemRef1.get() == nullptr) {
836  _log(MODULE__TRACE, "ShipItem::MoveModuleSlot - modItemRef1 is null.");
837  throw CustomError ("The module to move was not found.");
838  }
840  RemoveItem(modItemRef1);
841 
842  if (m_ModuleManager->IsSlotOccupied(slot2)) {
843  // dropped-on slot is occupied. proceed with moving the module currently in this slot.
844  InventoryItemRef modItemRef2 = GetModuleRef(slot2);
846  RemoveItem(modItemRef2);
847  AddItemByFlag(slot1, modItemRef2);
848  if (modItemRef2->GetAttribute(AttrOnline).get_bool())
849  m_ModuleManager->Online(slot1);
850  if (chargeItemRef2.get() != nullptr)
851  m_ModuleManager->LoadCharge(chargeItemRef2, slot1);
852  }
853 
854  AddItemByFlag(slot2, modItemRef1);
855  if (modItemRef1->GetAttribute(AttrOnline).get_bool())
856  m_ModuleManager->Online(slot2);
857 
858  if (chargeItemRef1.get() != nullptr)
859  m_ModuleManager->LoadCharge(chargeItemRef1, slot2);
860 }
#define _log(type, fmt,...)
Definition: logsys.h:124
InventoryItemRef GetLoadedChargeOnModule(EVEItemFlags flag)
bool get_bool()
Definition: EvilNumber.cpp:157
Advanced version of UserError that allows to send a full custom message.
Definition: PyExceptions.h:453
ModuleManager * m_ModuleManager
Definition: Ship.h:276
bool VerifySlotExchange(EVEItemFlags slot1, EVEItemFlags slot2)
X * get() const
Definition: RefPtr.h:213
InventoryItemRef GetModuleRef(EVEItemFlags flag)
Definition: Ship.cpp:582
GenericModule * GetModule(EVEItemFlags flag)
Definition: Ship.h:173
EvilNumber GetAttribute(const uint16 attrID) const
void LoadCharge(InventoryItemRef chargeRef, EVEItemFlags flag)
virtual void RemoveItem(InventoryItemRef iRef)
Definition: Ship.cpp:532
void Online(uint32 itemID)
uint32 AddItemByFlag(EVEItemFlags flag, InventoryItemRef iRef, Client *pClient=nullptr)
Definition: Ship.cpp:486
bool IsSlotOccupied(EVEItemFlags flag)

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::Offline ( uint32  modID)

Definition at line 1034 of file Ship.cpp.

References m_ModuleManager, and ModuleManager::Offline().

1035 {
1036  m_ModuleManager->Offline(modID);
1037 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void Offline(uint32 itemID)

Here is the call graph for this function:

void ShipItem::OfflineAll ( )

Definition at line 1055 of file Ship.cpp.

References m_ModuleManager, and ModuleManager::OfflineAll().

1056 {
1058 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276

Here is the call graph for this function:

void ShipItem::OfflineGroup ( GenericModule pMod)

Definition at line 1711 of file Ship.cpp.

References GenericModule::IsMaster(), and m_linkedWeapons.

1712 {
1713  if (pMod->IsMaster()) {
1714  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.find(pMod);
1715  if (itr != m_linkedWeapons.end())
1716  for (auto cur : itr->second)
1717  cur->Offline();
1718  } else {
1719  // this module isnt master... loop thru all links to see if we can find it
1720  for (auto cur : m_linkedWeapons) {
1721  std::list<GenericModule*>::iterator itr = cur.second.begin();
1722  while (itr != cur.second.end()) {
1723  if ((*itr) == pMod) {
1724  OfflineGroup(cur.first);
1725  return;
1726  }
1727  ++itr;
1728  }
1729  }
1730  }
1731 }
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
void OfflineGroup(GenericModule *pMod)
Definition: Ship.cpp:1711

Here is the call graph for this function:

void ShipItem::Online ( uint32  modID)

Definition at line 999 of file Ship.cpp.

References InventoryItem::locationID(), m_ModuleManager, ModuleManager::Online(), and sDataMgr.

1000 {
1001  if (sDataMgr.IsSolarSystem(locationID())) {
1002  ; // check for avalible cap, and drain accordingly (this can throw)
1003  /*
1004  float Charge = GetAttribute(AttrCapacitorCharge).get_float();
1005  float Capacity = GetAttribute(AttrCapacitorCapacity).get_float();
1006  float newCharge = 0;
1007  SetAttribute(AttrCapacitorCharge, newCharge);
1008  _log(SHIP__MESSAGE, "ShipItem::Online(): %s(%u) - New Cap Charge: %f", GetPilot()->GetName(), itemID(), newCharge);
1009  */
1010  }
1011  /* {'messageKey': 'EffectAlreadyActive2', 'dataID': 17876243, 'suppressable': False, 'bodyID': 256802, 'messageType': 'hint', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 3252}
1012  * {'messageKey': 'EffectCantHaveNegativeDuration', 'dataID': 17883801, 'suppressable': False, 'bodyID': 259632, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 847}
1013  * {'messageKey': 'EffectCrowdedOut', 'dataID': 17883719, 'suppressable': False, 'bodyID': 259602, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 848}
1014  * {'messageKey': 'EffectDeactivationCloaking', 'dataID': 17883455, 'suppressable': False, 'bodyID': 259510, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 849}
1015  * {'messageKey': 'EffectDeactivationWarping', 'dataID': 17883458, 'suppressable': False, 'bodyID': 259511, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 850}
1016  * {'messageKey': 'EffectNotActivatible', 'dataID': 17880378, 'suppressable': False, 'bodyID': 258369, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 2228}
1017  * {'messageKey': 'EffectNotDeactivatible', 'dataID': 17883847, 'suppressable': False, 'bodyID': 259649, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 851}
1018  * {'messageKey': 'EffectStillActivating', 'dataID': 17883850, 'suppressable': False, 'bodyID': 259650, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 852}
1019  * {'messageKey': 'EffectStillActive', 'dataID': 17883853, 'suppressable': False, 'bodyID': 259651, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 853}
1020  */
1021  /*{'FullPath': u'UI/Messages', 'messageID': 256802, 'label': u'EffectAlreadyActive2Body'}(u'{modulename} is already active', None, {u'{modulename}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'modulename'}})
1022  * {'FullPath': u'UI/Messages', 'messageID': 258369, 'label': u'EffectNotActivatibleBody'}(u'You do not have the ability to engage the {moduleName} in that action.', None, {u'{moduleName}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'moduleName'}})
1023  * {'FullPath': u'UI/Messages', 'messageID': 259510, 'label': u'EffectDeactivationCloakingBody'}(u'As certain activated effects interfere with the warping process, these are automatically being deactivated before the warp proceeds.', None, None)
1024  * {'FullPath': u'UI/Messages', 'messageID': 259511, 'label': u'EffectDeactivationWarpingBody'}(u'As certain activated effects interfere with the warping process, these are automatically being deactivated before the warp proceeds.', None, None)
1025  * {'FullPath': u'UI/Messages', 'messageID': 259602, 'label': u'EffectCrowdedOutBody'}(u'The {[item]module.name} cannot be activated as it requires access to resources and/or skills which {[numeric]count} modules of the same purpose are already using up.', None, {u'{[numeric]count}': {'conditionalValues': [], 'variableType': 9, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'count'}, u'{[item]module.name}': {'conditionalValues': [], 'variableType': 2, 'propertyName': 'name', 'args': 0, 'kwargs': {}, 'variableName': 'module'}})
1026  * {'FullPath': u'UI/Messages', 'messageID': 259632, 'label': u'EffectCantHaveNegativeDurationBody'}(u'{modulename} has somehow come to have a negative duration of {duration} and cannot operate. If you know how, obtain a breakdown of its modifiers and report it, otherwise submit a detailed bug report.', None, {u'{modulename}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'modulename'}, u'{duration}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'duration'}})
1027  * {'FullPath': u'UI/Messages', 'messageID': 259649, 'label': u'EffectNotDeactivatibleBody'}(u'The {moduleName} cannot be interrupted in that action.', None, {u'{moduleName}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'moduleName'}})
1028  * {'FullPath': u'UI/Messages', 'messageID': 259650, 'label': u'EffectStillActivatingBody'}(u'The {moduleName} cannot be manually deactivated while it is still being activated.', None, {u'{moduleName}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'moduleName'}})
1029  * {'FullPath': u'UI/Messages', 'messageID': 259651, 'label': u'EffectStillActiveBody'}(u'The {[item]moduleTypeID.name} cannot be manually deactivated in the middle of an operation, it will deactivate without repeating in {[timeinterval]timeLeft.writtenForm, from=second, to=second} (its activation duration is {[timeinterval]duration.writtenForm, from=second, to=second}).', None, {u'{[timeinterval]timeLeft.writtenForm, from=second, to=second}': {'conditionalValues': [], 'variableType': 8, 'propertyName': 'writtenForm', 'args': 0, 'kwargs': {'to': 'second', 'from': 'second'}, 'variableName': 'timeLeft'}, u'{[timeinterval]duration.writtenForm, from=second, to=second}': {'conditionalValues': [], 'variableType': 8, 'propertyName': 'writtenForm', 'args': 0, 'kwargs': {'to': 'second', 'from': 'second'}, 'variableName': 'duration'}, u'{[item]moduleTypeID.name}': {'conditionalValues': [], 'variableType': 2, 'propertyName': 'name', 'args': 0, 'kwargs': {}, 'variableName': 'moduleTypeID'}})
1030  */
1031  m_ModuleManager->Online(modID);
1032 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
uint32 locationID() const
void Online(uint32 itemID)
#define sDataMgr

Here is the call graph for this function:

void ShipItem::OnlineAll ( )

Definition at line 1050 of file Ship.cpp.

References m_ModuleManager, and ModuleManager::OnlineAll().

1051 {
1053 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276

Here is the call graph for this function:

void ShipItem::Overload ( uint32  itemID)
inline

Definition at line 124 of file Ship.h.

References m_ModuleManager, and ModuleManager::Overload().

ModuleManager * m_ModuleManager
Definition: Ship.h:276
void Overload(uint32 itemID)
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void ShipItem::PeelAndLink ( uint32  masterID,
uint32  slaveID 
)

Definition at line 1411 of file Ship.cpp.

References _log, InventoryItem::itemID(), and InventoryItem::name().

1412 {
1413  _log(MODULE__ERROR, "PeelAndLink() called by %s(%u). It still needs to be written.", name(), itemID());
1414 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const char * name()
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void ShipItem::PrepForUndock ( )

Definition at line 1895 of file Ship.cpp.

References m_ModuleManager, ModuleManager::OfflineAll(), and ProcessEffects().

1895  {
1896  // "Offline" modules (see notes in GM::Online and GM::Offline
1898  // clear fx maps before undock
1899  ProcessEffects();
1900 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void ProcessEffects(bool add=false, bool update=false)
Definition: Ship.cpp:1794

Here is the call graph for this function:

void ShipItem::ProcessEffects ( bool  add = false,
bool  update = false 
)

Definition at line 1794 of file Ship.cpp.

References _log, InventoryItem::ClearModifiers(), ClearModuleModifiers(), Client::GetChar(), ModuleManager::GetLoadedCharges(), ModuleManager::GetModuleListOfRefsAsc(), GetTimeMSeconds(), m_ModuleManager, m_pilot, InventoryItem::pAttributeMap, Character::ProcessEffects(), ProcessShipEffects(), InventoryItem::ResetAttributes(), Character::ResetModifiers(), and AttributeMap::SaveShipState().

Referenced by Dock(), PrepForUndock(), ResetEffects(), and SetPlayer().

1795 {
1796  _log(EFFECTS__TRACE, "ShipItem::ProcessEffects()");
1797  double start = GetTimeMSeconds();
1798  /*
1799  Effects processing order...
1800  Skills //char effect
1801  Implants //char effect
1802  Boosters //char effect
1803  Ship //ship effect
1804  Subsystem //module effect
1805  Rigs //module effect
1806  Low //module effect
1807  Mid //module effect
1808  Hi //module effect
1809  */
1810  if (add) {
1811  m_pilot->GetChar()->ProcessEffects(this);
1812  ProcessShipEffects(update);
1813  } else {
1814  ClearModifiers();
1815  pAttributeMap->SaveShipState(); // save ship damage as it's removed on next call
1816  ResetAttributes();
1819  std::vector< InventoryItemRef > modVec;
1821  for (auto cur : modVec)
1822  cur->ResetAttributes();
1823  std::map<EVEItemFlags, InventoryItemRef> charges;
1825  for (auto cur : charges)
1826  cur.second->ResetAttributes();
1827 
1828  // do we remove fx here? nah, we've reset everything at this point.
1829  }
1830 
1831  _log(EFFECTS__DEBUG, "ShipItem::ProcessEffects() - effects processed and applied in %.3fms", (GetTimeMSeconds() - start));
1832 }
void SaveShipState()
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef GetChar() const
Definition: Client.h:164
void GetLoadedCharges(std::map< EVEItemFlags, InventoryItemRef > &charges)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void GetModuleListOfRefsAsc(std::vector< InventoryItemRef > &modVec)
double GetTimeMSeconds()
Definition: utils_time.cpp:104
Client * m_pilot
Definition: Ship.h:273
void ProcessEffects(ShipItem *pShip)
Definition: Character.cpp:498
void ProcessShipEffects(bool update=false)
Definition: Ship.cpp:1834
void ResetModifiers()
Definition: Character.cpp:485
void ClearModuleModifiers()
Definition: Ship.cpp:1858
AttributeMap * pAttributeMap

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::ProcessHeat ( )

Definition at line 1130 of file Ship.cpp.

References _log, AttrHeatHi, AttrHeatLow, DissipateHeat(), GenerateHeat(), EvilNumber::get_float(), InventoryItem::GetAttribute(), GetTimeUSeconds(), and InventoryItem::SetAttribute().

Referenced by ShipSE::Process().

1131 {
1132  double start = GetTimeUSeconds();
1133  float heat(0.0f);
1134  // heat loop
1135  for (uint16 i = AttrHeatHi; i < AttrHeatLow + 1; ++i) {
1136  heat = GetAttribute(i).get_float();
1137  // the ordering here is important
1138  //heat -= log(-(heat + 1));
1139  if (heat > 1.0f)
1140  heat -= DissipateHeat(i, heat);
1141  heat += GenerateHeat(i);
1142  if (heat > 1.0f) { // not concerned about anything < 1
1143  if (heat > 100)
1144  heat = 100.0f;
1145  SetAttribute(i, heat);
1146  } //else
1147  // DeleteAttribute(i);
1148  heat = 0.0f;
1149  }
1150  _log(SHIP__HEAT, "ShipItem::ProcessHeat() Executed in %.3f us.", GetTimeUSeconds() - start);
1151 
1152  /* proc times with 3 banks of 8 modules each (from 0 - 3 modules actived)
1153 13:05:44 [ShipHeat] ShipItem::ProcessHeat() Executed in 867.000 us.
1154 13:05:50 [ShipHeat] ShipItem::ProcessHeat() Executed in 1205.000 us.
1155 13:05:56 [ShipHeat] ShipItem::ProcessHeat() Executed in 1051.500 us.
1156 13:06:02 [ShipHeat] ShipItem::ProcessHeat() Executed in 1665.750 us.
1157 13:06:08 [ShipHeat] ShipItem::ProcessHeat() Executed in 1108.500 us.
1158 13:06:14 [ShipHeat] ShipItem::ProcessHeat() Executed in 1090.250 us.
1159 13:06:20 [ShipHeat] ShipItem::ProcessHeat() Executed in 1011.250 us.
1160 13:06:26 [ShipHeat] ShipItem::ProcessHeat() Executed in 938.500 us.
1161  */
1162 }
#define _log(type, fmt,...)
Definition: logsys.h:124
double GetTimeUSeconds()
Definition: utils_time.cpp:116
float DissipateHeat(uint16 attrID, float heat)
Definition: Ship.cpp:1214
void SetAttribute(uint16 attrID, int num, bool notify=true)
float GenerateHeat(uint16 attrID)
Definition: Ship.cpp:1164
EvilNumber GetAttribute(const uint16 attrID) const
float get_float()
Definition: EvilNumber.cpp:184
unsigned __int16 uint16
Definition: eve-compat.h:48

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::ProcessModules ( )

Definition at line 343 of file Ship.cpp.

References Client::IsDocked(), m_ModuleManager, m_pilot, and ModuleManager::Process().

Referenced by ShipSE::Process().

343  {
344  if (m_pilot->IsDocked())
345  return;
346 
348 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
Client * m_pilot
Definition: Ship.h:273
bool IsDocked()
Definition: Client.h:229

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::ProcessShipEffects ( bool  update = false)
private

Definition at line 1834 of file Ship.cpp.

References _log, fxData::action, RefPtr< X >::get(), Client::GetChar(), FX::Action::Invalid, ModuleManager::LoadOnline(), m_isUndocking, m_ModuleManager, m_onlineModuleVec, m_pilot, sFxDataMgr, sFxProc, fxData::srcRef, InventoryItem::type(), and ModuleManager::UpdateModules().

Referenced by ProcessEffects().

1835 {
1836  _log(EFFECTS__TRACE, "ShipItem::ProcessShipEffects()");
1837  for (auto it : type().m_stateFxMap) {
1838  fxData data = fxData();
1839  data.action = FX::Action::Invalid;
1840  data.srcRef = static_cast<InventoryItemRef>(this);
1841  sFxProc.ParseExpression(this, sFxDataMgr.GetExpression(it.second.preExpression), data);
1842  }
1843  // apply processed ship effects
1844  sFxProc.ApplyEffects(this, m_pilot->GetChar().get(), this, update);
1845  //ClearModifiers();
1846 
1847  if (m_isUndocking) {
1848  // online modules sent from client (these are onlined in fit window while docked)
1850  m_onlineModuleVec.clear();
1851  //FailedToOnlineModulesOnUndock
1852  } else {
1853  // this will set module to last saved online state in the case of BoardShip() and Login()
1855  }
1856 }
#define _log(type, fmt,...)
Definition: logsys.h:124
std::vector< uint32 > m_onlineModuleVec
Definition: Ship.h:280
InventoryItemRef srcRef
Definition: EffectsData.h:78
CharacterRef GetChar() const
Definition: Client.h:164
ModuleManager * m_ModuleManager
Definition: Ship.h:276
const ItemType & type() const
void UpdateModules(std::vector< uint32 > modVec)
Client * m_pilot
Definition: Ship.h:273
#define sFxDataMgr
X * get() const
Definition: RefPtr.h:213
uint8 action
Definition: EffectsData.h:73
#define sFxProc
bool m_isUndocking
Definition: Ship.h:288

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::RemoveCharge ( EVEItemFlags  fromFlag)

Definition at line 718 of file Ship.cpp.

References ModuleManager::GetModule(), IsFittingSlot, m_ModuleManager, sDataMgr, and ModuleManager::UnloadCharge().

719 {
720  if (IsFittingSlot(fromFlag)) {
721  GenericModule* pMod(m_ModuleManager->GetModule(fromFlag));
722  if (pMod == nullptr)
723  throw CustomError ("Module was not found at %s.", sDataMgr.GetFlagName(fromFlag));
724 
725  if (pMod->IsActive())
726  throw UserError ("CannotAccessChargeWhileInUse");
727 
728  if (!pMod->IsLoaded())
729  throw CustomError ("Your %s is not loaded.", pMod->GetSelf()->name());
730 
732  }
733 }
Advanced version of UserError that allows to send a full custom message.
Definition: PyExceptions.h:453
ModuleManager * m_ModuleManager
Definition: Ship.h:276
GenericModule * GetModule(EVEItemFlags flag)
#define IsFittingSlot(flag)
Definition: EVE_Defines.h:355
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
void UnloadCharge(GenericModule *pMod)
#define sDataMgr

Here is the call graph for this function:

void ShipItem::RemoveItem ( InventoryItemRef  iRef)
virtual

Reimplemented from InventoryItem.

Definition at line 532 of file Ship.cpp.

References AttrMass, InventoryItem::categoryID(), EVEDB::invCategories::Charge, InventoryItem::flag(), RefPtr< X >::get(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), HasPilot(), IsModuleSlot, IsRigSlot, InventoryItem::itemID(), m_ModuleManager, m_pilot, ItemType::mass(), InventoryItem::quantity(), InventoryItem::RemoveItem(), sConfig, InventoryItem::SetAttribute(), InventoryItem::type(), ModuleManager::UnfitModule(), ModuleManager::UninstallRig(), and ModuleManager::UnloadModule().

Referenced by TurretModule::ApplyDamage(), Colony::CreatePin(), InventoryBound::MoveItems(), MoveModuleSlot(), and MiningLaser::ProcessCycle().

533 {
534  if (iRef.get() == nullptr)
535  return;
536 
538 
539  if (m_pilot == nullptr)
540  return;
541 
542  // check to see if item is currently in a module slot.
543  if (IsModuleSlot(iRef->flag())) {
544  if (IsRigSlot(iRef->flag())) {
546  } else if (iRef->categoryID() == EVEDB::invCategories::Charge) {
548  } else {
550  }
551  //m_ModuleManager->UpdateModules(iRef->flag());
552  }
553 
554  // remove item mass to ship's mass if set in options (additive...loaded ship should be heavy)
555  if (sConfig.server.CargoMassAdditive) {
557  uint32 addition = iRef->type().mass() * iRef->quantity();
558  SetAttribute(AttrMass, mass - addition, HasPilot());
559  }
560 }
#define sConfig
A macro for easier access to the singleton.
virtual void RemoveItem(InventoryItemRef iRef)
void UnfitModule(uint32 itemID)
void UnloadModule(uint32 itemID)
virtual bool HasPilot()
Definition: Ship.h:71
void UninstallRig(uint32 itemID)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
const ItemType & type() const
Client * m_pilot
Definition: Ship.h:273
uint32 get_uint32()
Definition: EvilNumber.cpp:173
float mass() const
Definition: ItemType.h:69
void SetAttribute(uint16 attrID, int num, bool notify=true)
X * get() const
Definition: RefPtr.h:213
unsigned __int32 uint32
Definition: eve-compat.h:50
EVEItemFlags flag() const
#define IsModuleSlot(flag)
Definition: EVE_Defines.h:350
EvilNumber GetAttribute(const uint16 attrID) const
#define IsRigSlot(flag)
Definition: EVE_Defines.h:367
uint8 categoryID() const
uint32 itemID() const
Definition: InventoryItem.h:98
int32 quantity() const
Definition: InventoryItem.h:97

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::RemoveRig ( InventoryItemRef  iRef)

Definition at line 1067 of file Ship.cpp.

References flagCargoHold, RefPtr< X >::get(), InventoryItem::itemID(), m_ModuleManager, InventoryItem::Move(), and ModuleManager::UninstallRig().

1067  {
1068  if (iRef.get() == nullptr)
1069  return;
1071  iRef->Move(itemID(), flagCargoHold, true);
1072 }
void UninstallRig(uint32 itemID)
void Move(uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
X * get() const
Definition: RefPtr.h:213
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void ShipItem::RepairModules ( std::vector< InventoryItemRef > &  itemRefVec,
float  fraction 
)
Todo:
this isnt right....needs update

Definition at line 981 of file Ship.cpp.

References AttrDamage, AttrHP, Profile::damage, EvilZero, m_ModuleManager, and ModuleManager::RepairModule().

Referenced by Command_repairmodules().

982 {
985  for (auto cur : itemRefVec) {
986  damage = cur->GetAttribute(AttrDamage);
987  if (damage < 0.01)
988  continue;
989  amount = cur->GetAttribute(AttrDamage);
990  if ((amount / cur->GetAttribute(AttrHP)) > fraction) {
991  amount = cur->GetAttribute(AttrHP) * fraction;
992  } else {
993  amount = 1;
994  }
995  m_ModuleManager->RepairModule(cur->itemID(), amount);
996  }
997 }
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void RepairModule(uint32 itemID, EvilNumber amount)

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::RepairModules ( )
inline

Definition at line 144 of file Ship.h.

References m_ModuleManager, and ModuleManager::RepairModules().

ModuleManager * m_ModuleManager
Definition: Ship.h:276

Here is the call graph for this function:

void ShipItem::RepairShip ( float  fraction)

Definition at line 950 of file Ship.cpp.

References AttrArmorDamage, AttrDamage, Profile::damage, EvilZero, InventoryItem::GetAttribute(), and InventoryItem::SetAttribute().

951 {
952  if (fraction > 1)
953  fraction = 1;
954 
955  if (fraction == 1) {
958  return;
959  }
960 
961  uint32 cHull(GetAttribute(AttrDamage).get_uint32());
962  uint32 cArmor(GetAttribute(AttrArmorDamage).get_uint32());
963  uint32 damage(cHull + cArmor);
964  EvilNumber amount(damage * fraction);
965  // this will repair hull first, then armor
966  if (amount > cHull) {
967  amount -= cHull;
969  if (amount >= cArmor) {
971  } else {
972  amount = cArmor - amount;
973  SetAttribute(AttrArmorDamage, amount);
974  }
975  } else {
976  SetAttribute(AttrDamage, amount);
977  }
978 }
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
void SetAttribute(uint16 attrID, int num, bool notify=true)
unsigned __int32 uint32
Definition: eve-compat.h:50
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

void ShipItem::ReplaceCharges ( EVEItemFlags  flag,
InventoryItemRef  newCharge 
)

Definition at line 1074 of file Ship.cpp.

References _log, InventoryItem::itemID(), and InventoryItem::name().

1075 {
1076  _log(MODULE__ERROR, "ReplaceCharges() called by %s(%u). It still needs to be written.", name(), itemID());
1077 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const char * name()
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void ShipItem::ResetEffects ( )

Definition at line 1872 of file Ship.cpp.

References _log, Client::GetChar(), ModuleManager::GetLoadedCharges(), ModuleManager::GetModuleListOfRefsAsc(), GetTimeMSeconds(), m_ModuleManager, m_pilot, ModuleManager::OfflineAll(), InventoryItem::pAttributeMap, ProcessEffects(), InventoryItem::ResetAttributes(), Character::ResetModifiers(), and AttributeMap::SaveShipState().

Referenced by Undock().

1872  {
1873  _log(EFFECTS__TRACE, "ShipItem::ResetEffects()");
1874  double start = GetTimeMSeconds();
1875 
1877 
1878  // reset attributes on char, ship, all modules and charges
1879  pAttributeMap->SaveShipState(); // save ship damage as it's removed on next call
1880  ResetAttributes();
1882  std::vector< InventoryItemRef > modVec;
1884  for (auto cur : modVec)
1885  cur->ResetAttributes();
1886  std::map<EVEItemFlags, InventoryItemRef> charges;
1888  for (auto cur : charges)
1889  cur.second->ResetAttributes();
1890 
1891  ProcessEffects(true, true/*sDataMgr.IsSolarSystem(locationID())*/);
1892  _log(EFFECTS__DEBUG, "ShipItem::ResetEffects() - Effects reset in %.3fms", (GetTimeMSeconds() - start));
1893 }
void SaveShipState()
#define _log(type, fmt,...)
Definition: logsys.h:124
CharacterRef GetChar() const
Definition: Client.h:164
void GetLoadedCharges(std::map< EVEItemFlags, InventoryItemRef > &charges)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void GetModuleListOfRefsAsc(std::vector< InventoryItemRef > &modVec)
double GetTimeMSeconds()
Definition: utils_time.cpp:104
Client * m_pilot
Definition: Ship.h:273
void ProcessEffects(bool add=false, bool update=false)
Definition: Ship.cpp:1794
void ResetModifiers()
Definition: Character.cpp:485
AttributeMap * pAttributeMap

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::SaveShip ( )

Definition at line 1060 of file Ship.cpp.

References m_ModuleManager, InventoryItem::pAttributeMap, InventoryItem::SaveItem(), ModuleManager::SaveModules(), and AttributeMap::SaveShipState().

Referenced by Client::BoardShip(), Eject(), LogOut(), Client::MoveToLocation(), Client::ResetAfterPodded(), and ShipSE::SaveShip().

1061 {
1062  SaveItem(); // Save ship info
1063  pAttributeMap->SaveShipState(); // save ship damage
1064  m_ModuleManager->SaveModules(); // Save item info for modules fitted to this ship
1065 }
void SaveShipState()
ModuleManager * m_ModuleManager
Definition: Ship.h:276
AttributeMap * pAttributeMap

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::SaveWeaponGroups ( )
protected

Definition at line 1733 of file Ship.cpp.

References InventoryItem::m_itemID, m_linkedWeapons, and ShipDB::SaveWeaponGroups().

Referenced by LinkAllWeapons(), LinkWeapon(), and UnlinkGroup().

1734 {
1735  std::multimap< uint32, uint32 > data;
1736  data.clear();
1737  if (!m_linkedWeapons.empty())
1738  for (auto cur : m_linkedWeapons)
1739  for (auto slave : cur.second)
1740  data.emplace(cur.first->itemID(), slave->itemID());
1741 
1743 }
static void SaveWeaponGroups(uint32 shipID, std::multimap< uint32, uint32 > &data)
Definition: ShipDB.cpp:103
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::SetDocked ( )
inline

Definition at line 150 of file Ship.h.

References m_isDocking.

Referenced by Client::DockToStation().

150 { m_isDocking = false; }
bool m_isDocking
Definition: Ship.h:287

Here is the caller graph for this function:

void ShipItem::SetPlayer ( Client pClient)
virtual

Reimplemented from InventoryItem.

Definition at line 106 of file Ship.cpp.

References AttrOnline, EvilZero, flagNone, Client::GetChar(), Init(), Client::IsCharCreation(), InventoryItem::locationID(), m_isActive, m_onlineModuleVec, m_pilot, InventoryItem::pInventory, ProcessEffects(), Inventory::RemoveItem(), sDataMgr, InventoryItem::SetAttribute(), and InventoryItem::SetFlag().

Referenced by Client::Eject(), Client::SelectCharacter(), and Client::SetShip().

106  {
107  if (m_pilot == pClient)
108  return;
109  if (pClient == nullptr) {
111  if (m_pilot != nullptr)
113  // remove ship effects and char skill effects for char leaving ship.
114  ProcessEffects(false);
115  // should we check for cargo and damage after char leaves ship? maybe later
116  m_onlineModuleVec.clear();
117  m_pilot = nullptr;
118  m_isActive = false;
119  return;
120  }
121 
122  m_pilot = pClient;
123  if (pClient->IsCharCreation())
124  return;
125 
126  Init();
127 
128  // proc effects when changing ships, or on login.
129  ProcessEffects(true, sDataMgr.IsSolarSystem(locationID()));
130 
131  // this hits on login and when boarding ship in space. will not hit on Undock() (location is still station at this point of execution)
132  if (sDataMgr.IsSolarSystem(locationID())) {
133  SetFlag(flagNone);
134  /* not sure if we're gonna keep this in here....
135  if (pClient->IsLogin()) {
136  if (sConfig.debug.IsTestServer) {
137  // Heal Ship completely on test server
138  Heal();
139  } else {
140  // live server will Recharge shields and cap if session change isnt active
141  if (!m_pilot->IsSessionChange()) {
142  SetShipShield(1.0);
143  SetShipCapacitorLevel(1.0);
144  }
145  }
146  } */
147  }
148 }
bool IsCharCreation()
Definition: Client.h:433
bool SetFlag(EVEItemFlags flag, bool notify=false)
void Init()
Definition: Ship.cpp:150
std::vector< uint32 > m_onlineModuleVec
Definition: Ship.h:280
void RemoveItem(InventoryItemRef iRef)
Definition: Inventory.cpp:243
CharacterRef GetChar() const
Definition: Client.h:164
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
Client * m_pilot
Definition: Ship.h:273
void ProcessEffects(bool add=false, bool update=false)
Definition: Ship.cpp:1794
Inventory * pInventory
uint32 locationID() const
void SetAttribute(uint16 attrID, int num, bool notify=true)
bool m_isActive
Definition: Ship.h:285
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::SetPopped ( bool  set = false)
inline

Definition at line 90 of file Ship.h.

References m_isPopped.

Referenced by ShipSE::Killed().

90 { m_isPopped = set; }
bool m_isPopped
Definition: Ship.h:286

Here is the caller graph for this function:

void ShipItem::SetShipArmor ( float  fraction)

Definition at line 913 of file Ship.cpp.

References _log, AttrArmorDamage, AttrArmorHP, EvilZero, EvilNumber::get_float(), InventoryItem::GetAttribute(), and InventoryItem::SetAttribute().

Referenced by Heal().

914 {
915  fraction = 1 - fraction;
916 
917  if (fraction > 1.0) fraction = 1.0;
918  if (fraction < 0.0) fraction = 0.0;
919 
920  EvilNumber newArmorDamage(EvilZero);
921  newArmorDamage = GetAttribute(AttrArmorHP) * fraction;
922  if ((newArmorDamage + 0.2f) > GetAttribute(AttrArmorHP).get_float())
923  newArmorDamage = GetAttribute(AttrArmorHP);
924  if ((newArmorDamage - 0.2f) < 0)
925  newArmorDamage = 0;
926 
927  _log(SHIP__MESSAGE, "SetShipArmor() to %.1f%%. new value is %.1f", fraction, newArmorDamage.get_float());
928  SetAttribute(AttrArmorDamage, newArmorDamage);
929 }
#define _log(type, fmt,...)
Definition: logsys.h:124
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
void SetAttribute(uint16 attrID, int num, bool notify=true)
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::SetShipCapacitorLevel ( float  fraction)

Definition at line 881 of file Ship.cpp.

References _log, AttrCapacitorCapacity, AttrCapacitorCharge, EvilZero, EvilNumber::get_float(), InventoryItem::GetAttribute(), and InventoryItem::SetAttribute().

Referenced by Heal(), Client::SelectCharacter(), and Undock().

882 {
883  if (fraction > 1.0) fraction = 1.0;
884  if (fraction < 0.0) fraction = 0.0;
885 
886  EvilNumber newCapacitorCharge(EvilZero);
887  newCapacitorCharge = GetAttribute(AttrCapacitorCapacity) * fraction;
888  if ((newCapacitorCharge + 0.5f) > GetAttribute(AttrCapacitorCapacity).get_float())
889  newCapacitorCharge = GetAttribute(AttrCapacitorCapacity);
890  if ((newCapacitorCharge - 0.5f) < 0)
891  newCapacitorCharge = 0;
892 
893  _log(SHIP__MESSAGE, "SetShipCapacitorLevel() to %.1f%%. new value is %.1f", fraction, newCapacitorCharge.get_float());
894  SetAttribute(AttrCapacitorCharge, newCapacitorCharge);
895 }
#define _log(type, fmt,...)
Definition: logsys.h:124
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
void SetAttribute(uint16 attrID, int num, bool notify=true)
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::SetShipHull ( float  fraction)

Definition at line 931 of file Ship.cpp.

References _log, AttrDamage, AttrHP, EvilZero, EvilNumber::get_float(), InventoryItem::GetAttribute(), and InventoryItem::SetAttribute().

Referenced by Heal().

932 {
933  fraction = 1 - fraction;
934 
935  if (fraction > 1.0) fraction = 1.0;
936  if (fraction < 0.0) fraction = 0.0;
937 
938  EvilNumber newHullDamage(EvilZero);
939  newHullDamage = GetAttribute(AttrHP) * fraction;
940  if ((newHullDamage + 0.2f) > GetAttribute(AttrHP).get_float())
941  newHullDamage = GetAttribute(AttrHP);
942  if ((newHullDamage - 0.2f) < 0)
943  newHullDamage = 0;
944 
945  _log(SHIP__MESSAGE, "SetShipHull() to %.1f%%. new value is %.1f", fraction, newHullDamage.get_float());
946  SetAttribute(AttrDamage, newHullDamage);
947 }
#define _log(type, fmt,...)
Definition: logsys.h:124
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
void SetAttribute(uint16 attrID, int num, bool notify=true)
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::SetShipShield ( float  fraction)

Definition at line 897 of file Ship.cpp.

References _log, AttrShieldCapacity, AttrShieldCharge, EvilZero, EvilNumber::get_float(), InventoryItem::GetAttribute(), and InventoryItem::SetAttribute().

Referenced by Heal(), Client::SelectCharacter(), and Undock().

898 {
899  if (fraction > 1.0) fraction = 1.0;
900  if (fraction < 0.0) fraction = 0.0;
901 
902  EvilNumber newShieldCharge(EvilZero);
903  newShieldCharge = GetAttribute(AttrShieldCapacity) * fraction;
904  if ((newShieldCharge + 0.2f) > GetAttribute(AttrShieldCapacity).get_float())
905  newShieldCharge = GetAttribute(AttrShieldCapacity);
906  if ((newShieldCharge - 0.2f) < 0)
907  newShieldCharge = 0;
908 
909  _log(SHIP__MESSAGE, "SetShipShield() to %.1f%%. new value is %.1f", fraction, newShieldCharge.get_float());
910  SetAttribute(AttrShieldCharge, newShieldCharge);
911 }
#define _log(type, fmt,...)
Definition: logsys.h:124
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
void SetAttribute(uint16 attrID, int num, bool notify=true)
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::SetUndocking ( bool  set = false)
inline

Definition at line 151 of file Ship.h.

References m_isUndocking.

Referenced by DestinyManager::Undock(), and Client::UndockFromStation().

151 { m_isUndocking = set; }
bool m_isUndocking
Definition: Ship.h:288

Here is the caller graph for this function:

PyList * ShipItem::ShipGetModuleList ( )

Definition at line 2247 of file Ship.cpp.

References _log, PyList::AddItem(), ModuleManager::GetModuleListOfRefsAsc(), InventoryItem::itemID(), Inventory::LoadContents(), m_ModuleManager, InventoryItem::name(), InventoryItem::pInventory, and PyTuple::SetItem().

Referenced by DestinyManager::UpdateNewShip().

2247  {
2248  if (!pInventory->LoadContents()) {
2249  _log(INV__ERROR, "%s(%u): Failed to load contents for ShipGetModuleList", name(), itemID());
2250  return nullptr;
2251  }
2252 
2253  PyList* result = new PyList();
2254  // Create entries in "onslimitemchange" modules list for ALL modules, rigs, and subsystems present on ship:
2255  std::vector<InventoryItemRef> moduleList;
2257  for (auto cur : moduleList) {
2258  PyTuple* module = new PyTuple(2);
2259  module->SetItem(0, new PyInt(cur->typeID()));
2260  module->SetItem(1, new PyInt(cur->itemID()));
2261  result->AddItem(module);
2262  }
2263 
2264  return result;
2265 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const char * name()
Python tuple.
Definition: PyRep.h:567
void AddItem(PyRep *i)
Definition: PyRep.h:701
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void GetModuleListOfRefsAsc(std::vector< InventoryItemRef > &modVec)
Inventory * pInventory
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231
bool LoadContents()
Definition: Inventory.cpp:113
Python list.
Definition: PyRep.h:639
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

ShipItemRef ShipItem::Spawn ( ItemData data)
static

Definition at line 51 of file Ship.cpp.

References InventoryItem::CreateItemID(), and Load().

Referenced by InventoryItem::Spawn(), and ItemFactory::SpawnShip().

51  {
52  uint32 shipID(InventoryItem::CreateItemID(data));
53  if (shipID == 0)
54  return ShipItemRef(nullptr);
55 
56  return ShipItem::Load( shipID);
57 }
static ShipItemRef Load(uint32 shipID)
Definition: Ship.cpp:46
unsigned __int32 uint32
Definition: eve-compat.h:50
RefPtr< ShipItem > ShipItemRef
Definition: ItemRef.h:54
static uint32 CreateItemID(ItemData &data)

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::StopModuleRepair ( uint32  modID)
inline

Definition at line 156 of file Ship.h.

References m_ModuleManager, and ModuleManager::StopModuleRepair().

ModuleManager * m_ModuleManager
Definition: Ship.h:276
void StopModuleRepair(uint32 modID)

Here is the call graph for this function:

void ShipItem::StripFitting ( )

Definition at line 1311 of file Ship.cpp.

References InventoryItem::flag(), flagCargoHold, flagHangar, ModuleManager::GetModuleListOfRefsAsc(), InventoryItem::locationID(), m_ModuleManager, sDataMgr, ModuleManager::UnfitModule(), and UnlinkAllWeapons().

1312 {
1313  UnlinkAllWeapons();
1314 
1316  if (sDataMgr.IsStation(locationID()))
1317  flag = flagHangar;
1318 
1319  std::vector<InventoryItemRef> moduleList;
1321  for (auto cur : moduleList) {
1322  m_ModuleManager->UnfitModule(cur->itemID());
1323  cur->Move(locationID(), flag, true);
1324  }
1325 }
void UnfitModule(uint32 itemID)
EVEItemFlags
Definition: EVE_Flags.h:13
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void GetModuleListOfRefsAsc(std::vector< InventoryItemRef > &modVec)
uint32 locationID() const
EVEItemFlags flag() const
void UnlinkAllWeapons()
Definition: Ship.cpp:1651
#define sDataMgr

Here is the call graph for this function:

void ShipItem::TryModuleLimitChecks ( EVEItemFlags  flag,
InventoryItemRef  iRef 
)

Definition at line 736 of file Ship.cpp.

References UserError::AddFormatValue(), UserError::AddTypeName(), AttrLauncherSlotsLeft, AttrRigSize, AttrTurretSlotsLeft, AttrUpgradeCapacity, AttrUpgradeCost, AttrUpgradeLoad, AttrUpgradeSlotsLeft, ModuleManager::CheckGroupFitLimited(), ModuleManager::CheckSlotFitLimited(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), ItemType::HasEffect(), IsHiSlot, IsRigSlot, ModuleManager::IsSlotOccupied(), launcherFitted, m_ModuleManager, sDataMgr, turretFitted, InventoryItem::type(), and InventoryItem::typeID().

Referenced by InventoryBound::MoveItems().

737 {
739  throw UserError ("SlotAlreadyOccupied");
740 
743 
744  if (IsHiSlot(flag)) {
745  // check available turret/launcher hardpoints
748  throw UserError ("NotEnoughTurretSlots")
749  .AddTypeName ("moduleName", iRef->typeID ());
750  /*u'NotEnoughTurretSlotsBody'}(u"You cannot fit the {moduleName} because your ship doesn't have any turret slots left for fitting, possibly because you have already filled your ship with turrets or that the ship simply can not be fitted with turrets.\r\n<br>
751  * <br>Turret slots represent how many weapons of a certain type can be fitted on a ship. The current design is over a hundred years old, and is modular enough to allow for a great leeway in the fitting of various weaponry.", None,
752  * {u'{moduleName}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'moduleName'}})
753  */
754  }
755  } else if (iRef->type().HasEffect(EVEEffectID::launcherFitted)) {
757  throw UserError ("NotEnoughLauncherSlots")
758  .AddTypeName ("moduleName", iRef->typeID ());
759  /*NotEnoughLauncherSlotsBody'}(u"You cannot fit the {moduleName} because your ship doesn't have any launcher slots left for fitting, possibly because you have already filled your ship with launchers or that the ship simply can not be fitted with launchers.<br>
760  * <br>Launcher slots represent how many weapons of a certain type can be fitted on a ship. The current design is over a hundred years old, and is modular enough to allow for a great leeway in the fitting of various weaponry.", None,
761  * {u'{moduleName}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'moduleName'}})
762  */
763  }
764  }
765  } else if (IsRigSlot(flag)) {
767  throw UserError ("CannotFitRigWrongSize")
768  .AddFormatValue ("rigSize", new PyString (sDataMgr.GetRigSizeName (iRef->GetAttribute (AttrRigSize).get_uint32())))
769  .AddTypeName ("item", iRef->typeID ())
770  .AddFormatValue ("shipRigSize", new PyString (sDataMgr.GetRigSizeName (GetAttribute (AttrRigSize).get_uint32())));
771  /* CannotFitRigWrongSizeBody'}(u'{item} does not fit in this slot.
772  * The slot takes size {shipRigSize} rigs, but the item is size {rigSize}.', None,
773  * {u'{rigSize}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'rigSize'},
774  * u'{item}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'item'},
775  * u'{shipRigSize}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'shipRigSize'}})
776  * check avalible rig slots and ship upgrade capy
777  */
778  }
780  throw UserError ("NotEnoughUpgradeSlots")
781  .AddFormatValue ("moduleType", new PyInt (iRef->typeID ()));
782  /*NotEnoughUpgradeSlotsBody'}(u"You cannot fit the {[item]moduleType.name} because your ship doesn't have any upgrade slots left for fitting, possibly because you have already filled your ship with upgrades or that the ship simply can not be fitted with upgrades.", None,
783  * {u'{[item]moduleType.name}': {'conditionalValues': [], 'variableType': 2, 'propertyName': 'name', 'args': 0, 'kwargs': {}, 'variableName': 'moduleType'}})
784  */
785  }
786 
788  throw UserError ("NotEnoughUpgradeCapacity")
789  .AddTypeName ("moduleName", iRef->typeID ());
790  /*NotEnoughUpgradeCapacityBody'}(u'You cannot fit the {moduleName} because your ship cannot handle it. Your ship can only fit so many upgrades as each interferes with its calibration, and past a certain point your ship is rendered unusable.', None,
791  * {u'{moduleName}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'moduleName'}})
792  */
793  }
794  }
795 }
void CheckSlotFitLimited(EVEItemFlags flag)
Python string.
Definition: PyRep.h:430
UserError & AddTypeName(const char *name, uint32 typeID)
Shorthand method for adding a type's name.
bool HasEffect(uint16 effectID) const
Definition: ItemType.cpp:208
void CheckGroupFitLimited(EVEItemFlags flag, InventoryItemRef iRef)
UserError & AddFormatValue(const char *name, PyRep *value)
Fluent version of the protected AddKeyword, allows for adding a keyword to the exception.
#define IsHiSlot(flag)
Definition: EVE_Defines.h:358
ModuleManager * m_ModuleManager
Definition: Ship.h:276
const ItemType & type() const
uint32 get_uint32()
Definition: EvilNumber.cpp:173
Python integer.
Definition: PyRep.h:231
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
EVEItemFlags flag() const
EvilNumber GetAttribute(const uint16 attrID) const
#define IsRigSlot(flag)
Definition: EVE_Defines.h:367
bool IsSlotOccupied(EVEItemFlags flag)
uint16 typeID() const
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::Undock ( )

Definition at line 370 of file Ship.cpp.

References Client::IsSessionChange(), m_isUndocking, m_ModuleManager, m_pilot, ResetEffects(), SetShipCapacitorLevel(), SetShipShield(), and ModuleManager::UpdateChargeQty().

Referenced by Client::UndockFromStation().

370  {
371  m_isUndocking = true;
372 
373  //HorribleFittingProblems
374 
375  ResetEffects();
376  //ProcessEffects(true, true);
377 
378  // horrible hack to set charge qty in fit window
379  // on the off-chance player opens the fit window
381 
382  // Recharge shields and cap if session change isnt active (undocking too fast)
383  if (!m_pilot->IsSessionChange()) {
384  SetShipShield(1.0);
386  }
387 }
bool IsSessionChange()
Definition: Client.h:241
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void ResetEffects()
Definition: Ship.cpp:1872
Client * m_pilot
Definition: Ship.h:273
void SetShipCapacitorLevel(float fraction)
Definition: Ship.cpp:881
void SetShipShield(float fraction)
Definition: Ship.cpp:897
bool m_isUndocking
Definition: Ship.h:288

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::UnlinkAllWeapons ( )

Definition at line 1651 of file Ship.cpp.

References ShipDB::ClearWeaponGroups(), ModuleManager::GetWeapons(), InventoryItem::m_itemID, m_linkedWeapons, and m_ModuleManager.

Referenced by LoadWeaponGroups(), and StripFitting().

1652 {
1653  std::list< GenericModule* > weaponList;
1654  m_ModuleManager->GetWeapons(weaponList);
1655  for (auto cur : weaponList) {
1656  if (cur->IsActive())
1657  throw UserError ("CantUngroupModuleActive");
1658  if (cur->IsLoading())
1659  throw UserError ("CantUngroupModuleLoading");
1660 
1661  cur->SetLinked(false);
1662  cur->SetLinkMaster(false);
1663  }
1664  m_linkedWeapons.clear();
1666 }
void GetWeapons(std::list< GenericModule * > &weaponList)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
static void ClearWeaponGroups(uint32 shipID)
Definition: ShipDB.cpp:92

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::UnlinkGroup ( uint32  memberID,
bool  update = false 
)

Definition at line 1602 of file Ship.cpp.

References ModuleManager::GetModule(), InventoryItem::m_itemID, m_linkedWeapons, m_ModuleManager, m_pilot, Client::QueueDestinyEvent(), SaveWeaponGroups(), and PyTuple::SetItem().

Referenced by ModuleManager::UnfitModule(), and UnlinkWeapon().

1603 {
1604  GenericModule* pMod1(m_ModuleManager->GetModule(memberID));
1605  if (pMod1 == nullptr)
1606  return; // make error here?
1607 
1608  // if master is loading or active, then whole group is
1609  if (pMod1->IsActive())
1610  throw UserError ("CantUngroupModuleActive");
1611  if (pMod1->IsLoading())
1612  throw UserError ("CantUngroupModuleLoading");
1613 
1614  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.find(pMod1);
1615  if (itr != m_linkedWeapons.end()) {
1616  pMod1->SetLinked(false);
1617  pMod1->SetLinkMaster(false);
1618  std::list<GenericModule*>::iterator itr2 = itr->second.begin();
1619  while (itr2 != itr->second.end()) {
1620  (*itr2)->SetLinked(false);
1621  itr2 = itr->second.erase(itr2);
1622  if (itr->second.empty()) {
1623  m_linkedWeapons.erase(itr);
1624  SaveWeaponGroups();
1625  if (update) {
1626  PyTuple* tuple = new PyTuple(3);
1627  tuple->SetItem(0, new PyString("OnWeaponGroupDestroyed"));
1628  tuple->SetItem(1, new PyInt(m_itemID));
1629  tuple->SetItem(2, new PyInt(memberID));
1630  m_pilot->QueueDestinyEvent(&tuple);
1631  }
1632  return;
1633  }
1634  }
1635  } else {
1636  // this module isnt master... loop thru all links to see if we can find it
1637  for (auto cur : m_linkedWeapons) {
1638  std::list<GenericModule*>::iterator itr2 = cur.second.begin();
1639  while (itr2 != cur.second.end()) {
1640  if ((*itr2) == pMod1) {
1641  UnlinkGroup(cur.first->itemID(), update);
1642  return;
1643  }
1644  ++itr2;
1645  }
1646  }
1647  }
1648 }
Python string.
Definition: PyRep.h:430
void QueueDestinyEvent(PyTuple **multiEvent)
Definition: Client.cpp:2124
Python tuple.
Definition: PyRep.h:567
void SaveWeaponGroups()
Definition: Ship.cpp:1733
ModuleManager * m_ModuleManager
Definition: Ship.h:276
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
GenericModule * GetModule(EVEItemFlags flag)
Client * m_pilot
Definition: Ship.h:273
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
void UnlinkGroup(uint32 memberID, bool update=false)
Definition: Ship.cpp:1602

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 ShipItem::UnlinkWeapon ( uint32  moduleID)

Definition at line 1522 of file Ship.cpp.

References PyList::AddItem(), ModuleManager::GetModule(), LinkWeapon(), InventoryItem::m_itemID, m_linkedWeapons, m_ModuleManager, m_pilot, Client::QueueDestinyEvent(), Client::SendNotifyMsg(), PyTuple::SetItem(), PyDict::SetItem(), and UnlinkGroup().

1523 {
1524  GenericModule* pMod1(m_ModuleManager->GetModule(moduleID));
1525  if (pMod1 == nullptr)
1526  return 0; // make error here?
1527 
1528  if (pMod1->IsActive()) {
1529  m_pilot->SendNotifyMsg("You cannot ungroup active modules, please deactivate them first.");
1530  return 0;
1531  }
1532  if (pMod1->IsLoading()) {
1533  m_pilot->SendNotifyMsg("You cannot ungroup weapons while they are being loaded with charges.");
1534  return 0;
1535  }
1536  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.find(pMod1);
1537  if (itr == m_linkedWeapons.end())
1538  return 0;
1539 
1540  // weird shit here, but this works...
1541 
1542  // get first linked moduleID
1543  uint32 slaveID(itr->second.front()->itemID());
1544  // delete group
1545  UnlinkGroup(moduleID);
1546  LinkWeapon(moduleID, slaveID);
1547  // make packet for master and first slave (slaveID)
1548  PyList* slaves = new PyList();
1549  slaves->AddItem(new PyInt(slaveID));
1550  PyDict* result = new PyDict();
1551  result->SetItem(new PyInt(moduleID), slaves);
1552  PyTuple* tuple = new PyTuple(3);
1553  tuple->SetItem(0, new PyString("OnWeaponBanksChanged"));
1554  tuple->SetItem(1, new PyInt(m_itemID));
1555  tuple->SetItem(2, result); //GetLinkedWeapons()
1556  // send 'new' group data to client
1557  m_pilot->QueueDestinyEvent(&tuple);
1558  // send immediately (otherwise it will wait until after this call returns, which negates this hack
1559  //m_pilot->FlushQueue();
1560 
1561  // return slaveID, which client will use to delete it's map and continue processing
1562  return slaveID;
1563 }
Python string.
Definition: PyRep.h:430
Python's dictionary.
Definition: PyRep.h:719
void QueueDestinyEvent(PyTuple **multiEvent)
Definition: Client.cpp:2124
void SendNotifyMsg(const char *fmt,...)
Definition: Client.cpp:2776
Python tuple.
Definition: PyRep.h:567
void AddItem(PyRep *i)
Definition: PyRep.h:701
ModuleManager * m_ModuleManager
Definition: Ship.h:276
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
GenericModule * GetModule(EVEItemFlags flag)
Client * m_pilot
Definition: Ship.h:273
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231
unsigned __int32 uint32
Definition: eve-compat.h:50
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713
Python list.
Definition: PyRep.h:639
void UnlinkGroup(uint32 memberID, bool update=false)
Definition: Ship.cpp:1602
void LinkWeapon(uint32 masterID, uint32 slaveID)
Definition: Ship.cpp:1365

Here is the call graph for this function:

void ShipItem::UnlinkWeapon ( uint32  masterID,
uint32  slaveID 
)
protected

Definition at line 1566 of file Ship.cpp.

References ModuleManager::GetModule(), m_linkedWeapons, and m_ModuleManager.

1567 {
1568  if (masterID == slaveID)
1569  return;
1570  GenericModule* pMod1(m_ModuleManager->GetModule(masterID));
1571  GenericModule* pMod2(m_ModuleManager->GetModule(slaveID));
1572  if ((pMod1 == nullptr) or (pMod2 == nullptr))
1573  return; // make error here?
1574 
1575  // if master is loading or active, then whole group is
1576  if (pMod1->IsActive())
1577  throw UserError ("CantUngroupModuleActive");
1578  if (pMod1->IsLoading())
1579  throw UserError ("CantUngroupModuleLoading");
1580 
1581  pMod2->SetLinked(false);
1582 
1583  std::map<GenericModule*, std::list<GenericModule*>>::iterator itr = m_linkedWeapons.find(pMod1);
1584  if (itr != m_linkedWeapons.end()) {
1585  std::list<GenericModule*>::iterator itr2 = itr->second.begin();
1586  while (itr2 != itr->second.end()) {
1587  if ((*itr2) == pMod2) {
1588  itr2 = itr->second.erase(itr2);
1589  if (itr->second.empty()) {
1590  pMod1->SetLinked(false);
1591  pMod1->SetLinkMaster(false);
1592  m_linkedWeapons.erase(itr);
1593  }
1594  return;
1595  }
1596  ++itr2;
1597  }
1598  }
1599 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
std::map< GenericModule *, std::list< GenericModule * > > m_linkedWeapons
Definition: Ship.h:281
GenericModule * GetModule(EVEItemFlags flag)
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121

Here is the call graph for this function:

void ShipItem::UnloadAllModules ( )
inline

Definition at line 132 of file Ship.h.

References m_ModuleManager, and ModuleManager::UnloadAllModules().

Referenced by Command_unload().

ModuleManager * m_ModuleManager
Definition: Ship.h:276

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::UnloadModule ( uint32  itemID)
inline

Definition at line 130 of file Ship.h.

References m_ModuleManager, and ModuleManager::UnloadModule().

Referenced by InventoryBound::MoveItems().

void UnloadModule(uint32 itemID)
ModuleManager * m_ModuleManager
Definition: Ship.h:276
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::UnloadModule ( GenericModule pMod)
inline

Definition at line 131 of file Ship.h.

References m_ModuleManager, and ModuleManager::UnloadModule().

131 { m_ModuleManager->UnloadModule(pMod); }
void UnloadModule(uint32 itemID)
ModuleManager * m_ModuleManager
Definition: Ship.h:276

Here is the call graph for this function:

void ShipItem::UpdateMass ( )

Definition at line 389 of file Ship.cpp.

References AttrMass, InventoryItem::GetAttribute(), Inventory::GetInventoryMap(), HasPilot(), InventoryItem::pInventory, and InventoryItem::SetAttribute().

Referenced by Init().

390 {
391  std::map< uint32, InventoryItemRef > invMap;
392  pInventory->GetInventoryMap(invMap);
393  uint32 mass(GetAttribute(AttrMass).get_uint32());
394  for (auto cur : invMap)
395  mass += cur.second->type().mass() * cur.second->quantity();
396 
397  // may have to adjust this for player login
398  SetAttribute(AttrMass, mass, HasPilot());
399 }
virtual bool HasPilot()
Definition: Ship.h:71
Inventory * pInventory
void SetAttribute(uint16 attrID, int num, bool notify=true)
unsigned __int32 uint32
Definition: eve-compat.h:50
void GetInventoryMap(std::map< uint32, InventoryItemRef > &invMap)
Definition: Inventory.cpp:453
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::UpdateModules ( )

Definition at line 862 of file Ship.cpp.

References m_ModuleManager, m_onlineModuleVec, and ModuleManager::UpdateModules().

Referenced by Client::MoveItem().

863 {
864  /* this is only called when ship is in space
865  * this will call Online() on all modules, which will apply passive and online effects.
866  */
868  m_onlineModuleVec.clear();
869  //FailedToOnlineModulesOnUndock
870 }
std::vector< uint32 > m_onlineModuleVec
Definition: Ship.h:280
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void UpdateModules(std::vector< uint32 > modVec)

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::UpdateModules ( EVEItemFlags  flag)

Definition at line 872 of file Ship.cpp.

References m_ModuleManager, and ModuleManager::UpdateModules().

873 {
874  // List of callees to put this function into context as to what it should be doing:
875  // ShipSE::AddItem()
876  // Client::MoveItem() - something has been moved into or out of the ship, recheck all modules for... some reason
878 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276
void UpdateModules(std::vector< uint32 > modVec)
EVEItemFlags flag() const

Here is the call graph for this function:

bool ShipItem::ValidateBoardShip ( CharacterRef  who)

Definition at line 2267 of file Ship.cpp.

References AttrRequiredSkill1, AttrRequiredSkill1Level, AttrRequiredSkill2, AttrRequiredSkill2Level, AttrRequiredSkill3, AttrRequiredSkill3Level, AttrRequiredSkill4, AttrRequiredSkill4Level, AttrRequiredSkill5, AttrRequiredSkill5Level, AttrRequiredSkill6, AttrRequiredSkill6Level, EvilZero, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), InventoryItem::HasAttribute(), and Character::HasSkillTrainedToLevel().

2267  {
2268  bool result = false;
2269  EvilNumber skillTypeID(EvilZero);
2270 
2271  if (HasAttribute(AttrRequiredSkill1, skillTypeID)) {
2272  if (character->HasSkillTrainedToLevel( skillTypeID.get_uint32(), GetAttribute(AttrRequiredSkill1Level).get_uint32()))
2273  result = true;
2274  if (HasAttribute(AttrRequiredSkill2, skillTypeID)) {
2275  if (character->HasSkillTrainedToLevel( skillTypeID.get_uint32(), GetAttribute(AttrRequiredSkill2Level).get_uint32())) {
2276  result = true;
2277  } else {
2278  return false;
2279  }
2280  if (HasAttribute(AttrRequiredSkill3, skillTypeID)) {
2281  if (character->HasSkillTrainedToLevel( skillTypeID.get_uint32(), GetAttribute(AttrRequiredSkill3Level).get_uint32())) {
2282  result = true;
2283  } else {
2284  return false;
2285  }
2286  if (HasAttribute(AttrRequiredSkill4, skillTypeID)) {
2287  if (character->HasSkillTrainedToLevel( skillTypeID.get_uint32(), GetAttribute(AttrRequiredSkill4Level).get_uint32())) {
2288  result = true;
2289  } else {
2290  return false;
2291  }
2292  if (HasAttribute(AttrRequiredSkill5, skillTypeID)) {
2293  if (character->HasSkillTrainedToLevel( skillTypeID.get_uint32(), GetAttribute(AttrRequiredSkill5Level).get_uint32())) {
2294  result = true;
2295  } else {
2296  return false;
2297  }
2298  if (HasAttribute(AttrRequiredSkill6, skillTypeID)) {
2299  if (character->HasSkillTrainedToLevel( skillTypeID.get_uint32(), GetAttribute(AttrRequiredSkill6Level).get_uint32())) {
2300  result = true;
2301  } else {
2302  return false;
2303  }
2304  }
2305  }
2306  }
2307  }
2308  }
2309  } else {
2310  result = true;
2311  }
2312 
2313  return result;
2314 }
bool HasAttribute(const uint16 attrID) const
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
uint32 get_uint32()
Definition: EvilNumber.cpp:173
EvilNumber GetAttribute(const uint16 attrID) const

Here is the call graph for this function:

bool ShipItem::ValidateItemSpecifics ( InventoryItemRef  iRef)

Definition at line 2316 of file Ship.cpp.

References _log, AttrCanFitShipGroup1, AttrCanFitShipGroup2, AttrCanFitShipGroup3, AttrCanFitShipGroup4, AttrCanFitShipGroup5, AttrCanFitShipGroup6, AttrCanFitShipGroup7, AttrCanFitShipGroup8, AttrCanFitShipType1, AttrCanFitShipType2, AttrCanFitShipType3, AttrCanFitShipType4, InventoryItem::groupID(), InventoryItem::HasAttribute(), InventoryItem::itemID(), InventoryItem::name(), InventoryItem::type(), and InventoryItem::typeID().

Referenced by VerifyHoldType().

2317 {
2318  bool result(false);
2319  EvilNumber fitID(0);
2320  uint16 groupID(type().groupID());
2321  // If a ship group restriction is specified, the item must be able to fit to at least one ship group.
2322  _log(SHIP__TRACE, "ShipItem::ValidateItemSpecifics - Beginning the group validation for %s(%u):", iRef->name(), iRef->itemID());
2323  if (iRef->HasAttribute(AttrCanFitShipGroup1, fitID)) {
2324  if (fitID == groupID)
2325  result = true;
2326  if (iRef->HasAttribute(AttrCanFitShipGroup2, fitID)) {
2327  if (fitID == groupID)
2328  result = true;
2329  if (iRef->HasAttribute(AttrCanFitShipGroup3, fitID)) {
2330  if (fitID == groupID)
2331  result = true;
2332  if (iRef->HasAttribute(AttrCanFitShipGroup4, fitID)) {
2333  if (fitID == groupID)
2334  result = true;
2335  if (iRef->HasAttribute(AttrCanFitShipGroup5, fitID)) {
2336  if (fitID == groupID)
2337  result = true;
2338  if (iRef->HasAttribute(AttrCanFitShipGroup6, fitID)) {
2339  if (fitID == groupID)
2340  result = true;
2341  if (iRef->HasAttribute(AttrCanFitShipGroup7, fitID)) {
2342  if (fitID == groupID)
2343  result = true;
2344  if (iRef->HasAttribute(AttrCanFitShipGroup8, fitID)) {
2345  if (fitID == groupID)
2346  result = true;
2347  }
2348  }
2349  }
2350  }
2351  }
2352  }
2353  }
2354  } else {
2355  result = true;
2356  }
2357 
2358  _log(SHIP__TRACE, "ShipItem::ValidateItemSpecifics - Group Validation returning %s.", (result ? "true" : "false"));
2359 
2360  if (result) {
2361  _log(SHIP__TRACE, "ShipItem::ValidateItemSpecifics - Beginning the type validation for %s(%u):", iRef->name(), iRef->itemID());
2362 
2363  uint16 typeID(type().id());
2364  if (iRef->HasAttribute(AttrCanFitShipType1, fitID)) {
2365  result = false;
2366  if (fitID == typeID)
2367  result = true;
2368  if (iRef->HasAttribute(AttrCanFitShipType2, fitID)) {
2369  if (fitID == typeID)
2370  result = true;
2371  if (iRef->HasAttribute(AttrCanFitShipType3, fitID)) {
2372  if (fitID == typeID)
2373  result = true;
2374  if (iRef->HasAttribute(AttrCanFitShipType4, fitID)) {
2375  if (fitID == typeID)
2376  result = true;
2377  }
2378  }
2379  }
2380  }
2381 
2382  _log(SHIP__TRACE, "ShipItem::ValidateItemSpecifics - Type Validation returning %s.", (result ? "true" : "false"));
2383  }
2384 
2385  return result;
2386 }
#define _log(type, fmt,...)
Definition: logsys.h:124
bool HasAttribute(const uint16 attrID) const
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
const char * name()
uint16 groupID() const
const ItemType & type() const
unsigned __int16 uint16
Definition: eve-compat.h:48
uint16 typeID() const
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::VerifyHoldType ( EVEItemFlags  flag,
InventoryItemRef  iRef,
Client pClient = nullptr 
)
Todo:
this is an error
Todo:
need to figure out how to separate ships into s/m/l/i for these....

Definition at line 1972 of file Ship.cpp.

References EVEDB::invGroups::Advanced_Artillery_Ammo, EVEDB::invGroups::Advanced_Autocannon_Ammo, EVEDB::invGroups::Advanced_Beam_Laser_Crystal, EVEDB::invGroups::Advanced_Blaster_Ammo, EVEDB::invGroups::Advanced_Pulse_Laser_Crystal, EVEDB::invGroups::Advanced_Railgun_Ammo, EVEDB::invGroups::Ammo, EVEDB::invCategories::Asteroid, AttrChargeGroup1, AttrChargeGroup2, AttrChargeGroup3, AttrChargeGroup4, AttrChargeGroup5, AttrChargeSize, AttrHasCorporateHangars, AttrHasShipMaintenanceBay, EVEDB::invGroups::CapitalIndustrialShip, InventoryItem::categoryID(), EVEDB::invCategories::Charge, EVEDB::invCategories::Drone, EVEDB::invGroups::Exhumer, EVEDB::invGroups::Fighter_Bomber, EVEDB::invGroups::Fighter_Drone, Skill::FitModuleSkillCheck(), flagAmmoHold, flagCargoHold, flagCorpHangar2, flagCorpHangar3, flagCorpHangar4, flagCorpHangar5, flagCorpHangar6, flagCorpHangar7, flagDroneBay, flagFuelBay, flagGasHold, flagHangar, flagIndustrialShipHold, flagLargeShipHold, flagMediumShipHold, flagMineralHold, flagOreHold, flagSalvageHold, flagShipHangar, flagShipHold, flagSmallShipHold, EVEDB::invGroups::Freighter, EVEDB::invGroups::Frequency_Crystal, EVEDB::invGroups::FuelBlock, EVEDB::invGroups::Gas_Isotopes, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), Client::GetChar(), ModuleManager::GetModule(), InventoryItem::groupID(), InventoryItem::HasAttribute(), EVEDB::invGroups::Hybrid_Ammo, EVEDB::invGroups::Ice_Product, EVEDB::invGroups::Industrial, IsModuleSlot, m_ModuleManager, m_pilot, EVEDB::invGroups::Mercoxit_Mining_Crystal, EVEDB::invGroups::Mineral, EVEDB::invGroups::Mining_Crystal, EVEDB::invGroups::MiningBarge, EVEDB::invCategories::Module, ItemType::name(), InventoryItem::name(), EVEDB::invGroups::Prototype_Exploration_Ship, InventoryItem::quantity(), EVEDB::invTypes::Rorqual, EVEDB::invGroups::Salvage_Materials, sDataMgr, EVEDB::invCategories::Ship, sLog, EVEDB::invCategories::Subsystem, EVEDB::invGroups::Supercarrier, EVEDB::invGroups::TransportShip, InventoryItem::type(), InventoryItem::typeID(), and ValidateItemSpecifics().

Referenced by LoadCharge(), LoadLinkedWeapons(), and InventoryBound::MoveItems().

1973 {
1974  // if *this ship isnt active, it wont have a pilot to send errors to. test and set as needed.
1975  // to fix this, set client to character calling the move
1976  if (pClient == nullptr) {
1977  if (m_pilot == nullptr)
1978  return;
1979  pClient = m_pilot;
1980  }
1981 
1982  switch (flag) {
1983  case flagCargoHold:
1984  // everything can be stored in general cargo
1985  // update this later to disallow specialized items?
1986  return;
1987  case flagDroneBay: {
1988  if (iRef->categoryID() != EVEDB::invCategories::Drone) {
1989  throw CustomError ("%s cannot be stowed in the Drone Bay", sDataMgr.GetGroupName(iRef->groupID()));
1990  }
1992  // these can only carry fighters and fighter/bombers in drone bay. enforce that here.
1993  if ((iRef->groupID() != EVEDB::invGroups::Fighter_Bomber)
1994  and (iRef->groupID() != EVEDB::invGroups::Fighter_Drone)) {
1995  throw CustomError ("The %s can only carry fighter drones in it's Drone Bay. The %s is not allowed.", name(), iRef->name());
1996  }
1997  }
1998  } break;
1999  case flagShipHangar: { //AttrShipMaintenanceBayCapacity
2001  throw CustomError ("Your %s has no ship maintenance bay.", name());
2002  }
2004  if ((iRef->groupID() != EVEDB::invGroups::MiningBarge)
2005  and (iRef->groupID() != EVEDB::invGroups::Exhumer)
2006  and (iRef->groupID() != EVEDB::invGroups::Industrial)
2007  and (iRef->groupID() != EVEDB::invGroups::TransportShip)
2008  and (iRef->groupID() != EVEDB::invGroups::Freighter)
2011  throw CustomError ("Only indy ships may be placed into the Rorqual's ship hold.");
2012  }
2013  if (iRef->categoryID() != EVEDB::invCategories::Ship) {
2014  throw CustomError ("Only ships may be placed into the maintenance bay.");
2015  }
2016  } break;
2017  case flagFuelBay: { // AttrFuelBayCapacity
2018  if ((iRef->groupID() != EVEDB::invGroups::FuelBlock)
2019  and (iRef->groupID() != EVEDB::invGroups::Ice_Product)) {
2020  throw CustomError ("Only fuel types may be stored in the fuel bay.");
2021  }
2022  } break;
2023  case flagOreHold: {
2024  if (iRef->categoryID() != EVEDB::invCategories::Asteroid) {
2025  throw CustomError ("Only mined ore may be stored in the ore hold.");
2026  }
2027  } break;
2028  case flagGasHold: {
2029  if (iRef->groupID() != EVEDB::invGroups::Gas_Isotopes) {
2030  throw CustomError ("Only gas products may be stored in the gas hold.");
2031  }
2032  } break;
2033  case flagMineralHold: {
2034  if (iRef->groupID() != EVEDB::invGroups::Mineral) {
2035  throw CustomError ("Only refined minerals may be placed into the mineral hold.");
2036  }
2037  } break;
2038  case flagSalvageHold: {
2040  throw CustomError ("Only salvaged materials may be placed into the salvage bay.");
2041  }
2042  } break;
2043  // not sure if all of these flag* are used. if not, *may* update dgmData to add them....later.
2044  case flagShipHold: {
2045  if (iRef->categoryID() != EVEDB::invCategories::Ship) {
2046  throw CustomError ("Only ships may be placed into the ship hold.");
2047  }
2048  } break;
2049 
2051  case flagSmallShipHold: {
2052  if (iRef->categoryID() != EVEDB::invCategories::Ship) {
2053  throw CustomError ("Only small ships may be placed into the ship's small ship hold.");
2054  }
2055  } break;
2056  case flagMediumShipHold: {
2057  if (iRef->categoryID() != EVEDB::invCategories::Ship) {
2058  throw CustomError ("Only medium ships may be placed into the ship's medium ship hold.");
2059  }
2060  } break;
2061  case flagLargeShipHold: {
2062  if (iRef->categoryID() != EVEDB::invCategories::Ship) {
2063  throw CustomError ("Only large ships may be placed into the ship's large ship hold.");
2064  }
2065  } break;
2066  case flagIndustrialShipHold: {
2067  if ((iRef->groupID() != EVEDB::invGroups::MiningBarge)
2068  and (iRef->groupID() != EVEDB::invGroups::Exhumer)
2069  and (iRef->groupID() != EVEDB::invGroups::Industrial)
2070  and (iRef->groupID() != EVEDB::invGroups::TransportShip)
2071  and (iRef->groupID() != EVEDB::invGroups::Freighter)
2074  throw CustomError ("Only indy ships may be placed into the ship's industrial ship hold.");
2075  }
2076  } break;
2077  case flagAmmoHold: {
2078  if ((iRef->groupID() != EVEDB::invGroups::Ammo)
2080  and (iRef->groupID() != EVEDB::invGroups::Mining_Crystal)
2088  and (iRef->groupID() != EVEDB::invGroups::Hybrid_Ammo)) {
2089  throw CustomError ("Only ammunition and crystals may be placed into the ammo bay.");
2090  }
2091  } break;
2092  case flagHangar:
2093  case flagCorpHangar2:
2094  case flagCorpHangar3:
2095  case flagCorpHangar4:
2096  case flagCorpHangar5:
2097  case flagCorpHangar6:
2098  case flagCorpHangar7: { //AttrCorporateHangarCapacity
2100  throw CustomError ("Your %s has no corporate hangars.", name());
2101  }
2102  } break;
2103  default: {
2104  // {'FullPath': u'UI/Messages', 'messageID': 259450, 'label': u'ItemNotHardwareBody'}(u'{[item]itemname.name} cannot be fitted onto a ship. Only hardware modules can be fitted.', None, {u'{[item]itemname.name}': {'conditionalValues': [], 'variableType': 2, 'propertyName': 'name', 'args': 0, 'kwargs': {}, 'variableName': 'itemname'}})
2105 
2106  if ((iRef->categoryID() != EVEDB::invCategories::Module)
2107  and (iRef->categoryID() != EVEDB::invCategories::Charge)
2108  and (iRef->categoryID() != EVEDB::invCategories::Subsystem)) {
2109  throw CustomError ("%s cannot be fitted onto a ship. Only hardware modules may be fitted.", iRef->name());
2110  }
2111 
2112  if (IsModuleSlot(flag)) {
2113  if (!Skill::FitModuleSkillCheck(iRef, pClient->GetChar())) {
2114  throw CustomError ("You do not have the required skills to fit this %s. Ref: ServerError 25163.", iRef->name());
2115  }
2116  if (!ValidateItemSpecifics(iRef)) {
2117  throw CustomError ("Your ship cannot equip the %s.<br>The group '%s' is not allowed on your %s.", \
2118  iRef->name(), sDataMgr.GetGroupName(iRef->groupID()), type().name().c_str());
2119  }
2120  if (iRef->categoryID() == EVEDB::invCategories::Charge) {
2122  if (pMod != nullptr) {
2123  // note: this is also checked in client before calling Load()
2124  if (iRef->HasAttribute(AttrChargeSize))
2125  if (pMod->GetAttribute(AttrChargeSize) != iRef->GetAttribute(AttrChargeSize)) {
2126  sLog.Error("ShipItem::VerifyHoldType", "Charge size %u for %s does not match Module size %u for %s.",\
2127  iRef->GetAttribute(AttrChargeSize).get_uint32(), iRef->name(),\
2128  pMod->GetAttribute(AttrChargeSize).get_uint32(), pMod->GetSelf()->name());
2129  throw CustomError ("Incorrect charge size for this module.");
2130  }
2131  if ((pMod->GetAttribute(AttrChargeGroup1) != iRef->groupID())
2132  and (pMod->GetAttribute(AttrChargeGroup2) != iRef->groupID())
2133  and (pMod->GetAttribute(AttrChargeGroup3) != iRef->groupID())
2134  and (pMod->GetAttribute(AttrChargeGroup4) != iRef->groupID())
2135  and (pMod->GetAttribute(AttrChargeGroup5) != iRef->groupID())) {
2136  throw CustomError ("Incorrect charge type for this module.");
2137  }
2138  // NOTE: Module Manager will check for actual room to load charges and make stack splits, or reject loading altogether
2139  } else {
2140  throw CustomError ("There is no module in %s. Ref: ServerError 25162.", sDataMgr.GetFlagName(flag));
2141  }
2142  }
2143  } else {
2144  sLog.Error("ShipItem::VerifyHoldType", "testing %s to add %u %s of cat %s has reached the end.",
2145  sDataMgr.GetFlagName(flag), iRef->quantity(), iRef->name(), sDataMgr.GetCategoryName(iRef->categoryID()));
2146  throw CustomError ("Internal Server Error. Ref: ServerError 25162.");
2147  }
2148  }
2149  }
2150 }
bool ValidateItemSpecifics(InventoryItemRef iRef)
Definition: Ship.cpp:2316
bool HasAttribute(const uint16 attrID) const
static bool FitModuleSkillCheck(InventoryItemRef item, CharacterRef ch)
Definition: Skill.cpp:230
const char * name()
CharacterRef GetChar() const
Definition: Client.h:164
Advanced version of UserError that allows to send a full custom message.
Definition: PyExceptions.h:453
uint16 groupID() const
ModuleManager * m_ModuleManager
Definition: Ship.h:276
const ItemType & type() const
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
GenericModule * GetModule(EVEItemFlags flag)
Client * m_pilot
Definition: Ship.h:273
uint32 get_uint32()
Definition: EvilNumber.cpp:173
const std::string & name() const
Definition: ItemType.h:74
EVEItemFlags flag() const
#define IsModuleSlot(flag)
Definition: EVE_Defines.h:350
EvilNumber GetAttribute(const uint16 attrID) const
uint16 typeID() const
uint8 categoryID() const
int32 quantity() const
Definition: InventoryItem.h:97
#define sDataMgr

Here is the call graph for this function:

Here is the caller graph for this function:

void ShipItem::Warp ( )

Definition at line 401 of file Ship.cpp.

References m_ModuleManager, and ModuleManager::ShipWarping().

Referenced by ShipSE::Warp().

401  {
403 }
ModuleManager * m_ModuleManager
Definition: Ship.h:276

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class InventoryItem
friend

Definition at line 49 of file Ship.h.

Member Data Documentation

bool ShipItem::m_isActive
private

Definition at line 285 of file Ship.h.

Referenced by Init(), IsActive(), and SetPlayer().

bool ShipItem::m_isDocking
private

Definition at line 287 of file Ship.h.

Referenced by Dock(), IsDocking(), and SetDocked().

bool ShipItem::m_isPopped
private

Definition at line 286 of file Ship.h.

Referenced by IsPopped(), and SetPopped().

bool ShipItem::m_isUndocking
private

Definition at line 288 of file Ship.h.

Referenced by IsUndocking(), ProcessShipEffects(), SetUndocking(), and Undock().

bool ShipItem::m_loaded
protected

Definition at line 227 of file Ship.h.

Referenced by _Load().

std::vector<uint32> ShipItem::m_onlineModuleVec
private
InventoryItemRef ShipItem::m_targetRef
private

Definition at line 278 of file Ship.h.

Referenced by Activate(), ClearTargetRef(), and GetTargetRef().


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