This commit is contained in:
Jonny_Bro (Nikita) 2023-10-12 21:12:06 +05:00
parent e1a0f9ee47
commit d6174fdabb
23 changed files with 368 additions and 98 deletions

View file

@ -10,14 +10,15 @@ Infamous parkour addon for Garry's Mod, fully open sourced and maintained by the
> * Network connectivity for courses (activates only when you load or upload courses, and by default `courses.beatrun.ru` is used).
**All of this is optional and you may remove all of it.**\
Modules are located [here](/lua/bin/) and courses database functionality is [here](/beatrun/gamemodes/beatrun/gamemode/cl/CoursesDatabase.lua).<br><br>
Modules are located [here](/lua/bin/) and courses database functionality is [here](/beatrun/gamemodes/beatrun/gamemode/cl/CoursesDatabase.lua).\
\
**PLEASE READ ALL BEFORE ASKING QUESTIONS ON OUR SERVER!**
## (Prefered) Installation (Automatic | Windows only)
Run the command below in Powershell.
> [!NOTE]
> Win + R > `powershell` > command in question
> Win + R > `powershell`
```powershell
iex (iwr "beatrun.ru/install.ps1" -UseBasicParsing)
@ -29,7 +30,7 @@ iex (iwr "beatrun.ru/install.ps1" -UseBasicParsing)
2. **Delete the `beatrun` folder in *your_game_folder/garrysmod/addons* if you have one.**
3. Extract the `beatrun` folder to *your_game_folder/garrysmod/addons*.
4. Extract the `lua` folder to *your_game_folder/garrysmod*.
* `lua` folder contains modules for Discord Rich Presense and Steam Presence. They are optional. You can find their source code in the [credits](#credits) section.<br><br>
* `lua` folder contains modules for Discord Rich Presense and Steam Presence. They are optional. You can find their source code in the [credits](#credits) section.
## Animations

View file

@ -1,5 +1,6 @@
# Misc
beatrun.misc.ok=OK
beatrun.misc.noclipdetected=Noclip Detected! Respawn to restart the course
# AddonWarning
beatrun.addonwarning.warntext=NOTICE\nPlease disable the following addons before playing\nor submitting any issues to GitHub:
@ -30,6 +31,15 @@ beatrun.convars.hudfloatxpcolor=HUD Floating XP Color\nDefault: 255 255 255 255
beatrun.convars.nametags=Toggles nametags above players
beatrun.convars.apikey=API key
beatrun.convars.domain=Domain of the courses database
beatrun.convars.viewbob=Viewbob Intensity
beatrun.convars.viewbobstabilization=Turn on to reduce motion sickness by making viewbobbing keep the player's look position centered
beatrun.convars.fov=Changes player's Field Of View
beatrun.convars.cpsave=Respawning during a course will go back to the last hit checkpoint
beatrun.convars.faststart=Faster start countdown
beatrun.convars.disablegrapple=Disables grapple ability
beatrun.convars.puristmode=Purist mode is a clientside preference that severely weakens the ability to strafe while in the air, which is how ME games handle this.\n0 = No restrictions\n1 = Reduced move speed in the air
beatrun.convars.quickturnground=Enables quickturning with secondary attack while on the ground
beatrun.convars.quickturnhandsonly=Enables quickturning with "Runner Hands" only
# HUD
beatrun.hud.course=Course: %s
@ -165,7 +175,7 @@ beatrun.toolsmenu.moves.kickglitch=Kick-Glitch
beatrun.toolsmenu.moves.kickglitchdesc=Toggles Kick-Glitch Move\nLMB when Wallrunning and Then Jumping Right After
beatrun.toolsmenu.moves.kickglitchversion=Kick-Glitch Version
beatrun.toolsmenu.moves.kickglitchversiondesc=Enabled - Old Kick-Glitch\nDisabled - New Kick-Glitch\nNew version uses mechanic from Mirror's Edge that spawns a small platform under a player
beatrun.toolsmenu.moves.kickglitchversiondesc=Enabled - Old Kick-Glitch\nDisabled - New Kick-Glitch\nNew version uses mechanic from ME that spawns a small platform under a player
beatrun.toolsmenu.moves.quakejump=Quake Jump
beatrun.toolsmenu.moves.quakejumpdesc=Toggles Quake Jump Move\nPress RMB Right After Side Step
@ -197,4 +207,28 @@ beatrun.toolsmenu.gamemodes.error=Another gamemode is running!
beatrun.toolsmenu.gamemodesc.infection=Toggle Infection Gamemode
beatrun.toolsmenu.gamemodesc.datatheft=Toggle Data Theft Gamemode
beatrun.toolsmenu.gamemodesc.deathmatch=Toggle Deathmatch Gamemode
beatrun.toolsmenu.gamemodesc.deathmatch=Toggle Deathmatch Gamemode
# Checkpoints
beatrun.checkpoints.countdown1=Ready
beatrun.checkpoints.countdown2=Set
beatrun.checkpoints.countdown3=GO!
beatrun.checkpoints.speedometer= %s km/h
# DataTheft
beatrun.datatheft.name=Data Theft (%s)
beatrun.datatheft.start=Data Theft! Kill players to collect data, deposit data in banks
# Deathmatch
beatrun.deathmatch.name=Deathmatch
beatrun.deathmatch.start=Deathmatch! Kill players to get points!
# Infection
beatrun.infection.name=Infection
beatrun.infection.start=Infection! Touch other players to infect them\n%s player(s) will become infected in %ss
beatrun.infection.nosurvivors=None...
beatrun.infection.infected=was infected!
beatrun.infection.infectedby=has infected
beatrun.infection.award=You were awarded 200 XP for surviving!
beatrun.infection.awardinfected=You were awarded 100 XP for spawning as an infected!
beatrun.infection.end=The game has ended!\nSurvivors: %s\nRestarting in 15s

View file

@ -0,0 +1,234 @@
# Misc
beatrun.misc.ok=OK
beatrun.misc.noclipdetected=Noclip Detected! Respawn to restart the course
# AddonWarning
beatrun.addonwarning.warntext=NOTICE\nPlease disable the following addons before playing\nor submitting any issues to GitHub:
beatrun.addonwarning.quitbutton=Quit to Main Menu
beatrun.addonwarning.play=Play
beatrun.addonwarning.conflictfound=CONFLICTING ADDONS FOUND
# BuildModeHUD
beatrun.buildmodehud.info=Index: %s\nSelected: %s\nAngle: %s
beatrun.buildmodehud.props=Menu / Props
beatrun.buildmodehud.entities=Menu / Entities
beatrun.buildmodehud.drag=Drag (G)
beatrun.buildmodehud.copy=Copy (SHIFT+D)
beatrun.buildmodehud.delete=Delete (DEL/BCKSPC)
beatrun.buildmodehud.highlight=Highlight (T)
beatrun.buildmodehud.select=Select
beatrun.buildmodehud.zipline=Zipline (SHIFT = 2-Way)
# All ConVars
beatrun.convars.hudxp=Show total XP near nickname
beatrun.convars.hudsway=Display HUD swaying
beatrun.convars.huddynamic=Hide HUD when moving
beatrun.convars.hudhidden=Hides most of the XP HUD
beatrun.convars.hudreticle=Display a reticle
beatrun.convars.hudtextcolor=HUD Text Color\nDefault: 255 255 255 255
beatrun.convars.hudcornercolor=HUD Left Corner Color\nDefault: 20 20 20 100
beatrun.convars.hudfloatxpcolor=HUD Floating XP Color\nDefault: 255 255 255 255
beatrun.convars.nametags=Toggles nametags above players
beatrun.convars.apikey=API key
beatrun.convars.domain=Domain of the courses database
beatrun.convars.viewbob=Viewbob Intensity
beatrun.convars.viewbobstabilization=Turn on to reduce motion sickness by making viewbobbing keep the player's look position centered
beatrun.convars.fov=Changes player's Field Of View
beatrun.convars.cpsave=Respawning during a course will go back to the last hit checkpoint
beatrun.convars.faststart=Faster start countdown
beatrun.convars.disablegrapple=Disables grapple ability
beatrun.convars.puristmode=Purist mode is a clientside preference that severely weakens the ability to strafe while in the air, which is how ME games handle this.\n0 = No restrictions\n1 = Reduced move speed in the air
beatrun.convars.quickturnground=Enables quickturning with secondary attack while on the ground
beatrun.convars.quickturnhandsonly=Enables quickturning with "Runner Hands" only
# HUD
beatrun.hud.course=Course: %s
beatrun.hud.freeplay=Freeplay
beatrun.hud.lvl=Lvl: %s
beatrun.hud.infector=Infector
# Menu_Course
beatrun.coursemenu.trials=Time Trials - %s
beatrun.coursemenu.buildmode=Toggle Build Mode
beatrun.coursemenu.freeplay=Return to Freeplay
# CoursesDatabase
beatrun.coursesdatabase.cantuploadfreeplay=Can't upload in Freeplay
beatrun.coursesdatabase.upload1=You're trying to upload a course with the name %s and on map %s.
beatrun.coursesdatabase.upload2=Use Beatrun_Confirm to continue, or Beatrun_Cancel to cancel.
beatrun.coursesdatabase.update1=You are trying to update a course with this code: %s, with a course on map %s and name %s.
# Tools Menu
beatrun.toolsmenu.client=Client
beatrun.toolsmenu.server=Server
# Tools Menu Courses Section
beatrun.toolsmenu.courses.name=Courses
beatrun.toolsmenu.courses.desc=Courses Settings
beatrun.toolsmenu.courses.faststart=Fast Start
beatrun.toolsmenu.courses.faststartdesc=Faster countdown at the start of the course
beatrun.toolsmenu.courses.checkpointsave=Save at Checkpoint
beatrun.toolsmenu.courses.checkpointsavedesc=Respawn at last hit checkpoint in courses
beatrun.toolsmenu.courses.database=Database domain
beatrun.toolsmenu.courses.databasedesc=Domain/IP of the database\nDefault: courses.beatrun.ru
beatrun.toolsmenu.courses.changeapikey=Change API Key
beatrun.toolsmenu.courses.enterapikey=Enter your API Key
beatrun.toolsmenu.courses.savecourse=Save currently running course to a file
beatrun.toolsmenu.courses.namesavecourse=Enter a name for your course
beatrun.toolsmenu.courses.loadcourse=Load a course from the online database
beatrun.toolsmenu.courses.enterloadcourse=Enter course code
beatrun.toolsmenu.courses.uploadcourse=Upload currently running course to the database
beatrun.toolsmenu.courses.uploadcoursehelp=Check the console for the code!
beatrun.toolsmenu.courses.updatecourse=Update a course on the database
beatrun.toolsmenu.courses.updatecourseconsole=Check the console for the response from the server!
beatrun.toolsmenu.courses.updatecoursehelp=Updates a course on the database with the currently running one
# Tools Menu HUD Section
beatrun.toolsmenu.hud.name=HUD
beatrun.toolsmenu.hud.desc=HUD Settings
beatrun.toolsmenu.hud.dynamic=Dynamic HUD
beatrun.toolsmenu.hud.dynamicdesc=Hides HUD when moving
beatrun.toolsmenu.hud.sway=HUD Sway
beatrun.toolsmenu.hud.swaydesc=Toggles HUD swaying
beatrun.toolsmenu.hud.reticle=Show Reticle
beatrun.toolsmenu.hud.reticledesc=Shows a dot in the center of the screen
beatrun.toolsmenu.hud.nametags=Show Nametags
beatrun.toolsmenu.hud.nametagsdesc=Toggles nametags above players
beatrun.toolsmenu.hud.hudxp=Show HUD XP
beatrun.toolsmenu.hud.hudxpdesc=Show total XP near your nickname
beatrun.toolsmenu.hud.wind=Wind Effect
beatrun.toolsmenu.hud.winddesc=Wind noises when running
beatrun.toolsmenu.hud.fov=FOV
beatrun.toolsmenu.hud.fovdesc=You need to respawn after changing your FOV!
beatrun.toolsmenu.hud.hidden=Hide HUD
beatrun.toolsmenu.hud.hiddendesc=0 - Shown\n1 - Gamemode only\n2 - Hidden
beatrun.toolsmenu.hud.textcolor=HUD Text Color
beatrun.toolsmenu.hud.cornercolor=HUD Corner Color
beatrun.toolsmenu.hud.floatxpcolor=HUD Floating XP Color
# Tools Menu Viewbob Section
beatrun.toolsmenu.viewbob.name=Viewbob
beatrun.toolsmenu.viewbob.desc=Viewbob Settings
beatrun.toolsmenu.viewbob.stabilization=Viewbob Stabilization
beatrun.toolsmenu.viewbob.stabilizationdesc=Turn on to reduce motion sickness by making viewbobbing keep the player's look position centered
beatrun.toolsmenu.viewbob.intensity=Viewbob Intensity
# Tools Menu Gameplay Section
beatrun.toolsmenu.gameplay.name=Gameplay
beatrun.toolsmenu.gameplay.desc=Gameplay Settings
beatrun.toolsmenu.gameplay.quickturnground=Quickturn Ground
beatrun.toolsmenu.gameplay.quickturngrounddesc=Enables quickturning with secondary attack while on the ground
beatrun.toolsmenu.gameplay.quickturnhandsonly=Quickturn Hands Only
beatrun.toolsmenu.gameplay.quickturnhandsonlydesc=Enables quickturning with "Runner Hands" only
beatrun.toolsmenu.gameplay.puristmode=Purist Mode
beatrun.toolsmenu.gameplay.puristmodedesc=Purist mode is a clientside preference that severely weakens the ability to strafe while in the air, which is how Mirror's Edge games handle this.\nDisabled = No restrictions\nEnabled = Reduced move speed in the air
beatrun.toolsmenu.gameplay.disablegrapple=Disable Grapple Ability
beatrun.toolsmenu.gameplay.disablegrappledesc=Disables grapple ability
# Tools Menu Misc Section
beatrun.toolsmenu.misc.name=Misc
beatrun.toolsmenu.misc.desc=Misc Settings
beatrun.toolsmenu.misc.propspawn=Prop Spawning
beatrun.toolsmenu.misc.propspawndesc=Allows players without admin rights to spawn props, entities and weapons
beatrun.toolsmenu.misc.overdrivemp=Overdrive in Multiplayer
beatrun.toolsmenu.misc.overdrivempdesc=Allows Overdrive usage on the server
# Tools Menu Moves Section
beatrun.toolsmenu.moves.name=Moves
beatrun.toolsmenu.moves.desc=Moves Settings
beatrun.toolsmenu.moves.help=You Can Dive with Ctrl + RMB While Midair!\nOverdrive Toggles with E + LMB.
beatrun.toolsmenu.moves.speedlimit=Speed Limit
beatrun.toolsmenu.moves.speedlimitdesc=Changes player's speed limit (325 is default)
beatrun.toolsmenu.moves.forcepuristmode=Force Purist Mode
beatrun.toolsmenu.moves.forcepuristmodedesc=Forces Purist Mode to be enabled for all players
beatrun.toolsmenu.moves.realisticwallrunning="Realistic" wallrunning
beatrun.toolsmenu.moves.realisticwallrunningdesc=You don't lose speed when starting wallrunning when disabled
beatrun.toolsmenu.moves.kickglitch=Kick-Glitch
beatrun.toolsmenu.moves.kickglitchdesc=Toggles Kick-Glitch Move\nLMB when Wallrunning and Then Jumping Right After
beatrun.toolsmenu.moves.kickglitchversion=Kick-Glitch Version
beatrun.toolsmenu.moves.kickglitchversiondesc=Enabled - Old Kick-Glitch\nDisabled - New Kick-Glitch\nNew version uses mechanic from ME that spawns a small platform under a player
beatrun.toolsmenu.moves.quakejump=Quake Jump
beatrun.toolsmenu.moves.quakejumpdesc=Toggles Quake Jump Move\nPress RMB Right After Side Step
beatrun.toolsmenu.moves.sidestep=Side Step
beatrun.toolsmenu.moves.sidestepdesc=Toggles Side Step Move\nA/D + RMB
beatrun.toolsmenu.moves.disarm=Disarm
beatrun.toolsmenu.moves.disarmdesc=Toggles Ability to Disarm NPC\nPress "%s" on an NPC
beatrun.toolsmenu.moves.divesettings=Dive Settings
beatrun.toolsmenu.moves.totsugeki=Totsugeki
beatrun.toolsmenu.moves.totsugekidesc=Toggles Totsugeki Move\nDive Right After Quake Jump
beatrun.toolsmenu.moves.totsugekispam=Totsugeki Spam
beatrun.toolsmenu.moves.totsugekispamdesc=TToggles Ability to Spam Totsugeki
beatrun.toolsmenu.moves.totsugekiheading=Totsugeki Heading
beatrun.toolsmenu.moves.totsugekiheadingdesc=Allows to Totsugeki on X axis (up/down)
beatrun.toolsmenu.moves.totsugekidirection=Totsugeki Direction
beatrun.toolsmenu.moves.totsugekidirectiondesc=Allows to Totsugeki into Another Direction\nCombined with Spam and Heading Allows You to Fly =)
# Tools Menu Gamemodes Section
beatrun.toolsmenu.gamemodes.name=Gamemodes
beatrun.toolsmenu.gamemodes.desc=Gamemodes Settings
beatrun.toolsmenu.gamemodes.error=Another gamemode is running!
beatrun.toolsmenu.gamemodesc.infection=Toggle Infection Gamemode
beatrun.toolsmenu.gamemodesc.datatheft=Toggle Data Theft Gamemode
beatrun.toolsmenu.gamemodesc.deathmatch=Toggle Deathmatch Gamemode
# Checkpoints
beatrun.checkpoints.countdown1=Ready
beatrun.checkpoints.countdown2=Set
beatrun.checkpoints.countdown3=GO!
beatrun.checkpoints.speedometer= %s km/h
# DataTheft
beatrun.datatheft.name=Data Theft (%s)
beatrun.datatheft.start=Data Theft! Kill players to collect data, deposit data in banks
# Deathmatch
beatrun.deathmatch.name=Deathmatch
beatrun.deathmatch.start=Deathmatch! Kill players to get points!
# Infection
beatrun.infection.name=Infection
beatrun.infection.start=Infection! Touch other players to infect them\n%s player(s) will become infected in %ss
beatrun.infection.nosurvivors=None...
beatrun.infection.infected=was infected!
beatrun.infection.infectedby=has infected
beatrun.infection.award=You were awarded 200 XP for surviving!
beatrun.infection.awardinfected=You were awarded 100 XP for spawning as an infected!
beatrun.infection.end=The game has ended!\nSurvivors: %s\nRestarting in 15s

View file

@ -16,11 +16,9 @@ local animtable = {
fbanims = {
ladderexittoplefthand = true,
runfwdstart = true,
vaultkong = true,
walktostandleft = true,
wallrunverticalstart = true,
meleeair = true,
vaultonto = true,
fallinguncontrolled = true,
stand = true,
meslideend = true,
@ -36,7 +34,6 @@ fbanims = {
hangheaveup = true,
jumpwrright = true,
meleeairhit = true,
vaultover = true,
jumpstill = true,
dodgejumpright = true,
jumpturnflyidle = true,
@ -75,10 +72,8 @@ fbanims = {
diveslideidle = true,
wallrunright = true,
diveslideend = true,
vaultontohigh = true,
divestart = true,
hangfoldedheaveup = true,
vaultoverhigh = true,
ziplinestart = true,
dodgejumpleft = true,
evaderoll = true,
@ -107,6 +102,11 @@ fbanims = {
ladderclimbuprighthandstill = true,
jumpidle = true,
jumpair = true,
vaultkong = true,
vaultonto = true,
vaultover = true,
vaultontohigh = true,
vaultoverhigh = true,
walkbalancefalloffright = true,
meleeairstill = true,
swingjumpoff = true,
@ -154,7 +154,6 @@ local events = {
fall = true,
ladderclimbleft = true,
jumpwallrun = true,
vaultonto = true,
ziplinestart = true,
hangstrafeleft = true,
hangstraferight = true,
@ -170,7 +169,6 @@ local events = {
jumpslide = true,
swingpipeleft = true,
ladderenterhang = true,
vault = true,
disarmsniper = true,
jumpstill = true,
climb = true,
@ -204,10 +202,13 @@ local events = {
ladderexittoprighthand = true,
hangend = true,
springboard = true,
vault = true,
vaultkong = true,
vaultonto = true,
vaultover = true,
vaultontohigh = true,
ladderclimbright = true,
meleeairstill = true,
vaultontohigh = true
meleeairstill = true
}
local eventslut = {
@ -329,9 +330,9 @@ local stillanims = {
local arminterrupts = {
punchright = true,
doorbash = true,
punchmid = true,
punchleft = true,
punchmid = true,
doorbash = true,
jumpturnflypiecesign = true,
standhandwallright = true,
standhandwallleft = true,
@ -344,8 +345,6 @@ local transitionanims = {
ladderexittoplefthand = "runfwd",
walktostandleft = "stand",
fallinguncontrolled = "runfwd",
vaultoverhigh = "runfwd",
vaultonto = "runfwd",
hangstrafeleft = "hang",
ladderclimbhangstart = "ladderclimbuprighthandstill",
hanghardstart2 = "hang",
@ -361,7 +360,6 @@ local transitionanims = {
hangheaveup = "runfwd",
dodgejumpleft = "stand",
walkbalancefalloffleft = "jumpair",
vaultover = "jumpair",
meleeairhit = "jumpair",
dodgejumpright = "stand",
meleeair = "jumpair",
@ -379,7 +377,6 @@ local transitionanims = {
ladderclimbuplefthand = "ladderclimbuplefthandstill",
jumpturnfly = "jumpturnflyidle",
meleewrleft = "jumpair",
vaultkong = "runfwd",
meleeslide = "meslideloop",
stepuprightleg = "runfwd",
snatchsniper = "stand",
@ -388,6 +385,10 @@ local transitionanims = {
wallrunverticalturn = "jumpslow",
ladderclimbuprighthand = "ladderclimbuprighthandstill",
meleeairstill = "jumpair",
vaultoverhigh = "runfwd",
vaultonto = "runfwd",
vaultover = "jumpair",
vaultkong = "runfwd",
vaultontohigh = "runfwd",
snatchscar = "stand",
water_swimfwd = "runfwd",
@ -464,7 +465,9 @@ local worldarm = {
jumpturnlandidle = true,
standhandwallright = true,
standhandwallleft = true,
standhandwallboth = true
standhandwallboth = true,
swing = true,
swingstraight = true
}
local ignorezarm = {
@ -775,7 +778,14 @@ local transitionchecks = {
fbfunctions = {
vaultontohigh = function(ply) return true end,
swing = function(ply)
CamIgnoreAng = false
BodyLimitY = 180
end,
swingstraight = function(ply)
CamIgnoreAng = false
BodyLimitY = 180
BodyAnim:SetPoseParameter("swing", (ply:GetSBOffset() / 45 - 1) * 100)
end,
ziplinestart = function(ply)

View file

@ -2,8 +2,8 @@ local meta = FindMetaTable("Player")
local metavec = FindMetaTable("Vector")
local PUNCH_DAMPING = 9
local PUNCH_SPRING_CONSTANT = 120
local viewbob_intensity = CreateClientConVar("Beatrun_ViewbobIntensity", "20", true, true, "Viewbob Intensity", -100, 100)
local viewbob_stabilized = CreateClientConVar("Beatrun_ViewbobStabilized", "0", true, true, "Turn on to reduce motion sickness by making viewbobbing keep the player's look position centered", 0, 1)
local viewbob_intensity = CreateClientConVar("Beatrun_ViewbobIntensity", "20", true, true, language.GetPhrase("beatrun.convars.viewbob"), -100, 100)
local viewbob_stabilized = CreateClientConVar("Beatrun_ViewbobStabilized", "0", true, true, language.GetPhrase("beatrun.convars.viewbobstabilization"), 0, 1)
local function lensqr(ang)
return ang[1] ^ 2 + ang[2] ^ 2 + ang[3] ^ 2

View file

@ -1,5 +1,5 @@
if SERVER then
local allowPropSpawn = CreateConVar("Beatrun_AllowPropSpawn", "0", {FCVAR_ARCHIVE}, "Allow players to spawn props and entities")
local allowPropSpawn = CreateConVar("Beatrun_AllowPropSpawn", "0", {FCVAR_ARCHIVE})
util.AddNetworkString("SPParkourEvent")
@ -21,8 +21,8 @@ if SERVER then
end
if CLIENT then
CreateClientConVar("Beatrun_FOV", 100, true, true, "'Woah how are you moving this fast' and other hilarious jokes", 70, 120)
CreateClientConVar("Beatrun_CPSave", 1, true, true, "Respawning during a course will go back to the last hit checkpoint", 0, 1)
CreateClientConVar("Beatrun_FOV", 100, true, true, language.GetPhrase("beatrun.convars.fov"), 70, 120)
CreateClientConVar("Beatrun_CPSave", 1, true, true, language.GetPhrase("beatrun.convars.cpsave"), 0, 1)
end
hook.Add("PlayerNoClip", "BlockNoClip", function(ply, enabled)
@ -30,9 +30,9 @@ hook.Add("PlayerNoClip", "BlockNoClip", function(ply, enabled)
ply:SetNW2Int("CPNum", -1)
if CLIENT and IsFirstTimePredicted() then
notification.AddLegacy("Noclip Detected! Respawn to restart the course", NOTIFY_ERROR, 4)
notification.AddLegacy(language.GetPhrase("beatrun.misc.noclipdetected"), NOTIFY_ERROR, 4)
elseif SERVER and game.SinglePlayer() then
ply:SendLua("notification.AddLegacy(\"Noclip Detected! Respawn to restart the course\", NOTIFY_ERROR, 4)")
ply:SendLua("notification.AddLegacy(\"#beatrun.misc.noclipdetected\", NOTIFY_ERROR, 4)")
end
end

View file

@ -328,9 +328,6 @@ if SERVER then
util.AddNetworkString("BuildMode_Sync")
util.AddNetworkString("Course_Stop")
buildmodelogs = {}
local buildmodelogs = buildmodelogs
function Course_Sync()
net.Start("BuildMode_Sync")
net.WriteFloat(Course_StartPos.x)
@ -428,10 +425,6 @@ if SERVER then
end
table.insert(buildmode_placed, a)
local bmlog = tostring(ply) .. " placed " .. tostring(a)
table.insert(buildmodelogs, bmlog)
end)
net.Receive("BuildMode_Duplicate", function(len, ply)
@ -440,7 +433,7 @@ if SERVER then
local selected = net.ReadTable()
local selectedents = net.ReadTable()
for k, v in pairs(selected) do
for _, v in pairs(selected) do
local a = ents.Create("prop_physics")
a:SetModel(v:GetModel())
@ -461,17 +454,13 @@ if SERVER then
a:SetHealth(inf)
end
for k, v in pairs(selectedents) do
for _, v in pairs(selectedents) do
local a = ents.Create(v:GetClass())
a:SetPos(v:GetPos())
a:SetAngles(v:GetAngles())
a:Spawn()
end
local bmlog = tostring(ply) .. " duped " .. tostring(table.Count(selected)) .. " props"
table.insert(buildmodelogs, bmlog)
end)
net.Receive("BuildMode_Delete", function(len, ply)
@ -479,15 +468,11 @@ if SERVER then
local selected = net.ReadTable()
for k, v in pairs(selected) do
for _, v in pairs(selected) do
if IsValid(v) then
v:Remove()
end
end
local bmlog = tostring(ply) .. " deleted " .. tostring(table.Count(selected)) .. " entities"
table.insert(buildmodelogs, bmlog)
end)
net.Receive("BuildMode_Highlight", function(len, ply)
@ -495,7 +480,7 @@ if SERVER then
local selected = net.ReadTable()
for k, v in pairs(selected) do
for _, v in pairs(selected) do
v.hr = not v.hr
CustomPropMat(v)
@ -516,7 +501,7 @@ if SERVER then
local a = util.Decompress(net.ReadData(len))
local props = util.JSONToTable(a)
for k, v in pairs(props) do
for _, v in pairs(props) do
local a = ents.Create("prop_physics")
a:SetModel(buildmode_props[v.model])
@ -616,7 +601,7 @@ if SERVER then
local name = data[5]
local entities = data[6]
for k, v in pairs(props) do
for _, v in pairs(props) do
local a = ents.Create("prop_physics")
a.hr = v.hr
a:SetModel(buildmode_props[v.model])
@ -634,7 +619,7 @@ if SERVER then
a:SetHealth(inf)
end
for k, v in ipairs(cp) do
for _, v in ipairs(cp) do
LoadCheckpoints()
local a = ents.Create("tt_cp")
@ -646,7 +631,7 @@ if SERVER then
end
if entities then
for k, v in ipairs(entities) do
for _, v in ipairs(entities) do
local a = ents.Create(v.ent)
local dontsetpos = nil
@ -671,7 +656,7 @@ if SERVER then
Course_Sync()
for k, v in pairs(player.GetAll()) do
for _, v in pairs(player.GetAll()) do
v:SetNW2Float("PBTime", 0)
v:SetNW2Int("CPNum", 1)
v:SetMoveType(MOVETYPE_WALK)
@ -903,7 +888,7 @@ if CLIENT then
function CourseData(name)
local save = {{}, {}, Course_StartPos, Course_StartAng, name or "Unnamed", {}}
for k, v in pairs(buildmode_placed) do
for _, v in pairs(buildmode_placed) do
if not IsValid(v) then -- Nothing
elseif v:GetNW2Bool("BRProtected") then
print("ignoring protected ent")
@ -935,7 +920,7 @@ if CLIENT then
end
end
for k, v in ipairs(Checkpoints) do
for _, v in ipairs(Checkpoints) do
table.insert(save[2], v:GetPos())
end
@ -963,7 +948,6 @@ if CLIENT then
concommand.Add("Beatrun_SaveCourse", function(ply, cmd, args, argstr)
local name = args[1] or "Unnamed"
-- local compress = not args[2]
SaveCourse(name, args[2])
end)
@ -1458,7 +1442,7 @@ if CLIENT then
cam.Start3D()
for k, v in ipairs(buildmode_placed) do
for _, v in ipairs(buildmode_placed) do
if IsValid(v) and not v:GetNW2Bool("BRProtected") then
local pos = v:GetRenderOrigin() or v:GetPos()
local w2s = pos:ToScreen()
@ -1551,7 +1535,7 @@ if CLIENT then
surface.SetFont("DebugFixed")
surface.SetTextColor(255, 255, 255)
for k, v in pairs(Checkpoints) do
for _, v in pairs(Checkpoints) do
if not IsValid(v) then
LoadCheckpoints()

View file

@ -44,28 +44,28 @@ function LoadCheckpoints()
table.Empty(Checkpoints)
if SERVER then
for k, v in pairs(player.GetAll()) do
for _, v in pairs(player.GetAll()) do
v:SetNW2Int("CPNum", 1)
end
end
if CLIENT then
timer.Simple(1, function()
for k, v in pairs(ents.FindByClass("tt_cp")) do
for _, v in pairs(ents.FindByClass("tt_cp")) do
if IsValid(v) and v.GetCPNum then
Checkpoints[v:GetCPNum()] = v
end
end
end)
else
for k, v in pairs(ents.FindByClass("tt_cp")) do
for _, v in pairs(ents.FindByClass("tt_cp")) do
Checkpoints[v:GetCPNum()] = v
end
end
end
if CLIENT then
CreateClientConVar("Beatrun_FastStart", "0", true, true, "Faster start countdown", 0, 1)
CreateClientConVar("Beatrun_FastStart", "0", true, true, language.GetPhrase("beatrun.convars.faststart"), 0, 1)
net.Receive("Checkpoint_Hit", function()
local timetaken = CurTime() - lastcptime
@ -181,7 +181,11 @@ end
local countdown = 0
local countdownalpha = 255
local countdowntext = {"Ready", "Set", "Go!!"}
local countdowntext = {
"#beatrun.checkpoints.countdown1",
"#beatrun.checkpoints.countdown2",
"#beatrun.checkpoints.countdown3"
}
local function StartCountdown()
local CT = CurTime()
@ -243,7 +247,8 @@ function CourseHUD()
speed = "0" .. speed
end
text = speed .. " km/h"
text = language.GetPhrase("beatrun.checkpoints.speedometer"):format(speed)
local w, _ = surface.GetTextSize(text)
w = w or 0

View file

@ -4,7 +4,7 @@ local problematichooks = {
local function RemoveConflicting()
for k, v in pairs(problematichooks) do
for l, b in ipairs(v) do
for _, b in ipairs(v) do
hook.Remove(k, b)
end
end

View file

@ -86,7 +86,7 @@ if CLIENT then
if GetGlobalBool("GM_DATATHEFT") then
local datacubes = LocalPlayer():GetNW2Int("DataCubes", 0)
return "Data Theft (" .. datacubes .. ")"
return language.GetPhrase("beatrun.datatheft.name"):format(datacubes)
else
hook.Remove("BeatrunHUDCourse", "DataTheftHUDName")
end
@ -98,6 +98,6 @@ if CLIENT then
net.Receive("DataTheft_Start", function()
hook.Add("BeatrunHUDCourse", "DataTheftHUDName", DataTheftHUDName)
chat.AddText(Color(200, 200, 200), "Data Theft! Kill players to collect data, deposit data in banks")
chat.AddText(Color(200, 200, 200), "#beatrun.datatheft.start")
end)
end

View file

@ -15,7 +15,8 @@ if SERVER then
else
for _, b in ipairs(DATATHEFT_LOADOUTS[math.random(#DATATHEFT_LOADOUTS)]) do
local wep = v:Give(b)
v:GiveAmmo(1000, wep:GetPrimaryAmmoType())
v:GiveAmmo(9999, wep:GetPrimaryAmmoType() or "Pistol", true)
end
end
end
@ -64,7 +65,7 @@ end
if CLIENT then
local function DeathmatchHUDName()
if GetGlobalBool("GM_DEATHMATCH") then
return "Deathmatch"
return "#beatrun.deathmatch.name"
else
hook.Remove("BeatrunHUDCourse", "DeathmatchHUDName")
end
@ -76,6 +77,6 @@ if CLIENT then
net.Receive("Deathmatch_Start", function()
hook.Add("BeatrunHUDCourse", "DeathmatchHUDName", DeathmatchHUDName)
chat.AddText(Color(200, 200, 200), "Deathmatch! Kill players to get points!")
chat.AddText(Color(200, 200, 200), "#beatrun.deathmatch.start")
end)
end

View file

@ -1,7 +1,7 @@
local totsugeki = CreateConVar("Beatrun_Totsugeki", 1, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Oh no...", 0, 1)
local totsugekispam = CreateConVar("Beatrun_TotsugekiSpam", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "OH NO...", 0, 1)
local totsugekiheading = CreateConVar("Beatrun_TotsugekiHeading", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Can we dive on the x axis?", 0, 1)
local totsugekidir = CreateConVar("Beatrun_TotsugekiDir", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Can we dive into another dir?", 0, 1)
local totsugeki = CreateConVar("Beatrun_Totsugeki", 1, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "", 0, 1)
local totsugekispam = CreateConVar("Beatrun_TotsugekiSpam", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "", 0, 1)
local totsugekiheading = CreateConVar("Beatrun_TotsugekiHeading", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "", 0, 1)
local totsugekidir = CreateConVar("Beatrun_TotsugekiDir", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "", 0, 1)
local function Dive(ply, mv, cmd)
if (not ply:GetDive() or ply:GetDive() and ply.QuakeJumping and totsugeki:GetBool() and totsugekispam:GetBool()) and ply:GetCrouchJump() and mv:KeyPressed(IN_ATTACK2) then

View file

@ -1,6 +1,6 @@
local disable_grapple = CreateClientConVar("Beatrun_DisableGrapple", 0, true, true, "Disables grapple ability", 0, 1)
if CLIENT then
local disable_grapple = CreateClientConVar("Beatrun_DisableGrapple", 0, true, true, language.GetPhrase("beatrun.convars.disablegrapple"), 0, 1)
local circle = Material("circlesmooth.png", "nocull smooth")
hook.Add("HUDPaint", "grappleicon", function()

View file

@ -17,7 +17,7 @@ end
local function HumanCount()
local count = 0
for k, v in ipairs(player.GetAll()) do
for _, v in ipairs(player.GetAll()) do
if IsValid(v) and not v:GetNW2Bool("Infected") then
count = count + 1
end
@ -376,7 +376,7 @@ if CLIENT then
hook.Add("BeatrunHUDCourse", "InfectionHUDName", InfectionHUDName)
hook.Add("CalcView", "InfectionCalcView", InfectionCalcView)
chat.AddText(chatcolor, "Infection! Touch other players to infect them\n", math.max(math.floor(player.GetCount() / 4), 1) .. " player(s) will become infected in 10s")
chat.AddText(chatcolor, language.GetPhrase("beatrun.infection.start"):format(math.max(math.floor(player.GetCount() / 4), 1), time))
end)
local music = nil
@ -399,12 +399,12 @@ if CLIENT then
survivors = survivors:sub(1, -3)
if survivors == "" then
survivors = "None..."
survivors = "#beatrun.infection.nosurvivors"
LocalPlayer():EmitSound("death.wav")
end
chat.AddText(chatcolor, "The game has ended!\nSurvivors: " .. survivors .. "\nRestarting in 15s")
chat.AddText(chatcolor, language.GetPhrase("beatrun.infection.end"):format(survivors))
end)
if music and music.Stop then
@ -432,9 +432,9 @@ if CLIENT then
if IsValid(attacker) and IsValid(victim) then
if attacker == victim then
chat.AddText(attacker, red, " died!")
chat.AddText(attacker, red, " #beatrun.infection.infected")
else
chat.AddText(attacker, red, " has infected ", yellow, victim, "!")
chat.AddText(attacker, red, " #beatrun.infection.infectedby ", yellow, victim, "!")
end
attacker.InfectionTouchDelay = CurTime() + 3
@ -497,10 +497,10 @@ if CLIENT then
if humanwin then
LocalPlayer():AddXP(200)
chat.AddText(chatcolor, "You were awarded 200 XP for surviving")
chat.AddText(chatcolor, "#beatrun.infection.award")
else
LocalPlayer():AddXP(100)
chat.AddText(chatcolor, "You were awarded 100 XP for spawning as an infected")
chat.AddText(chatcolor, "#beatrun.infection.awardinfected")
end
end)

View file

@ -1,8 +1,8 @@
if CLIENT then
CreateClientConVar("Beatrun_PuristMode", "1", true, true, "Purist mode is a clientside preference that severely weakens the ability to strafe while in the air, which is how Mirror's Edge games handle this.\n0 = No restrictions\n1 = Reduced move speed in the air")
CreateClientConVar("Beatrun_PuristMode", "1", true, true, language.GetPhrase("beatrun.convars.puristmode"))
end
local PuristModeForce = CreateConVar("Beatrun_PuristModeForce", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Force players to adhere to purist rules", 0, 1)
local PuristModeForce = CreateConVar("Beatrun_PuristModeForce", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "", 0, 1)
local function PuristMove(ply, mv, cmd)
if not ply:OnGround() and not ply:GetGrappling() then

View file

@ -1,6 +1,6 @@
if CLIENT then
QuickturnGround = CreateClientConVar("Beatrun_QuickturnGround", "0", true, true, "Enables quickturning with secondary attack while on the ground", 0, 1)
QuickturnHandsOnly = CreateClientConVar("Beatrun_QuickturnHandsOnly", "1", true, true, "Enables quickturning with \"Runner Hands\" only", 0, 1)
QuickturnGround = CreateClientConVar("Beatrun_QuickturnGround", "0", true, true, language.GetPhrase("beatrun.convars.quickturnground"), 0, 1)
QuickturnHandsOnly = CreateClientConVar("Beatrun_QuickturnHandsOnly", "1", true, true, language.GetPhrase("beatrun.convars.quickturnhandsonly"), 0, 1)
end
function DoJumpTurn(lookbehind)

View file

@ -26,6 +26,7 @@ local function SwingbarCheck(ply, mv, cmd)
if math.abs(dot) < 0.7 then return end
if CLIENT then
swingbar:SetPredictable(true)
end
@ -162,7 +163,7 @@ local function SwingbarThink(ply, mv, cmd)
ply:EmitSound("Cloth.VaultSwish")
end
ply:SetMEMoveLimit(350)
ply:SetMEMoveLimit(GetConVar("Beatrun_SpeedLimit"):GetInt())
ply:SetMESprintDelay(-1)
if CLIENT then

View file

@ -45,7 +45,7 @@ net.Receive("SlowSounds", function()
end
end)
concommand.Add("ToggleTimeSlow", function(ply)
concommand.Add("Beatrun_ToggleTimeSlow", function(ply)
slow = not slow
net.Start("SlowSounds")

View file

@ -45,7 +45,7 @@ function meta:SetMantleEndPos(value)
return self:SetDTVector(14, value)
end
local function PlayVaultAnim(ply, legs, ang)
local function PlayVaultAnim(ply, ang)
local activewep = ply:GetActiveWeapon()
if ply:UsingRH() and activewep:GetSequence() == 17 then
@ -140,7 +140,7 @@ local function Vault1(ply, mv, ang, t, h)
ply:SetMantle(1)
ply:SetWallrunTime(0)
PlayVaultAnim(ply)
PlayVaultAnim(ply, ang)
ply:ViewPunch(vpunch1)
ply.MantleInitVel = mv:GetVelocity()
@ -238,7 +238,7 @@ local function Vault2(ply, mv, ang, t, h)
ply:SetMantleData(mv:GetOrigin(), vaultpos, 0, 2)
ply:SetWallrunTime(0)
PlayVaultAnim(ply, 1)
PlayVaultAnim(ply, ang)
ply:ViewPunch(vpunch2)
ply.MantleInitVel = mv:GetVelocity()
@ -338,7 +338,7 @@ local function Vault3(ply, mv, ang, t, h)
ply:SetMantleData(mv:GetOrigin(), vaultpos, 0, 3)
ply:SetWallrunTime(0)
PlayVaultAnim(ply, 2)
PlayVaultAnim(ply, ang)
ply:ViewPunch(vpunch3)
ply.MantleInitVel = mv:GetVelocity()
@ -415,7 +415,7 @@ function Vault4(ply, mv, ang, t, h)
ply:SetMantleData(startpos, vaultpos, 0, 4)
ply:SetWallrunTime(0)
PlayVaultAnim(ply, 1)
PlayVaultAnim(ply, ang)
ply:ViewPunch(Angle(2.5, 0, 0))
ply.MantleInitVel = mv:GetVelocity()
@ -516,7 +516,7 @@ function Vault5(ply, mv, ang, t, h)
ply:SetMantle(5)
ply:SetWallrunTime(0)
PlayVaultAnim(ply, false, ang)
PlayVaultAnim(ply, ang)
ply:ViewPunch(vpunch1)
ply.MantleInitVel = mv:GetVelocity()

View file

@ -1,5 +1,5 @@
util.AddNetworkString("DisarmStart")
local cvardisarm = CreateConVar("Beatrun_Disarm", 1, FCVAR_ARCHIVE, "Whether 'using' NPCs triggers a disarm", 0, 1)
local cvardisarm = CreateConVar("Beatrun_Disarm", 1, FCVAR_ARCHIVE, "", 0, 1)
local function Disarm_Init(ply, victim)
victim:NextThink(CurTime() + 100)

View file

@ -1,7 +1,7 @@
if game.SinglePlayer() then return end
local maxmsgcount = 100
local netIncoming_old = net.Receive
-- local netIncoming_old = net.Incoming
local netIncoming_detour = function(length, ply)
local tickcount = engine.TickCount()

View file

@ -4,7 +4,7 @@ hook.Add("EntityTakeDamage", "MEHitSounds", function(ply, dmginfo)
if not ply:IsPlayer() then return end
if dmginfo:IsBulletDamage() then
--[[Block damage if they're going very fast]]
-- Block damage if they're going very fast
if ply:GetVelocity():Length() > 400 then return true end
ply:EmitSound("mirrorsedge/Flesh_0" .. tostring(math.random(1, 9)) .. ".wav")