Skip to content

Commit

Permalink
Update v1.1.2.5 Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyx0412 committed Feb 15, 2025
1 parent 95a14a0 commit d5844ed
Show file tree
Hide file tree
Showing 32 changed files with 556 additions and 214 deletions.
18 changes: 6 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
v1.1.2.2更新日志
v1.1.2.5更新日志

* 新增驱逐显示,可自定义驱逐玩家时显示的信息
* 优化游戏选项中常规选项的页面排版显示
* 律师的目标如果掉线则律师会变成起诉人

问题修复:

* 炸弹狂、纵火狂技能无法寻到目标
* 怨灵会被分配到豺狼阵营
* 非红狼阵营的职业无法使用键盘进入通风口
* 污点证人在部分情况下无法得分
* 鹈鹕被击杀时会卡在原地
* 新增船员职业:牧师
* 删除附加能力:酒鬼
* 在下载帽子时,如果配置文件下载失败则自动加载本地配置
* 修复有玩家复活时会重置其他玩家技能冷却的问题
* 修复了一些已知问题
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,21 +468,20 @@
| 送葬者 | 巴甫洛夫 | 侦探 | 溅血者 |
| 逃逸者 | 巴甫洛夫的狗 | 老兵 | 通讯兵 |
| 术士 | 隐身人 | 时间之主 | 破平者 |
| 骗术师 | 纵火犯 | 换票师 | 闪电侠 |
| 骗术师 | 纵火狂 | 换票师 | 闪电侠 |
| 赏金猎人 | 月下狼人 | 黑客 | 多线程 |
| 恐怖分子 | 身份窃贼 | 灵媒 | 巨人 |
| 恐怖分子 | 鹈鹕 | 灵媒 | 巨人 |
| 勒索者 | 天启 | 传送师 | 小孩 |
| 女巫 | 末日预言家 | 追踪者 | Vip |
| 忍者 | 魅魔 | 告密者 | 不屈者 |
| 悠悠球 | 打工仔 | 卧底 | 反骨 |
| 邪恶的设陷师 | | 保安 | 管道工程师 |
| 肢解者 | | 通灵师 | 酒鬼 |
| 赌徒 | | 设陷师 | 胆小鬼 |
| 掷弹兵 | | 预言家 | 窥视者 |
| | | 情报师 | 雷达 |
| | | 大神官 | 执钮人 |
| | | | 变色龙 |
| | | | 交换师 |
| 邪恶的设陷师 | 身份窃贼 | 保安 | 管道工程师 |
| 肢解者 | | 通灵师 | 胆小鬼 |
| 赌徒 | | 设陷师 | 窥视者 |
| 掷弹兵 | | 预言家 | 雷达 |
| 狼之主 | | 情报师 | 执钮人 |
| | | 大神官 | 变色龙 |
| | | 牧师 | 交换师 |

## 错误报告

Expand Down
15 changes: 7 additions & 8 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,17 @@ Even more roles are coming soon.
| Warlock | Swooper | Time Master | Tiebreaker |
| Trickster | Arsonist | Swapper | Flash |
| Bounty Hunter | Werewolf | Hacker | Multitasker |
| Terrorist | Thief | Seer | Giant |
| Terrorist | Pelican | Seer | Giant |
| Blackmailer | Juggernaut | Jumper | Mini |
| Witch | Doomsayer | Tracker | Vip |
| Ninja | Akujo | Snitch | Indomitable |
| Yo-Yo | PartTimer | Spy | Slueth |
| Evil Trapper | | SecurityGuard | Cursed |
| Butcher [Beta] | | Medium | Invert |
| Gambler | | Trapper | Blind |
| Grenadier | | Prophet | Watcher |
| | | Info Sleuth | Radar |
| | | | Button Barry |
| | | | Chameleon |
| Evil Trapper | Thief | SecurityGuard | Cursed |
| Butcher [Beta] | | Medium | Blind |
| Gambler | | Trapper | Watcher |
| Grenadier | | Prophet | Radar |
| WolfLord | | Info Sleuth | Button Barry |
| | | Redemptor | Chameleon |
| | | | Shifter |

## Credits & Resources
Expand Down
Binary file modified Strings.xlsx
Binary file not shown.
163 changes: 149 additions & 14 deletions TheOtherRoles/Buttons/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ internal static class HudManagerStartPatch
public static CustomButton defuseButton;
public static CustomButton zoomOutButton;
public static CustomButton roleSummaryButton;
public static CustomButton redemptorReviveButton;
public static CustomButton redemptorRevelationButton;
public static CustomButton redemptorPrayerButton;

public static Dictionary<byte, List<CustomButton>> deputyHandcuffedButtons;
public static PoolablePlayer targetDisplay;
Expand Down Expand Up @@ -201,7 +204,9 @@ public static void setCustomButtonCooldowns()
juggernautKillButton.MaxTimer = Juggernaut.cooldown;
swooperKillButton.MaxTimer = Swooper.cooldown;
evilTrapperSetTrapButton.MaxTimer = EvilTrapper.cooldown;

redemptorReviveButton.MaxTimer = 10f;
redemptorRevelationButton.MaxTimer = Redemptor.revelationCooldown;
redemptorPrayerButton.MaxTimer = Redemptor.prayerCooldown;
doomsayerButton.MaxTimer = Doomsayer.cooldown;
akujoHonmeiButton.MaxTimer = 0f;
akujoBackupButton.MaxTimer = 0f;
Expand Down Expand Up @@ -236,6 +241,9 @@ public static void setCustomButtonCooldowns()
securityGuardCamButton.EffectDuration = SecurityGuard.duration;
defuseButton.EffectDuration = Terrorist.defuseDuration;
terroristButton.EffectDuration = Terrorist.destructionTime + Terrorist.bombActiveAfter;
redemptorRevelationButton.EffectDuration = Redemptor.revelationDuration;
//redemptorPrayerButton.EffectDuration = Redemptor.prayerDuration;

zoomOutButton.MaxTimer = zoomOutButton.Timer = 0f;
}

Expand All @@ -244,11 +252,6 @@ public static void showTargetNameOnButton(PlayerControl target, CustomButton but
Helpers.showTargetNameOnButton(target, button, defaultText);
}

public static void showTargetNameOnButtonExplicit(PlayerControl target, CustomButton button, string defaultText)
{
Helpers.showTargetNameOnButtonExplicit(target, button, defaultText);
}

public static void resetTimeMasterButton()
{
timeMasterShieldButton.Timer = timeMasterShieldButton.MaxTimer;
Expand Down Expand Up @@ -3454,7 +3457,7 @@ public static void createButtonsPostfix(HudManager __instance)
}
}
},
buttonText: GetString("SpecterButton")
buttonText: GetString("ReviveButton")
);

// Medium button
Expand Down Expand Up @@ -4085,12 +4088,12 @@ public static void createButtonsPostfix(HudManager __instance)
{
// Could Use
Blackmailer.currentTarget = SetTarget();
SetPlayerOutline(Medic.currentTarget, Blackmailer.blackmailedColor);
SetPlayerOutline(Blackmailer.currentTarget, Blackmailer.blackmailedColor);

var text = GetString("BlackmailerText");
if (Blackmailer.blackmailed != null) text = Blackmailer.blackmailed.Data.PlayerName;
//Show target name under button if setting is true
showTargetNameOnButtonExplicit(Blackmailer.currentTarget, blackmailerButton, GetString("BlackmailerText"));
if (Blackmailer.blackmailed == null)
{
showTargetNameOnButton(Blackmailer.currentTarget, blackmailerButton, GetString("BlackmailerText"));
}
return Blackmailer.currentTarget != null && PlayerControl.LocalPlayer.CanMove;
},
() => { blackmailerButton.Timer = blackmailerButton.MaxTimer; },
Expand Down Expand Up @@ -4318,8 +4321,6 @@ public static void createButtonsPostfix(HudManager __instance)
trapperChargesText.transform.localScale = Vector3.one * 0.5f;
trapperChargesText.transform.localPosition += new Vector3(-0.05f, 0.7f, 0);



// Yoyo button
yoyoButton = new CustomButton(
() =>
Expand Down Expand Up @@ -4459,6 +4460,140 @@ public static void createButtonsPostfix(HudManager __instance)
"AdminMapText".Translate()
);

redemptorRevelationButton = new CustomButton(
() =>
{
Redemptor.Revelating = true;
},
() =>
{
return Redemptor.revelation && Redemptor.Player.IsAlive() && Redemptor.Player == PlayerControl.LocalPlayer;
},
() =>
{
redemptorRevelationButton.PositionOffset = Redemptor.prayer ? ButtonPositions.upperRowLeft : ButtonPositions.upperRowCenter;
return PlayerControl.LocalPlayer.CanMove;
},
() =>
{
Redemptor.Revelating = false;
redemptorRevelationButton.Timer = redemptorRevelationButton.MaxTimer;
redemptorRevelationButton.isEffectActive = false;
redemptorRevelationButton.actionButton.cooldownTimerText.color = Palette.EnabledColor;
},
Tracker.trackCorpsesButtonSprite,
ButtonPositions.upperRowCenter,
__instance,
secondaryAbilityInput.keyCode,
true,
Redemptor.revelationDuration,
() =>
{
Redemptor.Revelating = false;
redemptorRevelationButton.Timer = redemptorRevelationButton.MaxTimer;
},
buttonText: GetString("RedemptorRevelation")
);

redemptorPrayerButton = new CustomButton(
() =>
{
var writer = StartRPC(PlayerControl.LocalPlayer, CustomRPC.RedemptorPrayer);
writer.Write(byte.MaxValue);
writer.EndRPC();
Redemptor.RedemptorPrayer(byte.MaxValue);
},
() =>
{
return Redemptor.prayer && Redemptor.Player.IsAlive() &&
Redemptor.Player == PlayerControl.LocalPlayer && Redemptor.RevivedPlayer == null;
},
() =>
{
return Redemptor.target && PlayerControl.LocalPlayer.CanMove;
},
() =>
{
redemptorPrayerButton.Timer = redemptorPrayerButton.MaxTimer;
redemptorPrayerButton.isEffectActive = false;
redemptorPrayerButton.actionButton.cooldownTimerText.color = Palette.EnabledColor;
},
Redemptor.reviveButton,
ButtonPositions.upperRowCenter,
__instance,
modKillInput.keyCode,
true,
Redemptor.prayerDuration,
() =>
{
var writer = StartRPC(PlayerControl.LocalPlayer, CustomRPC.RedemptorPrayer);
writer.Write((byte)0);
writer.EndRPC();
Redemptor.RedemptorPrayer(0);

if (Redemptor.target != null)
{
var writer2 = StartRPC(PlayerControl.LocalPlayer, CustomRPC.RedemptorRevive);
writer2.Write(Redemptor.target.PlayerId);
writer2.EndRPC();
Redemptor.RevivePlayer(Redemptor.target.PlayerId);

redemptorPrayerButton.Timer = redemptorPrayerButton.MaxTimer;
}
},
buttonText: GetString("RedemptorPrayer")
);

redemptorReviveButton = new CustomButton(
() =>
{
if (Redemptor.target == null) return;

var writer = StartRPC(PlayerControl.LocalPlayer, CustomRPC.UncheckedMurderPlayer);
writer.Write(PlayerControl.LocalPlayer.PlayerId);
writer.Write(PlayerControl.LocalPlayer.PlayerId);
writer.Write(byte.MaxValue);
writer.EndRPC();
RPCProcedure.uncheckedMurderPlayer(PlayerControl.LocalPlayer.PlayerId, PlayerControl.LocalPlayer.PlayerId, byte.MaxValue);

_ = new LateTask(() =>
{
if (InMeeting) { Message("复活失败", "ReviveTask"); return; }
var writer = StartRPC(PlayerControl.LocalPlayer, CustomRPC.RedemptorRevive);
writer.Write(Redemptor.target.PlayerId);
writer.EndRPC();
Redemptor.RevivePlayer(Redemptor.target.PlayerId);
}, Redemptor.reviveDuration, "RedemptorRevive");
},
() =>
{
return Redemptor.Player.IsAlive() && Redemptor.Player == PlayerControl.LocalPlayer;
},
() =>
{
var pos = PlayerControl.LocalPlayer.GetTruePosition();
var maxDistance = PlayerControl.LocalPlayer.MaxReportDistance * 0.24f;

var deadBody = Physics2D.OverlapCircleAll(pos, maxDistance, Constants.PlayersOnlyMask)
.Where(collider => collider.CompareTag("DeadBody"))
.Select(collider => collider.GetComponent<DeadBody>())
.FirstOrDefault(db => db != null && playerById(db.ParentId)?.Data?.IsDead == true &&
!(playerById(db.ParentId)?.Data?.Disconnected == true));

Redemptor.target = playerById(deadBody?.ParentId);
return Redemptor.target && PlayerControl.LocalPlayer.CanMove;
},
() =>
{
redemptorReviveButton.Timer = 10f;
},
Redemptor.reviveButton,
ButtonPositions.upperRowRight,
__instance,
abilityInput.keyCode,
buttonText: GetString("ReviveButton")
);

// Set the default (or settings from the previous game) timers / durations when spawning the buttons
initialized = true;
setCustomButtonCooldowns();
Expand Down
8 changes: 3 additions & 5 deletions TheOtherRoles/Buttons/CustomButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ public static void MeetingEndedUpdate()
}
}

public static void ResetAllCooldowns(float Time = -1, PlayerControl target = null)
public static void ResetAllCooldowns(float Time = -1)
{
var player = target ?? PlayerControl.LocalPlayer;
var time = Time == -1 ? ModOption.KillCooddown : Time;
foreach (var t in buttons)
{
Expand All @@ -146,10 +145,10 @@ public static void ResetAllCooldowns(float Time = -1, PlayerControl target = nul
}
catch (Exception e)
{
Error($"NullReferenceException from MeetingEndedUpdate().HasButton(), if theres only one warning its fine\n{e}", "CustomButton");
Error($"NullReferenceException from ResetAllCooldowns(), if theres only one warning its fine\n{e}", "CustomButton");
}
}
player.killTimer = time;
PlayerControl.LocalPlayer.killTimer = time;
}

public static void resetKillButton(PlayerControl p, float time = -1)
Expand All @@ -173,7 +172,6 @@ public static void resetKillButton(PlayerControl p, float time = -1)
thiefKillButton.Timer = time == -1 ? thiefKillButton.MaxTimer : time;
pavlovsdogsKillButton.Timer = time == -1 ? pavlovsdogsKillButton.MaxTimer : time;
}

public void setActive(bool isActive)
{
if (isActive)
Expand Down
3 changes: 1 addition & 2 deletions TheOtherRoles/CustomCosmetics/CustomColors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ public static void Load()
[HarmonyPatch]
public static class CustomColorPatches
{
[HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString), typeof(StringNames),
typeof(Il2CppReferenceArray<Object>))]
[HarmonyPatch(typeof(TranslationController), nameof(TranslationController.GetString), typeof(StringNames), typeof(Il2CppReferenceArray<Object>))]
private class ColorStringPatch
{
[HarmonyPriority(Priority.Last)]
Expand Down
4 changes: 3 additions & 1 deletion TheOtherRoles/CustomCosmetics/CustomHats/HatsLoader.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections;
using System.IO;
using System.Text.Json;
Expand Down Expand Up @@ -76,6 +76,7 @@ private IEnumerator DownloadHatsConfig(string path)
{
Error($"下载帽子配置文件时出错: {www.error}");
isSuccessful = false;
LoadLocalHats();
yield break;
}

Expand All @@ -101,6 +102,7 @@ private IEnumerator DownloadHatsConfig(string path)
{
isSuccessful = false;
Error($"未能保存或加载帽子配置文件: {ex.Message}");
LoadLocalHats();
}
finally
{
Expand Down
Loading

0 comments on commit d5844ed

Please sign in to comment.