Skip to content

Commit 10f059e

Browse files
committed
Update v1.1.1.1
1 parent bef049e commit 10f059e

29 files changed

+1249
-1100
lines changed

CHANGELOG.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
1-
v1.1.0.8更新日志
1+
v1.1.1.1更新日志
22

3-
* 新增选项:"赌怪猜测时返还所有投票"。
4-
* 新增选项:"赌怪猜测时延长会议时间"。
5-
* 优化随机出生,游戏开始时会缓存出生点,使其不会因新增的管道出生点而出现玩家卡墙问题。
6-
* 赌怪猜测完毕时,如果其他玩家的赌怪界面没有关闭会强制关闭,避免多个玩家同时出赌的问题。
7-
* 交换师:交换失败时,将会延迟到会议结束的驱逐动画结束后判定。
8-
* 抹除者:抹除玩家后,将会延迟到会议结束的驱逐动画结束后判定。
9-
* 女巫:咒杀玩家时,目标玩家将会延迟到会议结束的驱逐动画结束后死亡。
10-
* 告密者:告密者已死亡时,即使告密者任务完成,其他玩家也不会看到告密者名称颜色。
11-
* 设陷师:优化陷阱日志,在陷阱触发时发送该踩到该陷阱的玩家职业信息。
12-
* 情报师:查验消息发送时间提前,当轮会议查验将会在会议结束后发送查验消息。
13-
* 忍者:修复隐身期间,其他玩家按钮可以看到忍者的玩家名称问题。
14-
* 纵火狂:修复点火按钮的冷却问题
15-
* 纵火狂:在仅剩纵火狂一个杀手时,点火按钮最大冷却更改为2.5s,基础冷却0s (但需要按照房间对应设置才可生效)。
16-
* 处刑者:修复处刑目标在会议中死亡时,处刑者不会变为起诉人的问题。
17-
* 入殓师:优化选项,独立附加能力的选项,且附加能力的入殓师启用后,强制禁用主职业入殓师。
18-
* 分散者:修复分散时,其他玩家如果在管道内,不会被强制跳出管道的问题。
19-
* 专业刺客:新增选项:"更改为公共附加能力",启用后,在赌怪模式中,所有赌怪都有可能获得该附加能力。
20-
* 巨人:不再修改碰撞体积,以优化卡墙的问题。
21-
* 怨灵:修复在会议中死亡的玩家获得怨灵时可以看到其他玩家职业信息的问题。
22-
* 怨灵:删除怨灵在会议外的聊天按钮,并无法接收到赌怪猜测信息和查验信息等。
3+
* 新增伪装者职业:狼之主
4+
* 新增附加能力:迷乱旋涡
5+
* 修复巨人的体型在其他玩家不可见的问题
6+
* 修复分散者的坐标问题
237

248
注:本次仅更新Lite分支

Strings.xlsx

485 Bytes
Binary file not shown.

TheOtherRoles/Objects/Trap.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,14 @@ public static void triggerTrap(byte playerId, byte trapId)
124124
message = trap.trappedPlayer.Aggregate(message, (current, p) => current + Trapper.infoType switch
125125
{
126126
0 => RoleInfo.GetRolesString(p, false, false, false) + "\n",
127-
1 when isEvilNeutral(p) || p.Data.Role.IsImpostor => "邪恶职业 \n",
127+
1 when (isEvilNeutral(p) || p.isImpostor()) ^ Vortox.Reversal => "邪恶职业 \n",
128128
1 => "善良职业 \n",
129129
_ => p.Data.PlayerName + "\n"
130130
});
131131

132132
FastDestroyableSingleton<HudManager>.Instance.Chat.AddChat(Trapper.trapper, $"{message}");
133133
}
134134
}
135-
136135
Trapper.playersOnMap = new List<PlayerControl>();
137136
}
138137

TheOtherRoles/Options/CustomOptionHolder.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public class CustomOptionHolder
4040
public static CustomOption yoyoAdminTableCooldown;
4141
public static CustomOption yoyoSilhouetteVisibility;
4242

43+
public static CustomOption wolfLordSpawnRate;
44+
4345
public static CustomOption morphlingSpawnRate;
4446
public static CustomOption morphlingCooldown;
4547
public static CustomOption morphlingDuration;
@@ -70,6 +72,10 @@ public class CustomOptionHolder
7072
public static CustomOption poucherSpawnRate;
7173
public static CustomOption modifierPoucher;
7274

75+
public static CustomOption modifierVortox;
76+
public static CustomOption modifierVortoxSkipMeeting;
77+
public static CustomOption modifierVortoxSkipNum;
78+
7379
public static CustomOption butcherSpawnRate;
7480
public static CustomOption butcherDissectionCooldown;
7581
public static CustomOption butcherDissectionDuration;
@@ -390,6 +396,7 @@ public class CustomOptionHolder
390396
public static CustomOption witnessMarkTimer;
391397
public static CustomOption witnessWinCount;
392398
public static CustomOption witnessMeetingDie;
399+
public static CustomOption witnessSkipMeeting;
393400

394401
public static CustomOption balancerSpawnRate;
395402
public static CustomOption balancerCount;
@@ -787,6 +794,8 @@ public static void Load()
787794

788795
//-------------------------- Impostor Options 10000-19999 -------------------------- //
789796

797+
wolfLordSpawnRate = Create(10100, Types.Impostor, cs(WolfLord.color, "WolfLord"), rates, null, true);
798+
790799
morphlingSpawnRate = Create(10110, Types.Impostor, cs(Morphling.color, "Morphling"), rates, null, true);
791800
morphlingCooldown = Create(10111, Types.Impostor, "morphlingCooldown", 15f, 10f, 60f, 2.5f, morphlingSpawnRate);
792801
morphlingDuration = Create(10112, Types.Impostor, "morphlingDuration", 15f, 1f, 20f, 0.5f, morphlingSpawnRate);
@@ -947,6 +956,7 @@ public static void Load()
947956
witnessMarkTimer = Create(20302, Types.Neutral, "witnessMarkTimer", 30, 20, 90, 5, witnessSpawnRate);
948957
witnessWinCount = Create(20303, Types.Neutral, "witnessWinCount", 2, 1, 6, 1, witnessSpawnRate);
949958
witnessMeetingDie = Create(20304, Types.Neutral, "witnessMeetingDie", true, witnessSpawnRate);
959+
witnessSkipMeeting = Create(20305, Types.Neutral, "witnessSkipMeeting", true, witnessSpawnRate);
950960

951961
jackalSpawnRate = Create(20130, Types.Neutral, cs(Jackal.color, "Jackal"), rates, null, true);
952962
jackalChanceSwoop = Create(20142, Types.Neutral, cs(Swooper.color, "jackalChanceSwoop"), rates, jackalSpawnRate);
@@ -1267,6 +1277,10 @@ public static void Load()
12671277
poucherSpawnRate.selection = 0;
12681278
});
12691279

1280+
modifierVortox = Create(40380, Types.Modifier, cs(Vortox.color, "Vortox"), rates, null, true);
1281+
modifierVortoxSkipMeeting = Create(40381, Types.Modifier, "modifierVortoxSkipMeeting", true, modifierVortox);
1282+
modifierVortoxSkipNum = Create(40382, Types.Modifier, "modifierVortoxSkipNum", 4, 1, 10, 1, modifierVortoxSkipMeeting);
1283+
12701284
modifierLastImpostor = Create(40110, Types.Modifier, cs(Palette.ImpostorRed, "LastImpostor"), false, null, true);
12711285
modifierLastImpostorDeduce = Create(40111, Types.Modifier, "modifierLastImpostorDeduce", 5f, 2.5f, 15f, 2.5f, modifierLastImpostor);
12721286

TheOtherRoles/Patches/EndGamePatch.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)] ref En
183183
var miniLose = Mini.mini != null && gameOverReason == (GameOverReason)CustomGameOverReason.MiniLose;
184184
var jesterWin = Jester.jester != null && gameOverReason == (GameOverReason)CustomGameOverReason.JesterWin;
185185
var witnessWin = Witness.Player != null && gameOverReason == (GameOverReason)CustomGameOverReason.WitnessWin;
186-
var impostorWin = gameOverReason is GameOverReason.ImpostorByKill or GameOverReason.ImpostorBySabotage or GameOverReason.ImpostorByVote;
186+
var impostorWin = (gameOverReason is GameOverReason.ImpostorByKill or GameOverReason.ImpostorBySabotage or GameOverReason.ImpostorByVote)
187+
|| Vortox.triggerImpWin;
187188
var werewolfWin = gameOverReason == (GameOverReason)CustomGameOverReason.WerewolfWin && Werewolf.werewolf.IsAlive();
188189
var juggernautWin = gameOverReason == (GameOverReason)CustomGameOverReason.JuggernautWin && Juggernaut.juggernaut.IsAlive();
189190
var swooperWin = gameOverReason == (GameOverReason)CustomGameOverReason.SwooperWin && Swooper.swooper.IsAlive();
@@ -485,7 +486,7 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)] ref En
485486
TempData.winners.Add(new WinningPlayerData(PartTimer.partTimer.Data));
486487
AdditionalTempData.additionalWinConditions.Add(WinCondition.AdditionalPartTimerWin);
487488
}
488-
Message($"游戏结束 {AdditionalTempData.winCondition}");
489+
Message($"游戏结束 {AdditionalTempData.winCondition}", "OnGameEnd");
489490
// Reset Settings
490491
RPCProcedure.resetVariables();
491492
}
@@ -1038,15 +1039,15 @@ private static bool CheckAndEndGameForJuggernautWin(ShipStatus __instance, Playe
10381039

10391040
private static bool CheckAndEndGameForImpostorWin(ShipStatus __instance, PlayerStatistics statistics)
10401041
{
1041-
if (statistics.TeamImpostorsAlive >= statistics.TotalAlive - statistics.TeamImpostorsAlive &&
1042+
if (Vortox.triggerImpWin || (statistics.TeamImpostorsAlive >= statistics.TotalAlive - statistics.TeamImpostorsAlive &&
10421043
statistics.TeamJackalAlive == 0 &&
10431044
statistics.TeamPavlovsAlive == 0 &&
10441045
statistics.TeamWerewolfAlive == 0 &&
10451046
statistics.TeamSwooperAlive == 0 &&
10461047
statistics.TeamArsonistAlive == 0 &&
10471048
statistics.TeamAkujoAlive == 0 &&
10481049
statistics.TeamJuggernautAlive == 0 &&
1049-
!(statistics.TeamImpostorHasAliveLover && statistics.TeamLoversAlive == 2) && !killingCrewAlive())
1050+
!(statistics.TeamImpostorHasAliveLover && statistics.TeamLoversAlive == 2) && !killingCrewAlive()))
10501051
{
10511052
//__instance.enabled = false;
10521053
GameOverReason endReason;

TheOtherRoles/Patches/ExileControllerPatch.cs

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ internal class ExileControllerBeginPatch
2424
public static bool Prefix(ExileController __instance, [HarmonyArgument(0)] ref GameData.PlayerInfo exiled, [HarmonyArgument(1)] bool tie)
2525
{
2626
lastExiled = exiled;
27-
27+
Message($"开始放逐: {exiled?.PlayerName ?? "null"}");
2828
if (Balancer.currentAbilityUser != null && Balancer.IsDoubleExile && !IsSec)
2929
{
3030
IsSec = true;
@@ -64,9 +64,25 @@ void createlate(int index)
6464
Helpers.SetActiveAllObject(controller.gameObject.GetChildren(), "RaftAnimation", false);
6565
controller.transform.localPosition = new(-3.75f, -0.2f, -60f);
6666
}
67+
if (Lawyer.lawyer != null && exiled?.Object.PlayerId == Lawyer.target.PlayerId && Lawyer.target != Jester.jester)
68+
{
69+
var writer = StartRPC(PlayerControl.LocalPlayer, CustomRPC.LawyerPromotesToPursuer);
70+
writer.Write(true);
71+
writer.EndRPC();
72+
Lawyer.PromotesToPursuer(true);
73+
}
74+
6775
if (!IsSec) return true;
6876
}
6977

78+
if (Lawyer.lawyer != null && exiled?.Object.PlayerId == Lawyer.target.PlayerId && Lawyer.target != Jester.jester)
79+
{
80+
var writer = StartRPC(PlayerControl.LocalPlayer, CustomRPC.LawyerPromotesToPursuer);
81+
writer.Write(true);
82+
writer.EndRPC();
83+
Lawyer.PromotesToPursuer(true);
84+
}
85+
7086
// Medic shield
7187
if (Medic.medic != null && AmongUsClient.Instance.AmHost && Medic.futureShielded != null && !Medic.medic.Data.IsDead)
7288
{
@@ -176,7 +192,7 @@ internal class ExileControllerWrapUpPatch
176192
public static void Prefix(GameObject obj)
177193
{
178194
// Nightvision:
179-
if (obj?.name != null && obj.name.Contains("FungleSecurity"))
195+
if (obj != null && obj.name != null && obj.name.Contains("FungleSecurity"))
180196
{
181197
SurveillanceMinigamePatch.resetNightVision();
182198
return;
@@ -198,7 +214,7 @@ public static void Prefix(GameObject obj)
198214

199215
private static void WrapUpPostfix(GameData.PlayerInfo exiled)
200216
{
201-
Message("驱逐结束");
217+
Message("WrapUp");
202218
if (CachedPlayer.LocalPlayer.IsDead) CanSeeRoleInfo = true;
203219
// Prosecutor win condition
204220
if (exiled != null && Executioner.executioner != null && Executioner.target != null &&
@@ -227,27 +243,31 @@ private static void WrapUpPostfix(GameData.PlayerInfo exiled)
227243
AmongUsClient.Instance.FinishRpcImmediately(writer);
228244
Executioner.PromotesRole();
229245
}
230-
else if (Witness.Player == CachedPlayer.LocalPlayer.PlayerControl && Witness.target != null && Witness.killerTarget != null)
246+
if (Witness.target != null && Witness.killerTarget != null)
231247
{
232-
bool skip = exiled == null;
248+
bool skip = exiled == null && Witness.skipMeeting;
233249
bool targetIsKillerAndNotExiled = Witness.target == Witness.killerTarget && (exiled?.Object == null || Witness.target != exiled?.Object);
234-
bool targetIsExiledAndNotKiller = (Witness.target == exiled?.Object || (Witness.meetingDie && Witness.target.IsDead()))
235-
&& Witness.target != Witness.killerTarget;
250+
bool targetIsExiledAndNotKiller = Witness.target != Witness.killerTarget && (Witness.target == exiled?.Object ||
251+
(Witness.meetingDie && Witness.target.IsDead()));
236252

237-
if (targetIsKillerAndNotExiled || targetIsExiledAndNotKiller)
253+
if ((!skip && targetIsKillerAndNotExiled) || targetIsExiledAndNotKiller)
238254
{
239255
Witness.exiledCount++;
240256
}
241257

242258
if (Witness.exiledCount == Witness.exileToWin)
243259
{
244-
var writer = StartRPC(CachedPlayer.LocalPlayer.PlayerControl, CustomRPC.WitnessWin);
245-
writer.EndRPC();
246260
Witness.triggerWitnessWin = true;
247261
}
248262
}
249263
Witness.target = Witness.killerTarget = null;
250264

265+
if (Vortox.Player.IsAlive())
266+
{
267+
Vortox.skipCount++;
268+
if (Vortox.skipCount == Vortox.skipMeetingNum) Vortox.triggerImpWin = true;
269+
}
270+
251271
// Reset custom button timers where necessary
252272
CustomButton.MeetingEndedUpdate();
253273

@@ -292,7 +312,6 @@ private static void WrapUpPostfix(GameData.PlayerInfo exiled)
292312
})));
293313
}
294314
}
295-
296315
Seer.deadBodyPositions = new List<Vector3>();
297316
}
298317

@@ -436,18 +455,16 @@ private static void WrapUpPostfix(GameData.PlayerInfo exiled)
436455

437456
if (InfoSleuth.infoSleuth != null && InfoSleuth.target != null && InfoSleuth.infoSleuth == PlayerControl.LocalPlayer)
438457
{
439-
string msg;
440-
var random = rnd.Next(2);
441-
var isNotCrew = isNeutral(InfoSleuth.target) || InfoSleuth.target.isImpostor();
442-
var team = "的阵营是 " + teamString(InfoSleuth.target);
458+
var isNotCrew = (isNeutral(InfoSleuth.target) || InfoSleuth.target.isImpostor()) ^ Vortox.Reversal;
459+
var team = "的阵营是 " + getTeam(InfoSleuth.target);
443460
var info = InfoSleuth.infoType switch
444461
{
445462
0 => isNotCrew ? "不是船员" : "是船员",
446463
1 => team,
447-
_ => random == 0 ? isNotCrew ? "不是船员" : "是船员" : team,
464+
_ => rnd.Next(2) == 0 ? isNotCrew ? "不是船员" : "是船员" : team,
448465
};
449466

450-
msg = $"{InfoSleuth.target.Data.PlayerName} {info}";
467+
string msg = $"{InfoSleuth.target.Data.PlayerName} {info}";
451468

452469
FastDestroyableSingleton<HudManager>.Instance.Chat.AddChat(PlayerControl.LocalPlayer, $"{msg}");
453470
var writer = StartRPC(PlayerControl.LocalPlayer, CustomRPC.ShareGhostInfo);
@@ -459,6 +476,19 @@ private static void WrapUpPostfix(GameData.PlayerInfo exiled)
459476
var writer1 = StartRPC(PlayerControl.LocalPlayer, CustomRPC.InfoSleuthNoTarget);
460477
writer1.EndRPC();
461478
RPCProcedure.infoSleuthNoTarget();
479+
480+
static string getTeam(PlayerControl player)
481+
{
482+
if (Vortox.Player.IsAlive())
483+
{
484+
if (player.isCrew()) return rnd.Next(2) == 0 ? "NeutralRolesText".Translate() : "ImpostorRolesText".Translate();
485+
if (isNeutral(player) || player.isImpostor()) return "CrewmateRolesText".Translate();
486+
}
487+
488+
return isNeutral(player) ? "NeutralRolesText".Translate()
489+
: player.isImpostor() ? "ImpostorRolesText".Translate()
490+
: "CrewmateRolesText".Translate();
491+
}
462492
}
463493

464494
// Invert add meeting
@@ -471,8 +501,7 @@ private static void WrapUpPostfix(GameData.PlayerInfo exiled)
471501
(GameOptionsManager.Instance.currentNormalGameOptions.KillCooldown / 2) + 2, new Action<float>(p =>
472502
{ if (p == 1f) foreach (var trap in Trap.traps) trap.triggerable = true; })));
473503

474-
if (!Yoyo.markStaysOverMeeting)
475-
Silhouette.clearSilhouettes();
504+
if (!Yoyo.markStaysOverMeeting) Silhouette.clearSilhouettes();
476505

477506
if (AmongUsClient.Instance.AmHost)
478507
{

TheOtherRoles/Patches/MeetingHudPatch.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,7 @@ private static void mayorToggleVoteTwice(MeetingHud __instance)
136136
__instance.playerStates[0].Cancel(); // This will stop the underlying buttons of the template from showing up
137137
if (__instance.state == VoteStates.Results || Mayor.mayor.Data.IsDead) return;
138138

139-
// Only accept changes until the mayor voted
140-
var mayorPVA = __instance.playerStates.FirstOrDefault(x => x.TargetPlayerId == Mayor.mayor.PlayerId);
141-
if (Mayor.Revealed && mayorPVA != null && mayorPVA.DidVote)
142-
{
143-
SoundEffectsManager.play("fail");
144-
return;
145-
}
146-
Mayor.Revealed = !Mayor.Revealed;
139+
Mayor.Revealed = true;
147140

148141
var writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId,
149142
(byte)CustomRPC.MayorRevealed, SendOption.Reliable);
@@ -261,7 +254,8 @@ private static void populateButtonsPostfix(MeetingHud __instance)
261254

262255
// Add Guesser Buttons
263256
var GuesserRemainingShots = HandleGuesser.remainingShots(CachedPlayer.LocalPlayer.PlayerId);
264-
if (!isGuesser || CachedPlayer.LocalPlayer.Data.IsDead || GuesserRemainingShots <= 0) return;
257+
if (!isGuesser || CachedPlayer.LocalPlayer.IsDead || GuesserRemainingShots <= 0 ||
258+
(PlayerControl.LocalPlayer == WolfLord.Player && WolfLord.Revealed)) return;
265259
{
266260
Doomsayer.CanShoot = true;
267261
for (var i = 0; i < __instance.playerStates.Length; i++)
@@ -515,7 +509,7 @@ private class MeetingHudBloopAVoteIconPatch
515509
public static bool Prefix(MeetingHud __instance, GameData.PlayerInfo voterPlayer, int index, Transform parent)
516510
{
517511
var spriteRenderer = Object.Instantiate(__instance.PlayerVotePrefab);
518-
var showVoteColors = !GameManager.Instance.LogicOptions.GetAnonymousVotes() || CachedPlayer.LocalPlayer.Data.IsDead ||
512+
var showVoteColors = !GameManager.Instance.LogicOptions.GetAnonymousVotes() || shouldShowGhostInfo() ||
519513
(Prosecutor.prosecutor != null && Prosecutor.prosecutor == CachedPlayer.LocalPlayer.PlayerControl &&
520514
Prosecutor.canSeeVoteColors && TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data).Item1 >=
521515
Prosecutor.tasksNeededToSeeVoteColors) ||
@@ -734,8 +728,7 @@ private static void Postfix(MeetingHud __instance)
734728
[HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.Deserialize))]
735729
private class MeetingDeserializePatch
736730
{
737-
private static void Postfix(MeetingHud __instance, [HarmonyArgument(0)] MessageReader reader,
738-
[HarmonyArgument(1)] bool initialState)
731+
private static void Postfix(MeetingHud __instance, [HarmonyArgument(0)] MessageReader reader, [HarmonyArgument(1)] bool initialState)
739732
{
740733
// Add swapper buttons
741734
if (initialState) populateButtonsPostfix(__instance);

0 commit comments

Comments
 (0)