Improved and fixed bugs with damage system

master
AlmTech 5 years ago
parent 0b5922cc59
commit 235ebe75c1
  1. 6
      gamemode/core/server/sv_player_damage.lua
  2. 10
      gamemode/settings/sv_settings.lua

@ -17,7 +17,7 @@ local damagescales = {
function GM:ScalePlayerDamage( pl, hitgroup, dmginfo ) -- This is used for getting shot etc function GM:ScalePlayerDamage( pl, hitgroup, dmginfo ) -- This is used for getting shot etc
if( damagescales[hitgroup] ~= nil ) then dmginfo:ScaleDamage( damagescales[hitgroup] ) end if( damagescales[hitgroup] ~= nil ) then dmginfo:ScaleDamage( damagescales[hitgroup] ) end
Quantum.Debug( tostring(pl) .. " got damaged (" .. tostring(hitgroup) .. " : " .. tostring( math.Round( dmginfo:GetDamage() ) ) .. " )" ) Quantum.Debug( tostring(pl) .. " got damaged ( " .. tostring(hitgroup) .. " : " .. tostring( math.Round( dmginfo:GetDamage() ) ) .. " )" )
end end
function GM:GetFallDamage( pl, vel ) function GM:GetFallDamage( pl, vel )
@ -51,3 +51,7 @@ hook.Add( "EntityTakeDamage", "Quantum_PlayerDamage_SoundEffect", function( pl,
end end
end) end)
hook.Add( "PlayerDeath", "Quantum_PlayerDamage_RemoveIdleSounds", function( pl )
if( timer.Exists( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) ) then timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) end
end)

@ -10,11 +10,11 @@
Quantum.Server.Settings.VoiceChatRange = 400 Quantum.Server.Settings.VoiceChatRange = 400
Quantum.Server.Settings.DamageScale = { -- The scale of the damage for each hitgroup Quantum.Server.Settings.DamageScale = { -- The scale of the damage for each hitgroup
[HITGROUP_HEAD] = 4, [HITGROUP_HEAD] = 10,
[HITGROUP_CHEST] = 2, [HITGROUP_CHEST] = 4,
[HITGROUP_STOMACH] = 1.5, [HITGROUP_STOMACH] = 2,
[HITGROUP_LEFTARM] = 0.8, [HITGROUP_LEFTARM] = 1,
[HITGROUP_RIGHTARM] = 0.8, [HITGROUP_RIGHTARM] = 1,
[HITGROUP_LEFTLEG] = 1, [HITGROUP_LEFTLEG] = 1,
[HITGROUP_RIGHTLEG] = 1 [HITGROUP_RIGHTLEG] = 1
} }

Loading…
Cancel
Save