Add car mechanic simulator mods

This commit is contained in:
2024-05-31 18:26:39 +02:00
parent 6b325ff7db
commit 9e923c4c87
13 changed files with 194 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" 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>{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SevenDaysToDie</RootNamespace>
<AssemblyName>CarMechanicSimulator2021</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>libs\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>libs\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>libs\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="ConfigurationManager">
<HintPath>libs\ConfigurationManager.dll</HintPath>
</Reference>
<Reference Include="MelonLoader">
<HintPath>libs\MelonLoader.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="XPPatch.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,16 @@
using HarmonyLib.Tools;
using MelonLoader;
namespace CarMechanicSimulator2021 {
[assembly: MelonInfo(typeof(Main), "CykaMod", "1", "Cyka")]
public class Main : MelonMod {
private const string pluginGuid = "CykaMod";
public void OnInitializeMelon() {
HarmonyFileLog.Enabled = true;
HarmonyLib.Harmony harmony = new HarmonyLib.Harmony(pluginGuid);
harmony.PatchAll();
}
}
}

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CarMechanicSimulator2021")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CarMechanicSimulator2021")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,29 @@
using HarmonyLib;
namespace CarMechanicSimulator2021 {
[HarmonyPatch]
public class Patches {
[HarmonyPrefix]
[HarmonyPatch(typeof(GlobalData), "AddPlayerExp")]
static void xpMulti(ref float exp) {
exp *= 10;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(MountObject), "Action")]
static void mountSpeedMulti(MountObject __instance) {
float num = 3f;
float num2 = 1.5f;
float num3 = num2 * num;
bool flag = !__instance.reverseMode;
if (flag)
{
__instance.mountState -= Time.deltaTime * num3 * Mathf.Abs(Mathf.Sin(Time.time * 10f));
}
else
{
__instance.mountState += Time.deltaTime * num3 * Mathf.Abs(Mathf.Sin(Time.time * 10f));
}
}
}
}