Skip to content

Commit

Permalink
funni 11.1 updoot
Browse files Browse the repository at this point in the history
  • Loading branch information
joker-119 committed Dec 1, 2021
1 parent 1680000 commit 27dd919
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 42 deletions.
2 changes: 1 addition & 1 deletion CustomItems/Components/Rock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public override void ProcessCollision(Collision collision)

if (Player.Get(collision.collider.GetComponentInParent<ReferenceHub>()) is Player target && (target.Side != Side || FriendlyFire))
{
target.Hurt(ThrownDamage, DamageTypes.Wall, "ROCK");
target.Hurt("Rock", ThrownDamage);
Player.Get(Owner).ShowHitMarker(1f);
}

Expand Down
34 changes: 17 additions & 17 deletions CustomItems/CustomItems.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,40 +53,40 @@
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>$(EXILED_REFERENCES)\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.API, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.3.6.0-beta\lib\net472\Exiled.API.dll</HintPath>
<Reference Include="Exiled.API, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.4.0.0-rc.1\lib\net472\Exiled.API.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Exiled.Bootstrap, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.3.6.0-beta\lib\net472\Exiled.Bootstrap.dll</HintPath>
<Reference Include="Exiled.Bootstrap, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.4.0.0-rc.1\lib\net472\Exiled.Bootstrap.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Exiled.CreditTags, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.3.6.0-beta\lib\net472\Exiled.CreditTags.dll</HintPath>
<Reference Include="Exiled.CreditTags, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.4.0.0-rc.1\lib\net472\Exiled.CreditTags.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Exiled.CustomItems, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.3.6.0-beta\lib\net472\Exiled.CustomItems.dll</HintPath>
<Reference Include="Exiled.CustomItems, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.4.0.0-rc.1\lib\net472\Exiled.CustomItems.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Exiled.CustomRoles, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.3.6.0-beta\lib\net472\Exiled.CustomRoles.dll</HintPath>
<Reference Include="Exiled.CustomRoles, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.4.0.0-rc.1\lib\net472\Exiled.CustomRoles.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Exiled.Events, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.3.6.0-beta\lib\net472\Exiled.Events.dll</HintPath>
<Reference Include="Exiled.Events, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.4.0.0-rc.1\lib\net472\Exiled.Events.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Exiled.Loader, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.3.6.0-beta\lib\net472\Exiled.Loader.dll</HintPath>
<Reference Include="Exiled.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.4.0.0-rc.1\lib\net472\Exiled.Loader.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Exiled.Permissions, Version=3.6.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.3.6.0-beta\lib\net472\Exiled.Permissions.dll</HintPath>
<Reference Include="Exiled.Permissions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.4.0.0-rc.1\lib\net472\Exiled.Permissions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Exiled.Updater, Version=3.1.1.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\EXILED.3.6.0-beta\lib\net472\Exiled.Updater.dll</HintPath>
<HintPath>..\packages\EXILED.4.0.0-rc.1\lib\net472\Exiled.Updater.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
Expand Down
5 changes: 4 additions & 1 deletion CustomItems/Items/AutoGun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ namespace CustomItems.Items
{
using System.Collections.Generic;
using System.ComponentModel;
using Exiled.API.Enums;
using Exiled.API.Extensions;
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.API.Features.Spawn;
using Exiled.CustomItems.API;
using Exiled.CustomItems.API.Features;
using Exiled.Events.EventArgs;
using PlayerStatsSystem;
using UnityEngine;

/// <inheritdoc />
Expand Down Expand Up @@ -93,7 +96,7 @@ protected override void OnShooting(ShootingEventArgs ev)
continue;

ammoUsed++;
player.Hurt(Damage, DamageTypes.Com15, ev.Shooter.Nickname, ev.Shooter.Id);
player.Hurt(new FirearmDamageHandler(firearm.Base, Damage, player.Role.GetSide() != Side.Scp));
if (player.IsDead)
player.ShowHint("<color=#FF0000>YOU HAVE BEEN KILLED BY AUTO AIM GUN</color>");
ev.Shooter.ShowHitMarker(1f);
Expand Down
7 changes: 5 additions & 2 deletions CustomItems/Items/DeflectorShield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ namespace CustomItems.Items
using Exiled.CustomItems.API.EventArgs;
using Exiled.CustomItems.API.Features;
using Exiled.Events.EventArgs;
using InventorySystem.Items.Firearms;
using MEC;
using PlayerStatsSystem;
using YamlDotNet.Serialization;
using Firearm = Exiled.API.Features.Items.Firearm;

/// <inheritdoc />
public class DeflectorShield : CustomItem
Expand Down Expand Up @@ -143,10 +146,10 @@ private void OnItemUsed(UsedItemEventArgs ev)

private void OnHurt(HurtingEventArgs ev)
{
if (deflectorPlayers.Contains(ev.Target) && ((ItemType)ev.DamageType.Weapon).IsWeapon() && ev.Target != ev.Attacker && !ev.DamageType.Equals(DamageTypes.MicroHID))
if (deflectorPlayers.Contains(ev.Target) && (ev.DamageHandler is FirearmDamageHandler && ev.Target != ev.Attacker))
{
ev.IsAllowed = false;
ev.Attacker.Hurt(ev.Amount * Multiplier, ev.Target, ev.DamageType);
ev.Attacker.Hurt(new FirearmDamageHandler(((Firearm)ev.Attacker.CurrentItem).Base, ev.Amount * Multiplier, ev.Attacker.Side != Side.Scp));
}
}
}
Expand Down
14 changes: 5 additions & 9 deletions CustomItems/Items/ImplosionGrenade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,12 @@ protected override void OnExploding(ExplodingGrenadeEventArgs ev)
layerMask = explosionGrenade._detectionMask;
}

foreach (Transform grenadePoint in player.ReferenceHub.playerStats.grenadePoints)
bool line = Physics.Linecast(ev.Grenade.transform.position, player.Position, layerMask);
Log.Debug($"{player.Nickname} - {line}", CustomItems.Instance.Config.IsDebugEnabled);
if (!line)
{
bool line = Physics.Linecast(ev.Grenade.transform.position, grenadePoint.position, layerMask);
Log.Debug($"{player.Nickname} - {line}", CustomItems.Instance.Config.IsDebugEnabled);
if (!line)
{
effectedPlayers.Add(player);
Coroutines.Add(Timing.RunCoroutine(DoSuction(player, ev.Grenade.transform.position + (Vector3.up * 1.5f))));
break;
}
effectedPlayers.Add(player);
Coroutines.Add(Timing.RunCoroutine(DoSuction(player, ev.Grenade.transform.position + (Vector3.up * 1.5f))));
}
}
catch (Exception exception)
Expand Down
5 changes: 3 additions & 2 deletions CustomItems/Items/LethalInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace CustomItems.Items
using Exiled.Events.EventArgs;
using MEC;
using PlayableScps;
using PlayerStatsSystem;
using Player = Exiled.Events.Handlers.Player;
using Scp096 = PlayableScps.Scp096;

Expand Down Expand Up @@ -96,7 +97,7 @@ private void OnUsingItem(UsedItemEventArgs ev)

Log.Debug($"{player.Nickname} 096 checks passed.", CustomItems.Instance.Config.IsDebugEnabled);
scp096.EndEnrage();
ev.Player.Kill(DamageTypes.Poison);
ev.Player.Hurt(new UniversalDamageHandler(-1f, DeathTranslations.Poisoned));
return;
}

Expand All @@ -111,7 +112,7 @@ private void OnUsingItem(UsedItemEventArgs ev)
}

Log.Debug($"{Name} kill on fail: {ev.Player.Nickname}", CustomItems.Instance.Config.IsDebugEnabled);
ev.Player.Kill(DamageTypes.Poison);
ev.Player.Hurt(new UniversalDamageHandler(-1f, DeathTranslations.Poisoned));
});

ev.Player.RemoveItem(ev.Player.CurrentItem);
Expand Down
3 changes: 2 additions & 1 deletion CustomItems/Items/MediGun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace CustomItems.Items
using Exiled.CustomItems.API;
using Exiled.CustomItems.API.Features;
using Exiled.Events.EventArgs;
using PlayerStatsSystem;
using UnityEngine;
using Firearm = Exiled.API.Features.Items.Firearm;

Expand Down Expand Up @@ -122,7 +123,7 @@ protected override void OnWaitingForPlayers()
/// <inheritdoc/>
protected override void OnHurting(HurtingEventArgs ev)
{
if (Check(ev.Attacker.CurrentItem) && ev.Attacker != ev.Target && ev.Attacker.CurrentItem is Firearm firearm && ev.DamageType.Equals(firearm.DamageType))
if (Check(ev.Attacker.CurrentItem) && ev.Attacker != ev.Target && ev.DamageHandler is FirearmDamageHandler firearmHandler && firearmHandler.WeaponType == ev.Attacker.CurrentItem.Type)
ev.Amount = 0f;
}

Expand Down
5 changes: 3 additions & 2 deletions CustomItems/Items/Scp1499.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace CustomItems.Items
using Exiled.CustomItems.API.Features;
using Exiled.Events.EventArgs;
using MEC;
using PlayerStatsSystem;
using UnityEngine;

/// <inheritdoc />
Expand Down Expand Up @@ -162,7 +163,7 @@ private void SendPlayerBack(Player player)
}

if (shouldKill)
player.Kill(DamageTypes.Nuke);
player.Hurt(new WarheadDamageHandler());
}
else if (Map.IsLczDecontaminated)
{
Expand All @@ -183,7 +184,7 @@ private void SendPlayerBack(Player player)
}

if (shouldKill)
player.Kill(DamageTypes.Decont);
player.Hurt(new UniversalDamageHandler(-1f, DeathTranslations.Decontamination));
}

scp1499Players.Remove(player);
Expand Down
7 changes: 4 additions & 3 deletions CustomItems/Items/Scp2818.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace CustomItems.Items
using Exiled.CustomItems.API.Features;
using Exiled.Events.EventArgs;
using MEC;
using PlayerStatsSystem;
using UnityEngine;
using YamlDotNet.Serialization;

Expand Down Expand Up @@ -103,7 +104,7 @@ protected override void OnShooting(ShootingEventArgs ev)
Player target = Player.Get(ev.TargetNetId);
if (ev.ShotPosition == Vector3.zero || (ev.Shooter.Position - ev.ShotPosition).sqrMagnitude > 1000f)
{
ev.Shooter.Kill(DamageTypes.Nuke);
ev.Shooter.Hurt(new UniversalDamageHandler(-1f, DeathTranslations.Warhead));
ev.IsAllowed = false;
return;
}
Expand Down Expand Up @@ -161,9 +162,9 @@ private IEnumerator<float> ShooterProjectile(Player player, Vector3 targetPos, P
}

if (player.Role != RoleType.Spectator)
player.Kill(DamageTypes.Nuke);
player.Hurt(new UniversalDamageHandler(-1f, DeathTranslations.Warhead));
if (target?.Role != RoleType.Spectator)
target?.Hurt(Damage, DamageTypes.Nuke, player.Nickname, player.Id);
target?.Hurt(new UniversalDamageHandler(Damage, DeathTranslations.Warhead));
}
}
}
3 changes: 2 additions & 1 deletion CustomItems/Items/SniperRifle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace CustomItems.Items
using Exiled.CustomItems.API;
using Exiled.CustomItems.API.Features;
using Exiled.Events.EventArgs;
using PlayerStatsSystem;
using YamlDotNet.Serialization;

/// <inheritdoc />
Expand Down Expand Up @@ -72,7 +73,7 @@ public class SniperRifle : CustomWeapon
/// <inheritdoc/>
protected override void OnHurting(HurtingEventArgs ev)
{
if (ev.Attacker != ev.Target && ev.Attacker.CurrentItem is Firearm firearm && ev.DamageType.Equals(firearm.DamageType))
if (ev.Attacker != ev.Target && ev.DamageHandler is FirearmDamageHandler firearmDamageHandler && firearmDamageHandler.WeaponType == ev.Attacker.CurrentItem.Type)
ev.Amount *= DamageMultiplier;
}
}
Expand Down
6 changes: 4 additions & 2 deletions CustomItems/Items/TranquilizerGun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ namespace CustomItems.Items
using Exiled.Events.EventArgs;
using MEC;
using Mirror;
using PlayerStatsSystem;
using UnityEngine;
using Ragdoll = Exiled.API.Features.Ragdoll;
using Random = UnityEngine.Random;

/// <inheritdoc />
Expand Down Expand Up @@ -197,7 +199,7 @@ private IEnumerator<float> DoTranquilize(Player player, float duration)
Log.Error($"{nameof(DoTranquilize)}: {e}");
}

Ragdoll ragdoll = Ragdoll.Spawn(player, DamageTypes.None, oldPosition, default, default, false, false);
Ragdoll ragdoll = new Ragdoll(player, new UniversalDamageHandler(0f, DeathTranslations.Warhead), true);

player.IsInvisible = true;
player.Scale = Vector3.one * 0.2f;
Expand Down Expand Up @@ -241,7 +243,7 @@ private IEnumerator<float> DoTranquilize(Player player, float duration)

if (Warhead.IsDetonated && player.Position.y < 900)
{
player.Kill(DamageTypes.Nuke);
player.Hurt(new UniversalDamageHandler(-1f, DeathTranslations.Warhead));
yield break;
}

Expand Down
2 changes: 1 addition & 1 deletion CustomItems/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EXILED" version="3.6.0-beta" targetFramework="net472" />
<package id="EXILED" version="4.0.0-rc.1" targetFramework="net472" />
<package id="Lib.Harmony" version="2.0.4" targetFramework="net472" />
<package id="StyleCop.Analyzers" version="1.1.118" targetFramework="net472" developmentDependency="true" />
</packages>

0 comments on commit 27dd919

Please sign in to comment.