Emergency 2017 Dokumentation  v3.0.1
em5::GangsterDemoExtremist Class Reference

Game logic for gangster type used in "Demonstration" Emergency 2017 campaign mini-event. More...

#include <GangsterDemoExtremist.h>

Public Member Functions

 GangsterDemoExtremist ()
 
- 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 bool onStartup () override
 
virtual void onShutdown () override
 
- 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 Public Attributes inherited from em5::GangsterBaseLogic
static const uint32 GAMELOGIC_TYPE_ID
 

Protected Member Functions

void onSimulationUpdate (const qsf::JobArguments &jobArguments) override
 Called once a tick. More...
 
void onIdle () override
 Called in case gangster has no action right now. More...
 
void onUnitsSpotted (std::vector< SpottedUnit > &sightedPoliceUnits) override
 Called when there were any units spotted which are considered targets of the gangster. More...
 
void onNoUnitsSpotted () override
 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...
 
- 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 ()
 Helper method to check whether the gangster's current action is a fleeing action. More...
 
bool isCurrentlyFighting ()
 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 onWaypointReached (const Waypoint &waypoint)
 Called when the next waypoint was just reached. 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  State { STATE_NORMAL, STATE_ARRESTED }
 
enum  EscapeType {
  ESCAPE_FOOT_LONG, ESCAPE_FOOT_SHORT, ESCAPE_HIDE_FOOT, ESCAPE_CAR_LONG,
  ESCAPE_CAR_SHORT
}
 
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 "Demonstration" Emergency 2017 campaign mini-event.

Todo:
  • TODO(fw): If this class stays as empty as it is when writing this, please remove it again

Definition at line 33 of file GangsterDemoExtremist.h.

Constructor & Destructor Documentation

em5::GangsterDemoExtremist::GangsterDemoExtremist ( )

Member Function Documentation

void em5::GangsterDemoExtremist::onIdle ( )
overrideprotectedvirtual

Called in case gangster has no action right now.

Remarks
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.

void em5::GangsterDemoExtremist::onNoUnitsSpotted ( )
overrideprotectedvirtual

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.

Remarks
The method is called every simulation step in case there are NO units in the target range. Else onUnitsSpotted() will be called instead with the found units
Note
  • This only gets called at all if "mUseOldSpottedUnitsLogic" is set to "true"

Reimplemented from em5::GangsterBaseLogic.

void em5::GangsterDemoExtremist::onSimulationUpdate ( const qsf::JobArguments jobArguments)
overrideprotectedvirtual

Called once a tick.

Remarks
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.

void em5::GangsterDemoExtremist::onUnitsSpotted ( std::vector< SpottedUnit > &  sightedPoliceUnits)
overrideprotectedvirtual

Called when there were any units spotted which are considered targets of the gangster.

Remarks
The method is called every simulation step in case there are units in the target range. Else onNoUnitsSpotted() will be called instead. Injured, Dead, Burning and Destroyed units are excluded!
Note
  • This only gets called at all if "mUseOldSpottedUnitsLogic" is set to "true"

Reimplemented from em5::GangsterBaseLogic.

Member Data Documentation

const uint32 em5::GangsterDemoExtremist::GAMELOGIC_TYPE_ID
static

Definition at line 41 of file GangsterDemoExtremist.h.


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