Floor tile fixes (#1055)

Co-authored-by: FL-OZ <anotherscuffed@gmail.com>
This commit is contained in:
FL-OZ
2020-05-31 12:36:14 -05:00
committed by GitHub
parent bffe4df16f
commit 8db5adb387
4 changed files with 62 additions and 41 deletions

View File

@@ -3,6 +3,7 @@ using Content.Server.GameObjects.EntitySystems;
using Content.Server.Utility;
using Content.Shared.Maps;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
@@ -24,8 +25,8 @@ namespace Content.Server.GameObjects.Components.Items
#pragma warning restore 649
public override string Name => "FloorTile";
private StackComponent Stack;
public string _outputTile;
private StackComponent _stack;
private string _outputTile;
public override void ExposeData(ObjectSerializer serializer)
@@ -37,7 +38,7 @@ namespace Content.Server.GameObjects.Components.Items
public override void Initialize()
{
base.Initialize();
Stack = Owner.GetComponent<StackComponent>();
_stack = Owner.GetComponent<StackComponent>();
}
public void AfterInteract(AfterInteractEventArgs eventArgs)
{
@@ -47,12 +48,13 @@ namespace Content.Server.GameObjects.Components.Items
var mapGrid = _mapManager.GetGrid(eventArgs.ClickLocation.GridID);
var tile = mapGrid.GetTileRef(eventArgs.ClickLocation);
var tileDef = (ContentTileDefinition)_tileDefinitionManager[tile.Tile.TypeId];
if (tileDef.IsSubFloor && attacked == null && Stack.Use(1))
if (tileDef.IsSubFloor && attacked == null && _stack.Use(1))
{
var desiredTile = _tileDefinitionManager[_outputTile];
mapGrid.SetTile(eventArgs.ClickLocation, new Tile(desiredTile.TileId));
_entitySystemManager.GetEntitySystem<AudioSystem>().Play("/Audio/items/genhit.ogg", Owner);
if(Stack.Count < 1){
_entitySystemManager.GetEntitySystem<AudioSystem>().Play("/Audio/items/genhit.ogg", eventArgs.ClickLocation, AudioParams.Default);
if(_stack.Count < 1){
Owner.Delete();
}
}

View File

@@ -1,29 +1,47 @@
- type: entity
name: Carpet Floor Tile
parent: BaseItem
id: FloorTileItemCarpet
description: Those could work as a pretty decent throwing weapon.
id: FloorTileItemBase
description: These could work as a pretty decent throwing weapon.
abstract: true
components:
- type: Sprite
sprite: Objects/Tiles/tile.rsi
state: tile_carpet
state: tile_steel
- type: Icon
sprite: Objects/Tiles/tile.rsi
state: tile_carpet
- type: Item
Size: 25
state: tile_steel
- type: FloorTile
output: floor_carpet
output: floor_steel
- type: Stack
stacktype: FloorTileCarpet
stacktype: FloorTileSteel
count: 1
max: 8
- type: entity
name: Steel Floor Tile
parent: FloorTileItemBase
id: FloorTileItemSteel
- type: entity
name: Carpet Floor Tile
parent: FloorTileItemBase
id: FloorTileItemCarpet
components:
- type: Sprite
sprite: Objects/Tiles/tile.rsi
state: tile_carpet
- type: Icon
sprite: Objects/Tiles/tile.rsi
state: tile_carpet
- type: FloorTile
output: floor_carpet
- type: Stack
stacktype: FloorTileCarpet
- type: entity
name: Wood Floor Tile
parent: BaseItem
parent: FloorTileItemBase
id: FloorTileItemWood
description: Those could work as a pretty decent throwing weapon.
components:
- type: Sprite
sprite: Objects/Tiles/tile.rsi
@@ -31,8 +49,6 @@
- type: Icon
sprite: Objects/Tiles/tile.rsi
state: tile_wood
- type: Item
Size: 25
- type: FloorTile
output: floor_wood
- type: Stack
@@ -42,9 +58,8 @@
- type: entity
name: White Floor Tile
parent: BaseItem
parent: FloorTileItemBase
id: FloorTileItemWhite
description: Those could work as a pretty decent throwing weapon.
components:
- type: Sprite
sprite: Objects/Tiles/tile.rsi
@@ -52,8 +67,6 @@
- type: Icon
sprite: Objects/Tiles/tile.rsi
state: tile_white
- type: Item
Size: 25
- type: FloorTile
output: floor_white
- type: Stack
@@ -63,9 +76,8 @@
- type: entity
name: Dark Floor Tile
parent: BaseItem
parent: FloorTileItemBase
id: FloorTileItemDark
description: Those could work as a pretty decent throwing weapon.
components:
- type: Sprite
sprite: Objects/Tiles/tile.rsi
@@ -73,8 +85,6 @@
- type: Icon
sprite: Objects/Tiles/tile.rsi
state: tile_dark
- type: Item
Size: 25
- type: FloorTile
output: floor_dark
- type: Stack
@@ -83,22 +93,29 @@
max: 8
- type: entity
name: Steel Floor Tile
parent: BaseItem
id: FloorTileItemSteel
description: Those could work as a pretty decent throwing weapon.
name: Floor Tile Techmaint
parent: FloorTileItemBase
id: FloorTileItemTechmaint
components:
- type: Sprite
sprite: Objects/Tiles/tile.rsi
state: tile_steel
state: tile_dark_techfloor_grid
- type: Icon
sprite: Objects/Tiles/tile.rsi
state: tile_steel
- type: Item
Size: 25
state: tile_dark_techfloor_grid
- type: FloorTile
output: floor_steel
- type: Stack
stacktype: FloorTileSteel
count: 1
max: 8
output: floor_techmaint
- type: entity
name: Floor Tile Freezer
parent: FloorTileItemBase
id: FloorTileItemFreezer
components:
- type: Sprite
sprite: Objects/Tiles/tile.rsi
state: tile_cafe #this is close enough for now.
- type: Icon
sprite: Objects/Tiles/tile.rsi
state: tile_cafe
- type: FloorTile
output: floor_freezer

View File

@@ -47,6 +47,7 @@
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.35
item_drop: FloorTileItemFreezer
- type: tile
name: floor_hydro
@@ -168,6 +169,7 @@
can_crowbar: true
footstep_sounds: footstep_floor
friction: 0.5
item_drop: FloorTileItemTechmaint
- type: tile
name: floor_white

View File

@@ -9,4 +9,4 @@
can_crowbar: true
footstep_sounds: footstep_wood
friction: 0.35
item_drop: FloorTileItemCarpet
item_drop: FloorTileItemWood