Mod Helpers  v5.9.6
A centralized collection of library code, helpful services, and end-user functions for mod management and information.
HamstarHelpers.Helpers.Players.PlayerHelpers Class Reference

Assorted static "helper" functions pertaining to players. More...

Static Public Member Functions

static int ComputeImpendingFallDamage (Player player)
 Predicts impending fall damage amount for a given player at the current time (if any). More...
 
static float LooselyAssessPower (Player player)
 Loosely assesses player's relative level of power. Factors include appraisals of inventory items, player's defense, and player's life. More...
 
static bool IsIncapacitated (Player player, bool freedomNeeded=false, bool armsNeeded=false, bool sightNeeded=false, bool sanityNeeded=false)
 Indicates if player counts as 'incapacitated'. More...
 
static void RawHurt (Player player, PlayerDeathReason deathReason, int damage, int direction, bool pvp=false, bool quiet=false, bool crit=false)
 Apply armor-bypassing damage to player, killing if needed (syncs via. Player.Hurt(...)). More...
 
static void KillWithPermadeath (Player player, string deathMsg)
 Kills a player permanently (as if hardcore mode). More...
 
static void FullVanillaReset (Player player)
 Resets a player back to (vanilla) factory defaults. More...
 
static void LockdownPlayerPerTick (Player player)
 For just the current game tick, the player is under complete lockdown: No movement, actions, or damage taken. More...
 

Public Attributes

const int InventorySize = 58
 
const int InventoryHotbarSize = 10
 
const int InventoryMainSize = 40
 

Detailed Description

Assorted static "helper" functions pertaining to players.

Definition at line 14 of file PlayerHelpers.cs.

Member Function Documentation

◆ ComputeImpendingFallDamage()

static int HamstarHelpers.Helpers.Players.PlayerHelpers.ComputeImpendingFallDamage ( Player  player)
static

Predicts impending fall damage amount for a given player at the current time (if any).

Parameters
player
Returns

Definition at line 31 of file PlayerHelpers.cs.

◆ FullVanillaReset()

static void HamstarHelpers.Helpers.Players.PlayerHelpers.FullVanillaReset ( Player  player)
static

Resets a player back to (vanilla) factory defaults.

Parameters
player

Definition at line 200 of file PlayerHelpers.cs.

◆ IsIncapacitated()

static bool HamstarHelpers.Helpers.Players.PlayerHelpers.IsIncapacitated ( Player  player,
bool  freedomNeeded = false,
bool  armsNeeded = false,
bool  sightNeeded = false,
bool  sanityNeeded = false 
)
static

Indicates if player counts as 'incapacitated'.

Parameters
player
freedomNeededPulley, grappling, or minecarting count as incapacitation. Default false.
armsNeededUse of arms (e.g. no Cursed debuff) count as incapacitation. Default false.
sightNeededVisual occlusion (e.g. Blackout debuff) counts as incapacitation. Default false.
sanityNeededControl complications (e.g. Confused debuff) counts as incapacition. Default false.
Returns

Definition at line 128 of file PlayerHelpers.cs.

◆ KillWithPermadeath()

static void HamstarHelpers.Helpers.Players.PlayerHelpers.KillWithPermadeath ( Player  player,
string  deathMsg 
)
static

Kills a player permanently (as if hardcore mode).

Parameters
player
deathMsg

Definition at line 178 of file PlayerHelpers.cs.

◆ LockdownPlayerPerTick()

static void HamstarHelpers.Helpers.Players.PlayerHelpers.LockdownPlayerPerTick ( Player  player)
static

For just the current game tick, the player is under complete lockdown: No movement, actions, or damage taken.

Parameters
player

Definition at line 254 of file PlayerHelpers.cs.

◆ LooselyAssessPower()

static float HamstarHelpers.Helpers.Players.PlayerHelpers.LooselyAssessPower ( Player  player)
static

Loosely assesses player's relative level of power. Factors include appraisals of inventory items, player's defense, and player's life.

Parameters
player
Returns

Definition at line 76 of file PlayerHelpers.cs.

◆ RawHurt()

static void HamstarHelpers.Helpers.Players.PlayerHelpers.RawHurt ( Player  player,
PlayerDeathReason  deathReason,
int  damage,
int  direction,
bool  pvp = false,
bool  quiet = false,
bool  crit = false 
)
static

Apply armor-bypassing damage to player, killing if needed (syncs via. Player.Hurt(...)).

Parameters
player
deathReason
damage
direction
pvp
quiet
crit

Definition at line 156 of file PlayerHelpers.cs.

Member Data Documentation

◆ InventoryHotbarSize

const int HamstarHelpers.Helpers.Players.PlayerHelpers.InventoryHotbarSize = 10

Definition at line 18 of file PlayerHelpers.cs.

◆ InventoryMainSize

const int HamstarHelpers.Helpers.Players.PlayerHelpers.InventoryMainSize = 40

Definition at line 20 of file PlayerHelpers.cs.

◆ InventorySize

const int HamstarHelpers.Helpers.Players.PlayerHelpers.InventorySize = 58

Definition at line 16 of file PlayerHelpers.cs.


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