|
Third Person Cover Shooter
1.6
|
Simulates a fighter, takes cover, assaults, uses weapons, throws grenades, etc. More...
Public Member Functions | |
| void | ToOpenFire () |
| Registers that the AI is currently firing. More... | |
| void | ToCloseFire () |
| Registers that the AI has stopped firing. More... | |
| void | ToSprintTo (Vector3 position) |
| Registers that the AI has started sprinting to a location. More... | |
| void | ToRunTo (Vector3 position) |
| Registers that the AI has started running to a location. More... | |
| void | ToWalkTo (Vector3 position) |
| Registers that the AI has started walking to a location. More... | |
| void | ToStopMoving () |
| Registers that the AI has stopped moving. More... | |
| void | ToCircle (Vector3 threat) |
| Registers that the AI has no target location to move to. More... | |
| void | ToWalkInDirection (Vector3 vector) |
| Registers that the AI has no target location to move to. More... | |
| void | ToRunInDirection (Vector3 vector) |
| Registers that the AI has no target location to move to. More... | |
| void | ToSprintInDirection (Vector3 vector) |
| Registers that the AI has no target location to move to. More... | |
| void | ToWalkFrom (Vector3 target) |
| Registers that the AI has no target location to move to. More... | |
| void | ToRunFrom (Vector3 target) |
| Registers that the AI has no target location to move to. More... | |
| void | ToSprintFrom (Vector3 target) |
| Registers that the AI has no target location to move to. More... | |
| void | ToKeepCloseTo (KeepCloseTo value) |
| Registers that the AI is told to keep close to a position. More... | |
| void | SetIdleAlertedState () |
| Sets the AI state to alerted. More... | |
| void | ToAttack (Actor target) |
| Sets the target threat and starts either taking cover or assaulting. More... | |
| void | ToEnterProcess (bool isFighting) |
| Enters a process. More... | |
| void | ToExitProcess () |
| Told that the process has stopped. More... | |
| void | ToExitProcessAndMaintainPosition () |
| Told to stop the process and maintain previous position if there was any. More... | |
| void | ToSetThreat (Threat threat) |
| Locks the AI on the given threat. More... | |
| void | ToHoldPosition (Vector3 position) |
| Starts maintaing the position. More... | |
| void | ToStopActions () |
| Removes threat and sets the AI state to idleButAlerted. More... | |
| override void | ToForget () |
| Forget about the enemy and return to patrol or idle state. More... | |
| void | ToBecomeScared () |
| Told by a component to be scared. More... | |
| void | ToMakeCall () |
| Told by a component to make a call. More... | |
| void | ToFindCover () |
| Told by a component to find a cover. More... | |
| void | ToFindDefenseCover (Vector3 position) |
| Told by a component to find a defensive cover. More... | |
| void | ToRegroupAround (AIBaseRegrouper regrouper) |
| Told by an outside command to regroup around a unit. More... | |
| void | ToFindAndMaintainPosition (AIBaseRegrouper regrouper) |
| Told by an outside command to regroup and maintain a position. More... | |
| void | AssaultResponse () |
| Registers existance of an assault component. More... | |
| void | CallResponse () |
| Registers that a call is being made. More... | |
| void | InvestigationResponse () |
| Registers existance of an investigation component. More... | |
| void | SearchResponse () |
| Registers existance of a search component. More... | |
| void | OnFinishSearch () |
| Notified that a search has finished. More... | |
| void | OnResurrect () |
| Notified that the AI has been resurected. More... | |
| void | OnDead () |
| Character is dead. More... | |
| void | OnAssaultStop () |
| Notified of an end of an assault. More... | |
| void | OnSeeDeath (Actor actor) |
| A death was witnessed. More... | |
| void | OnWaypointsFound () |
| Notified that the waypoint system has waypoints to visit. More... | |
| void | OnSpawn (Actor caller) |
| Event called during a spawning process. More... | |
| void | OnNeedLight () |
| One of the components declares a need for a light. More... | |
| void | OnDontNeedLight () |
| One of the components declares that a light is no longer needed. More... | |
| void | OnCallMade () |
| Registers a successful call. More... | |
| void | OnHit (Hit hit) |
| Registers damage done by a weapon. More... | |
| void | OnFriendHit (Actor friend) |
| Notified that a friend was hit. More... | |
| void | OnFinishTakeCover () |
| Notified by cover AI that target cover was taken. More... | |
| void | OnAlert (ref GeneratedAlert alert) |
| Notified by an alert system of an alert. More... | |
| void | OnFoundFriend (Actor friend) |
| Notified by communication AI that a friend was found. More... | |
| void | OnLostFriend (Actor friend) |
| Notified by communication AI that a friend got out of range. More... | |
| void | OnCivilianAlerted (Actor actor) |
| Notified that a civilian is alerted. More... | |
| void | OnFriendKnowsEnemy (Actor friend) |
| Notified by a friend that they found a new enemy position. More... | |
| void | OnFriendFoundEnemy (Actor friend) |
| Notified by a friend that they found a new enemy position. More... | |
| void | OnSeenByFriend (Actor friend) |
| Notified by a friend that the AI is seen by them. More... | |
| void | OnUnseenByFriend (Actor friend) |
| Notified by a friend that the AI is no longer visible by them. More... | |
| void | OnSeeActor (Actor actor) |
| Notified by the sight AI that an actor has entered the view. More... | |
| void | OnUnseeActor (Actor actor) |
| Notified by the sight AI that an actor has dissappeared from the view. More... | |
| void | OnInvalidCover () |
| Notified by the cover AI that the current cover is no longer valid. More... | |
| void | OnFoundCover () |
| Notified by the cover AI that a cover was found. More... | |
| void | OnNoCover () |
| Notified that no cover was found. More... | |
| void | OnCoverSearch () |
| Notified that a component has started to look for covers. More... | |
| void | OnCircleFail () |
| Notified by the movement AI that circling of an enemy is no longer viable. More... | |
| void | OnMoveFromFail () |
| Notified by the movement AI that a position can no longer be retreated from. More... | |
| void | OnPointInvestigated (Vector3 position) |
| Notified by the search AI that a position has been investigated. More... | |
Public Member Functions inherited from CoverShooter.BaseBrain | |
| void | OnEnterDanger () |
| Registers an entrance to a dangerous area. More... | |
| void | OnLeaveDanger () |
| Registers that the AI is leaving a dangerous area. More... | |
Public Member Functions inherited from CoverShooter.AIBase | |
| void | Message (string name) |
| Sends a message to other components. More... | |
| void | Message (string name, object value) |
| Sends a message to other components. More... | |
Public Attributes | |
| float | AvoidDistance = 4 |
| Enemy distance to trigger slow retreat. More... | |
| float | AllySpacing = 1.2f |
| Enemy distance to trigger slow retreat. More... | |
| float | StandDuration = 2 |
| Duration in seconds to stand fighting before changing state. More... | |
| float | CircleDuration = 2 |
| Duration in seconds to fight circling the enemy before changing state. More... | |
| float | CoverSwitchWait = 10 |
| Time in seconds for the AI to wait before switching to a better cover. More... | |
| float | GuessDistance = 30 |
| Distance at which the AI guesses the position on hearing instead of knowing it precisely. More... | |
| float | TakeCoverImmediatelyChance = 0 |
| Chance the AI will take cover immediately after learning of existance of an enemy. More... | |
| float | DistanceToGoToCoverFromStandOrCircle = 6 |
| AI won't go to cover if it is closer to the enemy than this value. More... | |
| bool | ImmediateThreatReaction = true |
| Should the AI attack threats immedietaly on seeing them. More... | |
| bool | AttackAggressors = true |
| Should the AI switch to attacking enemies that deal damage to the AI. More... | |
| AIStartSettings | Start = AIStartSettings.Default() |
| Settings for AI startup. More... | |
| FighterSpeedSettings | Speed = FighterSpeedSettings.Default() |
| Speed of the motor during various AI states. More... | |
| AIApproximationSettings | Approximation = new AIApproximationSettings(0, 10, 5, 30) |
| How accurately the AI guesses the position of an enemy. More... | |
| FighterRetreatSettings | Retreat = FighterRetreatSettings.Default() |
| Settings for AI retreats. More... | |
| FighterInvestigationWaitSettings | Investigation = FighterInvestigationWaitSettings.Default() |
| Settings for how long the AI waits before investigating. More... | |
| FighterGrenadeAvoidSettings | GrenadeAvoidance = FighterGrenadeAvoidSettings.Default() |
| Settings for how the fighter avoids other grenades. More... | |
| AIGrenadeSettings | Grenades = AIGrenadeSettings.Default() |
| Settings for AI grenades. More... | |
| bool | DebugThreat = false |
| Should a debug line be drawn towards the current threat. More... | |
Protected Member Functions | |
| override void | Awake () |
Protected Member Functions inherited from CoverShooter.BaseBrain | |
| void | RemoveThreat () |
| Unset the current threat. More... | |
| void | UnseeThreat () |
| Sets the threat state to unseen. More... | |
| void | SetUnseenThreat (bool isHeard, bool isDirect, Actor threat, Vector3 position, Cover threatCover) |
| Updates threat state. More... | |
| void | SetThreat (Actor threat, Vector3 position, Cover threatCover) |
| Updates threat state. More... | |
| void | SetThreat (bool isVisible, bool isHeard, bool isActual, Actor threat, Vector3 position, Cover threatCover, float time) |
| Updates threat state. More... | |
Properties | |
| bool | IsAlerted [get] |
| Is the AI currently alarmed. More... | |
| FighterState | State [get] |
| AI state the brain is at. More... | |
| float | InvestigationWait [get] |
| Time in seconds to wait for inspecting the last seen threat position. More... | |
| bool | IsInAggressiveMode [get] |
| Is the AI currently in an agressive mode. More... | |
| Actor | LockedThreat [get] |
| Threat actor that the AI is locked on. More... | |
Properties inherited from CoverShooter.BaseBrain | |
| Actor | Actor [get] |
| Actor component found in the same object. More... | |
| Actor | Threat [get] |
| Actor component of the threating character. More... | |
| Actor | ForgottenThreat [get] |
| Threat actor that was told to be forgotten. More... | |
| float | ThreatAge [get] |
| Time in seconds since the threat was last seen. More... | |
| Vector3 | LastKnownThreatPosition [get] |
| Last known position of the assigned threat. More... | |
| float | LastSeenThreatTime [get] |
| Time since level load that the threat was seen. More... | |
| bool | CanSeeTheThreat [get] |
| Is the threat currently seen. More... | |
| Cover | ThreatCover [get] |
| Cover that is currently known to be used by the threat. More... | |
| bool | IsActualThreatPosition [get] |
| Was the last known threat position a position the threat occupied or was it just an indirect explosion. More... | |
| bool | HasSeenTheEnemy [get] |
| Was any threat seen at least once. More... | |
| bool | HasHeardTheEnemy [get] |
| Was any threat heard at least once. More... | |
| Vector3 | StartingLocation [get] |
| Location at which the character started. More... | |
| bool | IsInDanger [get] |
| Is the AI currently in a dangerous area. More... | |
Simulates a fighter, takes cover, assaults, uses weapons, throws grenades, etc.
| void CoverShooter.FighterBrain.AssaultResponse | ( | ) |
Registers existance of an assault component.
|
protectedvirtual |
Reimplemented from CoverShooter.BaseBrain.
| void CoverShooter.FighterBrain.CallResponse | ( | ) |
Registers that a call is being made.
| void CoverShooter.FighterBrain.InvestigationResponse | ( | ) |
Registers existance of an investigation component.
| void CoverShooter.FighterBrain.OnAlert | ( | ref GeneratedAlert | alert | ) |
Notified by an alert system of an alert.
Implements CoverShooter.IAlertListener.
| void CoverShooter.FighterBrain.OnAssaultStop | ( | ) |
Notified of an end of an assault.
| void CoverShooter.FighterBrain.OnCallMade | ( | ) |
Registers a successful call.
| void CoverShooter.FighterBrain.OnCircleFail | ( | ) |
Notified by the movement AI that circling of an enemy is no longer viable.
| void CoverShooter.FighterBrain.OnCivilianAlerted | ( | Actor | actor | ) |
Notified that a civilian is alerted.
| void CoverShooter.FighterBrain.OnCoverSearch | ( | ) |
Notified that a component has started to look for covers.
| void CoverShooter.FighterBrain.OnDead | ( | ) |
Character is dead.
Implements CoverShooter.ICharacterHealthListener.
| void CoverShooter.FighterBrain.OnDontNeedLight | ( | ) |
One of the components declares that a light is no longer needed.
| void CoverShooter.FighterBrain.OnFinishSearch | ( | ) |
Notified that a search has finished.
Forgets about the previous threat as nothing was found during the search.
| void CoverShooter.FighterBrain.OnFinishTakeCover | ( | ) |
Notified by cover AI that target cover was taken.
| void CoverShooter.FighterBrain.OnFoundCover | ( | ) |
Notified by the cover AI that a cover was found.
| void CoverShooter.FighterBrain.OnFoundFriend | ( | Actor | friend | ) |
Notified by communication AI that a friend was found.
| void CoverShooter.FighterBrain.OnFriendFoundEnemy | ( | Actor | friend | ) |
Notified by a friend that they found a new enemy position.
| void CoverShooter.FighterBrain.OnFriendHit | ( | Actor | friend | ) |
Notified that a friend was hit.
| void CoverShooter.FighterBrain.OnFriendKnowsEnemy | ( | Actor | friend | ) |
Notified by a friend that they found a new enemy position.
| void CoverShooter.FighterBrain.OnHit | ( | Hit | hit | ) |
Registers damage done by a weapon.
| void CoverShooter.FighterBrain.OnInvalidCover | ( | ) |
Notified by the cover AI that the current cover is no longer valid.
| void CoverShooter.FighterBrain.OnLostFriend | ( | Actor | friend | ) |
Notified by communication AI that a friend got out of range.
| void CoverShooter.FighterBrain.OnMoveFromFail | ( | ) |
Notified by the movement AI that a position can no longer be retreated from.
| void CoverShooter.FighterBrain.OnNeedLight | ( | ) |
One of the components declares a need for a light.
| void CoverShooter.FighterBrain.OnNoCover | ( | ) |
Notified that no cover was found.
| void CoverShooter.FighterBrain.OnPointInvestigated | ( | Vector3 | position | ) |
Notified by the search AI that a position has been investigated.
| void CoverShooter.FighterBrain.OnResurrect | ( | ) |
Notified that the AI has been resurected.
Implements CoverShooter.ICharacterHealthListener.
| void CoverShooter.FighterBrain.OnSeeActor | ( | Actor | actor | ) |
Notified by the sight AI that an actor has entered the view.
| void CoverShooter.FighterBrain.OnSeeDeath | ( | Actor | actor | ) |
A death was witnessed.
| void CoverShooter.FighterBrain.OnSeenByFriend | ( | Actor | friend | ) |
Notified by a friend that the AI is seen by them.
| void CoverShooter.FighterBrain.OnSpawn | ( | Actor | caller | ) |
Event called during a spawning process.
| void CoverShooter.FighterBrain.OnUnseeActor | ( | Actor | actor | ) |
Notified by the sight AI that an actor has dissappeared from the view.
| void CoverShooter.FighterBrain.OnUnseenByFriend | ( | Actor | friend | ) |
Notified by a friend that the AI is no longer visible by them.
| void CoverShooter.FighterBrain.OnWaypointsFound | ( | ) |
Notified that the waypoint system has waypoints to visit.
| void CoverShooter.FighterBrain.SearchResponse | ( | ) |
Registers existance of a search component.
| void CoverShooter.FighterBrain.SetIdleAlertedState | ( | ) |
Sets the AI state to alerted.
| void CoverShooter.FighterBrain.ToAttack | ( | Actor | target | ) |
Sets the target threat and starts either taking cover or assaulting.
| void CoverShooter.FighterBrain.ToBecomeScared | ( | ) |
Told by a component to be scared.
| void CoverShooter.FighterBrain.ToCircle | ( | Vector3 | threat | ) |
Registers that the AI has no target location to move to.
| void CoverShooter.FighterBrain.ToCloseFire | ( | ) |
Registers that the AI has stopped firing.
| void CoverShooter.FighterBrain.ToEnterProcess | ( | bool | isFighting | ) |
Enters a process.
Is told if can fire during it.
| void CoverShooter.FighterBrain.ToExitProcess | ( | ) |
Told that the process has stopped.
Sets the idle but alerted AI state.
| void CoverShooter.FighterBrain.ToExitProcessAndMaintainPosition | ( | ) |
Told to stop the process and maintain previous position if there was any.
| void CoverShooter.FighterBrain.ToFindAndMaintainPosition | ( | AIBaseRegrouper | regrouper | ) |
Told by an outside command to regroup and maintain a position.
| void CoverShooter.FighterBrain.ToFindCover | ( | ) |
Told by a component to find a cover.
| void CoverShooter.FighterBrain.ToFindDefenseCover | ( | Vector3 | position | ) |
Told by a component to find a defensive cover.
|
virtual |
Forget about the enemy and return to patrol or idle state.
Reimplemented from CoverShooter.BaseBrain.
| void CoverShooter.FighterBrain.ToHoldPosition | ( | Vector3 | position | ) |
Starts maintaing the position.
| void CoverShooter.FighterBrain.ToKeepCloseTo | ( | KeepCloseTo | value | ) |
Registers that the AI is told to keep close to a position.
| void CoverShooter.FighterBrain.ToMakeCall | ( | ) |
Told by a component to make a call.
| void CoverShooter.FighterBrain.ToOpenFire | ( | ) |
Registers that the AI is currently firing.
| void CoverShooter.FighterBrain.ToRegroupAround | ( | AIBaseRegrouper | regrouper | ) |
Told by an outside command to regroup around a unit.
| void CoverShooter.FighterBrain.ToRunFrom | ( | Vector3 | target | ) |
Registers that the AI has no target location to move to.
| void CoverShooter.FighterBrain.ToRunInDirection | ( | Vector3 | vector | ) |
Registers that the AI has no target location to move to.
| void CoverShooter.FighterBrain.ToRunTo | ( | Vector3 | position | ) |
Registers that the AI has started running to a location.
| void CoverShooter.FighterBrain.ToSetThreat | ( | Threat | threat | ) |
Locks the AI on the given threat.
| void CoverShooter.FighterBrain.ToSprintFrom | ( | Vector3 | target | ) |
Registers that the AI has no target location to move to.
| void CoverShooter.FighterBrain.ToSprintInDirection | ( | Vector3 | vector | ) |
Registers that the AI has no target location to move to.
| void CoverShooter.FighterBrain.ToSprintTo | ( | Vector3 | position | ) |
Registers that the AI has started sprinting to a location.
| void CoverShooter.FighterBrain.ToStopActions | ( | ) |
Removes threat and sets the AI state to idleButAlerted.
| void CoverShooter.FighterBrain.ToStopMoving | ( | ) |
Registers that the AI has stopped moving.
| void CoverShooter.FighterBrain.ToWalkFrom | ( | Vector3 | target | ) |
Registers that the AI has no target location to move to.
| void CoverShooter.FighterBrain.ToWalkInDirection | ( | Vector3 | vector | ) |
Registers that the AI has no target location to move to.
| void CoverShooter.FighterBrain.ToWalkTo | ( | Vector3 | position | ) |
Registers that the AI has started walking to a location.
| float CoverShooter.FighterBrain.AllySpacing = 1.2f |
Enemy distance to trigger slow retreat.
| AIApproximationSettings CoverShooter.FighterBrain.Approximation = new AIApproximationSettings(0, 10, 5, 30) |
How accurately the AI guesses the position of an enemy.
| bool CoverShooter.FighterBrain.AttackAggressors = true |
Should the AI switch to attacking enemies that deal damage to the AI.
| float CoverShooter.FighterBrain.AvoidDistance = 4 |
Enemy distance to trigger slow retreat.
| float CoverShooter.FighterBrain.CircleDuration = 2 |
Duration in seconds to fight circling the enemy before changing state.
| float CoverShooter.FighterBrain.CoverSwitchWait = 10 |
Time in seconds for the AI to wait before switching to a better cover.
| bool CoverShooter.FighterBrain.DebugThreat = false |
Should a debug line be drawn towards the current threat.
| float CoverShooter.FighterBrain.DistanceToGoToCoverFromStandOrCircle = 6 |
AI won't go to cover if it is closer to the enemy than this value.
Only used when the enemy has been known for awhile.
| FighterGrenadeAvoidSettings CoverShooter.FighterBrain.GrenadeAvoidance = FighterGrenadeAvoidSettings.Default() |
Settings for how the fighter avoids other grenades.
| AIGrenadeSettings CoverShooter.FighterBrain.Grenades = AIGrenadeSettings.Default() |
Settings for AI grenades.
| float CoverShooter.FighterBrain.GuessDistance = 30 |
Distance at which the AI guesses the position on hearing instead of knowing it precisely.
| bool CoverShooter.FighterBrain.ImmediateThreatReaction = true |
Should the AI attack threats immedietaly on seeing them.
| FighterInvestigationWaitSettings CoverShooter.FighterBrain.Investigation = FighterInvestigationWaitSettings.Default() |
Settings for how long the AI waits before investigating.
| FighterRetreatSettings CoverShooter.FighterBrain.Retreat = FighterRetreatSettings.Default() |
Settings for AI retreats.
| FighterSpeedSettings CoverShooter.FighterBrain.Speed = FighterSpeedSettings.Default() |
Speed of the motor during various AI states.
| float CoverShooter.FighterBrain.StandDuration = 2 |
Duration in seconds to stand fighting before changing state.
| AIStartSettings CoverShooter.FighterBrain.Start = AIStartSettings.Default() |
Settings for AI startup.
| float CoverShooter.FighterBrain.TakeCoverImmediatelyChance = 0 |
Chance the AI will take cover immediately after learning of existance of an enemy.
|
get |
Time in seconds to wait for inspecting the last seen threat position.
|
get |
Is the AI currently alarmed.
|
get |
Is the AI currently in an agressive mode.
Aggressivness determines if the AI immediately attacks threats seen.
|
get |
Threat actor that the AI is locked on.
Other threats are ignored.
|
get |
AI state the brain is at.