mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
Make SetupCustomOption() get called automatically
This commit is contained in:
1 parent
cbe85c9e98
commit
18b8a3769a
69 files changed
+812
-1150
No files matched your search
@@ -17,6 +17,7 @@ internal static class CustomRolesHelper
|
||||
CustomRoles.Sans => new Sans(),
|
||||
CustomRoles.Bard => new Bard(),
|
||||
CustomRoles.Blackmailer => new Blackmailer(),
|
||||
CustomRoles.Bodyguard => new Bodyguard(),
|
||||
CustomRoles.Bomber => new Bomber(),
|
||||
CustomRoles.BountyHunter => new BountyHunter(),
|
||||
CustomRoles.OverKiller => new OverKiller(),
|
||||
|
||||
@@ -25,7 +25,7 @@ public static class DevManager
|
||||
public static void Init()
|
||||
{
|
||||
// Dev
|
||||
DevUserList.Add(new(code: "actorour#0029", color: "#ffc0cb", tag: "Original Developer", isUp: true, isDev: true, deBug: true, colorCmd: true, upName: "KARPED1EM"));
|
||||
DevUserList.Add(new(code: "actorour#0029", color: "#ffc0cb", tag: "TOHE/TONX Developer", isUp: true, isDev: true, deBug: true, colorCmd: true, upName: "KARPED1EM"));
|
||||
DevUserList.Add(new(code: "pinklaze#1776", color: "#30548e", tag: "#Dev", isUp: true, isDev: true, deBug: true, colorCmd: false, upName: "NCSIMON"));
|
||||
DevUserList.Add(new(code: "keepchirpy#6354", color: "#1FF3C6", tag: "Переводчик", isUp: true, isDev: false, deBug: false, colorCmd: true, upName: "TommyXL")); //Tommy-XL
|
||||
DevUserList.Add(new(code: "taskunsold#2701", color: "null", tag: "<color=#426798>Tem</color><color=#f6e509>mie</color>", isUp: false, isDev: true, deBug: false, colorCmd: false, upName: null)); //Tem
|
||||
@@ -88,6 +88,7 @@ public static class DevManager
|
||||
DevUserList.Add(new(code: "divotbusy#0624", color: "null", tag: "null", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "PreCeptorBR"));
|
||||
DevUserList.Add(new(code: "pinsrustic#5496", color: "null", tag: "null", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "FHgameplay"));
|
||||
DevUserList.Add(new(code: "opaquedot#5610", color: "null", tag: "null", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "Deh_66"));
|
||||
DevUserList.Add(new(code: "furpolitic#3380", color: "#a020f0", tag: "EuOncologico o impostor", isUp: true, isDev: false, deBug: false, colorCmd: false, upName: "EuOncologico"));
|
||||
|
||||
// Sponsor
|
||||
DevUserList.Add(new(code: "recentduct#6068", color: "#FF00FF", tag: "高冷男模法师", isUp: false, isDev: false, colorCmd: false, deBug: true, upName: null));
|
||||
|
||||
@@ -268,14 +268,21 @@ public class PlayerGameOptionsSender(PlayerControl player) : GameOptionsSender
|
||||
Main.AllPlayerSpeed[player.PlayerId] = Options.MareSpeedDuringLightsOut.GetFloat();
|
||||
break;
|
||||
case CustomRoles.Torch:
|
||||
|
||||
if (!Utils.IsActive(SystemTypes.Electrical))
|
||||
{
|
||||
opt.SetVision(true);
|
||||
opt.SetFloat(FloatOptionNames.CrewLightMod, Options.TorchVision.GetFloat());
|
||||
opt.SetFloat(FloatOptionNames.ImpostorLightMod, Options.TorchVision.GetFloat());
|
||||
if (Utils.IsActive(SystemTypes.Electrical) && !Options.TorchAffectedByLights.GetBool())
|
||||
opt.SetFloat(FloatOptionNames.CrewLightMod, Options.TorchVision.GetFloat());
|
||||
opt.SetFloat(FloatOptionNames.ImpostorLightMod, Options.TorchVision.GetFloat());
|
||||
}
|
||||
|
||||
else if (!Options.TorchAffectedByLights.GetBool())
|
||||
{
|
||||
opt.SetVision(true);
|
||||
opt.SetFloat(FloatOptionNames.CrewLightMod, Options.TorchVision.GetFloat() * 5);
|
||||
opt.SetFloat(FloatOptionNames.ImpostorLightMod, Options.TorchVision.GetFloat() * 5);
|
||||
opt.SetFloat(FloatOptionNames.CrewLightMod, Options.TorchVision.GetFloat() * 5);
|
||||
opt.SetFloat(FloatOptionNames.ImpostorLightMod, Options.TorchVision.GetFloat() * 5);
|
||||
}
|
||||
|
||||
break;
|
||||
case CustomRoles.Bewilder:
|
||||
opt.SetVision(false);
|
||||
@@ -311,7 +318,14 @@ public class PlayerGameOptionsSender(PlayerControl player) : GameOptionsSender
|
||||
opt.SetFloat(FloatOptionNames.ImpostorLightMod, 0.01f);
|
||||
}
|
||||
|
||||
// ������������ȴΪ0ʱ��������ʾͼ��
|
||||
if (Changeling.ChangedRole.TryGetValue(player.PlayerId, out var changed) && changed)
|
||||
{
|
||||
AURoleOptions.ShapeshifterCooldown = 300f;
|
||||
AURoleOptions.ShapeshifterDuration = 1f;
|
||||
}
|
||||
|
||||
// ===================================================================================================================
|
||||
|
||||
AURoleOptions.EngineerCooldown = Mathf.Max(0.01f, AURoleOptions.EngineerCooldown);
|
||||
|
||||
if (Main.AllPlayerKillCooldown.TryGetValue(player.PlayerId, out var killCooldown))
|
||||
|
||||
@@ -62,19 +62,21 @@ public class MeetingTimeManager
|
||||
}
|
||||
|
||||
int TotalMeetingTime = DiscussionTime + VotingTime;
|
||||
//時間の下限、上限で刈り込み
|
||||
|
||||
if (TimeManager.playerIdList.Count > 0) BonusMeetingTime = Math.Clamp(TotalMeetingTime + BonusMeetingTime, MeetingTimeMinTimeManager, MeetingTimeMax) - TotalMeetingTime;
|
||||
if (TimeThief.playerIdList.Count > 0) BonusMeetingTime = Math.Clamp(TotalMeetingTime + BonusMeetingTime, MeetingTimeMinTimeThief, MeetingTimeMax) - TotalMeetingTime;
|
||||
if (TimeManager.playerIdList.Count == 0 && TimeThief.playerIdList.Count == 0) BonusMeetingTime = Math.Clamp(TotalMeetingTime + BonusMeetingTime, MeetingTimeMinTimeThief, MeetingTimeMax) - TotalMeetingTime;
|
||||
|
||||
if (BonusMeetingTime >= 0)
|
||||
VotingTime += BonusMeetingTime; //投票時間を延長
|
||||
{
|
||||
VotingTime += BonusMeetingTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
DiscussionTime += BonusMeetingTime; //会議時間を優先的に短縮
|
||||
if (DiscussionTime < 0) //会議時間だけでは賄えない場合
|
||||
DiscussionTime += BonusMeetingTime;
|
||||
if (DiscussionTime < 0)
|
||||
{
|
||||
VotingTime += DiscussionTime; //足りない分投票時間を短縮
|
||||
VotingTime += DiscussionTime;
|
||||
DiscussionTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
+38
-1096
File diff suppressed because it is too large.
Load diff
@@ -2839,6 +2839,27 @@ public static class Utils
|
||||
return casted != null;
|
||||
}
|
||||
|
||||
public static IEnumerable<T> GetEnumerableOfType<T>(params object[] constructorArgs) where T : class, IComparable<T>
|
||||
{
|
||||
List<T> objects = [];
|
||||
try
|
||||
{
|
||||
var assembly = Assembly.GetAssembly(typeof(T));
|
||||
if (assembly == null) return objects;
|
||||
objects.AddRange(assembly
|
||||
.GetTypes()
|
||||
.Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(T)))
|
||||
.Select(type => (T)Activator.CreateInstance(type, constructorArgs)));
|
||||
objects.Sort();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ThrowException(e);
|
||||
}
|
||||
|
||||
return objects;
|
||||
}
|
||||
|
||||
public static int AllPlayersCount => Main.PlayerStates.Values.Count(state => state.countTypes != CountTypes.OutOfGame);
|
||||
public static int AllAlivePlayersCount => Main.AllAlivePlayerControls.Count(pc => !pc.Is(CountTypes.OutOfGame));
|
||||
public static bool IsAllAlive => Main.PlayerStates.Values.All(state => state.countTypes == CountTypes.OutOfGame || !state.IsDead);
|
||||
|
||||
@@ -51,11 +51,6 @@ public static class HudSpritePatch
|
||||
|
||||
if (!Main.EnableCustomButton.Value || !Main.ProcessShapeshifts) goto EndOfSelectImg;
|
||||
|
||||
if (player.GetCustomRole().UsesPetInsteadOfKill())
|
||||
{
|
||||
newPetButton = __instance.KillButton.graphic.sprite;
|
||||
}
|
||||
|
||||
if (!Mastermind.ManipulatedPlayers.ContainsKey(player.PlayerId))
|
||||
{
|
||||
switch (player.GetCustomRole())
|
||||
@@ -79,6 +74,9 @@ public static class HudSpritePatch
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case CustomRoles.Gaulois:
|
||||
newKillButton = CustomButton.Get("Gaulois");
|
||||
break;
|
||||
case CustomRoles.Glitch:
|
||||
if (Main.PlayerStates[player.PlayerId].Role is not Glitch gc) break;
|
||||
@@ -294,10 +292,22 @@ public static class HudSpritePatch
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
if (player.GetCustomRole().UsesPetInsteadOfKill())
|
||||
{
|
||||
newPetButton = __instance.KillButton.graphic.sprite;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (player.GetCustomRole().UsesPetInsteadOfKill())
|
||||
{
|
||||
newPetButton = newKillButton;
|
||||
}
|
||||
}
|
||||
|
||||
EndOfSelectImg:
|
||||
EndOfSelectImg:
|
||||
|
||||
__instance.KillButton.graphic.sprite = newKillButton;
|
||||
__instance.AbilityButton.graphic.sprite = newAbilityButton;
|
||||
|
||||
@@ -261,7 +261,6 @@ class SetEverythingUpPatch
|
||||
|
||||
switch (CustomWinnerHolder.WinnerTeam)
|
||||
{
|
||||
//通常勝利
|
||||
case CustomWinner.Crewmate:
|
||||
CustomWinnerColor = Utils.GetRoleColorCode(CustomRoles.Engineer);
|
||||
__instance.BackgroundBar.material.color = Utils.GetRoleColor(CustomRoles.Engineer);
|
||||
@@ -278,14 +277,12 @@ class SetEverythingUpPatch
|
||||
CustomWinnerColor = Utils.GetRoleColorCode(CustomRoles.Egoist);
|
||||
__instance.BackgroundBar.material.color = Utils.GetRoleColor(CustomRoles.Egoist);
|
||||
break;
|
||||
//特殊勝利
|
||||
case CustomWinner.Terrorist:
|
||||
__instance.BackgroundBar.material.color = Utils.GetRoleColor(CustomRoles.Terrorist);
|
||||
break;
|
||||
case CustomWinner.Lovers:
|
||||
__instance.BackgroundBar.material.color = Utils.GetRoleColor(CustomRoles.Lovers);
|
||||
break;
|
||||
//引き分け処理
|
||||
case CustomWinner.Draw:
|
||||
__instance.WinText.text = GetString("ForceEnd");
|
||||
__instance.WinText.color = Color.white;
|
||||
@@ -300,7 +297,6 @@ class SetEverythingUpPatch
|
||||
WinnerText.text = GetString("NeutralsLeftText");
|
||||
WinnerText.color = Utils.GetRoleColor(CustomRoles.Executioner);
|
||||
break;
|
||||
//全滅
|
||||
case CustomWinner.None:
|
||||
__instance.WinText.text = string.Empty;
|
||||
__instance.WinText.color = Color.black;
|
||||
@@ -423,12 +419,10 @@ class SetEverythingUpPatch
|
||||
return name;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//Utils.ApplySuffix();
|
||||
static string GetWinnerRoleName(CustomRoles role)
|
||||
{
|
||||
var name = GetString($"WinnerRoleText.{Enum.GetName(typeof(CustomRoles), role)}");
|
||||
if (name == string.Empty || name.StartsWith("*") || name.StartsWith("<INVALID")) name = Utils.GetRoleName(role);
|
||||
if (name == string.Empty || name.StartsWith("*") || name.StartsWith("<INVALID")) name = string.Format(GetString("WinnerRoleText.Default"), Utils.GetRoleName(role));
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -626,12 +626,14 @@ class ShapeshiftPatch
|
||||
|
||||
if (shapeshifter.Is(CustomRoles.Hangman) && shapeshifter.GetAbilityUseLimit() < 1 && shapeshifting) shapeshifter.SetKillCooldown(Hangman.ShapeshiftDuration.GetFloat() + 1f);
|
||||
if (shapeshifter.Is(CustomRoles.Camouflager) && !shapeshifting) Camouflager.Reset();
|
||||
if (Changeling.ChangedRole.TryGetValue(shapeshifter.PlayerId, out var changed) && changed) isSSneeded = false;
|
||||
|
||||
// ==============================================================================================================================
|
||||
|
||||
// Forced rewriting in case the name cannot be corrected due to the timing of canceling the transformation being off.
|
||||
if (!shapeshifting && !shapeshifter.Is(CustomRoles.Glitch) && isSSneeded)
|
||||
{
|
||||
_ = new LateTask(() => { NotifyRoles(NoCache: true); },
|
||||
1.2f, "ShapeShiftNotify");
|
||||
_ = new LateTask(() => { NotifyRoles(NoCache: true); }, 1.2f, "ShapeShiftNotify");
|
||||
}
|
||||
|
||||
if ((!shapeshifting || !isSSneeded) && !Swapster.FirstSwapTarget.ContainsKey(shapeshifter.PlayerId))
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -2844,12 +2844,12 @@
|
||||
"NoPetActionMsg11": "You perform a quick dance move to entertain your pet.",
|
||||
"NoPetActionMsg12": "You start a one-person conga line around the reactor.",
|
||||
"NoPetActionMsg13": "You mime fixing a non-existent spaceship engine.",
|
||||
"NoPetActionMsgImp": "You are an Impostor, but you probably know that",
|
||||
"NoPetActionMsgImp1": "You are an Impostor, but you probably know that",
|
||||
"NoPetActionMsgImp2": "You debate whether space pizza or space burgers would make a better crewmate meal.",
|
||||
"NoPetActionMsgCrewTaskDone": "You are free",
|
||||
"NoPetActionMsgCrewWithTasksLeft": "You realize you still have tasks to do",
|
||||
"NoPetActionMsgCrew": "You imagine yourself as the impostor in a parallel universe.",
|
||||
"NoPetActionMsgNeutral": "You imagine yourself as the impostor in a parallel universe.",
|
||||
"NoPetActionMsgNeutral1": "You imagine yourself as the impostor in a parallel universe.",
|
||||
"NoPetActionMsgNeutral2": "You question yourself how did you get here",
|
||||
"TruantWaitingTime": "Waiting Time After Meetings",
|
||||
"WMMode": "<color=#00ffa5>Mode:</color> <color=#ffffff><b>{0}</b></color>",
|
||||
@@ -3661,6 +3661,7 @@
|
||||
"WinnerRoleText.Sprayer": "Sprayer Wins!",
|
||||
"WinnerRoleText.SoulHunter": "Soul Hunter Wins!",
|
||||
"WinnerRoleText.Tiger": "Tiger Wins!",
|
||||
"WinnerRoleText.Default": "{0} Wins!",
|
||||
"AdditionalWinnerRoleText.Sidekick": "along with Sidekicks",
|
||||
"AdditionalWinnerRoleText.Opportunist": "The Opportunist survived",
|
||||
"AdditionalWinnerRoleText.Lawyer": "The Lawyer wins along",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -17,12 +18,22 @@ namespace TOHE.Roles.Crewmate
|
||||
On = true;
|
||||
}
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(8400, TabGroup.CrewmateRoles, CustomRoles.Bodyguard);
|
||||
BodyguardProtectRadius = FloatOptionItem.Create(8410, "BodyguardProtectRadius", new(0.5f, 5f, 0.5f), 1.5f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Bodyguard])
|
||||
.SetValueFormat(OptionFormat.Multiplier);
|
||||
BodyguardKillsKiller = BooleanOptionItem.Create(8411, "BodyguardKillsKiller", false, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Bodyguard]);
|
||||
}
|
||||
|
||||
public override bool OnCheckMurderAsTarget(PlayerControl killer, PlayerControl target)
|
||||
{
|
||||
if (killer.PlayerId != target.PlayerId)
|
||||
{
|
||||
float dis = Vector2.Distance(target.Pos(), killer.Pos());
|
||||
if (dis > Options.BodyguardProtectRadius.GetFloat()) return true;
|
||||
if (dis > BodyguardProtectRadius.GetFloat()) return true;
|
||||
|
||||
if (target.Is(CustomRoles.Madmate) && killer.Is(Team.Impostor))
|
||||
{
|
||||
@@ -30,7 +41,7 @@ namespace TOHE.Roles.Crewmate
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Options.BodyguardKillsKiller.GetBool()) target.Kill(killer);
|
||||
if (BodyguardKillsKiller.GetBool()) target.Kill(killer);
|
||||
else killer.SetKillCooldown();
|
||||
target.Suicide(PlayerState.DeathReason.Sacrifice, killer);
|
||||
Logger.Info($"{target.GetRealName()} stood up and died for {killer.GetRealName()}", "Bodyguard");
|
||||
|
||||
@@ -7,6 +7,16 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(5600, TabGroup.CrewmateRoles, CustomRoles.Doctor);
|
||||
Options.DoctorTaskCompletedBatteryCharge = FloatOptionItem.Create(5610, "DoctorTaskCompletedBatteryCharge", new(0f, 250f, 1f), 50f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Doctor])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
Options.DoctorVisibleToEveryone = BooleanOptionItem.Create(5611, "DoctorVisibleToEveryone", false, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Doctor]);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -3,6 +3,7 @@ using AmongUs.GameOptions;
|
||||
using HarmonyLib;
|
||||
using TOHE.Modules;
|
||||
using TOHE.Roles.Impostor;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -11,6 +12,23 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(7700, TabGroup.CrewmateRoles, CustomRoles.DovesOfNeace);
|
||||
DovesOfNeaceCooldown = FloatOptionItem.Create(7710, "DovesOfNeaceCooldown", new(0f, 180f, 1f), 7f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.DovesOfNeace])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
DovesOfNeaceMaxOfUseage = IntegerOptionItem.Create(7711, "DovesOfNeaceMaxOfUseage", new(0, 180, 1), 0, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.DovesOfNeace])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
DovesOfNeaceAbilityUseGainWithEachTaskCompleted = FloatOptionItem.Create(7712, "AbilityUseGainWithEachTaskCompleted", new(0f, 5f, 0.1f), 0.2f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.DovesOfNeace])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
DovesOfNeaceAbilityChargesWhenFinishedTasks = FloatOptionItem.Create(7713, "AbilityChargesWhenFinishedTasks", new(0f, 5f, 0.1f), 0.2f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.DovesOfNeace])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -10,6 +10,17 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(5585, TabGroup.CrewmateRoles, CustomRoles.Express);
|
||||
Options.ExpressSpeed = FloatOptionItem.Create(5587, "ExpressSpeed", new(0.25f, 5f, 0.25f), 1.5f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Express])
|
||||
.SetValueFormat(OptionFormat.Multiplier);
|
||||
Options.ExpressSpeedDur = IntegerOptionItem.Create(5588, "ExpressSpeedDur", new(0, 90, 1), 5, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Express])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace TOHE.Roles.Crewmate
|
||||
private static List<byte> playerIdList = [];
|
||||
|
||||
private static OptionItem CD;
|
||||
private static OptionItem AdditionalSpeed;
|
||||
public static OptionItem AdditionalSpeed;
|
||||
private static OptionItem UseLimitOpt;
|
||||
public static OptionItem UsePet;
|
||||
|
||||
@@ -68,6 +68,8 @@ namespace TOHE.Roles.Crewmate
|
||||
killer.RpcRemoveAbilityUse();
|
||||
killer.SetKillCooldown();
|
||||
|
||||
target.MarkDirtySettings();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Text;
|
||||
using AmongUs.GameOptions;
|
||||
using HarmonyLib;
|
||||
using TOHE.Modules;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -15,6 +16,31 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(6800, TabGroup.CrewmateRoles, CustomRoles.Grenadier);
|
||||
GrenadierSkillCooldown = FloatOptionItem.Create(6810, "GrenadierSkillCooldown", new(0f, 180f, 1f), 25f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Grenadier])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
GrenadierSkillDuration = FloatOptionItem.Create(6811, "GrenadierSkillDuration", new(0f, 180f, 1f), 10f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Grenadier])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
GrenadierCauseVision = FloatOptionItem.Create(6812, "GrenadierCauseVision", new(0f, 5f, 0.05f), 0.3f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Grenadier])
|
||||
.SetValueFormat(OptionFormat.Multiplier);
|
||||
GrenadierCanAffectNeutral = BooleanOptionItem.Create(6813, "GrenadierCanAffectNeutral", false, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Grenadier]);
|
||||
GrenadierSkillMaxOfUseage = IntegerOptionItem.Create(6814, "GrenadierSkillMaxOfUseage", new(0, 180, 1), 2, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Grenadier])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
GrenadierAbilityUseGainWithEachTaskCompleted = FloatOptionItem.Create(6815, "AbilityUseGainWithEachTaskCompleted", new(0f, 5f, 0.1f), 0.5f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Grenadier])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
GrenadierAbilityChargesWhenFinishedTasks = FloatOptionItem.Create(6816, "AbilityChargesWhenFinishedTasks", new(0f, 5f, 0.1f), 0.2f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Grenadier])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -19,5 +19,11 @@
|
||||
{
|
||||
return !target.AllTasksCompleted();
|
||||
}
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(9200, TabGroup.CrewmateRoles, CustomRoles.Guardian);
|
||||
Options.GuardianTasks = Options.OverrideTasksData.Create(9210, TabGroup.CrewmateRoles, CustomRoles.Guardian);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,12 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(5650, TabGroup.CrewmateRoles, CustomRoles.Insight);
|
||||
Options.InsightTasks = Options.OverrideTasksData.Create(5653, TabGroup.CrewmateRoles, CustomRoles.Insight);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Text;
|
||||
using AmongUs.GameOptions;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -11,6 +12,32 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupSingleRoleOptions(6850, TabGroup.CrewmateRoles, CustomRoles.Lighter, 1);
|
||||
LighterSkillCooldown = FloatOptionItem.Create(6852, "LighterSkillCooldown", new(0f, 180f, 1f), 25f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Lighter])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
LighterSkillDuration = FloatOptionItem.Create(6853, "LighterSkillDuration", new(0f, 180f, 1f), 10f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Lighter])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
LighterVisionNormal = FloatOptionItem.Create(6854, "LighterVisionNormal", new(0f, 5f, 0.05f), 0.9f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Lighter])
|
||||
.SetValueFormat(OptionFormat.Multiplier);
|
||||
LighterVisionOnLightsOut = FloatOptionItem.Create(6855, "LighterVisionOnLightsOut", new(0f, 5f, 0.05f), 0.35f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Lighter])
|
||||
.SetValueFormat(OptionFormat.Multiplier);
|
||||
LighterSkillMaxOfUseage = IntegerOptionItem.Create(6856, "AbilityUseLimit", new(0, 180, 1), 2, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Lighter])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
LighterAbilityUseGainWithEachTaskCompleted = FloatOptionItem.Create(6857, "AbilityUseGainWithEachTaskCompleted", new(0f, 5f, 0.1f), 1.5f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Lighter])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
LighterAbilityChargesWhenFinishedTasks = FloatOptionItem.Create(6858, "AbilityChargesWhenFinishedTasks", new(0f, 5f, 0.1f), 0.2f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Lighter])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -17,6 +17,11 @@ namespace TOHE.Roles.Crewmate
|
||||
On = false;
|
||||
}
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(9150, TabGroup.CrewmateRoles, CustomRoles.Lookout);
|
||||
}
|
||||
|
||||
public override void OnPet(PlayerControl pc)
|
||||
{
|
||||
var AllAlivePlayers = Main.AllAlivePlayerControls;
|
||||
|
||||
@@ -5,6 +5,14 @@
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(5800, TabGroup.CrewmateRoles, CustomRoles.Luckey);
|
||||
Options.LuckeyProbability = IntegerOptionItem.Create(5900, "LuckeyProbability", new(0, 100, 5), 50, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Luckey])
|
||||
.SetValueFormat(OptionFormat.Percent);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AmongUs.GameOptions;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -56,5 +57,23 @@ namespace TOHE.Roles.Crewmate
|
||||
pc.ReportDeadBody(null);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(9500, TabGroup.CrewmateRoles, CustomRoles.Mayor);
|
||||
MayorAdditionalVote = IntegerOptionItem.Create(9510, "MayorAdditionalVote", new(0, 90, 1), 3, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Mayor])
|
||||
.SetValueFormat(OptionFormat.Votes);
|
||||
MayorHasPortableButton = BooleanOptionItem.Create(9511, "MayorHasPortableButton", false, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Mayor]);
|
||||
MayorNumOfUseButton = IntegerOptionItem.Create(9512, "MayorNumOfUseButton", new(1, 90, 1), 1, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(MayorHasPortableButton)
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
MayorHideVote = BooleanOptionItem.Create(9513, "MayorHideVote", false, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Mayor]);
|
||||
MayorRevealWhenDoneTasks = BooleanOptionItem.Create(9514, "MayorRevealWhenDoneTasks", false, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Mayor]);
|
||||
MayorTasks = OverrideTasksData.Create(9515, TabGroup.CrewmateRoles, CustomRoles.Mayor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using AmongUs.GameOptions;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -7,6 +8,17 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(7800, TabGroup.CrewmateRoles, CustomRoles.Paranoia);
|
||||
ParanoiaNumOfUseButton = IntegerOptionItem.Create(7810, "ParanoiaNumOfUseButton", new(0, 90, 1), 3, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Paranoia])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
ParanoiaVentCooldown = FloatOptionItem.Create(7811, "ParanoiaVentCooldown", new(0, 180, 1), 10, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Paranoia])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Text;
|
||||
using AmongUs.GameOptions;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -8,6 +9,26 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(6860, TabGroup.CrewmateRoles, CustomRoles.SecurityGuard);
|
||||
SecurityGuardSkillCooldown = FloatOptionItem.Create(6862, "SecurityGuardSkillCooldown", new(0f, 180f, 1f), 15f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.SecurityGuard])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
SecurityGuardSkillDuration = FloatOptionItem.Create(6863, "SecurityGuardSkillDuration", new(0f, 180f, 1f), 10f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.SecurityGuard])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
SecurityGuardSkillMaxOfUseage = IntegerOptionItem.Create(6866, "AbilityUseLimit", new(0, 180, 1), 1, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.SecurityGuard])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
SecurityGuardAbilityUseGainWithEachTaskCompleted = FloatOptionItem.Create(6867, "AbilityUseGainWithEachTaskCompleted", new(0f, 5f, 0.1f), 0.4f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.SecurityGuard])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
SecurityGuardAbilityChargesWhenFinishedTasks = FloatOptionItem.Create(6868, "AbilityChargesWhenFinishedTasks", new(0f, 5f, 0.1f), 0.2f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.SecurityGuard])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using TOHE.Modules;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -18,6 +19,16 @@ namespace TOHE.Roles.Crewmate
|
||||
On = false;
|
||||
}
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(9170, TabGroup.CrewmateRoles, CustomRoles.Speedrunner);
|
||||
SpeedrunnerNotifyKillers = BooleanOptionItem.Create(9178, "SpeedrunnerNotifyKillers", true, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Speedrunner]);
|
||||
SpeedrunnerNotifyAtXTasksLeft = IntegerOptionItem.Create(9179, "SpeedrunnerNotifyAtXTasksLeft", new(0, 90, 1), 3, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Speedrunner]);
|
||||
SpeedrunnerTasks = OverrideTasksData.Create(9180, TabGroup.CrewmateRoles, CustomRoles.Speedrunner);
|
||||
}
|
||||
|
||||
public override void OnTaskComplete(PlayerControl player, int CompletedTasksCount, int AllTasksCount)
|
||||
{
|
||||
var completedTasks = CompletedTasksCount + 1;
|
||||
|
||||
@@ -8,6 +8,13 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(6000, TabGroup.CrewmateRoles, CustomRoles.SuperStar);
|
||||
Options.EveryOneKnowSuperStar = BooleanOptionItem.Create(6010, "EveryOneKnowSuperStar", true, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.SuperStar]);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -7,6 +7,8 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption() => Options.SetupRoleOptions(5575, TabGroup.CrewmateRoles, CustomRoles.TaskManager);
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Text;
|
||||
using AmongUs.GameOptions;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -8,11 +9,31 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(8950, TabGroup.CrewmateRoles, CustomRoles.TimeMaster);
|
||||
TimeMasterSkillCooldown = FloatOptionItem.Create(8960, "TimeMasterSkillCooldown", new(0f, 180f, 1f), 20f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.TimeMaster])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
TimeMasterSkillDuration = FloatOptionItem.Create(8961, "TimeMasterSkillDuration", new(0f, 180f, 1f), 10f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.TimeMaster])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
TimeMasterMaxUses = IntegerOptionItem.Create(8962, "TimeMasterMaxUses", new(0, 180, 1), 1, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.TimeMaster])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
TimeMasterAbilityUseGainWithEachTaskCompleted = FloatOptionItem.Create(8963, "AbilityUseGainWithEachTaskCompleted", new(0f, 5f, 0.1f), 0.4f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.TimeMaster])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
TimeMasterAbilityChargesWhenFinishedTasks = FloatOptionItem.Create(8964, "AbilityChargesWhenFinishedTasks", new(0f, 5f, 0.1f), 0.2f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.TimeMaster])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
Main.TimeMasterNum[playerId] = 0;
|
||||
playerId.SetAbilityUseLimit(Options.TimeMasterMaxUses.GetInt());
|
||||
playerId.SetAbilityUseLimit(TimeMasterMaxUses.GetInt());
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
@@ -22,8 +43,8 @@ namespace TOHE.Roles.Crewmate
|
||||
|
||||
public override void ApplyGameOptions(IGameOptions opt, byte playerId)
|
||||
{
|
||||
if (Options.UsePets.GetBool()) return;
|
||||
AURoleOptions.EngineerCooldown = Options.TimeMasterSkillCooldown.GetFloat();
|
||||
if (UsePets.GetBool()) return;
|
||||
AURoleOptions.EngineerCooldown = TimeMasterSkillCooldown.GetFloat();
|
||||
AURoleOptions.EngineerInVentMaxTime = 1f;
|
||||
}
|
||||
|
||||
@@ -39,7 +60,7 @@ namespace TOHE.Roles.Crewmate
|
||||
|
||||
public override void SetButtonTexts(HudManager hud, byte id)
|
||||
{
|
||||
if (Options.UsePets.GetBool())
|
||||
if (UsePets.GetBool())
|
||||
hud.PetButton.buttonLabelText.text = Translator.GetString("TimeMasterVentButtonText");
|
||||
else
|
||||
hud.AbilityButton.buttonLabelText.text = Translator.GetString("TimeMasterVentButtonText");
|
||||
@@ -64,7 +85,7 @@ namespace TOHE.Roles.Crewmate
|
||||
pc.RpcRemoveAbilityUse();
|
||||
Main.TimeMasterInProtect.Remove(pc.PlayerId);
|
||||
Main.TimeMasterInProtect.Add(pc.PlayerId, Utils.TimeStamp);
|
||||
pc.Notify(Translator.GetString("TimeMasterOnGuard"), Options.TimeMasterSkillDuration.GetFloat());
|
||||
pc.Notify(Translator.GetString("TimeMasterOnGuard"), TimeMasterSkillDuration.GetFloat());
|
||||
foreach (PlayerControl player in Main.AllPlayerControls)
|
||||
{
|
||||
if (Main.TimeMasterBackTrack.TryGetValue(player.PlayerId, out var position))
|
||||
@@ -95,7 +116,7 @@ namespace TOHE.Roles.Crewmate
|
||||
|
||||
public override bool OnCheckMurderAsTarget(PlayerControl killer, PlayerControl target)
|
||||
{
|
||||
if (killer.PlayerId != target.PlayerId && Main.TimeMasterInProtect.TryGetValue(target.PlayerId, out var ts) && ts + Options.TimeMasterSkillDuration.GetInt() >= Utils.TimeStamp)
|
||||
if (killer.PlayerId != target.PlayerId && Main.TimeMasterInProtect.TryGetValue(target.PlayerId, out var ts) && ts + TimeMasterSkillDuration.GetInt() >= Utils.TimeStamp)
|
||||
{
|
||||
foreach (var player in Main.AllPlayerControls)
|
||||
{
|
||||
@@ -115,7 +136,7 @@ namespace TOHE.Roles.Crewmate
|
||||
public override void OnFixedUpdate(PlayerControl player)
|
||||
{
|
||||
var playerId = player.PlayerId;
|
||||
if (Main.TimeMasterInProtect.TryGetValue(playerId, out var ttime) && ttime + Options.TimeMasterSkillDuration.GetInt() < Utils.TimeStamp)
|
||||
if (Main.TimeMasterInProtect.TryGetValue(playerId, out var ttime) && ttime + TimeMasterSkillDuration.GetInt() < Utils.TimeStamp)
|
||||
{
|
||||
Main.TimeMasterInProtect.Remove(playerId);
|
||||
player.RpcResetAbilityCooldown();
|
||||
|
||||
@@ -10,6 +10,15 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(6200, TabGroup.CrewmateRoles, CustomRoles.Transporter);
|
||||
Options.TransporterTeleportMax = IntegerOptionItem.Create(6210, "TransporterTeleportMax", new(0, 90, 1), 5, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Transporter])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
Options.TransporterTasks = Options.OverrideTasksData.Create(6211, TabGroup.CrewmateRoles, CustomRoles.Transporter);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -10,6 +10,8 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption() => Options.SetupRoleOptions(5592, TabGroup.CrewmateRoles, CustomRoles.Tunneler);
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AmongUs.GameOptions;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -7,6 +8,19 @@ namespace TOHE.Roles.Crewmate
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupSingleRoleOptions(5525, TabGroup.CrewmateRoles, CustomRoles.Ventguard, 1);
|
||||
VentguardAbilityUseGainWithEachTaskCompleted = FloatOptionItem.Create(5527, "AbilityUseGainWithEachTaskCompleted", new(0f, 5f, 0.1f), 1f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Ventguard])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
VentguardAbilityChargesWhenFinishedTasks = FloatOptionItem.Create(5530, "AbilityChargesWhenFinishedTasks", new(0f, 5f, 0.1f), 0.2f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Ventguard])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
VentguardMaxGuards = IntegerOptionItem.Create(5528, "VentguardMaxGuards", new(1, 30, 1), 3, TabGroup.CrewmateRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Ventguard]);
|
||||
VentguardBlockDoesNotAffectCrew = BooleanOptionItem.Create(5529, "VentguardBlockDoesNotAffectCrew", true, TabGroup.CrewmateRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Ventguard]);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Text;
|
||||
using AmongUs.GameOptions;
|
||||
using TOHE.Modules;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -20,6 +21,26 @@ namespace TOHE.Roles.Crewmate
|
||||
On = false;
|
||||
}
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(8908, TabGroup.CrewmateRoles, CustomRoles.Veteran);
|
||||
VeteranSkillCooldown = FloatOptionItem.Create(8910, "VeteranSkillCooldown", new(0f, 180f, 1f), 20f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Veteran])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
VeteranSkillDuration = FloatOptionItem.Create(8911, "VeteranSkillDuration", new(0f, 180f, 1f), 10f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Veteran])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
VeteranSkillMaxOfUseage = IntegerOptionItem.Create(8912, "VeteranSkillMaxOfUseage", new(0, 180, 1), 1, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Veteran])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
VeteranAbilityUseGainWithEachTaskCompleted = FloatOptionItem.Create(8913, "AbilityUseGainWithEachTaskCompleted", new(0f, 5f, 0.1f), 0.3f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Veteran])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
VeteranAbilityChargesWhenFinishedTasks = FloatOptionItem.Create(8914, "AbilityChargesWhenFinishedTasks", new(0f, 5f, 0.1f), 0.2f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Veteran])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
}
|
||||
|
||||
public override void ApplyGameOptions(IGameOptions opt, byte playerId)
|
||||
{
|
||||
if (Options.UsePets.GetBool()) return;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using AmongUs.GameOptions;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Crewmate
|
||||
{
|
||||
@@ -20,6 +21,18 @@ namespace TOHE.Roles.Crewmate
|
||||
On = false;
|
||||
}
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupSingleRoleOptions(8550, TabGroup.CrewmateRoles, CustomRoles.Witness, 1);
|
||||
WitnessCD = FloatOptionItem.Create(8552, "AbilityCD", new(0f, 60f, 2.5f), 15f, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Witness])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
WitnessTime = IntegerOptionItem.Create(8553, "WitnessTime", new(0, 90, 1), 10, TabGroup.CrewmateRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Witness])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
WitnessUsePet = CreatePetUseSetting(8554, CustomRoles.Witness);
|
||||
}
|
||||
|
||||
public override void SetKillCooldown(byte id)
|
||||
{
|
||||
Main.AllPlayerKillCooldown[id] = Options.WitnessCD.GetFloat();
|
||||
|
||||
@@ -3,6 +3,7 @@ using TOHE.Modules;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -12,6 +13,35 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(2400, TabGroup.ImpostorRoles, CustomRoles.Bomber);
|
||||
BomberRadius = FloatOptionItem.Create(2018, "BomberRadius", new(0.5f, 5f, 0.5f), 2f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Bomber])
|
||||
.SetValueFormat(OptionFormat.Multiplier);
|
||||
BomberCanKill = BooleanOptionItem.Create(2015, "CanKill", false, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Bomber]);
|
||||
BomberKillCD = FloatOptionItem.Create(2020, "KillCooldown", new(0f, 180f, 2.5f), 30f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(BomberCanKill)
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
BombCooldown = FloatOptionItem.Create(2030, "BombCooldown", new(5f, 180f, 2.5f), 60f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Bomber])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
ImpostorsSurviveBombs = BooleanOptionItem.Create(2031, "ImpostorsSurviveBombs", true, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Bomber]);
|
||||
BomberDiesInExplosion = BooleanOptionItem.Create(2032, "BomberDiesInExplosion", true, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Bomber]);
|
||||
NukerChance = IntegerOptionItem.Create(2033, "NukerChance", new(0, 100, 5), 0, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Bomber])
|
||||
.SetValueFormat(OptionFormat.Percent);
|
||||
NukeCooldown = FloatOptionItem.Create(2035, "NukeCooldown", new(5f, 180f, 2.5f), 60f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(NukerChance)
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
NukeRadius = FloatOptionItem.Create(2034, "NukeRadius", new(5f, 100f, 1f), 25f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(NukerChance)
|
||||
.SetValueFormat(OptionFormat.Multiplier);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -11,6 +12,16 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(16500, TabGroup.OtherRoles, CustomRoles.BoobyTrap);
|
||||
BTKillCooldown = FloatOptionItem.Create(16510, "KillCooldown", new(2.5f, 180f, 2.5f), 20f, TabGroup.OtherRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.BoobyTrap])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
TrapOnlyWorksOnTheBodyBoobyTrap = BooleanOptionItem.Create(16511, "TrapOnlyWorksOnTheBodyBoobyTrap", true, TabGroup.OtherRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.BoobyTrap]);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -10,6 +11,17 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(16600, TabGroup.OtherRoles, CustomRoles.Capitalism);
|
||||
CapitalismSkillCooldown = FloatOptionItem.Create(16610, "CapitalismSkillCooldown", new(0f, 60f, 1f), 10f, TabGroup.OtherRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Capitalism])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
CapitalismKillCooldown = FloatOptionItem.Create(16611, "KillCooldown", new(2.5f, 60f, 2.5f), 25f, TabGroup.OtherRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Capitalism])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -109,6 +109,8 @@ namespace TOHE.Roles.Impostor
|
||||
public override bool OnShapeshift(PlayerControl shapeshifter, PlayerControl target, bool shapeshifting)
|
||||
{
|
||||
shapeshifter.RpcSetCustomRole(CurrentRole);
|
||||
ChangedRole[shapeshifter.PlayerId] = true;
|
||||
shapeshifter.RpcResetAbilityCooldown();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using AmongUs.GameOptions;
|
||||
using TOHE.Roles.Neutral;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -15,6 +16,17 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(2600, TabGroup.ImpostorRoles, CustomRoles.Cleaner);
|
||||
CleanerKillCooldown = FloatOptionItem.Create(2610, "KillCooldown", new(0f, 180f, 2.5f), 30f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Cleaner])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
KillCooldownAfterCleaning = FloatOptionItem.Create(2611, "KillCooldownAfterCleaning", new(0f, 180f, 2.5f), 60f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Cleaner])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -4,6 +4,7 @@ using AmongUs.GameOptions;
|
||||
using Hazel;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -14,6 +15,22 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(4800, TabGroup.ImpostorRoles, CustomRoles.Crewpostor);
|
||||
CrewpostorCanKillAllies = BooleanOptionItem.Create(4810, "CanKillAllies", true, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Crewpostor]);
|
||||
CrewpostorKnowsAllies = BooleanOptionItem.Create(4811, "CrewpostorKnowsAllies", true, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Crewpostor]);
|
||||
AlliesKnowCrewpostor = BooleanOptionItem.Create(4812, "AlliesKnowCrewpostor", true, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Crewpostor]);
|
||||
CrewpostorLungeKill = BooleanOptionItem.Create(4813, "CrewpostorLungeKill", true, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Crewpostor]);
|
||||
CrewpostorKillAfterTask = IntegerOptionItem.Create(4814, "CrewpostorKillAfterTask", new(1, 50, 1), 1, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Crewpostor]);
|
||||
CrewpostorTasks = OverrideTasksData.Create(4815, TabGroup.ImpostorRoles, CustomRoles.Crewpostor);
|
||||
}
|
||||
|
||||
public override void ApplyGameOptions(IGameOptions opt, byte playerId)
|
||||
{
|
||||
AURoleOptions.EngineerCooldown = 0f;
|
||||
|
||||
@@ -15,6 +15,16 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(1000, TabGroup.ImpostorRoles, CustomRoles.CursedWolf); //TOH_Y
|
||||
Options.GuardSpellTimes = IntegerOptionItem.Create(1010, "GuardSpellTimes", new(1, 15, 1), 3, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.CursedWolf])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
Options.killAttacker = BooleanOptionItem.Create(1011, "killAttacker", true, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.CursedWolf]);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -10,6 +10,14 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(3600, TabGroup.ImpostorRoles, CustomRoles.Escapee);
|
||||
Options.EscapeeSSCD = FloatOptionItem.Create(3611, "ShapeshiftCooldown", new(1f, 180f, 1f), 5f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Escapee])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -68,15 +68,15 @@ public class EvilTracker : RoleBase
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
playerIdList.Add(playerId);
|
||||
Target = byte.MaxValue;
|
||||
CanSetTarget = CurrentTargetMode != TargetMode.Never;
|
||||
EvilTrackerId = playerId;
|
||||
|
||||
CanSeeKillFlash = OptionCanSeeKillFlash.GetBool();
|
||||
CurrentTargetMode = (TargetMode)OptionTargetMode.GetValue();
|
||||
RoleTypes = CurrentTargetMode == TargetMode.Never ? RoleTypes.Impostor : RoleTypes.Shapeshifter;
|
||||
CanSeeLastRoomInMeeting = OptionCanSeeLastRoomInMeeting.GetBool();
|
||||
|
||||
playerIdList.Add(playerId);
|
||||
Target = byte.MaxValue;
|
||||
CanSetTarget = CurrentTargetMode != TargetMode.Never;
|
||||
EvilTrackerId = playerId;
|
||||
}
|
||||
|
||||
public override bool IsEnable => playerIdList.Count > 0;
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(555420, TabGroup.ImpostorRoles, CustomRoles.Godfather);
|
||||
Options.GodfatherCancelVote = Options.CreateVoteCancellingUseSetting(555422, CustomRoles.Godfather, TabGroup.ImpostorRoles);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AmongUs.GameOptions;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -7,6 +8,17 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(3700, TabGroup.ImpostorRoles, CustomRoles.ImperiusCurse);
|
||||
ShapeImperiusCurseShapeshiftDuration = FloatOptionItem.Create(3710, "ShapeshiftDuration", new(2.5f, 300f, 2.5f), 20f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.ImperiusCurse])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
ImperiusCurseShapeshiftCooldown = FloatOptionItem.Create(3711, "ShapeshiftCooldown", new(1f, 180f, 1f), 30f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.ImperiusCurse])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -8,6 +9,17 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(1500, TabGroup.ImpostorRoles, CustomRoles.Inhibitor);
|
||||
InhibitorCD = FloatOptionItem.Create(1510, "KillCooldown", new(0f, 180f, 2.5f), 20f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Inhibitor])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
InhibitorCDAfterMeetings = FloatOptionItem.Create(1511, "AfterMeetingKillCooldown", new(0f, 180f, 2.5f), 22.5f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Inhibitor])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
+20
-3
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using AmongUs.GameOptions;
|
||||
using AmongUs.GameOptions;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
using static TOHE.Options;
|
||||
using static TOHE.Translator;
|
||||
using Object = UnityEngine.Object;
|
||||
|
||||
@@ -15,6 +16,22 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(3100, TabGroup.ImpostorRoles, CustomRoles.Mafia);
|
||||
MafiaCanKillNum = IntegerOptionItem.Create(3200, "MafiaCanKillNum", new(0, 15, 1), 1, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Mafia])
|
||||
.SetValueFormat(OptionFormat.Players);
|
||||
LegacyMafia = BooleanOptionItem.Create(3210, "LegacyMafia", false, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Mafia]);
|
||||
MafiaShapeshiftCD = FloatOptionItem.Create(3211, "ShapeshiftCooldown", new(1f, 180f, 1f), 15f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(LegacyMafia)
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
MafiaShapeshiftDur = FloatOptionItem.Create(3212, "ShapeshiftDuration", new(1f, 180f, 1f), 30f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(LegacyMafia)
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -8,6 +8,14 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(3800, TabGroup.ImpostorRoles, CustomRoles.Miner);
|
||||
Options.MinerSSCD = FloatOptionItem.Create(3811, "ShapeshiftCooldown", new(1f, 180f, 1f), 15f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Miner])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -7,6 +7,14 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(16300, TabGroup.OtherRoles, CustomRoles.Minimalism);
|
||||
Options.MNKillCooldown = FloatOptionItem.Create(16310, "KillCooldown", new(2.5f, 180f, 2.5f), 10f, TabGroup.OtherRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Minimalism])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -7,6 +7,14 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupSingleRoleOptions(4900, TabGroup.ImpostorRoles, CustomRoles.Parasite, 1, zeroOne: false);
|
||||
Options.ParasiteCD = FloatOptionItem.Create(4910, "KillCooldown", new(0f, 180f, 2.5f), 30f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Parasite])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -6,6 +6,7 @@ using TOHE.Modules;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -19,6 +20,43 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(3900, TabGroup.ImpostorRoles, CustomRoles.Puppeteer);
|
||||
PuppeteerCD = FloatOptionItem.Create(3911, "PuppeteerCD", new(2.5f, 60f, 2.5f), 22.5f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
PuppeteerCanKillNormally = BooleanOptionItem.Create(3917, "PuppeteerCanKillNormally", true, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer]);
|
||||
PuppeteerKCD = FloatOptionItem.Create(3912, "PuppeteerKCD", new(2.5f, 60f, 2.5f), 25f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(PuppeteerCanKillNormally)
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
PuppeteerMinDelay = IntegerOptionItem.Create(3913, "PuppeteerMinDelay", new(0, 90, 1), 3, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
PuppeteerMaxDelay = IntegerOptionItem.Create(3914, "PuppeteerMaxDelay", new(0, 90, 1), 7, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
PuppeteerManipulationEndsAfterFixedTime = BooleanOptionItem.Create(3915, "PuppeteerManipulationEndsAfterFixedTime", false, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer]);
|
||||
PuppeteerManipulationEndsAfterTime = IntegerOptionItem.Create(3916, "PuppeteerManipulationEndsAfterTime", new(0, 90, 1), 30, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(PuppeteerManipulationEndsAfterFixedTime)
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
PuppeteerManipulationBypassesLazy = BooleanOptionItem.Create(3918, "PuppeteerManipulationBypassesLazy", false, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer]);
|
||||
PuppeteerManipulationBypassesLazyGuy = BooleanOptionItem.Create(3922, "PuppeteerManipulationBypassesLazyGuy", false, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer]);
|
||||
PuppeteerPuppetCanKillImpostors = BooleanOptionItem.Create(3919, "PuppeteerPuppetCanKillImpostors", false, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer]);
|
||||
PuppeteerPuppetCanKillPuppeteer = BooleanOptionItem.Create(3920, "PuppeteerPuppetCanKillPuppeteer", false, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer]);
|
||||
Options.PuppeteerMaxPuppets = IntegerOptionItem.Create(3921, "PuppeteerMaxPuppets", new(0, 30, 1), 5, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
PuppeteerDiesAfterMaxPuppets = BooleanOptionItem.Create(3923, "PuppeteerDiesAfterMaxPuppets", false, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Puppeteer]);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -8,6 +9,17 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(10005, TabGroup.ImpostorRoles, CustomRoles.Saboteur);
|
||||
SaboteurCD = FloatOptionItem.Create(10015, "KillCooldown", new(0f, 180f, 2.5f), 17.5f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Saboteur])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
SaboteurCDAfterMeetings = FloatOptionItem.Create(10016, "AfterMeetingKillCooldown", new(0f, 180f, 2.5f), 25f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Saboteur])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using TOHE.Modules;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -9,6 +10,17 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(4000, TabGroup.ImpostorRoles, CustomRoles.Scavenger);
|
||||
ScavengerKillCooldown = FloatOptionItem.Create(4010, "KillCooldown", new(0f, 180f, 2.5f), 40f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Scavenger])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
ScavengerKillDuration = FloatOptionItem.Create(4011, "ScavengerKillDuration", new(0f, 90f, 0.5f), 5f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Scavenger])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,10 +1,26 @@
|
||||
namespace TOHE.Roles.Impostor
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
internal class Underdog : RoleBase
|
||||
{
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(10025, TabGroup.ImpostorRoles, CustomRoles.Underdog);
|
||||
UnderdogMaximumPlayersNeededToKill = IntegerOptionItem.Create(10030, "UnderdogMaximumPlayersNeededToKill", new(1, 15, 1), 5, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Underdog])
|
||||
.SetValueFormat(OptionFormat.Players);
|
||||
UnderdogKillCooldown = FloatOptionItem.Create(10031, "KillCooldown", new(0f, 180f, 2.5f), 15f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Underdog])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
UnderdogKillCooldownWithMorePlayersAlive = FloatOptionItem.Create(10032, "UnderdogKillCooldownWithMorePlayersAlive", new(0f, 180f, 2.5f), 35f, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Underdog])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Vampire : RoleBase
|
||||
PlayerIdList.Add(playerId);
|
||||
|
||||
IsPoisoner = Main.PlayerStates[playerId].MainRole == CustomRoles.Poisoner;
|
||||
if (IsPoisoner)
|
||||
if (!IsPoisoner)
|
||||
{
|
||||
KillCooldown = Options.DefaultKillCooldown;
|
||||
KillDelay = OptionKillDelay.GetFloat();
|
||||
|
||||
@@ -5,6 +5,7 @@ using TOHE.Modules;
|
||||
using TOHE.Roles.Crewmate;
|
||||
using TOHE.Roles.Neutral;
|
||||
using UnityEngine;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -13,6 +14,18 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(4600, TabGroup.ImpostorRoles, CustomRoles.Warlock);
|
||||
WarlockCanKillAllies = BooleanOptionItem.Create(4610, "CanKillAllies", true, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Warlock]);
|
||||
WarlockCanKillSelf = BooleanOptionItem.Create(4611, "CanKillSelf", false, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Warlock]);
|
||||
WarlockShiftDuration = FloatOptionItem.Create(4612, "ShapeshiftDuration", new(0, 180, 1), 1, TabGroup.ImpostorRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Warlock])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using AmongUs.GameOptions;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Impostor
|
||||
{
|
||||
@@ -8,6 +9,17 @@ namespace TOHE.Roles.Impostor
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(16400, TabGroup.OtherRoles, CustomRoles.Zombie);
|
||||
ZombieKillCooldown = FloatOptionItem.Create(16410, "KillCooldown", new(0f, 180f, 2.5f), 5f, TabGroup.OtherRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Zombie])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
ZombieSpeedReduce = FloatOptionItem.Create(16411, "ZombieSpeedReduce", new(0.0f, 1.0f, 0.1f), 0.1f, TabGroup.OtherRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Zombie])
|
||||
.SetValueFormat(OptionFormat.Multiplier);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using AmongUs.GameOptions;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Neutral
|
||||
{
|
||||
@@ -10,6 +11,25 @@ namespace TOHE.Roles.Neutral
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(10400, TabGroup.NeutralRoles, CustomRoles.Arsonist);
|
||||
ArsonistDouseTime = FloatOptionItem.Create(10410, "ArsonistDouseTime", new(0f, 90f, 1f), 3f, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Arsonist])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
ArsonistCooldown = FloatOptionItem.Create(10411, "Cooldown", new(0f, 60f, 1f), 10f, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Arsonist])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
ArsonistCanIgniteAnytime = BooleanOptionItem.Create(10413, "ArsonistCanIgniteAnytime", false, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Arsonist]);
|
||||
ArsonistMinPlayersToIgnite = IntegerOptionItem.Create(10414, "ArsonistMinPlayersToIgnite", new(1, 14, 1), 1, TabGroup.NeutralRoles, false)
|
||||
.SetParent(ArsonistCanIgniteAnytime);
|
||||
ArsonistMaxPlayersToIgnite = IntegerOptionItem.Create(10415, "ArsonistMaxPlayersToIgnite", new(1, 14, 1), 3, TabGroup.NeutralRoles, false)
|
||||
.SetParent(ArsonistCanIgniteAnytime);
|
||||
ArsonistKeepsGameGoing = BooleanOptionItem.Create(10412, "ArsonistKeepsGameGoing", false, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Arsonist]);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace TOHE.Roles.Neutral
|
||||
private static OptionItem ExplosionRadius;
|
||||
|
||||
public static readonly Dictionary<byte, long> EncasedPlayers = [];
|
||||
private static readonly Dictionary<byte, long> LastUpdates = [];
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
@@ -54,6 +55,7 @@ namespace TOHE.Roles.Neutral
|
||||
{
|
||||
BubbleId = byte.MaxValue;
|
||||
EncasedPlayers.Clear();
|
||||
LastUpdates.Clear();
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
@@ -142,7 +144,11 @@ namespace TOHE.Roles.Neutral
|
||||
|
||||
if (ts + NotifyDelay.GetInt() < now)
|
||||
{
|
||||
Main.AllAlivePlayerControls.Where(x => Vector2.Distance(x.Pos(), encasedPc.Pos()) < 5f).Do(x => NotifyRoles(SpecifySeer: x, SpecifyTarget: encasedPc));
|
||||
Main.AllAlivePlayerControls.Where(x => (!LastUpdates.TryGetValue(x.PlayerId, out var la) || la != now) && Vector2.Distance(x.Pos(), encasedPc.Pos()) < 5f).Do(x =>
|
||||
{
|
||||
NotifyRoles(SpecifySeer: x, SpecifyTarget: encasedPc);
|
||||
LastUpdates[x.PlayerId] = now;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,6 @@ public class Doppelganger : RoleBase
|
||||
|
||||
void RpcChangeSkin(PlayerControl pc, GameData.PlayerOutfit newOutfit)
|
||||
{
|
||||
if (!IsEnable) return;
|
||||
var sender = CustomRpcSender.Create(name: $"Doppelganger.RpcChangeSkin({pc.Data.PlayerName})");
|
||||
//if (pc.PlayerId == PlayerControl.LocalPlayer.PlayerId) Main.nickName = newOutfit.PlayerName;
|
||||
pc.SetName(newOutfit.PlayerName);
|
||||
|
||||
@@ -7,6 +7,13 @@ namespace TOHE.Roles.Neutral
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(10800, TabGroup.NeutralRoles, CustomRoles.Innocent);
|
||||
Options.InnocentCanWinByImp = BooleanOptionItem.Create(10810, "InnocentCanWinByImp", false, TabGroup.NeutralRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Innocent]);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using AmongUs.GameOptions;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Neutral
|
||||
{
|
||||
@@ -7,6 +8,20 @@ namespace TOHE.Roles.Neutral
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(10900, TabGroup.NeutralRoles, CustomRoles.Jester);
|
||||
JesterCanUseButton = BooleanOptionItem.Create(10910, "JesterCanUseButton", false, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Jester]);
|
||||
JesterCanVent = BooleanOptionItem.Create(10911, "CanVent", false, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Jester]);
|
||||
JesterHasImpostorVision = BooleanOptionItem.Create(10913, "ImpostorVision", false, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Jester]);
|
||||
SunnyboyChance = IntegerOptionItem.Create(10912, "SunnyboyChance", new(0, 100, 5), 0, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Jester])
|
||||
.SetValueFormat(OptionFormat.Percent);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using AmongUs.GameOptions;
|
||||
using UnityEngine;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Neutral
|
||||
{
|
||||
@@ -9,6 +10,17 @@ namespace TOHE.Roles.Neutral
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(18300, TabGroup.OtherRoles, CustomRoles.Mario);
|
||||
MarioVentNumWin = IntegerOptionItem.Create(18310, "MarioVentNumWin", new(0, 900, 5), 40, TabGroup.OtherRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Mario])
|
||||
.SetValueFormat(OptionFormat.Times);
|
||||
MarioVentCD = FloatOptionItem.Create(18311, "VentCooldown", new(0f, 180f, 1f), 15f, TabGroup.OtherRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Mario])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -19,5 +19,13 @@
|
||||
{
|
||||
return !Options.OppoImmuneToAttacksWhenTasksDone.GetBool() || !target.Is(CustomRoles.Opportunist) || !target.AllTasksCompleted();
|
||||
}
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
Options.SetupRoleOptions(10100, TabGroup.NeutralRoles, CustomRoles.Opportunist);
|
||||
Options.OppoImmuneToAttacksWhenTasksDone = BooleanOptionItem.Create(10110, "ImmuneToAttacksWhenTasksDone", false, TabGroup.NeutralRoles, false)
|
||||
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Opportunist]);
|
||||
Options.OpportunistTasks = Options.OverrideTasksData.Create(10111, TabGroup.NeutralRoles, CustomRoles.Opportunist);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ namespace TOHE.Roles.Neutral
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption() => Options.SetupRoleOptions(18500, TabGroup.NeutralRoles, CustomRoles.Provocateur);
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using AmongUs.GameOptions;
|
||||
using TOHE.Modules;
|
||||
using UnityEngine;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Neutral
|
||||
{
|
||||
@@ -10,6 +11,26 @@ namespace TOHE.Roles.Neutral
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(18400, TabGroup.NeutralRoles, CustomRoles.Revolutionist);
|
||||
RevolutionistDrawTime = FloatOptionItem.Create(18410, "RevolutionistDrawTime", new(0f, 90f, 1f), 3f, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Revolutionist])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
RevolutionistCooldown = FloatOptionItem.Create(18411, "RevolutionistCooldown", new(0f, 100f, 1f), 10f, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Revolutionist])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
RevolutionistDrawCount = IntegerOptionItem.Create(18412, "RevolutionistDrawCount", new(0, 14, 1), 6, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Revolutionist])
|
||||
.SetValueFormat(OptionFormat.Players);
|
||||
RevolutionistKillProbability = IntegerOptionItem.Create(18413, "RevolutionistKillProbability", new(0, 100, 5), 15, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Revolutionist])
|
||||
.SetValueFormat(OptionFormat.Percent);
|
||||
RevolutionistVentCountDown = FloatOptionItem.Create(18414, "RevolutionistVentCountDown", new(0f, 180f, 1f), 15f, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Revolutionist])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Linq;
|
||||
using AmongUs.GameOptions;
|
||||
using TOHE.Modules;
|
||||
using static TOHE.Options;
|
||||
|
||||
namespace TOHE.Roles.Neutral
|
||||
{
|
||||
@@ -9,6 +10,23 @@ namespace TOHE.Roles.Neutral
|
||||
public static bool On;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupRoleOptions(11700, TabGroup.NeutralRoles, CustomRoles.Workaholic); //TOH_Y
|
||||
WorkaholicCannotWinAtDeath = BooleanOptionItem.Create(11710, "WorkaholicCannotWinAtDeath", true, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Workaholic]);
|
||||
WorkaholicVentCooldown = FloatOptionItem.Create(11711, "VentCooldown", new(0f, 180f, 2.5f), 30f, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Workaholic])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
WorkaholicVisibleToEveryone = BooleanOptionItem.Create(11712, "WorkaholicVisibleToEveryone", false, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Workaholic]);
|
||||
WorkaholicGiveAdviceAlive = BooleanOptionItem.Create(11713, "WorkaholicGiveAdviceAlive", false, TabGroup.NeutralRoles, false)
|
||||
.SetParent(WorkaholicVisibleToEveryone);
|
||||
WorkaholicTasks = OverrideTasksData.Create(11714, TabGroup.NeutralRoles, CustomRoles.Workaholic);
|
||||
WorkaholicCanGuess = BooleanOptionItem.Create(11725, "CanGuess", true, TabGroup.NeutralRoles, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Workaholic]);
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
On = true;
|
||||
|
||||
+10
-2
@@ -1,10 +1,18 @@
|
||||
using System.Text;
|
||||
using System;
|
||||
using System.Text;
|
||||
using AmongUs.GameOptions;
|
||||
|
||||
namespace TOHE
|
||||
{
|
||||
public abstract class RoleBase
|
||||
public abstract class RoleBase : IComparable<RoleBase>
|
||||
{
|
||||
public int CompareTo(RoleBase other)
|
||||
{
|
||||
var thisName = GetType().Name;
|
||||
var otherName = other.GetType().Name;
|
||||
return string.Compare(thisName, otherName, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
// This is a base class for all roles. It contains some common methods and properties that are used by all roles.
|
||||
public abstract void Init();
|
||||
public abstract void Add(byte playerId);
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
<Description>TOHE+</Description>
|
||||
<Authors>Gurge44</Authors>
|
||||
<langVersion>preview</langVersion>
|
||||
<AmongUs>D:\Epic Games\AmongUs</AmongUs>
|
||||
<AmongUs>E:\Program Files\AmongUs</AmongUs>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Optimize>True</Optimize>
|
||||
<AssemblyName>$(MSBuildProjectName)+</AssemblyName>
|
||||
|
||||
Reference in new issue
Block a user