- Added early Rewolf Health/Armor HUD variants - Added original scoreboard from the early Half-Life versions for valve/scihunt/rewolf - Fixed some skybox behaviour to only apply to BSP30 - Changed the env_message and game_text display to use "creditsfont" instead of the conchars - Tweaked damage radius and prediction for some entities and weapons - Added world_items - Added item_healthkit - Added item_battery - Fixed level transition logic - impulse 101 now fills up health and armor/suit in mod valve - Some tweaks to Damage_Apply so that healing can be performed without funky visuals - Added stub monsters for valve/rewolf that'll soon support scripted sequences - Tweaked chat system to get rid of quotation marks around messages - Added support for changing the window caption to reflect the mod you're playing - Lots of small little things in terms of cleanup
101 lines
1.7 KiB
C++
101 lines
1.7 KiB
C++
/***
|
|
*
|
|
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
|
|
*
|
|
* See the file LICENSE attached with the sources for usage details.
|
|
*
|
|
****/
|
|
|
|
class CBaseMonster:CBaseEntity
|
|
{
|
|
void() CBaseMonster;
|
|
|
|
virtual void() touch;
|
|
virtual void() Hide;
|
|
virtual void() Respawn;
|
|
virtual void() PlayerUse;
|
|
virtual void(int) vPain;
|
|
virtual void(int) vDeath;
|
|
virtual void() Physics;
|
|
virtual void() Gib;
|
|
};
|
|
|
|
void CBaseMonster::Gib(void)
|
|
{
|
|
takedamage = DAMAGE_NO;
|
|
Effect_GibHuman(this.origin);
|
|
Hide();
|
|
}
|
|
|
|
void CBaseMonster::Physics(void)
|
|
{
|
|
input_movevalues = [0,0,0];
|
|
input_impulse = 0;
|
|
input_buttons = 0;
|
|
|
|
input_angles = angles = v_angle;
|
|
input_timelength = frametime;
|
|
movetype = MOVETYPE_WALK;
|
|
|
|
runstandardplayerphysics(this);
|
|
movetype = MOVETYPE_NONE;
|
|
}
|
|
|
|
void CBaseMonster::touch(void)
|
|
{
|
|
if (other.movetype == MOVETYPE_WALK) {
|
|
velocity = normalize(other.origin - origin) * -128;
|
|
}
|
|
}
|
|
|
|
void CBaseMonster::PlayerUse(void)
|
|
{
|
|
|
|
}
|
|
|
|
void CBaseMonster::vPain(int iHitBody)
|
|
{
|
|
|
|
}
|
|
|
|
void CBaseMonster::vDeath(int iHitBody)
|
|
{
|
|
customphysics = __NULL__;
|
|
|
|
if (health < -50) {
|
|
Gib();
|
|
return;
|
|
}
|
|
|
|
solid = SOLID_CORPSE;
|
|
}
|
|
|
|
void CBaseMonster::Hide(void)
|
|
{
|
|
setmodel(this, "");
|
|
solid = SOLID_NOT;
|
|
movetype = MOVETYPE_NONE;
|
|
customphysics = __NULL__;
|
|
}
|
|
|
|
void CBaseMonster::Respawn(void)
|
|
{
|
|
setorigin(this, m_oldOrigin);
|
|
angles = v_angle;
|
|
solid = SOLID_SLIDEBOX;
|
|
movetype = MOVETYPE_NONE;
|
|
setmodel(this, m_oldModel);
|
|
setsize(this, VEC_HULL_MIN + [0,0,36], VEC_HULL_MAX + [0,0,36]);
|
|
takedamage = DAMAGE_YES;
|
|
iBleeds = TRUE;
|
|
customphysics = Physics;
|
|
health = 100;
|
|
velocity = [0,0,0];
|
|
}
|
|
|
|
void CBaseMonster::CBaseMonster(void)
|
|
{
|
|
CBaseEntity::CBaseEntity();
|
|
precache_model(m_oldModel);
|
|
Respawn();
|
|
}
|