Skip to content

Commit

Permalink
Add files
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaPiggy committed Dec 24, 2021
1 parent 4de70c9 commit efa4458
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 0 deletions.
54 changes: 54 additions & 0 deletions EntryPoint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using HarmonyLib;
using SALT;
using SALT.Extensions;
using SALT.Registries;
using SALT.Config;
using SALT.Console;
using SALT.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEngine;

namespace OhFuck
{
public class EntryPoint : ModEntryPoint
{
/// <summary>THE EXECUTING ASSEMBLY</summary>
public static Assembly execAssembly;

public static AssetBundle bundle;

public override void PreLoad()
{
// Gets the Assembly being executed
execAssembly = Assembly.GetExecutingAssembly();
HarmonyInstance.PatchAll(execAssembly);
bundle = LoadAssetbundle("ohfuck");
}

public override void Load()
{
CharacterPack ame = CharacterRegistry.GetCharacter(Character.AMELIA).GetComponent<CharacterPack>();
CharacterPack ame_mous = CharacterRegistry.GetCharacter(Character.AMELIA_MOUSTACHE).GetComponent<CharacterPack>();

var clone = ame.deathSounds.ToList();

AudioClip oh_fuck = bundle.LoadAsset<AudioClip>("oh_fuck");
clone.Add(oh_fuck);

ame.deathSounds = clone;
ame_mous.deathSounds = clone;
}

public static AssetBundle LoadAssetbundle(string name)
{
Stream stream = execAssembly.GetManifestResourceStream(typeof(EntryPoint), name);
if (stream == null)
throw new Exception("AssetBundle " + name + " was not found");
return AssetBundle.LoadFromStream(stream);
}
}
}
81 changes: 81 additions & 0 deletions OhFuck.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?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>{1E61CDE4-F177-4C41-870F-3550BB16C9BA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OhFuck</RootNamespace>
<AssemblyName>OhFuck</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<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' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Shared\SmolAme_v210831.1\SALT\Libs\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\Shared\SmolAme_v210831.1\Smol Ame_Data\Managed\publicized_assemblies\Assembly-CSharp_publicized.dll</HintPath>
</Reference>
<Reference Include="SALT">
<HintPath>..\..\..\Shared\SmolAme_v210831.1\Smol Ame_Data\Managed\SALT.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Unity.TextMeshPro, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Shared\SmolAme_v210831.1\Smol Ame_Data\Managed\Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AssetBundleModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Shared\SmolAme_v210831.1\Smol Ame_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Shared\SmolAme_v210831.1\Smol Ame_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Shared\SmolAme_v210831.1\Smol Ame_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="EntryPoint.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="modinfo.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ohfuck" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
25 changes: 25 additions & 0 deletions OhFuck.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OhFuck", "OhFuck.csproj", "{1E61CDE4-F177-4C41-870F-3550BB16C9BA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1E61CDE4-F177-4C41-870F-3550BB16C9BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E61CDE4-F177-4C41-870F-3550BB16C9BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E61CDE4-F177-4C41-870F-3550BB16C9BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E61CDE4-F177-4C41-870F-3550BB16C9BA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6A6CACA0-4801-408A-8CA4-469675131A7B}
EndGlobalSection
EndGlobal
36 changes: 36 additions & 0 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
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("OhFuck")]
[assembly: AssemblyDescription("Mod for Smol Ame using SALT.\nAdds an \"oh fuck\" death sound to amelia.")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCompany("MegaPiggy")]
[assembly: AssemblyProduct("Oh Fuck")]
[assembly: AssemblyCopyright("Copyright © MegaPiggy 2021")]
[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("1e61cde4-f177-4c41-870f-3550bb16c9ba")]

// 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")]
10 changes: 10 additions & 0 deletions modinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "ohfuck",
"name": "Oh Fuck",
"author": "MegaPiggy",
"description": "Adds an \"oh fuck\" death sound to amelia.",
"version": "1.0",
"load_before": [
"beeg_ame"
]
}
Binary file added ohfuck
Binary file not shown.

0 comments on commit efa4458

Please sign in to comment.