Skip to content

Commit

Permalink
Update v1.1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyx0412 committed Jan 2, 2025
1 parent bef049e commit ca5b6bf
Show file tree
Hide file tree
Showing 28 changed files with 1,249 additions and 1,097 deletions.
26 changes: 5 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
v1.1.0.8更新日志
v1.1.1.1更新日志

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

注:本次仅更新Lite分支
Binary file modified Strings.xlsx
Binary file not shown.
3 changes: 1 addition & 2 deletions TheOtherRoles/Objects/Trap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,14 @@ public static void triggerTrap(byte playerId, byte trapId)
message = trap.trappedPlayer.Aggregate(message, (current, p) => current + Trapper.infoType switch
{
0 => RoleInfo.GetRolesString(p, false, false, false) + "\n",
1 when isEvilNeutral(p) || p.Data.Role.IsImpostor => "邪恶职业 \n",
1 when (isEvilNeutral(p) || p.isImpostor()) ^ Vortox.Reversal => "邪恶职业 \n",
1 => "善良职业 \n",
_ => p.Data.PlayerName + "\n"
});

FastDestroyableSingleton<HudManager>.Instance.Chat.AddChat(Trapper.trapper, $"{message}");
}
}

Trapper.playersOnMap = new List<PlayerControl>();
}

Expand Down
14 changes: 14 additions & 0 deletions TheOtherRoles/Options/CustomOptionHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class CustomOptionHolder
public static CustomOption yoyoAdminTableCooldown;
public static CustomOption yoyoSilhouetteVisibility;

public static CustomOption wolfLordSpawnRate;

public static CustomOption morphlingSpawnRate;
public static CustomOption morphlingCooldown;
public static CustomOption morphlingDuration;
Expand Down Expand Up @@ -70,6 +72,10 @@ public class CustomOptionHolder
public static CustomOption poucherSpawnRate;
public static CustomOption modifierPoucher;

public static CustomOption modifierVortox;
public static CustomOption modifierVortoxSkipMeeting;
public static CustomOption modifierVortoxSkipNum;

public static CustomOption butcherSpawnRate;
public static CustomOption butcherDissectionCooldown;
public static CustomOption butcherDissectionDuration;
Expand Down Expand Up @@ -390,6 +396,7 @@ public class CustomOptionHolder
public static CustomOption witnessMarkTimer;
public static CustomOption witnessWinCount;
public static CustomOption witnessMeetingDie;
public static CustomOption witnessSkipMeeting;

public static CustomOption balancerSpawnRate;
public static CustomOption balancerCount;
Expand Down Expand Up @@ -787,6 +794,8 @@ public static void Load()

//-------------------------- Impostor Options 10000-19999 -------------------------- //

wolfLordSpawnRate = Create(10100, Types.Impostor, cs(WolfLord.color, "WolfLord"), rates, null, true);

morphlingSpawnRate = Create(10110, Types.Impostor, cs(Morphling.color, "Morphling"), rates, null, true);
morphlingCooldown = Create(10111, Types.Impostor, "morphlingCooldown", 15f, 10f, 60f, 2.5f, morphlingSpawnRate);
morphlingDuration = Create(10112, Types.Impostor, "morphlingDuration", 15f, 1f, 20f, 0.5f, morphlingSpawnRate);
Expand Down Expand Up @@ -947,6 +956,7 @@ public static void Load()
witnessMarkTimer = Create(20302, Types.Neutral, "witnessMarkTimer", 30, 20, 90, 5, witnessSpawnRate);
witnessWinCount = Create(20303, Types.Neutral, "witnessWinCount", 2, 1, 6, 1, witnessSpawnRate);
witnessMeetingDie = Create(20304, Types.Neutral, "witnessMeetingDie", true, witnessSpawnRate);
witnessSkipMeeting = Create(20305, Types.Neutral, "witnessSkipMeeting", true, witnessSpawnRate);

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

modifierVortox = Create(40380, Types.Modifier, cs(Vortox.color, "Vortox"), rates, null, true);
modifierVortoxSkipMeeting = Create(40381, Types.Modifier, "modifierVortoxSkipMeeting", true, modifierVortox);
modifierVortoxSkipNum = Create(40382, Types.Modifier, "modifierVortoxSkipNum", 4, 1, 10, 1, modifierVortoxSkipMeeting);

modifierLastImpostor = Create(40110, Types.Modifier, cs(Palette.ImpostorRed, "LastImpostor"), false, null, true);
modifierLastImpostorDeduce = Create(40111, Types.Modifier, "modifierLastImpostorDeduce", 5f, 2.5f, 15f, 2.5f, modifierLastImpostor);

Expand Down
9 changes: 5 additions & 4 deletions TheOtherRoles/Patches/EndGamePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)] ref En
var miniLose = Mini.mini != null && gameOverReason == (GameOverReason)CustomGameOverReason.MiniLose;
var jesterWin = Jester.jester != null && gameOverReason == (GameOverReason)CustomGameOverReason.JesterWin;
var witnessWin = Witness.Player != null && gameOverReason == (GameOverReason)CustomGameOverReason.WitnessWin;
var impostorWin = gameOverReason is GameOverReason.ImpostorByKill or GameOverReason.ImpostorBySabotage or GameOverReason.ImpostorByVote;
var impostorWin = (gameOverReason is GameOverReason.ImpostorByKill or GameOverReason.ImpostorBySabotage or GameOverReason.ImpostorByVote)
|| Vortox.triggerImpWin;
var werewolfWin = gameOverReason == (GameOverReason)CustomGameOverReason.WerewolfWin && Werewolf.werewolf.IsAlive();
var juggernautWin = gameOverReason == (GameOverReason)CustomGameOverReason.JuggernautWin && Juggernaut.juggernaut.IsAlive();
var swooperWin = gameOverReason == (GameOverReason)CustomGameOverReason.SwooperWin && Swooper.swooper.IsAlive();
Expand Down Expand Up @@ -485,7 +486,7 @@ public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)] ref En
TempData.winners.Add(new WinningPlayerData(PartTimer.partTimer.Data));
AdditionalTempData.additionalWinConditions.Add(WinCondition.AdditionalPartTimerWin);
}
Message($"游戏结束 {AdditionalTempData.winCondition}");
Message($"游戏结束 {AdditionalTempData.winCondition}", "OnGameEnd");
// Reset Settings
RPCProcedure.resetVariables();
}
Expand Down Expand Up @@ -1038,15 +1039,15 @@ private static bool CheckAndEndGameForJuggernautWin(ShipStatus __instance, Playe

private static bool CheckAndEndGameForImpostorWin(ShipStatus __instance, PlayerStatistics statistics)
{
if (statistics.TeamImpostorsAlive >= statistics.TotalAlive - statistics.TeamImpostorsAlive &&
if (Vortox.triggerImpWin || (statistics.TeamImpostorsAlive >= statistics.TotalAlive - statistics.TeamImpostorsAlive &&
statistics.TeamJackalAlive == 0 &&
statistics.TeamPavlovsAlive == 0 &&
statistics.TeamWerewolfAlive == 0 &&
statistics.TeamSwooperAlive == 0 &&
statistics.TeamArsonistAlive == 0 &&
statistics.TeamAkujoAlive == 0 &&
statistics.TeamJuggernautAlive == 0 &&
!(statistics.TeamImpostorHasAliveLover && statistics.TeamLoversAlive == 2) && !killingCrewAlive())
!(statistics.TeamImpostorHasAliveLover && statistics.TeamLoversAlive == 2) && !killingCrewAlive()))
{
//__instance.enabled = false;
GameOverReason endReason;
Expand Down
63 changes: 46 additions & 17 deletions TheOtherRoles/Patches/ExileControllerPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,25 @@ void createlate(int index)
Helpers.SetActiveAllObject(controller.gameObject.GetChildren(), "RaftAnimation", false);
controller.transform.localPosition = new(-3.75f, -0.2f, -60f);
}
if (Lawyer.lawyer != null && exiled?.Object.PlayerId == Lawyer.target.PlayerId && Lawyer.target != Jester.jester)
{
var writer = StartRPC(PlayerControl.LocalPlayer, CustomRPC.LawyerPromotesToPursuer);
writer.Write(true);
writer.EndRPC();
Lawyer.PromotesToPursuer(true);
}

if (!IsSec) return true;
}

if (Lawyer.lawyer != null && exiled?.Object.PlayerId == Lawyer.target.PlayerId && Lawyer.target != Jester.jester)
{
var writer = StartRPC(PlayerControl.LocalPlayer, CustomRPC.LawyerPromotesToPursuer);
writer.Write(true);
writer.EndRPC();
Lawyer.PromotesToPursuer(true);
}

// Medic shield
if (Medic.medic != null && AmongUsClient.Instance.AmHost && Medic.futureShielded != null && !Medic.medic.Data.IsDead)
{
Expand Down Expand Up @@ -176,7 +192,7 @@ internal class ExileControllerWrapUpPatch
public static void Prefix(GameObject obj)
{
// Nightvision:
if (obj?.name != null && obj.name.Contains("FungleSecurity"))
if (obj != null && obj.name != null && obj.name.Contains("FungleSecurity"))
{
SurveillanceMinigamePatch.resetNightVision();
return;
Expand Down Expand Up @@ -227,27 +243,31 @@ private static void WrapUpPostfix(GameData.PlayerInfo exiled)
AmongUsClient.Instance.FinishRpcImmediately(writer);
Executioner.PromotesRole();
}
else if (Witness.Player == CachedPlayer.LocalPlayer.PlayerControl && Witness.target != null && Witness.killerTarget != null)
if (Witness.target != null && Witness.killerTarget != null)
{
bool skip = exiled == null;
bool skip = exiled == null && Witness.skipMeeting;
bool targetIsKillerAndNotExiled = Witness.target == Witness.killerTarget && (exiled?.Object == null || Witness.target != exiled?.Object);
bool targetIsExiledAndNotKiller = (Witness.target == exiled?.Object || (Witness.meetingDie && Witness.target.IsDead()))
&& Witness.target != Witness.killerTarget;
bool targetIsExiledAndNotKiller = Witness.target != Witness.killerTarget && (Witness.target == exiled?.Object ||
(Witness.meetingDie && Witness.target.IsDead()));

if (targetIsKillerAndNotExiled || targetIsExiledAndNotKiller)
if ((!skip && targetIsKillerAndNotExiled) || targetIsExiledAndNotKiller)
{
Witness.exiledCount++;
}

if (Witness.exiledCount == Witness.exileToWin)
{
var writer = StartRPC(CachedPlayer.LocalPlayer.PlayerControl, CustomRPC.WitnessWin);
writer.EndRPC();
Witness.triggerWitnessWin = true;
}
}
Witness.target = Witness.killerTarget = null;

if (Vortox.Player.IsAlive())
{
Vortox.skipCount++;
if (Vortox.skipCount == Vortox.skipMeetingNum) Vortox.triggerImpWin = true;
}

// Reset custom button timers where necessary
CustomButton.MeetingEndedUpdate();

Expand Down Expand Up @@ -292,7 +312,6 @@ private static void WrapUpPostfix(GameData.PlayerInfo exiled)
})));
}
}

Seer.deadBodyPositions = new List<Vector3>();
}

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

if (InfoSleuth.infoSleuth != null && InfoSleuth.target != null && InfoSleuth.infoSleuth == PlayerControl.LocalPlayer)
{
string msg;
var random = rnd.Next(2);
var isNotCrew = isNeutral(InfoSleuth.target) || InfoSleuth.target.isImpostor();
var team = "的阵营是 " + teamString(InfoSleuth.target);
var isNotCrew = (isNeutral(InfoSleuth.target) || InfoSleuth.target.isImpostor()) ^ Vortox.Reversal;
var team = "的阵营是 " + getTeam(InfoSleuth.target);
var info = InfoSleuth.infoType switch
{
0 => isNotCrew ? "不是船员" : "是船员",
1 => team,
_ => random == 0 ? isNotCrew ? "不是船员" : "是船员" : team,
_ => rnd.Next(2) == 0 ? isNotCrew ? "不是船员" : "是船员" : team,
};

msg = $"{InfoSleuth.target.Data.PlayerName} {info}";
string msg = $"{InfoSleuth.target.Data.PlayerName} {info}";

FastDestroyableSingleton<HudManager>.Instance.Chat.AddChat(PlayerControl.LocalPlayer, $"{msg}");
var writer = StartRPC(PlayerControl.LocalPlayer, CustomRPC.ShareGhostInfo);
Expand All @@ -459,6 +476,19 @@ private static void WrapUpPostfix(GameData.PlayerInfo exiled)
var writer1 = StartRPC(PlayerControl.LocalPlayer, CustomRPC.InfoSleuthNoTarget);
writer1.EndRPC();
RPCProcedure.infoSleuthNoTarget();

static string getTeam(PlayerControl player)
{
if (Vortox.Player.IsAlive())
{
if (player.isCrew()) return rnd.Next(2) == 0 ? "NeutralRolesText".Translate() : "ImpostorRolesText".Translate();
if (isNeutral(player) || player.isImpostor()) return "CrewmateRolesText".Translate();
}

return isNeutral(player) ? "NeutralRolesText".Translate()
: player.isImpostor() ? "ImpostorRolesText".Translate()
: "CrewmateRolesText".Translate();
}
}

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

if (!Yoyo.markStaysOverMeeting)
Silhouette.clearSilhouettes();
if (!Yoyo.markStaysOverMeeting) Silhouette.clearSilhouettes();

if (AmongUsClient.Instance.AmHost)
{
Expand Down
17 changes: 5 additions & 12 deletions TheOtherRoles/Patches/MeetingHudPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,7 @@ private static void mayorToggleVoteTwice(MeetingHud __instance)
__instance.playerStates[0].Cancel(); // This will stop the underlying buttons of the template from showing up
if (__instance.state == VoteStates.Results || Mayor.mayor.Data.IsDead) return;

// Only accept changes until the mayor voted
var mayorPVA = __instance.playerStates.FirstOrDefault(x => x.TargetPlayerId == Mayor.mayor.PlayerId);
if (Mayor.Revealed && mayorPVA != null && mayorPVA.DidVote)
{
SoundEffectsManager.play("fail");
return;
}
Mayor.Revealed = !Mayor.Revealed;
Mayor.Revealed = true;

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

// Add Guesser Buttons
var GuesserRemainingShots = HandleGuesser.remainingShots(CachedPlayer.LocalPlayer.PlayerId);
if (!isGuesser || CachedPlayer.LocalPlayer.Data.IsDead || GuesserRemainingShots <= 0) return;
if (!isGuesser || CachedPlayer.LocalPlayer.IsDead || GuesserRemainingShots <= 0 ||
(PlayerControl.LocalPlayer == WolfLord.Player && WolfLord.Revealed)) return;
{
Doomsayer.CanShoot = true;
for (var i = 0; i < __instance.playerStates.Length; i++)
Expand Down Expand Up @@ -515,7 +509,7 @@ private class MeetingHudBloopAVoteIconPatch
public static bool Prefix(MeetingHud __instance, GameData.PlayerInfo voterPlayer, int index, Transform parent)
{
var spriteRenderer = Object.Instantiate(__instance.PlayerVotePrefab);
var showVoteColors = !GameManager.Instance.LogicOptions.GetAnonymousVotes() || CachedPlayer.LocalPlayer.Data.IsDead ||
var showVoteColors = !GameManager.Instance.LogicOptions.GetAnonymousVotes() || shouldShowGhostInfo() ||
(Prosecutor.prosecutor != null && Prosecutor.prosecutor == CachedPlayer.LocalPlayer.PlayerControl &&
Prosecutor.canSeeVoteColors && TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data).Item1 >=
Prosecutor.tasksNeededToSeeVoteColors) ||
Expand Down Expand Up @@ -734,8 +728,7 @@ private static void Postfix(MeetingHud __instance)
[HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.Deserialize))]
private class MeetingDeserializePatch
{
private static void Postfix(MeetingHud __instance, [HarmonyArgument(0)] MessageReader reader,
[HarmonyArgument(1)] bool initialState)
private static void Postfix(MeetingHud __instance, [HarmonyArgument(0)] MessageReader reader, [HarmonyArgument(1)] bool initialState)
{
// Add swapper buttons
if (initialState) populateButtonsPostfix(__instance);
Expand Down
Loading

0 comments on commit ca5b6bf

Please sign in to comment.