Skip to content

Commit

Permalink
Removing un-needed code from content includer and small AI improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Stealthpaw <[email protected]>
  • Loading branch information
mattkrins committed Jul 3, 2015
1 parent da41e7f commit 6424292
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
DodgeBall Gamemode by StealthPaw!

http://steamcommunity.com/sharedfiles/filedetails/?id=473793126

http://facepunch.com/showthread.php?t=1474203&p=48110556

https://github.com/mattkrins/dodgeball

Win by hitting the score cap or having the highest score at the end of the round timer

Expand Down
2 changes: 1 addition & 1 deletion gamemode/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ UseAdministration = true
// Should bots have AI?
Enable_Bots = true
if Enable_Bots then
// How hard should the bot players be (lower is better)?
// How hard should the bot players be 0-50 (lower is better)
Bot_Difficulty = 20
// Should the AI use the NextBot system?
Bot_UseNextBotSystem = true
Expand Down
10 changes: 5 additions & 5 deletions gamemode/core/Plugins/sv_ai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if Enable_Bots then
}

local function BotMove(ply,mv, cmd)
if ply:IsPlayer() and ply:IsBot() then
if ply:IsBot() and GameStatus == 0 and ply:Alive() then
if ply.FindingBall then
mv:SetMoveAngles( ply:EyeAngles() )
else
Expand All @@ -56,7 +56,7 @@ if Enable_Bots then

local function BotControl(ply,cmd)
local Difficulty = math.Clamp(Bot_Difficulty or 10, 0, 50) or 10
if ply:IsPlayer() and ply:IsBot() and GameStatus == 0 then
if ply:IsBot() and GameStatus == 0 and ply:Alive() then
if !ply:Alive() then cmd:SetButtons( IN_ATTACK ) end
ply.target = ply.target or false
ply.FindingBall = ply.FindingBall or false
Expand All @@ -65,10 +65,10 @@ if Enable_Bots then
local vec1 = ply.target:GetPos()
local vec2 = ply:GetShootPos()
local ang = ( vec1 - vec2 ):Angle()
ply:SetEyeAngles( Angle(ang.p+math.Rand(-Difficulty or 10,Difficulty or 10), ang.y+math.Rand(-Difficulty,Difficulty or 10), ang.r+math.Rand(-Difficulty,Difficulty or 10)) )
ply:SetEyeAngles( Angle(ang.p+math.Rand(-Difficulty,Difficulty), ang.y+math.Rand(-Difficulty,Difficulty), ang.r+math.Rand(-Difficulty,Difficulty)) )
if ply:GetPos():Distance(ply.target:GetPos()) > 200 then
cmd:SetButtons( IN_FORWARD )
cmd:SetForwardMove( 210+(Difficulty or 10) )
cmd:SetForwardMove( 210+(Difficulty) )
end
local watching = ply:GetEyeTrace().Entity or false
if watching then
Expand All @@ -89,7 +89,7 @@ if Enable_Bots then
local vec2 = ply:GetShootPos()
ply:SetEyeAngles( ( vec1 - vec2 ):Angle() )
cmd:SetButtons( IN_FORWARD )
cmd:SetForwardMove( 300+(Difficulty or 10) )
cmd:SetForwardMove( 300+(Difficulty) )
end
elseif !ply.target then
ply.FindingBall = FindBall(ply)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,4 @@ if SERVER then
FindContent("sound/dodgeball/effects/")
FindContent("sound/dodgeball/music/")
if Server_ContentID then resource.AddWorkshop( Server_ContentID ) end
end
--[[
if CLIENT then
if Server_ContentID and !steamworks.IsSubscribed( Server_ContentID ) then
steamworks.Subscribe( Server_ContentID )
steamworks.ApplyAddons()
end
end
]]
end

0 comments on commit 6424292

Please sign in to comment.