Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
- Added
GlassBuild
DoorBuild
- Update ReadMe
- More configurable Door and Window
  • Loading branch information
louis1706 committed Aug 17, 2022
1 parent af2ccfe commit d2a7a03
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 74 deletions.
16 changes: 0 additions & 16 deletions AhpProccessBuild.cs

This file was deleted.

74 changes: 44 additions & 30 deletions Config.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
using Exiled.API.Enums;
using Exiled.API.Interfaces;
using Interactables.Interobjects.DoorUtils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using KeycardPermissions = Interactables.Interobjects.DoorUtils.KeycardPermissions;

namespace FacilityManagement
{
Expand All @@ -28,32 +25,12 @@ public class Config : IConfig
[Description("Time for generator to be Activated after being enable (-1 disable the config)")]
public float GeneratorDuration { get; set; } = -1;

[Description("Sets the health of breakable windows.")]
public Dictionary<GlassType, float> WindowHealth { get; set; } = new()
{
{GlassType.Scp079Trigger, 100},
};


[Description("Sets the health of breakable Door (-1 will make it Undestructible).")]
public Dictionary<DoorType, float> DoorHealth { get; set; } = new()
{
{DoorType.PrisonDoor, 1},
};


[Description("Sets the ignored damage of breakable Door (0 will make it Destructible for everything and 17 undestructible).")]
public Dictionary<DoorType, DoorDamageType> DoorDamageTypeIgnored { get; set; } = new()
{
{DoorType.HID, DoorDamageType.Weapon | DoorDamageType.Grenade},
};

[Description("Sets the time for Lift to teleport")]
public Dictionary<ElevatorType, float> LiftMoveDuration { get; set; } = new();

[Description(@"Custom intercom content. If there's no specific content, then the default client content is used.
# Check GitHub ReadMe for more info (https://github.com/louis1706/FacilityManagement/blob/main/readme.md)")]
public Dictionary<Intercom.State, string> CustomText { get; set; } = new()
public Dictionary<Intercom.State, string> CustomText { get; set; } = new()
{
{Intercom.State.Muted, "Issou you are muted"},
};
Expand All @@ -63,7 +40,7 @@ public class Config : IConfig

[Description("How many sacrifices it takes to lure 106. Values below 1 set the recontainer to always active.")]
public int Scp106LureAmount { get; set; } = 1;

[Description("Probability of succes for sacrifice work before enough player was enter in the recontainer")]
public float Scp106ChanceOfSuccess { get; set; } = 100;

Expand All @@ -78,15 +55,52 @@ public class Config : IConfig
Team.RSC,
Team.CDP,
};
public Dictionary<RoleType, AhpProccessBuild> RoleTypeHumeShield { get; set; } = new()

[Description("Sets the health of breakable windows.")]
public Dictionary<GlassType, GlassBuild> CustomWindows { get; set; } = new()
{
{
GlassType.Scp079Trigger,
new GlassBuild{
Health = 100,
DisableScpDamage = false,
}
},
};

[Description("Sets the ignored damage of breakable Door (0 will make it Destructible for everything and 17 undestructible).")]
public Dictionary<DoorType, DoorBuild> CustomDoors { get; set; } = new()
{
{ RoleType.Scp049,
new AhpProccessBuild{
{
DoorType.CheckpointEntrance,
new DoorBuild{
Health = 30,
RequiredPermission = KeycardPermissions.ContainmentLevelThree | KeycardPermissions.Checkpoints | KeycardPermissions.ScpOverride,
RequireAllPermission = false,
DamageTypeIgnored = DoorDamageType.Grenade,
}
},
{
DoorType.GR18Inner,
new DoorBuild{
Health = 120,
RequiredPermission = null,
RequireAllPermission = null,
DamageTypeIgnored = null,
}
},
};

public Dictionary<RoleType, ConfigBuild> RoleTypeHumeShield { get; set; } = new()
{
{
RoleType.Scp049,
new ConfigBuild{
Amount = 60,
Regen = 1.5f,
Efficacy = 1,
Sustain = 5,
}
}
},
};

Expand Down
32 changes: 32 additions & 0 deletions ConfigBuild.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Interactables.Interobjects.DoorUtils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FacilityManagement
{
public class ConfigBuild
{
public float Amount { get; set; }
public float Regen { get; set; }
public float Efficacy { get; set; }
public float Sustain { get; set; }
}

public class DoorBuild
{
public float? Health { get; set; }
public KeycardPermissions? RequiredPermission { get; set; }
public bool? RequireAllPermission { get; set; }
public DoorDamageType? DamageTypeIgnored { get; set; }
}

public class GlassBuild
{
public float? Health { get; set; }
public bool? DisableScpDamage { get; set; }
}

}
37 changes: 20 additions & 17 deletions EventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,34 @@ public class EventHandlers
public void HandleRoundStart()
{
LuresCount = 0;
if (plugin.Config.WindowHealth is not null)
if (plugin.Config.CustomWindows is not null)
{
foreach (Window window in Window.List)
{
if (plugin.Config.WindowHealth.TryGetValue(window.Type, out float WindowHealth))
window.Health = WindowHealth;
}
}
if (plugin.Config.DoorHealth is not null)
{
foreach (Door door in Door.List)
{
if (plugin.Config.DoorHealth.TryGetValue(door.Type, out float DoorHealth))
if (plugin.Config.CustomWindows.TryGetValue(window.Type, out GlassBuild glassBuild))
{
door.MaxHealth = DoorHealth;
door.Health = DoorHealth;
if (glassBuild.Health is not null)
window.Health = glassBuild.Health.Value;
if (glassBuild.DisableScpDamage is not null)
window.DisableScpDamage = glassBuild.DisableScpDamage.Value;
}
}
}
if (plugin.Config.DoorDamageTypeIgnored is not null)
if (plugin.Config.CustomDoors is not null)
{
foreach (Door door in Door.List)
{
if (plugin.Config.DoorDamageTypeIgnored.TryGetValue(door.Type, out DoorDamageType doorDamageType))
door.IgnoredDamageTypes = doorDamageType;
if (plugin.Config.CustomDoors.TryGetValue(door.Type,out DoorBuild doorBuild))
{
if (doorBuild.Health is not null)
door.Health = doorBuild.Health.Value;
if (doorBuild.DamageTypeIgnored is not null)
door.IgnoredDamageTypes = doorBuild.DamageTypeIgnored.Value;
if (doorBuild.RequiredPermission is not null)
door.RequiredPermissions.RequiredPermissions = doorBuild.RequiredPermission.Value;
if (doorBuild.RequireAllPermission is not null)
door.RequiredPermissions.RequireAll = doorBuild.RequireAllPermission.Value;
}
}
}
if (plugin.Config.LiftMoveDuration is not null)
Expand Down Expand Up @@ -85,7 +88,7 @@ public void HandleEnergyRadio(UsingRadioBatteryEventArgs ev)

public void OnSpawning(SpawningEventArgs ev)
{
if (plugin.Config.RoleTypeHumeShield is not null && plugin.Config.RoleTypeHumeShield.TryGetValue(ev.Player.Role.Type, out AhpProccessBuild ahpProccessBuild))
if (plugin.Config.RoleTypeHumeShield is not null && plugin.Config.RoleTypeHumeShield.TryGetValue(ev.Player.Role.Type, out ConfigBuild ahpProccessBuild))
{
ev.Player.ActiveArtificialHealthProcesses.ToList().RemoveAll(x => true);
ev.Player.AddAhp(ahpProccessBuild.Amount, ahpProccessBuild.Amount, -ahpProccessBuild.Regen, ahpProccessBuild.Efficacy, ahpProccessBuild.Sustain, ahpProccessBuild.Regen > 0);
Expand All @@ -94,7 +97,7 @@ public void OnSpawning(SpawningEventArgs ev)

public void OnHurting(HurtingEventArgs ev)
{
if (plugin.Config.RoleTypeHumeShield is not null && plugin.Config.RoleTypeHumeShield.TryGetValue(ev.Target.Role.Type, out AhpProccessBuild ahpProccessBuild))
if (plugin.Config.RoleTypeHumeShield is not null && plugin.Config.RoleTypeHumeShield.TryGetValue(ev.Target.Role.Type, out ConfigBuild ahpProccessBuild))
ev.Target.ActiveArtificialHealthProcesses.First().SustainTime = ahpProccessBuild.Sustain;
}

Expand Down
2 changes: 1 addition & 1 deletion FacilityManagement.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AhpProccessBuild.cs" />
<Compile Include="ConfigBuild.cs" />
<Compile Include="Config.cs" />
<Compile Include="EventHandlers.cs" />
<Compile Include="Patches\CommandIntercomTextFix.cs" />
Expand Down
32 changes: 22 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@


# FacilityManagement

This plugin make possible many things on your server.

## Configs
| Name | TypeValue | Description |
| :-------------: | :---------: | :--------- |
| IsEnabled | Bool | Is plugin Enable. |
| IsEnabled | Bool | Is plugin Enable |
| InfiniteAmmo | List<ItemType> | Item who having InfiniteAmmo |
| EnergyMicroHid | float | Multiplier conssumption of MicroHID (0 = No energy drain \ 2 = Double energy drain) |
| EnergyRadio | float | Multiplier conssumption of EnergyRadio (Same than above) |
| GeneratorDuration | float | Time for generator to be Activated after being enable (-1 disable the config) |
| WindowHealth | Dictionary<GlassType, float> | Change the health of Glass |
| DoorHealth | Dictionary<DoorType, float> | Change the health of Door (Work only for BreakableDoor) |
| DoorDamageTypeIgnored | Dictionary<DoorType, DoorDamageType> | Change the DamageType ignored by the door (0 = Ignored no damage / 17 = not destructible) |
| LiftMoveDuration | Dictionary<ElevatorType, float> | Change the times of Elevator to teleport |
| CustomText | Dictionary<Intercom.State, string> | Change the intercomText with specified there specified State |
| WarheadCleanup | bool | Remove all Pickup and Ragdoll in the facility (lower than y 500) |
| Scp106LureAmount | int | How many sacrifices it takes to lure 106. Values below 1 set the recontainer to always active |
| Scp106ChanceOfSuccess | float | Probability of succes for sacrifice work before enough player was enter in the recontainer |
| Scp106LureReload | int | Amount of time before another sacrifice can be made |
| Scp106LureTeam | List<Team> | Teams that can enter the femur breaker |
| RoleTypeHumeShield | Dictionary<RoleType, AhpProccessBuild> | sacrifice work before enough player was enter in the recontainer |
| CustomWindows | Dictionary<DoorType, GlassBuild> | Modify all the property of Window like you want (null make no change) |
| CustomDoors | Dictionary<DoorType, DoorBuild> | Modify all the property of Door like you want (null make no change) |
| RoleTypeHumeShield | Dictionary<RoleType, AhpProccessBuild> | Create a custoom AHP/HS for specified RoleType |

## GlassType

| PropertyName | TypeValue | Description |
| :-------------: | :---------: | :--------- |
| Health | float? | Health of the window (Null disable the change) |
| DisableScpDamage | bool? | Disable the damage of Scp (Null disable the change) |

## DoorBuild

| PropertyName | TypeValue | Description |
| :-------------: | :---------: | :--------- |
| Health | float? | Health of the door (Null disable the change) |
| RequiredPermission | KeycardPermissions? | Change the RequiredPermission for interact with the Door (Null disable the change) |
| RequireAllPermission | bool? | Required all the permission of RequiredPermission (Null disable the change) |
| DamageTypeIgnored | DoorDamageType? | Modified the DamageType ignored by the Door (Null disable the change) |

## AhpProccessBuild

Expand All @@ -37,8 +50,8 @@ This plugin make possible many things on your server.

This plugin make possible to customise the IntercomText on your server it's will be actualise every tick

This plugin use [CommandInterpolation](https://en.scpslgame.com/index.php?title=Command_Interpolation
) it's permit you to make custom text who can change with with what is happening on the server
This plugin use [CommandInterpolation](https://en.scpslgame.com/index.php?title=Command_Interpolation)
it's permit you to make custom text who can change with with what is happening on the server

whe have add just some CommandInterpolation for Intercom

Expand All @@ -57,4 +70,3 @@ whe have add just some CommandInterpolation for Intercom
## Authors

- [@Yamato](https://github.com/louis1706) // Yamato#8987

0 comments on commit d2a7a03

Please sign in to comment.