diff --git a/gamemode/core/client/cl_hud.lua b/gamemode/core/client/cl_hud.lua index 52d94ee..63d2251 100644 --- a/gamemode/core/client/cl_hud.lua +++ b/gamemode/core/client/cl_hud.lua @@ -58,7 +58,7 @@ function GM:HUDPaint() end hook.Add( "RenderScreenspaceEffects", "Quantum_HUD_RenderLowHealth", function() - if( LocalPlayer():Health() / LocalPlayer():GetMaxHealth() <= 0.20 ) then + if( LocalPlayer():Health() / LocalPlayer():GetMaxHealth() <= 0.25 ) then DrawMotionBlur( 0.4, 0.8, 0.1 ) DrawColorModify( { [ "$pp_colour_addr" ] = 0, diff --git a/gamemode/core/server/sv_player_damage.lua b/gamemode/core/server/sv_player_damage.lua index 25c519b..a31f554 100644 --- a/gamemode/core/server/sv_player_damage.lua +++ b/gamemode/core/server/sv_player_damage.lua @@ -17,7 +17,7 @@ local damagescales = { function GM:ScalePlayerDamage( pl, hitgroup, dmginfo ) -- This is used for getting shot etc if( damagescales[hitgroup] ~= nil ) then dmginfo:ScaleDamage( damagescales[hitgroup] ) end - Quantum.Debug( tostring(pl) .. " got damaged (" .. tostring(hitgroup) .. " : " .. tostring(dmginfo) .. " )" ) + Quantum.Debug( tostring(pl) .. " got damaged (" .. tostring(hitgroup) .. " : " .. tostring( math.Round( dmginfo:GetDamage() ) ) .. " )" ) end function GM:GetFallDamage( pl, vel ) @@ -25,4 +25,29 @@ function GM:GetFallDamage( pl, vel ) return vel / 8 -- Makes the player take more "realistic" fall damage end -function GM:PlayerDeathSound() return true end \ No newline at end of file +function GM:PlayerDeathSound() return true end + +hook.Add( "EntityTakeDamage", "Quantum_PlayerDamage_SoundEffect", function( pl, dmginfo ) + if( pl:IsPlayer() && dmginfo:GetDamage() >= 25 ) then + local soundlist = { + pain = Quantum.Server.Settings.PainSounds.Male, -- replace later with correct gender for the playermodel/character + idlepain = Quantum.Server.Settings.IdlePainSounds.Male -- same for this one + } + pl:EmitSound( Quantum.Server.Settings.PainSounds.Male[ math.random( 1, #Quantum.Server.Settings.PainSounds.Male ) ] ) + + if( timer.Exists( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) ) then timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) end -- if it already exists remove it + timer.Create( "Quantum_PlayerHurtSounds_" .. tostring( pl ), 4, 0, function() + + local rannum = math.random( 0, 100 ) + if( rannum >= Quantum.Server.Settings.DamageHurtSoundRepeatChance ) then -- Make the player "moan" for a while when hurt + pl:EmitSound( Quantum.Server.Settings.IdlePainSounds.Male[ math.random( 1, #Quantum.Server.Settings.IdlePainSounds.Male ) ] ) + end + + end) + + timer.Simple( 60, function() + timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) -- remove the timer for the player + end) + + end +end) \ No newline at end of file diff --git a/gamemode/core/server/sv_player_init.lua b/gamemode/core/server/sv_player_init.lua index 7fd22fd..c0c986c 100644 --- a/gamemode/core/server/sv_player_init.lua +++ b/gamemode/core/server/sv_player_init.lua @@ -8,6 +8,9 @@ local ply = FindMetaTable( "Player" ) function GM:PlayerSpawn( ply ) + + ply:SetModel( "models/player/Group03/male_04.mdl" ) + if( !ply:GetModel() || !ply:GetModel() == "" ) then ply:SetupHands() else diff --git a/gamemode/settings/sv_settings.lua b/gamemode/settings/sv_settings.lua index 8957052..42d374d 100644 --- a/gamemode/settings/sv_settings.lua +++ b/gamemode/settings/sv_settings.lua @@ -15,4 +15,30 @@ Quantum.Server.Settings.DamageScale = { -- The scale of the damage for each hitg [HITGROUP_RIGHTARM] = 0.8, [HITGROUP_LEFTLEG] = 1, [HITGROUP_RIGHTLEG] = 1 -} \ No newline at end of file +} + +Quantum.Server.Settings.PainSounds = {} +Quantum.Server.Settings.PainSounds.Male = { + "vo/npc/male01/pain01.wav", + "vo/npc/male01/pain02.wav", + "vo/npc/male01/pain03.wav", + "vo/npc/male01/pain04.wav", + "vo/npc/male01/pain05.wav", + "vo/npc/male01/pain06.wav", + "vo/npc/male01/pain07.wav", + "vo/npc/male01/pain08.wav", + "vo/npc/male01/pain09.wav" +} + +Quantum.Server.Settings.DamageHurtSoundRepeatChance = 90 + +Quantum.Server.Settings.IdlePainSounds = {} +Quantum.Server.Settings.IdlePainSounds.Male = { + "vo/npc/male01/moan01.wav", + "vo/npc/male01/moan02.wav", + "vo/npc/male01/moan03.wav", + "vo/npc/male01/moan04.wav", + "vo/npc/male01/moan05.wav" +} + +