diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-07-01 12:39:56 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-07-01 12:39:56 +0200 |
commit | 37276a4430e26f5b3ab56e07d5f30a194f75982e (patch) | |
tree | 95ba9a0a151dc9f4111d8b99e8af728993daa783 /source | |
parent | Changed the crafting recipe for book to match vanilla since 1.3.1 (fix contributed by mgueydan) (diff) | |
download | cuberite-37276a4430e26f5b3ab56e07d5f30a194f75982e.tar cuberite-37276a4430e26f5b3ab56e07d5f30a194f75982e.tar.gz cuberite-37276a4430e26f5b3ab56e07d5f30a194f75982e.tar.bz2 cuberite-37276a4430e26f5b3ab56e07d5f30a194f75982e.tar.lz cuberite-37276a4430e26f5b3ab56e07d5f30a194f75982e.tar.xz cuberite-37276a4430e26f5b3ab56e07d5f30a194f75982e.tar.zst cuberite-37276a4430e26f5b3ab56e07d5f30a194f75982e.zip |
Diffstat (limited to '')
71 files changed, 2086 insertions, 1892 deletions
diff --git a/source/Bindings.cpp b/source/Bindings.cpp index ec164b764..9e6e69005 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 06/29/13 17:21:35. +** Generated automatically by tolua++-1.0.92 on 07/01/13 09:49:28. */ #ifndef __cplusplus @@ -204,19 +204,18 @@ static void tolua_reg_types (lua_State* tolua_S) tolua_usertype(tolua_S,"cInventory"); tolua_usertype(tolua_S,"cRoot"); tolua_usertype(tolua_S,"cWindow"); - tolua_usertype(tolua_S,"cCraftingGrid"); tolua_usertype(tolua_S,"cPickup"); tolua_usertype(tolua_S,"cItems"); - tolua_usertype(tolua_S,"cGroup"); + tolua_usertype(tolua_S,"cCraftingGrid"); tolua_usertype(tolua_S,"cClientHandle"); tolua_usertype(tolua_S,"cChunkDesc"); tolua_usertype(tolua_S,"cFurnaceRecipe"); - tolua_usertype(tolua_S,"cTracer"); + tolua_usertype(tolua_S,"cGroup"); tolua_usertype(tolua_S,"cChatColor"); + tolua_usertype(tolua_S,"cTracer"); tolua_usertype(tolua_S,"cCuboid"); - tolua_usertype(tolua_S,"Vector3i"); tolua_usertype(tolua_S,"Lua__cWebPlugin"); - tolua_usertype(tolua_S,"Lua__cPawn"); + tolua_usertype(tolua_S,"Vector3i"); tolua_usertype(tolua_S,"cEntity"); tolua_usertype(tolua_S,"cItem"); tolua_usertype(tolua_S,"Vector3f"); @@ -3917,6 +3916,156 @@ static int tolua_AllToLua_cClientHandle_GetUniqueID00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE +/* get function: DamageType of class TakeDamageInfo */ +#ifndef TOLUA_DISABLE_tolua_get_TakeDamageInfo_DamageType +static int tolua_get_TakeDamageInfo_DamageType(lua_State* tolua_S) +{ + TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'DamageType'",NULL); +#endif + tolua_pushnumber(tolua_S,(lua_Number)self->DamageType); + return 1; +} +#endif //#ifndef TOLUA_DISABLE + +/* set function: DamageType of class TakeDamageInfo */ +#ifndef TOLUA_DISABLE_tolua_set_TakeDamageInfo_DamageType +static int tolua_set_TakeDamageInfo_DamageType(lua_State* tolua_S) +{ + TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'DamageType'",NULL); + if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) + tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); +#endif + self->DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,2,0)) +; + return 0; +} +#endif //#ifndef TOLUA_DISABLE + +/* get function: Attacker of class TakeDamageInfo */ +#ifndef TOLUA_DISABLE_tolua_get_TakeDamageInfo_Attacker_ptr +static int tolua_get_TakeDamageInfo_Attacker_ptr(lua_State* tolua_S) +{ + TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'Attacker'",NULL); +#endif + tolua_pushusertype(tolua_S,(void*)self->Attacker,"cEntity"); + return 1; +} +#endif //#ifndef TOLUA_DISABLE + +/* set function: Attacker of class TakeDamageInfo */ +#ifndef TOLUA_DISABLE_tolua_set_TakeDamageInfo_Attacker_ptr +static int tolua_set_TakeDamageInfo_Attacker_ptr(lua_State* tolua_S) +{ + TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'Attacker'",NULL); + if (!tolua_isusertype(tolua_S,2,"cEntity",0,&tolua_err)) + tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); +#endif + self->Attacker = ((cEntity*) tolua_tousertype(tolua_S,2,0)) +; + return 0; +} +#endif //#ifndef TOLUA_DISABLE + +/* get function: RawDamage of class TakeDamageInfo */ +#ifndef TOLUA_DISABLE_tolua_get_TakeDamageInfo_RawDamage +static int tolua_get_TakeDamageInfo_RawDamage(lua_State* tolua_S) +{ + TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'RawDamage'",NULL); +#endif + tolua_pushnumber(tolua_S,(lua_Number)self->RawDamage); + return 1; +} +#endif //#ifndef TOLUA_DISABLE + +/* set function: RawDamage of class TakeDamageInfo */ +#ifndef TOLUA_DISABLE_tolua_set_TakeDamageInfo_RawDamage +static int tolua_set_TakeDamageInfo_RawDamage(lua_State* tolua_S) +{ + TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'RawDamage'",NULL); + if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) + tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); +#endif + self->RawDamage = ((int) tolua_tonumber(tolua_S,2,0)) +; + return 0; +} +#endif //#ifndef TOLUA_DISABLE + +/* get function: FinalDamage of class TakeDamageInfo */ +#ifndef TOLUA_DISABLE_tolua_get_TakeDamageInfo_FinalDamage +static int tolua_get_TakeDamageInfo_FinalDamage(lua_State* tolua_S) +{ + TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'FinalDamage'",NULL); +#endif + tolua_pushnumber(tolua_S,(lua_Number)self->FinalDamage); + return 1; +} +#endif //#ifndef TOLUA_DISABLE + +/* set function: FinalDamage of class TakeDamageInfo */ +#ifndef TOLUA_DISABLE_tolua_set_TakeDamageInfo_FinalDamage +static int tolua_set_TakeDamageInfo_FinalDamage(lua_State* tolua_S) +{ + TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'FinalDamage'",NULL); + if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) + tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); +#endif + self->FinalDamage = ((int) tolua_tonumber(tolua_S,2,0)) +; + return 0; +} +#endif //#ifndef TOLUA_DISABLE + +/* get function: Knockback of class TakeDamageInfo */ +#ifndef TOLUA_DISABLE_tolua_get_TakeDamageInfo_Knockback +static int tolua_get_TakeDamageInfo_Knockback(lua_State* tolua_S) +{ + TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'Knockback'",NULL); +#endif + tolua_pushusertype(tolua_S,(void*)&self->Knockback,"Vector3d"); + return 1; +} +#endif //#ifndef TOLUA_DISABLE + +/* set function: Knockback of class TakeDamageInfo */ +#ifndef TOLUA_DISABLE_tolua_set_TakeDamageInfo_Knockback +static int tolua_set_TakeDamageInfo_Knockback(lua_State* tolua_S) +{ + TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'Knockback'",NULL); + if ((tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"Vector3d",0,&tolua_err))) + tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); +#endif + self->Knockback = *((Vector3d*) tolua_tousertype(tolua_S,2,0)) +; + return 0; +} +#endif //#ifndef TOLUA_DISABLE + /* method: GetEntityType of class cEntity */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetEntityType00 static int tolua_AllToLua_cEntity_GetEntityType00(lua_State* tolua_S) @@ -5902,795 +6051,466 @@ static int tolua_AllToLua_cEntity_Destroy00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: IsOnFire of class cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_IsOnFire00 -static int tolua_AllToLua_cEntity_IsOnFire00(lua_State* tolua_S) +/* method: TakeDamage of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_TakeDamage00 +static int tolua_AllToLua_cEntity_TakeDamage00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"cEntity",0,&tolua_err)) || + !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + cEntity* a_Attacker = ((cEntity*) tolua_tousertype(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsOnFire'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'TakeDamage'", NULL); #endif { - bool tolua_ret = (bool) self->IsOnFire(); - tolua_pushboolean(tolua_S,(bool)tolua_ret); + self->TakeDamage(*a_Attacker); } } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'IsOnFire'.",&tolua_err); return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - -/* method: IsCrouched of class cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_IsCrouched00 -static int tolua_AllToLua_cEntity_IsCrouched00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsCrouched'", NULL); -#endif - { - bool tolua_ret = (bool) self->IsCrouched(); - tolua_pushboolean(tolua_S,(bool)tolua_ret); - } - } - return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'IsCrouched'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'TakeDamage'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: IsRiding of class cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_IsRiding00 -static int tolua_AllToLua_cEntity_IsRiding00(lua_State* tolua_S) +/* method: TakeDamage of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_TakeDamage01 +static int tolua_AllToLua_cEntity_TakeDamage01(lua_State* tolua_S) { -#ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isusertype(tolua_S,3,"cEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnumber(tolua_S,5,0,&tolua_err) || + !tolua_isnoobj(tolua_S,6,&tolua_err) ) goto tolua_lerror; else -#endif { - const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + eDamageType a_DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,2,0)); + cEntity* a_Attacker = ((cEntity*) tolua_tousertype(tolua_S,3,0)); + int a_RawDamage = ((int) tolua_tonumber(tolua_S,4,0)); + double a_KnockbackAmount = ((double) tolua_tonumber(tolua_S,5,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsRiding'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'TakeDamage'", NULL); #endif { - bool tolua_ret = (bool) self->IsRiding(); - tolua_pushboolean(tolua_S,(bool)tolua_ret); + self->TakeDamage(a_DamageType,a_Attacker,a_RawDamage,a_KnockbackAmount); } } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'IsRiding'.",&tolua_err); return 0; -#endif +tolua_lerror: + return tolua_AllToLua_cEntity_TakeDamage00(tolua_S); } #endif //#ifndef TOLUA_DISABLE -/* method: IsSprinting of class cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_IsSprinting00 -static int tolua_AllToLua_cEntity_IsSprinting00(lua_State* tolua_S) +/* method: TakeDamage of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_TakeDamage02 +static int tolua_AllToLua_cEntity_TakeDamage02(lua_State* tolua_S) { -#ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isusertype(tolua_S,3,"cEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnumber(tolua_S,5,0,&tolua_err) || + !tolua_isnumber(tolua_S,6,0,&tolua_err) || + !tolua_isnoobj(tolua_S,7,&tolua_err) ) goto tolua_lerror; else -#endif { - const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + eDamageType a_DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,2,0)); + cEntity* a_Attacker = ((cEntity*) tolua_tousertype(tolua_S,3,0)); + int a_RawDamage = ((int) tolua_tonumber(tolua_S,4,0)); + int a_FinalDamage = ((int) tolua_tonumber(tolua_S,5,0)); + double a_KnockbackAmount = ((double) tolua_tonumber(tolua_S,6,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsSprinting'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'TakeDamage'", NULL); #endif { - bool tolua_ret = (bool) self->IsSprinting(); - tolua_pushboolean(tolua_S,(bool)tolua_ret); + self->TakeDamage(a_DamageType,a_Attacker,a_RawDamage,a_FinalDamage,a_KnockbackAmount); } } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'IsSprinting'.",&tolua_err); return 0; -#endif +tolua_lerror: + return tolua_AllToLua_cEntity_TakeDamage01(tolua_S); } #endif //#ifndef TOLUA_DISABLE -/* method: IsRclking of class cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_IsRclking00 -static int tolua_AllToLua_cEntity_IsRclking00(lua_State* tolua_S) +/* method: GetRawDamageAgainst of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetRawDamageAgainst00 +static int tolua_AllToLua_cEntity_GetRawDamageAgainst00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const cEntity",0,&tolua_err)) || + !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* a_Receiver = ((const cEntity*) tolua_tousertype(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsRclking'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetRawDamageAgainst'", NULL); #endif { - bool tolua_ret = (bool) self->IsRclking(); - tolua_pushboolean(tolua_S,(bool)tolua_ret); + int tolua_ret = (int) self->GetRawDamageAgainst(*a_Receiver); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'IsRclking'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'GetRawDamageAgainst'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE - class Lua__cEntity : public cEntity, public ToluaBase { -public: - bool IsA( const char* a_ClassName)const { - if (push_method("IsA", tolua_AllToLua_cEntity_IsA00)) { - tolua_pushstring(lua_state, (const char*)a_ClassName); - ToluaBase::dbcall(lua_state, 2, 1); - bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; - } else { - return ( bool ) cEntity:: IsA(a_ClassName); - }; - }; - const char* GetClass( void )const { - if (push_method("GetClass", tolua_AllToLua_cEntity_GetClass00)) { - ToluaBase::dbcall(lua_state, 1, 1); - const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; - } else { - return ( const char* ) cEntity:: GetClass(); - }; - }; - const char* GetParentClass( void )const { - if (push_method("GetParentClass", tolua_AllToLua_cEntity_GetParentClass00)) { - ToluaBase::dbcall(lua_state, 1, 1); - const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; - } else { - return ( const char* ) cEntity:: GetParentClass(); - }; - }; - bool IsOnFire( void )const { - if (push_method("IsOnFire", tolua_AllToLua_cEntity_IsOnFire00)) { - ToluaBase::dbcall(lua_state, 1, 1); - bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; - } else { - return ( bool ) cEntity:: IsOnFire(); - }; - }; - bool IsCrouched( void )const { - if (push_method("IsCrouched", tolua_AllToLua_cEntity_IsCrouched00)) { - ToluaBase::dbcall(lua_state, 1, 1); - bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; - } else { - return ( bool ) cEntity:: IsCrouched(); - }; - }; - bool IsRiding( void )const { - if (push_method("IsRiding", tolua_AllToLua_cEntity_IsRiding00)) { - ToluaBase::dbcall(lua_state, 1, 1); - bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; - } else { - return ( bool ) cEntity:: IsRiding(); - }; - }; - bool IsSprinting( void )const { - if (push_method("IsSprinting", tolua_AllToLua_cEntity_IsSprinting00)) { - ToluaBase::dbcall(lua_state, 1, 1); - bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; - } else { - return ( bool ) cEntity:: IsSprinting(); - }; - }; - bool IsRclking( void )const { - if (push_method("IsRclking", tolua_AllToLua_cEntity_IsRclking00)) { - ToluaBase::dbcall(lua_state, 1, 1); - bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; - } else { - return ( bool ) cEntity:: IsRclking(); - }; - }; - - bool cEntity__IsA( const char* a_ClassName) { - return ( bool )cEntity::IsA(a_ClassName); - }; - const char* cEntity__GetClass( void ) { - return ( const char* )cEntity::GetClass(); - }; - const char* cEntity__GetParentClass( void ) { - return ( const char* )cEntity::GetParentClass(); - }; - bool cEntity__IsOnFire( void ) { - return ( bool )cEntity::IsOnFire(); - }; - bool cEntity__IsCrouched( void ) { - return ( bool )cEntity::IsCrouched(); - }; - bool cEntity__IsRiding( void ) { - return ( bool )cEntity::IsRiding(); - }; - bool cEntity__IsSprinting( void ) { - return ( bool )cEntity::IsSprinting(); - }; - bool cEntity__IsRclking( void ) { - return ( bool )cEntity::IsRclking(); - }; -}; - -/* method: tolua__set_instance of class Lua__cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_tolua__set_instance00 -static int tolua_AllToLua_Lua__cEntity_tolua__set_instance00(lua_State* tolua_S) +/* method: GetArmorCoverAgainst of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetArmorCoverAgainst00 +static int tolua_AllToLua_cEntity_GetArmorCoverAgainst00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || - !tolua_isnoobj(tolua_S,3,&tolua_err) + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"const cEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnoobj(tolua_S,5,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); - lua_State* L = tolua_S; - lua_Object lo = ((lua_Object) tolua_tovalue(tolua_S,2,0)); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* a_Attacker = ((const cEntity*) tolua_tousertype(tolua_S,2,0)); + eDamageType a_DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,3,0)); + int a_RawDamage = ((int) tolua_tonumber(tolua_S,4,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'tolua__set_instance'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetArmorCoverAgainst'", NULL); #endif { - self->tolua__set_instance(L,lo); + int tolua_ret = (int) self->GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } - return 0; + return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'tolua__set_instance'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'GetArmorCoverAgainst'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cEntity__IsA of class Lua__cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsA00 -static int tolua_AllToLua_Lua__cEntity_cEntity__IsA00(lua_State* tolua_S) +/* method: GetKnockbackAmountAgainst of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetKnockbackAmountAgainst00 +static int tolua_AllToLua_cEntity_GetKnockbackAmountAgainst00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || - !tolua_isstring(tolua_S,2,0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const cEntity",0,&tolua_err)) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); - const char* a_ClassName = ((const char*) tolua_tostring(tolua_S,2,0)); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* a_Receiver = ((const cEntity*) tolua_tousertype(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsA'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetKnockbackAmountAgainst'", NULL); #endif { - bool tolua_ret = (bool) self->cEntity__IsA(a_ClassName); - tolua_pushboolean(tolua_S,(bool)tolua_ret); + double tolua_ret = (double) self->GetKnockbackAmountAgainst(*a_Receiver); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cEntity__IsA'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'GetKnockbackAmountAgainst'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cEntity__GetClass of class Lua__cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetClass00 -static int tolua_AllToLua_Lua__cEntity_cEntity__GetClass00(lua_State* tolua_S) +/* method: GetEquippedWeapon of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetEquippedWeapon00 +static int tolua_AllToLua_cEntity_GetEquippedWeapon00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetClass'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEquippedWeapon'", NULL); #endif { - const char* tolua_ret = (const char*) self->cEntity__GetClass(); - tolua_pushstring(tolua_S,(const char*)tolua_ret); - } - } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cEntity__GetClass'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - -/* method: cEntity__GetParentClass of class Lua__cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetParentClass00 -static int tolua_AllToLua_Lua__cEntity_cEntity__GetParentClass00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetParentClass'", NULL); + cItem tolua_ret = (cItem) self->GetEquippedWeapon(); + { +#ifdef __cplusplus + void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); +#else + void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); #endif - { - const char* tolua_ret = (const char*) self->cEntity__GetParentClass(); - tolua_pushstring(tolua_S,(const char*)tolua_ret); + } } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cEntity__GetParentClass'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'GetEquippedWeapon'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cEntity__IsOnFire of class Lua__cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsOnFire00 -static int tolua_AllToLua_Lua__cEntity_cEntity__IsOnFire00(lua_State* tolua_S) +/* method: GetEquippedHelmet of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetEquippedHelmet00 +static int tolua_AllToLua_cEntity_GetEquippedHelmet00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsOnFire'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEquippedHelmet'", NULL); #endif { - bool tolua_ret = (bool) self->cEntity__IsOnFire(); - tolua_pushboolean(tolua_S,(bool)tolua_ret); - } - } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cEntity__IsOnFire'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - -/* method: cEntity__IsCrouched of class Lua__cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsCrouched00 -static int tolua_AllToLua_Lua__cEntity_cEntity__IsCrouched00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsCrouched'", NULL); + cItem tolua_ret = (cItem) self->GetEquippedHelmet(); + { +#ifdef __cplusplus + void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); +#else + void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); #endif - { - bool tolua_ret = (bool) self->cEntity__IsCrouched(); - tolua_pushboolean(tolua_S,(bool)tolua_ret); + } } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cEntity__IsCrouched'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'GetEquippedHelmet'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cEntity__IsRiding of class Lua__cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsRiding00 -static int tolua_AllToLua_Lua__cEntity_cEntity__IsRiding00(lua_State* tolua_S) +/* method: GetEquippedChestplate of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetEquippedChestplate00 +static int tolua_AllToLua_cEntity_GetEquippedChestplate00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsRiding'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEquippedChestplate'", NULL); #endif { - bool tolua_ret = (bool) self->cEntity__IsRiding(); - tolua_pushboolean(tolua_S,(bool)tolua_ret); + cItem tolua_ret = (cItem) self->GetEquippedChestplate(); + { +#ifdef __cplusplus + void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); +#else + void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); +#endif + } } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cEntity__IsRiding'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'GetEquippedChestplate'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cEntity__IsSprinting of class Lua__cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsSprinting00 -static int tolua_AllToLua_Lua__cEntity_cEntity__IsSprinting00(lua_State* tolua_S) +/* method: GetEquippedLeggings of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetEquippedLeggings00 +static int tolua_AllToLua_cEntity_GetEquippedLeggings00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsSprinting'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEquippedLeggings'", NULL); #endif { - bool tolua_ret = (bool) self->cEntity__IsSprinting(); - tolua_pushboolean(tolua_S,(bool)tolua_ret); + cItem tolua_ret = (cItem) self->GetEquippedLeggings(); + { +#ifdef __cplusplus + void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); +#else + void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); +#endif + } } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cEntity__IsSprinting'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'GetEquippedLeggings'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cEntity__IsRclking of class Lua__cEntity */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsRclking00 -static int tolua_AllToLua_Lua__cEntity_cEntity__IsRclking00(lua_State* tolua_S) +/* method: GetEquippedBoots of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetEquippedBoots00 +static int tolua_AllToLua_cEntity_GetEquippedBoots00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsRclking'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEquippedBoots'", NULL); #endif { - bool tolua_ret = (bool) self->cEntity__IsRclking(); - tolua_pushboolean(tolua_S,(bool)tolua_ret); + cItem tolua_ret = (cItem) self->GetEquippedBoots(); + { +#ifdef __cplusplus + void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); +#else + void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); +#endif + } } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cEntity__IsRclking'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - -/* get function: DamageType of class TakeDamageInfo */ -#ifndef TOLUA_DISABLE_tolua_get_TakeDamageInfo_DamageType -static int tolua_get_TakeDamageInfo_DamageType(lua_State* tolua_S) -{ - TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'DamageType'",NULL); -#endif - tolua_pushnumber(tolua_S,(lua_Number)self->DamageType); - return 1; -} -#endif //#ifndef TOLUA_DISABLE - -/* set function: DamageType of class TakeDamageInfo */ -#ifndef TOLUA_DISABLE_tolua_set_TakeDamageInfo_DamageType -static int tolua_set_TakeDamageInfo_DamageType(lua_State* tolua_S) -{ - TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'DamageType'",NULL); - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); -#endif - self->DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,2,0)) -; - return 0; -} -#endif //#ifndef TOLUA_DISABLE - -/* get function: Attacker of class TakeDamageInfo */ -#ifndef TOLUA_DISABLE_tolua_get_TakeDamageInfo_Attacker_ptr -static int tolua_get_TakeDamageInfo_Attacker_ptr(lua_State* tolua_S) -{ - TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'Attacker'",NULL); -#endif - tolua_pushusertype(tolua_S,(void*)self->Attacker,"cPawn"); - return 1; -} -#endif //#ifndef TOLUA_DISABLE - -/* set function: Attacker of class TakeDamageInfo */ -#ifndef TOLUA_DISABLE_tolua_set_TakeDamageInfo_Attacker_ptr -static int tolua_set_TakeDamageInfo_Attacker_ptr(lua_State* tolua_S) -{ - TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'Attacker'",NULL); - if (!tolua_isusertype(tolua_S,2,"cPawn",0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); -#endif - self->Attacker = ((cPawn*) tolua_tousertype(tolua_S,2,0)) -; - return 0; -} -#endif //#ifndef TOLUA_DISABLE - -/* get function: RawDamage of class TakeDamageInfo */ -#ifndef TOLUA_DISABLE_tolua_get_TakeDamageInfo_RawDamage -static int tolua_get_TakeDamageInfo_RawDamage(lua_State* tolua_S) -{ - TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'RawDamage'",NULL); -#endif - tolua_pushnumber(tolua_S,(lua_Number)self->RawDamage); - return 1; -} -#endif //#ifndef TOLUA_DISABLE - -/* set function: RawDamage of class TakeDamageInfo */ -#ifndef TOLUA_DISABLE_tolua_set_TakeDamageInfo_RawDamage -static int tolua_set_TakeDamageInfo_RawDamage(lua_State* tolua_S) -{ - TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'RawDamage'",NULL); - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); -#endif - self->RawDamage = ((int) tolua_tonumber(tolua_S,2,0)) -; - return 0; -} -#endif //#ifndef TOLUA_DISABLE - -/* get function: FinalDamage of class TakeDamageInfo */ -#ifndef TOLUA_DISABLE_tolua_get_TakeDamageInfo_FinalDamage -static int tolua_get_TakeDamageInfo_FinalDamage(lua_State* tolua_S) -{ - TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'FinalDamage'",NULL); -#endif - tolua_pushnumber(tolua_S,(lua_Number)self->FinalDamage); - return 1; -} -#endif //#ifndef TOLUA_DISABLE - -/* set function: FinalDamage of class TakeDamageInfo */ -#ifndef TOLUA_DISABLE_tolua_set_TakeDamageInfo_FinalDamage -static int tolua_set_TakeDamageInfo_FinalDamage(lua_State* tolua_S) -{ - TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'FinalDamage'",NULL); - if (!tolua_isnumber(tolua_S,2,0,&tolua_err)) - tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); -#endif - self->FinalDamage = ((int) tolua_tonumber(tolua_S,2,0)) -; + tolua_error(tolua_S,"#ferror in function 'GetEquippedBoots'.",&tolua_err); return 0; -} -#endif //#ifndef TOLUA_DISABLE - -/* get function: Knockback of class TakeDamageInfo */ -#ifndef TOLUA_DISABLE_tolua_get_TakeDamageInfo_Knockback -static int tolua_get_TakeDamageInfo_Knockback(lua_State* tolua_S) -{ - TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'Knockback'",NULL); #endif - tolua_pushusertype(tolua_S,(void*)&self->Knockback,"Vector3d"); - return 1; } #endif //#ifndef TOLUA_DISABLE -/* set function: Knockback of class TakeDamageInfo */ -#ifndef TOLUA_DISABLE_tolua_set_TakeDamageInfo_Knockback -static int tolua_set_TakeDamageInfo_Knockback(lua_State* tolua_S) -{ - TakeDamageInfo* self = (TakeDamageInfo*) tolua_tousertype(tolua_S,1,0); -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if (!self) tolua_error(tolua_S,"invalid 'self' in accessing variable 'Knockback'",NULL); - if ((tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"Vector3d",0,&tolua_err))) - tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err); -#endif - self->Knockback = *((Vector3d*) tolua_tousertype(tolua_S,2,0)) -; - return 0; -} -#endif //#ifndef TOLUA_DISABLE - -/* method: TeleportToEntity of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_TeleportToEntity00 -static int tolua_AllToLua_cPawn_TeleportToEntity00(lua_State* tolua_S) +/* method: KilledBy of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_KilledBy00 +static int tolua_AllToLua_cEntity_KilledBy00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || - (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"cEntity",0,&tolua_err)) || + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); - cEntity* a_Entity = ((cEntity*) tolua_tousertype(tolua_S,2,0)); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'TeleportToEntity'", NULL); -#endif - { - self->TeleportToEntity(*a_Entity); - } - } - return 0; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'TeleportToEntity'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - -/* method: TeleportTo of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_TeleportTo00 -static int tolua_AllToLua_cPawn_TeleportTo00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || - !tolua_isnumber(tolua_S,2,0,&tolua_err) || - !tolua_isnumber(tolua_S,3,0,&tolua_err) || - !tolua_isnumber(tolua_S,4,0,&tolua_err) || - !tolua_isnoobj(tolua_S,5,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); - double a_PosX = ((double) tolua_tonumber(tolua_S,2,0)); - double a_PosY = ((double) tolua_tonumber(tolua_S,3,0)); - double a_PosZ = ((double) tolua_tonumber(tolua_S,4,0)); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + cEntity* a_Killer = ((cEntity*) tolua_tousertype(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'TeleportTo'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'KilledBy'", NULL); #endif { - self->TeleportTo(a_PosX,a_PosY,a_PosZ); + self->KilledBy(a_Killer); } } return 0; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'TeleportTo'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'KilledBy'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: Heal of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_Heal00 -static int tolua_AllToLua_cPawn_Heal00(lua_State* tolua_S) +/* method: Heal of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_Heal00 +static int tolua_AllToLua_cEntity_Heal00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || !tolua_isnumber(tolua_S,2,0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) @@ -6698,7 +6518,7 @@ static int tolua_AllToLua_cPawn_Heal00(lua_State* tolua_S) else #endif { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); int a_HitPoints = ((int) tolua_tonumber(tolua_S,2,0)); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Heal'", NULL); @@ -6716,21 +6536,21 @@ static int tolua_AllToLua_cPawn_Heal00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: GetHealth of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_GetHealth00 -static int tolua_AllToLua_cPawn_GetHealth00(lua_State* tolua_S) +/* method: GetHealth of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetHealth00 +static int tolua_AllToLua_cEntity_GetHealth00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"const cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - const cPawn* self = (const cPawn*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetHealth'", NULL); #endif @@ -6748,218 +6568,177 @@ static int tolua_AllToLua_cPawn_GetHealth00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: TakeDamage of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_TakeDamage00 -static int tolua_AllToLua_cPawn_TakeDamage00(lua_State* tolua_S) +/* method: SetMaxHealth of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_SetMaxHealth00 +static int tolua_AllToLua_cEntity_SetMaxHealth00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || - (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"cPawn",0,&tolua_err)) || + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); - cPawn* a_Attacker = ((cPawn*) tolua_tousertype(tolua_S,2,0)); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + int a_MaxHealth = ((int) tolua_tonumber(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'TakeDamage'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetMaxHealth'", NULL); #endif { - self->TakeDamage(*a_Attacker); + self->SetMaxHealth(a_MaxHealth); } } return 0; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'TakeDamage'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'SetMaxHealth'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: TakeDamage of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_TakeDamage01 -static int tolua_AllToLua_cPawn_TakeDamage01(lua_State* tolua_S) +/* method: GetMaxHealth of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_GetMaxHealth00 +static int tolua_AllToLua_cEntity_GetMaxHealth00(lua_State* tolua_S) { - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || - !tolua_isnumber(tolua_S,2,0,&tolua_err) || - !tolua_isusertype(tolua_S,3,"cPawn",0,&tolua_err) || - !tolua_isnumber(tolua_S,4,0,&tolua_err) || - !tolua_isnumber(tolua_S,5,0,&tolua_err) || - !tolua_isnoobj(tolua_S,6,&tolua_err) - ) - goto tolua_lerror; - else - { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); - eDamageType a_DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,2,0)); - cPawn* a_Attacker = ((cPawn*) tolua_tousertype(tolua_S,3,0)); - int a_RawDamage = ((int) tolua_tonumber(tolua_S,4,0)); - double a_KnockbackAmount = ((double) tolua_tonumber(tolua_S,5,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'TakeDamage'", NULL); -#endif - { - self->TakeDamage(a_DamageType,a_Attacker,a_RawDamage,a_KnockbackAmount); - } - } - return 0; -tolua_lerror: - return tolua_AllToLua_cPawn_TakeDamage00(tolua_S); -} -#endif //#ifndef TOLUA_DISABLE - -/* method: TakeDamage of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_TakeDamage02 -static int tolua_AllToLua_cPawn_TakeDamage02(lua_State* tolua_S) -{ tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || - !tolua_isnumber(tolua_S,2,0,&tolua_err) || - !tolua_isusertype(tolua_S,3,"cPawn",0,&tolua_err) || - !tolua_isnumber(tolua_S,4,0,&tolua_err) || - !tolua_isnumber(tolua_S,5,0,&tolua_err) || - !tolua_isnumber(tolua_S,6,0,&tolua_err) || - !tolua_isnoobj(tolua_S,7,&tolua_err) + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else +#endif { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); - eDamageType a_DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,2,0)); - cPawn* a_Attacker = ((cPawn*) tolua_tousertype(tolua_S,3,0)); - int a_RawDamage = ((int) tolua_tonumber(tolua_S,4,0)); - int a_FinalDamage = ((int) tolua_tonumber(tolua_S,5,0)); - double a_KnockbackAmount = ((double) tolua_tonumber(tolua_S,6,0)); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'TakeDamage'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetMaxHealth'", NULL); #endif { - self->TakeDamage(a_DamageType,a_Attacker,a_RawDamage,a_FinalDamage,a_KnockbackAmount); + int tolua_ret = (int) self->GetMaxHealth(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'GetMaxHealth'.",&tolua_err); return 0; -tolua_lerror: - return tolua_AllToLua_cPawn_TakeDamage01(tolua_S); +#endif } #endif //#ifndef TOLUA_DISABLE -/* method: DoTakeDamage of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_DoTakeDamage00 -static int tolua_AllToLua_cPawn_DoTakeDamage00(lua_State* tolua_S) +/* method: StartBurning of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_StartBurning00 +static int tolua_AllToLua_cEntity_StartBurning00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || - (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"TakeDamageInfo",0,&tolua_err)) || + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); - TakeDamageInfo* a_TDI = ((TakeDamageInfo*) tolua_tousertype(tolua_S,2,0)); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + int a_TicksLeftBurning = ((int) tolua_tonumber(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'DoTakeDamage'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'StartBurning'", NULL); #endif { - self->DoTakeDamage(*a_TDI); + self->StartBurning(a_TicksLeftBurning); } } return 0; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'DoTakeDamage'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'StartBurning'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: KilledBy of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_KilledBy00 -static int tolua_AllToLua_cPawn_KilledBy00(lua_State* tolua_S) +/* method: StopBurning of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_StopBurning00 +static int tolua_AllToLua_cEntity_StopBurning00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || - !tolua_isusertype(tolua_S,2,"cPawn",0,&tolua_err) || - !tolua_isnoobj(tolua_S,3,&tolua_err) + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); - cPawn* a_Killer = ((cPawn*) tolua_tousertype(tolua_S,2,0)); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'KilledBy'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'StopBurning'", NULL); #endif { - self->KilledBy(a_Killer); + self->StopBurning(); } } return 0; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'KilledBy'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'StopBurning'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: GetRawDamageAgainst of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_GetRawDamageAgainst00 -static int tolua_AllToLua_cPawn_GetRawDamageAgainst00(lua_State* tolua_S) +/* method: TeleportToEntity of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_TeleportToEntity00 +static int tolua_AllToLua_cEntity_TeleportToEntity00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || - (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const cPawn",0,&tolua_err)) || + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"cEntity",0,&tolua_err)) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); - const cPawn* a_Receiver = ((const cPawn*) tolua_tousertype(tolua_S,2,0)); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + cEntity* a_Entity = ((cEntity*) tolua_tousertype(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetRawDamageAgainst'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'TeleportToEntity'", NULL); #endif { - int tolua_ret = (int) self->GetRawDamageAgainst(*a_Receiver); - tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + self->TeleportToEntity(*a_Entity); } } - return 1; + return 0; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'GetRawDamageAgainst'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'TeleportToEntity'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: GetArmorCoverAgainst of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_GetArmorCoverAgainst00 -static int tolua_AllToLua_cPawn_GetArmorCoverAgainst00(lua_State* tolua_S) +/* method: TeleportToCoords of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_TeleportToCoords00 +static int tolua_AllToLua_cEntity_TeleportToCoords00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || - !tolua_isusertype(tolua_S,2,"const cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"cEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || !tolua_isnumber(tolua_S,3,0,&tolua_err) || !tolua_isnumber(tolua_S,4,0,&tolua_err) || !tolua_isnoobj(tolua_S,5,&tolua_err) @@ -6968,321 +6747,233 @@ static int tolua_AllToLua_cPawn_GetArmorCoverAgainst00(lua_State* tolua_S) else #endif { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); - const cPawn* a_Attacker = ((const cPawn*) tolua_tousertype(tolua_S,2,0)); - eDamageType a_DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,3,0)); - int a_RawDamage = ((int) tolua_tonumber(tolua_S,4,0)); + cEntity* self = (cEntity*) tolua_tousertype(tolua_S,1,0); + double a_PosX = ((double) tolua_tonumber(tolua_S,2,0)); + double a_PosY = ((double) tolua_tonumber(tolua_S,3,0)); + double a_PosZ = ((double) tolua_tonumber(tolua_S,4,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetArmorCoverAgainst'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'TeleportToCoords'", NULL); #endif { - int tolua_ret = (int) self->GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); - tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + self->TeleportToCoords(a_PosX,a_PosY,a_PosZ); } } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'GetArmorCoverAgainst'.",&tolua_err); return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - -/* method: GetKnockbackAmountAgainst of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_GetKnockbackAmountAgainst00 -static int tolua_AllToLua_cPawn_GetKnockbackAmountAgainst00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertype(tolua_S,1,"cPawn",0,&tolua_err) || - (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const cPawn",0,&tolua_err)) || - !tolua_isnoobj(tolua_S,3,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - cPawn* self = (cPawn*) tolua_tousertype(tolua_S,1,0); - const cPawn* a_Receiver = ((const cPawn*) tolua_tousertype(tolua_S,2,0)); -#ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetKnockbackAmountAgainst'", NULL); -#endif - { - double tolua_ret = (double) self->GetKnockbackAmountAgainst(*a_Receiver); - tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); - } - } - return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'GetKnockbackAmountAgainst'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'TeleportToCoords'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: GetEquippedWeapon of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_GetEquippedWeapon00 -static int tolua_AllToLua_cPawn_GetEquippedWeapon00(lua_State* tolua_S) +/* method: IsOnFire of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_IsOnFire00 +static int tolua_AllToLua_cEntity_IsOnFire00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"const cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - const cPawn* self = (const cPawn*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEquippedWeapon'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsOnFire'", NULL); #endif { - cItem tolua_ret = (cItem) self->GetEquippedWeapon(); - { -#ifdef __cplusplus - void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#else - void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#endif - } + bool tolua_ret = (bool) self->IsOnFire(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'GetEquippedWeapon'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'IsOnFire'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: GetEquippedHelmet of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_GetEquippedHelmet00 -static int tolua_AllToLua_cPawn_GetEquippedHelmet00(lua_State* tolua_S) +/* method: IsCrouched of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_IsCrouched00 +static int tolua_AllToLua_cEntity_IsCrouched00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"const cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - const cPawn* self = (const cPawn*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEquippedHelmet'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsCrouched'", NULL); #endif { - cItem tolua_ret = (cItem) self->GetEquippedHelmet(); - { -#ifdef __cplusplus - void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#else - void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#endif - } + bool tolua_ret = (bool) self->IsCrouched(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'GetEquippedHelmet'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'IsCrouched'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: GetEquippedChestplate of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_GetEquippedChestplate00 -static int tolua_AllToLua_cPawn_GetEquippedChestplate00(lua_State* tolua_S) +/* method: IsRiding of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_IsRiding00 +static int tolua_AllToLua_cEntity_IsRiding00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"const cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - const cPawn* self = (const cPawn*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEquippedChestplate'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsRiding'", NULL); #endif { - cItem tolua_ret = (cItem) self->GetEquippedChestplate(); - { -#ifdef __cplusplus - void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#else - void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#endif - } + bool tolua_ret = (bool) self->IsRiding(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'GetEquippedChestplate'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'IsRiding'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: GetEquippedLeggings of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_GetEquippedLeggings00 -static int tolua_AllToLua_cPawn_GetEquippedLeggings00(lua_State* tolua_S) +/* method: IsSprinting of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_IsSprinting00 +static int tolua_AllToLua_cEntity_IsSprinting00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"const cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - const cPawn* self = (const cPawn*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEquippedLeggings'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsSprinting'", NULL); #endif { - cItem tolua_ret = (cItem) self->GetEquippedLeggings(); - { -#ifdef __cplusplus - void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#else - void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#endif - } + bool tolua_ret = (bool) self->IsSprinting(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'GetEquippedLeggings'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'IsSprinting'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: GetEquippedBoots of class cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cPawn_GetEquippedBoots00 -static int tolua_AllToLua_cPawn_GetEquippedBoots00(lua_State* tolua_S) +/* method: IsRclking of class cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cEntity_IsRclking00 +static int tolua_AllToLua_cEntity_IsRclking00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"const cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - const cPawn* self = (const cPawn*) tolua_tousertype(tolua_S,1,0); + const cEntity* self = (const cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEquippedBoots'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IsRclking'", NULL); #endif { - cItem tolua_ret = (cItem) self->GetEquippedBoots(); - { -#ifdef __cplusplus - void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#else - void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#endif - } + bool tolua_ret = (bool) self->IsRclking(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'GetEquippedBoots'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'IsRclking'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE - class Lua__cPawn : public cPawn, public ToluaBase { + class Lua__cEntity : public cEntity, public ToluaBase { public: - void TeleportToEntity( cEntity& a_Entity) { - if (push_method("TeleportToEntity", tolua_AllToLua_cPawn_TeleportToEntity00)) { - tolua_pushusertype(lua_state, (void*)&a_Entity, "cEntity"); - ToluaBase::dbcall(lua_state, 2, 0); - } else { - return ( void ) cPawn:: TeleportToEntity(a_Entity); - }; - }; - void TeleportTo( double a_PosX, double a_PosY, double a_PosZ) { - if (push_method("TeleportTo", tolua_AllToLua_cPawn_TeleportTo00)) { - tolua_pushnumber(lua_state, (lua_Number)a_PosX); - tolua_pushnumber(lua_state, (lua_Number)a_PosY); - tolua_pushnumber(lua_state, (lua_Number)a_PosZ); - ToluaBase::dbcall(lua_state, 4, 0); + bool IsA( const char* a_ClassName)const { + if (push_method("IsA", tolua_AllToLua_cEntity_IsA00)) { + tolua_pushstring(lua_state, (const char*)a_ClassName); + ToluaBase::dbcall(lua_state, 2, 1); + bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; } else { - return ( void ) cPawn:: TeleportTo(a_PosX,a_PosY,a_PosZ); + return ( bool ) cEntity:: IsA(a_ClassName); }; }; - void DoTakeDamage( TakeDamageInfo& a_TDI) { - if (push_method("DoTakeDamage", tolua_AllToLua_cPawn_DoTakeDamage00)) { - tolua_pushusertype(lua_state, (void*)&a_TDI, "TakeDamageInfo"); - ToluaBase::dbcall(lua_state, 2, 0); + const char* GetClass( void )const { + if (push_method("GetClass", tolua_AllToLua_cEntity_GetClass00)) { + ToluaBase::dbcall(lua_state, 1, 1); + const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; } else { - return ( void ) cPawn:: DoTakeDamage(a_TDI); + return ( const char* ) cEntity:: GetClass(); }; }; - void KilledBy( cPawn* a_Killer) { - if (push_method("KilledBy", tolua_AllToLua_cPawn_KilledBy00)) { - tolua_pushusertype(lua_state, (void*)a_Killer, "cPawn"); - ToluaBase::dbcall(lua_state, 2, 0); + const char* GetParentClass( void )const { + if (push_method("GetParentClass", tolua_AllToLua_cEntity_GetParentClass00)) { + ToluaBase::dbcall(lua_state, 1, 1); + const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; } else { - return ( void ) cPawn:: KilledBy(a_Killer); + return ( const char* ) cEntity:: GetParentClass(); }; }; - int GetRawDamageAgainst( const cPawn& a_Receiver) { - if (push_method("GetRawDamageAgainst", tolua_AllToLua_cPawn_GetRawDamageAgainst00)) { - tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cPawn"); + int GetRawDamageAgainst( const cEntity& a_Receiver) { + if (push_method("GetRawDamageAgainst", tolua_AllToLua_cEntity_GetRawDamageAgainst00)) { + tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity"); ToluaBase::dbcall(lua_state, 2, 1); int tolua_ret = ( int )tolua_tonumber(lua_state, -1, 0); lua_pop(lua_state, 1); return tolua_ret; } else { - return ( int ) cPawn:: GetRawDamageAgainst(a_Receiver); + return ( int ) cEntity:: GetRawDamageAgainst(a_Receiver); }; }; - int GetArmorCoverAgainst( const cPawn* a_Attacker, eDamageType a_DamageType, int a_RawDamage) { - if (push_method("GetArmorCoverAgainst", tolua_AllToLua_cPawn_GetArmorCoverAgainst00)) { - tolua_pushusertype(lua_state, (void*)a_Attacker, "const cPawn"); + int GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) { + if (push_method("GetArmorCoverAgainst", tolua_AllToLua_cEntity_GetArmorCoverAgainst00)) { + tolua_pushusertype(lua_state, (void*)a_Attacker, "const cEntity"); tolua_pushnumber(lua_state, (lua_Number)a_DamageType); tolua_pushnumber(lua_state, (lua_Number)a_RawDamage); ToluaBase::dbcall(lua_state, 4, 1); @@ -7290,99 +6981,94 @@ public: lua_pop(lua_state, 1); return tolua_ret; } else { - return ( int ) cPawn:: GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); + return ( int ) cEntity:: GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); }; }; - double GetKnockbackAmountAgainst( const cPawn& a_Receiver) { - if (push_method("GetKnockbackAmountAgainst", tolua_AllToLua_cPawn_GetKnockbackAmountAgainst00)) { - tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cPawn"); + double GetKnockbackAmountAgainst( const cEntity& a_Receiver) { + if (push_method("GetKnockbackAmountAgainst", tolua_AllToLua_cEntity_GetKnockbackAmountAgainst00)) { + tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity"); ToluaBase::dbcall(lua_state, 2, 1); double tolua_ret = ( double )tolua_tonumber(lua_state, -1, 0); lua_pop(lua_state, 1); return tolua_ret; } else { - return ( double ) cPawn:: GetKnockbackAmountAgainst(a_Receiver); + return ( double ) cEntity:: GetKnockbackAmountAgainst(a_Receiver); }; }; cItem GetEquippedWeapon( void )const { - if (push_method("GetEquippedWeapon", tolua_AllToLua_cPawn_GetEquippedWeapon00)) { + if (push_method("GetEquippedWeapon", tolua_AllToLua_cEntity_GetEquippedWeapon00)) { ToluaBase::dbcall(lua_state, 1, 1); cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); lua_pop(lua_state, 1); return tolua_ret; } else { - return ( cItem ) cPawn:: GetEquippedWeapon(); + return ( cItem ) cEntity:: GetEquippedWeapon(); }; }; cItem GetEquippedHelmet( void )const { - if (push_method("GetEquippedHelmet", tolua_AllToLua_cPawn_GetEquippedHelmet00)) { + if (push_method("GetEquippedHelmet", tolua_AllToLua_cEntity_GetEquippedHelmet00)) { ToluaBase::dbcall(lua_state, 1, 1); cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); lua_pop(lua_state, 1); return tolua_ret; } else { - return ( cItem ) cPawn:: GetEquippedHelmet(); + return ( cItem ) cEntity:: GetEquippedHelmet(); }; }; cItem GetEquippedChestplate( void )const { - if (push_method("GetEquippedChestplate", tolua_AllToLua_cPawn_GetEquippedChestplate00)) { + if (push_method("GetEquippedChestplate", tolua_AllToLua_cEntity_GetEquippedChestplate00)) { ToluaBase::dbcall(lua_state, 1, 1); cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); lua_pop(lua_state, 1); return tolua_ret; } else { - return ( cItem ) cPawn:: GetEquippedChestplate(); + return ( cItem ) cEntity:: GetEquippedChestplate(); }; }; cItem GetEquippedLeggings( void )const { - if (push_method("GetEquippedLeggings", tolua_AllToLua_cPawn_GetEquippedLeggings00)) { + if (push_method("GetEquippedLeggings", tolua_AllToLua_cEntity_GetEquippedLeggings00)) { ToluaBase::dbcall(lua_state, 1, 1); cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); lua_pop(lua_state, 1); return tolua_ret; } else { - return ( cItem ) cPawn:: GetEquippedLeggings(); + return ( cItem ) cEntity:: GetEquippedLeggings(); }; }; cItem GetEquippedBoots( void )const { - if (push_method("GetEquippedBoots", tolua_AllToLua_cPawn_GetEquippedBoots00)) { + if (push_method("GetEquippedBoots", tolua_AllToLua_cEntity_GetEquippedBoots00)) { ToluaBase::dbcall(lua_state, 1, 1); cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); lua_pop(lua_state, 1); return tolua_ret; } else { - return ( cItem ) cPawn:: GetEquippedBoots(); + return ( cItem ) cEntity:: GetEquippedBoots(); }; }; - bool IsA( const char* a_ClassName)const { - if (push_method("IsA", tolua_AllToLua_cEntity_IsA00)) { - tolua_pushstring(lua_state, (const char*)a_ClassName); - ToluaBase::dbcall(lua_state, 2, 1); - bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; + void KilledBy( cEntity* a_Killer) { + if (push_method("KilledBy", tolua_AllToLua_cEntity_KilledBy00)) { + tolua_pushusertype(lua_state, (void*)a_Killer, "cEntity"); + ToluaBase::dbcall(lua_state, 2, 0); } else { - return ( bool ) cPawn:: IsA(a_ClassName); + return ( void ) cEntity:: KilledBy(a_Killer); }; }; - const char* GetClass( void )const { - if (push_method("GetClass", tolua_AllToLua_cEntity_GetClass00)) { - ToluaBase::dbcall(lua_state, 1, 1); - const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; + void TeleportToEntity( cEntity& a_Entity) { + if (push_method("TeleportToEntity", tolua_AllToLua_cEntity_TeleportToEntity00)) { + tolua_pushusertype(lua_state, (void*)&a_Entity, "cEntity"); + ToluaBase::dbcall(lua_state, 2, 0); } else { - return ( const char* ) cPawn:: GetClass(); + return ( void ) cEntity:: TeleportToEntity(a_Entity); }; }; - const char* GetParentClass( void )const { - if (push_method("GetParentClass", tolua_AllToLua_cEntity_GetParentClass00)) { - ToluaBase::dbcall(lua_state, 1, 1); - const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; + void TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) { + if (push_method("TeleportToCoords", tolua_AllToLua_cEntity_TeleportToCoords00)) { + tolua_pushnumber(lua_state, (lua_Number)a_PosX); + tolua_pushnumber(lua_state, (lua_Number)a_PosY); + tolua_pushnumber(lua_state, (lua_Number)a_PosZ); + ToluaBase::dbcall(lua_state, 4, 0); } else { - return ( const char* ) cPawn:: GetParentClass(); + return ( void ) cEntity:: TeleportToCoords(a_PosX,a_PosY,a_PosZ); }; }; bool IsOnFire( void )const { @@ -7392,7 +7078,7 @@ public: lua_pop(lua_state, 1); return tolua_ret; } else { - return ( bool ) cPawn:: IsOnFire(); + return ( bool ) cEntity:: IsOnFire(); }; }; bool IsCrouched( void )const { @@ -7402,7 +7088,7 @@ public: lua_pop(lua_state, 1); return tolua_ret; } else { - return ( bool ) cPawn:: IsCrouched(); + return ( bool ) cEntity:: IsCrouched(); }; }; bool IsRiding( void )const { @@ -7412,7 +7098,7 @@ public: lua_pop(lua_state, 1); return tolua_ret; } else { - return ( bool ) cPawn:: IsRiding(); + return ( bool ) cEntity:: IsRiding(); }; }; bool IsSprinting( void )const { @@ -7422,7 +7108,7 @@ public: lua_pop(lua_state, 1); return tolua_ret; } else { - return ( bool ) cPawn:: IsSprinting(); + return ( bool ) cEntity:: IsSprinting(); }; }; bool IsRclking( void )const { @@ -7432,87 +7118,84 @@ public: lua_pop(lua_state, 1); return tolua_ret; } else { - return ( bool ) cPawn:: IsRclking(); + return ( bool ) cEntity:: IsRclking(); }; }; - void cPawn__TeleportToEntity( cEntity& a_Entity) { - return ( void )cPawn::TeleportToEntity(a_Entity); - }; - void cPawn__TeleportTo( double a_PosX, double a_PosY, double a_PosZ) { - return ( void )cPawn::TeleportTo(a_PosX,a_PosY,a_PosZ); + bool cEntity__IsA( const char* a_ClassName) { + return ( bool )cEntity::IsA(a_ClassName); }; - void cPawn__DoTakeDamage( TakeDamageInfo& a_TDI) { - return ( void )cPawn::DoTakeDamage(a_TDI); + const char* cEntity__GetClass( void ) { + return ( const char* )cEntity::GetClass(); }; - void cPawn__KilledBy( cPawn* a_Killer) { - return ( void )cPawn::KilledBy(a_Killer); + const char* cEntity__GetParentClass( void ) { + return ( const char* )cEntity::GetParentClass(); }; - int cPawn__GetRawDamageAgainst( const cPawn& a_Receiver) { - return ( int )cPawn::GetRawDamageAgainst(a_Receiver); + int cEntity__GetRawDamageAgainst( const cEntity& a_Receiver) { + return ( int )cEntity::GetRawDamageAgainst(a_Receiver); }; - int cPawn__GetArmorCoverAgainst( const cPawn* a_Attacker, eDamageType a_DamageType, int a_RawDamage) { - return ( int )cPawn::GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); + int cEntity__GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) { + return ( int )cEntity::GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); }; - double cPawn__GetKnockbackAmountAgainst( const cPawn& a_Receiver) { - return ( double )cPawn::GetKnockbackAmountAgainst(a_Receiver); + double cEntity__GetKnockbackAmountAgainst( const cEntity& a_Receiver) { + return ( double )cEntity::GetKnockbackAmountAgainst(a_Receiver); }; - cItem cPawn__GetEquippedWeapon( void ) { - return ( cItem )cPawn::GetEquippedWeapon(); + cItem cEntity__GetEquippedWeapon( void ) { + return ( cItem )cEntity::GetEquippedWeapon(); }; - cItem cPawn__GetEquippedHelmet( void ) { - return ( cItem )cPawn::GetEquippedHelmet(); + cItem cEntity__GetEquippedHelmet( void ) { + return ( cItem )cEntity::GetEquippedHelmet(); }; - cItem cPawn__GetEquippedChestplate( void ) { - return ( cItem )cPawn::GetEquippedChestplate(); + cItem cEntity__GetEquippedChestplate( void ) { + return ( cItem )cEntity::GetEquippedChestplate(); }; - cItem cPawn__GetEquippedLeggings( void ) { - return ( cItem )cPawn::GetEquippedLeggings(); + cItem cEntity__GetEquippedLeggings( void ) { + return ( cItem )cEntity::GetEquippedLeggings(); }; - cItem cPawn__GetEquippedBoots( void ) { - return ( cItem )cPawn::GetEquippedBoots(); + cItem cEntity__GetEquippedBoots( void ) { + return ( cItem )cEntity::GetEquippedBoots(); }; - bool cPawn__IsA( const char* a_ClassName) { - return ( bool )cPawn::IsA(a_ClassName); + void cEntity__KilledBy( cEntity* a_Killer) { + return ( void )cEntity::KilledBy(a_Killer); }; - const char* cPawn__GetClass( void ) { - return ( const char* )cPawn::GetClass(); + void cEntity__TeleportToEntity( cEntity& a_Entity) { + return ( void )cEntity::TeleportToEntity(a_Entity); }; - const char* cPawn__GetParentClass( void ) { - return ( const char* )cPawn::GetParentClass(); + void cEntity__TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) { + return ( void )cEntity::TeleportToCoords(a_PosX,a_PosY,a_PosZ); }; - bool cPawn__IsOnFire( void ) { - return ( bool )cPawn::IsOnFire(); + bool cEntity__IsOnFire( void ) { + return ( bool )cEntity::IsOnFire(); }; - bool cPawn__IsCrouched( void ) { - return ( bool )cPawn::IsCrouched(); + bool cEntity__IsCrouched( void ) { + return ( bool )cEntity::IsCrouched(); }; - bool cPawn__IsRiding( void ) { - return ( bool )cPawn::IsRiding(); + bool cEntity__IsRiding( void ) { + return ( bool )cEntity::IsRiding(); }; - bool cPawn__IsSprinting( void ) { - return ( bool )cPawn::IsSprinting(); + bool cEntity__IsSprinting( void ) { + return ( bool )cEntity::IsSprinting(); }; - bool cPawn__IsRclking( void ) { - return ( bool )cPawn::IsRclking(); + bool cEntity__IsRclking( void ) { + return ( bool )cEntity::IsRclking(); }; }; -/* method: tolua__set_instance of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_tolua__set_instance00 -static int tolua_AllToLua_Lua__cPawn_tolua__set_instance00(lua_State* tolua_S) +/* method: tolua__set_instance of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_tolua__set_instance00 +static int tolua_AllToLua_Lua__cEntity_tolua__set_instance00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); lua_State* L = tolua_S; lua_Object lo = ((lua_Object) tolua_tovalue(tolua_S,2,0)); #ifndef TOLUA_RELEASE @@ -7531,268 +7214,272 @@ static int tolua_AllToLua_Lua__cPawn_tolua__set_instance00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__TeleportToEntity of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__TeleportToEntity00 -static int tolua_AllToLua_Lua__cPawn_cPawn__TeleportToEntity00(lua_State* tolua_S) +/* method: cEntity__IsA of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsA00 +static int tolua_AllToLua_Lua__cEntity_cEntity__IsA00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || - (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"cEntity",0,&tolua_err)) || + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isstring(tolua_S,2,0,&tolua_err) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); - cEntity* a_Entity = ((cEntity*) tolua_tousertype(tolua_S,2,0)); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + const char* a_ClassName = ((const char*) tolua_tostring(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__TeleportToEntity'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsA'", NULL); #endif { - self->cPawn__TeleportToEntity(*a_Entity); + bool tolua_ret = (bool) self->cEntity__IsA(a_ClassName); + tolua_pushboolean(tolua_S,(bool)tolua_ret); } } - return 0; + return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__TeleportToEntity'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__IsA'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__TeleportTo of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__TeleportTo00 -static int tolua_AllToLua_Lua__cPawn_cPawn__TeleportTo00(lua_State* tolua_S) +/* method: cEntity__GetClass of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetClass00 +static int tolua_AllToLua_Lua__cEntity_cEntity__GetClass00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || - !tolua_isnumber(tolua_S,2,0,&tolua_err) || - !tolua_isnumber(tolua_S,3,0,&tolua_err) || - !tolua_isnumber(tolua_S,4,0,&tolua_err) || - !tolua_isnoobj(tolua_S,5,&tolua_err) + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); - double a_PosX = ((double) tolua_tonumber(tolua_S,2,0)); - double a_PosY = ((double) tolua_tonumber(tolua_S,3,0)); - double a_PosZ = ((double) tolua_tonumber(tolua_S,4,0)); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__TeleportTo'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetClass'", NULL); #endif { - self->cPawn__TeleportTo(a_PosX,a_PosY,a_PosZ); + const char* tolua_ret = (const char*) self->cEntity__GetClass(); + tolua_pushstring(tolua_S,(const char*)tolua_ret); } } - return 0; + return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__TeleportTo'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__GetClass'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__DoTakeDamage of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__DoTakeDamage00 -static int tolua_AllToLua_Lua__cPawn_cPawn__DoTakeDamage00(lua_State* tolua_S) +/* method: cEntity__GetParentClass of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetParentClass00 +static int tolua_AllToLua_Lua__cEntity_cEntity__GetParentClass00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || - (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"TakeDamageInfo",0,&tolua_err)) || - !tolua_isnoobj(tolua_S,3,&tolua_err) + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); - TakeDamageInfo* a_TDI = ((TakeDamageInfo*) tolua_tousertype(tolua_S,2,0)); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__DoTakeDamage'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetParentClass'", NULL); #endif { - self->cPawn__DoTakeDamage(*a_TDI); + const char* tolua_ret = (const char*) self->cEntity__GetParentClass(); + tolua_pushstring(tolua_S,(const char*)tolua_ret); } } - return 0; + return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__DoTakeDamage'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__GetParentClass'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__KilledBy of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__KilledBy00 -static int tolua_AllToLua_Lua__cPawn_cPawn__KilledBy00(lua_State* tolua_S) +/* method: cEntity__GetRawDamageAgainst of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetRawDamageAgainst00 +static int tolua_AllToLua_Lua__cEntity_cEntity__GetRawDamageAgainst00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || - !tolua_isusertype(tolua_S,2,"cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const cEntity",0,&tolua_err)) || !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); - cPawn* a_Killer = ((cPawn*) tolua_tousertype(tolua_S,2,0)); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* a_Receiver = ((const cEntity*) tolua_tousertype(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__KilledBy'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetRawDamageAgainst'", NULL); #endif { - self->cPawn__KilledBy(a_Killer); + int tolua_ret = (int) self->cEntity__GetRawDamageAgainst(*a_Receiver); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } - return 0; + return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__KilledBy'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__GetRawDamageAgainst'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__GetRawDamageAgainst of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__GetRawDamageAgainst00 -static int tolua_AllToLua_Lua__cPawn_cPawn__GetRawDamageAgainst00(lua_State* tolua_S) +/* method: cEntity__GetArmorCoverAgainst of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetArmorCoverAgainst00 +static int tolua_AllToLua_Lua__cEntity_cEntity__GetArmorCoverAgainst00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || - (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const cPawn",0,&tolua_err)) || - !tolua_isnoobj(tolua_S,3,&tolua_err) + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"const cEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnoobj(tolua_S,5,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); - const cPawn* a_Receiver = ((const cPawn*) tolua_tousertype(tolua_S,2,0)); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* a_Attacker = ((const cEntity*) tolua_tousertype(tolua_S,2,0)); + eDamageType a_DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,3,0)); + int a_RawDamage = ((int) tolua_tonumber(tolua_S,4,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__GetRawDamageAgainst'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetArmorCoverAgainst'", NULL); #endif { - int tolua_ret = (int) self->cPawn__GetRawDamageAgainst(*a_Receiver); + int tolua_ret = (int) self->cEntity__GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__GetRawDamageAgainst'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__GetArmorCoverAgainst'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__GetArmorCoverAgainst of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__GetArmorCoverAgainst00 -static int tolua_AllToLua_Lua__cPawn_cPawn__GetArmorCoverAgainst00(lua_State* tolua_S) +/* method: cEntity__GetKnockbackAmountAgainst of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetKnockbackAmountAgainst00 +static int tolua_AllToLua_Lua__cEntity_cEntity__GetKnockbackAmountAgainst00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || - !tolua_isusertype(tolua_S,2,"const cPawn",0,&tolua_err) || - !tolua_isnumber(tolua_S,3,0,&tolua_err) || - !tolua_isnumber(tolua_S,4,0,&tolua_err) || - !tolua_isnoobj(tolua_S,5,&tolua_err) + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const cEntity",0,&tolua_err)) || + !tolua_isnoobj(tolua_S,3,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); - const cPawn* a_Attacker = ((const cPawn*) tolua_tousertype(tolua_S,2,0)); - eDamageType a_DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,3,0)); - int a_RawDamage = ((int) tolua_tonumber(tolua_S,4,0)); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + const cEntity* a_Receiver = ((const cEntity*) tolua_tousertype(tolua_S,2,0)); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__GetArmorCoverAgainst'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetKnockbackAmountAgainst'", NULL); #endif { - int tolua_ret = (int) self->cPawn__GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); + double tolua_ret = (double) self->cEntity__GetKnockbackAmountAgainst(*a_Receiver); tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__GetArmorCoverAgainst'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__GetKnockbackAmountAgainst'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__GetKnockbackAmountAgainst of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__GetKnockbackAmountAgainst00 -static int tolua_AllToLua_Lua__cPawn_cPawn__GetKnockbackAmountAgainst00(lua_State* tolua_S) +/* method: cEntity__GetEquippedWeapon of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedWeapon00 +static int tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedWeapon00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || - (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const cPawn",0,&tolua_err)) || - !tolua_isnoobj(tolua_S,3,&tolua_err) + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); - const cPawn* a_Receiver = ((const cPawn*) tolua_tousertype(tolua_S,2,0)); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__GetKnockbackAmountAgainst'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetEquippedWeapon'", NULL); #endif { - double tolua_ret = (double) self->cPawn__GetKnockbackAmountAgainst(*a_Receiver); - tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + cItem tolua_ret = (cItem) self->cEntity__GetEquippedWeapon(); + { +#ifdef __cplusplus + void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); +#else + void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); + tolua_pushusertype(tolua_S,tolua_obj,"cItem"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); +#endif + } } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__GetKnockbackAmountAgainst'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__GetEquippedWeapon'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__GetEquippedWeapon of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedWeapon00 -static int tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedWeapon00(lua_State* tolua_S) +/* method: cEntity__GetEquippedHelmet of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedHelmet00 +static int tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedHelmet00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__GetEquippedWeapon'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetEquippedHelmet'", NULL); #endif { - cItem tolua_ret = (cItem) self->cPawn__GetEquippedWeapon(); + cItem tolua_ret = (cItem) self->cEntity__GetEquippedHelmet(); { #ifdef __cplusplus void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); @@ -7809,32 +7496,32 @@ static int tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedWeapon00(lua_State* tolua return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__GetEquippedWeapon'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__GetEquippedHelmet'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__GetEquippedHelmet of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedHelmet00 -static int tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedHelmet00(lua_State* tolua_S) +/* method: cEntity__GetEquippedChestplate of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedChestplate00 +static int tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedChestplate00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__GetEquippedHelmet'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetEquippedChestplate'", NULL); #endif { - cItem tolua_ret = (cItem) self->cPawn__GetEquippedHelmet(); + cItem tolua_ret = (cItem) self->cEntity__GetEquippedChestplate(); { #ifdef __cplusplus void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); @@ -7851,32 +7538,32 @@ static int tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedHelmet00(lua_State* tolua return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__GetEquippedHelmet'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__GetEquippedChestplate'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__GetEquippedChestplate of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedChestplate00 -static int tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedChestplate00(lua_State* tolua_S) +/* method: cEntity__GetEquippedLeggings of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedLeggings00 +static int tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedLeggings00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__GetEquippedChestplate'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetEquippedLeggings'", NULL); #endif { - cItem tolua_ret = (cItem) self->cPawn__GetEquippedChestplate(); + cItem tolua_ret = (cItem) self->cEntity__GetEquippedLeggings(); { #ifdef __cplusplus void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); @@ -7893,32 +7580,32 @@ static int tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedChestplate00(lua_State* t return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__GetEquippedChestplate'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__GetEquippedLeggings'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__GetEquippedLeggings of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedLeggings00 -static int tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedLeggings00(lua_State* tolua_S) +/* method: cEntity__GetEquippedBoots of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedBoots00 +static int tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedBoots00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__GetEquippedLeggings'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetEquippedBoots'", NULL); #endif { - cItem tolua_ret = (cItem) self->cPawn__GetEquippedLeggings(); + cItem tolua_ret = (cItem) self->cEntity__GetEquippedBoots(); { #ifdef __cplusplus void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); @@ -7935,49 +7622,270 @@ static int tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedLeggings00(lua_State* tol return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__GetEquippedLeggings'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__GetEquippedBoots'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: cEntity__KilledBy of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__KilledBy00 +static int tolua_AllToLua_Lua__cEntity_cEntity__KilledBy00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"cEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + cEntity* a_Killer = ((cEntity*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__KilledBy'", NULL); +#endif + { + self->cEntity__KilledBy(a_Killer); + } + } + return 0; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'cEntity__KilledBy'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: cEntity__TeleportToEntity of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__TeleportToEntity00 +static int tolua_AllToLua_Lua__cEntity_cEntity__TeleportToEntity00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"cEntity",0,&tolua_err)) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + cEntity* a_Entity = ((cEntity*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__TeleportToEntity'", NULL); +#endif + { + self->cEntity__TeleportToEntity(*a_Entity); + } + } + return 0; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'cEntity__TeleportToEntity'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: cEntity__TeleportToCoords of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__TeleportToCoords00 +static int tolua_AllToLua_Lua__cEntity_cEntity__TeleportToCoords00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnoobj(tolua_S,5,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); + double a_PosX = ((double) tolua_tonumber(tolua_S,2,0)); + double a_PosY = ((double) tolua_tonumber(tolua_S,3,0)); + double a_PosZ = ((double) tolua_tonumber(tolua_S,4,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__TeleportToCoords'", NULL); +#endif + { + self->cEntity__TeleportToCoords(a_PosX,a_PosY,a_PosZ); + } + } + return 0; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'cEntity__TeleportToCoords'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: cEntity__IsOnFire of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsOnFire00 +static int tolua_AllToLua_Lua__cEntity_cEntity__IsOnFire00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsOnFire'", NULL); +#endif + { + bool tolua_ret = (bool) self->cEntity__IsOnFire(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'cEntity__IsOnFire'.",&tolua_err); return 0; #endif } #endif //#ifndef TOLUA_DISABLE -/* method: cPawn__GetEquippedBoots of class Lua__cPawn */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedBoots00 -static int tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedBoots00(lua_State* tolua_S) +/* method: cEntity__IsCrouched of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsCrouched00 +static int tolua_AllToLua_Lua__cEntity_cEntity__IsCrouched00(lua_State* tolua_S) { #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"Lua__cPawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - Lua__cPawn* self = (Lua__cPawn*) tolua_tousertype(tolua_S,1,0); + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE - if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPawn__GetEquippedBoots'", NULL); + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsCrouched'", NULL); #endif { - cItem tolua_ret = (cItem) self->cPawn__GetEquippedBoots(); - { -#ifdef __cplusplus - void* tolua_obj = Mtolua_new((cItem)(tolua_ret)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); -#else - void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem)); - tolua_pushusertype(tolua_S,tolua_obj,"cItem"); - tolua_register_gc(tolua_S,lua_gettop(tolua_S)); + bool tolua_ret = (bool) self->cEntity__IsCrouched(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'cEntity__IsCrouched'.",&tolua_err); + return 0; #endif - } +} +#endif //#ifndef TOLUA_DISABLE + +/* method: cEntity__IsRiding of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsRiding00 +static int tolua_AllToLua_Lua__cEntity_cEntity__IsRiding00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsRiding'", NULL); +#endif + { + bool tolua_ret = (bool) self->cEntity__IsRiding(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'cEntity__IsRiding'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: cEntity__IsSprinting of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsSprinting00 +static int tolua_AllToLua_Lua__cEntity_cEntity__IsSprinting00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsSprinting'", NULL); +#endif + { + bool tolua_ret = (bool) self->cEntity__IsSprinting(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); } } return 1; #ifndef TOLUA_RELEASE tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'cPawn__GetEquippedBoots'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'cEntity__IsSprinting'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: cEntity__IsRclking of class Lua__cEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsRclking00 +static int tolua_AllToLua_Lua__cEntity_cEntity__IsRclking00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsRclking'", NULL); +#endif + { + bool tolua_ret = (bool) self->cEntity__IsRclking(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'cEntity__IsRclking'.",&tolua_err); return 0; #endif } @@ -8023,14 +7931,14 @@ static int tolua_AllToLua_cPlayer_GetEyeHeight00(lua_State* tolua_S) #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cPlayer",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cPlayer",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - cPlayer* self = (cPlayer*) tolua_tousertype(tolua_S,1,0); + const cPlayer* self = (const cPlayer*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEyeHeight'", NULL); #endif @@ -8055,14 +7963,14 @@ static int tolua_AllToLua_cPlayer_GetEyePosition00(lua_State* tolua_S) #ifndef TOLUA_RELEASE tolua_Error tolua_err; if ( - !tolua_isusertype(tolua_S,1,"cPlayer",0,&tolua_err) || + !tolua_isusertype(tolua_S,1,"const cPlayer",0,&tolua_err) || !tolua_isnoobj(tolua_S,2,&tolua_err) ) goto tolua_lerror; else #endif { - cPlayer* self = (cPlayer*) tolua_tousertype(tolua_S,1,0); + const cPlayer* self = (const cPlayer*) tolua_tousertype(tolua_S,1,0); #ifndef TOLUA_RELEASE if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetEyePosition'", NULL); #endif @@ -9361,43 +9269,40 @@ public: return ( void ) cPlayer:: MoveTo(a_NewPos); }; }; - void TeleportToEntity( cEntity& a_Entity) { - if (push_method("TeleportToEntity", tolua_AllToLua_cPawn_TeleportToEntity00)) { - tolua_pushusertype(lua_state, (void*)&a_Entity, "cEntity"); - ToluaBase::dbcall(lua_state, 2, 0); - } else { - return ( void ) cPlayer:: TeleportToEntity(a_Entity); - }; - }; - void TeleportTo( double a_PosX, double a_PosY, double a_PosZ) { - if (push_method("TeleportTo", tolua_AllToLua_cPawn_TeleportTo00)) { - tolua_pushnumber(lua_state, (lua_Number)a_PosX); - tolua_pushnumber(lua_state, (lua_Number)a_PosY); - tolua_pushnumber(lua_state, (lua_Number)a_PosZ); - ToluaBase::dbcall(lua_state, 4, 0); + bool IsA( const char* a_ClassName)const { + if (push_method("IsA", tolua_AllToLua_cEntity_IsA00)) { + tolua_pushstring(lua_state, (const char*)a_ClassName); + ToluaBase::dbcall(lua_state, 2, 1); + bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; } else { - return ( void ) cPlayer:: TeleportTo(a_PosX,a_PosY,a_PosZ); + return ( bool ) cPlayer:: IsA(a_ClassName); }; }; - void DoTakeDamage( TakeDamageInfo& a_TDI) { - if (push_method("DoTakeDamage", tolua_AllToLua_cPawn_DoTakeDamage00)) { - tolua_pushusertype(lua_state, (void*)&a_TDI, "TakeDamageInfo"); - ToluaBase::dbcall(lua_state, 2, 0); + const char* GetClass( void )const { + if (push_method("GetClass", tolua_AllToLua_cEntity_GetClass00)) { + ToluaBase::dbcall(lua_state, 1, 1); + const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; } else { - return ( void ) cPlayer:: DoTakeDamage(a_TDI); + return ( const char* ) cPlayer:: GetClass(); }; }; - void KilledBy( cPawn* a_Killer) { - if (push_method("KilledBy", tolua_AllToLua_cPawn_KilledBy00)) { - tolua_pushusertype(lua_state, (void*)a_Killer, "cPawn"); - ToluaBase::dbcall(lua_state, 2, 0); + const char* GetParentClass( void )const { + if (push_method("GetParentClass", tolua_AllToLua_cEntity_GetParentClass00)) { + ToluaBase::dbcall(lua_state, 1, 1); + const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; } else { - return ( void ) cPlayer:: KilledBy(a_Killer); + return ( const char* ) cPlayer:: GetParentClass(); }; }; - int GetRawDamageAgainst( const cPawn& a_Receiver) { - if (push_method("GetRawDamageAgainst", tolua_AllToLua_cPawn_GetRawDamageAgainst00)) { - tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cPawn"); + int GetRawDamageAgainst( const cEntity& a_Receiver) { + if (push_method("GetRawDamageAgainst", tolua_AllToLua_cEntity_GetRawDamageAgainst00)) { + tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity"); ToluaBase::dbcall(lua_state, 2, 1); int tolua_ret = ( int )tolua_tonumber(lua_state, -1, 0); lua_pop(lua_state, 1); @@ -9406,9 +9311,9 @@ public: return ( int ) cPlayer:: GetRawDamageAgainst(a_Receiver); }; }; - int GetArmorCoverAgainst( const cPawn* a_Attacker, eDamageType a_DamageType, int a_RawDamage) { - if (push_method("GetArmorCoverAgainst", tolua_AllToLua_cPawn_GetArmorCoverAgainst00)) { - tolua_pushusertype(lua_state, (void*)a_Attacker, "const cPawn"); + int GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) { + if (push_method("GetArmorCoverAgainst", tolua_AllToLua_cEntity_GetArmorCoverAgainst00)) { + tolua_pushusertype(lua_state, (void*)a_Attacker, "const cEntity"); tolua_pushnumber(lua_state, (lua_Number)a_DamageType); tolua_pushnumber(lua_state, (lua_Number)a_RawDamage); ToluaBase::dbcall(lua_state, 4, 1); @@ -9419,9 +9324,9 @@ public: return ( int ) cPlayer:: GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); }; }; - double GetKnockbackAmountAgainst( const cPawn& a_Receiver) { - if (push_method("GetKnockbackAmountAgainst", tolua_AllToLua_cPawn_GetKnockbackAmountAgainst00)) { - tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cPawn"); + double GetKnockbackAmountAgainst( const cEntity& a_Receiver) { + if (push_method("GetKnockbackAmountAgainst", tolua_AllToLua_cEntity_GetKnockbackAmountAgainst00)) { + tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity"); ToluaBase::dbcall(lua_state, 2, 1); double tolua_ret = ( double )tolua_tonumber(lua_state, -1, 0); lua_pop(lua_state, 1); @@ -9431,7 +9336,7 @@ public: }; }; cItem GetEquippedWeapon( void )const { - if (push_method("GetEquippedWeapon", tolua_AllToLua_cPawn_GetEquippedWeapon00)) { + if (push_method("GetEquippedWeapon", tolua_AllToLua_cEntity_GetEquippedWeapon00)) { ToluaBase::dbcall(lua_state, 1, 1); cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); lua_pop(lua_state, 1); @@ -9441,7 +9346,7 @@ public: }; }; cItem GetEquippedHelmet( void )const { - if (push_method("GetEquippedHelmet", tolua_AllToLua_cPawn_GetEquippedHelmet00)) { + if (push_method("GetEquippedHelmet", tolua_AllToLua_cEntity_GetEquippedHelmet00)) { ToluaBase::dbcall(lua_state, 1, 1); cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); lua_pop(lua_state, 1); @@ -9451,7 +9356,7 @@ public: }; }; cItem GetEquippedChestplate( void )const { - if (push_method("GetEquippedChestplate", tolua_AllToLua_cPawn_GetEquippedChestplate00)) { + if (push_method("GetEquippedChestplate", tolua_AllToLua_cEntity_GetEquippedChestplate00)) { ToluaBase::dbcall(lua_state, 1, 1); cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); lua_pop(lua_state, 1); @@ -9461,7 +9366,7 @@ public: }; }; cItem GetEquippedLeggings( void )const { - if (push_method("GetEquippedLeggings", tolua_AllToLua_cPawn_GetEquippedLeggings00)) { + if (push_method("GetEquippedLeggings", tolua_AllToLua_cEntity_GetEquippedLeggings00)) { ToluaBase::dbcall(lua_state, 1, 1); cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); lua_pop(lua_state, 1); @@ -9471,7 +9376,7 @@ public: }; }; cItem GetEquippedBoots( void )const { - if (push_method("GetEquippedBoots", tolua_AllToLua_cPawn_GetEquippedBoots00)) { + if (push_method("GetEquippedBoots", tolua_AllToLua_cEntity_GetEquippedBoots00)) { ToluaBase::dbcall(lua_state, 1, 1); cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); lua_pop(lua_state, 1); @@ -9480,35 +9385,30 @@ public: return ( cItem ) cPlayer:: GetEquippedBoots(); }; }; - bool IsA( const char* a_ClassName)const { - if (push_method("IsA", tolua_AllToLua_cEntity_IsA00)) { - tolua_pushstring(lua_state, (const char*)a_ClassName); - ToluaBase::dbcall(lua_state, 2, 1); - bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; + void KilledBy( cEntity* a_Killer) { + if (push_method("KilledBy", tolua_AllToLua_cEntity_KilledBy00)) { + tolua_pushusertype(lua_state, (void*)a_Killer, "cEntity"); + ToluaBase::dbcall(lua_state, 2, 0); } else { - return ( bool ) cPlayer:: IsA(a_ClassName); + return ( void ) cPlayer:: KilledBy(a_Killer); }; }; - const char* GetClass( void )const { - if (push_method("GetClass", tolua_AllToLua_cEntity_GetClass00)) { - ToluaBase::dbcall(lua_state, 1, 1); - const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; + void TeleportToEntity( cEntity& a_Entity) { + if (push_method("TeleportToEntity", tolua_AllToLua_cEntity_TeleportToEntity00)) { + tolua_pushusertype(lua_state, (void*)&a_Entity, "cEntity"); + ToluaBase::dbcall(lua_state, 2, 0); } else { - return ( const char* ) cPlayer:: GetClass(); + return ( void ) cPlayer:: TeleportToEntity(a_Entity); }; }; - const char* GetParentClass( void )const { - if (push_method("GetParentClass", tolua_AllToLua_cEntity_GetParentClass00)) { - ToluaBase::dbcall(lua_state, 1, 1); - const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0); - lua_pop(lua_state, 1); - return tolua_ret; + void TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) { + if (push_method("TeleportToCoords", tolua_AllToLua_cEntity_TeleportToCoords00)) { + tolua_pushnumber(lua_state, (lua_Number)a_PosX); + tolua_pushnumber(lua_state, (lua_Number)a_PosY); + tolua_pushnumber(lua_state, (lua_Number)a_PosZ); + ToluaBase::dbcall(lua_state, 4, 0); } else { - return ( const char* ) cPlayer:: GetParentClass(); + return ( void ) cPlayer:: TeleportToCoords(a_PosX,a_PosY,a_PosZ); }; }; bool IsOnFire( void )const { @@ -9568,25 +9468,22 @@ public: void cPlayer__MoveTo( const Vector3d& a_NewPos) { return ( void )cPlayer::MoveTo(a_NewPos); }; - void cPlayer__TeleportToEntity( cEntity& a_Entity) { - return ( void )cPlayer::TeleportToEntity(a_Entity); - }; - void cPlayer__TeleportTo( double a_PosX, double a_PosY, double a_PosZ) { - return ( void )cPlayer::TeleportTo(a_PosX,a_PosY,a_PosZ); + bool cPlayer__IsA( const char* a_ClassName) { + return ( bool )cPlayer::IsA(a_ClassName); }; - void cPlayer__DoTakeDamage( TakeDamageInfo& a_TDI) { - return ( void )cPlayer::DoTakeDamage(a_TDI); + const char* cPlayer__GetClass( void ) { + return ( const char* )cPlayer::GetClass(); }; - void cPlayer__KilledBy( cPawn* a_Killer) { - return ( void )cPlayer::KilledBy(a_Killer); + const char* cPlayer__GetParentClass( void ) { + return ( const char* )cPlayer::GetParentClass(); }; - int cPlayer__GetRawDamageAgainst( const cPawn& a_Receiver) { + int cPlayer__GetRawDamageAgainst( const cEntity& a_Receiver) { return ( int )cPlayer::GetRawDamageAgainst(a_Receiver); }; - int cPlayer__GetArmorCoverAgainst( const cPawn* a_Attacker, eDamageType a_DamageType, int a_RawDamage) { + int cPlayer__GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) { return ( int )cPlayer::GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); }; - double cPlayer__GetKnockbackAmountAgainst( const cPawn& a_Receiver) { + double cPlayer__GetKnockbackAmountAgainst( const cEntity& a_Receiver) { return ( double )cPlayer::GetKnockbackAmountAgainst(a_Receiver); }; cItem cPlayer__GetEquippedWeapon( void ) { @@ -9604,14 +9501,14 @@ public: cItem cPlayer__GetEquippedBoots( void ) { return ( cItem )cPlayer::GetEquippedBoots(); }; - bool cPlayer__IsA( const char* a_ClassName) { - return ( bool )cPlayer::IsA(a_ClassName); + void cPlayer__KilledBy( cEntity* a_Killer) { + return ( void )cPlayer::KilledBy(a_Killer); }; - const char* cPlayer__GetClass( void ) { - return ( const char* )cPlayer::GetClass(); + void cPlayer__TeleportToEntity( cEntity& a_Entity) { + return ( void )cPlayer::TeleportToEntity(a_Entity); }; - const char* cPlayer__GetParentClass( void ) { - return ( const char* )cPlayer::GetParentClass(); + void cPlayer__TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) { + return ( void )cPlayer::TeleportToCoords(a_PosX,a_PosY,a_PosZ); }; bool cPlayer__IsOnFire( void ) { return ( bool )cPlayer::IsOnFire(); @@ -18111,6 +18008,117 @@ public: return ( const char* ) cPickup:: GetParentClass(); }; }; + int GetRawDamageAgainst( const cEntity& a_Receiver) { + if (push_method("GetRawDamageAgainst", tolua_AllToLua_cEntity_GetRawDamageAgainst00)) { + tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity"); + ToluaBase::dbcall(lua_state, 2, 1); + int tolua_ret = ( int )tolua_tonumber(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; + } else { + return ( int ) cPickup:: GetRawDamageAgainst(a_Receiver); + }; + }; + int GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) { + if (push_method("GetArmorCoverAgainst", tolua_AllToLua_cEntity_GetArmorCoverAgainst00)) { + tolua_pushusertype(lua_state, (void*)a_Attacker, "const cEntity"); + tolua_pushnumber(lua_state, (lua_Number)a_DamageType); + tolua_pushnumber(lua_state, (lua_Number)a_RawDamage); + ToluaBase::dbcall(lua_state, 4, 1); + int tolua_ret = ( int )tolua_tonumber(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; + } else { + return ( int ) cPickup:: GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); + }; + }; + double GetKnockbackAmountAgainst( const cEntity& a_Receiver) { + if (push_method("GetKnockbackAmountAgainst", tolua_AllToLua_cEntity_GetKnockbackAmountAgainst00)) { + tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity"); + ToluaBase::dbcall(lua_state, 2, 1); + double tolua_ret = ( double )tolua_tonumber(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; + } else { + return ( double ) cPickup:: GetKnockbackAmountAgainst(a_Receiver); + }; + }; + cItem GetEquippedWeapon( void )const { + if (push_method("GetEquippedWeapon", tolua_AllToLua_cEntity_GetEquippedWeapon00)) { + ToluaBase::dbcall(lua_state, 1, 1); + cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; + } else { + return ( cItem ) cPickup:: GetEquippedWeapon(); + }; + }; + cItem GetEquippedHelmet( void )const { + if (push_method("GetEquippedHelmet", tolua_AllToLua_cEntity_GetEquippedHelmet00)) { + ToluaBase::dbcall(lua_state, 1, 1); + cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; + } else { + return ( cItem ) cPickup:: GetEquippedHelmet(); + }; + }; + cItem GetEquippedChestplate( void )const { + if (push_method("GetEquippedChestplate", tolua_AllToLua_cEntity_GetEquippedChestplate00)) { + ToluaBase::dbcall(lua_state, 1, 1); + cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; + } else { + return ( cItem ) cPickup:: GetEquippedChestplate(); + }; + }; + cItem GetEquippedLeggings( void )const { + if (push_method("GetEquippedLeggings", tolua_AllToLua_cEntity_GetEquippedLeggings00)) { + ToluaBase::dbcall(lua_state, 1, 1); + cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; + } else { + return ( cItem ) cPickup:: GetEquippedLeggings(); + }; + }; + cItem GetEquippedBoots( void )const { + if (push_method("GetEquippedBoots", tolua_AllToLua_cEntity_GetEquippedBoots00)) { + ToluaBase::dbcall(lua_state, 1, 1); + cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0); + lua_pop(lua_state, 1); + return tolua_ret; + } else { + return ( cItem ) cPickup:: GetEquippedBoots(); + }; + }; + void KilledBy( cEntity* a_Killer) { + if (push_method("KilledBy", tolua_AllToLua_cEntity_KilledBy00)) { + tolua_pushusertype(lua_state, (void*)a_Killer, "cEntity"); + ToluaBase::dbcall(lua_state, 2, 0); + } else { + return ( void ) cPickup:: KilledBy(a_Killer); + }; + }; + void TeleportToEntity( cEntity& a_Entity) { + if (push_method("TeleportToEntity", tolua_AllToLua_cEntity_TeleportToEntity00)) { + tolua_pushusertype(lua_state, (void*)&a_Entity, "cEntity"); + ToluaBase::dbcall(lua_state, 2, 0); + } else { + return ( void ) cPickup:: TeleportToEntity(a_Entity); + }; + }; + void TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) { + if (push_method("TeleportToCoords", tolua_AllToLua_cEntity_TeleportToCoords00)) { + tolua_pushnumber(lua_state, (lua_Number)a_PosX); + tolua_pushnumber(lua_state, (lua_Number)a_PosY); + tolua_pushnumber(lua_state, (lua_Number)a_PosZ); + ToluaBase::dbcall(lua_state, 4, 0); + } else { + return ( void ) cPickup:: TeleportToCoords(a_PosX,a_PosY,a_PosZ); + }; + }; bool IsOnFire( void )const { if (push_method("IsOnFire", tolua_AllToLua_cEntity_IsOnFire00)) { ToluaBase::dbcall(lua_state, 1, 1); @@ -18174,6 +18182,39 @@ public: const char* cPickup__GetParentClass( void ) { return ( const char* )cPickup::GetParentClass(); }; + int cPickup__GetRawDamageAgainst( const cEntity& a_Receiver) { + return ( int )cPickup::GetRawDamageAgainst(a_Receiver); + }; + int cPickup__GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) { + return ( int )cPickup::GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage); + }; + double cPickup__GetKnockbackAmountAgainst( const cEntity& a_Receiver) { + return ( double )cPickup::GetKnockbackAmountAgainst(a_Receiver); + }; + cItem cPickup__GetEquippedWeapon( void ) { + return ( cItem )cPickup::GetEquippedWeapon(); + }; + cItem cPickup__GetEquippedHelmet( void ) { + return ( cItem )cPickup::GetEquippedHelmet(); + }; + cItem cPickup__GetEquippedChestplate( void ) { + return ( cItem )cPickup::GetEquippedChestplate(); + }; + cItem cPickup__GetEquippedLeggings( void ) { + return ( cItem )cPickup::GetEquippedLeggings(); + }; + cItem cPickup__GetEquippedBoots( void ) { + return ( cItem )cPickup::GetEquippedBoots(); + }; + void cPickup__KilledBy( cEntity* a_Killer) { + return ( void )cPickup::KilledBy(a_Killer); + }; + void cPickup__TeleportToEntity( cEntity& a_Entity) { + return ( void )cPickup::TeleportToEntity(a_Entity); + }; + void cPickup__TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) { + return ( void )cPickup::TeleportToCoords(a_PosX,a_PosY,a_PosZ); + }; bool cPickup__IsOnFire( void ) { return ( bool )cPickup::IsOnFire(); }; @@ -27875,6 +27916,45 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_function(tolua_S,"GetViewDistance",tolua_AllToLua_cClientHandle_GetViewDistance00); tolua_function(tolua_S,"GetUniqueID",tolua_AllToLua_cClientHandle_GetUniqueID00); tolua_endmodule(tolua_S); + tolua_constant(tolua_S,"dtAttack",dtAttack); + tolua_constant(tolua_S,"dtLightning",dtLightning); + tolua_constant(tolua_S,"dtFalling",dtFalling); + tolua_constant(tolua_S,"dtDrowning",dtDrowning); + tolua_constant(tolua_S,"dtSuffocating",dtSuffocating); + tolua_constant(tolua_S,"dtStarving",dtStarving); + tolua_constant(tolua_S,"dtCactusContact",dtCactusContact); + tolua_constant(tolua_S,"dtLavaContact",dtLavaContact); + tolua_constant(tolua_S,"dtPoisoning",dtPoisoning); + tolua_constant(tolua_S,"dtOnFire",dtOnFire); + tolua_constant(tolua_S,"dtFireContact",dtFireContact); + tolua_constant(tolua_S,"dtInVoid",dtInVoid); + tolua_constant(tolua_S,"dtPotionOfHarming",dtPotionOfHarming); + tolua_constant(tolua_S,"dtAdmin",dtAdmin); + tolua_constant(tolua_S,"dtPawnAttack",dtPawnAttack); + tolua_constant(tolua_S,"dtEntityAttack",dtEntityAttack); + tolua_constant(tolua_S,"dtMob",dtMob); + tolua_constant(tolua_S,"dtMobAttack",dtMobAttack); + tolua_constant(tolua_S,"dtFall",dtFall); + tolua_constant(tolua_S,"dtDrown",dtDrown); + tolua_constant(tolua_S,"dtSuffocation",dtSuffocation); + tolua_constant(tolua_S,"dtStarvation",dtStarvation); + tolua_constant(tolua_S,"dtHunger",dtHunger); + tolua_constant(tolua_S,"dtCactus",dtCactus); + tolua_constant(tolua_S,"dtCactuses",dtCactuses); + tolua_constant(tolua_S,"dtCacti",dtCacti); + tolua_constant(tolua_S,"dtLava",dtLava); + tolua_constant(tolua_S,"dtPoison",dtPoison); + tolua_constant(tolua_S,"dtBurning",dtBurning); + tolua_constant(tolua_S,"dtInFire",dtInFire); + tolua_constant(tolua_S,"dtPlugin",dtPlugin); + tolua_cclass(tolua_S,"TakeDamageInfo","TakeDamageInfo","",NULL); + tolua_beginmodule(tolua_S,"TakeDamageInfo"); + tolua_variable(tolua_S,"DamageType",tolua_get_TakeDamageInfo_DamageType,tolua_set_TakeDamageInfo_DamageType); + tolua_variable(tolua_S,"Attacker",tolua_get_TakeDamageInfo_Attacker_ptr,tolua_set_TakeDamageInfo_Attacker_ptr); + tolua_variable(tolua_S,"RawDamage",tolua_get_TakeDamageInfo_RawDamage,tolua_set_TakeDamageInfo_RawDamage); + tolua_variable(tolua_S,"FinalDamage",tolua_get_TakeDamageInfo_FinalDamage,tolua_set_TakeDamageInfo_FinalDamage); + tolua_variable(tolua_S,"Knockback",tolua_get_TakeDamageInfo_Knockback,tolua_set_TakeDamageInfo_Knockback); + tolua_endmodule(tolua_S); tolua_cclass(tolua_S,"cEntity","cEntity","",NULL); tolua_beginmodule(tolua_S,"cEntity"); tolua_constant(tolua_S,"ENTITY_STATUS_HURT",cEntity::ENTITY_STATUS_HURT); @@ -27884,6 +27964,13 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_constant(tolua_S,"ENTITY_STATUS_WOLF_SHAKING",cEntity::ENTITY_STATUS_WOLF_SHAKING); tolua_constant(tolua_S,"ENTITY_STATUS_EATING_ACCEPTED",cEntity::ENTITY_STATUS_EATING_ACCEPTED); tolua_constant(tolua_S,"ENTITY_STATUS_SHEEP_EATING",cEntity::ENTITY_STATUS_SHEEP_EATING); + tolua_constant(tolua_S,"FIRE_TICKS_PER_DAMAGE",cEntity::FIRE_TICKS_PER_DAMAGE); + tolua_constant(tolua_S,"FIRE_DAMAGE",cEntity::FIRE_DAMAGE); + tolua_constant(tolua_S,"LAVA_TICKS_PER_DAMAGE",cEntity::LAVA_TICKS_PER_DAMAGE); + tolua_constant(tolua_S,"LAVA_DAMAGE",cEntity::LAVA_DAMAGE); + tolua_constant(tolua_S,"BURN_TICKS_PER_DAMAGE",cEntity::BURN_TICKS_PER_DAMAGE); + tolua_constant(tolua_S,"BURN_DAMAGE",cEntity::BURN_DAMAGE); + tolua_constant(tolua_S,"BURN_TICKS",cEntity::BURN_TICKS); tolua_constant(tolua_S,"etEntity",cEntity::etEntity); tolua_constant(tolua_S,"etPlayer",cEntity::etPlayer); tolua_constant(tolua_S,"etPickup",cEntity::etPickup); @@ -27957,6 +28044,26 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_function(tolua_S,"GetUniqueID",tolua_AllToLua_cEntity_GetUniqueID00); tolua_function(tolua_S,"IsDestroyed",tolua_AllToLua_cEntity_IsDestroyed00); tolua_function(tolua_S,"Destroy",tolua_AllToLua_cEntity_Destroy00); + tolua_function(tolua_S,"TakeDamage",tolua_AllToLua_cEntity_TakeDamage00); + tolua_function(tolua_S,"TakeDamage",tolua_AllToLua_cEntity_TakeDamage01); + tolua_function(tolua_S,"TakeDamage",tolua_AllToLua_cEntity_TakeDamage02); + tolua_function(tolua_S,"GetRawDamageAgainst",tolua_AllToLua_cEntity_GetRawDamageAgainst00); + tolua_function(tolua_S,"GetArmorCoverAgainst",tolua_AllToLua_cEntity_GetArmorCoverAgainst00); + tolua_function(tolua_S,"GetKnockbackAmountAgainst",tolua_AllToLua_cEntity_GetKnockbackAmountAgainst00); + tolua_function(tolua_S,"GetEquippedWeapon",tolua_AllToLua_cEntity_GetEquippedWeapon00); + tolua_function(tolua_S,"GetEquippedHelmet",tolua_AllToLua_cEntity_GetEquippedHelmet00); + tolua_function(tolua_S,"GetEquippedChestplate",tolua_AllToLua_cEntity_GetEquippedChestplate00); + tolua_function(tolua_S,"GetEquippedLeggings",tolua_AllToLua_cEntity_GetEquippedLeggings00); + tolua_function(tolua_S,"GetEquippedBoots",tolua_AllToLua_cEntity_GetEquippedBoots00); + tolua_function(tolua_S,"KilledBy",tolua_AllToLua_cEntity_KilledBy00); + tolua_function(tolua_S,"Heal",tolua_AllToLua_cEntity_Heal00); + tolua_function(tolua_S,"GetHealth",tolua_AllToLua_cEntity_GetHealth00); + tolua_function(tolua_S,"SetMaxHealth",tolua_AllToLua_cEntity_SetMaxHealth00); + tolua_function(tolua_S,"GetMaxHealth",tolua_AllToLua_cEntity_GetMaxHealth00); + tolua_function(tolua_S,"StartBurning",tolua_AllToLua_cEntity_StartBurning00); + tolua_function(tolua_S,"StopBurning",tolua_AllToLua_cEntity_StopBurning00); + tolua_function(tolua_S,"TeleportToEntity",tolua_AllToLua_cEntity_TeleportToEntity00); + tolua_function(tolua_S,"TeleportToCoords",tolua_AllToLua_cEntity_TeleportToCoords00); tolua_function(tolua_S,"IsOnFire",tolua_AllToLua_cEntity_IsOnFire00); tolua_function(tolua_S,"IsCrouched",tolua_AllToLua_cEntity_IsCrouched00); tolua_function(tolua_S,"IsRiding",tolua_AllToLua_cEntity_IsRiding00); @@ -27969,86 +28076,25 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_function(tolua_S,"cEntity__IsA",tolua_AllToLua_Lua__cEntity_cEntity__IsA00); tolua_function(tolua_S,"cEntity__GetClass",tolua_AllToLua_Lua__cEntity_cEntity__GetClass00); tolua_function(tolua_S,"cEntity__GetParentClass",tolua_AllToLua_Lua__cEntity_cEntity__GetParentClass00); + tolua_function(tolua_S,"cEntity__GetRawDamageAgainst",tolua_AllToLua_Lua__cEntity_cEntity__GetRawDamageAgainst00); + tolua_function(tolua_S,"cEntity__GetArmorCoverAgainst",tolua_AllToLua_Lua__cEntity_cEntity__GetArmorCoverAgainst00); + tolua_function(tolua_S,"cEntity__GetKnockbackAmountAgainst",tolua_AllToLua_Lua__cEntity_cEntity__GetKnockbackAmountAgainst00); + tolua_function(tolua_S,"cEntity__GetEquippedWeapon",tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedWeapon00); + tolua_function(tolua_S,"cEntity__GetEquippedHelmet",tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedHelmet00); + tolua_function(tolua_S,"cEntity__GetEquippedChestplate",tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedChestplate00); + tolua_function(tolua_S,"cEntity__GetEquippedLeggings",tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedLeggings00); + tolua_function(tolua_S,"cEntity__GetEquippedBoots",tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedBoots00); + tolua_function(tolua_S,"cEntity__KilledBy",tolua_AllToLua_Lua__cEntity_cEntity__KilledBy00); + tolua_function(tolua_S,"cEntity__TeleportToEntity",tolua_AllToLua_Lua__cEntity_cEntity__TeleportToEntity00); + tolua_function(tolua_S,"cEntity__TeleportToCoords",tolua_AllToLua_Lua__cEntity_cEntity__TeleportToCoords00); tolua_function(tolua_S,"cEntity__IsOnFire",tolua_AllToLua_Lua__cEntity_cEntity__IsOnFire00); tolua_function(tolua_S,"cEntity__IsCrouched",tolua_AllToLua_Lua__cEntity_cEntity__IsCrouched00); tolua_function(tolua_S,"cEntity__IsRiding",tolua_AllToLua_Lua__cEntity_cEntity__IsRiding00); tolua_function(tolua_S,"cEntity__IsSprinting",tolua_AllToLua_Lua__cEntity_cEntity__IsSprinting00); tolua_function(tolua_S,"cEntity__IsRclking",tolua_AllToLua_Lua__cEntity_cEntity__IsRclking00); tolua_endmodule(tolua_S); - tolua_constant(tolua_S,"dtAttack",dtAttack); - tolua_constant(tolua_S,"dtLightning",dtLightning); - tolua_constant(tolua_S,"dtFalling",dtFalling); - tolua_constant(tolua_S,"dtDrowning",dtDrowning); - tolua_constant(tolua_S,"dtSuffocating",dtSuffocating); - tolua_constant(tolua_S,"dtStarving",dtStarving); - tolua_constant(tolua_S,"dtCactusContact",dtCactusContact); - tolua_constant(tolua_S,"dtLavaContact",dtLavaContact); - tolua_constant(tolua_S,"dtPoisoning",dtPoisoning); - tolua_constant(tolua_S,"dtOnFire",dtOnFire); - tolua_constant(tolua_S,"dtFireContact",dtFireContact); - tolua_constant(tolua_S,"dtInVoid",dtInVoid); - tolua_constant(tolua_S,"dtPotionOfHarming",dtPotionOfHarming); - tolua_constant(tolua_S,"dtAdmin",dtAdmin); - tolua_constant(tolua_S,"dtPawnAttack",dtPawnAttack); - tolua_constant(tolua_S,"dtEntityAttack",dtEntityAttack); - tolua_constant(tolua_S,"dtMob",dtMob); - tolua_constant(tolua_S,"dtMobAttack",dtMobAttack); - tolua_constant(tolua_S,"dtFall",dtFall); - tolua_constant(tolua_S,"dtDrown",dtDrown); - tolua_constant(tolua_S,"dtSuffocation",dtSuffocation); - tolua_constant(tolua_S,"dtStarvation",dtStarvation); - tolua_constant(tolua_S,"dtHunger",dtHunger); - tolua_constant(tolua_S,"dtCactus",dtCactus); - tolua_constant(tolua_S,"dtCactuses",dtCactuses); - tolua_constant(tolua_S,"dtCacti",dtCacti); - tolua_constant(tolua_S,"dtLava",dtLava); - tolua_constant(tolua_S,"dtPoison",dtPoison); - tolua_constant(tolua_S,"dtBurning",dtBurning); - tolua_constant(tolua_S,"dtInFire",dtInFire); - tolua_constant(tolua_S,"dtPlugin",dtPlugin); - tolua_cclass(tolua_S,"TakeDamageInfo","TakeDamageInfo","",NULL); - tolua_beginmodule(tolua_S,"TakeDamageInfo"); - tolua_variable(tolua_S,"DamageType",tolua_get_TakeDamageInfo_DamageType,tolua_set_TakeDamageInfo_DamageType); - tolua_variable(tolua_S,"Attacker",tolua_get_TakeDamageInfo_Attacker_ptr,tolua_set_TakeDamageInfo_Attacker_ptr); - tolua_variable(tolua_S,"RawDamage",tolua_get_TakeDamageInfo_RawDamage,tolua_set_TakeDamageInfo_RawDamage); - tolua_variable(tolua_S,"FinalDamage",tolua_get_TakeDamageInfo_FinalDamage,tolua_set_TakeDamageInfo_FinalDamage); - tolua_variable(tolua_S,"Knockback",tolua_get_TakeDamageInfo_Knockback,tolua_set_TakeDamageInfo_Knockback); - tolua_endmodule(tolua_S); tolua_cclass(tolua_S,"cPawn","cPawn","cEntity",NULL); tolua_beginmodule(tolua_S,"cPawn"); - tolua_function(tolua_S,"TeleportToEntity",tolua_AllToLua_cPawn_TeleportToEntity00); - tolua_function(tolua_S,"TeleportTo",tolua_AllToLua_cPawn_TeleportTo00); - tolua_function(tolua_S,"Heal",tolua_AllToLua_cPawn_Heal00); - tolua_function(tolua_S,"GetHealth",tolua_AllToLua_cPawn_GetHealth00); - tolua_function(tolua_S,"TakeDamage",tolua_AllToLua_cPawn_TakeDamage00); - tolua_function(tolua_S,"TakeDamage",tolua_AllToLua_cPawn_TakeDamage01); - tolua_function(tolua_S,"TakeDamage",tolua_AllToLua_cPawn_TakeDamage02); - tolua_function(tolua_S,"DoTakeDamage",tolua_AllToLua_cPawn_DoTakeDamage00); - tolua_function(tolua_S,"KilledBy",tolua_AllToLua_cPawn_KilledBy00); - tolua_function(tolua_S,"GetRawDamageAgainst",tolua_AllToLua_cPawn_GetRawDamageAgainst00); - tolua_function(tolua_S,"GetArmorCoverAgainst",tolua_AllToLua_cPawn_GetArmorCoverAgainst00); - tolua_function(tolua_S,"GetKnockbackAmountAgainst",tolua_AllToLua_cPawn_GetKnockbackAmountAgainst00); - tolua_function(tolua_S,"GetEquippedWeapon",tolua_AllToLua_cPawn_GetEquippedWeapon00); - tolua_function(tolua_S,"GetEquippedHelmet",tolua_AllToLua_cPawn_GetEquippedHelmet00); - tolua_function(tolua_S,"GetEquippedChestplate",tolua_AllToLua_cPawn_GetEquippedChestplate00); - tolua_function(tolua_S,"GetEquippedLeggings",tolua_AllToLua_cPawn_GetEquippedLeggings00); - tolua_function(tolua_S,"GetEquippedBoots",tolua_AllToLua_cPawn_GetEquippedBoots00); - tolua_endmodule(tolua_S); - tolua_cclass(tolua_S,"Lua__cPawn","Lua__cPawn","cPawn",NULL); - tolua_beginmodule(tolua_S,"Lua__cPawn"); - tolua_function(tolua_S,"tolua__set_instance",tolua_AllToLua_Lua__cPawn_tolua__set_instance00); - tolua_function(tolua_S,"cPawn__TeleportToEntity",tolua_AllToLua_Lua__cPawn_cPawn__TeleportToEntity00); - tolua_function(tolua_S,"cPawn__TeleportTo",tolua_AllToLua_Lua__cPawn_cPawn__TeleportTo00); - tolua_function(tolua_S,"cPawn__DoTakeDamage",tolua_AllToLua_Lua__cPawn_cPawn__DoTakeDamage00); - tolua_function(tolua_S,"cPawn__KilledBy",tolua_AllToLua_Lua__cPawn_cPawn__KilledBy00); - tolua_function(tolua_S,"cPawn__GetRawDamageAgainst",tolua_AllToLua_Lua__cPawn_cPawn__GetRawDamageAgainst00); - tolua_function(tolua_S,"cPawn__GetArmorCoverAgainst",tolua_AllToLua_Lua__cPawn_cPawn__GetArmorCoverAgainst00); - tolua_function(tolua_S,"cPawn__GetKnockbackAmountAgainst",tolua_AllToLua_Lua__cPawn_cPawn__GetKnockbackAmountAgainst00); - tolua_function(tolua_S,"cPawn__GetEquippedWeapon",tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedWeapon00); - tolua_function(tolua_S,"cPawn__GetEquippedHelmet",tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedHelmet00); - tolua_function(tolua_S,"cPawn__GetEquippedChestplate",tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedChestplate00); - tolua_function(tolua_S,"cPawn__GetEquippedLeggings",tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedLeggings00); - tolua_function(tolua_S,"cPawn__GetEquippedBoots",tolua_AllToLua_Lua__cPawn_cPawn__GetEquippedBoots00); tolua_endmodule(tolua_S); tolua_cclass(tolua_S,"cPlayer","cPlayer","cPawn",NULL); tolua_beginmodule(tolua_S,"cPlayer"); diff --git a/source/Bindings.h b/source/Bindings.h index c13cf32bd..f1ebbac51 100644 --- a/source/Bindings.h +++ b/source/Bindings.h @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 06/29/13 17:21:36. +** Generated automatically by tolua++-1.0.92 on 07/01/13 09:49:29. */ /* Exported function */ diff --git a/source/ChunkMap.cpp b/source/ChunkMap.cpp index b1471dc6c..4c181cce5 100644 --- a/source/ChunkMap.cpp +++ b/source/ChunkMap.cpp @@ -510,16 +510,16 @@ void cChunkMap::BroadcastEntityStatus(const cEntity & a_Entity, char a_Status, c -void cChunkMap::BroadcastMetadata(const cPawn & a_Pawn, const cClientHandle * a_Exclude) +void cChunkMap::BroadcastMetadata(const cEntity & a_Entity, const cClientHandle * a_Exclude) { cCSLock Lock(m_CSLayers); - cChunkPtr Chunk = GetChunkNoGen(a_Pawn.GetChunkX(), ZERO_CHUNK_Y, a_Pawn.GetChunkZ()); + cChunkPtr Chunk = GetChunkNoGen(a_Entity.GetChunkX(), ZERO_CHUNK_Y, a_Entity.GetChunkZ()); if (Chunk == NULL) { return; } // It's perfectly legal to broadcast packets even to invalid chunks! - Chunk->BroadcastMetadata(a_Pawn, a_Exclude); + Chunk->BroadcastMetadata(a_Entity, a_Exclude); } diff --git a/source/ChunkMap.h b/source/ChunkMap.h index 1e232deb0..de902ba47 100644 --- a/source/ChunkMap.h +++ b/source/ChunkMap.h @@ -79,7 +79,7 @@ public: void BroadcastEntityStatus(const cEntity & a_Entity, char a_Status, const cClientHandle * a_Exclude = NULL); - void BroadcastMetadata(const cPawn & a_Pawn, const cClientHandle * a_Exclude = NULL); + void BroadcastMetadata(const cEntity & a_Entity, const cClientHandle * a_Exclude = NULL); void BroadcastSpawn(cEntity & a_Entity, const cClientHandle * a_Exclude = NULL); diff --git a/source/Entity.cpp b/source/Entity.cpp index bc68ec3b2..bb65f4358 100644 --- a/source/Entity.cpp +++ b/source/Entity.cpp @@ -12,6 +12,7 @@ #include "Tracer.h" #include "Chunk.h" #include "Simulator/FluidSimulator.h" +#include "PluginManager.h" @@ -24,8 +25,10 @@ cCriticalSection cEntity::m_CSCount; -cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z) +cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, double a_Width, double a_Height) : m_UniqueID(0) + , m_Health(1) + , m_MaxHealth(1) , m_AttachedTo(NULL) , m_Attachee(NULL) , m_Referencers(new cReferenceManager(cReferenceManager::RFMNGR_REFERENCERS)) @@ -49,9 +52,13 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z) , m_TimeLastSpeedPacket(0) , m_EntityType(a_EntityType) , m_World(NULL) - , m_FireDamageInterval(0.f) - , m_BurnPeriod(0.f) - , m_WaterSpeed( 0.0 , 0.0 , 0.0 ) + , m_TicksSinceLastBurnDamage(0) + , m_TicksSinceLastLavaDamage(0) + , m_TicksSinceLastFireDamage(0) + , m_TicksLeftBurning(0) + , m_WaterSpeed(0, 0, 0) + , m_Width(a_Width) + , m_Height(a_Height) { cCSLock Lock(m_CSCount); m_EntityCount++; @@ -194,6 +201,236 @@ void cEntity::Destroy(bool a_ShouldBroadcast) +void cEntity::TakeDamage(cEntity & a_Attacker) +{ + int RawDamage = a_Attacker.GetRawDamageAgainst(*this); + + TakeDamage(dtAttack, &a_Attacker, RawDamage, a_Attacker.GetKnockbackAmountAgainst(*this)); +} + + + + + +void cEntity::TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_RawDamage, double a_KnockbackAmount) +{ + int FinalDamage = a_RawDamage - GetArmorCoverAgainst(a_Attacker, a_DamageType, a_RawDamage); + cEntity::TakeDamage(a_DamageType, a_Attacker, a_RawDamage, FinalDamage, a_KnockbackAmount); +} + + + + + +void cEntity::TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_RawDamage, int a_FinalDamage, double a_KnockbackAmount) +{ + TakeDamageInfo TDI; + TDI.DamageType = a_DamageType; + TDI.Attacker = a_Attacker; + TDI.RawDamage = a_RawDamage; + TDI.FinalDamage = a_FinalDamage; + Vector3d Heading; + Heading.x = sin(GetRotation()); + Heading.y = 0.4; // TODO: adjust the amount of "up" knockback when testing + Heading.z = cos(GetRotation()); + TDI.Knockback = Heading * a_KnockbackAmount; + DoTakeDamage(TDI); +} + + + + + +void cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) +{ + if (cRoot::Get()->GetPluginManager()->CallHookTakeDamage(*this, a_TDI)) + { + return; + } + + if (m_Health <= 0) + { + // Can't take damage if already dead + return; + } + + m_Health -= (short)a_TDI.FinalDamage; + + // TODO: Apply damage to armor + + if (m_Health < 0) + { + m_Health = 0; + } + + m_World->BroadcastEntityStatus(*this, ENTITY_STATUS_HURT); + + if (m_Health <= 0) + { + KilledBy(a_TDI.Attacker); + } +} + + + + + +int cEntity::GetRawDamageAgainst(const cEntity & a_Receiver) +{ + // Returns the hitpoints that this pawn can deal to a_Receiver using its equipped items + // Ref: http://www.minecraftwiki.net/wiki/Damage#Dealing_damage as of 2012_12_20 + switch (this->GetEquippedWeapon().m_ItemType) + { + case E_ITEM_WOODEN_SWORD: return 4; + case E_ITEM_GOLD_SWORD: return 4; + case E_ITEM_STONE_SWORD: return 5; + case E_ITEM_IRON_SWORD: return 6; + case E_ITEM_DIAMOND_SWORD: return 7; + + case E_ITEM_WOODEN_AXE: return 3; + case E_ITEM_GOLD_AXE: return 3; + case E_ITEM_STONE_AXE: return 4; + case E_ITEM_IRON_AXE: return 5; + case E_ITEM_DIAMOND_AXE: return 6; + + case E_ITEM_WOODEN_PICKAXE: return 2; + case E_ITEM_GOLD_PICKAXE: return 2; + case E_ITEM_STONE_PICKAXE: return 3; + case E_ITEM_IRON_PICKAXE: return 4; + case E_ITEM_DIAMOND_PICKAXE: return 5; + + case E_ITEM_WOODEN_SHOVEL: return 1; + case E_ITEM_GOLD_SHOVEL: return 1; + case E_ITEM_STONE_SHOVEL: return 2; + case E_ITEM_IRON_SHOVEL: return 3; + case E_ITEM_DIAMOND_SHOVEL: return 4; + } + // All other equipped items give a damage of 1: + return 1; +} + + + + + +int cEntity::GetArmorCoverAgainst(const cEntity * a_Attacker, eDamageType a_DamageType, int a_Damage) +{ + // Returns the hitpoints out of a_RawDamage that the currently equipped armor would cover + + // Filter out damage types that are not protected by armor: + // Ref.: http://www.minecraftwiki.net/wiki/Armor#Effects as of 2012_12_20 + switch (a_DamageType) + { + case dtOnFire: + case dtSuffocating: + case dtDrowning: // TODO: This one could be a special case - in various MC versions (PC vs XBox) it is and isn't armor-protected + case dtStarving: + case dtInVoid: + case dtPoisoning: + case dtPotionOfHarming: + case dtFalling: + case dtLightning: + { + return 0; + } + } + + // Add up all armor points: + // Ref.: http://www.minecraftwiki.net/wiki/Armor#Defense_points as of 2012_12_20 + int ArmorValue = 0; + switch (GetEquippedHelmet().m_ItemType) + { + case E_ITEM_LEATHER_CAP: ArmorValue += 1; break; + case E_ITEM_GOLD_HELMET: ArmorValue += 2; break; + case E_ITEM_CHAIN_HELMET: ArmorValue += 2; break; + case E_ITEM_IRON_HELMET: ArmorValue += 2; break; + case E_ITEM_DIAMOND_HELMET: ArmorValue += 3; break; + } + switch (GetEquippedChestplate().m_ItemType) + { + case E_ITEM_LEATHER_TUNIC: ArmorValue += 3; break; + case E_ITEM_GOLD_CHESTPLATE: ArmorValue += 5; break; + case E_ITEM_CHAIN_CHESTPLATE: ArmorValue += 5; break; + case E_ITEM_IRON_CHESTPLATE: ArmorValue += 6; break; + case E_ITEM_DIAMOND_CHESTPLATE: ArmorValue += 8; break; + } + switch (GetEquippedLeggings().m_ItemType) + { + case E_ITEM_LEATHER_PANTS: ArmorValue += 2; break; + case E_ITEM_GOLD_LEGGINGS: ArmorValue += 3; break; + case E_ITEM_CHAIN_LEGGINGS: ArmorValue += 4; break; + case E_ITEM_IRON_LEGGINGS: ArmorValue += 5; break; + case E_ITEM_DIAMOND_LEGGINGS: ArmorValue += 6; break; + } + switch (GetEquippedBoots().m_ItemType) + { + case E_ITEM_LEATHER_BOOTS: ArmorValue += 1; break; + case E_ITEM_GOLD_BOOTS: ArmorValue += 1; break; + case E_ITEM_CHAIN_BOOTS: ArmorValue += 1; break; + case E_ITEM_IRON_BOOTS: ArmorValue += 2; break; + case E_ITEM_DIAMOND_BOOTS: ArmorValue += 3; break; + } + + // TODO: Special armor cases, such as wool, saddles, dog's collar + // Ref.: http://www.minecraftwiki.net/wiki/Armor#Mob_armor as of 2012_12_20 + + // Now ArmorValue is in [0, 20] range, which corresponds to [0, 80%] protection. Calculate the hitpoints from that: + return a_Damage * (ArmorValue * 4) / 100; +} + + + + + +double cEntity::GetKnockbackAmountAgainst(const cEntity & a_Receiver) +{ + // Returns the knockback amount that the currently equipped items would cause to a_Receiver on a hit + + // TODO: Enchantments + return 1; +} + + + + + +void cEntity::KilledBy(cEntity * a_Killer) +{ + m_Health = 0; + + cRoot::Get()->GetPluginManager()->CallHookKilling(*this, a_Killer); + + if (m_Health > 0) + { + // Plugin wants to 'unkill' the pawn. Abort + return; + } + + // Drop loot: + cItems Drops; + GetDrops(Drops, a_Killer); + m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ()); + + m_World->BroadcastEntityStatus(*this, ENTITY_STATUS_DEAD); +} + + + + + +void cEntity::Heal(int a_HitPoints) +{ + m_Health += a_HitPoints; + if (m_Health > m_MaxHealth) + { + m_Health = m_MaxHealth; + } +} + + + + + void cEntity::Tick(float a_Dt, cChunk & a_Chunk) { if (m_AttachedTo != NULL) @@ -207,6 +444,7 @@ void cEntity::Tick(float a_Dt, cChunk & a_Chunk) { HandlePhysics(a_Dt, a_Chunk); } + TickBurning(a_Chunk); } @@ -391,6 +629,226 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk) +void cEntity::TickBurning(cChunk & a_Chunk) +{ + // Do the burning damage: + if (m_TicksLeftBurning > 0) + { + m_TicksSinceLastBurnDamage++; + if (m_TicksSinceLastBurnDamage >= BURN_TICKS_PER_DAMAGE) + { + TakeDamage(dtOnFire, NULL, BURN_DAMAGE, 0, 0); + m_TicksSinceLastFireDamage = 0; + } + m_TicksLeftBurning--; + if (m_TicksLeftBurning == 0) + { + OnFinishedBurning(); + } + } + + // Remember the current burning state: + bool HasBeenBurning = (m_TicksLeftBurning > 0); + + // Update the burning times, based on surroundings: + int MinRelX = (int)floor(GetPosX() - m_Width / 2) - a_Chunk.GetPosX() * cChunkDef::Width; + int MaxRelX = (int)floor(GetPosX() + m_Width / 2) - a_Chunk.GetPosX() * cChunkDef::Width; + int MinRelZ = (int)floor(GetPosZ() - m_Width / 2) - a_Chunk.GetPosZ() * cChunkDef::Width; + int MaxRelZ = (int)floor(GetPosZ() + m_Width / 2) - a_Chunk.GetPosZ() * cChunkDef::Width; + int MinY = std::max(0, std::min(cChunkDef::Height - 1, (int)floor(GetPosY()))); + int MaxY = std::max(0, std::min(cChunkDef::Height - 1, (int)ceil (GetPosY() + m_Height))); + bool HasWater = false; + bool HasLava = false; + bool HasFire = false; + + for (int x = MinRelX; x <= MaxRelX; x++) + { + for (int z = MinRelZ; z <= MaxRelZ; z++) + { + int RelX = x; + int RelZ = z; + cChunk * CurChunk = a_Chunk.GetRelNeighborChunkAdjustCoords(RelX, RelZ); + if (CurChunk == NULL) + { + continue; + } + for (int y = MinY; y <= MaxY; y++) + { + switch (CurChunk->GetBlock(RelX, y, RelZ)) + { + case E_BLOCK_FIRE: + { + HasFire = true; + break; + } + case E_BLOCK_LAVA: + case E_BLOCK_STATIONARY_LAVA: + { + HasLava = true; + break; + } + case E_BLOCK_STATIONARY_WATER: + case E_BLOCK_WATER: + { + HasWater = true; + break; + } + } // switch (BlockType) + } // for y + } // for z + } // for x + + if (HasWater) + { + // Extinguish the fire + m_TicksLeftBurning = 0; + } + + if (HasLava) + { + // Burn: + m_TicksLeftBurning = BURN_TICKS; + + // Periodically damage: + m_TicksSinceLastLavaDamage++; + if (m_TicksSinceLastLavaDamage >= 10) + { + TakeDamage(dtLavaContact, NULL, LAVA_DAMAGE, 0); + m_TicksSinceLastLavaDamage = 0; + } + } + else + { + m_TicksSinceLastLavaDamage = 0; + } + + if (HasFire) + { + // Burn: + m_TicksLeftBurning = BURN_TICKS; + + // Periodically damage: + m_TicksSinceLastFireDamage++; + if (m_TicksSinceLastFireDamage >= FIRE_TICKS_PER_DAMAGE) + { + TakeDamage(dtFireContact, NULL, FIRE_DAMAGE, 0); + } + } + else + { + m_TicksSinceLastFireDamage = 0; + } + + // If just started / finished burning, notify descendants: + if ((m_TicksLeftBurning > 0) && !HasBeenBurning) + { + OnStartedBurning(); + } + else if ((m_TicksLeftBurning <= 0) && HasBeenBurning) + { + OnFinishedBurning(); + } +} + + + + + +/// Called when the entity starts burning +void cEntity::OnStartedBurning(void) +{ + // Broadcast the change: + m_World->BroadcastMetadata(*this); +} + + + + + +/// Called when the entity finishes burning +void cEntity::OnFinishedBurning(void) +{ + // Broadcast the change: + m_World->BroadcastMetadata(*this); +} + + + + + +/// Sets the maximum value for the health +void cEntity::SetMaxHealth(int a_MaxHealth) +{ + m_MaxHealth = a_MaxHealth; + + // Reset health, if too high: + if (m_Health > a_MaxHealth) + { + m_Health = a_MaxHealth; + } +} + + + + + +/// Puts the entity on fire for the specified amount of ticks +void cEntity::StartBurning(int a_TicksLeftBurning) +{ + if (m_TicksLeftBurning > 0) + { + // Already burning, top up the ticks left burning and bail out: + m_TicksLeftBurning = std::max(m_TicksLeftBurning, a_TicksLeftBurning); + return; + } + + m_TicksLeftBurning = a_TicksLeftBurning; + OnStartedBurning(); +} + + + + + +/// Stops the entity from burning, resets all burning timers +void cEntity::StopBurning(void) +{ + bool HasBeenBurning = (m_TicksLeftBurning > 0); + m_TicksLeftBurning = 0; + m_TicksSinceLastBurnDamage = 0; + m_TicksSinceLastFireDamage = 0; + m_TicksSinceLastLavaDamage = 0; + + // Notify if the entity has stopped burning + if (HasBeenBurning) + { + OnFinishedBurning(); + } +} + + + + + +void cEntity::TeleportToEntity(cEntity & a_Entity) +{ + TeleportToCoords(a_Entity.GetPosX(), a_Entity.GetPosY(), a_Entity.GetPosZ()); +} + + + + + +void cEntity::TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) +{ + SetPosition(a_PosX, a_PosY, a_PosZ); + m_World->BroadcastTeleportEntity(*this); +} + + + + + void cEntity::BroadcastMovementUpdate(const cClientHandle * a_Exclude) { //We need to keep updating the clients when there is movement or if there was a change in speed and after 2 ticks diff --git a/source/Entity.h b/source/Entity.h index a756d064b..775b95253 100644 --- a/source/Entity.h +++ b/source/Entity.h @@ -1,9 +1,7 @@ #pragma once - - - +#include "Item.h" #include "Vector3d.h" #include "Vector3f.h" @@ -43,6 +41,65 @@ class cChunk; + +// tolua_begin +enum eDamageType +{ + // Canonical names for the types (as documented in the plugin wiki): + dtAttack, // Being attacked by a mob + dtLightning, // Hit by a lightning strike + dtFalling, // Falling down; dealt when hitting the ground + dtDrowning, // Drowning in water / lava + dtSuffocating, // Suffocating inside a block + dtStarving, // Hunger + dtCactusContact, // Contact with a cactus block + dtLavaContact, // Contact with a lava block + dtPoisoning, // Having the poison effect + dtOnFire, // Being on fire + dtFireContact, // Standing inside a fire block + dtInVoid, // Falling into the Void (Y < 0) + dtPotionOfHarming, + dtAdmin, // Damage applied by an admin command + + // Some common synonyms: + dtPawnAttack = dtAttack, + dtEntityAttack = dtAttack, + dtMob = dtAttack, + dtMobAttack = dtAttack, + dtFall = dtFalling, + dtDrown = dtDrowning, + dtSuffocation = dtSuffocating, + dtStarvation = dtStarving, + dtHunger = dtStarving, + dtCactus = dtCactusContact, + dtCactuses = dtCactusContact, + dtCacti = dtCactusContact, + dtLava = dtLavaContact, + dtPoison = dtPoisoning, + dtBurning = dtOnFire, + dtInFire = dtFireContact, + dtPlugin = dtAdmin, +} ; + + + + + +struct TakeDamageInfo +{ + eDamageType DamageType; // Where does the damage come from? Being hit / on fire / contact with cactus / ... + cEntity * Attacker; // The attacking entity; valid only for dtAttack + int RawDamage; // What damage would the receiver get without any armor. Usually: attacker mob type + weapons + int FinalDamage; // What actual damage will be received. Usually: m_RawDamage minus armor + Vector3d Knockback; // The amount and direction of knockback received from the damage + // TODO: Effects - list of effects that the hit is causing. Unknown representation yet +} ; +// tolua_end + + + + + // tolua_begin class cEntity { @@ -58,6 +115,17 @@ public: ENTITY_STATUS_SHEEP_EATING = 10, } ; + enum + { + FIRE_TICKS_PER_DAMAGE = 10, ///< How many ticks to wait between damaging an entity when it stands in fire + FIRE_DAMAGE = 1, ///< How much damage to deal when standing in fire + LAVA_TICKS_PER_DAMAGE = 10, ///< How many ticks to wait between damaging an entity when it stands in lava + LAVA_DAMAGE = 5, ///< How much damage to deal when standing in lava + BURN_TICKS_PER_DAMAGE = 20, ///< How many ticks to wait between damaging an entity when it is burning + BURN_DAMAGE = 1, ///< How much damage to deal when the entity is burning + BURN_TICKS = 200, ///< How long to keep an entity burning after it has stood in lava / fire + } ; + enum eEntityType { etEntity, // For all other types @@ -78,7 +146,7 @@ public: // tolua_end - cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z); + cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, double a_Width, double a_Height); virtual ~cEntity(); virtual void Initialize(cWorld * a_World); @@ -164,10 +232,85 @@ public: /// Schedules the entity for destroying; if a_ShouldBroadcast is set to true, broadcasts the DestroyEntity packet void Destroy(bool a_ShouldBroadcast = true); + /// Makes this pawn take damage from an attack by a_Attacker. Damage values are calculated automatically and DoTakeDamage() called + void TakeDamage(cEntity & a_Attacker); + + /// Makes this entity take the specified damage. The final damage is calculated using current armor, then DoTakeDamage() called + void TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_RawDamage, double a_KnockbackAmount); + + /// Makes this entity take the specified damage. The values are packed into a TDI, knockback calculated, then sent through DoTakeDamage() + void TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_RawDamage, int a_FinalDamage, double a_KnockbackAmount); + + // tolua_end + + /// Makes this entity take damage specified in the a_TDI. The TDI is sent through plugins first, then applied + virtual void DoTakeDamage(TakeDamageInfo & a_TDI); + + // tolua_begin + + /// Returns the hitpoints that this pawn can deal to a_Receiver using its equipped items + virtual int GetRawDamageAgainst(const cEntity & a_Receiver); + + /// Returns the hitpoints out of a_RawDamage that the currently equipped armor would cover + virtual int GetArmorCoverAgainst(const cEntity * a_Attacker, eDamageType a_DamageType, int a_RawDamage); + + /// Returns the knockback amount that the currently equipped items would cause to a_Receiver on a hit + virtual double GetKnockbackAmountAgainst(const cEntity & a_Receiver); + + /// Returns the curently equipped weapon; empty item if none + virtual cItem GetEquippedWeapon(void) const { return cItem(); } + + /// Returns the currently equipped helmet; empty item if nonte + virtual cItem GetEquippedHelmet(void) const { return cItem(); } + + /// Returns the currently equipped chestplate; empty item if nonte + virtual cItem GetEquippedChestplate(void) const { return cItem(); } + + /// Returns the currently equipped leggings; empty item if nonte + virtual cItem GetEquippedLeggings(void) const { return cItem(); } + + /// Returns the currently equipped boots; empty item if nonte + virtual cItem GetEquippedBoots(void) const { return cItem(); } + + /// Called when the health drops below zero. a_Killer may be NULL (environmental damage) + virtual void KilledBy(cEntity * a_Killer); + + /// Heals the specified amount of HPs + void Heal(int a_HitPoints); + + /// Returns the health of this pawn + int GetHealth(void) const { return m_Health; } + // tolua_end virtual void Tick(float a_Dt, cChunk & a_Chunk); + + /// Handles the physics of the entity - updates position based on speed, updates speed based on environment virtual void HandlePhysics(float a_Dt, cChunk & a_Chunk); + + /// Updates the state related to this entity being on fire + virtual void TickBurning(cChunk & a_Chunk); + + /// Called when the entity starts burning + virtual void OnStartedBurning(void); + + /// Called when the entity finishes burning + virtual void OnFinishedBurning(void); + + // tolua_begin + + /// Sets the maximum value for the health + void SetMaxHealth(int a_MaxHealth); + + int GetMaxHealth(void) const { return m_MaxHealth; } + + /// Puts the entity on fire for the specified amount of ticks + void StartBurning(int a_TicksLeftBurning); + + /// Stops the entity from burning, resets all burning timers + void StopBurning(void); + + // tolua_end /** Descendants override this function to send a command to the specified client to spawn the entity on the client. To spawn on all eligible clients, use cChunkMap::BroadcastSpawnEntity() @@ -175,6 +318,16 @@ public: */ virtual void SpawnOn(cClientHandle & a_Client) {ASSERT(!"SpawnOn() unimplemented!"); } + // tolua_begin + + /// Teleports to the entity specified + virtual void TeleportToEntity(cEntity & a_Entity); + + /// Teleports to the coordinates specified + virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ); + + // tolua_end + /// Updates clients of changes in the entity. virtual void BroadcastMovementUpdate(const cClientHandle * a_Exclude = NULL); @@ -196,7 +349,7 @@ public: // tolua_begin // Metadata flags; descendants may override the defaults: - virtual bool IsOnFire (void) const {return (m_BurnPeriod > 0); } + virtual bool IsOnFire (void) const {return (m_TicksLeftBurning > 0); } virtual bool IsCrouched (void) const {return false; } virtual bool IsRiding (void) const {return false; } virtual bool IsSprinting(void) const {return false; } @@ -207,12 +360,18 @@ public: /// Called when the specified player right-clicks this entity virtual void OnRightClicked(cPlayer & a_Player) {}; + /// Returns the list of drops for this pawn when it is killed. May check a_Killer for special handling (sword of looting etc.). Called from KilledBy(). + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) {} + protected: static cCriticalSection m_CSCount; static int m_EntityCount; int m_UniqueID; + int m_Health; + int m_MaxHealth; + /// The entity to which this entity is attached (vehicle), NULL if none cEntity * m_AttachedTo; @@ -243,8 +402,17 @@ protected: cWorld * m_World; - float m_FireDamageInterval; - float m_BurnPeriod; + /// Time, in ticks, since the last damage dealt by being on fire. Valid only if on fire (IsOnFire()) + int m_TicksSinceLastBurnDamage; + + /// Time, in ticks, since the last damage dealt by standing in lava. Reset to zero when moving out of lava. + int m_TicksSinceLastLavaDamage; + + /// Time, in ticks, since the last damage dealt by standing in fire. Reset to zero when moving out of fire. + int m_TicksSinceLastFireDamage; + + /// Time, in ticks, until the entity extinguishes its fire + int m_TicksLeftBurning; virtual void Destroyed(void) {} // Called after the entity has been destroyed @@ -254,22 +422,28 @@ protected: void AddReference( cEntity*& a_EntityPtr ); void ReferencedBy( cEntity*& a_EntityPtr ); void Dereference( cEntity*& a_EntityPtr ); + private: - //Measured in degrees (MAX 360°) + // Measured in degrees (MAX 360°) double m_HeadYaw; - //Measured in meter/second (m/s) + // Measured in meter/second (m/s) Vector3d m_Speed; - //Measured in degrees (MAX 360°) + // Measured in degrees (MAX 360°) Vector3d m_Rot; - //Measured in meters (1 meter = 1 block) (m) + + /// Position of the entity's XZ center and Y bottom Vector3d m_Pos; - //Measured in meter/second + + // Measured in meter / second Vector3d m_WaterSpeed; - //Measured in Kilograms (Kg) + + // Measured in Kilograms (Kg) double m_Mass; - //It's Width. + + /// Width of the entity, in the XZ plane. Since entities are represented as cylinders, this is more of a diameter. double m_Width; - //It's height + + /// Height of the entity (Y axis) double m_Height; } ; // tolua_export diff --git a/source/FallingBlock.cpp b/source/FallingBlock.cpp index 0da00e29f..8b57b5d57 100644 --- a/source/FallingBlock.cpp +++ b/source/FallingBlock.cpp @@ -11,7 +11,7 @@ cFallingBlock::cFallingBlock(const Vector3i & a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) :
- super(etFallingBlock, a_BlockPosition.x + 0.5f, a_BlockPosition.y + 0.5f, a_BlockPosition.z + 0.5f),
+ super(etFallingBlock, a_BlockPosition.x + 0.5f, a_BlockPosition.y + 0.5f, a_BlockPosition.z + 0.5f, 0.98, 0.98),
m_BlockType(a_BlockType),
m_BlockMeta(a_BlockMeta),
m_OriginalPosition(a_BlockPosition)
diff --git a/source/Minecart.cpp b/source/Minecart.cpp index c8d1946e5..869f93d74 100644 --- a/source/Minecart.cpp +++ b/source/Minecart.cpp @@ -14,7 +14,7 @@ cMinecart::cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z) :
- super(etMinecart, a_X, a_Y, a_Z),
+ super(etMinecart, a_X, a_Y, a_Z, 0.98, 0.7),
m_Payload(a_Payload)
{
}
diff --git a/source/Mobs/AggressiveMonster.cpp b/source/Mobs/AggressiveMonster.cpp index de73e6123..c6befa0ed 100644 --- a/source/Mobs/AggressiveMonster.cpp +++ b/source/Mobs/AggressiveMonster.cpp @@ -11,8 +11,8 @@ -cAggressiveMonster::cAggressiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath) : - super(a_ConfigName, a_ProtocolMobType, a_SoundHurt, a_SoundDeath), +cAggressiveMonster::cAggressiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height) : + super(a_ConfigName, a_ProtocolMobType, a_SoundHurt, a_SoundDeath, a_Width, a_Height), m_ChaseTime(999999) { m_EMPersonality = AGGRESSIVE; diff --git a/source/Mobs/AggressiveMonster.h b/source/Mobs/AggressiveMonster.h index ed21c6344..1eff1831e 100644 --- a/source/Mobs/AggressiveMonster.h +++ b/source/Mobs/AggressiveMonster.h @@ -13,7 +13,7 @@ class cAggressiveMonster : typedef cMonster super; public: - cAggressiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath); + cAggressiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height); virtual void Tick (float a_Dt, cChunk & a_Chunk) override; virtual void InStateChasing(float a_Dt) override; diff --git a/source/Mobs/Bat.h b/source/Mobs/Bat.h index 35c0f99a6..df6745fe5 100644 --- a/source/Mobs/Bat.h +++ b/source/Mobs/Bat.h @@ -14,7 +14,8 @@ class cBat : public:
cBat(void) :
- super("Bat", 65, "mob.bat.hurt", "mob.bat.death")
+ // TODO: The size is only a guesstimate, measure in vanilla and fix the size values here
+ super("Bat", 65, "mob.bat.hurt", "mob.bat.death", 0.7, 0.7)
{
}
diff --git a/source/Mobs/Blaze.cpp b/source/Mobs/Blaze.cpp index e6e2d7ec2..069ee8934 100644 --- a/source/Mobs/Blaze.cpp +++ b/source/Mobs/Blaze.cpp @@ -8,7 +8,8 @@ cBlaze::cBlaze(void) :
- super("Blaze", 61, "mob.blaze.hit", "mob.blaze.death")
+ // TODO: The size is only a guesstimate, measure in vanilla and fix the size values here
+ super("Blaze", 61, "mob.blaze.hit", "mob.blaze.death", 0.7, 1.8)
{
}
@@ -16,7 +17,7 @@ cBlaze::cBlaze(void) : -void cBlaze::GetDrops(cItems & a_Drops, cPawn * a_Killer)
+void cBlaze::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
AddRandomDropItem(a_Drops, 0, 1, E_ITEM_BLAZE_ROD);
}
diff --git a/source/Mobs/Blaze.h b/source/Mobs/Blaze.h index a897d7e8a..8b7a15848 100644 --- a/source/Mobs/Blaze.h +++ b/source/Mobs/Blaze.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cBlaze);
- virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override;
+ virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
} ;
diff --git a/source/Mobs/Cavespider.cpp b/source/Mobs/Cavespider.cpp index e4030af57..b547362ad 100644 --- a/source/Mobs/Cavespider.cpp +++ b/source/Mobs/Cavespider.cpp @@ -8,7 +8,8 @@ cCavespider::cCavespider(void) : - super("Cavespider", 59, "mob.spider.say", "mob.spider.death") + // TODO: The size is only a guesstimate, measure in vanilla and fix the size values here + super("Cavespider", 59, "mob.spider.say", "mob.spider.death", 0.9, 0.6) { } @@ -28,7 +29,7 @@ void cCavespider::Tick(float a_Dt, cChunk & a_Chunk) -void cCavespider::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cCavespider::GetDrops(cItems & a_Drops, cEntity * a_Killer) { AddRandomDropItem(a_Drops, 0, 2, E_ITEM_STRING); AddRandomDropItem(a_Drops, 0, 1, E_ITEM_SPIDER_EYE); diff --git a/source/Mobs/Cavespider.h b/source/Mobs/Cavespider.h index 00a4e16df..10ea03f7b 100644 --- a/source/Mobs/Cavespider.h +++ b/source/Mobs/Cavespider.h @@ -18,7 +18,7 @@ public: CLASS_PROTODEF(cCaveSpider); virtual void Tick(float a_Dt, cChunk & a_Chunk) override; - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Chicken.cpp b/source/Mobs/Chicken.cpp index e506bb7a8..3da9781d3 100644 --- a/source/Mobs/Chicken.cpp +++ b/source/Mobs/Chicken.cpp @@ -14,7 +14,7 @@ cChicken::cChicken(void) : - super("Chicken", 93, "mob.chicken.hurt", "mob.chicken.hurt") + super("Chicken", 93, "mob.chicken.hurt", "mob.chicken.hurt", 0.3, 0.4) { } @@ -22,10 +22,10 @@ cChicken::cChicken(void) : -void cChicken::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cChicken::GetDrops(cItems & a_Drops, cEntity * a_Killer) { AddRandomDropItem(a_Drops, 0, 2, E_ITEM_FEATHER); - a_Drops.push_back(cItem((GetMetaData() == BURNING) ? E_ITEM_COOKED_CHICKEN : E_ITEM_RAW_CHICKEN, 1)); + a_Drops.push_back(cItem(IsOnFire() ? E_ITEM_COOKED_CHICKEN : E_ITEM_RAW_CHICKEN, 1)); } diff --git a/source/Mobs/Chicken.h b/source/Mobs/Chicken.h index ed36df4d5..2f674e908 100644 --- a/source/Mobs/Chicken.h +++ b/source/Mobs/Chicken.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cChicken); - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Cow.cpp b/source/Mobs/Cow.cpp index 31a431af4..8e9b87d27 100644 --- a/source/Mobs/Cow.cpp +++ b/source/Mobs/Cow.cpp @@ -14,7 +14,7 @@ cCow::cCow(void) : - super("Cow", 92, "mob.cow.hurt", "mob.cow.hurt") + super("Cow", 92, "mob.cow.hurt", "mob.cow.hurt", 0.9, 1.3) { } @@ -22,10 +22,10 @@ cCow::cCow(void) : -void cCow::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cCow::GetDrops(cItems & a_Drops, cEntity * a_Killer) { AddRandomDropItem(a_Drops, 0, 2, E_ITEM_LEATHER); - AddRandomDropItem(a_Drops, 1, 3, (GetMetaData() == BURNING) ? E_ITEM_STEAK : E_ITEM_RAW_BEEF); + AddRandomDropItem(a_Drops, 1, 3, IsOnFire() ? E_ITEM_STEAK : E_ITEM_RAW_BEEF); } diff --git a/source/Mobs/Cow.h b/source/Mobs/Cow.h index d50c8df08..b90cb170e 100644 --- a/source/Mobs/Cow.h +++ b/source/Mobs/Cow.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cCow); - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Creeper.cpp b/source/Mobs/Creeper.cpp index 44b5e76cd..9b1b68b79 100644 --- a/source/Mobs/Creeper.cpp +++ b/source/Mobs/Creeper.cpp @@ -8,7 +8,7 @@ cCreeper::cCreeper(void) : - super("Creeper", 50, "mob.creeper.say", "mob.creeper.say") + super("Creeper", 50, "mob.creeper.say", "mob.creeper.say", 0.6, 1.8) { } @@ -16,7 +16,7 @@ cCreeper::cCreeper(void) : -void cCreeper::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cCreeper::GetDrops(cItems & a_Drops, cEntity * a_Killer) { AddRandomDropItem(a_Drops, 0, 2, E_ITEM_GUNPOWDER); diff --git a/source/Mobs/Creeper.h b/source/Mobs/Creeper.h index 721847cb5..c1d46f462 100644 --- a/source/Mobs/Creeper.h +++ b/source/Mobs/Creeper.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cCreeper); - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Enderman.cpp b/source/Mobs/Enderman.cpp index 356815be0..1dc47876f 100644 --- a/source/Mobs/Enderman.cpp +++ b/source/Mobs/Enderman.cpp @@ -8,7 +8,8 @@ cEnderman::cEnderman(void) : - super("Enderman", 58, "mob.endermen.hit", "mob.endermen.death") + // TODO: The size is only a guesstimate, measure in vanilla and fix the size values here + super("Enderman", 58, "mob.endermen.hit", "mob.endermen.death", 0.5, 2.5) { } @@ -16,7 +17,7 @@ cEnderman::cEnderman(void) : -void cEnderman::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cEnderman::GetDrops(cItems & a_Drops, cEntity * a_Killer) { AddRandomDropItem(a_Drops, 0, 1, E_ITEM_ENDER_PEARL); } diff --git a/source/Mobs/Enderman.h b/source/Mobs/Enderman.h index 44719ea5a..c4f4ee364 100644 --- a/source/Mobs/Enderman.h +++ b/source/Mobs/Enderman.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cEnderman); - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Ghast.cpp b/source/Mobs/Ghast.cpp index 1d0e074b8..288d0c28a 100644 --- a/source/Mobs/Ghast.cpp +++ b/source/Mobs/Ghast.cpp @@ -8,7 +8,7 @@ cGhast::cGhast(void) : - super("Ghast", 56, "mob.ghast.scream", "mob.ghast.death") + super("Ghast", 56, "mob.ghast.scream", "mob.ghast.death", 4, 4) { } @@ -16,7 +16,7 @@ cGhast::cGhast(void) : -void cGhast::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cGhast::GetDrops(cItems & a_Drops, cEntity * a_Killer) { AddRandomDropItem(a_Drops, 0, 2, E_ITEM_GUNPOWDER); AddRandomDropItem(a_Drops, 0, 1, E_ITEM_GHAST_TEAR); diff --git a/source/Mobs/Ghast.h b/source/Mobs/Ghast.h index b560d6907..f9b60dfcf 100644 --- a/source/Mobs/Ghast.h +++ b/source/Mobs/Ghast.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cGhast); - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Magmacube.cpp b/source/Mobs/Magmacube.cpp index fb9228c08..156a29607 100644 --- a/source/Mobs/Magmacube.cpp +++ b/source/Mobs/Magmacube.cpp @@ -7,8 +7,9 @@ -cMagmacube::cMagmacube(void) :
- super("Magmacube", 62, "mob.magmacube.big", "mob.magmacube.big")
+cMagmacube::cMagmacube(int a_Size) :
+ super("Magmacube", 62, "mob.magmacube.big", "mob.magmacube.big", 0.6 * a_Size, 0.6 * a_Size),
+ m_Size(a_Size)
{
}
@@ -16,7 +17,7 @@ cMagmacube::cMagmacube(void) : -void cMagmacube::GetDrops(cItems & a_Drops, cPawn * a_Killer)
+void cMagmacube::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
AddRandomDropItem(a_Drops, 0, 1, E_ITEM_MAGMA_CREAM);
}
diff --git a/source/Mobs/Magmacube.h b/source/Mobs/Magmacube.h index 863ba7072..da62b9615 100644 --- a/source/Mobs/Magmacube.h +++ b/source/Mobs/Magmacube.h @@ -13,11 +13,17 @@ class cMagmacube : typedef cAggressiveMonster super;
public:
- cMagmacube();
+ /// Creates a magmacube of the specified size; size is 1 .. 3, with 1 being the smallest
+ cMagmacube(int a_Size);
CLASS_PROTODEF(cMagmacube);
- virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override;
+ virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
+
+protected:
+
+ /// Size of the magmacube, 1 .. 3, with 1 being the smallest
+ int m_Size;
} ;
diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp index 0176175e9..706649cb2 100644 --- a/source/Mobs/Monster.cpp +++ b/source/Mobs/Monster.cpp @@ -22,8 +22,8 @@ -cMonster::cMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath) - : super(etMob) +cMonster::cMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height) + : super(etMob, a_Width, a_Height) , m_Target(NULL) , m_bMovingToDestination(false) , m_DestinationTime( 0 ) @@ -204,10 +204,13 @@ void cMonster::DoTakeDamage(TakeDamageInfo & a_TDI) -void cMonster::KilledBy(cPawn * a_Killer) +void cMonster::KilledBy(cEntity * a_Killer) { super::KilledBy(a_Killer); - if(m_SoundHurt != "") m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f); + if (m_SoundHurt != "") + { + m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f); + } m_DestroyTimer = 0; } diff --git a/source/Mobs/Monster.h b/source/Mobs/Monster.h index ec27df38a..ea7f935ea 100644 --- a/source/Mobs/Monster.h +++ b/source/Mobs/Monster.h @@ -31,7 +31,7 @@ public: * a_ProtocolMobType is the ID of the mob used in the protocol ( http://wiki.vg/Entities#Mobs , 2012_12_22) * a_SoundHurt and a_SoundDeath are assigned into m_SoundHurt and m_SoundDeath, respectively */ - cMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath); + cMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height); CLASS_PROTODEF(cMonster); @@ -41,7 +41,7 @@ public: virtual void DoTakeDamage(TakeDamageInfo & a_TDI) override; - virtual void KilledBy(cPawn * a_Killer) override; + virtual void KilledBy(cEntity * a_Killer) override; virtual void MoveToPosition(const Vector3f & a_Position); virtual bool ReachedDestination(void); diff --git a/source/Mobs/Mooshroom.cpp b/source/Mobs/Mooshroom.cpp index 1ef1d600d..c85ceda3a 100644 --- a/source/Mobs/Mooshroom.cpp +++ b/source/Mobs/Mooshroom.cpp @@ -14,7 +14,7 @@ cMooshroom::cMooshroom(void) :
- super("Mooshroom", 96, "mob.cow.hurt", "mob.cow.hurt")
+ super("Mooshroom", 96, "mob.cow.hurt", "mob.cow.hurt", 0.9, 1.3)
{
}
@@ -22,10 +22,10 @@ cMooshroom::cMooshroom(void) : -void cMooshroom::GetDrops(cItems & a_Drops, cPawn * a_Killer)
+void cMooshroom::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
AddRandomDropItem(a_Drops, 0, 2, E_ITEM_LEATHER);
- AddRandomDropItem(a_Drops, 1, 3, (GetMetaData() == BURNING) ? E_ITEM_STEAK : E_ITEM_RAW_BEEF);
+ AddRandomDropItem(a_Drops, 1, 3, IsOnFire() ? E_ITEM_STEAK : E_ITEM_RAW_BEEF);
}
diff --git a/source/Mobs/Mooshroom.h b/source/Mobs/Mooshroom.h index c50c04ed8..20fc293b9 100644 --- a/source/Mobs/Mooshroom.h +++ b/source/Mobs/Mooshroom.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cMooshroom);
- virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override;
+ virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
} ;
diff --git a/source/Mobs/Ocelot.h b/source/Mobs/Ocelot.h index 76ee6815e..4d22575f2 100644 --- a/source/Mobs/Ocelot.h +++ b/source/Mobs/Ocelot.h @@ -14,7 +14,8 @@ class cOcelot : public:
cOcelot(void) :
- super("Ocelot", 98, "mob.cat.hitt", "mob.cat.hitt")
+ // TODO: The size is only a guesstimate, measure in vanilla and fix the size values here
+ super("Ocelot", 98, "mob.cat.hitt", "mob.cat.hitt", 0.9, 0.5)
{
}
diff --git a/source/Mobs/PassiveAggressiveMonster.cpp b/source/Mobs/PassiveAggressiveMonster.cpp index 41258c788..f1e231a09 100644 --- a/source/Mobs/PassiveAggressiveMonster.cpp +++ b/source/Mobs/PassiveAggressiveMonster.cpp @@ -9,8 +9,8 @@ -cPassiveAggressiveMonster::cPassiveAggressiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath) : - super(a_ConfigName, a_ProtocolMobType, a_SoundHurt, a_SoundDeath) +cPassiveAggressiveMonster::cPassiveAggressiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height) : + super(a_ConfigName, a_ProtocolMobType, a_SoundHurt, a_SoundDeath, a_Width, a_Height) { m_EMPersonality = PASSIVE; } diff --git a/source/Mobs/PassiveAggressiveMonster.h b/source/Mobs/PassiveAggressiveMonster.h index abb6a7abd..243dfff38 100644 --- a/source/Mobs/PassiveAggressiveMonster.h +++ b/source/Mobs/PassiveAggressiveMonster.h @@ -13,7 +13,7 @@ class cPassiveAggressiveMonster : typedef cAggressiveMonster super; public: - cPassiveAggressiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath); + cPassiveAggressiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height); virtual void DoTakeDamage(TakeDamageInfo & a_TDI) override; } ; diff --git a/source/Mobs/PassiveMonster.cpp b/source/Mobs/PassiveMonster.cpp index 22bc17f6f..96cc1ba8f 100644 --- a/source/Mobs/PassiveMonster.cpp +++ b/source/Mobs/PassiveMonster.cpp @@ -8,8 +8,8 @@ -cPassiveMonster::cPassiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath) : - super(a_ConfigName, a_ProtocolMobType, a_SoundHurt, a_SoundDeath) +cPassiveMonster::cPassiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height) : + super(a_ConfigName, a_ProtocolMobType, a_SoundHurt, a_SoundDeath, a_Width, a_Height) { m_EMPersonality = PASSIVE; } diff --git a/source/Mobs/PassiveMonster.h b/source/Mobs/PassiveMonster.h index 8abbd8687..ae0bea3fb 100644 --- a/source/Mobs/PassiveMonster.h +++ b/source/Mobs/PassiveMonster.h @@ -13,7 +13,7 @@ class cPassiveMonster : typedef cMonster super; public: - cPassiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath); + cPassiveMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height); virtual void Tick(float a_Dt, cChunk & a_Chunk) override; diff --git a/source/Mobs/Pig.cpp b/source/Mobs/Pig.cpp index a71476e00..9df2c2571 100644 --- a/source/Mobs/Pig.cpp +++ b/source/Mobs/Pig.cpp @@ -8,7 +8,7 @@ cPig::cPig(void) : - super("Pig", 90, "mob.pig.say", "mob.pig.death") + super("Pig", 90, "mob.pig.say", "mob.pig.death", 0.9, 0.9) { } @@ -16,9 +16,9 @@ cPig::cPig(void) : -void cPig::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cPig::GetDrops(cItems & a_Drops, cEntity * a_Killer) { - AddRandomDropItem(a_Drops, 1, 3, (GetMetaData() == BURNING) ? E_ITEM_COOKED_PORKCHOP : E_ITEM_RAW_PORKCHOP); + AddRandomDropItem(a_Drops, 1, 3, IsOnFire() ? E_ITEM_COOKED_PORKCHOP : E_ITEM_RAW_PORKCHOP); } diff --git a/source/Mobs/Pig.h b/source/Mobs/Pig.h index 995f2a593..ae790ac2f 100644 --- a/source/Mobs/Pig.h +++ b/source/Mobs/Pig.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cPig); - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Sheep.cpp b/source/Mobs/Sheep.cpp index 174c8a9d3..2f371f384 100644 --- a/source/Mobs/Sheep.cpp +++ b/source/Mobs/Sheep.cpp @@ -9,7 +9,7 @@ cSheep::cSheep(void) : - super("Sheep", 91, "mob.sheep.say", "mob.sheep.say"), + super("Sheep", 91, "mob.sheep.say", "mob.sheep.say", 0.6, 1.3), m_IsSheared(false), m_WoolColor(E_META_WOOL_WHITE) { @@ -19,7 +19,7 @@ cSheep::cSheep(void) : -void cSheep::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer) { if (!m_IsSheared) { diff --git a/source/Mobs/Sheep.h b/source/Mobs/Sheep.h index 801cf97d7..369fc78c5 100644 --- a/source/Mobs/Sheep.h +++ b/source/Mobs/Sheep.h @@ -20,7 +20,7 @@ public: CLASS_PROTODEF(cSheep); - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Silverfish.h b/source/Mobs/Silverfish.h index 24a9cf38b..7d675a9c0 100644 --- a/source/Mobs/Silverfish.h +++ b/source/Mobs/Silverfish.h @@ -14,7 +14,8 @@ class cSilverfish : public: cSilverfish(void) : - super("Silverfish", 60, "mob.silverfish.hit", "mob.silverfish.kill") + // TODO: The size is only a guesstimate, measure in vanilla and fix the size values here + super("Silverfish", 60, "mob.silverfish.hit", "mob.silverfish.kill", 0.9, 0.3) { } diff --git a/source/Mobs/Skeleton.cpp b/source/Mobs/Skeleton.cpp index b2b0c325d..8dacbece8 100644 --- a/source/Mobs/Skeleton.cpp +++ b/source/Mobs/Skeleton.cpp @@ -8,7 +8,7 @@ cSkeleton::cSkeleton(void) : - super("Skeleton", 51, "mob.skeleton.hurt", "mob.skeleton.death") + super("Skeleton", 51, "mob.skeleton.hurt", "mob.skeleton.death", 0.6, 1.8) { } @@ -22,9 +22,10 @@ void cSkeleton::Tick(float a_Dt, cChunk & a_Chunk) // TODO Outsource // TODO should do SkyLight check, mobs in the dark don´t burn - if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && !IsBurning()) + if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && !IsOnFire()) { - SetMetaData(BURNING); // BURN, BABY, BURN! >:D + // Burn for 10 ticks, then decide again + StartBurning(10); } } @@ -32,7 +33,7 @@ void cSkeleton::Tick(float a_Dt, cChunk & a_Chunk) -void cSkeleton::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer) { AddRandomDropItem(a_Drops, 0, 2, E_ITEM_ARROW); AddRandomDropItem(a_Drops, 0, 2, E_ITEM_BONE); diff --git a/source/Mobs/Skeleton.h b/source/Mobs/Skeleton.h index e0b537cc8..bc541bac2 100644 --- a/source/Mobs/Skeleton.h +++ b/source/Mobs/Skeleton.h @@ -18,7 +18,7 @@ public: CLASS_PROTODEF(cSkeleton); virtual void Tick(float a_Dt, cChunk & a_Chunk) override; - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Slime.cpp b/source/Mobs/Slime.cpp index ee7093b73..b209ac869 100644 --- a/source/Mobs/Slime.cpp +++ b/source/Mobs/Slime.cpp @@ -9,8 +9,10 @@ -cSlime::cSlime(void) : - super("Slime", 55, "mob.slime.attack", "mob.slime.attack") +/// Creates a slime of the specified size; size is 1 .. 3, with 1 being the smallest +cSlime::cSlime(int a_Size) : + super("Slime", 55, "mob.slime.attack", "mob.slime.attack", 0.6 * a_Size, 0.6 * a_Size), + m_Size(a_Size) { } @@ -18,7 +20,7 @@ cSlime::cSlime(void) : -void cSlime::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cSlime::GetDrops(cItems & a_Drops, cEntity * a_Killer) { // TODO: only when tiny AddRandomDropItem(a_Drops, 0, 2, E_ITEM_SLIMEBALL); diff --git a/source/Mobs/Slime.h b/source/Mobs/Slime.h index 17bf0807a..88136ff32 100644 --- a/source/Mobs/Slime.h +++ b/source/Mobs/Slime.h @@ -13,11 +13,17 @@ class cSlime : typedef cAggressiveMonster super; public: - cSlime(void); + /// Creates a slime of the specified size; size is 1 .. 3, with 1 being the smallest + cSlime(int a_Size); CLASS_PROTODEF(cSlime); - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; + +protected: + + /// Size of the slime, 1 .. 3, with 1 being the smallest + int m_Size; } ; diff --git a/source/Mobs/Spider.cpp b/source/Mobs/Spider.cpp index 4e671e7ab..2f244cdbc 100644 --- a/source/Mobs/Spider.cpp +++ b/source/Mobs/Spider.cpp @@ -8,7 +8,7 @@ cSpider::cSpider(void) : - super("Spider", 52, "mob.spider.say", "mob.spider.death") + super("Spider", 52, "mob.spider.say", "mob.spider.death", 1.4, 0.9) { } @@ -16,7 +16,7 @@ cSpider::cSpider(void) : -void cSpider::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cSpider::GetDrops(cItems & a_Drops, cEntity * a_Killer) { AddRandomDropItem(a_Drops, 0, 2, E_ITEM_STRING); AddRandomDropItem(a_Drops, 0, 1, E_ITEM_SPIDER_EYE); diff --git a/source/Mobs/Spider.h b/source/Mobs/Spider.h index 17a954a02..51e65d028 100644 --- a/source/Mobs/Spider.h +++ b/source/Mobs/Spider.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cSpider); - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Squid.cpp b/source/Mobs/Squid.cpp index 78dd37393..09236f3c5 100644 --- a/source/Mobs/Squid.cpp +++ b/source/Mobs/Squid.cpp @@ -3,13 +3,14 @@ #include "Squid.h" #include "../Vector3d.h" +#include "../Chunk.h" cSquid::cSquid(void) : - super("Squid", 94, "", "") + super("Squid", 94, "", "", 0.95, 0.95) { } @@ -17,7 +18,7 @@ cSquid::cSquid(void) : -void cSquid::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cSquid::GetDrops(cItems & a_Drops, cEntity * a_Killer) { // Drops 0-3 Ink Sacs AddRandomDropItem(a_Drops, 0, 3, E_ITEM_DYE, E_META_DYE_BLACK); @@ -29,15 +30,17 @@ void cSquid::GetDrops(cItems & a_Drops, cPawn * a_Killer) void cSquid::Tick(float a_Dt, cChunk & a_Chunk) { - // TODO: Rewrite this function to use a_Chunk instead of m_World super::Tick(a_Dt, a_Chunk); Vector3d Pos = GetPosition(); // TODO: Not a real behavior, but cool :D - if (!IsBlockWater(GetWorld()->GetBlock((int) Pos.x, (int) Pos.y, (int) Pos.z)) && !IsBurning()) + int RelX = (int)floor(Pos.x + 0.5) - a_Chunk.GetPosX() * cChunkDef::Width; + int RelZ = (int)floor(Pos.z + 0.5) - a_Chunk.GetPosZ() * cChunkDef::Width; + if (!IsBlockWater(a_Chunk.GetBlock(RelX, (int)Pos.y, RelZ)) && !IsOnFire()) { - SetMetaData(BURNING); + // Burn for 10 ticks, then decide again + StartBurning(10); } } diff --git a/source/Mobs/Squid.h b/source/Mobs/Squid.h index de205f397..35d7295b3 100644 --- a/source/Mobs/Squid.h +++ b/source/Mobs/Squid.h @@ -19,7 +19,7 @@ public: CLASS_PROTODEF(cSquid); - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Villager.cpp b/source/Mobs/Villager.cpp index 1bc5fb86b..0ec2cf76c 100644 --- a/source/Mobs/Villager.cpp +++ b/source/Mobs/Villager.cpp @@ -8,7 +8,7 @@ cVillager::cVillager(void) :
- super("Villager", 120, "", "")
+ super("Villager", 120, "", "", 0.6, 1.8)
{
}
diff --git a/source/Mobs/Witch.cpp b/source/Mobs/Witch.cpp index ee77d066b..66295ed1b 100644 --- a/source/Mobs/Witch.cpp +++ b/source/Mobs/Witch.cpp @@ -8,7 +8,7 @@ cWitch::cWitch(void) :
- super("Witch", 66, "", "")
+ super("Witch", 66, "", "", 0.6, 1.8)
{
}
@@ -16,7 +16,7 @@ cWitch::cWitch(void) : -void cWitch::GetDrops(cItems & a_Drops, cPawn * a_Killer)
+void cWitch::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
AddRandomDropItem(a_Drops, 0, 6, E_ITEM_GLASS_BOTTLE);
AddRandomDropItem(a_Drops, 0, 6, E_ITEM_GLOWSTONE_DUST);
diff --git a/source/Mobs/Witch.h b/source/Mobs/Witch.h index 5b8c7ba4f..2ca2c081f 100644 --- a/source/Mobs/Witch.h +++ b/source/Mobs/Witch.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cWitch);
- virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override;
+ virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
} ;
diff --git a/source/Mobs/Wolf.h b/source/Mobs/Wolf.h index 7247f823c..405df80a6 100644 --- a/source/Mobs/Wolf.h +++ b/source/Mobs/Wolf.h @@ -14,7 +14,8 @@ class cWolf : public: cWolf(void) : - super("Wolf", 95, "mob.wolf.hurt", "mob.wolf.death") + // TODO: The size is only a guesstimate, measure in vanilla and fix the size values here (wiki.vg values are suspicious) + super("Wolf", 95, "mob.wolf.hurt", "mob.wolf.death", 0.9, 0.9) { } diff --git a/source/Mobs/Zombie.cpp b/source/Mobs/Zombie.cpp index cf0391b4c..d0a929519 100644 --- a/source/Mobs/Zombie.cpp +++ b/source/Mobs/Zombie.cpp @@ -8,7 +8,7 @@ cZombie::cZombie(void) : - super("Zombie", 54, "mob.zombie.hurt", "mob.zombie.death") + super("Zombie", 54, "mob.zombie.hurt", "mob.zombie.death", 0.6, 1.8) { } @@ -21,9 +21,10 @@ void cZombie::Tick(float a_Dt, cChunk & a_Chunk) super::Tick(a_Dt, a_Chunk); // TODO Same as in cSkeleton :D - if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && !IsBurning()) + if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && !IsOnFire()) { - SetMetaData(BURNING); // BURN, BABY, BURN! >:D + // Burn for 10 ticks, then decide again + StartBurning(10); } } @@ -31,7 +32,7 @@ void cZombie::Tick(float a_Dt, cChunk & a_Chunk) -void cZombie::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer) { AddRandomDropItem(a_Drops, 0, 2, E_ITEM_ROTTEN_FLESH); diff --git a/source/Mobs/Zombie.h b/source/Mobs/Zombie.h index 5813a900b..61f8e3bb8 100644 --- a/source/Mobs/Zombie.h +++ b/source/Mobs/Zombie.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cZombie); virtual void Tick(float a_Dt, cChunk & a_Chunk) override; - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/source/Mobs/Zombiepigman.cpp b/source/Mobs/Zombiepigman.cpp index 40fb0a593..6483e58c5 100644 --- a/source/Mobs/Zombiepigman.cpp +++ b/source/Mobs/Zombiepigman.cpp @@ -8,7 +8,7 @@ cZombiepigman::cZombiepigman(void) : - super("Zombiepigman", 57, "mob.zombiepig.zpighurt", "mob.zombiepig.zpigdeath") + super("Zombiepigman", 57, "mob.zombiepig.zpighurt", "mob.zombiepig.zpigdeath", 0.6, 1.8) { } @@ -21,9 +21,10 @@ void cZombiepigman::Tick(float a_Dt, cChunk & a_Chunk) super::Tick(a_Dt, a_Chunk); // TODO Same as noticed in cSkeleton AND Do they really burn by sun?? :D In the neather is no sun :D - if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && !IsBurning()) + if ((GetWorld()->GetTimeOfDay() < (12000 + 1000)) && !IsOnFire()) { - SetMetaData(BURNING); // BURN, BABY, BURN! >:D + // Burn for 10 ticks, then decide again + StartBurning(10); } } @@ -31,7 +32,7 @@ void cZombiepigman::Tick(float a_Dt, cChunk & a_Chunk) -void cZombiepigman::GetDrops(cItems & a_Drops, cPawn * a_Killer) +void cZombiepigman::GetDrops(cItems & a_Drops, cEntity * a_Killer) { AddRandomDropItem(a_Drops, 0, 1, E_ITEM_ROTTEN_FLESH); AddRandomDropItem(a_Drops, 0, 1, E_ITEM_GOLD_NUGGET); @@ -43,7 +44,7 @@ void cZombiepigman::GetDrops(cItems & a_Drops, cPawn * a_Killer) -void cZombiepigman::KilledBy(cPawn * a_Killer) +void cZombiepigman::KilledBy(cEntity * a_Killer) { super::KilledBy(a_Killer); diff --git a/source/Mobs/Zombiepigman.h b/source/Mobs/Zombiepigman.h index a8c2e429d..fe8c6d047 100644 --- a/source/Mobs/Zombiepigman.h +++ b/source/Mobs/Zombiepigman.h @@ -18,8 +18,8 @@ public: CLASS_PROTODEF(cZombiepigman); virtual void Tick(float a_Dt, cChunk & a_Chunk) override; - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL) override; - virtual void KilledBy(cPawn * a_Killer) override; + virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; + virtual void KilledBy(cEntity * a_Killer) override; } ; diff --git a/source/Pawn.cpp b/source/Pawn.cpp index b3cba7ab0..b58c2b544 100644 --- a/source/Pawn.cpp +++ b/source/Pawn.cpp @@ -15,12 +15,9 @@ -cPawn::cPawn(eEntityType a_EntityType) - : cEntity(a_EntityType, 0, 0, 0) - , m_Health(1) - , m_MaxHealth(1) +cPawn::cPawn(eEntityType a_EntityType, double a_Width, double a_Height) + : cEntity(a_EntityType, 0, 0, 0, a_Width, a_Height) , m_bBurnable(true) - , m_MetaData(NORMAL) { } @@ -28,374 +25,3 @@ cPawn::cPawn(eEntityType a_EntityType) -void cPawn::Heal(int a_HitPoints) -{ - m_Health += a_HitPoints; - if (m_Health > m_MaxHealth) - { - m_Health = m_MaxHealth; - } -} - - - - - -void cPawn::TakeDamage(cPawn & a_Attacker) -{ - int RawDamage = a_Attacker.GetRawDamageAgainst(*this); - - TakeDamage(dtAttack, &a_Attacker, RawDamage, a_Attacker.GetKnockbackAmountAgainst(*this)); -} - - - - - -void cPawn::TakeDamage(eDamageType a_DamageType, cPawn * a_Attacker, int a_RawDamage, double a_KnockbackAmount) -{ - int FinalDamage = a_RawDamage - GetArmorCoverAgainst(a_Attacker, a_DamageType, a_RawDamage); - TakeDamage(a_DamageType, a_Attacker, a_RawDamage, FinalDamage, a_KnockbackAmount); -} - - - - - -void cPawn::TakeDamage(eDamageType a_DamageType, cPawn * a_Attacker, int a_RawDamage, int a_FinalDamage, double a_KnockbackAmount) -{ - TakeDamageInfo TDI; - TDI.DamageType = a_DamageType; - TDI.Attacker = a_Attacker; - TDI.RawDamage = a_RawDamage; - TDI.FinalDamage = a_FinalDamage; - Vector3d Heading; - Heading.x = sin(GetRotation()); - Heading.y = 0.4; // TODO: adjust the amount of "up" knockback when testing - Heading.z = cos(GetRotation()); - TDI.Knockback = Heading * a_KnockbackAmount; - DoTakeDamage(TDI); -} - - - - - -void cPawn::DoTakeDamage(TakeDamageInfo & a_TDI) -{ - if (cRoot::Get()->GetPluginManager()->CallHookTakeDamage(*this, a_TDI)) - { - return; - } - - if (m_Health <= 0) - { - // Can't take damage if already dead - return; - } - - m_Health -= (short)a_TDI.FinalDamage; - - // TODO: Apply damage to armor - - if (m_Health < 0) - { - m_Health = 0; - } - - m_World->BroadcastEntityStatus(*this, ENTITY_STATUS_HURT); - - if (m_Health <= 0) - { - KilledBy(a_TDI.Attacker); - } -} - - - - - -void cPawn::KilledBy(cPawn * a_Killer) -{ - m_Health = 0; - - cRoot::Get()->GetPluginManager()->CallHookKilling(*this, a_Killer); - - if (m_Health > 0) - { - // Plugin wants to 'unkill' the pawn. Abort - return; - } - - // Drop loot: - cItems Drops; - GetDrops(Drops, a_Killer); - m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ()); - - m_World->BroadcastEntityStatus(*this, ENTITY_STATUS_DEAD); -} - - - - - -int cPawn::GetRawDamageAgainst(const cPawn & a_Receiver) -{ - // Returns the hitpoints that this pawn can deal to a_Receiver using its equipped items - // Ref: http://www.minecraftwiki.net/wiki/Damage#Dealing_damage as of 2012_12_20 - switch (this->GetEquippedWeapon().m_ItemType) - { - case E_ITEM_WOODEN_SWORD: return 4; - case E_ITEM_GOLD_SWORD: return 4; - case E_ITEM_STONE_SWORD: return 5; - case E_ITEM_IRON_SWORD: return 6; - case E_ITEM_DIAMOND_SWORD: return 7; - - case E_ITEM_WOODEN_AXE: return 3; - case E_ITEM_GOLD_AXE: return 3; - case E_ITEM_STONE_AXE: return 4; - case E_ITEM_IRON_AXE: return 5; - case E_ITEM_DIAMOND_AXE: return 6; - - case E_ITEM_WOODEN_PICKAXE: return 2; - case E_ITEM_GOLD_PICKAXE: return 2; - case E_ITEM_STONE_PICKAXE: return 3; - case E_ITEM_IRON_PICKAXE: return 4; - case E_ITEM_DIAMOND_PICKAXE: return 5; - - case E_ITEM_WOODEN_SHOVEL: return 1; - case E_ITEM_GOLD_SHOVEL: return 1; - case E_ITEM_STONE_SHOVEL: return 2; - case E_ITEM_IRON_SHOVEL: return 3; - case E_ITEM_DIAMOND_SHOVEL: return 4; - } - // All other equipped items give a damage of 1: - return 1; -} - - - - - -int cPawn::GetArmorCoverAgainst(const cPawn * a_Attacker, eDamageType a_DamageType, int a_Damage) -{ - // Returns the hitpoints out of a_RawDamage that the currently equipped armor would cover - - // Filter out damage types that are not protected by armor: - // Ref.: http://www.minecraftwiki.net/wiki/Armor#Effects as of 2012_12_20 - switch (a_DamageType) - { - case dtOnFire: - case dtSuffocating: - case dtDrowning: // TODO: This one could be a special case - in various MC versions (PC vs XBox) it is and isn't armor-protected - case dtStarving: - case dtInVoid: - case dtPoisoning: - case dtPotionOfHarming: - case dtFalling: - case dtLightning: - { - return 0; - } - } - - // Add up all armor points: - // Ref.: http://www.minecraftwiki.net/wiki/Armor#Defense_points as of 2012_12_20 - int ArmorValue = 0; - switch (GetEquippedHelmet().m_ItemType) - { - case E_ITEM_LEATHER_CAP: ArmorValue += 1; break; - case E_ITEM_GOLD_HELMET: ArmorValue += 2; break; - case E_ITEM_CHAIN_HELMET: ArmorValue += 2; break; - case E_ITEM_IRON_HELMET: ArmorValue += 2; break; - case E_ITEM_DIAMOND_HELMET: ArmorValue += 3; break; - } - switch (GetEquippedChestplate().m_ItemType) - { - case E_ITEM_LEATHER_TUNIC: ArmorValue += 3; break; - case E_ITEM_GOLD_CHESTPLATE: ArmorValue += 5; break; - case E_ITEM_CHAIN_CHESTPLATE: ArmorValue += 5; break; - case E_ITEM_IRON_CHESTPLATE: ArmorValue += 6; break; - case E_ITEM_DIAMOND_CHESTPLATE: ArmorValue += 8; break; - } - switch (GetEquippedLeggings().m_ItemType) - { - case E_ITEM_LEATHER_PANTS: ArmorValue += 2; break; - case E_ITEM_GOLD_LEGGINGS: ArmorValue += 3; break; - case E_ITEM_CHAIN_LEGGINGS: ArmorValue += 4; break; - case E_ITEM_IRON_LEGGINGS: ArmorValue += 5; break; - case E_ITEM_DIAMOND_LEGGINGS: ArmorValue += 6; break; - } - switch (GetEquippedBoots().m_ItemType) - { - case E_ITEM_LEATHER_BOOTS: ArmorValue += 1; break; - case E_ITEM_GOLD_BOOTS: ArmorValue += 1; break; - case E_ITEM_CHAIN_BOOTS: ArmorValue += 1; break; - case E_ITEM_IRON_BOOTS: ArmorValue += 2; break; - case E_ITEM_DIAMOND_BOOTS: ArmorValue += 3; break; - } - - // TODO: Special armor cases, such as wool, saddles, dog's collar - // Ref.: http://www.minecraftwiki.net/wiki/Armor#Mob_armor as of 2012_12_20 - - // Now ArmorValue is in [0, 20] range, which corresponds to [0, 80%] protection. Calculate the hitpoints from that: - return a_Damage * (ArmorValue * 4) / 100; -} - - - - - -double cPawn::GetKnockbackAmountAgainst(const cPawn & a_Receiver) -{ - // Returns the knockback amount that the currently equipped items would cause to a_Receiver on a hit - - // TODO: Enchantments - return 1; -} - - - - - -void cPawn::GetDrops(cItems & a_Drops, cPawn * a_Killer) -{ - UNUSED(a_Drops); - UNUSED(a_Killer); -} - - - - - -void cPawn::TeleportToEntity(cEntity & a_Entity) -{ - TeleportTo(a_Entity.GetPosX(), a_Entity.GetPosY(), a_Entity.GetPosZ()); -} - - - - - -void cPawn::TeleportTo(double a_PosX, double a_PosY, double a_PosZ) -{ - SetPosition(a_PosX, a_PosY, a_PosZ); - - GetWorld()->BroadcastTeleportEntity(*this); -} - - - - - -void cPawn::Tick(float a_Dt, cChunk & a_Chunk) -{ - CheckMetaDataBurn(a_Chunk); // Check to see if pawn should burn based on block they are on - - if (IsBurning()) - { - InStateBurning(a_Dt); - } -} - - - - - - -void cPawn::SetMetaData(MetaData a_MetaData) -{ - //Broadcast new status to clients in the chunk - m_MetaData = a_MetaData; - m_World->BroadcastMetadata(*this); -} - - - - - -//----Change Entity MetaData -void cPawn::CheckMetaDataBurn(cChunk & a_Chunk) -{ - // TODO: Rewrite this function to use a_Chunk instead of m_World - - if ((GetPosY() < 1) || (GetPosY() >= 254)) - { - // Y coord out of range - return; - } - - BLOCKTYPE Block = GetWorld()->GetBlock((int) GetPosX(), (int) GetPosY(), (int) GetPosZ()); - BLOCKTYPE BlockAbove = GetWorld()->GetBlock((int) GetPosX(), (int) GetPosY() + 1, (int) GetPosZ()); - BLOCKTYPE BlockBelow = GetWorld()->GetBlock((int) GetPosX(), (int) GetPosY() - 1, (int) GetPosZ()); - - if ( - (GetMetaData() == BURNING) && - (IsBlockWater(Block) || IsBlockWater(BlockAbove) || IsBlockWater(BlockBelow)) - ) - { - SetMetaData(NORMAL); - } - else if ( - m_bBurnable && - (GetMetaData() != BURNING) && - ( - IsBlockLava(Block) || (Block == E_BLOCK_FIRE) || - IsBlockLava(BlockAbove) || (BlockAbove == E_BLOCK_FIRE) || - IsBlockLava(BlockBelow) || (BlockBelow == E_BLOCK_FIRE) - ) - ) - { - SetMetaData(BURNING); - } -} - - - - - -// What to do if On fire -void cPawn::InStateBurning(float a_Dt) -{ - m_FireDamageInterval += a_Dt; - if (m_FireDamageInterval < 800) - { - return; - } - - BLOCKTYPE Block = GetWorld()->GetBlock((int)GetPosX(), (int)GetPosY(), (int)GetPosZ()); - BLOCKTYPE BlockAbove = GetWorld()->GetBlock((int)GetPosX(), (int)GetPosY() + 1, (int)GetPosZ()); - m_FireDamageInterval = 0; - TakeDamage(dtOnFire, NULL, 1, 0); - - m_BurnPeriod++; - if ( - IsBlockLava(Block) || - (Block == E_BLOCK_FIRE) || - IsBlockLava(BlockAbove) || - (BlockAbove == E_BLOCK_FIRE) - ) - { - m_BurnPeriod = 0; - TakeDamage(dtLavaContact, NULL, 6, 0); - } - - if (m_BurnPeriod > 7) - { - SetMetaData(NORMAL); - m_BurnPeriod = 0; - } -} - - - - - -void cPawn::SetMaxHealth(short a_MaxHealth) -{ - this->m_MaxHealth = a_MaxHealth; - - // Reset health - m_Health = a_MaxHealth; -} - diff --git a/source/Pawn.h b/source/Pawn.h index e0dca8b72..b1b8c71ec 100644 --- a/source/Pawn.h +++ b/source/Pawn.h @@ -8,71 +8,6 @@ -// fwd: -class cPawn; - - - - - -// tolua_begin -enum eDamageType -{ - // Canonical names for the types (as documented in the plugin wiki): - dtAttack, // Being attacked by a mob - dtLightning, // Hit by a lightning strike - dtFalling, // Falling down; dealt when hitting the ground - dtDrowning, // Drowning in water / lava - dtSuffocating, // Suffocating inside a block - dtStarving, // Hunger - dtCactusContact, // Contact with a cactus block - dtLavaContact, // Contact with a lava block - dtPoisoning, // Having the poison effect - dtOnFire, // Being on fire - dtFireContact, // Standing inside a fire block - dtInVoid, // Falling into the Void (Y < 0) - dtPotionOfHarming, - dtAdmin, // Damage applied by an admin command - - // Some common synonyms: - dtPawnAttack = dtAttack, - dtEntityAttack = dtAttack, - dtMob = dtAttack, - dtMobAttack = dtAttack, - dtFall = dtFalling, - dtDrown = dtDrowning, - dtSuffocation = dtSuffocating, - dtStarvation = dtStarving, - dtHunger = dtStarving, - dtCactus = dtCactusContact, - dtCactuses = dtCactusContact, - dtCacti = dtCactusContact, - dtLava = dtLavaContact, - dtPoison = dtPoisoning, - dtBurning = dtOnFire, - dtInFire = dtFireContact, - dtPlugin = dtAdmin, -} ; - - - - - -struct TakeDamageInfo -{ - eDamageType DamageType; // Where does the damage come from? Being hit / on fire / contact with cactus / ... - cPawn * Attacker; // The attacking pawn; valid only for dtAttack - int RawDamage; // What damage would the receiver get without any armor. Usually: attacker mob type + weapons - int FinalDamage; // What actual damage will be received. Usually: m_RawDamage minus armor - Vector3d Knockback; // The amount and direction of knockback received from the damage - // TODO: Effects - list of effects that the hit is causing. Unknown representation yet -} ; -// tolua_end - - - - - // tolua_begin class cPawn : public cEntity @@ -83,91 +18,11 @@ class cPawn : public: CLASS_PROTODEF(cPawn); - cPawn(eEntityType a_EntityType); - - virtual void Tick(float a_Dt, cChunk & a_Chunk) override; - - // tolua_begin - - /// Teleports to the entity specified - virtual void TeleportToEntity(cEntity & a_Entity); - - /// Teleports to the coordinates specified - virtual void TeleportTo(double a_PosX, double a_PosY, double a_PosZ); - - /// Heals the specified amount of HPs - void Heal(int a_HitPoints); - - /// Returns the health of this pawn - int GetHealth(void) const { return m_Health; } - - /// Makes this pawn take damage from an attack by a_Attacker. Damage values are calculated automatically and DoTakeDamage() called - void TakeDamage(cPawn & a_Attacker); - - /// Makes this pawn take the specified damage. The final damage is calculated using current armor, then DoTakeDamage() called - void TakeDamage(eDamageType a_DamageType, cPawn * a_Attacker, int a_RawDamage, double a_KnockbackAmount); - - /// Makes this pawn take the specified damage. The values are packed into a TDI, knockback calculated, then sent through DoTakeDamage() - void TakeDamage(eDamageType a_DamageType, cPawn * a_Attacker, int a_RawDamage, int a_FinalDamage, double a_KnockbackAmount); - - /// Makes this pawn take damage specified in the a_TDI. The TDI is sent through plugins first, then applied - virtual void DoTakeDamage(TakeDamageInfo & a_TDI); - - /// Called when the health drops below zero. a_Killer may be NULL (environmental damage) - virtual void KilledBy(cPawn * a_Killer); - - /// Returns the hitpoints that this pawn can deal to a_Receiver using its equipped items - virtual int GetRawDamageAgainst(const cPawn & a_Receiver); - - /// Returns the hitpoints out of a_RawDamage that the currently equipped armor would cover - virtual int GetArmorCoverAgainst(const cPawn * a_Attacker, eDamageType a_DamageType, int a_RawDamage); - - /// Returns the knockback amount that the currently equipped items would cause to a_Receiver on a hit - virtual double GetKnockbackAmountAgainst(const cPawn & a_Receiver); - - /// Returns the curently equipped weapon; empty item if none - virtual cItem GetEquippedWeapon(void) const { return cItem(); } - - /// Returns the currently equipped helmet; empty item if nonte - virtual cItem GetEquippedHelmet(void) const { return cItem(); } - - /// Returns the currently equipped chestplate; empty item if nonte - virtual cItem GetEquippedChestplate(void) const { return cItem(); } - - /// Returns the currently equipped leggings; empty item if nonte - virtual cItem GetEquippedLeggings(void) const { return cItem(); } - - /// Returns the currently equipped boots; empty item if nonte - virtual cItem GetEquippedBoots(void) const { return cItem(); } - - // tolua_end - - /// Returns the list of drops for this pawn when it is killed. May check a_Killer for special handling (sword of looting etc.). Called from KilledBy(). - virtual void GetDrops(cItems & a_Drops, cPawn * a_Killer = NULL); - - enum MetaData {NORMAL, BURNING, CROUCHED, RIDING, SPRINTING, EATING, BLOCKING}; - - virtual void SetMetaData(MetaData a_MetaData); - virtual MetaData GetMetaData(void) const { return m_MetaData; } - - virtual void InStateBurning(float a_Dt); - - virtual void CheckMetaDataBurn(cChunk & a_Chunk); - - virtual void SetMaxHealth(short a_MaxHealth); - virtual short GetMaxHealth() { return m_MaxHealth; } - - bool IsBurning(void) const { return (m_MetaData == BURNING); } + cPawn(eEntityType a_EntityType, double a_Width, double a_Height); protected: - short m_Health; - short m_MaxHealth; - bool m_bBurnable; - - MetaData m_MetaData; - -}; // tolua_export +} ; // tolua_export diff --git a/source/Pickup.cpp b/source/Pickup.cpp index 6d0f0aa0e..efd5f5799 100644 --- a/source/Pickup.cpp +++ b/source/Pickup.cpp @@ -26,7 +26,7 @@ cPickup::cPickup(int a_MicroPosX, int a_MicroPosY, int a_MicroPosZ, const cItem & a_Item, float a_SpeedX /* = 0.f */, float a_SpeedY /* = 0.f */, float a_SpeedZ /* = 0.f */) - : cEntity(etPickup, ((double)(a_MicroPosX)) / 32, ((double)(a_MicroPosY)) / 32, ((double)(a_MicroPosZ)) / 32) + : cEntity(etPickup, ((double)(a_MicroPosX)) / 32, ((double)(a_MicroPosY)) / 32, ((double)(a_MicroPosZ)) / 32, 0.2, 0.2) , m_Health(5) , m_Timer( 0.f ) , m_Item(a_Item) diff --git a/source/Player.cpp b/source/Player.cpp index 24f02e7eb..84d38f13b 100644 --- a/source/Player.cpp +++ b/source/Player.cpp @@ -33,7 +33,7 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) - : super(etPlayer) + : super(etPlayer, 0.6, 1.8) , m_GameMode(eGameMode_NotSet) , m_IP("") , m_LastBlockActionTime( 0 ) @@ -197,7 +197,7 @@ void cPlayer::Tick(float a_Dt, cChunk & a_Chunk) } else if (m_FoodLevel == 0) { - super::TakeDamage(dtStarving, NULL, 1, 1, 0); + TakeDamage(dtStarving, NULL, 1, 1, 0); } } @@ -272,7 +272,7 @@ void cPlayer::SetTouchGround(bool a_bTouchGround) m_LastJumpHeight = (float)GetPosY(); if (Damage > 0) { - super::TakeDamage(dtFalling, NULL, Damage, Damage, 0); + TakeDamage(dtFalling, NULL, Damage, Damage, 0); } m_LastGroundHeight = (float)GetPosY(); @@ -396,9 +396,9 @@ void cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI) -void cPlayer::KilledBy(cPawn * a_Killer) +void cPlayer::KilledBy(cEntity * a_Killer) { - cPawn::KilledBy(a_Killer); + super::KilledBy(a_Killer); if (m_Health > 0) { @@ -425,10 +425,10 @@ void cPlayer::Respawn(void) m_ClientHandle->SendRespawn(); - // Set non Burning - SetMetaData(NORMAL); + // Extinguish the fire: + StopBurning(); - TeleportTo(GetWorld()->GetSpawnX(), GetWorld()->GetSpawnY(), GetWorld()->GetSpawnZ()); + TeleportToCoords(GetWorld()->GetSpawnX(), GetWorld()->GetSpawnY(), GetWorld()->GetSpawnZ()); SetVisible(true); } @@ -437,12 +437,15 @@ void cPlayer::Respawn(void) -double cPlayer::GetEyeHeight() +double cPlayer::GetEyeHeight(void) const { return m_Stance; } -Vector3d cPlayer::GetEyePosition() + + + +Vector3d cPlayer::GetEyePosition(void) const { return Vector3d( GetPosX(), m_Stance, GetPosZ() ); } @@ -574,7 +577,7 @@ void cPlayer::SendMessage(const AString & a_Message) -void cPlayer::TeleportTo(double a_PosX, double a_PosY, double a_PosZ) +void cPlayer::TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) { SetPosition( a_PosX, a_PosY, a_PosZ ); diff --git a/source/Player.h b/source/Player.h index f2eb2320d..f36545a4c 100644 --- a/source/Player.h +++ b/source/Player.h @@ -61,8 +61,8 @@ public: void SetTouchGround( bool a_bTouchGround ); inline void SetStance( const double a_Stance ) { m_Stance = a_Stance; } - double GetEyeHeight(); // tolua_export - Vector3d GetEyePosition(); // tolua_export + double GetEyeHeight(void) const; // tolua_export + Vector3d GetEyePosition(void) const; // tolua_export inline bool IsOnGround(void) const {return m_bTouchGround; } // tolua_export inline const double GetStance(void) const { return GetPosY() + 1.62; } // tolua_export // TODO: Proper stance when crouching etc. inline cInventory & GetInventory(void) { return m_Inventory; } // tolua_export @@ -70,7 +70,7 @@ public: inline const cItem & GetEquippedItem(void) const { return GetInventory().GetEquippedItem(); } // tolua_export - virtual void TeleportTo(double a_PosX, double a_PosY, double a_PosZ) override; + virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) override; eGameMode GetGameMode(void) const { return m_GameMode; } // tolua_export std::string GetIP() { return m_IP; } // tolua_export @@ -138,7 +138,7 @@ public: void AddFoodExhaustion(float a_Exhaustion) { m_FoodExhaustionLevel += a_Exhaustion; } // tolua_export - virtual void KilledBy(cPawn * a_Killer) override; + virtual void KilledBy(cEntity * a_Killer) override; void Respawn(void); // tolua_export diff --git a/source/Plugin.cpp b/source/Plugin.cpp index daf1d33c8..23757f492 100644 --- a/source/Plugin.cpp +++ b/source/Plugin.cpp @@ -2,7 +2,7 @@ #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "Plugin.h" -#include "Pawn.h" +// #include "Pawn.h" #include "Player.h" #include "World.h" #include "CommandOutput.h" @@ -187,7 +187,7 @@ bool cPlugin::OnHandshake(cClientHandle * a_Client, const AString & a_Username) -bool cPlugin::OnKilling(cPawn & a_Victim, cEntity * a_Killer) +bool cPlugin::OnKilling(cEntity & a_Victim, cEntity * a_Killer) { UNUSED(a_Victim); UNUSED(a_Killer); @@ -468,9 +468,9 @@ bool cPlugin::OnPreCrafting(const cPlayer * a_Player, const cCraftingGrid * a_Gr -bool cPlugin::OnTakeDamage(cPawn & a_Pawn, TakeDamageInfo & a_TakeDamageInfo) +bool cPlugin::OnTakeDamage(cEntity & a_Receiver, TakeDamageInfo & a_TakeDamageInfo) { - UNUSED(a_Pawn); + UNUSED(a_Receiver); UNUSED(a_TakeDamageInfo); return false; } diff --git a/source/Plugin.h b/source/Plugin.h index 91f5f5286..edf3a7c9e 100644 --- a/source/Plugin.h +++ b/source/Plugin.h @@ -13,7 +13,6 @@ class cPlayer; class cPickup; class cItem; class cEntity; -class cPawn; class cWorld; class cChunkDesc; struct TakeDamageInfo; @@ -60,7 +59,7 @@ public: virtual bool OnDisconnect (cPlayer * a_Player, const AString & a_Reason); virtual bool OnExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split); virtual bool OnHandshake (cClientHandle * a_Client, const AString & a_Username); - virtual bool OnKilling (cPawn & a_Victim, cEntity * a_Killer); + virtual bool OnKilling (cEntity & a_Victim, cEntity * a_Killer); virtual bool OnLogin (cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username); virtual bool OnPlayerBreakingBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); virtual bool OnPlayerBrokenBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); @@ -80,7 +79,7 @@ public: virtual bool OnPlayerUsingItem (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ); virtual bool OnPostCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe); virtual bool OnPreCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe); - virtual bool OnTakeDamage (cPawn & a_Receiver, TakeDamageInfo & a_TakeDamageInfo); + virtual bool OnTakeDamage (cEntity & a_Receiver, TakeDamageInfo & a_TakeDamageInfo); virtual bool OnUpdatedSign (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4, cPlayer * a_Player); virtual bool OnUpdatingSign (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4, cPlayer * a_Player); virtual bool OnWeatherChanged (cWorld & a_World); diff --git a/source/PluginManager.cpp b/source/PluginManager.cpp index 32f2a2a99..b7a21a7ea 100644 --- a/source/PluginManager.cpp +++ b/source/PluginManager.cpp @@ -447,7 +447,7 @@ bool cPluginManager::CallHookHandshake(cClientHandle * a_ClientHandle, const ASt -bool cPluginManager::CallHookKilling(cPawn & a_Victim, cEntity * a_Killer) +bool cPluginManager::CallHookKilling(cEntity & a_Victim, cEntity * a_Killer) { HookMap::iterator Plugins = m_Hooks.find(HOOK_KILLING); if (Plugins == m_Hooks.end()) @@ -867,7 +867,7 @@ bool cPluginManager::CallHookPreCrafting(const cPlayer * a_Player, const cCrafti -bool cPluginManager::CallHookTakeDamage(cPawn & a_Receiver, TakeDamageInfo & a_TDI) +bool cPluginManager::CallHookTakeDamage(cEntity & a_Receiver, TakeDamageInfo & a_TDI) { HookMap::iterator Plugins = m_Hooks.find(HOOK_TAKE_DAMAGE); if (Plugins == m_Hooks.end()) diff --git a/source/PluginManager.h b/source/PluginManager.h index 9268fe66d..3832ee455 100644 --- a/source/PluginManager.h +++ b/source/PluginManager.h @@ -126,7 +126,7 @@ public: // tolua_export bool CallHookDisconnect (cPlayer * a_Player, const AString & a_Reason); bool CallHookExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split); // If a_Player == NULL, it is a console cmd bool CallHookHandshake (cClientHandle * a_ClientHandle, const AString & a_Username); - bool CallHookKilling (cPawn & a_Victim, cEntity * a_Killer); + bool CallHookKilling (cEntity & a_Victim, cEntity * a_Killer); bool CallHookLogin (cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username); bool CallHookPlayerBreakingBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); bool CallHookPlayerBrokenBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); @@ -146,7 +146,7 @@ public: // tolua_export bool CallHookPlayerUsingItem (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ); bool CallHookPostCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe); bool CallHookPreCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe); - bool CallHookTakeDamage (cPawn & a_Receiver, TakeDamageInfo & a_TDI); + bool CallHookTakeDamage (cEntity & a_Receiver, TakeDamageInfo & a_TDI); bool CallHookUpdatedSign (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4, cPlayer * a_Player); bool CallHookUpdatingSign (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4, cPlayer * a_Player); bool CallHookWeatherChanged (cWorld & a_World); diff --git a/source/Plugin_NewLua.cpp b/source/Plugin_NewLua.cpp index 1e4a6a94a..c79106761 100644 --- a/source/Plugin_NewLua.cpp +++ b/source/Plugin_NewLua.cpp @@ -549,7 +549,7 @@ bool cPlugin_NewLua::OnHandshake(cClientHandle * a_Client, const AString & a_Use -bool cPlugin_NewLua::OnKilling(cPawn & a_Victim, cEntity * a_Killer) +bool cPlugin_NewLua::OnKilling(cEntity & a_Victim, cEntity * a_Killer) { cCSLock Lock(m_CriticalSection); const char * FnName = GetHookFnName(cPluginManager::HOOK_KILLING); @@ -559,7 +559,7 @@ bool cPlugin_NewLua::OnKilling(cPawn & a_Victim, cEntity * a_Killer) return false; } - tolua_pushusertype(m_LuaState, &a_Victim, "cPawn"); + tolua_pushusertype(m_LuaState, &a_Victim, "cEntity"); tolua_pushusertype(m_LuaState, a_Killer, "cEntity"); if (!CallFunction(2, 1, FnName)) @@ -1150,7 +1150,7 @@ bool cPlugin_NewLua::OnPreCrafting(const cPlayer * a_Player, const cCraftingGrid -bool cPlugin_NewLua::OnTakeDamage(cPawn & a_Receiver, TakeDamageInfo & a_TDI) +bool cPlugin_NewLua::OnTakeDamage(cEntity & a_Receiver, TakeDamageInfo & a_TDI) { cCSLock Lock(m_CriticalSection); const char * FnName = GetHookFnName(cPluginManager::HOOK_TAKE_DAMAGE); @@ -1160,7 +1160,7 @@ bool cPlugin_NewLua::OnTakeDamage(cPawn & a_Receiver, TakeDamageInfo & a_TDI) return false; } - tolua_pushusertype(m_LuaState, &a_Receiver, "cPawn"); + tolua_pushusertype(m_LuaState, &a_Receiver, "cEntity"); tolua_pushusertype(m_LuaState, &a_TDI, "TakeDamageInfo"); if (!CallFunction(2, 1, FnName)) diff --git a/source/Plugin_NewLua.h b/source/Plugin_NewLua.h index 7abd0f9fe..8d51c86f6 100644 --- a/source/Plugin_NewLua.h +++ b/source/Plugin_NewLua.h @@ -49,7 +49,7 @@ public: virtual bool OnDisconnect (cPlayer * a_Player, const AString & a_Reason) override; virtual bool OnExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split) override; virtual bool OnHandshake (cClientHandle * a_Client, const AString & a_Username) override; - virtual bool OnKilling (cPawn & a_Victim, cEntity * a_Killer) override; + virtual bool OnKilling (cEntity & a_Victim, cEntity * a_Killer) override; virtual bool OnLogin (cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username) override; virtual bool OnPlayerBreakingBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override; virtual bool OnPlayerBrokenBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override; @@ -69,7 +69,7 @@ public: virtual bool OnPlayerUsingItem (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override; virtual bool OnPostCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) override; virtual bool OnPreCrafting (const cPlayer * a_Player, const cCraftingGrid * a_Grid, cCraftingRecipe * a_Recipe) override; - virtual bool OnTakeDamage (cPawn & a_Receiver, TakeDamageInfo & a_TakeDamageInfo) override; + virtual bool OnTakeDamage (cEntity & a_Receiver, TakeDamageInfo & a_TakeDamageInfo) override; virtual bool OnUpdatedSign (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4, cPlayer * a_Player) override; virtual bool OnUpdatingSign (cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4, cPlayer * a_Player) override; virtual bool OnWeatherChanged (cWorld & a_World) override; diff --git a/source/TNTEntity.cpp b/source/TNTEntity.cpp index 53981eee7..fcfd1e0ba 100644 --- a/source/TNTEntity.cpp +++ b/source/TNTEntity.cpp @@ -9,7 +9,7 @@ cTNTEntity::cTNTEntity(double a_X, double a_Y, double a_Z, float a_FuseTimeInSec) :
- super(etTNT, a_X, a_Y, a_Z),
+ super(etTNT, a_X, a_Y, a_Z, 0.98, 0.98),
m_Counter(0),
m_MaxFuseTime(a_FuseTimeInSec)
{
@@ -20,7 +20,7 @@ cTNTEntity::cTNTEntity(double a_X, double a_Y, double a_Z, float a_FuseTimeInSec cTNTEntity::cTNTEntity(const Vector3d & a_Pos, float a_FuseTimeInSec) :
- super(etTNT, a_Pos.x, a_Pos.y, a_Pos.z),
+ super(etTNT, a_Pos.x, a_Pos.y, a_Pos.z, 0.98, 0.98),
m_Counter(0),
m_MaxFuseTime(a_FuseTimeInSec)
{
diff --git a/source/World.cpp b/source/World.cpp index 569e2e4f9..4333aa7a4 100644 --- a/source/World.cpp +++ b/source/World.cpp @@ -1523,9 +1523,9 @@ void cWorld::BroadcastEntityStatus(const cEntity & a_Entity, char a_Status, cons -void cWorld::BroadcastMetadata(const cPawn & a_Pawn, const cClientHandle * a_Exclude) +void cWorld::BroadcastMetadata(const cEntity & a_Entity, const cClientHandle * a_Exclude) { - m_ChunkMap->BroadcastMetadata(a_Pawn, a_Exclude); + m_ChunkMap->BroadcastMetadata(a_Entity, a_Exclude); } @@ -2317,31 +2317,33 @@ int cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, int a_EntityTy { cMonster * Monster = NULL; + int Size = GetTickRandomNumber(2) + 1; // 1 .. 3 + switch (a_EntityType) { - case E_ENTITY_TYPE_BAT: Monster = new cBat(); break; - case E_ENTITY_TYPE_BLAZE: Monster = new cBlaze(); break; - case E_ENTITY_TYPE_CAVE_SPIDER: Monster = new cCavespider(); break; - case E_ENTITY_TYPE_CHICKEN: Monster = new cChicken(); break; - case E_ENTITY_TYPE_COW: Monster = new cCow(); break; - case E_ENTITY_TYPE_CREEPER: Monster = new cCreeper(); break; - case E_ENTITY_TYPE_ENDERMAN: Monster = new cEnderman(); break; - case E_ENTITY_TYPE_GHAST: Monster = new cGhast(); break; - case E_ENTITY_TYPE_MAGMA_CUBE: Monster = new cMagmacube(); break; - case E_ENTITY_TYPE_MOOSHROOM: Monster = new cMooshroom(); break; - case E_ENTITY_TYPE_OCELOT: Monster = new cOcelot(); break; - case E_ENTITY_TYPE_PIG: Monster = new cPig(); break; - case E_ENTITY_TYPE_SHEEP: Monster = new cSheep(); break; - case E_ENTITY_TYPE_SILVERFISH: Monster = new cSilverfish(); break; - case E_ENTITY_TYPE_SKELETON: Monster = new cSkeleton(); break; - case E_ENTITY_TYPE_SLIME: Monster = new cSlime(); break; - case E_ENTITY_TYPE_SPIDER: Monster = new cSpider(); break; - case E_ENTITY_TYPE_SQUID: Monster = new cSquid(); break; - case E_ENTITY_TYPE_VILLAGER: Monster = new cVillager(); break; - case E_ENTITY_TYPE_WITCH: Monster = new cWitch(); break; - case E_ENTITY_TYPE_WOLF: Monster = new cWolf(); break; - case E_ENTITY_TYPE_ZOMBIE: Monster = new cZombie(); break; - case E_ENTITY_TYPE_ZOMBIE_PIGMAN: Monster = new cZombiepigman(); break; + case E_ENTITY_TYPE_BAT: Monster = new cBat(); break; + case E_ENTITY_TYPE_BLAZE: Monster = new cBlaze(); break; + case E_ENTITY_TYPE_CAVE_SPIDER: Monster = new cCavespider(); break; + case E_ENTITY_TYPE_CHICKEN: Monster = new cChicken(); break; + case E_ENTITY_TYPE_COW: Monster = new cCow(); break; + case E_ENTITY_TYPE_CREEPER: Monster = new cCreeper(); break; + case E_ENTITY_TYPE_ENDERMAN: Monster = new cEnderman(); break; + case E_ENTITY_TYPE_GHAST: Monster = new cGhast(); break; + case E_ENTITY_TYPE_MAGMA_CUBE: Monster = new cMagmacube(Size); break; + case E_ENTITY_TYPE_MOOSHROOM: Monster = new cMooshroom(); break; + case E_ENTITY_TYPE_OCELOT: Monster = new cOcelot(); break; + case E_ENTITY_TYPE_PIG: Monster = new cPig(); break; + case E_ENTITY_TYPE_SHEEP: Monster = new cSheep(); break; + case E_ENTITY_TYPE_SILVERFISH: Monster = new cSilverfish(); break; + case E_ENTITY_TYPE_SKELETON: Monster = new cSkeleton(); break; + case E_ENTITY_TYPE_SLIME: Monster = new cSlime(Size); break; + case E_ENTITY_TYPE_SPIDER: Monster = new cSpider(); break; + case E_ENTITY_TYPE_SQUID: Monster = new cSquid(); break; + case E_ENTITY_TYPE_VILLAGER: Monster = new cVillager(); break; + case E_ENTITY_TYPE_WITCH: Monster = new cWitch(); break; + case E_ENTITY_TYPE_WOLF: Monster = new cWolf(); break; + case E_ENTITY_TYPE_ZOMBIE: Monster = new cZombie(); break; + case E_ENTITY_TYPE_ZOMBIE_PIGMAN: Monster = new cZombiepigman(); break; default: { diff --git a/source/World.h b/source/World.h index aa1f1f8bb..233759589 100644 --- a/source/World.h +++ b/source/World.h @@ -133,7 +133,7 @@ public: void BroadcastBlockAction (int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle * a_Exclude = NULL); void BroadcastDestroyEntity (const cEntity & a_Entity, const cClientHandle * a_Exclude = NULL); void BroadcastEntityStatus (const cEntity & a_Entity, char a_Status, const cClientHandle * a_Exclude = NULL); - void BroadcastMetadata (const cPawn & a_Pawn, const cClientHandle * a_Exclude = NULL); + void BroadcastMetadata (const cEntity & a_Entity, const cClientHandle * a_Exclude = NULL); void BroadcastSpawn (cEntity & a_Entity, const cClientHandle * a_Exclude = NULL); void BroadcastCollectPickup (const cPickup & a_Pickup, const cPlayer & a_Player, const cClientHandle * a_Exclude = NULL); void BroadcastWeather (eWeather a_Weather, const cClientHandle * a_Exclude = NULL); |