Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a1fa75a30 | |||
| eac0c12d64 | |||
| 74d77b5269 | |||
| 14e32383c4 | |||
| 0efa3f12c0 | |||
| f38e70dce9 | |||
| 67c91f9225 | |||
| bc0068a79a | |||
| 6ad75df85d | |||
| e8454d4d27 |
@@ -1,3 +1,4 @@
|
|||||||
Pack.gma
|
Pack.gma
|
||||||
Changelog.txt
|
Changelog.txt
|
||||||
Description.txt
|
Description.txt
|
||||||
|
/*.gma
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
@ECHO OFF
|
|
||||||
call env.win.bat
|
|
||||||
"%GARRYSMODPATH%\bin\gmad.exe" create -folder "%CD%\Source" -out "%CD%\Pack.gma"
|
|
||||||
PAUSE
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
call env.win.bat
|
call env.win.bat
|
||||||
"%GARRYSMODPATH%\bin\gmpublish.exe" update -id 468149739 -icon "media\gamemode_workshop.jpg" -addon "Pack.gma" -changes ""
|
"%GARRYSMODPATH%\bin\gmpublish.exe" update -id 468149739 -icon "media\gamemode_workshop.jpg" -addon "pack.gma" -changes ""
|
||||||
PAUSE
|
PAUSE
|
||||||
|
Before Width: | Height: | Size: 212 KiB After Width: | Height: | Size: 212 KiB |
|
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 1003 KiB After Width: | Height: | Size: 1003 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
@@ -0,0 +1,4 @@
|
|||||||
|
@ECHO OFF
|
||||||
|
call env.win.bat
|
||||||
|
"%GARRYSMODPATH%\bin\gmad.exe" create -folder "%CD%\source" -out "%CD%\pack.gma"
|
||||||
|
PAUSE
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@ECHO OFF
|
@ECHO OFF
|
||||||
call env.win.bat
|
call env.win.bat
|
||||||
SET "PATH=%CD%;%GARRYSMODPATH%\bin;%PATH%"
|
SET "PATH=%CD%;%GARRYSMODPATH%\bin;%PATH%"
|
||||||
CMD
|
CMD
|
||||||
|
Before Width: | Height: | Size: 1003 KiB After Width: | Height: | Size: 1003 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
@@ -208,21 +208,23 @@ function DrawNamePlates(bDrawingDepth, bDrawingSkybox)
|
|||||||
|
|
||||||
for i,v in ipairs(pls) do
|
for i,v in ipairs(pls) do
|
||||||
if (v:Alive() && v != LocalPlayer()) then
|
if (v:Alive() && v != LocalPlayer()) then
|
||||||
local color = HSVToColor(GAMEMODE.Config.NamePlates:TintHue(),
|
if (player_manager.GetPlayerClass(v) != "Spectator") then
|
||||||
GAMEMODE.Config.NamePlates:TintSaturation(),
|
local color = HSVToColor(GAMEMODE.Config.NamePlates:TintHue(),
|
||||||
GAMEMODE.Config.NamePlates:TintValue())
|
GAMEMODE.Config.NamePlates:TintSaturation(),
|
||||||
if GAMEMODE.Config.NamePlates:TintHealth() then
|
GAMEMODE.Config.NamePlates:TintValue())
|
||||||
local healthPrc = v:Health() / v:GetMaxHealth()
|
if GAMEMODE.Config.NamePlates:TintHealth() then
|
||||||
color = HSVToColor(120 * healthPrc, 1.0, 1.0)
|
local healthPrc = v:Health() / v:GetMaxHealth()
|
||||||
elseif GAMEMODE.Config.NamePlates:TintTeam() then
|
color = HSVToColor(120 * healthPrc, 1.0, 1.0)
|
||||||
color = team.GetColor(v:Team())
|
elseif GAMEMODE.Config.NamePlates:TintTeam() then
|
||||||
end
|
color = team.GetColor(v:Team())
|
||||||
|
end
|
||||||
local pos = v:GetPos() + v:GetViewOffset() + Vector(0, 0, GAMEMODE.Config.NamePlates:Height())
|
|
||||||
local ang = Angle(0, LocalPlayer():EyeAngles().y - 90, 90 - LocalPlayer():EyeAngles().x)
|
local pos = v:GetPos() + v:GetViewOffset() + Vector(0, 0, GAMEMODE.Config.NamePlates:Height())
|
||||||
cam.Start3D2D(pos, ang, scale)
|
local ang = Angle(0, LocalPlayer():EyeAngles().y - 90, 90 - LocalPlayer():EyeAngles().x)
|
||||||
draw.DrawText(v:GetName(), "RobotoBoldCondensed160", 0, -draw.GetFontHeight("RobotoBoldCondensed160") / 2, color, TEXT_ALIGN_CENTER)
|
cam.Start3D2D(pos, ang, scale)
|
||||||
cam.End3D2D()
|
draw.DrawText(v:GetName(), "RobotoBoldCondensed160", 0, -draw.GetFontHeight("RobotoBoldCondensed160") / 2, color, TEXT_ALIGN_CENTER)
|
||||||
|
cam.End3D2D()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -241,7 +241,19 @@ function GM:PlayerUse(ply, ent) return player_manager.RunClass(ply, "Use", ent)
|
|||||||
function GM:AllowPlayerPickup(ply, ent) return player_manager.RunClass(ply, "AllowPickup", ent) end
|
function GM:AllowPlayerPickup(ply, ent) return player_manager.RunClass(ply, "AllowPickup", ent) end
|
||||||
function GM:PlayerSetModel(ply) return player_manager.RunClass(ply, "SetModel") end
|
function GM:PlayerSetModel(ply) return player_manager.RunClass(ply, "SetModel") end
|
||||||
|
|
||||||
-- Called when an entity takes damage
|
-- Damage
|
||||||
|
function GM:PlayerShouldTakeDamage(victim, attacker)
|
||||||
|
return player_manager.RunClass(victim, "ShouldTakeDamage", attacker)
|
||||||
|
end
|
||||||
|
|
||||||
|
function GM:PlayerHurt(victim, attacker, healthRemaining, damageTaken)
|
||||||
|
player_manager.RunClass(victim, "Hurt", victim, attacker, healthRemaining, damageTaken)
|
||||||
|
|
||||||
|
if (IsValid(attacker) && attacker:IsPlayer()) then
|
||||||
|
player_manager.RunClass(attacker, "Damage", victim, attacker, healthRemaining, damageTaken)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function GM:EntityTakeDamage(ent, dmg)
|
function GM:EntityTakeDamage(ent, dmg)
|
||||||
local att = dmg:GetAttacker()
|
local att = dmg:GetAttacker()
|
||||||
|
|
||||||
@@ -96,30 +96,51 @@ function CLASS:ShouldTakeDamage(attacker)
|
|||||||
local ffmode = GetConVarNumber("mp_friendlyfire")
|
local ffmode = GetConVarNumber("mp_friendlyfire")
|
||||||
if (ffmode == 0) then -- Not Allowed
|
if (ffmode == 0) then -- Not Allowed
|
||||||
return false
|
return false
|
||||||
elseif (ffmode == 2) then -- Damage self instead
|
|
||||||
if (IsValid(attacker) && attacker:IsPlayer()) then
|
|
||||||
attacker:SetHealth(attacker:Health() - damageTaken)
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function CLASS:Damage(victim, attacker, healthRemaining, damageDealt)
|
||||||
|
if ((victim != attacker) && victim:IsPlayer() && attacker:IsPlayer() && (attacker:Team() == victim:Team())) then
|
||||||
|
if (GAMEMODE.Config:DebugLog()) then
|
||||||
|
print("Prop Hunt: Seeker '"..attacker:GetName().."' (SteamID: "..attacker:SteamID()..") damaged seeker '"..victim:GetName().."' (SteamID: "..victim:SteamID()..") with "..damageDealt.." damage.")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function CLASS:Hurt(victim, attacker, healthRemaining, damageTaken)
|
||||||
|
if ((victim != attacker) && victim:IsPlayer() && attacker:IsPlayer() && (attacker:Team() == victim:Team())) then
|
||||||
|
if (GAMEMODE.Config:DebugLog()) then
|
||||||
|
print("Prop Hunt: Seeker '"..victim:GetName().."' (SteamID: "..victim:SteamID()..") was hurt by seeker '"..attacker:GetName().."' (SteamID: "..attacker:SteamID()..") with "..damageTaken.." damage.")
|
||||||
|
end
|
||||||
|
|
||||||
|
if (GetConVarNumber("mp_friendlyfire") == 2) then
|
||||||
|
victim:SetHealth(healthRemaining + damageTaken)
|
||||||
|
attacker:TakeDamage(damageTaken, attacker, attacker)
|
||||||
|
print("Prop Hunt: Seeker '"..victim:GetName().."' (SteamID: "..victim:SteamID()..") reflected "..damageTaken.." to seeker '"..attacker:GetName().."' (SteamID: "..attacker:SteamID()..").")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function CLASS:DamageEntity(ent, att, dmg)
|
function CLASS:DamageEntity(ent, att, dmg)
|
||||||
if (GAMEMODE.Config:DebugLog()) then print("Prop Hunt: Seeker '"..self.Player:GetName().."' (SteamID: "..self.Player:SteamID()..") damaged entity "..ent:GetClass()..".") end
|
if (GAMEMODE.Config:DebugLog()) then print("Prop Hunt: Seeker '"..self.Player:GetName().."' (SteamID: "..self.Player:SteamID()..") damaged entity "..ent:GetClass()..".") end
|
||||||
|
|
||||||
|
if (GAMEMODE:GetRoundState() != GAMEMODE.States.Seek) then return end
|
||||||
|
if (!IsValid(ent) || !IsValid(att)) then return end
|
||||||
|
if (att == ent) then return end
|
||||||
|
|
||||||
-- Only take damage during this phase.
|
-- Only take damage during this phase.
|
||||||
if (GAMEMODE:GetRoundState() == GAMEMODE.States.Seek) then
|
if IsValid(ent) && (!(ent:IsPlayer())) then
|
||||||
if IsValid(ent) && (!(ent:IsPlayer())) then
|
if (ent:GetClass() == "ph_prop") then
|
||||||
if (ent:GetClass() == "ph_prop") then
|
ent:GetOwner():TakeDamageInfo(dmg)
|
||||||
ent:GetOwner():TakeDamageInfo(dmg)
|
self.Player.Data.RandomWeight = self.Player.Data.RandomWeight - 1
|
||||||
self.Player.Data.RandomWeight = self.Player.Data.RandomWeight - 1
|
elseif (ent:GetClass() == "func_breakable") then
|
||||||
elseif (ent:GetClass() == "func_breakable") then -- ToDo: Make Configurable which entities don't hurt?
|
elseif (ent:GetClass() == "prop_ragdoll") then
|
||||||
else
|
else
|
||||||
att:TakeDamage(GAMEMODE.Config.Seeker:HealthPenalty(), ent, ent)
|
att:TakeDamage(GAMEMODE.Config.Seeker:HealthPenalty(), ent, ent)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -104,17 +104,6 @@ function GM:PlayerTick(ply, mv)
|
|||||||
return player_manager.RunClass(ply, "Tick", mv)
|
return player_manager.RunClass(ply, "Tick", mv)
|
||||||
end
|
end
|
||||||
|
|
||||||
function GM:PlayerHurt(victim, attacker, healthRemaining, damageTaken)
|
|
||||||
player_manager.RunClass(victim, "Hurt", victim, attacker, healthRemaining, damageTaken)
|
|
||||||
|
|
||||||
if (IsValid(attacker) && attacker:IsPlayer()) then
|
|
||||||
player_manager.RunClass(attacker, "Damage", victim, attacker, healthRemaining, damageTaken)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
function GM:PlayerShouldTakeDamage(victim, attacker)
|
|
||||||
return player_manager.RunClass(victim, "ShouldTakeDamage", attacker)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- ------------------------------------------------------------------------- --
|
-- ------------------------------------------------------------------------- --
|
||||||
--! Gamemode Functionality
|
--! Gamemode Functionality
|
||||||
-- ------------------------------------------------------------------------- --
|
-- ------------------------------------------------------------------------- --
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 152 KiB |