Show / Hide Table of Contents

Class MobStateSystem

Inheritance
System.Object
MobStateSystem
Namespace: Content.Shared.Mobs.Systems
Assembly: Content.Shared.dll
Syntax
public class MobStateSystem : EntitySystem

Methods

| Improve this Doc View Source

ChangeMobState(EntityUid, MobState, MobStateComponent, Nullable<EntityUid>)

Change the MobState and trigger MobState update events

Declaration
public void ChangeMobState(EntityUid entity, MobState mobState, MobStateComponent component = null, EntityUid? origin = null)
Parameters
Type Name Description
EntityUid entity

Target Entity we want to change the MobState of

MobState mobState

The new MobState we want to set

MobStateComponent component

MobState Component attached to the entity

System.Nullable<EntityUid> origin

Entity that caused the state update (if applicable)

| Improve this Doc View Source

HasState(EntityUid, MobState, MobStateComponent)

Check if an Entity can be set to a particular MobState

Declaration
public bool HasState(EntityUid entity, MobState mobState, MobStateComponent component = null)
Parameters
Type Name Description
EntityUid entity

Target Entity

MobState mobState

MobState to check

MobStateComponent component

MobState Component owned by the target

Returns
Type Description
System.Boolean

If the entity can be set to that MobState

| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
| Improve this Doc View Source

IsAlive(EntityUid, MobStateComponent)

Check if a Mob is Alive

Declaration
public bool IsAlive(EntityUid target, MobStateComponent component = null)
Parameters
Type Name Description
EntityUid target

Target Entity

MobStateComponent component

The MobState component owned by the target

Returns
Type Description
System.Boolean

If the entity is alive

| Improve this Doc View Source

IsCritical(EntityUid, MobStateComponent)

Check if a Mob is Critical

Declaration
public bool IsCritical(EntityUid target, MobStateComponent component = null)
Parameters
Type Name Description
EntityUid target

Target Entity

MobStateComponent component

The MobState component owned by the target

Returns
Type Description
System.Boolean

If the entity is Critical

| Improve this Doc View Source

IsDead(EntityUid, MobStateComponent)

Check if a Mob is Dead

Declaration
public bool IsDead(EntityUid target, MobStateComponent component = null)
Parameters
Type Name Description
EntityUid target

Target Entity

MobStateComponent component

The MobState component owned by the target

Returns
Type Description
System.Boolean

If the entity is Dead

| Improve this Doc View Source

IsIncapacitated(EntityUid, MobStateComponent)

Check if a Mob is Critical or Dead

Declaration
public bool IsIncapacitated(EntityUid target, MobStateComponent component = null)
Parameters
Type Name Description
EntityUid target

Target Entity

MobStateComponent component

The MobState component owned by the target

Returns
Type Description
System.Boolean

If the entity is Critical or Dead

| Improve this Doc View Source

IsInvalidState(EntityUid, MobStateComponent)

Check if a Mob is in an Invalid state

Declaration
public bool IsInvalidState(EntityUid target, MobStateComponent component = null)
Parameters
Type Name Description
EntityUid target

Target Entity

MobStateComponent component

The MobState component owned by the target

Returns
Type Description
System.Boolean

If the entity is in an Invalid State

| Improve this Doc View Source

OnEnterState(EntityUid, MobStateComponent, MobState)

Called when a new MobState is entered.

Declaration
protected virtual void OnEnterState(EntityUid entity, MobStateComponent component, MobState state)
Parameters
Type Name Description
EntityUid entity

The owner of the MobState Component

MobStateComponent component

MobState Component owned by the target

MobState state

The new MobState

| Improve this Doc View Source

OnExitState(EntityUid, MobStateComponent, MobState)

Called when a new MobState is exited.

Declaration
protected virtual void OnExitState(EntityUid entity, MobStateComponent component, MobState state)
Parameters
Type Name Description
EntityUid entity

The owner of the MobState Component

MobStateComponent component

MobState Component owned by the target

MobState state

The old MobState

| Improve this Doc View Source

OnStateChanged(EntityUid, MobStateComponent, MobState, MobState)

Called when this entity changes MobState

Declaration
protected virtual void OnStateChanged(EntityUid entity, MobStateComponent component, MobState oldState, MobState newState)
Parameters
Type Name Description
EntityUid entity

The owner of the MobState Component

MobStateComponent component

MobState Component owned by the target

MobState oldState

The previous MobState

MobState newState

The new MobState

| Improve this Doc View Source

UpdateMobState(EntityUid, MobStateComponent, Nullable<EntityUid>)

Run a MobState update check. This will trigger update events if the state has been changed.

Declaration
public void UpdateMobState(EntityUid entity, MobStateComponent component = null, EntityUid? origin = null)
Parameters
Type Name Description
EntityUid entity

Target Entity we want to change the MobState of

MobStateComponent component

MobState Component attached to the entity

System.Nullable<EntityUid> origin

Entity that caused the state update (if applicable)

  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾