Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit f5f811b

Browse files
committed
E
1 parent 58fe235 commit f5f811b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+334
-183
lines changed

Docs/Dev.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@
88
>
99
> ***资源请勿用于任何商业用途***
1010
>
11-
> ***本模组任何图片音频等资源如有侵权请联系***
11+
> ***本模组任何图片音频等资源如有侵权请联系***
12+
13+
我希望使用的人能遵守开源协议, 而不是像AllTheRole模组一样使用其他模组的代码,但不遵循GPLv3协议进行开源
14+
15+
## 开发计划
16+
将根据情况开发模组
17+
本模组将遵守模组协议不会添加解锁原版皮肤等任何黑客行为

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ Among Us Mod
2424

2525
# 代码仓库
2626
## 全球
27-
* GitHub:https://github.com/Huier-Huang/TheOtherUs
27+
* GitHub:https://github.com/TianMengLucky/TheOtherUs
28+
* GitLab:https://gitlab.com/Huier-Huang/TheOtherUs
2829
## 中国
2930
* Gitee:https://gitee.com/bilibili_MC/TheOtherUs
3031
* GitCode:https://gitcode.com/Huier-Huang/TheOtherUs

TheOtherUs/Buttons.cs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
using TheOtherUs.Modules.Compatibility;
77
using TheOtherUs.Objects;
88
using TheOtherUs.Patches;
9+
using TheOtherUs.Roles.Crewmates;
10+
using TheOtherUs.Roles.Impostors;
911
using TMPro;
1012
using UnityEngine;
1113
using Object = UnityEngine.Object;

TheOtherUs/Chat/CommandEvent.cs

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using System.Net;
3+
4+
namespace TheOtherUs.Chat;
5+
6+
public class CommandEvent
7+
{
8+
public string[] Command { get; init; }
9+
public Action<CommandInfo> Event { get; set; }
10+
public CommandPermissions permission { get; set; }
11+
12+
public CommandEvent RegisterEvent(Action<CommandInfo> e)
13+
{
14+
Event += e;
15+
return this;
16+
}
17+
18+
public void Start(string text)
19+
{
20+
21+
}
22+
}
23+
24+
[Flags]
25+
public enum CommandPermissions
26+
{
27+
All,
28+
Host,
29+
Player,
30+
Lobby,
31+
OnGame,
32+
Debug
33+
}
34+
35+
public record CommandInfo();

TheOtherUs/CustomGameMode/GuesserGM.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace TheOtherUs.CustomGameMode;
55

66
internal class GuesserGM : CustomModeBase
77
{
8-
// Guesser Gamemode
8+
/*// Guesser Gamemode
99
public static List<GuesserGM> guessers = [];
1010
public static Color color = new Color32(255, 255, 0, byte.MaxValue);
1111
@@ -44,5 +44,5 @@ public static void clearAndReload()
4444
public static bool isGuesser(byte playerId)
4545
{
4646
return guessers.FindAll(x => x.guesser.PlayerId == playerId).Count > 0;
47-
}
47+
}*/
4848
}

TheOtherUs/CustomGameMode/HideNSeekGM.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace TheOtherUs.CustomGameMode;
99

10-
public class HideNSeek : CustomModeBase
10+
/*public class HideNSeek : CustomModeBase
1111
{
1212
// HideNSeek Gamemode
1313
public static bool isHideNSeekGM;
@@ -150,4 +150,4 @@ public static void clearAndReload()
150150
shieldDuration = CustomOptionHolder.huntedShieldDuration.getFloat();
151151
shieldRewindTime = CustomOptionHolder.huntedShieldRewindTime.getFloat();
152152
}
153-
}
153+
}*/

TheOtherUs/CustomGameMode/PropHunt.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace TheOtherUs.CustomGameMode;
1515

16-
[HarmonyPatch]
16+
/*[HarmonyPatch]
1717
internal class PropHunt : CustomModeBase
1818
{
1919
public static bool isPropHuntGM;
@@ -740,4 +740,4 @@ public static bool DisableFunctions()
740740
{
741741
return !isPropHuntGM;
742742
}
743-
}
743+
}*/

TheOtherUs/CustomOptionHolder.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System.Collections.Generic;
22
using TheOtherUs.Options;
3+
using TheOtherUs.Roles.Crewmates;
4+
using TheOtherUs.Roles.Impostors;
35
using UnityEngine;
46

57
namespace TheOtherUs;

TheOtherUs/GlobalUsing.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
global using TheOtherUs.Helper;
99
global using TheOtherUs.Utilities;
1010
global using TheOtherUs.Roles;
11-
global using TheOtherUs.Roles.Crewmate;
12-
global using TheOtherUs.Roles.Impostor;
1311
global using TheOtherUs.Roles.Neutral;
1412
global using TheOtherUs.Roles.Modifier;
1513
global using TheOtherUs.Roles.Assigns;
14+
global using TheOtherUs.Roles.Impostors;
15+
global using TheOtherUs.Roles.Crewmates;
1616
global using TheOtherUs.Modules;
1717
global using static TheOtherUs.Helper.RoleHelper;
18-
global using static TheOtherUs.Roles.CustomRoleManager;
1918
global using static TheOtherUs.Languages.LanguageExtension;
2019
global using static TheOtherUs.Helper.LogHelper;
2120
global using Main = TheOtherUs.TheOtherRolesPlugin;

TheOtherUs/Helper/ButtonHelper.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using TheOtherUs.Objects;
22
using TheOtherUs.Patches;
3+
using TheOtherUs.Roles.Impostors;
34
using UnityEngine;
45

56
namespace TheOtherUs.Helper;

TheOtherUs/Helper/DownloadHelper.cs

+46-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,52 @@ public static CodeRepo GetFastRepo()
8787
}
8888
}
8989

90-
public interface IRepoGet : IDisposable;
90+
public interface IGet : IDisposable;
9191

92-
public class GithubGet(string RepoOwner, string RepoName) : IRepoGet
92+
public class NugetGet : IGet
93+
{
94+
public string NugetURL { get; set; }
95+
96+
public List<IGet> Packages { get; set; } = [];
97+
98+
public static NugetGet CreateNewGet(string url)
99+
{
100+
return new NugetGet
101+
{
102+
NugetURL = url
103+
};
104+
}
105+
106+
public NugetGet AddPackage()
107+
{
108+
Packages.Add(new PackageGet()
109+
{
110+
111+
});
112+
return this;
113+
}
114+
115+
public class PackageGet : IGet
116+
{
117+
public string Id { get; set; }
118+
public string Name { get; set; }
119+
public string Framework { get; set; }
120+
public string Author { get; set; }
121+
public Version Version { get; set; }
122+
123+
public void Dispose()
124+
{
125+
126+
}
127+
128+
}
129+
130+
public void Dispose()
131+
{
132+
}
133+
}
134+
135+
public class GithubGet(string RepoOwner, string RepoName) : IGet
93136
{
94137
public const string Api = "https://api.github.com";
95138
public const string Web = "https://github.com";
@@ -249,7 +292,7 @@ public void Dispose()
249292
}
250293
}
251294

252-
public interface IGithubGet : IDisposable
295+
public interface IGithubGet : IGet
253296
{
254297
public GithubGet Github { get; }
255298
}

TheOtherUs/Helper/Helpers.cs

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
using TheOtherUs.Modules.Compatibility;
1313
using TheOtherUs.Objects;
1414
using TheOtherUs.Patches;
15+
using TheOtherUs.Roles.Crewmates;
16+
using TheOtherUs.Roles.Impostors;
1517
using UnityEngine;
1618

1719
namespace TheOtherUs.Helper;

TheOtherUs/Languages/LanguageManager.cs

+28-1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@ internal string GetString(string Key, bool tag = true)
137137
Info($"获取失败 Key{Key} Language{CurrentLang}");
138138
return tag ? $"'{Key}'" : Key;
139139
}
140+
141+
internal readonly List<TranslateNode> _translateNodes = [];
142+
}
143+
144+
public class TranslateNode(string id, string[]? values = null, TranslateNode[]? nodes = null)
145+
{
146+
public string Id { get; set; } = id;
147+
public string[]? Values { get; set; } = values;
148+
public TranslateNode[]? _nodes { get; set; } = nodes;
149+
150+
public string Def => Values?[0] ?? string.Empty;
140151
}
141152

142153
[Harmony]
@@ -147,7 +158,7 @@ internal static class LanguageExtension
147158
private static void OnTranslationController_Initialized_Load(TranslationController __instance)
148159
{
149160
LanguageManager.Instance.CurrentLang = __instance.currentLanguage.languageID;
150-
TheOtherRolesPlugin.OnTranslationController_Initialized_Load();
161+
Main.OnTranslationController_Initialized_Load();
151162
}
152163

153164
[HarmonyPatch(typeof(TranslationController), nameof(TranslationController.SetLanguage))]
@@ -161,4 +172,20 @@ internal static string Translate(this string key)
161172
{
162173
return LanguageManager.Instance.GetString(key);
163174
}
175+
internal static string Get(params string[] strings)
176+
{
177+
TranslateNode? node = null;
178+
var count = 1;
179+
foreach (var str in strings)
180+
{
181+
node = count == 1 ? LanguageManager.Instance._translateNodes.FirstOrDefault(n => n.Id == str) : node?._nodes.FirstOrDefault(n => n.Id == str);
182+
183+
if (node == null)
184+
return string.Empty;
185+
186+
count++;
187+
}
188+
189+
return node?.Def ?? string.Empty;
190+
}
164191
}

TheOtherUs/MapOptions.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using TheOtherUs.Roles.Crewmates;
23
using UnityEngine;
34

45
namespace TheOtherUs;

0 commit comments

Comments
 (0)