Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development v2.1.0 #1138

Merged
merged 983 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
983 commits
Select commit Hold shift + click to select a range
bbb929a
Fix
Tommy-XL Sep 21, 2024
49bf365
Add
Tommy-XL Sep 21, 2024
b48b1a0
Fix Mod Client Blue name not showing
NikoCat233 Sep 22, 2024
5f305c1
Perform Code Format
NikoCat233 Sep 22, 2024
cec4d44
Update DelayedNetworkData to InnerSloth officials
NikoCat233 Sep 22, 2024
806104d
Merge pull request #1217 from NikoCat233/Fix-Mod-Client-Not-Having-Bl…
Tommy-XL Sep 22, 2024
f8e183d
Merge pull request #1218 from NikoCat233/Recode-Delayed-Network-Data
Tommy-XL Sep 22, 2024
c23b2d7
Lot of fix & Recode Executioner and Lawyer & support change role basi…
Tommy-XL Sep 22, 2024
6f0ee56
Merge remote-tracking branch 'origin/DevBuild_2.1.0' into DevBuild_2.1.0
Tommy-XL Sep 22, 2024
2e16902
Fixed Hater can't kill
Tommy-XL Sep 22, 2024
242f7d0
Change
Tommy-XL Sep 22, 2024
7fcfed5
Utils.SendGameData() in end game
Tommy-XL Sep 22, 2024
35221d3
Move Main.PlayerColors and remember last summary message
Tommy-XL Sep 22, 2024
2db4f35
Check null
Tommy-XL Sep 22, 2024
9c1d846
Fix
Tommy-XL Sep 22, 2024
f3b5fc3
New role: Ventguard (From EHR)
Tommy-XL Sep 22, 2024
4158896
Merge Ability In Use & Ability Expired
Tommy-XL Sep 22, 2024
8870500
Remove
Tommy-XL Sep 22, 2024
9cbf103
private
Tommy-XL Sep 22, 2024
336cd6d
Merge pull request #1219 from EnhancedNetwork/NewRole_Ventguard
Tommy-XL Sep 22, 2024
abba132
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Sep 22, 2024
6807c5c
Block Vent Cooldown
Tommy-XL Sep 22, 2024
17224c4
Add string
Tommy-XL Sep 22, 2024
544f01e
Fix bug modded xkient calles RpcSetName in emd game
Tommy-XL Sep 22, 2024
bd841d3
Fix Doppelganger HasI mpostor Vision
Tommy-XL Sep 22, 2024
7f2e18e
i think this works
MargaretTheFool Sep 22, 2024
3579387
Fix bugs
Tommy-XL Sep 23, 2024
266f42e
Fix Ventguard and Prohibited conflicts
Tommy-XL Sep 23, 2024
f726ac4
NotUnlockVent()
Tommy-XL Sep 23, 2024
89f5b98
Fix NeutralApocalypseCanGuess not work for commands
Tommy-XL Sep 23, 2024
5171232
Fix Crewpostor kill Solsticer
Tommy-XL Sep 23, 2024
cf7b878
Fix conflict
Tommy-XL Sep 23, 2024
e9e8fef
Fix Statue speed after meeting
Tommy-XL Sep 23, 2024
917adda
Merge pull request #1221 from MargaretTheFool/death-eject-msg
Tommy-XL Sep 23, 2024
abb5a65
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Sep 23, 2024
7082411
Alpha 14
Tommy-XL Sep 23, 2024
a754d0e
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Sep 23, 2024
7d4e2db
Add RPC for Blackmailer
Tommy-XL Sep 23, 2024
17cae70
Change
Tommy-XL Sep 23, 2024
60f1a29
Fix
Tommy-XL Sep 23, 2024
0467c91
Added Eavesdropper (Helpful Addon)
0xDrMoe Sep 24, 2024
03c66da
Fix typos
KingPanda360 Sep 24, 2024
963639a
Fix Eavesdropper
Tommy-XL Sep 24, 2024
499654a
hm
Tommy-XL Sep 24, 2024
8f9e9f6
Recode label Id (Thanks D1GQ)
Tommy-XL Sep 24, 2024
db67b60
hm
Tommy-XL Sep 24, 2024
82fdf0f
Merge pull request #1225 from KingPanda360/patch-25
0xDrMoe Sep 25, 2024
9de9ead
Fix bugs
Tommy-XL Sep 25, 2024
d505d86
Merge remote-tracking branch 'origin/DevBuild_2.1.0' into DevBuild_2.1.0
Tommy-XL Sep 25, 2024
fbe0f59
SendOption.Reliable
Tommy-XL Sep 25, 2024
6873e3a
Change
Tommy-XL Sep 25, 2024
9afd2b8
Revert
Tommy-XL Sep 25, 2024
2f5450a
Slightly Improve Deleayed Networked Data
NikoCat233 Sep 25, 2024
660bf52
Merge branch 'DevBuild_2.1.0' into Change-Certain-Messages-to-be-sent…
NikoCat233 Sep 25, 2024
c6946e0
RpcSetDisconnected with Delay
NikoCat233 Sep 25, 2024
40a3d0f
Merge branch 'Change-Certain-Messages-to-be-sent-with-None' of https:…
NikoCat233 Sep 25, 2024
558ff30
VentilationSystem LastUpadate
Tommy-XL Sep 25, 2024
ec8a31d
Fix Ventguard
Tommy-XL Sep 25, 2024
0af8a9d
Directly send spawn instead of streams
NikoCat233 Sep 25, 2024
b1ca29a
Check win
Tommy-XL Sep 25, 2024
d7ddd51
CoEnterVent Force Update
Tommy-XL Sep 25, 2024
82efc86
Fix Force Upadate
Tommy-XL Sep 25, 2024
cf4ac24
Check meeting
Tommy-XL Sep 25, 2024
25aa032
Add Rpc for Altruist
NikoCat233 Sep 26, 2024
d486cbc
Discord rip? omg bro
Tommy-XL Sep 26, 2024
678b56c
Merge pull request #1228 from NikoCat233/Add-Rpc-for-Altruist
Tommy-XL Sep 26, 2024
768e229
Merge pull request #1227 from NikoCat233/Change-Certain-Messages-to-b…
Tommy-XL Sep 26, 2024
b7c3ab9
Hmm
Tommy-XL Sep 26, 2024
5f40c3c
Check modded in lobby in sync custom settings
Tommy-XL Sep 26, 2024
f8de505
Plugin Version
Tommy-XL Sep 26, 2024
6f280e4
try {} catch { }
Tommy-XL Sep 26, 2024
55cc286
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Sep 26, 2024
7d66a5e
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Sep 26, 2024
b9210a9
Add Sync Names
Tommy-XL Sep 26, 2024
50189a7
Update en_US.json
KingPanda360 Sep 27, 2024
06fcc0f
Add notifyGameEnding
NikoCat233 Sep 27, 2024
b6de1e1
Move before gamedata sync
NikoCat233 Sep 27, 2024
7be9c7a
Some fix
Tommy-XL Sep 27, 2024
834ba6e
Fix
Tommy-XL Sep 27, 2024
c269bfa
Merge pull request #1232 from NikoCat233/Add-NotifyGameEnding
Tommy-XL Sep 27, 2024
2ffa170
Add Swapper Task String
hinhinarrrrrr Sep 27, 2024
0ab7f78
Check AntiBlackout
Tommy-XL Sep 27, 2024
28795d2
Check Game Is Ended
Tommy-XL Sep 27, 2024
7305d7b
Merge pull request #1233 from HInhinarrrrrrrrrrrr/DevBuild_2.1.0
Tommy-XL Sep 27, 2024
02d1bf3
Hm
Tommy-XL Sep 27, 2024
5c0c496
Check Camouflage in RpcRevive
Tommy-XL Sep 27, 2024
e2d4082
Alpha 15 Hotfix 1
Tommy-XL Sep 27, 2024
a567092
Add more green bean kick
NikoCat233 Sep 28, 2024
eddbe77
Change certain delay
NikoCat233 Sep 28, 2024
d5419e1
Merge pull request #1234 from NikoCat233/Improve-Kick-Green-beans
Tommy-XL Sep 28, 2024
e3969b4
Check null
Tommy-XL Sep 28, 2024
2f464b9
Hotfix 2
Tommy-XL Sep 28, 2024
de5a7c7
Change
Tommy-XL Sep 28, 2024
e2b3cfc
Add Option Judge Max Trials Per Game
hinhinarrrrrr Sep 28, 2024
4376b91
Fix
hinhinarrrrrr Sep 28, 2024
ab83460
Fix mistakes again
KingPanda360 Sep 28, 2024
e489a0c
Check null
Tommy-XL Sep 28, 2024
d90496d
Mayor color now in Vindicator description, plus swapper description fix
KingPanda360 Sep 28, 2024
37ec93a
Nothing
KingPanda360 Sep 28, 2024
650758e
Revert DelayNetworkedData
Tommy-XL Sep 29, 2024
b74f206
Merge pull request #1235 from HInhinarrrrrrrrrrrr/DevBuild_2.1.0
Tommy-XL Sep 29, 2024
1b74771
Fix modded client not reset limit for Judge
Tommy-XL Sep 29, 2024
a08331e
Merge pull request #1231 from KingPanda360/patch-26
Tommy-XL Sep 29, 2024
8261e75
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Sep 29, 2024
fe550e2
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Sep 29, 2024
020cece
Alpha 16
Tommy-XL Sep 29, 2024
7bc0f72
Add GetProgressText for Troller
Tommy-XL Sep 29, 2024
76eb354
Change
Tommy-XL Sep 29, 2024
544a5a1
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Sep 29, 2024
e07a979
Fix duplicate id
Tommy-XL Sep 29, 2024
b865301
Remove
Tommy-XL Sep 29, 2024
6e3f8ea
Fix Jailer
Tommy-XL Sep 29, 2024
93c418e
Check
Tommy-XL Sep 29, 2024
6d45ae6
Hotfix 1
Tommy-XL Sep 29, 2024
9a16945
Jester can't get Susceptible
KingPanda360 Sep 30, 2024
de565a5
Jester Ejection Message Option
this-dude-codes Sep 30, 2024
41cfbca
Merge pull request #1238 from KingPanda360/patch-27
Tommy-XL Oct 1, 2024
bf2938d
Add dealy timer in loading
Tommy-XL Oct 1, 2024
59eef3c
Merge remote-tracking branch 'origin/DevBuild_2.1.0' into DevBuild_2.1.0
Tommy-XL Oct 1, 2024
d3ea6be
Fix errors
Tommy-XL Oct 1, 2024
bf19863
Fix Stalker
Tommy-XL Oct 1, 2024
2104a15
Monarch and Fragile
Tommy-XL Oct 1, 2024
628f418
Improve Unreported body
hinhinarrrrrr Oct 1, 2024
e532ac6
Fix Altrurist may revive some unreported body
hinhinarrrrrr Oct 1, 2024
6c16555
Fix Madmate Impostor Vision
Tommy-XL Oct 1, 2024
dac778a
remove
hinhinarrrrrr Oct 1, 2024
be968b4
Fix
Tommy-XL Oct 1, 2024
400351a
Add Check Unreportable Bodies For Medusa
Tommy-XL Oct 1, 2024
dbe03b8
fix
hinhinarrrrrr Oct 1, 2024
154bda2
fix ...
hinhinarrrrrr Oct 1, 2024
b973c37
Fix mistakes
this-dude-codes Oct 1, 2024
8aeaa1b
fix........
hinhinarrrrrr Oct 1, 2024
46ca7d9
Add Jester_RevealUponEject
Tommy-XL Oct 1, 2024
6040398
Add Jester_RevealUponEject in Jester.cs
Tommy-XL Oct 1, 2024
1afae13
Remove = false
Tommy-XL Oct 1, 2024
421c5d6
Merge pull request #1239 from TheDiamondStar/patch-1
Tommy-XL Oct 1, 2024
3d1a6ba
Set private & Fix bug
Tommy-XL Oct 1, 2024
4712ed9
Merge branch 'DevBuild_2.1.0' into altu
hinhinarrrrrr Oct 1, 2024
7e17a7d
Add Client Options in logs
Tommy-XL Oct 1, 2024
9b69008
Merge pull request #1241 from HInhinarrrrrrrrrrrr/altu
Tommy-XL Oct 1, 2024
5012b2a
Move PR #1244 (By @TheDiamondStar)
Tommy-XL Oct 2, 2024
3aad765
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Oct 2, 2024
9ae5439
Change
Tommy-XL Oct 2, 2024
fdc12fd
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Oct 2, 2024
6c848b4
Forgot
Tommy-XL Oct 2, 2024
c32e7e9
Some fix
Tommy-XL Oct 3, 2024
5f3e57e
Change
Tommy-XL Oct 3, 2024
36c62c3
Fix bug
Tommy-XL Oct 3, 2024
f6e7c7e
Change
Tommy-XL Oct 3, 2024
5c5a429
Add Simplified Chinese Command
Reborn5537 Oct 3, 2024
edc8931
Vanilla Map Decorations
Tommy-XL Oct 3, 2024
9e7b60e
Set Random Decoration When Birthday And Halloween Is Active
Tommy-XL Oct 3, 2024
0168722
Okay, I admit I missed something
Reborn5537 Oct 3, 2024
83feeea
End?
Reborn5537 Oct 4, 2024
ddf6a7a
Fix Some situation killing bait would send log and play sound when ba…
hinhinarrrrrr Oct 4, 2024
52113f2
Fix Huntsman targets when he dead & Fix cancel start cooldown in game
Tommy-XL Oct 4, 2024
3268f61
Merge pull request #1251 from HInhinarrrrrrrrrrrr/sidekick
Tommy-XL Oct 4, 2024
3571222
Merge pull request #1247 from Reborn5537/DevBuild_2.1.0
Tommy-XL Oct 4, 2024
fe05922
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Oct 4, 2024
8666a05
PluginVersion
Tommy-XL Oct 4, 2024
d92bec5
Lot of fixes for Phantom
Tommy-XL Oct 5, 2024
05040e1
Improve Menu Description
Tommy-XL Oct 5, 2024
3827f90
Check size text
Tommy-XL Oct 5, 2024
2dddfc7
Revert
Tommy-XL Oct 5, 2024
95b07c1
Remove
Tommy-XL Oct 5, 2024
0760f38
Fix
Tommy-XL Oct 5, 2024
d39f722
Use forced check for Witness
Tommy-XL Oct 5, 2024
d9d4b56
GetClientId() from NetworkedPlayerInfo
Tommy-XL Oct 5, 2024
e06902a
Remove
Tommy-XL Oct 5, 2024
36b11b2
fix ejection because im a bum who forgot to change a variable
MargaretTheFool Oct 5, 2024
0d099e8
apoc cant get rebirth nor evader
MargaretTheFool Oct 5, 2024
3b23912
apoc can see eachother's addons
MargaretTheFool Oct 5, 2024
0b6c9ea
Merge pull request #1254 from MargaretTheFool/na-post-beta
Tommy-XL Oct 6, 2024
a62d249
Fix lot of bugs
Tommy-XL Oct 6, 2024
2cbc10c
Merge remote-tracking branch 'origin/DevBuild_2.1.0' into DevBuild_2.1.0
Tommy-XL Oct 6, 2024
fe2a5eb
Fix missed string "GuessedAsMundane"
Tommy-XL Oct 6, 2024
e5aeb06
Change MonarchInfoLong
Tommy-XL Oct 6, 2024
8846534
Fix kill cd for Glitch
Tommy-XL Oct 6, 2024
763185b
Fix PhantomRole when meeting forced started
Tommy-XL Oct 6, 2024
a1547fc
Fix
Tommy-XL Oct 6, 2024
8331a03
Add Sleuth Settings back
KingPanda360 Oct 6, 2024
8fb0135
Miner can't be Circumvent
KingPanda360 Oct 6, 2024
7c93fdf
Return sleuth back to normal
KingPanda360 Oct 6, 2024
b150fbf
Add ApocolypseInfoLong
KingPanda360 Oct 7, 2024
63d1353
Merge pull request #1256 from KingPanda360/patch-28
Tommy-XL Oct 8, 2024
3af4fb6
Fix arrows & Sleuth
Tommy-XL Oct 8, 2024
8ad680e
Merge remote-tracking branch 'origin/DevBuild_2.1.0' into DevBuild_2.1.0
Tommy-XL Oct 8, 2024
d5ba039
Lot of fixes
Tommy-XL Oct 8, 2024
868e31d
Merge pull request #1248 from EnhancedNetwork/VanillaMapDecorations
Tommy-XL Oct 8, 2024
33e14ab
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Oct 8, 2024
c9da0c1
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Oct 8, 2024
fb8ace6
Beta 2
Tommy-XL Oct 8, 2024
b6ad225
Some changes
Tommy-XL Oct 8, 2024
1d9fa37
Change size
Tommy-XL Oct 8, 2024
c4b0789
Action => UnityEngine.Events.UnityAction in AddListener()
Tommy-XL Oct 8, 2024
5d77239
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Oct 8, 2024
dc2a9e1
Fix Executioner & Lawyer Intro cutscene
Tommy-XL Oct 8, 2024
8c431e0
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Oct 8, 2024
0bb413a
Some fix & add DefaultOutfit.SequenceIs += 10 to prevent bugs which p…
Tommy-XL Oct 9, 2024
0820747
Remove & Change
Tommy-XL Oct 9, 2024
dc94095
Check SnapTo for modded & Some patch & Fix RpcDesyncTeleport
Tommy-XL Oct 9, 2024
483943b
Move code
Tommy-XL Oct 9, 2024
4b9a04c
Some change
Tommy-XL Oct 9, 2024
d31efa7
hm
Tommy-XL Oct 9, 2024
a4b2e77
Revert
Tommy-XL Oct 9, 2024
c4a0562
Some change
Tommy-XL Oct 9, 2024
d2483a6
Change
Tommy-XL Oct 9, 2024
a3fddfb
Return
Tommy-XL Oct 9, 2024
0f2f69c
NotificationPopper support TOHE settings
Tommy-XL Oct 9, 2024
962d3f0
Add check Hide Game Settings
Tommy-XL Oct 9, 2024
b8d47d3
Clear code
Tommy-XL Oct 9, 2024
ea27ba8
so much work
MargaretTheFool Oct 9, 2024
2dbddee
Fix bugs
Tommy-XL Oct 11, 2024
83e8b5e
Clear code in NotificationPopperAwakePatch
Tommy-XL Oct 11, 2024
8f155e6
Add try {} catch {} in case of any exceptions
Tommy-XL Oct 11, 2024
84c62e3
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Oct 11, 2024
dc6cb71
Add Timer icon
Tommy-XL Oct 11, 2024
4c0bd35
Fix
Tommy-XL Oct 11, 2024
50e0462
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Oct 11, 2024
7a1d8ca
Add
Tommy-XL Oct 11, 2024
7a37996
Fix bug when some players stuck in walls after meeting
Tommy-XL Oct 11, 2024
b67cdc9
a
MargaretTheFool Oct 11, 2024
f157291
Change RpcSetSpecificScanner
Tommy-XL Oct 12, 2024
1d83ca7
Merge pull request #1263 from MargaretTheFool/war-pesti-fix
Tommy-XL Oct 12, 2024
e6a4c97
Fix some bugs
Tommy-XL Oct 13, 2024
da20f11
Add Shuffle for Common Tasks in RpcSetTasks
Tommy-XL Oct 13, 2024
db06baf
Ok
Tommy-XL Oct 13, 2024
f21362e
Check
Tommy-XL Oct 13, 2024
d46960c
made settings actually used
MargaretTheFool Oct 13, 2024
dcd15d3
Add Check Infacted After Meeting For PlagueBearer
Tommy-XL Oct 13, 2024
eb2f19f
Merge pull request #1260 from MargaretTheFool/unhide-team-guessing
Tommy-XL Oct 13, 2024
d65abc1
Update en_US.json
MargaretTheFool Oct 14, 2024
50e9b4f
Some fix
Tommy-XL Oct 16, 2024
0632afb
Some fix
Tommy-XL Oct 17, 2024
4968760
Update Bastion.cs
MargaretTheFool Oct 18, 2024
2bf6349
cant get unlucky
MargaretTheFool Oct 19, 2024
46ed0c1
Update Unlucky.cs
MargaretTheFool Oct 19, 2024
31b3f29
Fix 100% amhost error
NikoCat233 Oct 20, 2024
f702d90
Merge pull request #1264 from MargaretTheFool/apoc-mispell
0xDrMoe Oct 26, 2024
e15d5ba
Merge pull request #1265 from MargaretTheFool/war-bastion-fix
0xDrMoe Oct 26, 2024
cd5ea0b
Merge pull request #1266 from NikoCat233/Fix-error-as-host
0xDrMoe Oct 26, 2024
081c3fd
Changes
Tommy-XL Oct 27, 2024
9e1d757
Fix Dark Theme in lasted version AU
Tommy-XL Oct 27, 2024
73cc13b
Fix Double Shot assign NA when NA Can Guess is off
Tommy-XL Oct 27, 2024
c889736
Some fix
Tommy-XL Oct 27, 2024
0bd97d2
Fix RPC not send Vector
Tommy-XL Oct 27, 2024
077d9e8
Fix Rpc in SendGhostRoleInfo
Tommy-XL Oct 27, 2024
55c1ae6
Change Beta => Release
Tommy-XL Oct 27, 2024
3089e3b
PluginVersion
Tommy-XL Oct 27, 2024
fffd9bd
Merge remote-tracking branch 'origin/main' into DevBuild_2.1.0
Tommy-XL Oct 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 2 additions & 6 deletions FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<Costura>
<IncludeAssemblies>
Csv
</IncludeAssemblies>
</Costura>
</Weavers>
<Costura />
</Weavers>
44 changes: 19 additions & 25 deletions GameModes/FFAManager.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Hazel;
using System;
using TOHE.Modules;
using UnityEngine;
using static TOHE.Translator;
Expand Down Expand Up @@ -99,25 +98,18 @@ public static void Init()
FFAVentDuration = [];
FFAEnterVentTime = [];
}

_ = new LateTask( ()=>
}
public static void SetData()
{
if (Options.CurrentGameMode != CustomGameMode.FFA) return;

RoundTime = FFA_GameTime.GetInt() + 8;
var now = Utils.GetTimeStamp() + 8;
foreach (PlayerControl pc in Main.AllAlivePlayerControls)
{
try
{
Utils.SetChatVisibleForEveryone();
}
catch (Exception error)
{
Logger.Error($"Error: {error}", "FFA Init");
}
RoundTime = FFA_GameTime.GetInt() + 8;
var now = Utils.GetTimeStamp() + 8;
foreach (PlayerControl pc in Main.AllAlivePlayerControls)
{
KBScore.TryAdd(pc.PlayerId, 0);
if (FFA_DisableVentingWhenKCDIsUp.GetBool()) FFALastKill.TryAdd(pc.PlayerId, now);
}
}, 10f, "Set Chat Visible for Everyone");
KBScore[pc.PlayerId] = 0;
if (FFA_DisableVentingWhenKCDIsUp.GetBool()) FFALastKill[pc.PlayerId] = now;
}
}
private static void SendRPCSyncFFAPlayer(byte playerId)
{
Expand All @@ -133,7 +125,7 @@ public static void ReceiveRPCSyncFFAPlayer(MessageReader reader)
}
public static void SendRPCSyncNameNotify(PlayerControl pc)
{
if (pc.AmOwner || !pc.IsModClient()) return;
if (!pc.IsNonHostModdedClient()) return;
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SyncFFANameNotify, SendOption.Reliable, pc.GetClientId());
if (NameNotify.ContainsKey(pc.PlayerId))
writer.Write(NameNotify[pc.PlayerId].TEXT);
Expand All @@ -160,7 +152,7 @@ public static void GetNameNotify(PlayerControl player, ref string name)
public static string GetDisplayScore(byte playerId)
{
int rank = GetRankOfScore(playerId);
string score = KBScore.TryGetValue(playerId, out var s) ? $"{s}" : "Invalid";
string score = KBScore.TryGetValue(playerId, out var s) ? $"{s}" : "0";
string text = string.Format(GetString("FFADisplayScore"), rank.ToString(), score);
Color color = Utils.GetRoleColor(CustomRoles.Killer);
return Utils.ColorString(color, text);
Expand Down Expand Up @@ -227,11 +219,13 @@ public static void OnPlayerAttack(PlayerControl killer, PlayerControl target)
bool mark = false;
var nowKCD = Main.AllPlayerKillCooldown[killer.PlayerId];
byte EffectType;
if (!GameStates.AirshipIsActive) EffectType = (byte)HashRandom.Next(0, 10);
else EffectType = (byte)HashRandom.Next(4, 10);
var random = IRandom.Instance;

if (!GameStates.AirshipIsActive) EffectType = (byte)random.Next(0, 10);
else EffectType = (byte)random.Next(4, 10);
if (EffectType <= 7) // Buff
{
byte EffectID = (byte)HashRandom.Next(0, 3);
byte EffectID = (byte)random.Next(0, 3);
if (GameStates.AirshipIsActive) EffectID = 2;
switch (EffectID)
{
Expand Down Expand Up @@ -269,7 +263,7 @@ public static void OnPlayerAttack(PlayerControl killer, PlayerControl target)
}
else if (EffectType == 8) // De-Buff
{
byte EffectID = (byte)HashRandom.Next(0, 3);
byte EffectID = (byte)random.Next(0, 3);
if (GameStates.AirshipIsActive) EffectID = 1;
switch (EffectID)
{
Expand Down
3 changes: 1 addition & 2 deletions Helpers/EnumHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public static List<TEnum[]> Achunk<TEnum>(int chunkSize, bool shuffle = false, F
{
List<TEnum[]> chunkedList = [];
TEnum[] allValues = GetAllValues<TEnum>();
var rnd = IRandom.Instance;
if (shuffle) allValues = allValues.Shuffle(rnd).ToArray();
if (shuffle) allValues = allValues.Shuffle().ToArray();
if (exclude != null) allValues = allValues.Where(exclude).ToArray();

for (int i = 0; i < allValues.Length; i += chunkSize)
Expand Down
2 changes: 1 addition & 1 deletion Modules/AdminProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static SortedDictionary<SystemTypes, AdminEntry> CalculateAdmin()
totalPlayers++;
numDeadBodies++;
// If it the impostor's dead body
if (Utils.GetPlayerById(deadBody.ParentId)?.Is(Custom_Team.Impostor) == true)
if (deadBody.ParentId.GetPlayer()?.Is(Custom_Team.Impostor) == true)
{
numImpostors++;
}
Expand Down
148 changes: 97 additions & 51 deletions Modules/AntiBlackout.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using AmongUs.GameOptions;
using Hazel;
using System;
using System.Runtime.CompilerServices;
Expand All @@ -11,7 +12,11 @@ public static class AntiBlackout
///<summary>
/// Check num alive Impostors & Crewmates & NeutralKillers
///</summary>
public static bool BlackOutIsActive => !Options.DisableAntiBlackoutProtects.GetBool() && CheckBlackOut();
public static bool BlackOutIsActive => false; /*!Options.DisableAntiBlackoutProtects.GetBool() && CheckBlackOut();*/

//this is simply just called in less places, because antiblackout with role-basis changing is OP
public static int ExilePlayerId = -1;
public static bool SkipTasks = false;

///<summary>
/// Count alive players and check black out
Expand All @@ -33,14 +38,14 @@ public static bool CheckBlackOut()
Impostors.Add(pc.PlayerId);

// Only Neutral killers
else if (pc.IsNeutralKiller())
else if (pc.IsNeutralKiller() || pc.IsNeutralApocalypse())
NeutralKillers.Add(pc.PlayerId);

// Crewmate
else Crewmates.Add(pc.PlayerId);
}

var numAliveImpostors = Impostors.Count;
var numAliveImpostors = Impostors.Count;
var numAliveCrewmates = Crewmates.Count;
var numAliveNeutralKillers = NeutralKillers.Count;

Expand Down Expand Up @@ -72,10 +77,11 @@ public static bool CheckBlackOut()

public static void SetIsDead(bool doSend = true, [CallerMemberName] string callerMethodName = "")
{
SkipTasks = true;
RevivePlayersAndSetDummyImp();
logger.Info($"SetIsDead is called from {callerMethodName}");
if (IsCached)
{
logger.Info("Please run RestoreIsDead before running SetIsDead again.");
return;
}
isDeadCache.Clear();
Expand All @@ -89,6 +95,24 @@ public static void SetIsDead(bool doSend = true, [CallerMemberName] string calle
IsCached = true;
if (doSend) SendGameData();
}
private static void RevivePlayersAndSetDummyImp()
{
if (CustomWinnerHolder.WinnerTeam != CustomWinner.Default) return;

PlayerControl dummyImp = Main.AllAlivePlayerControls.FirstOrDefault(x => x.PlayerId != ExilePlayerId);
if (dummyImp == null) return;

foreach (var seer in Main.AllPlayerControls)
{
if (seer.IsModded()) continue;
foreach (var target in Main.AllPlayerControls)
{
RoleTypes targetRoleType = target.PlayerId == dummyImp.PlayerId ? RoleTypes.Impostor : RoleTypes.Crewmate;

target.RpcSetRoleDesync(targetRoleType, seer.GetClientId());
}
}
}
public static void RestoreIsDead(bool doSend = true, [CallerMemberName] string callerMethodName = "")
{
logger.Info($"RestoreIsDead is called from {callerMethodName}");
Expand All @@ -109,59 +133,17 @@ public static void RestoreIsDead(bool doSend = true, [CallerMemberName] string c
public static void SendGameData([CallerMemberName] string callerMethodName = "")
{
logger.Info($"SendGameData is called from {callerMethodName}");
foreach (var playerinfo in GameData.Instance.AllPlayers)
{
MessageWriter writer = MessageWriter.Get(SendOption.Reliable);
writer.StartMessage(5); //0x05 GameData
{
writer.Write(AmongUsClient.Instance.GameId);
writer.StartMessage(1); //0x01 Data
{
writer.WritePacked(playerinfo.NetId);
playerinfo.Serialize(writer, true);
}
writer.EndMessage();
}
writer.EndMessage();

AmongUsClient.Instance.SendOrDisconnect(writer);
writer.Recycle();
}
Utils.SendGameData();
}
public static void OnDisconnect(NetworkedPlayerInfo player)
{
// Execution conditions: Client is the host, IsDead is overridden, player is already disconnected
if (!AmongUsClient.Instance.AmHost || !IsCached || !player.Disconnected) return;
isDeadCache[player.PlayerId] = (true, true);
RevivePlayersAndSetDummyImp();
player.IsDead = player.Disconnected = false;
SendGameData();
}

///<summary>
///Execute the code with IsDead temporarily set back to what it should be
///<param name="action">Execution details</param>
///</summary>
public static void TempRestore(Action action)
{
logger.Info("==Temp Restore==");
// Whether TempRestore was executed with IsDead overwritten
bool before_IsCached = IsCached;
try
{
if (before_IsCached) RestoreIsDead(doSend: false);
action();
}
catch (Exception ex)
{
logger.Warn("An exception occurred within AntiBlackout.TempRestore");
logger.Exception(ex);
}
finally
{
if (before_IsCached) SetIsDead(doSend: false);
logger.Info("==/Temp Restore==");
}
}
public static void AntiBlackRpcVotingComplete(this MeetingHud __instance, MeetingHud.VoterState[] states, NetworkedPlayerInfo exiled, bool tie)
{
if (AmongUsClient.Instance.AmClient)
Expand All @@ -172,8 +154,8 @@ public static void AntiBlackRpcVotingComplete(this MeetingHud __instance, Meetin
var sender = CustomRpcSender.Create("AntiBlack RpcVotingComplete", SendOption.None);
foreach (var pc in Main.AllPlayerControls)
{
if (pc.AmOwner) continue;
if (pc.IsModClient()) //For mod client show real result
if (pc.IsHost()) continue;
if (pc.IsNonHostModdedClient()) //For mod client show real result
{
sender.AutoStartRpc(__instance.NetId, (byte)RpcCalls.VotingComplete, pc.GetClientId());
{
Expand Down Expand Up @@ -215,7 +197,7 @@ public static void AfterMeetingTasks()
if (CheckForEndVotingPatch.TempExileMsg != null && BlackOutIsActive)
{
timeNotify = 4f;
foreach (var pc in Main.AllPlayerControls.Where(p => p != null && !(p.AmOwner || p.IsModClient())).ToArray())
foreach (var pc in Main.AllPlayerControls.Where(p => !p.IsModded()).ToArray())
{
pc.Notify(CheckForEndVotingPatch.TempExileMsg, time: timeNotify);
}
Expand All @@ -236,6 +218,68 @@ public static void AfterMeetingTasks()
Logger.Error($"{error}", "AntiBlackout.AfterMeetingTasks");
}
}
public static void SetRealPlayerRoles()
{
if (CustomWinnerHolder.WinnerTeam != CustomWinner.Default) return;

foreach (var ((seerId, targetId), (roletype, _)) in RpcSetRoleReplacer.RoleMap)
{
// skip host
if (seerId == 0) continue;

var seer = seerId.GetPlayer();
var target = targetId.GetPlayer();

if (seer == null || target == null) continue;
if (seer.IsModded()) continue;

var isSelf = seerId == targetId;
var changedRoleType = roletype;
if (target.Data.IsDead)
{
if (isSelf)
{
target.RpcExile();

if (target.HasGhostRole()) changedRoleType = RoleTypes.GuardianAngel;
else if (target.Is(Custom_Team.Impostor) || target.HasDesyncRole()) changedRoleType = RoleTypes.ImpostorGhost;
else changedRoleType = RoleTypes.CrewmateGhost;
}
else
{
var seerIsKiller = seer.Is(Custom_Team.Impostor) || seer.HasDesyncRole();
if (!seerIsKiller && target.Is(Custom_Team.Impostor)) changedRoleType = RoleTypes.ImpostorGhost;
else changedRoleType = RoleTypes.CrewmateGhost;
}
}

target.RpcSetRoleDesync(changedRoleType, seer.GetClientId());
}
}
private static void ResetAllCooldown()
{
foreach (var seer in Main.AllPlayerControls)
{
if (seer.IsAlive())
{
seer.RpcResetAbilityCooldown();
seer.ResetKillCooldown();

if (Main.AllPlayerKillCooldown.TryGetValue(seer.PlayerId, out var kcd) && kcd >= 2f)
seer.SetKillCooldown(kcd - 2f);
}
else if (seer.HasGhostRole())
{
seer.RpcResetAbilityCooldown();
}
}
}
public static void ResetAfterMeeting()
{
SkipTasks = false;
ExilePlayerId = -1;
ResetAllCooldown();
}
public static void Reset()
{
logger.Info("==Reset==");
Expand All @@ -244,6 +288,8 @@ public static void Reset()
IsCached = false;
ShowExiledInfo = false;
StoreExiledMessage = "";
ExilePlayerId = -1;
SkipTasks = false;
}

public static bool ShowExiledInfo = false;
Expand Down
Loading