Broke Protocol Game API Reference  1.39
Code reference for server and client scripting
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
BrokeProtocol.Entities.ShEntity Class Reference
Inheritance diagram for BrokeProtocol.Entities.ShEntity:
BrokeProtocol.Entities.Serialized BrokeProtocol.Entities.ShDamageable BrokeProtocol.Entities.ShDeathZone BrokeProtocol.Entities.ShDoor BrokeProtocol.Entities.ShTextDisplay BrokeProtocol.Entities.ShTrigger BrokeProtocol.Entities.ShVault BrokeProtocol.Entities.ShMountable BrokeProtocol.Entities.ShVoxel BrokeProtocol.Entities.ShApartment BrokeProtocol.Entities.ShTerritory BrokeProtocol.Entities.ShDestroyable BrokeProtocol.Entities.ShItem BrokeProtocol.Entities.ShSmoothVoxel BrokeProtocol.Entities.ShDamage BrokeProtocol.Entities.ShPhysical BrokeProtocol.Entities.ShAttachment BrokeProtocol.Entities.ShEquipable BrokeProtocol.Entities.ShWearable BrokeProtocol.Entities.ShFire BrokeProtocol.Entities.ShMovable BrokeProtocol.Entities.ShThrown BrokeProtocol.Entities.ShMuzzle BrokeProtocol.Entities.ShSight BrokeProtocol.Entities.ShUnderbarrel BrokeProtocol.Entities.ShLight BrokeProtocol.Entities.ShShield BrokeProtocol.Entities.ShUsable

Public Member Functions

Bounds GetWorldBounds ()
 
virtual void CleanUp ()
 
virtual void Restore (Vector3 position, Quaternion rotation, Transform placeT)
 
override void CheckSave ()
 
float GetLocalY (Vector3 worldPosition)
 
float GetFlatAngle (Vector3 v)
 
virtual bool InActionRange (ShEntity e)
 
bool CanSeeEntity (ShEntity other, bool checkInFront=false, float viewRange=Util.visibleRange)
 
bool GetOverlapEntity< T > (Vector3 position, Quaternion rotation, int maskIndex, float extentsMultiplier, Predicate< T > predicate, out T entity)
 
bool CanSpawn (Vector3 position, Quaternion rotation, ShEntity[] ignoreArray)
 
bool CanSee (Vector3 position)
 
float Distance (ShEntity other)
 
float DistanceSqr (ShEntity other)
 
float DistanceSqr2D (ShEntity other)
 
float DistanceSqr2D (Vector3 other)
 
float Distance (Vector3 other)
 
float DistanceSqr (Vector3 other)
 
virtual void DestroyExtras ()
 
void SetParent (Transform parent)
 
void SetPosition (Vector3 position)
 
virtual void SetRotation (Quaternion rotation)
 
void SetPositionSafe (Vector3 targetPosition)
 
virtual void Destroy ()
 
virtual void PreInitialize (int ID)
 
virtual void Initialize ()
 
virtual void Spawn (Vector3 position, Quaternion rotation, Transform placeT)
 
void DeactivateEntity ()
 
void IgnoreCollision (ShPlayer p, bool ignore)
 
IEnumerator ResetCollisions (ShPlayer p)
 
virtual void SetTransform (Vector3 position, Quaternion rotation, bool zeroVelocity)
 
int InventoryValue ()
 
int GetMyItemValue (ShItem item, bool markup)
 
void SendViewerDelta (byte delta, int itemIndex, int amount, ShPlayer ignorePlayer)
 
void TransferMoney (byte deltaType, int amount=1, bool dispatch=true)
 
void TransferItem (byte deltaType, ShItem item, int amount=1, bool dispatch=true)
 
bool ValidTransfer (int itemIndex, int amount)
 
virtual void TransferItem (byte deltaType, int itemIndex, int amount=1, bool dispatch=true)
 
byte[] SerializeMyItems ()
 
SizedArray SerializeShop ()
 
void DeserializeMyItems (byte[] inventoryArray)
 
void DeserializeShop (byte[] inventoryArray)
 
virtual void AddToMyItems (int itemIndex, int amount, bool dispatch)
 
void AddToTradeItems (int itemIndex, int amount)
 
virtual void RemoveFromMyItems (int itemIndex, int amount, bool dispatch)
 
void RemoveFromTradeItems (int itemIndex, int amount)
 
virtual bool CanBeSearched (ShPlayer p)
 
bool CanBeCracked (ShPlayer p)
 
int ItemCount (Dictionary< int, InventoryItem > inventory, int itemIndex)
 
bool HasItem (ShItem item)
 
bool HasItem (int itemIndex)
 
int MyItemCount (ShEntity item)
 
int TradeItemCount (ShEntity item)
 
int MyItemCount (int itemIndex)
 
int TradeItemCount (int itemIndex)
 
void ClearAllViewers ()
 
void RemoveViewer (ShPlayer viewer)
 
bool ShopCanBuy (ShItem item)
 
- Public Member Functions inherited from BrokeProtocol.Entities.Serialized
virtual void InitializeEditor ()
 
virtual void BoundsHighlightAdd ()
 
virtual void BoundsHighlightRemove ()
 
void Trigger (Collider collider, string eventName, bool enter)
 

Public Attributes

ClEntity clEntity
 
SvEntity svEntity
 
Animator animator
 
bool syncAnimator
 
ShPlayer controller
 
Dictionary< string, string > dynamicActions = new ()
 
bool isHuman
 
float videoStartTime
 
string profile = string.Empty
 
bool isWorldEntity
 
Renderer[] renderers
 
AppIndex[] availableApps
 
InventoryType inventoryType
 
Dictionary< int, InventoryItemmyItems = new ()
 
Dictionary< int, InventoryItemtradeItems = new ()
 
HashSet< ShPlayerviewers = new ()
 
HashSet< Collider > colliders
 
int ID
 
int index
 
ShManager manager
 
int value
 
int respawnFrame
 
Vector3 relativeVelocity
 
Bounds bounds
 
- Public Attributes inherited from BrokeProtocol.Entities.Serialized
string referencePrefab
 
GameObject go
 
Transform mainT
 
string data
 
BoundsHighlight highlight
 

Protected Member Functions

virtual void UpdateMainColliders ()
 
InventoryItem DeserializeItem (byte[] itemArray)
 
InventoryItem DeserializeShopItem (byte[] itemArray)
 
void AddToInventory (Dictionary< int, InventoryItem > inventory, int itemIndex, int amount)
 
void RemoveFromInventory (Dictionary< int, InventoryItem > inventory, int itemIndex, int amount)
 

Properties

virtual bool IsDead [get]
 
virtual bool SyncTransform [get]
 
virtual Collider Ground [get]
 
virtual ShEntity SpecEntity [get]
 
bool SpecSelf [get]
 
override SerializedParameters Parameters [get]
 
override Type EditorType [get]
 
virtual ShMountable GetMount [get]
 
virtual ShPlayer Player [get]
 
virtual Vector3 Velocity [get, set]
 
virtual Vector3 GetOrigin [get]
 
virtual float MountHealth [get]
 
override bool SendInitial [get]
 
virtual InventoryStruct[] CollectedItems [get]
 
bool IsClientMain [get]
 
virtual float ProcessDuration [get]
 
Bounds ScaledBounds [get]
 
Vector3 CenterBounds [get]
 
bool HasInventory [get]
 
bool Shop [get]
 
int MyMoneyCount [get]
 
int TradeMoneyCount [get]
 
- Properties inherited from BrokeProtocol.Entities.Serialized
virtual bool SendInitial [get]
 
virtual SerializedParameters Parameters [get]
 
virtual Type EditorType [get]
 
ChildIndex GetChildIndex [get]
 
virtual Transform GetRotationT [get]
 
virtual Quaternion GetRotation [get]
 
Transform GetParent [get]
 
bool IsOutside [get]
 
int GetPlaceIndex [get]
 
Place GetPlace [get]
 
Vector3 GetPosition [get]
 
string LogPosition [get]
 
virtual Vector3 CenterBuoyancy [get]
 
virtual bool InWater [get]
 

Member Function Documentation

◆ AddToInventory()

void BrokeProtocol.Entities.ShEntity.AddToInventory ( Dictionary< int, InventoryItem > inventory,
int itemIndex,
int amount )
inlineprotected

◆ AddToMyItems()

virtual void BrokeProtocol.Entities.ShEntity.AddToMyItems ( int itemIndex,
int amount,
bool dispatch )
inlinevirtual

◆ AddToTradeItems()

void BrokeProtocol.Entities.ShEntity.AddToTradeItems ( int itemIndex,
int amount )

◆ CanBeCracked()

bool BrokeProtocol.Entities.ShEntity.CanBeCracked ( ShPlayer p)

◆ CanBeSearched()

virtual bool BrokeProtocol.Entities.ShEntity.CanBeSearched ( ShPlayer p)
virtual

◆ CanSee()

bool BrokeProtocol.Entities.ShEntity.CanSee ( Vector3 position)
inline

◆ CanSeeEntity()

bool BrokeProtocol.Entities.ShEntity.CanSeeEntity ( ShEntity other,
bool checkInFront = false,
float viewRange = Util::visibleRange )
inline

◆ CanSpawn()

bool BrokeProtocol.Entities.ShEntity.CanSpawn ( Vector3 position,
Quaternion rotation,
ShEntity[] ignoreArray )

◆ CheckSave()

override void BrokeProtocol.Entities.ShEntity.CheckSave ( )
inlinevirtual

Reimplemented from BrokeProtocol.Entities.Serialized.

◆ CleanUp()

virtual void BrokeProtocol.Entities.ShEntity.CleanUp ( )
inlinevirtual

◆ ClearAllViewers()

void BrokeProtocol.Entities.ShEntity.ClearAllViewers ( )
inline

◆ DeactivateEntity()

void BrokeProtocol.Entities.ShEntity.DeactivateEntity ( )
inline

◆ DeserializeItem()

InventoryItem BrokeProtocol.Entities.ShEntity.DeserializeItem ( byte[] itemArray)
inlineprotected

◆ DeserializeMyItems()

void BrokeProtocol.Entities.ShEntity.DeserializeMyItems ( byte[] inventoryArray)
inline

◆ DeserializeShop()

void BrokeProtocol.Entities.ShEntity.DeserializeShop ( byte[] inventoryArray)
inline

◆ DeserializeShopItem()

InventoryItem BrokeProtocol.Entities.ShEntity.DeserializeShopItem ( byte[] itemArray)
inlineprotected

◆ Destroy()

virtual void BrokeProtocol.Entities.ShEntity.Destroy ( )
inlinevirtual

◆ DestroyExtras()

virtual void BrokeProtocol.Entities.ShEntity.DestroyExtras ( )
inlinevirtual

◆ Distance() [1/2]

float BrokeProtocol.Entities.ShEntity.Distance ( ShEntity other)

◆ Distance() [2/2]

float BrokeProtocol.Entities.ShEntity.Distance ( Vector3 other)

◆ DistanceSqr() [1/2]

float BrokeProtocol.Entities.ShEntity.DistanceSqr ( ShEntity other)

◆ DistanceSqr() [2/2]

float BrokeProtocol.Entities.ShEntity.DistanceSqr ( Vector3 other)

◆ DistanceSqr2D() [1/2]

float BrokeProtocol.Entities.ShEntity.DistanceSqr2D ( ShEntity other)

◆ DistanceSqr2D() [2/2]

float BrokeProtocol.Entities.ShEntity.DistanceSqr2D ( Vector3 other)

◆ GetFlatAngle()

float BrokeProtocol.Entities.ShEntity.GetFlatAngle ( Vector3 v)
inline

◆ GetLocalY()

float BrokeProtocol.Entities.ShEntity.GetLocalY ( Vector3 worldPosition)

◆ GetMyItemValue()

int BrokeProtocol.Entities.ShEntity.GetMyItemValue ( ShItem item,
bool markup )

◆ GetOverlapEntity< T >()

bool BrokeProtocol.Entities.ShEntity.GetOverlapEntity< T > ( Vector3 position,
Quaternion rotation,
int maskIndex,
float extentsMultiplier,
Predicate< T > predicate,
out T entity )
inline
Type Constraints
T :ShEntity 

◆ GetWorldBounds()

Bounds BrokeProtocol.Entities.ShEntity.GetWorldBounds ( )
inline

◆ HasItem() [1/2]

bool BrokeProtocol.Entities.ShEntity.HasItem ( int itemIndex)

◆ HasItem() [2/2]

bool BrokeProtocol.Entities.ShEntity.HasItem ( ShItem item)

◆ IgnoreCollision()

void BrokeProtocol.Entities.ShEntity.IgnoreCollision ( ShPlayer p,
bool ignore )
inline

◆ InActionRange()

virtual bool BrokeProtocol.Entities.ShEntity.InActionRange ( ShEntity e)
inlinevirtual

◆ Initialize()

virtual void BrokeProtocol.Entities.ShEntity.Initialize ( )
inlinevirtual

◆ InventoryValue()

int BrokeProtocol.Entities.ShEntity.InventoryValue ( )
inline

◆ ItemCount()

int BrokeProtocol.Entities.ShEntity.ItemCount ( Dictionary< int, InventoryItem > inventory,
int itemIndex )

◆ MyItemCount() [1/2]

int BrokeProtocol.Entities.ShEntity.MyItemCount ( int itemIndex)

◆ MyItemCount() [2/2]

int BrokeProtocol.Entities.ShEntity.MyItemCount ( ShEntity item)

◆ PreInitialize()

virtual void BrokeProtocol.Entities.ShEntity.PreInitialize ( int ID)
inlinevirtual

◆ RemoveFromInventory()

void BrokeProtocol.Entities.ShEntity.RemoveFromInventory ( Dictionary< int, InventoryItem > inventory,
int itemIndex,
int amount )
inlineprotected

◆ RemoveFromMyItems()

virtual void BrokeProtocol.Entities.ShEntity.RemoveFromMyItems ( int itemIndex,
int amount,
bool dispatch )
inlinevirtual

◆ RemoveFromTradeItems()

void BrokeProtocol.Entities.ShEntity.RemoveFromTradeItems ( int itemIndex,
int amount )

◆ RemoveViewer()

void BrokeProtocol.Entities.ShEntity.RemoveViewer ( ShPlayer viewer)
inline

◆ ResetCollisions()

IEnumerator BrokeProtocol.Entities.ShEntity.ResetCollisions ( ShPlayer p)
inline

◆ Restore()

virtual void BrokeProtocol.Entities.ShEntity.Restore ( Vector3 position,
Quaternion rotation,
Transform placeT )
inlinevirtual

◆ SendViewerDelta()

void BrokeProtocol.Entities.ShEntity.SendViewerDelta ( byte delta,
int itemIndex,
int amount,
ShPlayer ignorePlayer )
inline

◆ SerializeMyItems()

byte[] BrokeProtocol.Entities.ShEntity.SerializeMyItems ( )
inline

◆ SerializeShop()

SizedArray BrokeProtocol.Entities.ShEntity.SerializeShop ( )
inline

◆ SetParent()

void BrokeProtocol.Entities.ShEntity.SetParent ( Transform parent)

◆ SetPosition()

void BrokeProtocol.Entities.ShEntity.SetPosition ( Vector3 position)

◆ SetPositionSafe()

void BrokeProtocol.Entities.ShEntity.SetPositionSafe ( Vector3 targetPosition)
inline

◆ SetRotation()

virtual void BrokeProtocol.Entities.ShEntity.SetRotation ( Quaternion rotation)
virtual

◆ SetTransform()

virtual void BrokeProtocol.Entities.ShEntity.SetTransform ( Vector3 position,
Quaternion rotation,
bool zeroVelocity )
inlinevirtual

◆ ShopCanBuy()

bool BrokeProtocol.Entities.ShEntity.ShopCanBuy ( ShItem item)
inline

◆ Spawn()

virtual void BrokeProtocol.Entities.ShEntity.Spawn ( Vector3 position,
Quaternion rotation,
Transform placeT )
inlinevirtual

◆ TradeItemCount() [1/2]

int BrokeProtocol.Entities.ShEntity.TradeItemCount ( int itemIndex)

◆ TradeItemCount() [2/2]

int BrokeProtocol.Entities.ShEntity.TradeItemCount ( ShEntity item)

◆ TransferItem() [1/2]

virtual void BrokeProtocol.Entities.ShEntity.TransferItem ( byte deltaType,
int itemIndex,
int amount = 1,
bool dispatch = true )
inlinevirtual

◆ TransferItem() [2/2]

void BrokeProtocol.Entities.ShEntity.TransferItem ( byte deltaType,
ShItem item,
int amount = 1,
bool dispatch = true )

◆ TransferMoney()

void BrokeProtocol.Entities.ShEntity.TransferMoney ( byte deltaType,
int amount = 1,
bool dispatch = true )

◆ UpdateMainColliders()

virtual void BrokeProtocol.Entities.ShEntity.UpdateMainColliders ( )
inlineprotectedvirtual

◆ ValidTransfer()

bool BrokeProtocol.Entities.ShEntity.ValidTransfer ( int itemIndex,
int amount )
inline

Member Data Documentation

◆ animator

Animator BrokeProtocol.Entities.ShEntity.animator

◆ availableApps

AppIndex [] BrokeProtocol.Entities.ShEntity.availableApps

◆ bounds

Bounds BrokeProtocol.Entities.ShEntity.bounds

◆ clEntity

ClEntity BrokeProtocol.Entities.ShEntity.clEntity

◆ colliders

HashSet<Collider> BrokeProtocol.Entities.ShEntity.colliders

◆ controller

ShPlayer BrokeProtocol.Entities.ShEntity.controller

◆ dynamicActions

Dictionary<string, string> BrokeProtocol.Entities.ShEntity.dynamicActions = new ()

◆ ID

int BrokeProtocol.Entities.ShEntity.ID

◆ index

int BrokeProtocol.Entities.ShEntity.index

◆ inventoryType

InventoryType BrokeProtocol.Entities.ShEntity.inventoryType

◆ isHuman

bool BrokeProtocol.Entities.ShEntity.isHuman

◆ isWorldEntity

bool BrokeProtocol.Entities.ShEntity.isWorldEntity

◆ manager

ShManager BrokeProtocol.Entities.ShEntity.manager

◆ myItems

Dictionary<int, InventoryItem> BrokeProtocol.Entities.ShEntity.myItems = new ()

◆ profile

string BrokeProtocol.Entities.ShEntity.profile = string.Empty

◆ relativeVelocity

Vector3 BrokeProtocol.Entities.ShEntity.relativeVelocity

◆ renderers

Renderer [] BrokeProtocol.Entities.ShEntity.renderers

◆ respawnFrame

int BrokeProtocol.Entities.ShEntity.respawnFrame

◆ svEntity

SvEntity BrokeProtocol.Entities.ShEntity.svEntity

◆ syncAnimator

bool BrokeProtocol.Entities.ShEntity.syncAnimator

◆ tradeItems

Dictionary<int, InventoryItem> BrokeProtocol.Entities.ShEntity.tradeItems = new ()

◆ value

int BrokeProtocol.Entities.ShEntity.value

◆ videoStartTime

float BrokeProtocol.Entities.ShEntity.videoStartTime

◆ viewers

HashSet<ShPlayer> BrokeProtocol.Entities.ShEntity.viewers = new ()

Property Documentation

◆ CenterBounds

Vector3 BrokeProtocol.Entities.ShEntity.CenterBounds
get

◆ CollectedItems

virtual InventoryStruct [] BrokeProtocol.Entities.ShEntity.CollectedItems
get

◆ EditorType

override Type BrokeProtocol.Entities.ShEntity.EditorType
get

◆ GetMount

virtual ShMountable BrokeProtocol.Entities.ShEntity.GetMount
get

◆ GetOrigin

virtual Vector3 BrokeProtocol.Entities.ShEntity.GetOrigin
get

◆ Ground

virtual Collider BrokeProtocol.Entities.ShEntity.Ground
get

◆ HasInventory

bool BrokeProtocol.Entities.ShEntity.HasInventory
get

◆ IsClientMain

bool BrokeProtocol.Entities.ShEntity.IsClientMain
get

◆ IsDead

virtual bool BrokeProtocol.Entities.ShEntity.IsDead
get

◆ MountHealth

virtual float BrokeProtocol.Entities.ShEntity.MountHealth
get

◆ MyMoneyCount

int BrokeProtocol.Entities.ShEntity.MyMoneyCount
get

◆ Parameters

override SerializedParameters BrokeProtocol.Entities.ShEntity.Parameters
get

◆ Player

virtual ShPlayer BrokeProtocol.Entities.ShEntity.Player
get

◆ ProcessDuration

virtual float BrokeProtocol.Entities.ShEntity.ProcessDuration
get

◆ ScaledBounds

Bounds BrokeProtocol.Entities.ShEntity.ScaledBounds
get

◆ SendInitial

override bool BrokeProtocol.Entities.ShEntity.SendInitial
get

◆ Shop

bool BrokeProtocol.Entities.ShEntity.Shop
get

◆ SpecEntity

virtual ShEntity BrokeProtocol.Entities.ShEntity.SpecEntity
get

◆ SpecSelf

bool BrokeProtocol.Entities.ShEntity.SpecSelf
get

◆ SyncTransform

virtual bool BrokeProtocol.Entities.ShEntity.SyncTransform
get

◆ TradeMoneyCount

int BrokeProtocol.Entities.ShEntity.TradeMoneyCount
get

◆ Velocity

virtual Vector3 BrokeProtocol.Entities.ShEntity.Velocity
getset

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