Skip to content

Commit

Permalink
fixed #27 and #28
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikihero committed Nov 9, 2023
1 parent 866a6ee commit 3299dc2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 45 deletions.
1 change: 0 additions & 1 deletion BetterCoinflips/Configs/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ public class Config : IConfig
public int WarheadChance { get; set; } = 10;
public int LightsOutChance { get; set; } = 20;
public int LiveHeChance { get; set; } = 30;
public int TrollGunChance { get; set; } = 50;
public int TrollFlashChance { get; set; } = 50;
public int ScpTpChance { get; set; } = 20;
public int OneHpLeftChance { get; set; } = 15;
Expand Down
1 change: 0 additions & 1 deletion BetterCoinflips/Configs/Translations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class Translations : ITranslation
public string WarheadStartMessage { get; set; } = "The warhead has been started.";
public string LightsOutMessage { get; set; } = "Lights out.";
public string LiveGrenadeMessage { get; set; } = "Watch your head!";
public string TrollGunMessage { get; set; } = "YOU GOT A WHAT!?";
public string TrollFlashMessage { get; set; } = "You heard something?";
public string TpToRandomScpMessage { get; set; } = "You were teleported to an SCP.";
public string SmallDamageMessage { get; set; } = "You've lost 15hp.";
Expand Down
35 changes: 17 additions & 18 deletions BetterCoinflips/EventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,23 @@ public class EventHandlers
{ 3, Cfg.WarheadChance },
{ 4, Cfg.LightsOutChance },
{ 5, Cfg.LiveHeChance },
{ 6, Cfg.TrollGunChance },
{ 7, Cfg.TrollFlashChance },
{ 8, Cfg.ScpTpChance },
{ 9, Cfg.OneHpLeftChance },
{ 10, Cfg.PrimedVaseChance },
{ 11, Cfg.ShitPantsChance },
{ 12, Cfg.FakeCassieChance },
{ 13, Cfg.TurnIntoScpChance },
{ 14, Cfg.InventoryResetChance },
{ 15, Cfg.ClassSwapChance },
{ 16, Cfg.InstantExplosionChance },
{ 17, Cfg.PlayerSwapChance },
{ 18, Cfg.KickChance },
{ 19, Cfg.SpectSwapChance },
{ 20, Cfg.TeslaTpChance },
{ 21, Cfg.InventorySwapChance },
{ 22, Cfg.RandomTeleportChance },
{ 23, Cfg.HandcuffChance },
{ 6, Cfg.TrollFlashChance },
{ 7, Cfg.ScpTpChance },
{ 8, Cfg.OneHpLeftChance },
{ 9, Cfg.PrimedVaseChance },
{ 10, Cfg.ShitPantsChance },
{ 11, Cfg.FakeCassieChance },
{ 12, Cfg.TurnIntoScpChance },
{ 13, Cfg.InventoryResetChance },
{ 14, Cfg.ClassSwapChance },
{ 15, Cfg.InstantExplosionChance },
{ 16, Cfg.PlayerSwapChance },
{ 17, Cfg.KickChance },
{ 18, Cfg.SpectSwapChance },
{ 19, Cfg.TeslaTpChance },
{ 20, Cfg.InventorySwapChance },
{ 21, Cfg.RandomTeleportChance },
{ 22, Cfg.HandcuffChance },
};

private readonly Dictionary<string, DateTime> _cooldownDict = new();
Expand Down
42 changes: 17 additions & 25 deletions BetterCoinflips/Types/CoinEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public CoinFlipEffect(Action<Player> execute, string message)
//13
new CoinFlipEffect(player =>
{
player.Scale = new Vector3(1.3f, 0.5f, 1.3f);
player.Scale = new Vector3(1.13f, 0.5f, 1.13f);
}, Translations.SizeChangeMessage),

//14
Expand Down Expand Up @@ -206,21 +206,13 @@ public CoinFlipEffect(Action<Player> execute, string message)

//6
new CoinFlipEffect(player =>
{
Firearm gun = (Firearm)Item.Create(ItemType.ParticleDisruptor);
gun.Ammo = 0;
gun.CreatePickup(player.Position);
}, Translations.TrollGunMessage),

//7
new CoinFlipEffect(player =>
{
FlashGrenade flash = (FlashGrenade)Item.Create(ItemType.GrenadeFlash);
flash.FuseTime = 1f;
flash.SpawnActive(player.Position);
}, Translations.TrollFlashMessage),

//8
//7
new CoinFlipEffect(player =>
{
if (Player.Get(Side.Scp).Any())
Expand All @@ -236,7 +228,7 @@ public CoinFlipEffect(Action<Player> execute, string message)
}
}, Player.Get(Side.Scp).Any() ? Translations.TpToRandomScpMessage : Translations.SmallDamageMessage),

//9
//8
new CoinFlipEffect(player =>
{
if ((int)player.Health == 1)
Expand All @@ -245,28 +237,28 @@ public CoinFlipEffect(Action<Player> execute, string message)
player.Health = 1;
}, Translations.HugeDamageMessage),

//10
//9
new CoinFlipEffect(player =>
{
Scp244 vase = (Scp244)Item.Create(ItemType.SCP244a);
vase.Primed = true;
vase.CreatePickup(player.Position);
}, Translations.PrimedVaseMessage),

//11
//10
new CoinFlipEffect(player =>
{
player.PlaceTantrum();
}, Translations.ShitPantsMessage),

//12
//11
new CoinFlipEffect(player =>
{
var scpName = _scpNames.ToList().RandomItem();
Cassie.MessageTranslated($"scp {scpName.Key} successfully terminated by automatic security system",$"{scpName.Value} successfully terminated by Automatic Security System.");
}, Translations.FakeScpKillMessage),

//13
//12
new CoinFlipEffect(player =>
{
player.DropItems();
Expand All @@ -277,14 +269,14 @@ public CoinFlipEffect(Action<Player> execute, string message)
player.EnableEffect(EffectType.PocketCorroding);
}, Translations.TurnIntoScpMessage),

//14
//13
new CoinFlipEffect(player =>
{
player.DropHeldItem();
player.ClearInventory();
}, Translations.InventoryResetMessage),

//15
//14
new CoinFlipEffect(player =>
{
player.DropItems();
Expand Down Expand Up @@ -328,15 +320,15 @@ public CoinFlipEffect(Action<Player> execute, string message)
}
}, Translations.ClassSwapMessage),

//16
//15
new CoinFlipEffect(player =>
{
ExplosiveGrenade instaBoom = (ExplosiveGrenade)Item.Create(ItemType.GrenadeHE);
instaBoom.FuseTime = 0.1f;
instaBoom.SpawnActive(player.Position, player);
}, Translations.InstantExplosionMessage),

//17
//16
new CoinFlipEffect(player =>
{
var playerList = Player.List.Where(x => !Cfg.IgnoredRoles.Contains(x.Role.Type)).ToList();
Expand All @@ -351,13 +343,13 @@ public CoinFlipEffect(Action<Player> execute, string message)
player.Teleport(pos);
}, Player.List.Where(x => x.Role.Type != RoleTypeId.Spectator).IsEmpty() ? Translations.PlayerSwapIfOneAliveMessage : Translations.PlayerSwapMessage),

//18
//17
new CoinFlipEffect(player =>
{
Timing.CallDelayed(1f, () => player.Kick(Cfg.KickReason));
}, Translations.KickMessage),

//19
//18
new CoinFlipEffect(player =>
{
var spectList = Player.List.Where(x => x.Role.Type == RoleTypeId.Spectator).ToList();
Expand Down Expand Up @@ -392,14 +384,14 @@ public CoinFlipEffect(Action<Player> execute, string message)
EventHandlers.SendBroadcast(spect, Translations.SpectSwapSpectMessage);
}, Player.List.Where(x => x.Role.Type == RoleTypeId.Spectator).IsEmpty() ? Translations.SpectSwapNoSpectsMessage : Translations.SpectSwapPlayerMessage),

//20
//19
new CoinFlipEffect(player =>
{
player.DropHeldItem();
player.Teleport(Exiled.API.Features.TeslaGate.List.ToList().RandomItem());
}, Translations.TeslaTpMessage),

//21
//20
new CoinFlipEffect(player =>
{
var target = Player.List.Where(x => x != player).ToList().RandomItem();
Expand Down Expand Up @@ -447,7 +439,7 @@ public CoinFlipEffect(Action<Player> execute, string message)
EventHandlers.SendBroadcast(target, Translations.InventorySwapMessage);
}, Translations.InventorySwapMessage),

//22
//21
new CoinFlipEffect(player =>
{
if (Warhead.IsDetonated)
Expand All @@ -463,7 +455,7 @@ public CoinFlipEffect(Action<Player> execute, string message)

}, Warhead.IsDetonated ? Translations.RandomTeleportWarheadDetonatedMessage : Translations.RandomTeleportMessage),

//23
//22
new CoinFlipEffect(player =>
{
player.Handcuff();
Expand Down

0 comments on commit 3299dc2

Please sign in to comment.