void HandleTNTPhysics(Level lvl, ref PhysInfo C) { ushort x = C.X, y = C.Y, z = C.Z; Player p = GetPlayer(ref C.Data); if (p == null) { C.Data.Data = PhysicsArgs.RemoveFromChecks; return; } int power = 2, threshold = 3; switch (Config.Difficulty) { case TWDifficulty.Easy: threshold = 7; break; case TWDifficulty.Normal: threshold = 5; break; case TWDifficulty.Extreme: power = 3; break; } if ((C.Data.Data >> 4) < threshold) { C.Data.Data += (1 << 4); TntPhysics.ToggleFuse(lvl, x, (ushort)(y + 1), z); return; } TWData data = Get(p); if (data.KillStreak >= cfg.StreakTwoAmount && cfg.Streaks) { power++; } TntPhysics.MakeExplosion(Map, x, y, z, power - 2, true, this); List <Player> inRange = new List <Player>(); Player[] all = allPlayers.Items; foreach (Player pl in all) { if (pl == p) { continue; } if (Math.Abs(pl.Pos.BlockX - x) + Math.Abs(pl.Pos.BlockY - y) + Math.Abs(pl.Pos.BlockZ - z) < ((power * 3) + 1)) { inRange.Add(pl); } } KillPlayers(p, data, inRange); }
public void MakeExplosion(ushort x, ushort y, ushort z, int size, bool force = false) { TntPhysics.MakeExplosion(this, x, y, z, size, force, null); }
public void MakeExplosion(ushort x, ushort y, ushort z, int size, bool force = false, TntWarsGame CheckForExplosionZone = null) { TntPhysics.MakeExplosion(this, x, y, z, size, force, CheckForExplosionZone); }