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

Commit b4b7653

Browse files
committed
1043
1 parent 48f9951 commit b4b7653

25 files changed

Lines changed: 587 additions & 46 deletions

Nebula/Module/AssetLoader.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Nebula.Tasks;
1+
using Nebula.Roles.NeutralRoles;
2+
using Nebula.Tasks;
23
using System.Reflection;
34
using UnityEngine;
45

@@ -43,6 +44,9 @@ public static class AssetLoader
4344

4445
public static AudioClip Paparazzo;
4546

47+
public static AudioClip PuppeteerLaugh;
48+
public static AudioClip Uskneko;
49+
4650
public static GameObject SkeldDivMap;
4751
public static GameObject MIRADivMap;
4852
public static GameObject PolusDivMap;
@@ -95,6 +99,9 @@ static public void Load()
9599
MetaObjectPrefab = assetBundleBundle.LoadAsset<GameObject>("MetaObjectPrefab").DontUnload();
96100

97101
Paparazzo = assetBundleBundle.LoadAsset<AudioClip>("Camera").DontUnload();
102+
103+
PuppeteerLaugh = AssetBundle.LoadFromMemory(assembly.GetManifestResourceStream("Nebula.Resources.Assets.audiobundle").ReadFully()).LoadAsset<AudioClip>("PuppeteerLaugh.mp3").DontUnload();
104+
Uskneko = AssetBundle.LoadFromMemory(assembly.GetManifestResourceStream("Nebula.Resources.Assets.haomingassets").ReadFully()).LoadAsset<AudioClip>("Uskneko.mp3").DontUnload();
98105
}
99106

100107
public static Sprite GetMapSprite(byte mapId,Vector2 size,Int32 mask)
@@ -223,6 +230,11 @@ public static AudioClip GetAudioClip(Module.AudioAsset id)
223230

224231
case AudioAsset.Paparazzo:
225232
return Paparazzo;
233+
234+
case AudioAsset.PuppeteerLaugh:
235+
return PuppeteerLaugh;
236+
case AudioAsset.Uskneko:
237+
return Uskneko;
226238
}
227239

228240
return null;
@@ -245,6 +257,8 @@ public enum AudioAsset
245257
SpectreStatueCrush0,
246258
SpectreStatueCrush1,
247259
SpectreStatueBroken,
248-
Paparazzo
260+
Paparazzo,
261+
PuppeteerLaugh,
262+
Uskneko,
249263

250264
}

Nebula/Nebula.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ public class NebulaPlugin : BasePlugin
4343
public const string AmongUsVersion = "2023.3.28";
4444
public const string PluginGuid = "cn.zsfabtest.amongus.nebular";
4545
public const string PluginName = "TheNebula-R-LTS";
46-
public const string PluginVersion = "1.0.4.0";
46+
public const string PluginVersion = "1.0.4.3";
4747
public const bool IsSnapshot = true;
4848

49-
public static string PluginVisualVersion = (IsSnapshot ? "23.08.14-" : "") + PluginVersion;
49+
public static string PluginVisualVersion = (IsSnapshot ? "23.08.17-" : "") + PluginVersion;
5050
public static string PluginStage = IsSnapshot ? "Snapshot" : "";
5151

52-
public const string PluginVersionForFetch = "1.0.4.0";
53-
public byte[] PluginVersionData = new byte[] { 1, 0, 4, 0 };
52+
public const string PluginVersionForFetch = "1.0.4.3";
53+
public byte[] PluginVersionData = new byte[] { 1, 0, 4, 3 };
5454

5555
public static NebulaPlugin Instance;
5656

Nebula/NebulaPlugin.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
<EmbeddedResource Include="Resources\Help.dat" />
4040
<EmbeddedResource Include="Resources\Shaders\*.shader" />
4141
<EmbeddedResource Include="Resources\Assets\nebula_asset" />
42+
<EmbeddedResource Include="Resources\Assets\audiobundle" />
43+
<EmbeddedResource Include="Resources\Assets\haomingassets" />
4244
</ItemGroup>
4345

4446
<ItemGroup>

Nebula/Objects/ObjectTypes/Bomb.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Nebula.Objects.ObjectTypes;
2+
3+
public class Bomb : TypeWithImage
4+
{
5+
public Bomb() : base(114, "Bomb", new SpriteLoader("Nebula.Resources.BombEffect.png",165f))
6+
{
7+
}
8+
9+
public override bool RequireMonoBehaviour => true;
10+
11+
public override bool CanSeeInShadow(CustomObject? obj) { return true; }
12+
13+
public override void OnMeetingEnd(CustomObject obj){
14+
RPCEvents.ObjectDestroy(obj.Id);
15+
}
16+
}

Nebula/Patches/CredentialsPatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static void Postfix(MainMenuManager __instance)
112112
buttonObj.GetComponent<SpriteRenderer>().sprite = DesignerToolButtonSprite.GetSprite();
113113
var button = buttonObj.GetComponent<PassiveButton>();
114114
button.OnClick = new UnityEngine.UI.Button.ButtonClickedEvent();
115-
button.OnClick.AddListener((UnityAction)(() => { NebulaPlugin.isFoolDay = !NebulaPlugin.isFoolDay; }));
115+
button.OnClick.AddListener((UnityAction)(() => { NebulaPlugin.isFoolDay = !NebulaPlugin.isFoolDay; SoundPlayer.PlaySound(AudioAsset.Uskneko); }));
116116

117117
bottomButtons.GetComponent<DotAligner>().Start();
118118
}

Nebula/Patches/EndGamePatch.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class EndCondition
4646
public static EndCondition ChallengerWin = new EndCondition(135,Roles.NeutralRoles.Challenger.RoleColor,"challenger",1,Module.CustomGameMode.Standard);
4747
public static EndCondition OracleWin = new EndCondition(136,Roles.NeutralRoles.Oracle.RoleColor,"oracle",1,Module.CustomGameMode.Standard);
4848
public static EndCondition GhostWin = new EndCondition(137,new(1f,1f,1f),"ghost",1,Module.CustomGameMode.Standard);
49+
public static EndCondition PuppeteerWin = new EndCondition(138,Roles.NeutralRoles.Puppeteer.RoleColor,"puppeteer",1,Module.CustomGameMode.Standard);
4950

5051

5152
public static HashSet<EndCondition> AllEnds = new HashSet<EndCondition>() {
@@ -55,7 +56,7 @@ public class EndCondition
5556
JesterWin,JackalWin,ArsonistWin,EmpiricWin,PaparazzoWin,VultureWin,SpectreWin,SantaWin,
5657
LoversWin,TrilemmaWin,AvengerWin,
5758
NoGame,NobodyWin,NobodySkeldWin,NobodyMiraWin,NobodyPolusWin,NobodyAirshipWin,
58-
PavlovWin,MoriartyWin,MoriartyWinByKillHolmes,CascrubinterWin,GuesserWin,YandereWin,WerewolfWin,ChallengerWin,OracleWin,GhostWin
59+
PavlovWin,MoriartyWin,MoriartyWinByKillHolmes,CascrubinterWin,GuesserWin,YandereWin,WerewolfWin,ChallengerWin,OracleWin,GhostWin,PuppeteerWin
5960
};
6061

6162
public static EndCondition GetEndCondition(GameOverReason gameOverReason)
@@ -740,6 +741,8 @@ public class PlayerStatistics
740741
public int AliveOracleWithSidekick;
741742
public int AliveInLoveOracleWithSidekick;
742743

744+
public int AlivePuppeteer;
745+
743746
public int AliveZombieSidekick;
744747

745748
public bool IsValid;
@@ -809,6 +812,7 @@ public PlayerStatistics(ShipStatus __instance)
809812
AliveInLoveOracleWithSidekick = 0;
810813

811814
AliveZombieSidekick = 0;
815+
AlivePuppeteer = 0;
812816

813817

814818
Roles.Side side;
@@ -1061,6 +1065,8 @@ public PlayerStatistics(ShipStatus __instance)
10611065

10621066
if(data.role == Roles.Roles.ZombieSidekick) AliveZombieSidekick++;
10631067

1068+
if(data.role == Roles.Roles.Puppeteer) AlivePuppeteer++;
1069+
10641070
IsValid = true;
10651071
}
10661072
catch(Exception e)

Nebula/Patches/ExileControllPatch.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ static void Postfix(ref string __result, [HarmonyArgument(0)] StringNames id)
236236
player.GetModData().role.side == Roles.Side.Jester ||
237237
player.GetModData().role.side == Roles.Side.Challenger ||
238238
player.GetModData().role.side == Roles.Side.Oracle ||
239-
player.GetModData().role.side == Roles.Side.SantaClaus
239+
player.GetModData().role.side == Roles.Side.SantaClaus ||
240+
player.GetModData().role.side == Roles.Side.Ghost
240241
)) sums--;
241242
//__result.Remove('.');
242243
//__result.Remove('。');
@@ -300,7 +301,8 @@ static void Postfix(ref string __result, [HarmonyArgument(0)] StringNames id)
300301
p.GetModData().role.side == Roles.Side.Jester ||
301302
p.GetModData().role.side == Roles.Side.Challenger ||
302303
p.GetModData().role.side == Roles.Side.Oracle ||
303-
p.GetModData().role.side == Roles.Side.SantaClaus
304+
p.GetModData().role.side == Roles.Side.SantaClaus ||
305+
p.GetModData().role.side == Roles.Side.Ghost
304306
)) sums++;
305307
//Debug.LogWarning(string.Format("ExileControllPatch - {0} : {1}", p.name, p.GetModData().role.LocalizeName));
306308
}

Nebula/Patches/GameStartManagerPatch.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ public static bool Prefix(GameStartManager __instance)
237237
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.ResetVaribles, Hazel.SendOption.Reliable, -1);
238238
AmongUsClient.Instance.FinishRpcImmediately(writer);
239239
RPCEvents.ResetVaribles();
240-
241-
if (PlayerControl.AllPlayerControls.Count > (Game.GameModeProperty.GetProperty(CustomOptionHolder.GetCustomGameMode()).MaxPlayers ?? 15)) continueStart = false;
240+
//if (PlayerControl.AllPlayerControls.Count > (Game.GameModeProperty.GetProperty(CustomOptionHolder.GetCustomGameMode()).MaxPlayers ?? 15)) continueStart = false;
242241

243242
foreach (InnerNet.ClientData client in AmongUsClient.Instance.allClients)
244243
{

Nebula/Patches/PlayerControlPatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ static public PlayerControl GetTarget(Vector3 position, float distance, bool onl
157157
float num = range;
158158
if (!ShipStatus.Instance) return result;
159159
if (targetingPlayer == null) targetingPlayer = PlayerControl.LocalPlayer;
160-
if (targetingPlayer.Data.IsDead && !(targetingPlayer.GetModData().role == Roles.Roles.EvilBusker && Roles.Roles.EvilBusker.pseudocideFlag)) return result;
160+
if (targetingPlayer.Data.IsDead && !(targetingPlayer.GetModData().role == Roles.Roles.EvilBusker && Roles.Roles.EvilBusker.pseudocideFlag) && !(targetingPlayer.GetModData().role == Roles.Roles.Puppeteer)) return result;
161161

162162
Vector2 truePosition = targetingPlayer.GetTruePosition();
163163
Il2CppSystem.Collections.Generic.List<GameData.PlayerInfo> allPlayers = GameData.Instance.AllPlayers;

Nebula/Patches/RoleAssignmentPatch.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ public static void Postfix()
392392
{
393393
//標準ロールを割り当てるならこれ
394394
//assignDefaultRoles(assignMap);
395+
//chooseRoles(assingMap);
395396
assignRoles(assignMap);
396397

397398
}
@@ -436,6 +437,27 @@ private static Dictionary<string, Role> LoadMetaRoleAssignments()
436437
return result;
437438
}
438439

440+
/*
441+
private static void chooseRoles(AssignMap assignMap){
442+
var metaAssignment = LoadMetaRoleAssignments();
443+
444+
Game.GameModeProperty property = Game.GameModeProperty.GetProperty(CustomOptionHolder.GetCustomGameMode());
445+
446+
List<PlayerControl> crewmates = PlayerControl.AllPlayerControls.ToArray().ToList().OrderBy(x => Guid.NewGuid()).ToList();
447+
448+
List<PlayerControl> impostors = new List<PlayerControl>();
449+
450+
//VOID割り当て
451+
if (CustomOptionHolder.GetCustomGameMode() != Module.CustomGameMode.FreePlay && Roles.Roles.VOID.TopOption.getBool())
452+
{
453+
assignMap.AssignRole(PlayerControl.LocalPlayer.PlayerId, Roles.Roles.VOID.id);
454+
crewmates.RemoveAll((p) => p.PlayerId == PlayerControl.LocalPlayer.PlayerId);
455+
}
456+
457+
458+
}
459+
*/
460+
439461
private static void assignRoles(AssignMap assignMap)
440462
{
441463
//メタ的な割り当てを読み込む

0 commit comments

Comments
 (0)