Skip to content

Commit

Permalink
Update v1.1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyx0412 committed Dec 9, 2024
1 parent 4348c9d commit 76696f0
Show file tree
Hide file tree
Showing 29 changed files with 639 additions and 295 deletions.
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
v1.0.9.3更新日志:
v1.1.0.4更新日志

* 换票师:修复换票次数不会减少的问题
* 魅魔:会议中魅魔如果精力衰竭,自杀时会通知其他玩家
* 新增幽灵职业与相关功能!
* 玩家死亡的第一轮无法看到其他玩家的职业信息
* 怨灵(幽灵职业):可以在灵魂状态拾取尸体复活
* 灵魂工程师(幽灵职业):可以使用唯一的一次修复破坏能力
* 污点证人(中立职业):向所有玩家标记凶手,达到一定分数即可独自胜利 (相关信息可查看游戏内的职业介绍)
* 按钮冷却为0时不会重置冷却
* 市长:更改计票时的动画
* 检察官:优化计票时的动画,使其不会与换票师冲突
* 换票师:修复无法换票的问题
* 豺狼:优化职业结构,删除假跟班等选项
* 失忆者:优化职业结构

注:本次仅更新Lite分支
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@

# The Other Us - Edited

<p align="center">若在游玩过程中发现了bug或有一些建议,欢迎提出ISSUE、PR或加入模组交流群:<a href="https://qm.qq.com/q/MlhqY3QcYU">961341019</a></p>
<p align="center">若在游玩过程中发现了bug或有一些建议,欢迎提出ISSUE、PR或加入模组交流群 >>> <a href="https://qm.qq.com/q/MlhqY3QcYU">961341019</a></p>

<p align="center">职业相关Wiki请移步至我的个人博客 >>> <a href="https://www.mxyx.club/archives/theotherus">[沫夏悠轩の聚会 - 模组职业介绍]</p>

## 模组下载

| 游戏版本 | 模组版本 | 发布日期 | 链接 |
| ------------------- | -------- | --------- | ------------------------------------------------------------ |
| 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.1.0.4 | 2024.12.9 | [下载](https://github.com/mxyx-club/TheOtherUs-Edited/releases/download/v1.1.0.4/TheOtherUs-Lite.zip) |
| 2024.3.5 ~ 2024.6.4 | v1.0.9.8 | 2024.11.26 | [下载](https://github.com/mxyx-club/TheOtherUs-Edited/releases/download/v1.0.9.8/TheOtherUs.zip) |
| 2024.3.5 ~ 2024.6.4 | v1.0.9.4 | 2024.11.16 | [下载](https://github.com/mxyx-club/TheOtherUs-Edited/releases/download/v1.0.9.4/TheOtherUs.zip) |
| 2024.3.5 ~ 2024.6.4 | v1.0.9.3 | 2024.11.15 | [下载](https://github.com/mxyx-club/TheOtherUs-Edited/releases/download/v1.0.9.3/TheOtherUs.zip) |
| 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.0/TheOtherUs.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 Down
Binary file modified Strings.xlsx
Binary file not shown.
72 changes: 37 additions & 35 deletions TheOtherRoles/Buttons/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ internal static class HudManagerStartPatch
{
private static bool initialized;

private static readonly float defaultMaxTimer = 0.5f;
private static readonly float multiplier = Mini.mini != null && CachedPlayer.LocalPlayer.PlayerControl == Mini.mini
? Mini.isGrownUp() ? 0.66f : 2f : 1f;
public static CustomButton ghostEngineerButton;
Expand All @@ -42,7 +41,6 @@ internal static class HudManagerStartPatch
private static CustomButton usePortalButton;
private static CustomButton portalmakerMoveToPortalButton;
public static CustomButton hackerButton;
//private static CustomButton changeChatButton;
public static CustomButton hackerVitalsButton;
public static CustomButton hackerAdminTableButton;
public static CustomButton trackerTrackPlayerButton;
Expand Down Expand Up @@ -117,6 +115,7 @@ internal static class HudManagerStartPatch
public static TMP_Text portalmakerButtonText1;
public static TMP_Text portalmakerButtonText2;
public static TMP_Text PavlovsdogKillSelfText;
public static TMP_Text PavlovsdogCreateNumText;
public static TMP_Text akujoTimeRemainingText;
public static TMP_Text akujoBackupLeftText;

Expand All @@ -135,18 +134,19 @@ public static void setCustomButtonCooldowns()
yoyoButton.MaxTimer = Yoyo.markCooldown;
yoyoAdminTableButton.MaxTimer = Yoyo.adminCooldown;
yoyoAdminTableButton.EffectDuration = 10f;
engineerRepairButton.MaxTimer = defaultMaxTimer;
ghostEngineerButton.MaxTimer = defaultMaxTimer;
engineerRepairButton.MaxTimer = 0f;
ghostEngineerButton.Timer = ghostEngineerButton.MaxTimer = 0f;
specterRememberButton.MaxTimer = 15f;
sheriffKillButton.MaxTimer = Sheriff.cooldown;
deputyHandcuffButton.MaxTimer = Deputy.handcuffCooldown;
timeMasterShieldButton.MaxTimer = TimeMaster.cooldown;
veteranAlertButton.MaxTimer = Veteran.cooldown;
survivorVestButton.MaxTimer = Survivor.vestCooldown;
survivorBlanksButton.MaxTimer = Survivor.blanksCooldown;
medicShieldButton.MaxTimer = defaultMaxTimer;
shifterShiftButton.MaxTimer = defaultMaxTimer;
disperserDisperseButton.MaxTimer = defaultMaxTimer;
buttonBarryButton.MaxTimer = defaultMaxTimer;
medicShieldButton.MaxTimer = 0f;
shifterShiftButton.MaxTimer = 0f;
disperserDisperseButton.MaxTimer = 0f;
buttonBarryButton.MaxTimer = 0f;
morphlingButton.MaxTimer = Morphling.cooldown;
butcherDissectionButton.MaxTimer = Butcher.dissectionCooldown;
bomberBombButton.MaxTimer = Bomber.cooldown;
Expand All @@ -158,13 +158,13 @@ public static void setCustomButtonCooldowns()
hackerVitalsButton.MaxTimer = Hacker.cooldown;
hackerAdminTableButton.MaxTimer = Hacker.cooldown;
vampireKillButton.MaxTimer = Vampire.cooldown;
trackerTrackPlayerButton.MaxTimer = defaultMaxTimer;
trackerTrackPlayerButton.MaxTimer = 0f;
jumperMarkButton.MaxTimer = Jumper.JumpTime;
jumperJumpButton.MaxTimer = Jumper.JumpTime;
escapistMarkButton.MaxTimer = Escapist.EscapeTime;
escapistEscapeButton.MaxTimer = Escapist.EscapeTime;
bodyGuardGuardButton.MaxTimer = defaultMaxTimer;
garlicButton.MaxTimer = defaultMaxTimer;
bodyGuardGuardButton.MaxTimer = 0f;
garlicButton.MaxTimer = 0f;
jackalKillButton.MaxTimer = Jackal.cooldown;
werewolfKillButton.MaxTimer = Werewolf.killCooldown;
sidekickKillButton.MaxTimer = Jackal.cooldown;
Expand All @@ -173,17 +173,15 @@ public static void setCustomButtonCooldowns()
placeJackInTheBoxButton.MaxTimer = Trickster.placeBoxCooldown;
lightsOutButton.MaxTimer = Trickster.lightsOutCooldown;
cleanerCleanButton.MaxTimer = Cleaner.cooldown;
undertakerDragButton.MaxTimer = defaultMaxTimer;
undertakerDragButton.MaxTimer = 0f;
warlockCurseButton.MaxTimer = Warlock.cooldown;
securityGuardButton.MaxTimer = SecurityGuard.cooldown;
securityGuardCamButton.MaxTimer = SecurityGuard.cooldown;
arsonistButton.MaxTimer = Arsonist.cooldown;
vultureEatButton.MaxTimer = Vulture.cooldown;
amnisiacRememberButton.MaxTimer = defaultMaxTimer;
specterRememberButton.MaxTimer = 10f;
amnisiacRememberButton.MaxTimer = 0f;
grenadierFlashButton.MaxTimer = Grenadier.cooldown;
bomberGiveButton.MaxTimer = 0f;
bomberGiveButton.Timer = 0f;
bomberGiveButton.MaxTimer = bomberGiveButton.Timer = 0f;
partTimerButton.MaxTimer = PartTimer.cooldown;
mediumButton.MaxTimer = Medium.cooldown;
pursuerButton.MaxTimer = Pursuer.cooldown;
Expand All @@ -205,17 +203,16 @@ public static void setCustomButtonCooldowns()
evilTrapperSetTrapButton.MaxTimer = EvilTrapper.cooldown;

doomsayerButton.MaxTimer = Doomsayer.cooldown;
akujoHonmeiButton.MaxTimer = defaultMaxTimer;
akujoBackupButton.MaxTimer = defaultMaxTimer;
akujoHonmeiButton.MaxTimer = 0f;
akujoBackupButton.MaxTimer = 0f;

pavlovsdogsKillButton.MaxTimer = Pavlovsdogs.cooldown;
pavlovsownerCreateDogButton.MaxTimer = Pavlovsdogs.createDogCooldown;

mayorMeetingButton.MaxTimer = defaultMaxTimer;
mayorMeetingButton.MaxTimer = 0f;
trapperButton.MaxTimer = Trapper.cooldown;
terroristButton.MaxTimer = Terrorist.bombCooldown;
defuseButton.MaxTimer = defaultMaxTimer;
defuseButton.Timer = defaultMaxTimer;
defuseButton.MaxTimer = defuseButton.Timer = 0f;

butcherDissectionButton.EffectDuration = Butcher.dissectionDuration;
timeMasterShieldButton.EffectDuration = TimeMaster.shieldDuration;
Expand All @@ -239,10 +236,7 @@ public static void setCustomButtonCooldowns()
securityGuardCamButton.EffectDuration = SecurityGuard.duration;
defuseButton.EffectDuration = Terrorist.defuseDuration;
terroristButton.EffectDuration = Terrorist.destructionTime + Terrorist.bombActiveAfter;
// Already set the timer to the max, as the button is enabled during the game and not available at the start
lightsOutButton.Timer = lightsOutButton.MaxTimer;
zoomOutButton.MaxTimer = 0f;
//changeChatButton.MaxTimer = 0f;
zoomOutButton.MaxTimer = zoomOutButton.Timer = 0f;
}

public static void showTargetNameOnButton(PlayerControl target, CustomButton button, string defaultText)
Expand Down Expand Up @@ -275,7 +269,6 @@ private static void addReplacementHandcuffedButton(CustomButton button, Vector3?
replacementHandcuffedButton.Timer = replacementHandcuffedButton.EffectDuration;
replacementHandcuffedButton.actionButton.cooldownTimerText.color = new Color(0F, 0.8F, 0F);
replacementHandcuffedButton.isEffectActive = true;
replacementHandcuffedButton.hotkey = KeyCode.V;
if (deputyHandcuffedButtons.ContainsKey(CachedPlayer.LocalPlayer.PlayerId))
deputyHandcuffedButtons[CachedPlayer.LocalPlayer.PlayerId].Add(replacementHandcuffedButton);
else
Expand Down Expand Up @@ -555,15 +548,15 @@ public static void createButtonsPostfix(HudManager __instance)
() =>
{
return GhostEngineer.player != null && GhostEngineer.player == CachedPlayer.LocalPlayer.PlayerControl &&
!GhostEngineer.Fixes && CachedPlayer.LocalPlayer.Data.IsDead && !GhostEngineer.Fixes;
!GhostEngineer.Fixes && CachedPlayer.LocalPlayer.Data.IsDead;
},
() =>
{
return isSabotageActive() && GhostEngineer.Fixes && CachedPlayer.LocalPlayer.PlayerControl.CanMove;
return isSabotageActive() && CachedPlayer.LocalPlayer.PlayerControl.CanMove;
},
() => { },
Engineer.buttonSprite,
ButtonPositions.upperRowRight,
ButtonPositions.upperRowCenter,
__instance,
abilityInput.keyCode,
buttonText: GetString("RepairText")
Expand Down Expand Up @@ -2118,7 +2111,6 @@ public static void createButtonsPostfix(HudManager __instance)
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.pavlovsCreateDog(Pavlovsdogs.currentTarget.PlayerId);
SoundEffectsManager.play("jackalSidekick");
Pavlovsdogs.createDogNum -= 1;

_ = new LateTask(LastImpostor.promoteToLastImpostor, 0.5f);

Expand All @@ -2133,6 +2125,9 @@ public static void createButtonsPostfix(HudManager __instance)
},
() =>
{
if (PavlovsdogCreateNumText != null)
PavlovsdogCreateNumText.text = $"{Pavlovsdogs.createDogNum}";

showTargetNameOnButton(Pavlovsdogs.currentTarget, pavlovsownerCreateDogButton, GetString("pavlovsCreateDogText"));
// Show now text since the button already says sidekick
return Pavlovsdogs.currentTarget != null && CachedPlayer.LocalPlayer.PlayerControl.CanMove;
Expand All @@ -2144,6 +2139,14 @@ public static void createButtonsPostfix(HudManager __instance)
abilityInput.keyCode
);

PavlovsdogCreateNumText = Object.Instantiate(pavlovsownerCreateDogButton.actionButton.cooldownTimerText,
pavlovsownerCreateDogButton.actionButton.cooldownTimerText.transform.parent);
PavlovsdogCreateNumText.text = "";
PavlovsdogCreateNumText.enableWordWrapping = false;
PavlovsdogCreateNumText.transform.localScale = Vector3.one * 0.5f;
PavlovsdogCreateNumText.transform.localPosition += new Vector3(-0.05f, 0.55f, -1f);


minerMineButton = new CustomButton(
() =>
{
Expand Down Expand Up @@ -3209,11 +3212,10 @@ public static void createButtonsPostfix(HudManager __instance)
{
var playerInfo = GameData.Instance.GetPlayerById(component.ParentId);

var writer = AmongUsClient.Instance.StartRpcImmediately(
CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.AmnisiacTakeRole,
SendOption.Reliable);
var writer = StartRPC(CachedPlayer.LocalPlayer.PlayerControl, CustomRPC.AmnisiacTakeRole);
writer.Write(playerInfo.PlayerId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
writer.Write(PlayerControl.LocalPlayer.PlayerId);
writer.EndRPC();
Amnisiac.TakeRole(playerInfo.PlayerId, PlayerControl.LocalPlayer.PlayerId);
break;
}
Expand Down Expand Up @@ -3265,7 +3267,7 @@ public static void createButtonsPostfix(HudManager __instance)
__instance,
abilityInput.keyCode,
true,
2f,
1.5f,
() =>
{
foreach (var collider2D in Physics2D.OverlapCircleAll(CachedPlayer.LocalPlayer.PlayerControl.GetTruePosition(),
Expand Down
8 changes: 4 additions & 4 deletions TheOtherRoles/Buttons/CustomButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public CustomButton(Action OnClick, Func<bool> HasButton, Func<bool> CouldUse, A
button.OnClick = new Button.ButtonClickedEvent();
button.OnClick.AddListener((UnityAction)onClickEvent);

Timer = ModOption.ButtonCooldown + 8.5f;
Timer = 10.5f;
SetHotKeyGuide();
setActive(false);
}
Expand Down Expand Up @@ -134,12 +134,14 @@ public static void MeetingEndedUpdate()

public static void ResetAllCooldowns(float Time = -1)
{
var time = Time == -1 ? ModOption.KillCooddown : Time;
CachedPlayer.LocalPlayer.PlayerControl.killTimer = time;
foreach (var t in buttons)
{
var maxTime = Time == -1 ? t.MaxTimer : Time;
try
{
t.Timer = maxTime;
t.Timer = t.MaxTimer == 0 ? 0 : maxTime;
t.DeputyTimer = maxTime;
t.Update();
}
Expand All @@ -148,8 +150,6 @@ public static void ResetAllCooldowns(float Time = -1)
Error($"NullReferenceException from MeetingEndedUpdate().HasButton(), if theres only one warning its fine\n{e}", "CustomButton");
}
}
var time = Time == -1 ? ModOption.KillCooddown : Time;
CachedPlayer.LocalPlayer.PlayerControl.killTimer = time;
}

public static void resetKillButton(PlayerControl p, float time = -1)
Expand Down
9 changes: 9 additions & 0 deletions TheOtherRoles/GameHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,13 @@ public static int GetKillCount(PlayerControl killer)

return DeadPlayers.Count(dp => dp.KillerIfExisting == killer && dp.Player != killer);
}

public static PlayerControl GetLastKiller()
{
var db = DeadPlayers.Where(dp => dp.Player != dp.KillerIfExisting && dp.KillerIfExisting.IsAlive())?
.OrderByDescending(dp => dp.TimeOfDeath)
.FirstOrDefault().KillerIfExisting;
Message($"GetLastKiller {db?.Data?.PlayerName ?? ""}");
return db;
}
}
2 changes: 1 addition & 1 deletion TheOtherRoles/Helper/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public static class Helpers
/// </summary>
public static bool hasFakeTasks(this PlayerControl player)
{
if (player == Specter.player) return false;
return player == Werewolf.werewolf ||
player == Doomsayer.doomsayer ||
player == Juggernaut.juggernaut ||
Expand All @@ -98,6 +97,7 @@ public static bool hasFakeTasks(this PlayerControl player)
player == Witness.player ||
player == PartTimer.partTimer ||
player == Akujo.akujo ||
player == Specter.player ||
player == Swooper.swooper ||
player == Lawyer.lawyer ||
player == Executioner.executioner ||
Expand Down
Loading

0 comments on commit 76696f0

Please sign in to comment.