Skip to content

Commit

Permalink
Added AntiMemeticPills
Browse files Browse the repository at this point in the history
Changed LethalInjection so that it should correctly play the animation.
Updated README.md
  • Loading branch information
joker-119 committed Mar 2, 2021
1 parent 150f5b9 commit f444f57
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 78 deletions.
60 changes: 34 additions & 26 deletions CustomItems/Configs/Items.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,117 +23,125 @@ public class Items
/// Gets the list of emp greanades.
/// </summary>
[Description("The list of EMP grenades.")]
public List<EmpGrenade> EmpGrenades { get; private set; } = new List<EmpGrenade>()
public List<EmpGrenade> EmpGrenades { get; private set; } = new List<EmpGrenade>
{
new EmpGrenade() { Type = ItemType.GrenadeFlash },
new EmpGrenade { Type = ItemType.GrenadeFlash },
};

/// <summary>
/// Gets the list of grenade launchers.
/// </summary>
[Description("The list of grenade launchers.")]
public List<GrenadeLauncher> GrenadeLaunchers { get; private set; } = new List<GrenadeLauncher>()
public List<GrenadeLauncher> GrenadeLaunchers { get; private set; } = new List<GrenadeLauncher>
{
new GrenadeLauncher() { Type = ItemType.GunLogicer },
new GrenadeLauncher { Type = ItemType.GunLogicer },
};

/// <summary>
/// Gets the list of implosion grenades.
/// </summary>
[Description("The list of implosion grenades.")]
public List<ImplosionGrenade> ImplosionGrenades { get; private set; } = new List<ImplosionGrenade>()
public List<ImplosionGrenade> ImplosionGrenades { get; private set; } = new List<ImplosionGrenade>
{
new ImplosionGrenade() { Type = ItemType.GrenadeFrag },
new ImplosionGrenade { Type = ItemType.GrenadeFrag },
};

/// <summary>
/// Gets the list of lethal injections.
/// </summary>
[Description("The list of lethal injections.")]
public List<LethalInjection> LethalInjections { get; private set; } = new List<LethalInjection>()
public List<LethalInjection> LethalInjections { get; private set; } = new List<LethalInjection>
{
new LethalInjection() { Type = ItemType.Adrenaline },
new LethalInjection { Type = ItemType.Adrenaline },
};

/// <summary>
/// Gets the list of lucky coins.
/// </summary>
[Description("The list of lucky coins.")]
public List<LuckyCoin> LuckyCoins { get; private set; } = new List<LuckyCoin>()
public List<LuckyCoin> LuckyCoins { get; private set; } = new List<LuckyCoin>
{
new LuckyCoin() { Type = ItemType.Coin },
new LuckyCoin { Type = ItemType.Coin },
};

/// <summary>
/// Gets the list of mediGuns.
/// </summary>
[Description("The list of mediGuns.")]
public List<MediGun> MediGuns { get; private set; } = new List<MediGun>()
public List<MediGun> MediGuns { get; private set; } = new List<MediGun>
{
new MediGun() { Type = ItemType.GunProject90 },
new MediGun { Type = ItemType.GunProject90 },
};

/// <summary>
/// Gets the list of Rocks.
/// </summary>
[Description("The list of Rocks.")]
public List<Rock> Rocks { get; private set; } = new List<Rock>()
public List<Rock> Rocks { get; private set; } = new List<Rock>
{
new Rock() { Type = ItemType.SCP018 },
new Rock { Type = ItemType.SCP018 },
};

/// <summary>
/// Gets the list of Scp127s.
/// </summary>
[Description("The list of Scp127s.")]
public List<Scp127> Scp127s { get; private set; } = new List<Scp127>()
public List<Scp127> Scp127s { get; private set; } = new List<Scp127>
{
new Scp127() { Type = ItemType.GunCOM15 },
new Scp127 { Type = ItemType.GunCOM15 },
};

/// <summary>
/// Gets the list of Scp1499s.
/// </summary>
[Description("The list of Scp1499s.")]
public List<Scp1499> Scp1499s { get; private set; } = new List<Scp1499>()
public List<Scp1499> Scp1499s { get; private set; } = new List<Scp1499>
{
new Scp1499() { Type = ItemType.SCP268 },
new Scp1499 { Type = ItemType.SCP268 },
};

/// <summary>
/// Gets the list of shotguns.
/// </summary>
[Description("The list of shotguns.")]
public List<Shotgun> Shotguns { get; private set; } = new List<Shotgun>()
public List<Shotgun> Shotguns { get; private set; } = new List<Shotgun>
{
new Shotgun() { Type = ItemType.GunMP7 },
new Shotgun { Type = ItemType.GunMP7 },
};

/// <summary>
/// Gets the list of sniper rifles.
/// </summary>
[Description("The list of sniper rifles.")]
public List<SniperRifle> SniperRifle { get; private set; } = new List<SniperRifle>()
public List<SniperRifle> SniperRifle { get; private set; } = new List<SniperRifle>
{
new SniperRifle() { Type = ItemType.GunE11SR },
new SniperRifle { Type = ItemType.GunE11SR },
};

/// <summary>
/// Gets the list of tranquilizer guns.
/// </summary>
[Description("The list of tranquilizer guns.")]
public List<TranquilizerGun> TranquilizerGun { get; private set; } = new List<TranquilizerGun>()
public List<TranquilizerGun> TranquilizerGun { get; private set; } = new List<TranquilizerGun>
{
new TranquilizerGun() { Type = ItemType.GunUSP },
new TranquilizerGun { Type = ItemType.GunUSP },
};

/// <summary>
/// Gets the list of Scp714s.
/// </summary>
[Description("The list of Scp714s.")]
public List<Scp714> Scp714s { get; private set; } = new List<Scp714>()
public List<Scp714> Scp714s { get; private set; } = new List<Scp714>
{
new Scp714() { Type = ItemType.Coin },
new Scp714 { Type = ItemType.Coin },
};

/// <summary>
/// Gets the list of Anti-Memetic Pills.
/// </summary>
public List<AntiMemeticPills> AntiMemeticPills { get; private set; } = new List<AntiMemeticPills>
{
new AntiMemeticPills { Type = ItemType.SCP500 },
};
}
}
1 change: 1 addition & 0 deletions CustomItems/CustomItems.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
<Compile Include="Events\ServerHandler.cs" />
<Compile Include="Events\AddClassEvent.cs" />
<Compile Include="Events\AddClassEventArgs.cs" />
<Compile Include="Items\AntiMemeticPills.cs" />
<Compile Include="Items\EmpGrenade.cs" />
<Compile Include="Items\GrenadeLauncher.cs" />
<Compile Include="Items\LethalInjection.cs" />
Expand Down
75 changes: 75 additions & 0 deletions CustomItems/Items/AntiMemeticPills.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// -----------------------------------------------------------------------
// <copyright file="AntiMemeticPills.cs" company="Galaxy199 and iopietro">
// Copyright (c) Galaxy199 and iopietro. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace CustomItems.Items
{
using System.Collections.Generic;
using CustomPlayerEffects;
using Exiled.API.Features;
using Exiled.CustomItems.API;
using Exiled.CustomItems.API.Features;
using Exiled.CustomItems.API.Spawn;
using Exiled.Events.EventArgs;
using MEC;

/// <inheritdoc />
public class AntiMemeticPills : CustomItem
{
/// <inheritdoc/>
public override uint Id { get; set; } = 13;

/// <inheritdoc/>
public override string Name { get; set; } = "AM-119";

/// <inheritdoc/>
public override string Description { get; set; } =
"Drugs that make you forget things. If you use these while you are targeted by SCP-096, you will forget what his face looks like, and thus no longer be a target.";

/// <inheritdoc/>
public override SpawnProperties SpawnProperties { get; set; } = new SpawnProperties
{
DynamicSpawnPoints = new List<DynamicSpawnPoint>
{
new DynamicSpawnPoint { Chance = 100, Location = SpawnLocation.Inside096 },
},
};

/// <inheritdoc/>
protected override void SubscribeEvents()
{
Exiled.Events.Handlers.Player.UsingMedicalItem += OnUsingMedicalItem;
base.SubscribeEvents();
}

/// <inheritdoc/>
protected override void UnsubscribeEvents()
{
Exiled.Events.Handlers.Player.UsingMedicalItem -= OnUsingMedicalItem;
base.UnsubscribeEvents();
}

/// <summary>
/// Handles the using of this item.
/// </summary>
/// <param name="ev"><see cref="UsingMedicalItemEventArgs"/>.</param>
private void OnUsingMedicalItem(UsingMedicalItemEventArgs ev)
{
if (!Check(ev.Player.CurrentItem))
return;

IEnumerable<Player> scp096s = Player.Get(RoleType.Scp096);

Timing.CallDelayed(1f, () =>
{
foreach (Player scp in scp096s)
if (scp.CurrentScp is PlayableScps.Scp096 scp096 && scp096.HasTarget(ev.Player.ReferenceHub))
scp096._targets.Remove(ev.Player.ReferenceHub);
ev.Player.EnableEffect<Concussed>(5f, true);
});
}
}
}
70 changes: 36 additions & 34 deletions CustomItems/Items/LethalInjection.cs
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
// -----------------------------------------------------------------------
// <copyright file="LethalInjection.cs" company="Galaxy199 and iopietro">
// Copyright (c) Galaxy199 and iopietro. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

// -----------------------------------------------------------------------
// <copyright file="LethalInjection.cs" company="Galaxy199 and iopietro">
// Copyright (c) Galaxy199 and iopietro. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace CustomItems.Items
{
using System.Collections.Generic;
using System.ComponentModel;
using Exiled.API.Features;
using Exiled.CustomItems.API;
using Exiled.CustomItems.API.Features;
using Exiled.CustomItems.API.Spawn;
using Exiled.Events.EventArgs;
using MEC;
using PlayableScps;
using Player = Exiled.Events.Handlers.Player;
{
using System.Collections.Generic;
using System.ComponentModel;
using Exiled.API.Features;
using Exiled.CustomItems.API;
using Exiled.CustomItems.API.Features;
using Exiled.CustomItems.API.Spawn;
using Exiled.Events.EventArgs;
using MEC;
using PlayableScps;
using Player = Exiled.Events.Handlers.Player;
using Scp096 = PlayableScps.Scp096;


/// <inheritdoc />
public class LethalInjection : CustomItem
{
/// <inheritdoc/>
{
/// <inheritdoc/>
public override uint Id { get; set; } = 3;

/// <inheritdoc/>
public override string Name { get; set; } = "LJ-119";

/// <inheritdoc/>
public override string Description { get; set; } = "This is a Lethal Injection that, when used, will cause SCP-096 to immediately leave his enrage, regardless of how many targets he currently has, if you are one of his current targets. You always die when using this, even if there's no enrage to break, or you are not a target.";

public override string Description { get; set; } = "This is a Lethal Injection that, when used, will cause SCP-096 to immediately leave his enrage, regardless of how many targets he currently has, if you are one of his current targets. You always die when using this, even if there's no enrage to break, or you are not a target.";

/// <inheritdoc/>
public override SpawnProperties SpawnProperties { get; set; } = new SpawnProperties
{
Expand All @@ -43,31 +43,31 @@ public class LethalInjection : CustomItem
Location = SpawnLocation.Inside096,
},
},
};

/// <summary>
/// Gets or sets a value indicating whether the Lethal Injection should always kill the user, regardless of if they stop SCP-096's enrage.
/// </summary>
};

/// <summary>
/// Gets or sets a value indicating whether the Lethal Injection should always kill the user, regardless of if they stop SCP-096's enrage.
/// </summary>
[Description("Whether the Lethal Injection should always kill the user, regardless of if they stop SCP-096's enrage.")]
public bool KillOnFail { get; set; } = true;

public bool KillOnFail { get; set; } = true;

/// <inheritdoc/>
protected override void SubscribeEvents()
{
Player.UsingMedicalItem += OnMedicalItemUsed;
Player.UsingMedicalItem += OnUsingMedicalItem;

base.SubscribeEvents();
}

/// <inheritdoc/>
protected override void UnsubscribeEvents()
{
Player.UsingMedicalItem -= OnMedicalItemUsed;
Player.UsingMedicalItem -= OnUsingMedicalItem;

base.UnsubscribeEvents();
}

private void OnMedicalItemUsed(UsingMedicalItemEventArgs ev)
private void OnUsingMedicalItem(UsingMedicalItemEventArgs ev)
{
Log.Debug($"{ev.Player.Nickname} used a medical item: {ev.Item}", CustomItems.Instance.Config.IsDebugEnabled);
if (!Check(ev.Player.CurrentItem))
Expand Down Expand Up @@ -97,14 +97,16 @@ private void OnMedicalItemUsed(UsingMedicalItemEventArgs ev)
}

if (!KillOnFail)
{
ev.Player.AdrenalineHealth = 0;
return;
}

Log.Debug($"{Name} kill on fail: {ev.Player.Nickname}", CustomItems.Instance.Config.IsDebugEnabled);
ev.Player.Kill(DamageTypes.Poison);
});

ev.Player.RemoveItem(ev.Player.CurrentItem);
ev.IsAllowed = false;
}
}
}
9 changes: 8 additions & 1 deletion CustomItems/Items/Scp714.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
namespace CustomItems.Items
// -----------------------------------------------------------------------
// <copyright file="Scp714.cs" company="Galaxy199 and iopietro">
// Copyright (c) Galaxy199 and iopietro. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace CustomItems.Items
{
using System.Collections.Generic;
using System.ComponentModel;
Expand Down
2 changes: 1 addition & 1 deletion CustomItems/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.2.0")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
Loading

0 comments on commit f444f57

Please sign in to comment.