Table of Contents

Class Bot

Namespace
DefaultNamespace
Assembly
Assembly-CSharp.dll
public class Bot : MonoBehaviour, IHasPatrolGroup
Inheritance
Bot
Implements
Inherited Members
Extension Methods

Constructors

Bot()

public Bot()

Fields

aggro

public bool aggro

Field Value

bool

alertable

public bool alertable

Field Value

bool

animMoveSpeedFactor

public float animMoveSpeedFactor

Field Value

float

attackType

public int attackType

Field Value

int

attacking

public bool attacking

Field Value

bool

botSounds

public UniversalBotSounds botSounds

Field Value

UniversalBotSounds

busy

public bool busy

Field Value

bool

canJumpScareFromBehind

public bool canJumpScareFromBehind

Field Value

bool

centerTransform

public Transform centerTransform

Field Value

Transform

conditionalObject

public GameObject conditionalObject

Field Value

GameObject

currentPlayerCheckID

public int currentPlayerCheckID

Field Value

int

distanceToTarget

public float distanceToTarget

Field Value

float

distanceToTarget_Flat

public float distanceToTarget_Flat

Field Value

float

flashLightRequireLineOfSight

public bool flashLightRequireLineOfSight

Field Value

bool

framesSincePatrol

public int framesSincePatrol

Field Value

int

groundTransform

public Transform groundTransform

Field Value

Transform

hasBeenSearchingFor

public float hasBeenSearchingFor

Field Value

float

hasConditionalObject

public bool hasConditionalObject

Field Value

bool

hasSearchPoint

public bool hasSearchPoint

Field Value

bool

hurt

public bool hurt

Field Value

bool

ignoredPlayers

public List<Player> ignoredPlayers

Field Value

List<Player>

jumpScareLevel

public int jumpScareLevel

Field Value

int

lastGodNavPos

public Vector3 lastGodNavPos

Field Value

Vector3

lastNoisePos

public Vector3 lastNoisePos

Field Value

Vector3

lastPatrolPoint

public PatrolPoint lastPatrolPoint

Field Value

PatrolPoint

lastPlayerID

public int lastPlayerID

Field Value

int

lightLevelRequired

public int lightLevelRequired

Field Value

int

m_OnTargetChangeAction

public Action m_OnTargetChangeAction

Field Value

Action

moveSpeedMultiplier

public float moveSpeedMultiplier

Field Value

float

navDestination_Read

public Vector3 navDestination_Read

Field Value

Vector3

navDirection_Read

public Vector3 navDirection_Read

Field Value

Vector3

navOffset

public Vector3 navOffset

Field Value

Vector3

navTargetPos_Set

public Vector3 navTargetPos_Set

Field Value

Vector3

navigationSpeedAdjustment

public float navigationSpeedAdjustment

Field Value

float

nrOfAlerts

public int nrOfAlerts

Field Value

int

patrolGroups

public List<PatrolPoint.PatrolGroup> patrolGroups

Field Value

List<PatrolPoint.PatrolGroup>

patrolLeader

public Bot patrolLeader

Field Value

Bot

patrolPoint

public PatrolPoint patrolPoint

Field Value

PatrolPoint

remainingNavDistance

public float remainingNavDistance

Field Value

float

searchPoint

public Vector3 searchPoint

Field Value

Vector3

seeBodypartValue

public float seeBodypartValue

Field Value

float

sinceAlert

public float sinceAlert

Field Value

float

sinceAttack

public float sinceAttack

Field Value

float

sinceFlashLit

public float sinceFlashLit

Field Value

float

sinceFlashLit_LevelLight

public float sinceFlashLit_LevelLight

Field Value

float

sinceFlashLit_PlayerLight

public float sinceFlashLit_PlayerLight

Field Value

float

sinceHeardNoise

public float sinceHeardNoise

Field Value

float

sinceLastSawTarget

public float sinceLastSawTarget

Field Value

float

sinceLookForTarget

public float sinceLookForTarget

Field Value

float

sinceSyncAttacking

public float sinceSyncAttacking

Field Value

float

slowDownWhenNavigating

public bool slowDownWhenNavigating

Field Value

bool

suspicionValue

public float suspicionValue

Field Value

float

syncData

public Bot.SyncData syncData

Field Value

Bot.SyncData

targetAngle

public float targetAngle

Field Value

float

targetAngle_Nav

public float targetAngle_Nav

Field Value

float

targetBodypart

public Rigidbody targetBodypart

Field Value

Rigidbody

targetIsHiding

public bool targetIsHiding

Field Value

bool

targetOutOfRangeFor

public float targetOutOfRangeFor

Field Value

float

targetPlayer

public Player targetPlayer

Field Value

Player

targetUnReachable

public bool targetUnReachable

Field Value

bool

teleportAction

public Action<Vector3> teleportAction

Field Value

Action<Vector3>

turnVel

public float turnVel

Field Value

float

view

public PhotonView view

Field Value

PhotonView

Methods

AbleToAttack(float, float, Player)

public bool AbleToAttack(float range = 4, float minSinceAttack = 2.5, Player playerReference = null)

Parameters

range float
minSinceAttack float
playerReference Player

Returns

bool

AddOnTargetChangeAction(Action)

public void AddOnTargetChangeAction(Action a)

Parameters

a Action

Alert(Vector3, int)

public void Alert(Vector3 alertPosition, int alerts = 1)

Parameters

alertPosition Vector3
alerts int

AngleToLookDirection(Vector3)

public float AngleToLookDirection(Vector3 direction)

Parameters

direction Vector3

Returns

float

Back()

public void Back()

BusyOrAttacking()

public bool BusyOrAttacking()

Returns

bool

CanSee(Vector3, Vector3, float, float)

public bool CanSee(Vector3 from, Vector3 to, float maxDistance, float maxAngle)

Parameters

from Vector3
to Vector3
maxDistance float
maxAngle float

Returns

bool

CanSeeTarget(Vector3, float)

public bool CanSeeTarget(Vector3 headPosition, float angle = 110)

Parameters

headPosition Vector3
angle float

Returns

bool

Center()

public Vector3 Center()

Returns

Vector3

ChaseTarget(Vector3, float, float, bool, float, bool, bool, bool)

public void ChaseTarget(Vector3 headPosition, float targetDistance = 1.75, float sidePrediction = 1, bool lookForBetterTarget = true, float rotationSpeed = 3, bool loseInterestIfUnreachable = false, bool backUpIfTooClose = true, bool canRotateWhenStandingStill = true)

Parameters

headPosition Vector3
targetDistance float
sidePrediction float
lookForBetterTarget bool
rotationSpeed float
loseInterestIfUnreachable bool
backUpIfTooClose bool
canRotateWhenStandingStill bool

Destroy()

public void Destroy()

DoNavigationSlowing()

public void DoNavigationSlowing()

DoNothing()

public void DoNothing()

GetGroup()

public List<PatrolPoint.PatrolGroup> GetGroup()

Returns

List<PatrolPoint.PatrolGroup>

GetNearbyPlayerInSight(float, float)

public Player GetNearbyPlayerInSight(float range, float angle)

Parameters

range float
angle float

Returns

Player

GetTargetPlayer()

public void GetTargetPlayer()

GroundPos()

public Vector3 GroundPos()

Returns

Vector3

HasRecentNoise()

public bool HasRecentNoise()

Returns

bool

IgnoreTargetFor(Player, float)

public void IgnoreTargetFor(Player target, float ignoreFor)

Parameters

target Player
ignoreFor float

Investigate()

public void Investigate()

InvestigateCurrentTarget(Vector3, float, float, float, bool, bool)

public void InvestigateCurrentTarget(Vector3 headPos, float aggroSpeed = 1, float maxRange = 30, float rotationSpeed = 3, bool lookAt = true, bool searchPoint = true)

Parameters

headPos Vector3
aggroSpeed float
maxRange float
rotationSpeed float
lookAt bool
searchPoint bool

KeepDistanceHover(Vector3, float, float)

public void KeepDistanceHover(Vector3 pos, float distance, float sideMove)

Parameters

pos Vector3
distance float
sideMove float

Look(Vector3, float)

public void Look(Vector3 direction, float rotationSpeed = 3)

Parameters

direction Vector3
rotationSpeed float

LookAt(Vector3, float)

public void LookAt(Vector3 position, float rotationSpeed = 3)

Parameters

position Vector3
rotationSpeed float

LookForBetterTarget(Vector3, float, float)

public void LookForBetterTarget(Vector3 headPosition, float maxRange = 70, float maxAngle = 110)

Parameters

headPosition Vector3
maxRange float
maxAngle float

LookForTarget(Vector3, float, float, float)

public bool LookForTarget(Vector3 headPosition, float maxRange = 70, float maxAngle = 110, float timeToSeeTarget = 1)

Parameters

headPosition Vector3
maxRange float
maxAngle float
timeToSeeTarget float

Returns

bool

LoseTarget()

public void LoseTarget()

OnDestroy()

public void OnDestroy()

OnNoisePlayed(Vector3, float, int)

public void OnNoisePlayed(Vector3 noisePosition, float noiseRange, int alerts = 1)

Parameters

noisePosition Vector3
noiseRange float
alerts int

Patrol(bool, bool, float, bool, Vector3, bool)

public bool Patrol(bool look = true, bool walk = true, float rotationSpeed = 3, bool listenToNoise = true, Vector3 preferedDirection = default, bool alertable = true)

Parameters

look bool
walk bool
rotationSpeed float
listenToNoise bool
preferedDirection Vector3
alertable bool

Returns

bool

RPCA_BotSetAttacking(bool)

[PunRPC]
public void RPCA_BotSetAttacking(bool setAttacking)

Parameters

setAttacking bool

RemoveTargetChangeAction(Action)

public void RemoveTargetChangeAction(Action a)

Parameters

a Action

RotateThenMove(Vector3, float)

public void RotateThenMove(Vector3 dir, float rotationSpeed = 3)

Parameters

dir Vector3
rotationSpeed float

Run()

public void Run()

SearchForTargetBodyPart(Vector3, float, float)

public Rigidbody SearchForTargetBodyPart(Vector3 headPosition, float maxRange = 70, float maxAngle = 110)

Parameters

headPosition Vector3
maxRange float
maxAngle float

Returns

Rigidbody

SearchPoint(float)

public void SearchPoint(float rotationSpeed)

Parameters

rotationSpeed float

SetLeader(Bot)

public void SetLeader(Bot leader)

Parameters

leader Bot

SetMovementWorld(Vector3)

public void SetMovementWorld(Vector3 worldMove)

Parameters

worldMove Vector3

SetSyncAttacking(bool)

public void SetSyncAttacking(bool setAttacking)

Parameters

setAttacking bool

SetTargetPlayer(Player)

public void SetTargetPlayer(Player player)

Parameters

player Player

SetTransform()

public void SetTransform()

SpeedFactor()

public float SpeedFactor()

Returns

float

StandStill()

public void StandStill()

Start()

public void Start()

TargetLookY()

public float TargetLookY()

Returns

float

Teleport(Vector3)

public void Teleport(Vector3 position)

Parameters

position Vector3

TryToReturnTarget(Vector3, float, float)

public Player TryToReturnTarget(Vector3 headPosition, float maxRange = 70, float maxAngle = 110)

Parameters

headPosition Vector3
maxRange float
maxAngle float

Returns

Player

Update()

public void Update()

UpdateLocalVariables()

public void UpdateLocalVariables()

UpdateVariables()

public void UpdateVariables()

ValidateChase(Vector3, float)

public void ValidateChase(Vector3 headPosition, float loseTargetTime = 4.5)

Parameters

headPosition Vector3
loseTargetTime float

Walk()

public void Walk()

WalkAway(Vector3)

public void WalkAway(Vector3 walkAwayDir)

Parameters

walkAwayDir Vector3

WorldMoveTo(Vector3)

public void WorldMoveTo(Vector3 position)

Parameters

position Vector3