BaseTurfs (#699)

* tweaks

* Baseturfs

* dotnet messages

* indentation

* comment

* Change requests

* Smaller diff

* Diff
This commit is contained in:
Rohesie
2020-02-22 20:30:36 -03:00
committed by GitHub
parent 4f397e1ce2
commit ffe55648b6
5 changed files with 208 additions and 88 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.EntitySystems;
@@ -46,8 +47,7 @@ namespace Content.Server.Explosions
continue;
var distanceFromEntity = (int)entity.Transform.GridPosition.Distance(mapManager, coords);
var exAct = entitySystemManager.GetEntitySystem<ActSystem>();
var severity = ExplosionSeverity.Destruction;
ExplosionSeverity severity;
if (distanceFromEntity < devastationRange)
{
severity = ExplosionSeverity.Destruction;
@@ -64,6 +64,7 @@ namespace Content.Server.Explosions
{
continue;
}
var exAct = entitySystemManager.GetEntitySystem<ActSystem>();
//exAct.HandleExplosion(Owner, entity, severity);
exAct.HandleExplosion(null, entity, severity);
}
@@ -76,29 +77,33 @@ namespace Content.Server.Explosions
foreach (var tile in tiles)
{
var tileLoc = mapGrid.GridTileToLocal(tile.GridIndices);
var tileDef = (ContentTileDefinition)tileDefinitionManager[tile.Tile.TypeId];
var distanceFromTile = (int)tileLoc.Distance(mapManager, coords);
if (!string.IsNullOrWhiteSpace(tileDef.SubFloor))
var tileDef = (ContentTileDefinition) tileDefinitionManager[tile.Tile.TypeId];
var baseTurfs = tileDef.BaseTurfs;
if (baseTurfs.Count == 0)
{
if (distanceFromTile < devastationRange)
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager["space"].TileId));
if (distanceFromTile < heavyImpactRange)
continue;
}
var distanceFromTile = (int) tileLoc.Distance(mapManager, coords);
if (distanceFromTile < devastationRange)
{
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager[baseTurfs[0]].TileId));
}
else if (distanceFromTile < heavyImpactRange)
{
if (robustRandom.Prob(80))
{
if (robustRandom.Prob(80))
{
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager[tileDef.SubFloor].TileId));
}
else
{
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager["space"].TileId));
}
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager[baseTurfs[^1]].TileId));
}
if (distanceFromTile < lightImpactRange)
else
{
if (robustRandom.Prob(50))
{
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager[tileDef.SubFloor].TileId));
}
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager[baseTurfs[0]].TileId));
}
}
else if (distanceFromTile < lightImpactRange)
{
if (robustRandom.Prob(50))
{
mapGrid.SetTile(tileLoc, new Tile(tileDefinitionManager[baseTurfs[^1]].TileId));
}
}
}

View File

@@ -1,4 +1,7 @@
using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
@@ -19,7 +22,7 @@ namespace Content.Shared.Maps
public string DisplayName { get; private set; }
public string SpriteName { get; private set; }
public bool IsSubFloor { get; private set; }
public string SubFloor { get; private set; }
public List<string> BaseTurfs { get; private set; }
public bool CanCrowbar { get; private set; }
public string FootstepSounds { get; private set; }
public float Friction { get; set; }
@@ -40,10 +43,11 @@ namespace Content.Shared.Maps
{
IsSubFloor = node.AsBool();
}
if (mapping.TryGetNode("subfloor", out var another_node))
{
SubFloor = another_node.AsString();
}
if (mapping.TryGetNode("base_turfs", out YamlSequenceNode baseTurfNode))
BaseTurfs = baseTurfNode.Select(i => i.ToString()).ToList();
else
BaseTurfs = new List<string>();
if (mapping.TryGetNode("can_crowbar", out node))
{

View File

@@ -1,213 +1,249 @@
- type: tile
- type: tile
name: floor_carpet
display_name: Carpet
texture: "carpet"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_carpet
friction: 0.35
subfloor: plating
item_drop: FloorTileItemCarpet
- type: tile
name: floor_dark
display_name: Dark floor
texture: "dark"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
item_drop: FloorTileItemDark
- type: tile
name: floor_elevator_shaft
display_name: Elevator shaft
texture: "elevator_shaft"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
- type: tile
name: floor_freezer
display_name: Freezer
texture: "freezer"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
- type: tile
name: floor_hydro
display_name: Hydro floor
texture: "hydro"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
- type: tile
name: floor_green_circuit
display_name: Green circuit floor
texture: "green_circuit"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
- type: tile
name: floor_lino
display_name: Linoleum floor
texture: "lino"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
- type: tile
name: floor_mono
display_name: Mono floor
texture: "mono"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
- type: tile
name: floor_reinforced
display_name: Reinforced floor
texture: "reinforced"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
- type: tile
name: floor_rock_vault
display_name: Rock vault floor
texture: "rock_vault"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
- type: tile
name: floor_showroom
display_name: Showroom floor
texture: "showroom"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
- type: tile
name: floor_steel
display_name: Steel floor
texture: "steel"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
item_drop: FloorTileItemSteel
- type: tile
name: floor_steel_dirty
display_name: Dirty steel floor
texture: "steel_dirty"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
subfloor: plating
- type: tile
name: floor_techmaint
display_name: Techmaint Floor
texture: "tech_maint"
base_turfs:
- space
- underplating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.5
subfloor: underplating
- type: tile
name: floor_white
display_name: White Floor
texture: "white"
base_turfs:
- space
- underplating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.1
subfloor: underplating
item_drop: FloorTileItemWhite
- type: tile
name: floor_asteroid_sand
display_name: Asteroid Floor
texture: asteroid_sand
base_turfs:
- space
is_subfloor: false
can_crowbar: false
footstep_sounds: footstep_asteroid
friction: 0.35
subfloor: space
- type: tile
name: floor_asteroid_tile
display_name: Asteroid Tile
texture: asteroid_tile
base_turfs:
- space
is_subfloor: false
can_crowbar: false
footstep_sounds: footstep_asteroid
friction: 0.35
subfloor: space
- type: tile
name: floor_asteroid_coarse_sand0
display_name: Asteroid Coarse Sand 0
texture: asteroid_coarse_sand0
base_turfs:
- space
is_subfloor: false
can_crowbar: false
footstep_sounds: footstep_asteroid
friction: 0.35
subfloor: space
- type: tile
name: floor_asteroid_coarse_sand1
display_name: Asteroid Coarse Sand 1
texture: asteroid_coarse_sand1
base_turfs:
- space
is_subfloor: false
can_crowbar: false
footstep_sounds: footstep_asteroid
friction: 0.35
subfloor: space
- type: tile
name: floor_asteroid_coarse_sand2
display_name: Asteroid Coarse Sand 2
texture: asteroid_coarse_sand2
base_turfs:
- space
is_subfloor: false
can_crowbar: false
footstep_sounds: footstep_asteroid
friction: 0.35
subfloor: space
- type: tile
name: floor_asteroid_coarse_sand_dug
display_name: Asteroid Dug Coarse Sand
texture: asteroid_coarse_sand_dug
base_turfs:
- space
is_subfloor: false
can_crowbar: false
footstep_sounds: footstep_asteroid
friction: 0.35
subfloor: space

View File

@@ -1,397 +1,469 @@
# TODO: Change code to avoid the DRY
# TODO: Change code to avoid the DRY
- type: tile
parent: floor_hull_base
name: floor_hull_center0
display_name: Hull Center 0
texture: "Hull/hullcenter0"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center1
display_name: Hull Center 1
texture: "Hull/hullcenter1"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center2
display_name: Hull Center 2
texture: "Hull/hullcenter2"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center3
display_name: Hull Center 3
texture: "Hull/hullcenter3"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center4
display_name: Hull Center 4
texture: "Hull/hullcenter4"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center5
display_name: Hull Center 5
texture: "Hull/hullcenter5"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center6
display_name: Hull Center 6
texture: "Hull/hullcenter6"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center7
display_name: Hull Center 7
texture: "Hull/hullcenter7"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center8
display_name: Hull Center 8
texture: "Hull/hullcenter8"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center9
display_name: Hull Center 9
texture: "Hull/hullcenter9"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center10
display_name: Hull Center 10
texture: "Hull/hullcenter10"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center11
display_name: Hull Center 11
texture: "Hull/hullcenter11"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center12
display_name: Hull Center 12
texture: "Hull/hullcenter12"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center13
display_name: Hull Center 13
texture: "Hull/hullcenter13"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center14
display_name: Hull Center 14
texture: "Hull/hullcenter14"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center15
display_name: Hull Center 15
texture: "Hull/hullcenter15"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center16
display_name: Hull Center 16
texture: "Hull/hullcenter16"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center17
display_name: Hull Center 17
texture: "Hull/hullcenter17"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center18
display_name: Hull Center 18
texture: "Hull/hullcenter18"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center19
display_name: Hull Center 19
texture: "Hull/hullcenter19"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center20
display_name: Hull Center 20
texture: "Hull/hullcenter20"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center21
display_name: Hull Center 21
texture: "Hull/hullcenter21"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center22
display_name: Hull Center 22
texture: "Hull/hullcenter22"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center23
display_name: Hull Center 23
texture: "Hull/hullcenter23"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center24
display_name: Hull Center 24
texture: "Hull/hullcenter24"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center25
display_name: Hull Center 25
texture: "Hull/hullcenter25"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center26
display_name: Hull Center 26
texture: "Hull/hullcenter26"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center27
display_name: Hull Center 27
texture: "Hull/hullcenter27"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center28
display_name: Hull Center 28
texture: "Hull/hullcenter28"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center29
display_name: Hull Center 29
texture: "Hull/hullcenter29"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center30
display_name: Hull Center 30
texture: "Hull/hullcenter30"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center31
display_name: Hull Center 31
texture: "Hull/hullcenter31"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center32
display_name: Hull Center 32
texture: "Hull/hullcenter32"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center33
display_name: Hull Center 33
texture: "Hull/hullcenter33"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center34
display_name: Hull Center 34
texture: "Hull/hullcenter34"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating
- type: tile
parent: floor_hull_base
name: floor_hull_center35
display_name: Hull Center 35
texture: "Hull/hullcenter35"
base_turfs:
- space
- plating
is_subfloor: false
can_crowbar: true
footstep_sounds: footstep_hull
friction: 0.35
subfloor: plating

View File

@@ -1,16 +1,19 @@
- type: tile
- type: tile
name: plating
display_name: Plating
texture: plating
base_turfs:
- space
is_subfloor: true
footstep_sounds: footstep_plating
friction: 0.5
subfloor: space
- type: tile
name: underplating
display_name: Underplating
texture: underplating
base_turfs:
- space
is_subfloor: true
footstep_sounds: footstep_plating
friction: 0.5