Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
BG-Music committed Jul 5, 2021
1 parent 96959c8 commit dba8d14
Show file tree
Hide file tree
Showing 13 changed files with 340 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Airship Source Code v9.3.0/Airship.sln
@@ -0,0 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31205.134
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Airship", "Airship\Airship.csproj", "{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D4B18E03-E16D-4C41-8753-70CAD2611B11}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {371E59C1-0EFD-448D-8D7A-3AC7CAB3482C}
EndGlobalSection
EndGlobal
37 changes: 37 additions & 0 deletions Airship Source Code v9.3.0/Airship/Airship.cs
@@ -0,0 +1,37 @@
using BepInEx;
using BepInEx.IL2CPP;
using HarmonyLib;
using BepInEx.Logging;
using Reactor;
using Reactor.Patches;

namespace Airship
{
[BepInPlugin(Id)]
[BepInProcess("Among Us.exe")]
[BepInDependency(ReactorPlugin.Id)]
public class Airship : BasePlugin
{
public const string Id = "boss.gamer.yt";

public Harmony Harmony { get; } = new Harmony(Id);
public static ManualLogSource log;


public override void Load()
{
log = Log;

log.LogMessage("Better Airship Mod loaded");

ReactorVersionShower.TextUpdated += (text) =>
{
int index = text.text.LastIndexOf('\n');
text.text = text.text.Insert(index == -1 ? text.text.Length - 1 : index,
"\n \n \n \n \n \n \nBetter Airship by Boss_GamerYT & DaNoob \nyoutube.com/BossGamerYTShorts \n<color=#2cdb12>Version: 9.3.0</color> <color=#2cdb12>Stable</color> \n<color=#2294E6FF>Thanks for installing BetterAirship!</color>");
};

Harmony.PatchAll();
}
}
}
29 changes: 29 additions & 0 deletions Airship Source Code v9.3.0/Airship/Airship.csproj
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Version>9.2.9</Version>
<GameVersion>2021.6.15s</GameVersion>
<Description>BetterAirship</Description>
<Authors>BossGamerYT</Authors>
</PropertyGroup>

<Target Name="Copy" AfterTargets="Build">
<Copy SourceFiles="$(OutputPath)$(AssemblyName).dll" DestinationFiles="$(AmongUs)/BepInEx/plugins/BetterAirship MOD.dll" />
</Target>


<ItemGroup>
<Reference Include="$(AmongUs)\BepInEx\core\*.dll">
<Private>false</Private>
</Reference>
<Reference Include="$(AmongUs)\BepInEx\unhollowed\*.dll">
<Private>false</Private>
</Reference>
<Reference Remove="$(AmongUs)\BepInEx\unhollowed\netstandard.dll;$(AmongUs)\BepInEx\unhollowed\Newtonsoft.Json.dll" />
<None Include="..\.editorconfig" Link=".editorconfig" />

<Reference Include="$(AmongUs)\BepInEx\plugins\Reactor-$(GameVersion).dll" />

<EmbeddedResource Include="Resources\Hats\*.png" />
</ItemGroup>
</Project>
62 changes: 62 additions & 0 deletions Airship Source Code v9.3.0/Airship/HatManager/CustomHatManager.cs
@@ -0,0 +1,62 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using UnhollowerBaseLib;
using UnityEngine;
using BepInEx;
using BepInEx.IL2CPP;
using Reactor.Extensions;
using Reactor.Unstrip;

namespace Airship
{
class CustomHatManager
{

public static HatBehaviour CreateHat(string hat)
{
HatBehaviour newHat = new HatBehaviour();
Texture2D tex = GUIExtensions.CreateEmptyTexture(2, 2);
Assembly assembly = Assembly.GetExecutingAssembly();
Stream myStream = assembly.GetManifestResourceStream("Airship.Resources.Hats."+ hat);
byte[] buttonTexture = Reactor.Extensions.Extensions.ReadFully(myStream);
ImageConversion.LoadImage(tex, buttonTexture, false);
newHat.MainImage = Sprite.Create(
tex,
new Rect(0, 0, tex.width, tex.height),
new Vector2(0.5f, 0.8f),
225f
);
newHat.ProductId = $"+{hat}";
newHat.InFront = true;
newHat.NoBounce = true;
return newHat;
}
}

[HarmonyPatch(typeof(HatManager), nameof(HatManager.GetHatById))]
public static class HatManagerPatch
{
private static bool modded = false;
public static void Prefix(HatManager __instance)
{
if(!modded)
{
modded = true;
var hats = new List<string>();
string[] fileEntries = Assembly.GetExecutingAssembly().GetManifestResourceNames();
foreach (string file in fileEntries)
if (file.StartsWith("Airship.Resources.Hats.") && file.EndsWith(".png"))
hats.Add(file.Split("Airship.Resources.Hats.")[1]);
foreach (string hat in hats)
__instance.AllHats.Add(CustomHatManager.CreateHat(hat));
__instance.AllHats.Sort((Il2CppSystem.Comparison<HatBehaviour>) ((h1, h2) => h2.ProductId.CompareTo(h1.ProductId)));
}
}
}
}
129 changes: 129 additions & 0 deletions Airship Source Code v9.3.0/Airship/Patch/Colors.cs
@@ -0,0 +1,129 @@
using BepInEx;
using BepInEx.IL2CPP;
using HarmonyLib;
using InnerNet;
using UnhollowerBaseLib;
using UnityEngine;

namespace Airship.Colors
{
[BepInPlugin("en.bossgamer.excolors", "ExtraColors", "1.3")]
public class ExtraColors : BasePlugin {
public override void Load() {
var array = new[] {
StringNames.VitalsRED,
StringNames.VitalsBLUE,
StringNames.VitalsGRN,
StringNames.VitalsPINK,
StringNames.VitalsORGN,
StringNames.VitalsYLOW,
StringNames.VitalsBLAK,
StringNames.VitalsWHTE,
StringNames.VitalsPURP,
StringNames.VitalsBRWN,
StringNames.VitalsCYAN,
StringNames.VitalsLIME,
(StringNames)999991,
(StringNames)999992,
(StringNames)999993,
(StringNames)999994,
(StringNames)999995,
(StringNames)999996,
(StringNames)999997,
(StringNames)999998,
(StringNames)999999,
(StringNames)1000000,
};
Color32[] array2 = new Color32[] {
new Color32(198, 17, 17, byte.MaxValue),
new Color32(19, 46, 210, byte.MaxValue),
new Color32(27, 145, 62, byte.MaxValue),
new Color32(238, 84, 187, byte.MaxValue),
new Color32(240, 125, 13, byte.MaxValue),
new Color32(246, 246, 87, byte.MaxValue),
new Color32(63, 71, 78, byte.MaxValue),
new Color32(215, 225, 241, byte.MaxValue),
new Color32(107, 47, 188, byte.MaxValue),
new Color32(113, 73, 30, byte.MaxValue),
new Color32(56, byte.MaxValue, 221, byte.MaxValue),
new Color32(80, 240, 57, byte.MaxValue),
new Color32(108, 43, 61, byte.MaxValue),
new Color32(255, 255, 190, byte.MaxValue),
new Color32(131, 151, 167, byte.MaxValue),
new Color32(159, 153, 137, byte.MaxValue),
new Color32(236, 117, 120, byte.MaxValue),
new Color32(97, 114, 24, byte.MaxValue),
new Color32(38, 166, 98, byte.MaxValue),
new Color32(0, 0, 255, byte.MaxValue),
new Color32(255, 0, 0, byte.MaxValue)
};
Color32[] array3 = new Color32[] {
new Color32(122, 8, 56, byte.MaxValue),
new Color32(9, 21, 142, byte.MaxValue),
new Color32(10, 77, 46, byte.MaxValue),
new Color32(172, 43, 174, byte.MaxValue),
new Color32(180, 62, 21, byte.MaxValue),
new Color32(195, 136, 34, byte.MaxValue),
new Color32(30, 31, 38, byte.MaxValue),
new Color32(132, 149, 192, byte.MaxValue),
new Color32(59, 23, 124, byte.MaxValue),
new Color32(94, 38, 21, byte.MaxValue),
new Color32(36, 169, 191, byte.MaxValue),
new Color32(21, 168, 66, byte.MaxValue),
new Color32(108, 43, 61, byte.MaxValue),
new Color32(255, 255, 190, byte.MaxValue),
new Color32(131, 151, 167, byte.MaxValue),
new Color32(159, 153, 137, byte.MaxValue),
new Color32(236, 117, 120, byte.MaxValue),
new Color32(97, 114, 24, byte.MaxValue),
new Color32(38, 166, 98, byte.MaxValue),
new Color32(255, 0, 0, byte.MaxValue),
new Color32(0, 0, 255, byte.MaxValue)
};

Palette.ColorNames = array;
Palette.PlayerColors = array2;
Palette.ShadowColors = array3;
}
};

[HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString),
new[] { typeof(StringNames), typeof(Il2CppReferenceArray<Il2CppSystem.Object>) })]
public class PatchColours {
public static bool Prefix(ref string __result, [HarmonyArgument(0)] StringNames name) {
switch ((int)name) {
case 999991:
__result = "MAROON";
return false;
case 999992:
__result = "ROSE";
return false;
case 999993:
__result = "BANANA";
return false;
case 999994:
__result = "GRAY";
return false;
case 999995:
__result = "TAN";
return false;
case 999996:
__result = "CORAL";
return false;
case 999997:
__result = "FGREEN";
return false;
case 999998:
__result = "OLIVE";
return false;
case 999999:
__result = "ABASE";
return false;
case 1000000:
__result = "BBASE";
return false;
}
return true;
}
}
}
23 changes: 23 additions & 0 deletions Airship Source Code v9.3.0/Airship/Patch/UnlockAllHats.cs
@@ -0,0 +1,23 @@
using System.Linq;
using HarmonyLib;
using UnhollowerBaseLib;

namespace Airship.Patch
{
[HarmonyPatch(typeof(HatManager), nameof(HatManager.GetUnlockedHats))]
public class UnlockHats
{
public static bool Prefix(HatManager __instance, ref Il2CppReferenceArray<HatBehaviour> __result)
{
var array = (
from h in __instance.AllHats.ToArray()
where !HatManager.IsMapStuff(h.ProdId) || SaveManager.GetPurchase(h.ProductId)
select h
into o
orderby o.Order descending, o.name
select o).ToArray();
__result = array;
return false;
}
}
}
25 changes: 25 additions & 0 deletions Airship Source Code v9.3.0/Airship/Patch/pingtrackerupdate.cs
@@ -0,0 +1,25 @@
using HarmonyLib;
using InnerNet;
using UnityEngine;

namespace BetterAirship.Patch {

[HarmonyPatch(typeof(PingTracker), nameof(PingTracker.Update))]
[HarmonyPriority(Priority.First)]
public static class PingTrackerPatch {
private static Vector3 lastDist = Vector3.zero;

public static void Postfix(ref PingTracker __instance) {
if (!(AmongUsClient.Instance.GameState == InnerNetClient.GameStates.Started)) {
AspectPosition aspect = __instance.text.gameObject.GetComponent<AspectPosition>();
if (aspect.DistanceFromEdge != lastDist) {
aspect.DistanceFromEdge += new Vector3(0.6f, 0);
aspect.AdjustPosition();

lastDist = aspect.DistanceFromEdge;
}
__instance.text.text += $"\n<color=#2294E6FF>BetterAirship by Boss_GamerYT#0001</color> \nThanks for downloading!";
}
}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,3 @@
Images can only be 300 x 375

Check the Hat Templates folder for a template
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Airship Source Code v9.3.0/build.cmd
@@ -0,0 +1,2 @@
dotnet build
pause

0 comments on commit dba8d14

Please sign in to comment.