mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 21:33:02 +05:00
stupid ass ladder jump off, dont ask me anything, it just works
This commit is contained in:
parent
6cb4fef7ec
commit
28a3f63645
20 changed files with 209 additions and 24 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*.pdb
|
70
BeatrunAnimInstaller/BeatrunAnimInstaller.cs
Normal file
70
BeatrunAnimInstaller/BeatrunAnimInstaller.cs
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace BeatrunAnimInstaller
|
||||||
|
{
|
||||||
|
internal class BeatrunAnimInstaller
|
||||||
|
{
|
||||||
|
private static readonly string inDir = ".";
|
||||||
|
private static readonly string outDir = "gamemodes\\beatrun\\content\\models";
|
||||||
|
private static readonly List<string> choices = new List<string>() { "Old Animations", "New Animations" };
|
||||||
|
|
||||||
|
static void RecursiveCopyDir(string inputDir, string outputDir)
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(inputDir)) return;
|
||||||
|
if (!Directory.Exists(outputDir)) Directory.CreateDirectory(outputDir);
|
||||||
|
|
||||||
|
foreach (string filePath in Directory.GetFiles(inputDir))
|
||||||
|
{
|
||||||
|
string fileName = Path.GetFileName(filePath);
|
||||||
|
File.Copy(filePath, outputDir + Path.DirectorySeparatorChar + fileName, true);
|
||||||
|
Console.WriteLine(string.Format("Copied {0}", filePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (string dirPath in Directory.GetDirectories(inputDir))
|
||||||
|
{
|
||||||
|
string dirName = Path.GetDirectoryName(dirPath);
|
||||||
|
RecursiveCopyDir(dirPath, outputDir + Path.DirectorySeparatorChar + dirName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Select animations to install:");
|
||||||
|
Console.WriteLine("");
|
||||||
|
int i = 1;
|
||||||
|
foreach (string choice in choices)
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Format("{0}. {1}", i, choice));
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
Console.WriteLine("");
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
ConsoleKeyInfo key = Console.ReadKey(true);
|
||||||
|
|
||||||
|
if (key.Key == ConsoleKey.Enter || key.Key == ConsoleKey.Escape) break;
|
||||||
|
|
||||||
|
char keyChar = key.KeyChar;
|
||||||
|
if (char.IsDigit(keyChar))
|
||||||
|
{
|
||||||
|
int index = keyChar - '0';
|
||||||
|
string choice = choices[index - 1];
|
||||||
|
if (choice != null)
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Format("Selected pack: {0}", choice));
|
||||||
|
|
||||||
|
RecursiveCopyDir(inDir + Path.DirectorySeparatorChar + choice, outDir);
|
||||||
|
|
||||||
|
Console.WriteLine("Press any key to exit...");
|
||||||
|
Console.ReadKey(true);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
50
BeatrunAnimInstaller/BeatrunAnimInstaller.csproj
Normal file
50
BeatrunAnimInstaller/BeatrunAnimInstaller.csproj
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{6096D195-BC98-4E67-86F7-CBD21A427405}</ProjectGuid>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>BeatrunAnimInstaller</RootNamespace>
|
||||||
|
<AssemblyName>BeatrunAnimInstaller</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<StartupObject>BeatrunAnimInstaller.BeatrunAnimInstaller</StartupObject>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="BeatrunAnimInstaller.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
25
BeatrunAnimInstaller/BeatrunAnimInstaller.sln
Normal file
25
BeatrunAnimInstaller/BeatrunAnimInstaller.sln
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.6.33829.357
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BeatrunAnimInstaller", "BeatrunAnimInstaller.csproj", "{6096D195-BC98-4E67-86F7-CBD21A427405}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{6096D195-BC98-4E67-86F7-CBD21A427405}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{6096D195-BC98-4E67-86F7-CBD21A427405}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{6096D195-BC98-4E67-86F7-CBD21A427405}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{6096D195-BC98-4E67-86F7-CBD21A427405}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {A9FCE6D1-6D4B-4DFB-91A2-DCC7E79299D8}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
36
BeatrunAnimInstaller/Properties/AssemblyInfo.cs
Normal file
36
BeatrunAnimInstaller/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// Общие сведения об этой сборке предоставляются следующим набором
|
||||||
|
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
|
||||||
|
// связанные с этой сборкой.
|
||||||
|
[assembly: AssemblyTitle("BeatrunAnimInstaller")]
|
||||||
|
[assembly: AssemblyDescription("Beatrun Animations Installer")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("beatrun.ru")]
|
||||||
|
[assembly: AssemblyProduct("BeatrunAnimInstaller")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
|
||||||
|
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
|
||||||
|
// из модели COM задайте для атрибута ComVisible этого типа значение true.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// Следующий GUID представляет идентификатор typelib, если этот проект доступен из модели COM
|
||||||
|
[assembly: Guid("6096d195-bc98-4e67-86f7-cbd21a427405")]
|
||||||
|
|
||||||
|
// Сведения о версии сборки состоят из указанных ниже четырех значений:
|
||||||
|
//
|
||||||
|
// Основной номер версии
|
||||||
|
// Дополнительный номер версии
|
||||||
|
// Номер сборки
|
||||||
|
// Номер редакции
|
||||||
|
//
|
||||||
|
// Можно задать все значения или принять номера сборки и редакции по умолчанию
|
||||||
|
// используя "*", как показано ниже:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
BIN
BeatrunAnimInstaller/bin/Release/BeatrunAnimInstaller.exe
Normal file
BIN
BeatrunAnimInstaller/bin/Release/BeatrunAnimInstaller.exe
Normal file
Binary file not shown.
Binary file not shown.
|
@ -1,20 +0,0 @@
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
files_new = [ file for file in os.listdir("_new") ]
|
|
||||||
files_old = [ file for file in os.listdir("_old") ]
|
|
||||||
i = input("Type \"y\" for new animations or \"n\" for old animations to be installed: ")
|
|
||||||
|
|
||||||
if i == "y":
|
|
||||||
for file in files_new:
|
|
||||||
shutil.copy2("_new/" + file, "gamemodes/beatrun/content/models")
|
|
||||||
print("New animations installed successfully")
|
|
||||||
else:
|
|
||||||
for file in files_old:
|
|
||||||
shutil.copy2("_old/" + file, "gamemodes/beatrun/content/models")
|
|
||||||
print("Old animations installed successfully")
|
|
||||||
|
|
||||||
print("i hate python")
|
|
||||||
|
|
||||||
os.system("pause")
|
|
|
@ -75,8 +75,6 @@ local function LadderCheck(ply, mv, cmd, ladder)
|
||||||
else
|
else
|
||||||
ply:SetLadderDelay(CurTime() + 0.25)
|
ply:SetLadderDelay(CurTime() + 0.25)
|
||||||
end
|
end
|
||||||
|
|
||||||
ply:SetMoveType(MOVETYPE_WALK)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function LadderThink(ply, mv, cmd, ladder)
|
local function LadderThink(ply, mv, cmd, ladder)
|
||||||
|
@ -129,7 +127,7 @@ local function LadderThink(ply, mv, cmd, ladder)
|
||||||
ply:SetLadderDelay(CurTime() + 0.15)
|
ply:SetLadderDelay(CurTime() + 0.15)
|
||||||
ply:SetLadderStartPos(pos)
|
ply:SetLadderStartPos(pos)
|
||||||
|
|
||||||
pos.z = pos.z - (40 + math.min(ply:GetLadderHeight() - 40, 0))
|
pos.z = pos.z - (85 + math.min(ply:GetLadderHeight() - 85, 0))
|
||||||
|
|
||||||
ply:SetLadderEndPos(pos)
|
ply:SetLadderEndPos(pos)
|
||||||
ply:SetLadderLerp(0)
|
ply:SetLadderLerp(0)
|
||||||
|
@ -222,6 +220,31 @@ local function LadderThink(ply, mv, cmd, ladder)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if mv:KeyDown(IN_DUCK) then
|
||||||
|
local ladderangf = ladder:GetAngles():Forward()
|
||||||
|
local newpos = mv:GetOrigin()
|
||||||
|
local facing = {
|
||||||
|
pos = ladderangf.x == 1 and "x" or ladderangf.x == -1 and "x" or ladderangf.y == 1 and "y" or ladderangf.y == -1 and "y",
|
||||||
|
num = ladderangf.x == 1 and 40 or ladderangf.x == -1 and -40 or ladderangf.y == 1 and 40 or ladderangf.y == -1 and -40,
|
||||||
|
}
|
||||||
|
|
||||||
|
newpos[facing.pos] = mv:GetOrigin()[facing.pos] + facing.num
|
||||||
|
|
||||||
|
mv:SetOrigin(newpos)
|
||||||
|
mv:SetVelocity(vector_origin)
|
||||||
|
|
||||||
|
if CLIENT_IFTP() then
|
||||||
|
BodyAnim:SetSequence("jumpfast")
|
||||||
|
elseif game.SinglePlayer() then
|
||||||
|
ply:SendLua("BodyAnim:SetSequence('jumpfast')")
|
||||||
|
end
|
||||||
|
|
||||||
|
ply:SetMoveType(MOVETYPE_WALK)
|
||||||
|
ply:SetLadder(nil)
|
||||||
|
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
mv:SetVelocity(vector_origin)
|
mv:SetVelocity(vector_origin)
|
||||||
mv:SetButtons(0)
|
mv:SetButtons(0)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function LadderSpawnDebug()
|
function SpawnDebugLadder()
|
||||||
local p = Entity(1):GetEyeTrace()
|
local p = Entity(1):GetEyeTrace()
|
||||||
a = ents.Create("br_ladder")
|
a = ents.Create("br_ladder")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue