Emergency 20 Dokumentation  4.2.0
em5::GangsterME301Arsonist Class Reference

Game logic for gangster type used in "Arsonist" Emergency 20 years event. More...

#include <GangsterME301Arsonist.h>

Inheritance diagram for em5::GangsterME301Arsonist:
em5::GangsterBaseLogic qsf::GameLogic qsf::WeakPtrTarget

Public Member Functions

 GangsterME301Arsonist ()
void setTimeToStartFire (qsf::Time time)
void setFirefighterBuildingEvacuateTime (qsf::Time time)
void setMaxBurningObjectsToStartFire (uint32 value)
void initializeWithTargets (const std::vector< qsf::Entity * > &targetBuildings)
void startFireAtRandomTarget ()
void placeAtNextTarget ()
virtual bool onStartup () override
 If overriding this function in derived class, make sure to call this function to make sure startup process is correct. More...
- Public Member Functions inherited from em5::GangsterBaseLogic
 GangsterBaseLogic ()
 Default constructor. More...
 GangsterBaseLogic (uint32 gameLogicId)
 Constructor. More...
virtual ~GangsterBaseLogic ()
 Destructor. More...
void applyGangsterType (const GangsterType &gangsterType)
std::string getDebugGangsterName () const
 Return the GangsterLogic class and, if existing, the gangster type name. More...
WeaponFlagSet getEquippedWeaponTypes () const
void setEquippedWeaponTypes (WeaponFlagSet weapons)
State getCurrentState () const
void setCurrentState (State newState)
bool getAsGangsterFlagged () const
void setAsGangsterFlagged (bool isGangster)
AutoReaction getIdleReaction () const
void setIdleReaction (AutoReaction autoReaction)
AutoReaction getAutoTargetReaction () const
void setAutoTargetReaction (AutoReaction autoReaction)
bool getAutoAggression () const
void setAutoAggression (bool autoAggression)
float getAutoAggroRange () const
void setAutoAggroRange (float autoAggroRange)
float getAutoDeAggroRange () const
void setAutoDeAggroRange (float autoAggroRange)
bool getResistArrest () const
void setResistArrest (bool resistArrest)
weapon::WeaponConfigurationgetConfigurationForWeapon (weapon::Weapon usedWeapon)
const weapon::WeaponConfigurationgetConfigurationForWeapon (weapon::Weapon usedWeapon) const
void setWeaponAttackDistance (weapon::Weapon weapon, float distance)
 Sets the attack distance required for a specific weapon. More...
float getWeaponAttackDistance (weapon::Weapon weapon) const
void addAutoTargetEventTag (const qsf::StringHash &eventTag, uint32 priority)
qsf::Time getCelebrateWinTime () const
void setCelebrateWinTime (qsf::Time celebrateWinTime)
void setChainReaction (bool active)
 Sets the chain reaction feature active. This will listen to injured gangster in aggro range and start autoreact on this targert. More...
bool getChainReaction ()
void attack (qsf::Entity &targetEntity)
 The gangster attacks the given target with the given weapon. More...
void escape (EscapeType escapeType)
void setEscapeTargetTag (const std::string &escapeTargetTag)
void setLastGangsterLogic (uint32 lastLogicId)
 Stores the gangster logic that belonged to this gangster before the current one. More...
qsf::EntitygetCurrentAutoAggresionTarget ()
void hideCurrentWeapon ()
 Call to let the currently active gangster weapon vanish (if any) More...
void showWeapon (const std::string &equipmentPrefab)
 Call to create a new weapon from prefab and make it visible (equipped) More...
bool getPatrolOnWaypoints () const
void setPatrolOnWaypoints (bool patrol)
void clearWaypoints ()
 Clear list of waypoints. More...
void addWaypoint (qsf::Entity &waypointEntity, uint32 targetPointProviderId=qsf::getUninitialized< uint32 >(), uint32 movementModeId=qsf::getUninitialized< uint32 >())
 Add a waypoint to the end of the waypoint list. More...
void addWaypoint (glm::vec3 waypointPosition, uint32 movementModeId=qsf::getUninitialized< uint32 >())
virtual float getMovingSpeed () const
 Returns the moving speed with which the gangster should move. More...
virtual void onShutdown () override
 If overriding this function in derived class, make sure to call this function to make sure shutdown process is correct. More...
- Public Member Functions inherited from qsf::GameLogic
virtual ~GameLogic ()
 Destructor. More...
uint32 getId () const
 Get the game logic's unique ID. More...
uint32 getTypeId () const
 Get the game logic's type ID. More...
uint64 getEntityId () const
 Get the owning entity's ID or zero if there is none. More...
EntitygetEntity () const
 Get the owning entity or a null pointer if there is none. More...
EntitygetEntitySafe () const
 Get the owning entity or a null pointer if there is none. More...
MapgetMap () const
 Get the associated map of the game logic. More...
bool startup ()
 Startup the game logic. More...
bool isRunning () const
 Return whether or not the game logic is up-and-running. More...
void shutdown ()
 Shutdown the game logic. More...
bool isDebug () const
 Return whether or not the logic is considered to be in debug mode. More...
void setDebug (bool debugMode)
 Set whether or not the logic is considered to be in debug mode. More...
virtual void serialize (BinarySerializer &serializer)
 Serialize or deserialize the game logic using a binary serializer. More...

Static Public Attributes

static const uint32 GAMELOGIC_TYPE_ID
static const uint32 MESSAGE_FIRE_STARTED
- Static Public Attributes inherited from em5::GangsterBaseLogic
static const uint32 GAMELOGIC_TYPE_ID

Protected Member Functions

virtual void onSimulationUpdate (const qsf::JobArguments &jobArguments) override
 Called once a tick. More...
virtual void onIdle () override
 Called in case gangster has no action right now. More...
virtual void onWaypointReached (const Waypoint &waypoint) override
 Called when the next waypoint was just reached. More...
- Protected Member Functions inherited from em5::GangsterBaseLogic
bool changeLogic (const qsf::StringHash &newLogicId)
 Helper method to replace the current gangster game logic (When the gangster should change his behavior) More...
bool isCurrentlyFleeing () const
 Helper method to check whether the gangster's current action is a fleeing action. More...
bool isCurrentlyFighting () const
 Helper method to check whether the gangster's current action is a fighting action, i.e. Shoot, ThrownWeapon, CloseQuartersCombat. More...
void fearNearbyCivilists ()
 Give all civil persons around a little fear. More...
void updateCatchedByPolice ()
 If escaping, check if nearly police is attacking the gangster and tell the escape action to slowdown movement. So player units a chance to catch them. More...
virtual void onUnitsSpotted (std::vector< SpottedUnit > &sightedPoliceUnits)
 Called when there were any units spotted which are considered targets of the gangster. More...
virtual void onNoUnitsSpotted ()
 This is the counterpart to onUnitsSpotted. Implement it (not in here, override it!) if you need to be notified when no police units are in range. More...
virtual void onPersonGetsShoot (const qsf::MessageParameters &parameters)
virtual void onGunShot (const qsf::MessageParameters &parameters)
- Protected Member Functions inherited from qsf::GameLogic
virtual void onSetDebug (bool debug)
 Set whether or not the logic is considered to be in debug mode. More...
void removeThis ()
 GameLogic (uint32 typeId)
 Constructor. More...
void registrationAtManager (GameLogicManager &manager, uint32 id)
 Registering call from manager. More...
- Protected Member Functions inherited from qsf::WeakPtrTarget
 WeakPtrTarget ()
 Default constructor. More...
 WeakPtrTarget (const WeakPtrTarget &other)
 Copy constructor. More...
 WeakPtrTarget (WeakPtrTarget &&)=delete
 Delete the move constructor, as WeakPtrTarget would need a proper move constructor-implementation that ensures that its pointer gets updated in the WeakPtrBase as well. More...
 ~WeakPtrTarget ()
 Destructor. More...
void invalidateAllWeakPtr ()
 Invalidate all weak pointers to this object. More...
void operator= (const WeakPtrTarget &other)
 Copy operator. More...

Additional Inherited Members

- Public Types inherited from em5::GangsterBaseLogic
enum  EscapeType {
enum  AutoReaction { AutoReaction::NONE, AutoReaction::ATTACK, AutoReaction::ESCAPE_SHORT, AutoReaction::ESCAPE_LONG }
typedef qsf::EnumBitmask< uint16, weapon::WeaponWeaponFlagSet
typedef PossibleTarget SpottedUnit
- Protected Types inherited from em5::GangsterBaseLogic
typedef boost::container::flat_map< qsf::StringHash, uint32PriorityByEventTagMap
- Protected Attributes inherited from em5::GangsterBaseLogic
const GangsterTypemGangsterType
 Gangster type; may be a null pointer, do not destroy the instance. More...
WeaponFlagSet mEquippedWeaponTypes
 Indicates which weapons the gangster has. More...
uint32 mLastGangsterLogicId
 In case this gangster logic was changed, this variable holds the former logic. More...
qsf::WeakPtr< qsf::TransformComponentmTransformComponent
 Caching of gangster's transform component. More...
qsf::WeakPtr< qsf::ActionComponentmActionComponent
 Caching of gangster's action component. More...
bool mSetGangsterFlagOnStartup
 If set, the gangster will be visible as gangster to the player from the beginning. More...
bool mAlwaysShowWeapon
 Flag whether this gangster type show his weapon/ carries it visibly. More...
bool mUseOldSpottedUnitsLogic
 Backwards compatibility mode. More...
bool mConsiderAllUnitsAsTarget
 Flag whether this gangster type should not only attack police units, but any unit. More...
bool mChainReaction
 If set, gangster will detect if nearby gangster are attacked. More...
std::string mEscapeTargetTag
 Event tag of the target spawn point to escape to. More...
AutoReaction mIdleReaction
 What to do when idling. More...
AutoReaction mAutoTargetReaction
 Reaction to targets in aggro range. More...
bool mAutoAggression
 Lets a gangster search for targets to attack. More...
float mAutoAggroRange
 Range this gangster searches to targets. More...
float mAutoDeAggroRange
 Range where this gangster ignored the target. More...
qsf::WeakPtr< qsf::EntitymCurrentAutoTarget
 The current target. More...
uint32 mCurrentAutoTargetPriority
PriorityByEventTagMap mAutoTargetPrioritiesByEventTag
 Event tags we want to attack, and their priorities (usually between 1 and 5; the higher, the more important) More...
qsf::Time mCelebrateWinTime
 Time to celebrate a win. More...
weapon::WeaponConfiguration mWeaponConfigurationForPistol
 Contains all weapon-specific settings for pistol usage. More...
weapon::WeaponConfiguration mWeaponConfigurationForRifle
 Contains all weapon-specific settings for rifle usage. More...
std::deque< WaypointmWaypoints
 Waypoints the gangster will try to go to if he has nothing better to do. More...
bool mPatrolOnWaypoints
 If set, the gangster will repeatedly cycle through his waypoints, and won't run in between. More...
bool mNeedsUpdateInContainer
 If "false", the gangster won't get updates if inside a container. More...

Detailed Description

Game logic for gangster type used in "Arsonist" Emergency 20 years event.

Constructor & Destructor Documentation

em5::GangsterME301Arsonist::GangsterME301Arsonist ( )

Member Function Documentation

void em5::GangsterME301Arsonist::initializeWithTargets ( const std::vector< qsf::Entity * > &  targetBuildings)
virtual void em5::GangsterME301Arsonist::onIdle ( )

Called in case gangster has no action right now.

The method is called every simulation step in case there is no action left in the action plan. It is called after the simulation update. Implementation in sub-classes is optional.

Reimplemented from em5::GangsterBaseLogic.

virtual void em5::GangsterME301Arsonist::onSimulationUpdate ( const qsf::JobArguments jobArguments)

Called once a tick.

The method is not called if gangster is inside a container or cannot act right now (e.g. when injured or arrested)

Reimplemented from em5::GangsterBaseLogic.

virtual bool em5::GangsterME301Arsonist::onStartup ( )

If overriding this function in derived class, make sure to call this function to make sure startup process is correct.

Reimplemented from em5::GangsterBaseLogic.

virtual void em5::GangsterME301Arsonist::onWaypointReached ( const Waypoint waypoint)

Called when the next waypoint was just reached.

Reimplemented from em5::GangsterBaseLogic.

void em5::GangsterME301Arsonist::placeAtNextTarget ( )
void em5::GangsterME301Arsonist::setFirefighterBuildingEvacuateTime ( qsf::Time  time)
void em5::GangsterME301Arsonist::setMaxBurningObjectsToStartFire ( uint32  value)
void em5::GangsterME301Arsonist::setTimeToStartFire ( qsf::Time  time)
void em5::GangsterME301Arsonist::startFireAtRandomTarget ( )

Member Data Documentation

const uint32 em5::GangsterME301Arsonist::GAMELOGIC_TYPE_ID
const uint32 em5::GangsterME301Arsonist::MESSAGE_FIRE_STARTED

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