Skip to content

Commit

Permalink
Update v1.0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyx0412 committed Nov 15, 2024
1 parent 1c6159c commit f032cde
Show file tree
Hide file tree
Showing 37 changed files with 779 additions and 816 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,5 @@ jobs:
files: |
TheOtherUs.dll
./TheOtherUs.zip
draft: true
draft: false
prerelease: false
17 changes: 9 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
v1.0.8.8-Beta更新日志:
v1.0.9.3更新日志:

* 新增伪装者职业:掷弹兵(技能图标未完成)
* 新增选项: "禁用破坏功能", 可以直接禁用所有破坏(但可以关门)
* 新增选项:"诅咒模式", 将小部分的任务难度加强到地狱级
* 修复大神官能多次使用技能的问题
* 修复巴甫洛夫无法破坏的问题

注:本次为Beta测试版,30天后版本过期
* 继续完善职业介绍
* 重做纵火狂:现在可随时点火,但需要在已涂油目标附近才可点火
* 纵火狂:更改为击杀型中立,游戏存在纵火狂时不会结束
* 市长:已死亡的玩家可以看见已揭示的市长名称变色
* 魅魔:修复选项 “魅魔不招募备胎会自杀” ,如果该选项开启时,备胎数量少于1且招募时间结束则会自杀。
* 魅魔:在非跟随胜利的场景时,如果场上不存在杀手玩家,则直接夺取船员胜利(包括恋人)
* 巨人:在小黑人时,会恢复正常的体型与速度
* 还有一部分小更改
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

| 游戏版本 | 模组版本 | 发布日期 | 链接 |
| ------------------- | -------- | --------- | ------------------------------------------------------------ |
| 2024.8.13 ~ 2024.10.29 | v2.0.0.0 | 即将推出 | [下载](https://github.com/mxyx-club/TheOtherUs-Edited/releases/download/v1.0.8.7/TheOtherUs.zip) |
| 2024.8.13 ~ 2024.10.29 | v2.0.0.0 | 即将推出 | |
| 2024.3.5 ~ 2024.6.4 | v1.1.0.0 | 即将推出 | |
| 2024.3.5 ~ 2024.6.4 | v1.0.9.0 | 2024.11.5 | [下载](https://github.com/mxyx-club/TheOtherUs-Edited/releases/download/v1.0.9.0TheOtherUs.zip) |
| 2024.3.5 ~ 2024.6.4 | v1.0.8.7 | 2024.10.24 | [下载](https://github.com/mxyx-club/TheOtherUs-Edited/releases/download/v1.0.8.7/TheOtherUs.zip) |
| 2024.3.5 ~ 2024.6.4 | v1.0.8.6 | 2024.10.18 | [下载](https://github.com/mxyx-club/TheOtherUs-Edited/releases/download/v1.0.8.6/TheOtherUs.zip) |
| 2024.3.5 ~ 2024.6.4 | v1.0.7.7 | 2024.9.16 | [下载](https://github.com/mxyx-club/TheOtherUs-Edited/releases/download/v1.0.7.7/TheOtherUs.zip) |
Expand All @@ -37,6 +39,29 @@

## 更新日志

### v1.0.9.0:

* 完善职业介绍
* 游戏内添加职业介绍按钮(可按H打开)
* 优化游戏内按钮布局
* 新增伪装者职业:掷弹兵
* 新增选项: "禁用破坏功能", 可以直接禁用所有破坏(但可以关门)
* 新增选项:"诅咒模式", 将小部分的任务难度加强
* 反骨:隐藏职业时,可以分配到已有附加能力的玩家中。
* 破平者:重做逻辑,现在为全局1.5票,不会与其它职业冲突。
* 大神官:现在不会出现与破平冲突导致驱除出错的问题了
* 大神官:更换会议界面背景图片
* 抹除者:修复抹除刀余波时会导致房主会卡在驱逐画面的问题
* 专业刺客:优化赌怪猜测,修复猜错后无法继续猜测下一位玩家的问题。
* 身份窃贼:修复击杀巴甫洛夫阵营时会出现一个人同时是"巴甫洛夫"和"巴甫洛夫的狗"的问题
* 修正部分预设问题
* 修复巴甫洛夫无法破坏的问题
* 修复大神官能多次使用技能的问题
* 修复一个玩家有可能获得两个附加能力的问题

<details>
<summary>点我查看更多更新日志</summary>

### v1.0.8.7:

* 修复部分情况下刺客无法连赌的问题
Expand All @@ -58,9 +83,6 @@
* 可以使用F11键位控制游戏分辨率大小
* 添加 "最小/最大 独立阵营杀手数" 调整选项,如果这两项都是随机,则使用原先的概率分配。

<details>
<summary>点我查看更多更新日志</summary>

### v1.0.7.7:

- #### Bug修复与其它优化:
Expand Down
Binary file modified Strings.xlsx
Binary file not shown.
76 changes: 51 additions & 25 deletions TheOtherRoles/Buttons/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Hazel;
using TheOtherRoles.CustomGameModes;
using TheOtherRoles.Objects;
using TheOtherRoles.Options;
using TheOtherRoles.Patches;
using TheOtherRoles.Utilities;
using TMPro;
Expand Down Expand Up @@ -66,6 +67,7 @@ internal static class HudManagerStartPatch
public static CustomButton securityGuardButton;
public static CustomButton securityGuardCamButton;
public static CustomButton arsonistButton;
public static CustomButton arsonistKillButton;
public static CustomButton vultureEatButton;
public static CustomButton mediumButton;
public static CustomButton pursuerButton;
Expand Down Expand Up @@ -274,7 +276,6 @@ public static void setCustomButtonCooldowns()
lightsOutButton.Timer = lightsOutButton.MaxTimer;
zoomOutButton.MaxTimer = 0f;
//changeChatButton.MaxTimer = 0f;

}

public static void showTargetNameOnButton(PlayerControl target, CustomButton button, string defaultText)
Expand Down Expand Up @@ -1151,7 +1152,7 @@ public static void createButtonsPostfix(HudManager __instance)
() =>
{
if (Morphling.sampledTarget == null) showTargetNameOnButton(Morphling.currentTarget, morphlingButton, getString("SampleText"));
return (Morphling.currentTarget || Morphling.sampledTarget) && !isActiveCamoComms() &&
return (Morphling.currentTarget || Morphling.sampledTarget) && !isActiveCamoComms &&
CachedPlayer.LocalPlayer.PlayerControl.CanMove && !MushroomSabotageActive();
},
() =>
Expand Down Expand Up @@ -1200,7 +1201,7 @@ public static void createButtonsPostfix(HudManager __instance)
Camouflager.camouflager == CachedPlayer.LocalPlayer.PlayerControl &&
!CachedPlayer.LocalPlayer.Data.IsDead;
},
() => { return !isActiveCamoComms() && CachedPlayer.LocalPlayer.PlayerControl.CanMove; },
() => { return !isActiveCamoComms && CachedPlayer.LocalPlayer.PlayerControl.CanMove; },
() =>
{
camouflagerButton.Timer = camouflagerButton.MaxTimer;
Expand Down Expand Up @@ -3019,22 +3020,10 @@ public static void createButtonsPostfix(HudManager __instance)
arsonistButton = new CustomButton(
() =>
{
var dousedEveryoneAlive = Arsonist.dousedEveryoneAlive();
if (dousedEveryoneAlive)
{
var winWriter = AmongUsClient.Instance.StartRpcImmediately(
CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.ArsonistWin, SendOption.Reliable);
AmongUsClient.Instance.FinishRpcImmediately(winWriter);
RPCProcedure.arsonistWin();
arsonistButton.HasEffect = false;
}
else if (Arsonist.currentTarget != null)
{
if (checkAndDoVetKill(Arsonist.currentTarget)) return;
Arsonist.douseTarget = Arsonist.currentTarget;
arsonistButton.HasEffect = true;
SoundEffectsManager.play("arsonistDouse");
}
if (checkAndDoVetKill(Arsonist.currentTarget)) return;
Arsonist.douseTarget = Arsonist.currentTarget;
arsonistButton.HasEffect = true;
SoundEffectsManager.play("arsonistDouse");
},
() =>
{
Expand All @@ -3046,7 +3035,6 @@ public static void createButtonsPostfix(HudManager __instance)
var dousedEveryoneAlive = Arsonist.dousedEveryoneAlive();
if (!dousedEveryoneAlive)
showTargetNameOnButton(Arsonist.currentTarget, arsonistButton, getString("DouseText"));
if (dousedEveryoneAlive) arsonistButton.actionButton.graphic.sprite = Arsonist.igniteSprite;

if (arsonistButton.isEffectActive && Arsonist.douseTarget != Arsonist.currentTarget)
{
Expand All @@ -3055,8 +3043,7 @@ public static void createButtonsPostfix(HudManager __instance)
arsonistButton.isEffectActive = false;
}

return CachedPlayer.LocalPlayer.PlayerControl.CanMove &&
(dousedEveryoneAlive || Arsonist.currentTarget != null);
return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Arsonist.currentTarget != null;
},
() =>
{
Expand All @@ -3065,7 +3052,7 @@ public static void createButtonsPostfix(HudManager __instance)
Arsonist.douseTarget = null;
},
Arsonist.douseSprite,
ButtonPositions.lowerRowRight,
ButtonPositions.upperRowRight,
__instance,
abilityInput.keyCode,
true,
Expand All @@ -3074,8 +3061,8 @@ public static void createButtonsPostfix(HudManager __instance)
{
if (Arsonist.douseTarget != null) Arsonist.dousedPlayers.Add(Arsonist.douseTarget);

arsonistButton.Timer = Arsonist.dousedEveryoneAlive() ? 0 : arsonistButton.MaxTimer;

arsonistButton.Timer = arsonistButton.MaxTimer;
arsonistKillButton.Timer = arsonistButton.MaxTimer;
foreach (var p in Arsonist.dousedPlayers)
if (ModOption.playerIcons.ContainsKey(p.PlayerId))
ModOption.playerIcons[p.PlayerId].setSemiTransparent(false);
Expand All @@ -3092,6 +3079,45 @@ public static void createButtonsPostfix(HudManager __instance)
}
);

// Arsonist button
arsonistKillButton = new CustomButton(
() =>
{
foreach (PlayerControl p in Arsonist.dousedPlayers.Where(p => p.IsAlive()))
{
checkMurderAttemptAndKill(Arsonist.arsonist, p, false, false, false);
GameHistory.overrideDeathReasonAndKiller(p, DeadPlayer.CustomDeathReason.Arson, Arsonist.arsonist);
}
Message("点火");
arsonistKillButton.Timer = arsonistKillButton.MaxTimer;
arsonistButton.Timer = arsonistButton.MaxTimer;
},
() =>
{
return Arsonist.arsonist != null && Arsonist.arsonist == CachedPlayer.LocalPlayer.PlayerControl &&
CachedPlayer.LocalPlayer.IsAlive && Arsonist.dousedPlayers != null && Arsonist.dousedPlayers.Count > 0;
},
() =>
{
showTargetNameOnButton(Arsonist.currentTarget2, arsonistKillButton, getString("IgniteText"));
return CachedPlayer.LocalPlayer.PlayerControl.CanMove && Arsonist.currentTarget2 != null && Arsonist.dousedPlayers.Any(p => p == Arsonist.currentTarget2);
},
() =>
{
/*var alivePlayersList = PlayerControl.AllPlayerControls.ToArray().Where(pc => !pc.Data.IsDead);
var count = alivePlayersList.Count(pc => isNeutral(pc) && pc.isKiller());
if (count < 1) arsonistKillButton.Timer = arsonistKillButton.MaxTimer = 0f;
else */
arsonistKillButton.Timer = arsonistKillButton.MaxTimer;
},
Arsonist.igniteSprite,
ButtonPositions.upperRowCenter,
__instance,
modKillInput.keyCode,
buttonText: getString("IgniteText")
);

// Vulture Eat
vultureEatButton = new CustomButton(
() =>
Expand Down
71 changes: 22 additions & 49 deletions TheOtherRoles/Helper/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public enum SabatageTypes
None
}

public enum RoleTeam
public enum RoleType
{
Crewmate,
Impostor,
Expand Down Expand Up @@ -288,7 +288,7 @@ public static bool isShiftNeutral(PlayerControl player)
public static bool isNeutral(PlayerControl player)
{
var roleInfo = RoleInfo.getRoleInfoForPlayer(player, false).FirstOrDefault();
return roleInfo != null && roleInfo.roleTeam == RoleTeam.Neutral;
return roleInfo != null && roleInfo.roleTeam == RoleType.Neutral;
}

public static bool isKillerNeutral(PlayerControl player)
Expand Down Expand Up @@ -389,7 +389,7 @@ public static bool roleCanSabotage(this PlayerControl player)
return roleCouldUse;
}

public static SabatageTypes getActiveSabo()
public static SabatageTypes GetActiveSabo()
{
foreach (var task in CachedPlayer.LocalPlayer.PlayerControl.myTasks.GetFastEnumerator())
if (task.TaskType == TaskTypes.FixLights)
Expand All @@ -405,27 +405,21 @@ public static SabatageTypes getActiveSabo()
return SabatageTypes.None;
}

public static bool isLightsActive() => getActiveSabo() == SabatageTypes.Lights;
public static bool isLightsActive => GetActiveSabo() == SabatageTypes.Lights;

public static bool isCommsActive() => getActiveSabo() == SabatageTypes.Comms;
public static bool isCommsActive => GetActiveSabo() == SabatageTypes.Comms;

public static bool isCamoComms() => isCommsActive() && ModOption.camoComms;
public static bool isReactor => GetActiveSabo() is SabatageTypes.Reactor or SabatageTypes.O2;

public static bool isActiveCamoComms() => isCamoComms() && Camouflager.camoComms;
public static bool isCamoComms => isCommsActive && ModOption.camoComms;

public static bool wasActiveCamoComms() => !isCamoComms() && Camouflager.camoComms;
public static bool isActiveCamoComms => isCamoComms && Camouflager.camoComms;

public static bool sabotageActive()
{
var sabSystem = ShipStatus.Instance.Systems[SystemTypes.Sabotage].CastFast<SabotageSystemType>();
return sabSystem.AnyActive;
}
public static bool wasActiveCamoComms => !isCamoComms && Camouflager.camoComms;

public static float sabotageTimer()
{
var sabSystem = ShipStatus.Instance.Systems[SystemTypes.Sabotage].CastFast<SabotageSystemType>();
return sabSystem.Timer;
}
public static bool sabotageActive => ShipStatus.Instance.Systems[SystemTypes.Sabotage].CastFast<SabotageSystemType>().AnyActive;

public static float sabotageTimer => ShipStatus.Instance.Systems[SystemTypes.Sabotage].CastFast<SabotageSystemType>().Timer;

public static bool canUseSabotage()
{
Expand Down Expand Up @@ -479,27 +473,6 @@ public static int getAvailableId()
}
}

public static void turnToCrewmate(PlayerControl player)
{
var writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId,
(byte)CustomRPC.TurnToCrewmate, SendOption.Reliable);
writer.Write(player.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.turnToCrewmate(player.PlayerId);
foreach (var player2 in PlayerControl.AllPlayerControls)
if (player2.Data.Role.IsImpostor && CachedPlayer.LocalPlayer.PlayerControl.Data.Role.IsImpostor)
player.cosmetics.nameText.color = Palette.White;
}

public static void turnToCrewmate(List<PlayerControl> players, PlayerControl player)
{
foreach (var p in players)
{
if (p == player) continue;
turnToCrewmate(p);
}
}

public static void turnToImpostorRPC(PlayerControl player)
{
var writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId,
Expand Down Expand Up @@ -529,9 +502,9 @@ public static void showTargetNameOnButton(PlayerControl target, CustomButton but
// Should the button show the target name option
string text;
// set text to default if camo is on
if (Camouflager.camouflageTimer >= 0.1f || isCamoComms()) text = defaultText;
if (Camouflager.camouflageTimer >= 0.1f || isCamoComms) text = defaultText;
// set to default if lights are out
else if (isLightsActive()) text = defaultText;
else if (isLightsActive) text = defaultText;
// set to default if trickster ability is active
else if (Trickster.trickster != null && Trickster.lightsOutTimer > 0f) text = defaultText;
// set to morphed player
Expand Down Expand Up @@ -680,7 +653,7 @@ public static List<RoleInfo> allRoleInfos()
var allRoleInfo = new List<RoleInfo>();
foreach (var role in RoleInfo.allRoleInfos)
{
if (role.roleTeam == RoleTeam.Modifier) continue;
if (role.roleTeam == RoleType.Modifier) continue;
allRoleInfo.Add(role);
}
return allRoleInfo;
Expand Down Expand Up @@ -841,15 +814,15 @@ public static async Task checkBeta()
}
}

public static Color getTeamColor(RoleTeam team)
public static Color getTeamColor(RoleType team)
{
return team switch
{
RoleTeam.Crewmate => Color.white,
RoleTeam.Impostor => Palette.ImpostorRed,
RoleTeam.Neutral => Color.gray,
RoleTeam.Modifier => Color.yellow,
RoleTeam.Special => Palette.Purple,
RoleType.Crewmate => Color.white,
RoleType.Impostor => Palette.ImpostorRed,
RoleType.Neutral => Color.gray,
RoleType.Modifier => Color.yellow,
RoleType.Special => Palette.Purple,
_ => Palette.White
};
}
Expand Down Expand Up @@ -1029,7 +1002,7 @@ public static KeyValuePair<byte, int> MaxPair(this Dictionary<byte, int> self, o
public static bool hidePlayerName(PlayerControl source, PlayerControl target)
{
var localPlayer = PlayerControl.LocalPlayer;
if (Camouflager.camouflageTimer > 0f || MushroomSabotageActive() || isCamoComms())
if (Camouflager.camouflageTimer > 0f || MushroomSabotageActive() || isCamoComms)
return true; // No names are visible
if (SurveillanceMinigamePatch.nightVisionIsActive) return true;
if (Ninja.isInvisble && Ninja.ninja == target) return true;
Expand Down
Loading

0 comments on commit f032cde

Please sign in to comment.