Make devastation the only explosion type that removes tiles entirely (#1612)

* Make light and heavy explosions not destroy tiles to space

* Change welding fuel tank and grenade explosion values
This commit is contained in:
DrSmugleaf
2020-08-08 18:14:22 +02:00
committed by GitHub
parent 9681907006
commit ee14d67756
3 changed files with 21 additions and 25 deletions

View File

@@ -83,29 +83,25 @@ namespace Content.Server.Explosions
continue; continue;
} }
var distanceFromTile = (int) tileLoc.Distance(mapManager, coords); var distanceFromTile = (int) tileLoc.Distance(mapManager, coords);
if (distanceFromTile < devastationRange)
{
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager[baseTurfs[0]].TileId));
}
else if (distanceFromTile < heavyImpactRange) var zeroTile = new Tile(tileDefinitionManager[baseTurfs[0]].TileId);
{ var previousTile = new Tile(tileDefinitionManager[baseTurfs[^1]].TileId);
if (robustRandom.Prob(0.8f))
{
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager[baseTurfs[^1]].TileId));
}
else
{
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager[baseTurfs[0]].TileId));
}
}
else if (distanceFromTile < lightImpactRange) switch (distanceFromTile)
{ {
if (robustRandom.Prob(0.5f)) case var d when d < devastationRange:
{ mapGrid.SetTile(tileLoc, zeroTile);
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager[baseTurfs[^1]].TileId)); break;
} case var d when d < heavyImpactRange
&& !previousTile.IsEmpty
&& robustRandom.Prob(0.8f):
mapGrid.SetTile(tileLoc, previousTile);
break;
case var d when d < lightImpactRange
&& !previousTile.IsEmpty
&& robustRandom.Prob(0.5f):
mapGrid.SetTile(tileLoc, previousTile);
break;
} }
} }

View File

@@ -9,9 +9,9 @@
- type: Icon - type: Icon
texture: Constructible/Misc/weldtank.png texture: Constructible/Misc/weldtank.png
- type: Explosive - type: Explosive
devastationRange: 1 devastationRange: 0
heavyImpactRange: 2 heavyImpactRange: 2
lightImpactRange: 4 lightImpactRange: 6
flashRange: 5 flashRange: 5
- type: Solution - type: Solution
contents: contents:

View File

@@ -17,9 +17,9 @@
- type: OnUseTimerTrigger - type: OnUseTimerTrigger
delay: 3.5 delay: 3.5
- type: Explosive - type: Explosive
devastationRange: 1 devastationRange: 0
heavyImpactRange: 3 heavyImpactRange: 2
lightImpactRange: 5 lightImpactRange: 4
flashRange: 7 flashRange: 7
- type: Damageable - type: Damageable
- type: Destructible - type: Destructible