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 | Protected Attributes | Static Protected Attributes | Properties | List of all members
BrokeProtocol.Entities.ShGun Class Reference
Inheritance diagram for BrokeProtocol.Entities.ShGun:
BrokeProtocol.Entities.ShWeapon BrokeProtocol.Entities.ShHitscan BrokeProtocol.Entities.ShUsable BrokeProtocol.Entities.ShEquipable BrokeProtocol.Entities.ShItem BrokeProtocol.Entities.ShMountable BrokeProtocol.Entities.ShDamageable BrokeProtocol.Entities.ShEntity BrokeProtocol.Entities.Serialized BrokeProtocol.Entities.ShBallistic

Public Member Functions

override bool CanUse ()
 
override StringBuilder GetTooltip ()
 
override void InitializeOnPlayer (ShPlayer player)
 
override Transform GetAttachmentPoint (int typeIndex)
 
override void HitCheck (out RaycastHit hit)
 
override void Use ()
 
override void Reload ()
 
void Load (int bulletCount)
 
- Public Member Functions inherited from BrokeProtocol.Entities.ShWeapon
override void HitCheck (out RaycastHit hit)
 
- Public Member Functions inherited from BrokeProtocol.Entities.ShHitscan
void PushHitscanState (Vector2 fireOffset)
 
bool GetHitscanState (byte fireIndex, byte burst, out NetState state)
 
override void Use ()
 
- Public Member Functions inherited from BrokeProtocol.Entities.ShUsable
virtual string GetTargetType ()
 
override void Use ()
 
void RemoveAmmo ()
 
- Public Member Functions inherited from BrokeProtocol.Entities.ShEquipable
override Vector3 GetWeaponPosition ()
 
override Vector3 GetWeaponVector ()
 
override void ResetAmmo ()
 
void RecalulcateFactors ()
 
Transform AcceptAttachment (ShAttachment a)
 
override void DestroyExtras ()
 
void SetVisible (bool setting)
 
- Public Member Functions inherited from BrokeProtocol.Entities.ShItem
override void DestroyExtras ()
 
int GetValue (int count, bool markup)
 
- Public Member Functions inherited from BrokeProtocol.Entities.ShMountable
void UpdatePrimaryAmmo (int delta)
 
void UpdateSecondaryAmmo (int delta)
 
override void PreInitialize (int ID)
 
override void Initialize ()
 
override void Spawn (Vector3 position, Quaternion rotation, Transform placeT)
 
void Rearm (float amount)
 
virtual void Mounted (ShPlayer occupant, int enterSeat)
 
virtual bool IsAccessible (ShPlayer attempter, bool checkOwner)
 
virtual void ResetInputs ()
 
override void Restore (Vector3 position, Quaternion rotation, Transform placeT)
 
void IncrementFireTime (float delay)
 
void MountFire ()
 
override void CleanUp ()
 
- Public Member Functions inherited from BrokeProtocol.Entities.ShDamageable
virtual void HitEffect (Collider collider, DamageIndex damageIndex, Vector3 point, Vector3 normal)
 
- Public Member Functions inherited from BrokeProtocol.Entities.ShEntity
Bounds GetWorldBounds ()
 
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)
 
void SetParent (Transform parent)
 
void SetPosition (Vector3 position)
 
virtual void SetRotation (Quaternion rotation)
 
void SetPositionSafe (Vector3 targetPosition)
 
virtual void Destroy ()
 
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

Transform[] attachmentPoints
 
- Public Attributes inherited from BrokeProtocol.Entities.ShWeapon
float damage
 
- Public Attributes inherited from BrokeProtocol.Entities.ShHitscan
float range = Util.manhattanRange
 
bool checkHitscan
 
Vector2 hitscanOffset
 
- Public Attributes inherited from BrokeProtocol.Entities.ShUsable
byte burstSize = 1
 
byte currentBurst
 
- Public Attributes inherited from BrokeProtocol.Entities.ShEquipable
ClEquipable clEquipable
 
CharacterType characterType
 
string attachBone = "RightHand"
 
Grip grip
 
float moveSpeed = 1f
 
ShMuzzle curMuzzle
 
ShSight curSight
 
ShUnderbarrel curUnderbarrel
 
float accuracyFactor = 1f
 
float recoilFactor = 1f
 
float recoveryFactor = 1f
 
- Public Attributes inherited from BrokeProtocol.Entities.ShItem
ClItem clItem
 
string itemName
 
bool needItem
 
bool illegal
 
ShItem license
 
float weight
 
ShItem ammoItem
 
- Public Attributes inherited from BrokeProtocol.Entities.ShMountable
ClMountable clMountable
 
SvMountable svMountable
 
Seat[] seats
 
Transform[] exitTransforms
 
float viewAngleLimit = 89f
 
Transform turretT
 
Transform barrelT
 
WeaponSet[] weaponSets
 
int weaponIndex
 
Vector2 recoilP
 
Vector2 recoilV
 
ShPlayer[] occupants
 
float nextFire
 
- Public Attributes inherited from BrokeProtocol.Entities.ShDamageable
SvDamageable svDamageable
 
- Public Attributes inherited from BrokeProtocol.Entities.ShEntity
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

void Update ()
 
void OnEnable ()
 
IEnumerator LoadOne ()
 
IEnumerator ReloadLoop ()
 
- Protected Member Functions inherited from BrokeProtocol.Entities.ShHitscan
Vector3 FireVector ()
 
Vector3 OffsetToDirection (Vector2 offset)
 
bool Hitscan (out RaycastHit hit)
 
- Protected Member Functions inherited from BrokeProtocol.Entities.ShMountable
void DeltaClip (int delta)
 
IEnumerator RearmLoop ()
 
IEnumerator MoveTurret ()
 
- Protected Member Functions inherited from BrokeProtocol.Entities.ShEntity
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)
 

Protected Attributes

float accuracy
 
float recoil
 
bool reloading
 
AudioSource reloadSound
 
bool incrementalReload
 
int clipSize
 
int currentClip
 
- Protected Attributes inherited from BrokeProtocol.Entities.ShHitscan
DamageIndex damageIndex
 
Transform muzzleT
 
FireEffect fireEffect
 
GameObject customFireEffect
 
float customFireEffectLifespan
 
Queue< NetStatehitscanStates = new()
 
- Protected Attributes inherited from BrokeProtocol.Entities.ShUsable
float useDelay = 1f
 
bool fireAnimation = true
 
AudioSource useSound
 

Static Protected Attributes

const float loadDelay = 0.5f
 
- Static Protected Attributes inherited from BrokeProtocol.Entities.ShHitscan
const float radius = 0.5f
 

Properties

override int ClipSize [get]
 
override int CurrentClip [get, set]
 
override bool ServersideAmmo [get]
 
override bool CanZoom [get]
 
override bool CanReload [get]
 
override string AmmoString [get]
 
override Vector2 FireOffset [get]
 
override bool UseClips [get]
 
- Properties inherited from BrokeProtocol.Entities.ShWeapon
override float Damage [get]
 
- Properties inherited from BrokeProtocol.Entities.ShHitscan
override DamageIndex DamageProperty [get]
 
virtual Vector2 FireOffset [get]
 
override bool MustAim [get]
 
override float Range [get]
 
virtual int HitscanMask [get]
 
- Properties inherited from BrokeProtocol.Entities.ShUsable
override bool ServersideAmmo [get]
 
override float UseDelay [get]
 
- Properties inherited from BrokeProtocol.Entities.ShEquipable
virtual DamageIndex DamageProperty [get]
 
override bool CanLockOn [get]
 
virtual bool CanZoom [get]
 
- Properties inherited from BrokeProtocol.Entities.ShItem
override ShItem AmmoItem [get]
 
virtual string AmmoString [get]
 
override InventoryStruct[] CollectedItems [get]
 
string GetSortableName [get]
 
- Properties inherited from BrokeProtocol.Entities.ShMountable
float NormalizedRecoilAmount [get]
 
virtual bool UsePathfinding [get]
 
WeaponSet WeaponSet [get]
 
virtual int ClipSize [get]
 
virtual int CurrentClip [get, set]
 
virtual bool CanReload [get]
 
virtual bool ServersideAmmo [get]
 
virtual ShItem AmmoItem [get]
 
int AmmoTotal [get]
 
virtual bool UseClips [get]
 
virtual bool MustAim [get]
 
virtual float Range [get]
 
virtual float Damage [get]
 
virtual bool CanLockOn [get]
 
bool ThrownHasGuidance [get]
 
virtual float CameraDistance [get]
 
override ShMountable GetMount [get]
 
bool CheckHitscans [get]
 
virtual bool ServersidePhysics [get]
 
bool IsSimulated [get]
 
bool HasWeapons [get]
 
virtual float WeaponVelocity [get]
 
float WeaponGravity [get]
 
float ThrownVelocity [get]
 
virtual float UseDelay [get]
 
- Properties inherited from BrokeProtocol.Entities.ShEntity
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

◆ CanUse()

override bool BrokeProtocol.Entities.ShGun.CanUse ( )
virtual

◆ GetAttachmentPoint()

override Transform BrokeProtocol.Entities.ShGun.GetAttachmentPoint ( int typeIndex)
virtual

◆ GetTooltip()

override StringBuilder BrokeProtocol.Entities.ShGun.GetTooltip ( )
inlinevirtual

Reimplemented from BrokeProtocol.Entities.ShItem.

◆ HitCheck()

override void BrokeProtocol.Entities.ShGun.HitCheck ( out RaycastHit hit)
inlinevirtual

Reimplemented from BrokeProtocol.Entities.ShUsable.

◆ InitializeOnPlayer()

override void BrokeProtocol.Entities.ShGun.InitializeOnPlayer ( ShPlayer player)
inlinevirtual

Reimplemented from BrokeProtocol.Entities.ShItem.

◆ Load()

void BrokeProtocol.Entities.ShGun.Load ( int bulletCount)
inline

◆ LoadOne()

IEnumerator BrokeProtocol.Entities.ShGun.LoadOne ( )
inlineprotected

◆ OnEnable()

void BrokeProtocol.Entities.ShGun.OnEnable ( )
protected

◆ Reload()

override void BrokeProtocol.Entities.ShGun.Reload ( )
inlinevirtual

◆ ReloadLoop()

IEnumerator BrokeProtocol.Entities.ShGun.ReloadLoop ( )
inlineprotected

◆ Update()

void BrokeProtocol.Entities.ShGun.Update ( )
inlineprotected

◆ Use()

override void BrokeProtocol.Entities.ShGun.Use ( )
inlinevirtual

Member Data Documentation

◆ accuracy

float BrokeProtocol.Entities.ShGun.accuracy
protected

◆ attachmentPoints

Transform [] BrokeProtocol.Entities.ShGun.attachmentPoints

◆ clipSize

int BrokeProtocol.Entities.ShGun.clipSize
protected

◆ currentClip

int BrokeProtocol.Entities.ShGun.currentClip
protected

◆ incrementalReload

bool BrokeProtocol.Entities.ShGun.incrementalReload
protected

◆ loadDelay

const float BrokeProtocol.Entities.ShGun.loadDelay = 0.5f
staticprotected

◆ recoil

float BrokeProtocol.Entities.ShGun.recoil
protected

◆ reloading

bool BrokeProtocol.Entities.ShGun.reloading
protected

◆ reloadSound

AudioSource BrokeProtocol.Entities.ShGun.reloadSound
protected

Property Documentation

◆ AmmoString

override string BrokeProtocol.Entities.ShGun.AmmoString
get

◆ CanReload

override bool BrokeProtocol.Entities.ShGun.CanReload
get

◆ CanZoom

override bool BrokeProtocol.Entities.ShGun.CanZoom
get

◆ ClipSize

override int BrokeProtocol.Entities.ShGun.ClipSize
get

◆ CurrentClip

override int BrokeProtocol.Entities.ShGun.CurrentClip
getset

◆ FireOffset

override Vector2 BrokeProtocol.Entities.ShGun.FireOffset
getprotected

◆ ServersideAmmo

override bool BrokeProtocol.Entities.ShGun.ServersideAmmo
get

◆ UseClips

override bool BrokeProtocol.Entities.ShGun.UseClips
getprotected

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