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

Commit 7d7c7eb

Browse files
committed
1045
1 parent 0fd7048 commit 7d7c7eb

19 files changed

Lines changed: 425 additions & 33 deletions

File tree

Nebula/CustomOptionHolder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class CustomOptionHolder
6969
"option.display.percentage.andSoForth", "option.display.percentage.10", "option.display.percentage.20", "option.display.percentage.30", "option.display.percentage.40",
7070
"option.display.percentage.50", "option.display.percentage.60", "option.display.percentage.70", "option.display.percentage.80", "option.display.percentage.90" };
7171
public static string[] presets = new string[] { "option.display.preset.1", "option.display.preset.2", "option.display.preset.3", "option.display.preset.4", "option.display.preset.5" };
72-
public static string[] gamemodesNormal = new string[] { "gamemode.standard", "gamemode.freePlay", "gamemode.battle" };
72+
public static string[] gamemodesNormal = new string[] { "gamemode.standard", "gamemode.freePlay", "gamemode.battle", "gamemode.viruscrisis" };
7373
public static string[] gamemodesHnS = new string[] { "gamemode.standard", "gamemode.freePlay" };
7474

7575
private static byte ToByte(float f)
@@ -502,7 +502,7 @@ public static void Load()
502502
}
503503
};
504504

505-
mapOptions = CustomOption.Create(Color.white, "option.mapOptions", false, null, true, false, "", CustomOptionTab.Settings).SetGameMode(CustomGameMode.All);
505+
mapOptions = CustomOption.Create(Color.white, "option.mapOptions", false, null, true, false, "", CustomOptionTab.Settings).SetGameMode(CustomGameMode.ActuallyAll);
506506
CustomOption.RegisterTopOption(mapOptions);
507507
dynamicMap = CustomOption.Create(Color.white, "option.playRandomMaps", false, mapOptions).SetGameMode(CustomGameMode.All);
508508
exceptSkeld = CustomOption.Create(Color.white, "option.exceptSkeld", false, dynamicMap).SetGameMode(CustomGameMode.All);
@@ -581,7 +581,7 @@ MetaScreenContent getSuitableContent()
581581
};
582582
};
583583

584-
limiterOptions = CustomOption.Create(Color.white, "option.limitOptions", false, null, true, false, "", CustomOptionTab.Settings).SetGameMode(CustomGameMode.AllStandard);
584+
limiterOptions = CustomOption.Create(Color.white, "option.limitOptions", false, null, true, false, "", CustomOptionTab.Settings).SetGameMode(CustomGameMode.ActuallyAll);
585585
CustomOption.RegisterTopOption(limiterOptions);
586586
timeLimitOption = CustomOption.Create(Color.white, "option.timeLimitOption", 20f, 1f, 80f, 1f, limiterOptions).SetGameMode(CustomGameMode.All);
587587
timeLimitSecondOption = CustomOption.Create(Color.white, "option.timeLimitSecondOption", 0f, 0f, 55f, 5f, limiterOptions).SetGameMode(CustomGameMode.All);

Nebula/Game/GameModeProperty.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public GameModeProperty(Module.CustomGameMode RelatedMode, int MinPlayers, bool
5454
static public GameModeProperty StandardHnSMode;
5555
static public GameModeProperty FreePlayHnSMode;
5656
static public GameModeProperty BattleMode;
57+
static public GameModeProperty VirusCrisisMode;
5758

5859
static public void Load()
5960
{
@@ -65,7 +66,8 @@ static public void Load()
6566
Module.CustomOptionTab.Settings | Module.CustomOptionTab.CrewmateRoles | Module.CustomOptionTab.ImpostorRoles | Module.CustomOptionTab.AdvancedSettings);
6667
FreePlayHnSMode = new GameModeProperty(Module.CustomGameMode.FreePlayHnS, new IntRange(0, 1), false, false, false, null, Roles.Roles.HnSCrewmate, Roles.Roles.HnSReaper,
6768
Module.CustomOptionTab.Settings | Module.CustomOptionTab.AdvancedSettings);
68-
BattleMode = new GameModeProperty(Module.CustomGameMode.Battle,2,false,false,false,null,Roles.Roles.Crewmate,Roles.Roles.Impostor,Module.CustomOptionTab.Settings);
69+
BattleMode = new GameModeProperty(Module.CustomGameMode.Battle,2,false,false,false,null,Roles.Roles.YellowTeam,Roles.Roles.GreenTeam,Module.CustomOptionTab.Settings);
70+
VirusCrisisMode = new GameModeProperty(Module.CustomGameMode.VirusCrisis,4,false,false,false,null,Roles.Roles.Crewmate,Roles.Roles.Impostor,Module.CustomOptionTab.Settings | Module.CustomOptionTab.CrewmateRoles | Module.CustomOptionTab.ImpostorRoles);
6971
}
7072

7173
static public GameModeProperty GetProperty(Module.CustomGameMode gameMode)

Nebula/Module/CustomOption.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public enum CustomGameMode
2020
AllHnS = 12,
2121
AllStandard = 3,
2222
Battle = 16,
23-
ActuallyAll = 31,
24-
23+
ActuallyAll = 63,
24+
VirusCrisis = 32,
2525
}
2626

2727
[Flags]
@@ -43,7 +43,7 @@ public static class CustomGameModes
4343
{
4444
static public List<CustomGameMode> AllGameModes = new List<CustomGameMode>()
4545
{
46-
CustomGameMode.Standard,CustomGameMode.FreePlay,CustomGameMode.Battle,CustomGameMode.Standard,
46+
CustomGameMode.Standard,CustomGameMode.FreePlay,CustomGameMode.Battle,CustomGameMode.VirusCrisis,
4747
CustomGameMode.Standard,CustomGameMode.Standard,CustomGameMode.Standard,CustomGameMode.Standard,
4848
CustomGameMode.StandardHnS,CustomGameMode.FreePlayHnS
4949
};

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.4";
46+
public const string PluginVersion = "1.0.4.5";
4747
public const bool IsSnapshot = true;
4848

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

52-
public const string PluginVersionForFetch = "1.0.4.4";
53-
public byte[] PluginVersionData = new byte[] { 1, 0, 4, 4 };
52+
public const string PluginVersionForFetch = "1.0.4.5";
53+
public byte[] PluginVersionData = new byte[] { 1, 0, 4, 5 };
5454

5555
public static NebulaPlugin Instance;
5656

Nebula/Patches/CredentialsPatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void Prefix(PingTracker __instance)
6565
static void Postfix(PingTracker __instance)
6666
{
6767
__instance.text.alignment = TMPro.TextAlignmentOptions.TopRight;
68-
__instance.text.text = $"<size=130%><color=#9579ce>Nebula-R-LTS</color></size> v" + NebulaPlugin.PluginVisualVersion + "\n" + "<color=#eddb5aff>Produced by 凛\nBased on Nebula produced by Dolly1016\n<color=#ED1C24FF>这辈子都不可能写轮选的</color>\n</color><color=#30CF42FF>" + __instance.text.text + "</color>";
68+
__instance.text.text = $"<size=130%><color=#9579ce>Nebula-R-LTS</color></size> v" + NebulaPlugin.PluginVisualVersion + "\n" + "<color=#eddb5aff>Produced by 凛(YiChanlian)\nBased on Nebula produced by Dolly1016\n<color=#ED1C24FF>这辈子都不可能写轮选的</color>\n</color><color=#30CF42FF>" + __instance.text.text + "</color>";
6969
if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GameStates.Started)
7070
{
7171
__instance.gameObject.GetComponent<AspectPosition>().DistanceFromEdge = new Vector3(1.2f, 0.8f, 0f);

Nebula/Patches/EndGamePatch.cs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ public class EndCondition
2828
public static EndCondition TrilemmaWin = new EndCondition(25, new Color(209f / 255f, 63f / 255f, 138f / 255f), "trilemma", 0, Module.CustomGameMode.Standard);
2929
public static EndCondition SantaWin = new EndCondition(26, Roles.NeutralRoles.SantaClaus.RoleColor, "santa", 4, Module.CustomGameMode.Standard);
3030

31-
public static EndCondition NobodyWin = new EndCondition(48, new Color(72f / 255f, 78f / 255f, 84f / 255f), "nobody", 0, Module.CustomGameMode.All).SetNoBodyWin(true);
32-
public static EndCondition NobodySkeldWin = new EndCondition(49, new Color(72f / 255f, 78f / 255f, 84f / 255f), "nobody.skeld", 32, Module.CustomGameMode.All).SetNoBodyWin(true);
33-
public static EndCondition NobodyMiraWin = new EndCondition(50, new Color(72f / 255f, 78f / 255f, 84f / 255f), "nobody.mira", 32, Module.CustomGameMode.All).SetNoBodyWin(true);
34-
public static EndCondition NobodyPolusWin = new EndCondition(51, new Color(72f / 255f, 78f / 255f, 84f / 255f), "nobody.polus", 32, Module.CustomGameMode.All).SetNoBodyWin(true);
35-
public static EndCondition NobodyAirshipWin = new EndCondition(52, new Color(72f / 255f, 78f / 255f, 84f / 255f), "nobody.airship", 32, Module.CustomGameMode.All).SetNoBodyWin(true);
31+
public static EndCondition NobodyWin = new EndCondition(48, new Color(72f / 255f, 78f / 255f, 84f / 255f), "nobody", 0, Module.CustomGameMode.ActuallyAll).SetNoBodyWin(true);
32+
public static EndCondition NobodySkeldWin = new EndCondition(49, new Color(72f / 255f, 78f / 255f, 84f / 255f), "nobody.skeld", 32, Module.CustomGameMode.ActuallyAll).SetNoBodyWin(true);
33+
public static EndCondition NobodyMiraWin = new EndCondition(50, new Color(72f / 255f, 78f / 255f, 84f / 255f), "nobody.mira", 32, Module.CustomGameMode.ActuallyAll).SetNoBodyWin(true);
34+
public static EndCondition NobodyPolusWin = new EndCondition(51, new Color(72f / 255f, 78f / 255f, 84f / 255f), "nobody.polus", 32, Module.CustomGameMode.ActuallyAll).SetNoBodyWin(true);
35+
public static EndCondition NobodyAirshipWin = new EndCondition(52, new Color(72f / 255f, 78f / 255f, 84f / 255f), "nobody.airship", 32, Module.CustomGameMode.ActuallyAll).SetNoBodyWin(true);
3636

37-
public static EndCondition NoGame = new EndCondition(64, new Color(72f / 255f, 78f / 255f, 84f / 255f), "noGame", 0, Module.CustomGameMode.All).SetNoBodyWin(true);
37+
public static EndCondition NoGame = new EndCondition(64, new Color(72f / 255f, 78f / 255f, 84f / 255f), "noGame", 0, Module.CustomGameMode.ActuallyAll).SetNoBodyWin(true);
3838

3939
public static EndCondition PavlovWin = new EndCondition(128, Roles.NeutralRoles.Pavlov.RoleColor, "pavlov", 1, Module.CustomGameMode.Standard);
4040
public static EndCondition MoriartyWin = new EndCondition(129, Roles.NeutralRoles.Moriarty.RoleColor, "moriarty", 1, Module.CustomGameMode.Standard);
@@ -49,6 +49,8 @@ public class EndCondition
4949
public static EndCondition PuppeteerWin = new EndCondition(138,Roles.NeutralRoles.Puppeteer.RoleColor,"puppeteer",1,Module.CustomGameMode.Standard);
5050
public static EndCondition YellowTeamWin = new EndCondition(139,Roles.BattleRoles.YellowTeam.RoleColor,"yellowTeam",1,Module.CustomGameMode.Battle);
5151
public static EndCondition GreenTeamWin = new EndCondition(140,Roles.BattleRoles.GreenTeam.RoleColor,"greenTeam",1,Module.CustomGameMode.Battle);
52+
public static EndCondition InfectedWin = new EndCondition(141,Palette.ImpostorRed,"infected",1,Module.CustomGameMode.VirusCrisis);
53+
public static EndCondition SurvivalWin = new EndCondition(142,Palette.CrewmateBlue,"survival",1,Module.CustomGameMode.VirusCrisis);
5254

5355
public static HashSet<EndCondition> AllEnds = new HashSet<EndCondition>() {
5456
CrewmateWinByVote ,CrewmateWinByTask,CrewmateWinDisconnect,
@@ -57,7 +59,7 @@ public class EndCondition
5759
JesterWin,JackalWin,ArsonistWin,EmpiricWin,PaparazzoWin,VultureWin,SpectreWin,SantaWin,
5860
LoversWin,TrilemmaWin,AvengerWin,
5961
NoGame,NobodyWin,NobodySkeldWin,NobodyMiraWin,NobodyPolusWin,NobodyAirshipWin,
60-
PavlovWin,MoriartyWin,MoriartyWinByKillHolmes,CascrubinterWin,GuesserWin,YandereWin,WerewolfWin,ChallengerWin,OracleWin,GhostWin,PuppeteerWin,YellowTeamWin,GreenTeamWin
62+
PavlovWin,MoriartyWin,MoriartyWinByKillHolmes,CascrubinterWin,GuesserWin,YandereWin,WerewolfWin,ChallengerWin,OracleWin,GhostWin,PuppeteerWin,YellowTeamWin,GreenTeamWin,InfectedWin,SurvivalWin,
6163
};
6264

6365
public static EndCondition GetEndCondition(GameOverReason gameOverReason)
@@ -749,6 +751,9 @@ public class PlayerStatistics
749751
public int AliveYellowTeam;
750752
public int AliveGreenTeam;
751753

754+
public int AliveInfected;
755+
public int AliveSurvivals;
756+
752757
public bool IsValid;
753758

754759
//
@@ -821,6 +826,9 @@ public PlayerStatistics(ShipStatus __instance)
821826
AliveYellowTeam = 0;
822827
AliveGreenTeam = 0;
823828

829+
AliveInfected = 0;
830+
AliveSurvivals = 0;
831+
824832
Roles.Side side;
825833

826834

@@ -1093,6 +1101,8 @@ public PlayerStatistics(ShipStatus __instance)
10931101
AliveOracle = GetAlivePlayers(Roles.Side.Oracle);
10941102
AliveYellowTeam = GetAlivePlayers(Roles.Side.YellowTeam);
10951103
AliveGreenTeam = GetAlivePlayers(Roles.Side.GreenTeam);
1104+
AliveInfected = GetAlivePlayers(Roles.Side.Infected);
1105+
AliveSurvivals = GetAlivePlayers(Roles.Side.Survival);
10961106

10971107
if (!Roles.Roles.Lover.loversAsIndependentSideOption.getBool())
10981108
{

Nebula/Patches/RoleAssignmentPatch.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,25 @@ private static void assignRoles(AssignMap assignMap)
490490
else assignMap.AssignRole(allPlayers[tmp],Roles.Roles.GreenTeam.id);
491491
}
492492

493+
return;
494+
}else if(CustomOptionHolder.GetCustomGameMode() == Module.CustomGameMode.VirusCrisis){
495+
var allPlayers = new List<byte>();
496+
foreach (var player in PlayerControl.AllPlayerControls.GetFastEnumerator())
497+
{
498+
allPlayers.Add(player.PlayerId);
499+
}
500+
501+
var impidx = NebulaPlugin.rnd.Next(0,allPlayers.Count);
502+
assignMap.AssignRole(allPlayers[impidx],Roles.Roles.Infected.id);
503+
allPlayers.RemoveAt(impidx);
504+
for(int i = 0;i < Roles.Roles.Gunner.neutrallySpawnCount.getFloat();i++){
505+
var idx = NebulaPlugin.rnd.Next(0,allPlayers.Count);
506+
assignMap.AssignRole(allPlayers[idx],Roles.Roles.Gunner.id);
507+
allPlayers.RemoveAt(idx);
508+
}
509+
foreach(var pi in allPlayers){
510+
assignMap.AssignRole(pi,Roles.Roles.Survival.id);
511+
}
493512
return;
494513
}
495514

Nebula/RPC.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public enum CustomRPC
110110
FixedRevive,
111111
SetBombTarget,
112112
SetSmoke,
113+
SetInfectLives,
113114
}
114115

115116
//RPCを受け取ったときのイベント
@@ -428,6 +429,9 @@ static void Postfix([HarmonyArgument(0)] byte callId, [HarmonyArgument(1)] Messa
428429
case (byte)CustomRPC.SetSmoke:
429430
RPCEvents.SetSmoke(reader.ReadByte());
430431
break;
432+
case (byte)CustomRPC.SetInfectLives:
433+
RPCEvents.SetInfectLives(reader.ReadByte());
434+
break;
431435
}
432436
}
433437
}
@@ -1772,6 +1776,10 @@ public static void SetSmoke(byte playerId){
17721776
*/
17731777
RPCEventInvoker.ObjectInstantiate(new Objects.ObjectTypes.Bomb(),Helpers.playerById(playerId).transform.position);
17741778
}
1779+
1780+
public static void SetInfectLives(byte lives){
1781+
Roles.Roles.Infected.TotalLives = lives;
1782+
}
17751783
}
17761784

17771785
public class RPCEventInvoker
@@ -2817,4 +2825,11 @@ public static void SetSmoke(PlayerControl player){
28172825
AmongUsClient.Instance.FinishRpcImmediately(writer);
28182826
RPCEvents.SetSmoke(player.PlayerId);
28192827
}
2828+
2829+
public static void SetInfectLives(byte lives){
2830+
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId,(byte)CustomRPC.SetInfectLives,Hazel.SendOption.Reliable,-1);
2831+
writer.Write(lives);
2832+
AmongUsClient.Instance.FinishRpcImmediately(writer);
2833+
RPCEvents.SetInfectLives(lives);
2834+
}
28202835
}

Nebula/Resources/Languages/SChinese.dat

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,7 @@
13841384
"option.searchableDistance" : "船员搜索最大半径"
13851385

13861386
"gamemode.battle" : "小游戏:战争模式"
1387+
"gamemode.viruscrisis" : "小游戏:感染对抗"
13871388

13881389
"option.battleOption" : "战争模式设置"
13891390
"option.battleOption.killCooldownOption" : "狙击冷却时间"
@@ -2144,6 +2145,30 @@
21442145
"role.greenTeam.hint" : "取得战争的胜利"
21452146
"role.greenTeam.info" : "取得战争的胜利"
21462147

2148+
"role.infected.name" : "感染者"
2149+
"role.infected.short" : "感"
2150+
"role.infected.hint" : "将所有人杀干净"
2151+
"role.infected.description" : "将他们杀干净!"
2152+
"role.infected.info" : "你拥有极快的冷却。\n如果有时间设置,时间结束后将胜利。"
2153+
"role.infected.initkillcooldown" : "初始击杀冷却"
2154+
"role.infected.killcooldown" : "击杀冷却"
2155+
"role.infected.totalLives" : "初始生命值"
2156+
2157+
"role.survival.name" : "幸存者"
2158+
"role.survival.short" : "幸"
2159+
"role.survival.description" : "想办法活下来"
2160+
"role.survival.hint" : "做任务 活下来"
2161+
"role.survival.info" : "你可以跳管道保命。\n做完任务后将成为枪手。\n你可以挨两刀。"
2162+
"role.survival.taskCount" : "任务数量"
2163+
2164+
"role.gunner.name" : "枪手"
2165+
"role.gunner.short" : "枪"
2166+
"role.gunner.description" : "击杀<color=#ff1919ff>感染者</color>!"
2167+
"role.gunner.hint" : "击杀<color=#ff1919ff>感染者</color>"
2168+
"role.gunner.info" : "你可以攻击伪装者。\n更重要的是,你只有一次机会(一条命)。"
2169+
"role.gunner.killcooldown" : "击杀冷却时间"
2170+
"role.gunner.neutrallySpawnCount" : "自然生成的枪手个数"
2171+
21472172
"option.display.random" : "随机"
21482173

21492174
"side.paparazzo.name" : "摄影师"
@@ -2159,7 +2184,9 @@
21592184
"side.oracle.name" : "天启"
21602185
"side.ghost.name" : "怨灵"
21612186
"side.yellowTeam.name" : "黄队"
2162-
"side.greenTeam.short" : "绿队"
2187+
"side.greenTeam.name" : "绿队"
2188+
"side.infected.name" : "感染者"
2189+
"side.survival.name" : "幸存者"
21632190

21642191
"text.exile.role" : "%PLAYER% 的职业是 %ROLE%"
21652192
"text.exile.connection" : " "
@@ -2182,8 +2209,10 @@
21822209
"game.endText.challenger" : "挑战者胜利"
21832210
"game.endText.oracle" : "天启胜利"
21842211
"game.endText.ghost" : "怨灵胜利"
2185-
"game.endText.yellowTeam" : "黄队胜利"
2186-
"game.endText.greenTeam" : "绿队胜利"
2212+
"game.endText.yellowTeam" : "黄队取得了战争的胜利!"
2213+
"game.endText.greenTeam" : "绿队取得了战争的胜利!"
2214+
"game.endText.infected" : "所有人都失踪了!"
2215+
"game.endText.survival" : "我们活下来了!"
21872216

21882217
"status.hemorrhage" : "失血"
21892218
"status.killed" : "爆炸"

Nebula/Roles/BattleRoles/GreenTeam.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ public override void CleanUp()
198198
}
199199

200200
public override void EditOthersDisplayNameColor(byte playerId,ref Color displayColor){
201-
if(Helpers.playerById(playerId).GetModData().role.side == Side.GreenTeam) displayColor = RoleColor;
201+
displayColor = RoleColor;
202+
}
203+
204+
public override void OnMurdered(byte murderId){
205+
Game.GameData.data.myData.CanSeeEveryoneInfo = true;
202206
}
203207

204208
public GreenTeam()

0 commit comments

Comments
 (0)