Add config option for the bomb radius.
This commit is contained in:
parent
b73088306d
commit
8edca72919
2 changed files with 7 additions and 4 deletions
|
|
@ -1295,10 +1295,10 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
var keys = projectileCreatesLiquid.Where(k => k.Value == type).Select(k => k.Key);
|
var keys = projectileCreatesLiquid.Where(k => k.Value == type).Select(k => k.Key);
|
||||||
var recentBombs = args.Player.RecentlyCreatedProjectiles.Where(p => keys.Contains(Main.projectile[p.Index].type));
|
var recentBombs = args.Player.RecentlyCreatedProjectiles.Where(p => keys.Contains(Main.projectile[p.Index].type));
|
||||||
wasThereABombNearby = recentBombs.Any(r => (args.TileX > (Main.projectile[r.Index].position.X / 16.0f) - 16
|
wasThereABombNearby = recentBombs.Any(r => (args.TileX > (Main.projectile[r.Index].position.X / 16.0f) - TShock.Config.BombExplosionRadius
|
||||||
&& args.TileX < (Main.projectile[r.Index].position.X / 16.0f) + 16)
|
&& args.TileX < (Main.projectile[r.Index].position.X / 16.0f) + TShock.Config.BombExplosionRadius)
|
||||||
&& (args.TileY > (Main.projectile[r.Index].position.Y / 16.0f) - 16
|
&& (args.TileY > (Main.projectile[r.Index].position.Y / 16.0f) - TShock.Config.BombExplosionRadius
|
||||||
&& args.TileY < (Main.projectile[r.Index].position.Y / 16.0f) + 16));
|
&& args.TileY < (Main.projectile[r.Index].position.Y / 16.0f) + TShock.Config.BombExplosionRadius));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Liquid anti-cheat
|
// Liquid anti-cheat
|
||||||
|
|
|
||||||
|
|
@ -527,6 +527,9 @@ namespace TShockAPI
|
||||||
[Description("Whether or not the server should output debug level messages related to system operation.")]
|
[Description("Whether or not the server should output debug level messages related to system operation.")]
|
||||||
public bool DebugLogs = false;
|
public bool DebugLogs = false;
|
||||||
|
|
||||||
|
[Description("Determines the range in tiles that a bomb can affect tiles.")]
|
||||||
|
public int BombExplosionRadius = 5;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Reads a configuration file from a given path
|
/// Reads a configuration file from a given path
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue