Luanti 5.16.0-dev
Loading...
Searching...
No Matches
PlayerHPChangeReason Struct Reference

#include <player_sao.h>

Collaboration diagram for PlayerHPChangeReason:

Public Types

enum  Type : u8 {
  SET_HP , SET_HP_MAX , PLAYER_PUNCH , FALL ,
  NODE_DAMAGE , DROWNING , RESPAWN
}

Public Member Functions

bool hasLuaReference () const
bool setTypeFromString (const std::string &typestr)
std::string getTypeAsString () const
 PlayerHPChangeReason (Type type)
 PlayerHPChangeReason (Type type, ServerActiveObject *object)
 PlayerHPChangeReason (Type type, std::string node, v3s16 node_pos)

Public Attributes

Type type = SET_HP
bool from_mod = false
int lua_reference = -1
ServerActiveObjectobject = nullptr
std::string node
v3s16 node_pos

Member Enumeration Documentation

◆ Type

Enumerator
SET_HP 
SET_HP_MAX 
PLAYER_PUNCH 
FALL 
NODE_DAMAGE 
DROWNING 
RESPAWN 

Constructor & Destructor Documentation

◆ PlayerHPChangeReason() [1/3]

PlayerHPChangeReason::PlayerHPChangeReason ( Type type)
inline

References type.

◆ PlayerHPChangeReason() [2/3]

PlayerHPChangeReason::PlayerHPChangeReason ( Type type,
ServerActiveObject * object )
inline

References object, and type.

◆ PlayerHPChangeReason() [3/3]

PlayerHPChangeReason::PlayerHPChangeReason ( Type type,
std::string node,
v3s16 node_pos )
inline

References node, node_pos, and type.

Member Function Documentation

◆ getTypeAsString()

std::string PlayerHPChangeReason::getTypeAsString ( ) const
inline

References DROWNING, FALL, NODE_DAMAGE, PLAYER_PUNCH, RESPAWN, SET_HP, SET_HP_MAX, and type.

Referenced by ScriptApiBase::pushPlayerHPChangeReason().

Here is the caller graph for this function:

◆ hasLuaReference()

bool PlayerHPChangeReason::hasLuaReference ( ) const
inline

References lua_reference.

Referenced by ObjectRef::l_set_hp(), and ScriptApiBase::pushPlayerHPChangeReason().

Here is the caller graph for this function:

◆ setTypeFromString()

bool PlayerHPChangeReason::setTypeFromString ( const std::string & typestr)
inline

References DROWNING, FALL, NODE_DAMAGE, PLAYER_PUNCH, RESPAWN, SET_HP, and type.

Referenced by ObjectRef::l_set_hp().

Here is the caller graph for this function:

Member Data Documentation

◆ from_mod

bool PlayerHPChangeReason::from_mod = false

◆ lua_reference

int PlayerHPChangeReason::lua_reference = -1

◆ node

std::string PlayerHPChangeReason::node

◆ node_pos

v3s16 PlayerHPChangeReason::node_pos

◆ object

◆ type


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