Skip to content

Commit

Permalink
updated readme, exiled package, added roledamagereceived multiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikihero committed Sep 30, 2024
1 parent 61ec80a commit 03b7120
Show file tree
Hide file tree
Showing 5 changed files with 264 additions and 225 deletions.
2 changes: 1 addition & 1 deletion Common Utilities/Common Utilities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="EXILEDOFFICIAL" Version="8.11.0" />
<PackageReference Include="EXILED-OFFICIAL" Version="8.12.2" />
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopVersion)" IncludeAssets="All" PrivateAssets="All" />
</ItemGroup>

Expand Down
16 changes: 12 additions & 4 deletions Common Utilities/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public class Config : IConfig
},
};

[Description("The list of custom 914 recipies. OriginalItem is the item being upgraded, NewItem is the item to upgrade to, and Chance is the percent chance of the upgrade happening. You can specify multiple upgrade choices for the same item.")]
[Description("The list of custom 914 recipies. OriginalItem is the item being upgraded, NewItem is the item to upgrade to, and Chance is the percent chance of the upgrade happening. You can specify multiple upgrade choices for the same item. For custom items use the item's name.")]
public Dictionary<Scp914KnobSetting, List<ItemUpgradeChance>> Scp914ItemChances { get; set; } = new()
{
{
Expand All @@ -153,7 +153,7 @@ public class Config : IConfig
},
};

[Description("The list of custom 914 recipies for roles. Original is the role to be changed, New is the new role to assign, Chance is the % chance of the upgrade occuring.")]
[Description("The list of custom 914 recipies for roles. Original is the role to be changed, New is the new role to assign, Chance is the % chance of the upgrade occuring. For custom roles use the role's name.")]
public Dictionary<Scp914KnobSetting, List<PlayerUpgradeChance>> Scp914ClassChanges { get; set; } = new()
{
{
Expand Down Expand Up @@ -228,8 +228,16 @@ public class Config : IConfig
[Description("If item cleanup should only happen in the Pocket Dimension or not.")]
public bool ItemCleanupOnlyPocket { get; set; } = false;

[Description("A list of all roles and their damage modifiers. The number here is a multiplier, not a raw damage amount. Thus, setting it to 1 = normal damage, 1.5 = 50% more damage, and 0.5 = 50% less damage.")]
public Dictionary<RoleTypeId, float> RoleDamageMultipliers { get; set; } = new()
[Description("A list of all roles and their damage dealt modifiers. The number here is a multiplier, not a raw damage amount. Thus, setting it to 1 = normal damage, 1.5 = 50% more damage, and 0.5 = 50% less damage.")]
public Dictionary<RoleTypeId, float> RoleDamageDealtMultipliers { get; set; } = new()
{
{
RoleTypeId.Scp173, 1.0f
},
};

[Description("List of roles and their damage received multipliers. 1 = normal damage, 1.5 = 50% more damage, 0.5 = 50% less damage.")]
public Dictionary<RoleTypeId, float> RoleDamageReceivedMultipliers { get; set; } = new()
{
{
RoleTypeId.Scp173, 1.0f
Expand Down
5 changes: 4 additions & 1 deletion Common Utilities/EventHandlers/PlayerHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ public void OnPlayerDied(DiedEventArgs ev)

public void OnPlayerHurting(HurtingEventArgs ev)
{
if (config.RoleDamageMultipliers != null && ev.Attacker != null && config.RoleDamageMultipliers.TryGetValue(ev.Attacker.Role, out var damageMultiplier))
if (config.RoleDamageDealtMultipliers != null && ev.Attacker != null && config.RoleDamageDealtMultipliers.TryGetValue(ev.Attacker.Role, out var damageMultiplier))
ev.Amount *= damageMultiplier;

if (config.RoleDamageReceivedMultipliers != null && config.RoleDamageReceivedMultipliers.TryGetValue(ev.Player.Role, out damageMultiplier))
ev.Amount *= damageMultiplier;

if (config.DamageMultipliers != null && config.DamageMultipliers.TryGetValue(ev.DamageHandler.Type, out damageMultiplier))
ev.Amount *= damageMultiplier;

Expand Down
Loading

0 comments on commit 03b7120

Please sign in to comment.