mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
Add Absorber (Addon) (#575)
* Update CustomRoles.cs * Update en_US.jsonc * Add Absorber class implementing IAddon interface * Update CustomRoles.cs * Update Main.cs * Update PlayerControlPatch.cs * Update PlayerControlPatch.cs
This commit is contained in:
1 parent
60c83df155
commit
a51e6f29cf
6 files changed
+24
No files matched your search
@@ -503,6 +503,7 @@ public enum CustomRoles
|
||||
|
||||
// Sub-role after 500
|
||||
NotAssigned = 500,
|
||||
Absorber,
|
||||
Aide,
|
||||
Allergic,
|
||||
Anchor,
|
||||
|
||||
@@ -503,6 +503,7 @@ public enum CustomRoles
|
||||
|
||||
// Sub-role after 500
|
||||
NotAssigned = 500,
|
||||
Absorber,
|
||||
Aide,
|
||||
Allergic,
|
||||
Anchor,
|
||||
|
||||
@@ -691,6 +691,7 @@ public class Main : BasePlugin
|
||||
{ CustomRoles.Aide, "#ff1919" },
|
||||
{ CustomRoles.Anchor, "#6B4CE4" },
|
||||
{ CustomRoles.Fragile, "#debe66" },
|
||||
{ CustomRoles.Absorber, "#29f5a0" },
|
||||
{ CustomRoles.Allergic, "#e3bd56" },
|
||||
{ CustomRoles.Introvert, "#6293e3" },
|
||||
{ CustomRoles.Deadlined, "#ffa500" },
|
||||
|
||||
@@ -1339,6 +1339,13 @@ internal static class ReportDeadBodyPatch
|
||||
|
||||
if (player.Is(CustomRoles.Looter))
|
||||
tpc.GetCustomSubRoles().FindAll(x => !player.Is(x) && !x.IsGhostRole() && !x.IsNotAssignableMidGame() && CustomRolesHelper.CheckAddonConflict(x, player)).ForEach(x => player.RpcSetCustomRole(x));
|
||||
|
||||
if (player.Is(CustomRoles.Absorber))
|
||||
{
|
||||
float give = target.PlayerId.GetAbilityUseLimit();
|
||||
if (give < 1f) player.RpcIncreaseAbilityUseLimitBy(give);
|
||||
else player.RpcIncreaseAbilityUseLimitBy(1f);
|
||||
}
|
||||
}
|
||||
|
||||
if (QuizMaster.On)
|
||||
|
||||
@@ -3461,6 +3461,9 @@
|
||||
/* ==============================
|
||||
Roles (Add-ons)
|
||||
============================== */
|
||||
"Absorber": "Absorber",
|
||||
"AbsorberInfo": "Report bodies to absorb Ability Uses",
|
||||
"AbsorberInfoLong": "(Add-ons):\\nAs the Absorber, you can take at most 1 ability use from dead players by reporting their body.",
|
||||
"Aide": "Aide",
|
||||
"AideInfo": "You Can't Sabotage",
|
||||
"AideInfoLong": "(Add-ons):\\nYou cannot sabotage.",
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace EHR.Roles;
|
||||
|
||||
public class Absorber : IAddon
|
||||
{
|
||||
public AddonTypes Type => AddonTypes.Helpful;
|
||||
|
||||
public void SetupCustomOption()
|
||||
{
|
||||
Options.SetupAdtRoleOptions(645670, CustomRoles.Absorber, canSetNum: true, teamSpawnOptions: true);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user