Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
💨
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus-QC committed Jan 3, 2022
1 parent 9c10f8f commit 5fb601f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion BetterDrops/BetterDrops.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class BetterDrops : Plugin<PluginConfig>
public override string Author { get; } = "Jesus-QC";
public override string Name { get; } = "BetterDrops";
public override string Prefix { get; } = "better_drops";
public override Version Version { get; } = new Version(1, 0, 1);
public override Version Version { get; } = new Version(1, 0, 2);
public override Version RequiredExiledVersion { get; } = new Version(4, 1, 7);

public static PluginConfig Cfg;
Expand Down
7 changes: 5 additions & 2 deletions BetterDrops/Commands/SpawnCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace BetterDrops.Commands
public class SpawnCommand : ICommand
{
public string Command { get; } = "SpawnDrop";
public string[] Aliases { get; } = {};
public string[] Aliases { get; } = Array.Empty<string>();
public string Description { get; } = "Spawns drops";

public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
Expand All @@ -34,9 +34,12 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
new Drop(Team.MTF.GetRandomDropSpawnPoint()).Spawn();
else if (arguments.At(0).ToLower() == "chaos")
new Drop(Team.CHI.GetRandomDropSpawnPoint()).Spawn();

response = "Done!";
return true;
}

else if(arguments.Count > 2)
if(arguments.Count > 2)
{
if (!float.TryParse(arguments.At(0), out var x) || !float.TryParse(arguments.At(1), out var y) || !float.TryParse(arguments.At(2), out var z))
{
Expand Down
6 changes: 4 additions & 2 deletions BetterDrops/Features/Components/DropController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ private void Start()
ChangeLayers(transform, BetterDrops.Cfg.DropLayer);

_rigidbody = gameObject.AddComponent<Rigidbody>();
_rigidbody.mass = 20;
_rigidbody.drag = 3;
_rigidbody.constraints = RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionZ;
}

Expand Down Expand Up @@ -62,10 +64,10 @@ private void OnTriggerEnter(Collider other)
foreach (var face in faces)
{
var r = face.AddComponent<Rigidbody>();
r.AddExplosionForce(5, transform.position, 1);
r.AddExplosionForce(20, transform.position, 1);
}

BetterDrops.EventManager.Coroutines.Add(Timing.CallDelayed(30, () => Destroy(gameObject)));
BetterDrops.EventManager.Coroutines.Add(Timing.CallDelayed(5, () => Destroy(gameObject)));
}

private static void ChangeLayers(Transform t, int layer)
Expand Down
2 changes: 1 addition & 1 deletion BetterDrops/PluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class PluginConfig : IConfig
public int DropLayer { get; set; } = 6;

[Description("The possible items inside the drop")]
public List<ItemType> PossibleItems { get; set; } = new List<ItemType> {ItemType.Coal, ItemType.Coin, ItemType.GunCrossvec, ItemType.GunLogicer, ItemType.GunRevolver, ItemType.GunShotgun, ItemType.GunAK, ItemType.GunCOM15, ItemType.GunE11SR, ItemType.Ammo9x19, ItemType.Ammo12gauge, ItemType.Adrenaline, ItemType.Flashlight, ItemType.Medkit, ItemType.GrenadeFlash, ItemType.GrenadeHE};
public List<ItemType> PossibleItems { get; set; } = new List<ItemType> {ItemType.Coin, ItemType.GunCrossvec, ItemType.GunLogicer, ItemType.GunRevolver, ItemType.GunShotgun, ItemType.GunAK, ItemType.GunCOM15, ItemType.GunE11SR, ItemType.Ammo9x19, ItemType.Ammo12gauge, ItemType.Adrenaline, ItemType.Flashlight, ItemType.Medkit, ItemType.GrenadeFlash, ItemType.GrenadeHE};

[Description("Should drops spawn on MTFs spawns")]
public bool MtfDrops { get; set; } = true;
Expand Down

0 comments on commit 5fb601f

Please sign in to comment.