diff --git a/gradle.properties b/gradle.properties index 107964b4..8815c202 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ majorVersion=5 -minorVersion=17 +minorVersion=18 maintenanceVersion=0 diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index 85948491..6efc44f2 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -1130,10 +1130,15 @@ public: }; -const float KNIFE_BODYHIT_VOLUME = 128.0f; -const float KNIFE_WALLHIT_VOLUME = 512.0f; -const float KNIFE_MAX_SPEED = 250.0f; -const float KNIFE_MAX_SPEED_SHIELD = 180.0f; +const float KNIFE_BODYHIT_VOLUME = 128.0f; +const float KNIFE_WALLHIT_VOLUME = 512.0f; +const float KNIFE_MAX_SPEED = 250.0f; +const float KNIFE_MAX_SPEED_SHIELD = 180.0f; +const float KNIFE_STAB_DAMAGE = 65.0f; +const float KNIFE_SWING_DAMAGE = 15.0f; +const float KNIFE_SWING_DAMAGE_FAST = 20.0f; +const float KNIFE_STAB_DISTANCE = 32.0f; +const float KNIFE_SWING_DISTANCE = 48.0f; enum knife_e { @@ -1194,9 +1199,17 @@ public: void SetPlayerShieldAnim(); void ResetPlayerShieldAnim(); -public: +private: TraceResult m_trHit; unsigned short m_usKnife; + + // Extra RegameDLL features + float m_flStabBaseDamage; + float m_flSwingBaseDamage; + float m_flSwingBaseDamage_Fast; + + float m_flStabDistance; + float m_flSwingDistance; }; diff --git a/regamedll/dlls/wpn_shared/wpn_knife.cpp b/regamedll/dlls/wpn_shared/wpn_knife.cpp index 8a13a05b..18275c04 100644 --- a/regamedll/dlls/wpn_shared/wpn_knife.cpp +++ b/regamedll/dlls/wpn_shared/wpn_knife.cpp @@ -12,6 +12,13 @@ void CKnife::Spawn() m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_iClip = WEAPON_NOCLIP; + m_flStabBaseDamage = KNIFE_STAB_DAMAGE; + m_flSwingBaseDamage = KNIFE_SWING_DAMAGE; + m_flSwingBaseDamage_Fast = KNIFE_SWING_DAMAGE_FAST; + + m_flStabDistance = KNIFE_STAB_DISTANCE; + m_flSwingDistance = KNIFE_SWING_DISTANCE; + // Get ready to fall down FallInit(); @@ -36,6 +43,13 @@ void CKnife::Precache() PRECACHE_SOUND("weapons/knife_hitwall1.wav"); m_usKnife = PRECACHE_EVENT(1, "events/knife.sc"); + + m_flStabBaseDamage = KNIFE_STAB_DAMAGE; + m_flSwingBaseDamage = KNIFE_SWING_DAMAGE; + m_flSwingBaseDamage_Fast = KNIFE_SWING_DAMAGE_FAST; + + m_flStabDistance = KNIFE_STAB_DISTANCE; + m_flSwingDistance = KNIFE_SWING_DISTANCE; } int CKnife::GetItemInfo(ItemInfo *p) @@ -257,7 +271,7 @@ BOOL CKnife::Swing(BOOL fFirst) UTIL_MakeVectors(m_pPlayer->pev->v_angle); vecSrc = m_pPlayer->GetGunPosition(); - vecEnd = vecSrc + gpGlobals->v_forward * 48.0f; + vecEnd = vecSrc + gpGlobals->v_forward * m_flSwingDistance; UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, m_pPlayer->edict(), &tr); @@ -355,9 +369,9 @@ BOOL CKnife::Swing(BOOL fFirst) ClearMultiDamage(); if (m_flNextPrimaryAttack + 0.4f < UTIL_WeaponTimeBase()) - pEntity->TraceAttack(m_pPlayer->pev, 20, gpGlobals->v_forward, &tr, (DMG_NEVERGIB | DMG_BULLET)); + pEntity->TraceAttack(m_pPlayer->pev, m_flSwingBaseDamage_Fast, gpGlobals->v_forward, &tr, (DMG_NEVERGIB | DMG_BULLET)); else - pEntity->TraceAttack(m_pPlayer->pev, 15, gpGlobals->v_forward, &tr, (DMG_NEVERGIB | DMG_BULLET)); + pEntity->TraceAttack(m_pPlayer->pev, m_flSwingBaseDamage, gpGlobals->v_forward, &tr, (DMG_NEVERGIB | DMG_BULLET)); ApplyMultiDamage(m_pPlayer->pev, m_pPlayer->pev); @@ -435,7 +449,7 @@ BOOL CKnife::Stab(BOOL fFirst) UTIL_MakeVectors(m_pPlayer->pev->v_angle); vecSrc = m_pPlayer->GetGunPosition(); - vecEnd = vecSrc + gpGlobals->v_forward * 32.0f; + vecEnd = vecSrc + gpGlobals->v_forward * m_flStabDistance; UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, m_pPlayer->edict(), &tr); @@ -503,7 +517,7 @@ BOOL CKnife::Stab(BOOL fFirst) // player "shoot" animation m_pPlayer->SetAnimation(PLAYER_ATTACK1); - float flDamage = 65.0f; + float flDamage = m_flStabBaseDamage; if (pEntity && pEntity->IsPlayer()) { diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index e8c7b9dc..dcfe2b5b 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -38,7 +38,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 17 +#define REGAMEDLL_API_VERSION_MINOR 18 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn;