Skip to content
Open
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
2 changes: 1 addition & 1 deletion BetterCoinflips/BetterCoinflips.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="ExMod.Exiled" Version="9.6.0" />
<PackageReference Include="ExMod.Exiled" Version="9.6.1" />
<PackageReference Include="Lib.Harmony">
<Version>2.2.2</Version>
</PackageReference>
Expand Down
1 change: 0 additions & 1 deletion BetterCoinflips/Configs/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ public class Config : IConfig
RoomType.HczHid,
RoomType.HczNuke,
RoomType.HczStraight,
RoomType.HczTesla,
RoomType.HczTestRoom,
RoomType.Lcz173,
RoomType.Lcz330,
Expand Down
2 changes: 1 addition & 1 deletion BetterCoinflips/Configs/Translations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class Translations : ITranslation
public string InventoryResetMessage { get; set; } = "You lost your stuff.";
public string ClassSwapMessage { get; set; } = "That's what I call an UNO reverse card!";
public string InstantExplosionMessage { get; set; } = "You got smoked.";
public string PlayerSwapMessage { get; set; } = "Your inventory was swapped with a random player.";
public string PlayerSwapMessage { get; set; } = "You were swapped with another player.";
public string PlayerSwapIfOneAliveMessage { get; set; } = "You were supposed to switch places with someone but no one else is alive!";
public string KickMessage { get; set; } = "Bye!";
public string SpectSwapPlayerMessage { get; set; } = "You just made someone's round better!";
Expand Down
4 changes: 2 additions & 2 deletions BetterCoinflips/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace BetterCoinflips
{
public class Plugin : Plugin<Config, Configs.Translations>
{
public override Version RequiredExiledVersion => new(9, 1, 1);
public override Version Version => new(5, 0, 0);
public override Version RequiredExiledVersion => new(9, 6, 0);
public override Version Version => new(5, 1, 0);
public override string Author => "Miki_hero";
public override string Name => "BetterCoinflips";

Expand Down
17 changes: 12 additions & 5 deletions BetterCoinflips/Types/CoinEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public CoinFlipEffect(string message, Action<Player> execute)
new CoinFlipEffect(Translations.OneAmmoLogicerMessage, player =>
{
Firearm gun = (Firearm)Item.Create(ItemType.GunLogicer);
gun.BarrelAmmo = 1;
gun.MagazineAmmo = 1;
gun.CreatePickup(player.Position);
}),

Expand All @@ -122,6 +122,7 @@ public CoinFlipEffect(string message, Action<Player> execute)
Firearm revo = (Firearm)Item.Create(ItemType.GunRevolver);
revo.AddAttachment(new[]
{AttachmentName.CylinderMag7, AttachmentName.ShortBarrel, AttachmentName.ScopeSight});
revo.MagazineAmmo = revo.MaxMagazineAmmo;
revo.CreatePickup(player.Position);
}),

Expand Down Expand Up @@ -149,7 +150,13 @@ public CoinFlipEffect(string message, Action<Player> execute)
// 14: Spawns a random item for the player.
new CoinFlipEffect(Translations.RandomItemMessage, player =>
{
Item.Create(Config.ItemsToGive.ToList().RandomItem()).CreatePickup(player.Position);
var itemType = Config.ItemsToGive.ToList().RandomItem();
var item = Item.Create(itemType);

if (item is Firearm firearm)
firearm.MagazineAmmo = firearm.MaxMagazineAmmo;

item.CreatePickup(player.Position);
}),
};

Expand Down Expand Up @@ -409,9 +416,9 @@ public CoinFlipEffect(string message, Action<Player> execute)
new CoinFlipEffect(Warhead.IsDetonated ? Translations.TeslaTpAfterWarheadMessage : Translations.TeslaTpMessage, player =>
{
player.DropHeldItem();
player.Teleport(Exiled.API.Features.TeslaGate.List.ToList().RandomItem());

player.Teleport(Room.Get(r => r.Type == RoomType.HczTesla).GetRandomValue());

if (Warhead.IsDetonated)
{
player.Kill(DamageType.Decontamination);
Expand Down