30 m_destinyMgr(nullptr),
116 _log(MODULE__TRACE,
"Reload time for %s(%u) set to %ums. (uses charge: %s", \
119 _log(MODULE__TRACE,
"%s(%u) does not use reload time.", mRef->
name(), mRef->
itemID());
321 if (effectID == 16) {
323 sLog.Error(
"AM::Activate()",
"effectID 16 got here.");
328 _log(MODULE__TRACE,
"ActiveModule::Activate - %s: needsCharge: %s, chargeLoaded: %s, chargeRef: %s", \
342 throw UserError (
"DeniedActivateTargetNotPresent");
364 throw UserError (
"DeniedActivateTargetAssistDisallowed");
374 throw CustomError (
"Attacking Customs Offices isn't implemented at this time.");
410 std::vector<GenericModule*>
modules;
413 for (
auto cur : modules) {
414 cur->GetActiveModule()->SetSlaveData(pShip);
415 cur->GetActiveModule()->ShowEffect(
true,
false);
465 _log(MODULE__TRACE,
"ActiveModule::Deactivate(%s) - module %s(%u) remaining time %ums.", \
475 if (effect.compare(
"TargetDestroyed") == 0) {
525 if (iRef.get() !=
nullptr) {
526 if (iRef->quantity() > qtyNeed) {
531 iRef->SetQuantity(0,
true,
true);
654 _log(MODULE__TRACE,
"%s(%u) calling AbortCycle() - state: %s, m_stop:%s", \
677 _log(MODULE__ERROR,
"ActiveModule::DeactivateCycle() - Called on %s(%u) with current state %s and !abort.", \
682 std::vector<GenericModule*>
modules;
685 for (
auto cur : modules)
686 cur->GetActiveModule()->ShowEffect(
false, abort);
724 std::vector<AsteroidSE*> vList;
730 for (
auto pASE : vList) {
732 distance -= pASE->GetRadius();
734 if (distance < m_range) {
744 for (
auto pASE : vList) {
824 _log(MODULE__TRACE,
"ActiveModule::SetTimer() - %s with %u ms for %s on %s.", \
833 if (chargeRef.
get() ==
nullptr) {
834 _log(MODULE__WARNING,
"ActiveModule::LoadCharge() for %s - Cannot find charge to load into this module",
m_modRef->
name());
839 if (pClient ==
nullptr) {
840 _log(MODULE__WARNING,
"ActiveModule::LoadCharge() for %s - Pilot is null. Cannot load charge.",
m_modRef->
name());
941 std::vector<GenericModule*>
modules;
943 for (
auto cur : modules)
944 if (cur->isOnline() and cur->IsLoaded())
945 cur->GetLoadedChargeRef()->AlterQuantity(-1, cur->IsLoaded());
1033 bool allowed(
false);
1053 bool owner(
false),
fleet(
false),
corp(
false), ally(
false), war(
false);
1066 if (owner or
fleet or
corp or ally or war) {
1073 throw UserError (
"InvalidTargetCanOwner")
1129 _log(SHIP__WARNING,
"Activate::RangeTest - Default hit for %s(%u) group: %u. Using %.1f", \
1137 _log(MODULE__MESSAGE,
"Activate::RangeTest - distance between %s and target %s: %.1f. range of %s is %.1f", \
1140 if (distance > range) {
1173 std::string guidStr =
sFxDataMgr.GetEffectGuid(effectID);
1174 if (guidStr.empty())
1175 _log(EFFECTS__ERROR,
"guid empty for %s using effectID %u",
m_modRef->
name(), effectID);
1196 GodmaEnvironment ge;
1204 if (chgTypeID > 0) {
1206 gsl.shipID = ge.shipID;
1208 gsl.typeID = chgTypeID;
1209 ge.subLoc = gsl.Encode();
1216 Notify_OnGodmaShipEffect shipEff;
1217 shipEff.itemID = ge.selfID;
1218 shipEff.effectID = ge.effectID;
1220 shipEff.start = (active ? 1 : 0);
1221 shipEff.active = (active ? 1 : 0);
1222 shipEff.environment = ge.Encode();
1224 shipEff.duration = (abort ? 2000 : timeLeft);
1237 shipEff.error = tuple;
1267 shipEff.error =
PyStatic.NewNone();
1276 shipEff.error =
PyStatic.NewNone();
1279 PyTuple* tuple = shipEff.Encode();
1281 tuple->
Dump(EFFECTS__DUMP,
"");
1335 if (pClient ==
nullptr)
1339 if (missileRef.get() ==
nullptr) {
1348 if (pMissile ==
nullptr) {
1357 float travelTime = (distance/missileSpeed);
1377 if (pClient ==
nullptr)
1379 if (pClient->
scan() ==
nullptr)
1384 pClient->
SendErrorMsg(
"You can only control %u probes based on your current skills.", pcount);
1395 if (probeRef.get() ==
nullptr)
1396 throw CustomError (
"Unable to spawn item #%u:'%s' of type %u.", \
1399 probeRef->SetPosition(pos);
1402 if (pProbe ==
nullptr)
void ResetAttribute(uint32 attrID)
void SendNotification(const PyAddress &dest, EVENotificationStream ¬i, bool seq=true)
SystemEntity * GetSE(uint32 entityID) const
uint32 GetLocationID() const
void AddEntity(SystemEntity *pSE, bool addSignal=true)
void HeatDamageCheck(GenericModule *pMod)
void AddProbe(ProbeSE *pProbe)
void SendErrorMsg(const char *fmt,...)
#define _log(type, fmt,...)
virtual Prospector * GetProspectModule()
void ProcessEffects(int8 state, bool active=false)
bool HasAttribute(const uint16 attrID) const
ActiveModule(ModuleItemRef mRef, ShipItemRef sRef)
const GPoint & position() const
void MakeMissile(Missile *missile)
SystemBubble * SysBubble()
virtual void DeOverload()
virtual void RemoveTarget(SystemEntity *pSE)
double MakeRandomFloat(double low, double high)
Generates random real from interval [low; high].
void QueueDestinyEvent(PyTuple **multiEvent)
void SetHitTimer(uint32 setTime)
int32 GetCharacterID() const
void GetList(uint32 beltID, std::vector< AsteroidSE * > &list)
int32 GetWarFactionID() const
int32 GetCorporationID() const
uint16 GetDefaultEffect() const
uint32 GetRemainingCycleTimeMS()
UserError & AddFormatValue(const char *name, PyRep *value)
Fluent version of the protected AddKeyword, allows for adding a keyword to the exception.
this is a class that kinda mimics how python polymorph's numbers.
void SendNotifyMsg(const char *fmt,...)
TargetManager * TargetMgr()
CharacterRef GetChar() const
void SetAttribute(uint32 attrID, EvilNumber val, bool update=true)
Advanced version of UserError that allows to send a full custom message.
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
std::unordered_multimap< int8, Effect > m_stateFxMap
int32 GetAllianceID() const
const GPoint & GetPosition() const
void UpdateDamage(uint16 attrID, uint16 srcAttrID, InventoryItemRef iRef)
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
const ItemType & type() const
#define is_log_enabled(type)
#define sLog
Evaluates to a NewLog instance.
void SendSpecialEffect(uint32 entityID, uint32 moduleID, uint32 moduleTypeID, uint32 targetID, uint32 chargeTypeID, std::string guid, bool isOffensive, bool start, bool isActive, int32 duration, uint32 repeat, int32 graphicInfo=0) const
virtual bool IsProspectModule() const
TargetManager * m_targMgr
SystemEntity * m_targetSE
DestinyManager * DestinyMgr()
SystemManager * SystemMgr()
void RemoveTarget(SystemEntity *tSE)
InventoryItemRef GetSelf()
void BubblecastDestinyEvent(std::vector< PyTuple * > &events, const char *desc) const
DestinyManager * m_destinyMgr
void SetItem(size_t index, PyRep *object)
Stores Python object.
virtual void UnloadCharge()
SystemManager * SystemMgr() const
InventoryItemRef m_chargeRef
virtual bool IsItemEntity()
virtual bool IsContainerSE()
void RemoveTargetModule(ActiveModule *pMod)
#define IsValidTarget(itemID)
bool AlterQuantity(int32 qty, bool notify=false)
void ShowEffect(bool active=false, bool abort=false)
void SetAttribute(uint16 attrID, int num, bool notify=true)
virtual void ApplyDamage()
bool Check(bool reset=true)
uint32 GetFleetID() const
virtual void AbortCycle()
void SetSpeed(double speed)
const char * GetName() const
const char * GetModuleStateName(int8 state)
void GetLinkedWeaponMods(EVEItemFlags flag, std::vector< GenericModule * > &modules)
Python object "ccp_exceptions.UserError".
void SetTimer(uint32 time)
virtual bool CanActivate()
EVEItemFlags flag() const
PyServiceMgr * GetServiceMgr()
void ApplyEffect(int8 state, bool active=false)
RefPtr< InventoryItem > InventoryItemRef
void UpdateCharge(uint16 attrID, uint16 testAttrID, uint16 srcAttrID, InventoryItemRef iRef)
uint32 GetCorporationID()
void ProcessActiveCycle()
virtual Client * GetPilot()
void SendDamageStateChanged()
void SetScan(Scan *pScan)
EvilNumber GetAttribute(const uint16 attrID) const
void TractorBeamStart(SystemEntity *pShipSE, EvilNumber speed)
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const
void SetSlaveData(ShipSE *pShip)
virtual void LoadCharge(InventoryItemRef charge)
void SpeedBoost(bool deactivate=false)
virtual void DeOverload()
virtual ContainerSE * GetContSE()
GaExpInl GaFloat distance(const GaVec3 &oth) const
void AddTargetModule(ActiveModule *pMod)
virtual void Deactivate(std::string effect="")
virtual void MissileLaunched(Missile *pMissile)
void MakeRandomPointOnSphere(double radius)
virtual bool IsStaticEntity()
bool ContainsTypeQtyByFlag(uint16 typeID, EVEItemFlags flag=flagNone, uint32 qty=0) const
Inventory * GetMyInventory()
entityID heal the character with the entityID note giving you detailed ship status information gives a list of all dynamic entities and players and their destinyState in this bubble shows some current destiny variables save all kick all and halt server immediate command list all items in current location s gives list of cargo contents and volumes in all holds list current session values show current ship DNA show current objects in their destiny state
EvilNumber GetAttribute(uint32 attrID)
virtual void DeactivateCycle(bool abort=false)
InventoryItemRef GetByTypeFlag(uint32 typeID, EVEItemFlags flag) const
virtual void ReprocessCharge()
void SetModuleState(int8 state)
virtual void Activate(uint16 effectID, uint32 targetID=0, int16 repeat=0)
void WebbedMe(InventoryItemRef modRef, bool apply=false)
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)