Skip to content

Commit

Permalink
sk_plr_hornet_regen
Browse files Browse the repository at this point in the history
value of -1 to disable recharging
  • Loading branch information
Mikk155 committed Apr 7, 2024
1 parent d0dad56 commit 56414fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions game/cfg/skills/skill_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"apache_health1": 150,
"apache_health2": 250,
"apache_health3": 400,

"apache_rockets1": 0,
"apache_rockets2": 1,
"apache_rockets3": 1,
Expand All @@ -29,7 +29,7 @@
"barney_armor_chest1": 0.5,
"barney_armor_chest2": 0.6,
"barney_armor_chest3": 0.7,

// flDamage - barney_armor_helmet
"barney_armor_helmet1": 20,
"barney_armor_helmet2": 15,
Expand Down Expand Up @@ -90,7 +90,7 @@
"hassassin_health1": 30,
"hassassin_health2": 50,
"hassassin_health3": 50,

// 0 = always visible
// 1 = Invisible when not moving
// 2 = always invisible, flicks when moving
Expand Down Expand Up @@ -246,7 +246,7 @@
"turret_health1": 50,
"turret_health2": 50,
"turret_health3": 60,

// 0 = turret can not take damage when it's off
// affects both turret and miniturret.
"turret_takedamage_off1": 1,
Expand All @@ -262,7 +262,7 @@
"sentry_health1": 40,
"sentry_health2": 40,
"sentry_health3": 50,

// 0 = sentry can not take damage when it's off
"sentry_takedamage_off1": 1,
"sentry_takedamage_off2": 1,
Expand Down Expand Up @@ -467,7 +467,7 @@
"barnacle_health1": 50,
"barnacle_health2": 75,
"barnacle_health3": 100,

"barnacle_speed1": 8,
"barnacle_speed2": 10,
"barnacle_speed3": 12,
Expand Down Expand Up @@ -523,6 +523,7 @@

// PLAYER HORNET
"plr_hornet_dmg": 7,
"plr_hornet_regen": 0.5,

"plr_pipewrench": 20,

Expand Down
8 changes: 4 additions & 4 deletions src/game/shared/entities/items/weapons/CHgun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void CHgun::PrimaryAttack()

pHornet->pev->velocity = gpGlobals->v_forward * 300;

m_flRechargeTime = gpGlobals->time + 0.5;
m_flRechargeTime = gpGlobals->time + GetSkillFloat( "plr_hornet_regen"sv, 0.5 );
#endif

const bool wasLastShot = m_pPlayer->GetAmmoCountByIndex(m_iPrimaryAmmoType) == 1;
Expand Down Expand Up @@ -217,7 +217,7 @@ void CHgun::SecondaryAttack()

pHornet->SetThink(&CHornet::StartDart);

m_flRechargeTime = gpGlobals->time + 0.5;
m_flRechargeTime = gpGlobals->time + GetSkillFloat( "plr_hornet_regen"sv, 0.5 );
#endif

int flags;
Expand Down Expand Up @@ -258,10 +258,10 @@ void CHgun::Reload()

bool updatedAmmo = false;

while (ammoCount < HORNET_MAX_CARRY && m_flRechargeTime < gpGlobals->time)
while( (int)GetSkillFloat( "plr_hornet_regen"sv, 0.5 ) != -1 && ammoCount < HORNET_MAX_CARRY && m_flRechargeTime < gpGlobals->time )
{
++ammoCount;
m_flRechargeTime += 0.5;
m_flRechargeTime += GetSkillFloat( "plr_hornet_regen"sv, 0.5 );
updatedAmmo = true;
}

Expand Down

0 comments on commit 56414fb

Please sign in to comment.