Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Xmas update #2339

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Exiled.API/Features/DamageHandlers/AttackerDamageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace Exiled.API.Features.DamageHandlers
{
using CustomPlayerEffects;
using PlayerRoles;

using BaseHandler = PlayerStatsSystem.DamageHandlerBase;

Expand Down Expand Up @@ -99,7 +100,7 @@ public override void ProcessDamage(Player player)

if ((player != Attacker) && !ForceFullFriendlyFire)
{
if (HitboxIdentity.CheckFriendlyFire(AttackerFootprint.Role, player.Role, true))
if (HitboxIdentity.IsEnemy(AttackerFootprint.Role, player.Role))
return;

Damage *= PlayerStatsSystem.AttackerDamageHandler._ffMultiplier;
Expand Down
6 changes: 5 additions & 1 deletion Exiled.CustomItems/API/Features/CustomGrenade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ public virtual Pickup Throw(Vector3 position, float force, float weight, float f
NetworkServer.Spawn(thrownProjectile.gameObject);
thrownProjectile.InfoReceivedHook(default, newInfo);
if (thrownProjectile.TryGetComponent(out Rigidbody component))
throwable.Base.PropelBody(component, throwable.Base.FullThrowSettings.StartTorque, ThrowableNetworkHandler.GetLimitedVelocity(velocity), force, throwable.Base.FullThrowSettings.UpwardsFactor);
{
Vector3 vector = (throwable.Base.GetCameraVector(throwable.Base.FullThrowSettings.UpwardsFactor) * force) + ThrowableNetworkHandler.GetLimitedVelocity(velocity);
throwable.Base.PropelBody(component, throwable.Base.FullThrowSettings.StartTorque, vector);
}

thrownProjectile.ServerActivate();

return Pickup.Get(thrownProjectile);
Expand Down
2 changes: 1 addition & 1 deletion Exiled.Events/EventArgs/Map/ExplodingGrenadeEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public ExplodingGrenadeEventArgs(Footprint thrower, Vector3 position, ExplosionG
break;
case true:
{
if (Server.FriendlyFire || thrower.Hub == Server.Host.ReferenceHub || HitboxIdentity.CheckFriendlyFire(thrower.Role, hub.roleManager.CurrentRole.RoleTypeId))
if (Server.FriendlyFire || thrower.Hub == Server.Host.ReferenceHub || HitboxIdentity.IsEnemy(thrower.Role, hub.roleManager.CurrentRole.RoleTypeId))
{
if (!TargetsToAffect.Contains(player))
TargetsToAffect.Add(player);
Expand Down
10 changes: 5 additions & 5 deletions Exiled.Events/Patches/Generic/IndividualFriendlyFire.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static bool CheckFriendlyFirePlayerRules(Footprint attackerFootprint, Ref

// Return false, no custom friendly fire allowed, default to NW logic for FF. No point in processing if FF is enabled across the board.
if (Server.FriendlyFire)
return HitboxIdentity.CheckFriendlyFire(attackerFootprint.Role, victimHub.roleManager.CurrentRole.RoleTypeId);
return HitboxIdentity.IsEnemy(attackerFootprint.Role, victimHub.roleManager.CurrentRole.RoleTypeId);

// always allow damage from Server.Host
if (attackerFootprint.Hub == Server.Host.ReferenceHub)
Expand All @@ -98,7 +98,7 @@ public static bool CheckFriendlyFirePlayerRules(Footprint attackerFootprint, Ref
// Only check friendlyFire if the FootPrint hasn't changed (Fix for Grenade not dealing damage because it's from a dead player)
// TODO rework FriendlyFireRule to make it compatible with Footprint
if (!attackerFootprint.SameLife(new(attackerFootprint.Hub)))
return HitboxIdentity.CheckFriendlyFire(attackerFootprint.Role, victimHub.roleManager.CurrentRole.RoleTypeId);
return HitboxIdentity.IsEnemy(attackerFootprint.Role, victimHub.roleManager.CurrentRole.RoleTypeId);

if (attackerFootprint.Hub is null || victimHub is null)
{
Expand Down Expand Up @@ -170,14 +170,14 @@ public static bool CheckFriendlyFirePlayerRules(Footprint attackerFootprint, Ref
Log.Error($"CheckFriendlyFirePlayerRules failed to handle friendly fire because: {ex}");
}

return HitboxIdentity.CheckFriendlyFire(attackerFootprint.Role, victimHub.roleManager.CurrentRole.RoleTypeId);
return HitboxIdentity.IsEnemy(attackerFootprint.Role, victimHub.roleManager.CurrentRole.RoleTypeId);
}
}

/// <summary>
/// Patches <see cref="HitboxIdentity.CheckFriendlyFire(ReferenceHub, ReferenceHub, bool)"/>.
/// Patches <see cref="HitboxIdentity.IsEnemy(ReferenceHub, ReferenceHub)"/>.
/// </summary>
[HarmonyPatch(typeof(HitboxIdentity), nameof(HitboxIdentity.CheckFriendlyFire), typeof(ReferenceHub), typeof(ReferenceHub), typeof(bool))]
[HarmonyPatch(typeof(HitboxIdentity), nameof(HitboxIdentity.IsEnemy), typeof(ReferenceHub), typeof(ReferenceHub))]
internal static class HitboxIdentityCheckFriendlyFire
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
Expand Down
2 changes: 1 addition & 1 deletion Exiled.Loader/AutoUpdateFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public static class AutoUpdateFiles
/// <summary>
/// Gets which SCP: SL version generated Exiled.
/// </summary>
public static readonly Version RequiredSCPSLVersion = new(13, 3, 0, 1);
public static readonly Version RequiredSCPSLVersion = new(13, 4, 0, 0);
}
}
20 changes: 20 additions & 0 deletions docs/docs/Resources/Intro.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@













---
sidebar_position: 1
---
Expand Down Expand Up @@ -62,6 +75,9 @@ sidebar_position: 1
| 21 | Overwatch | Dead | None | Draw |
| 22 | Filmmaker | Dead | None | Draw |
| 23 | Scp3114 | SCPs | Scp | Anomalies |
| 24 | Flamingo | Dead | None | Draw |
| 25 | AlphaFlamingo | Dead | None | Draw |
| 26 | ZombieFlamingo | Dead | None | Draw |
```

</details>
Expand Down Expand Up @@ -127,6 +143,10 @@ sidebar_position: 1
[52] GunFRMG0
[53] GunA7
[54] Lantern
[55] Snowball
[56] Coal
[57] SpecialCoal
[58] Tape
```

</details>
Expand Down
Loading