Botany (#2357)
* plants and seeds go brrrr * update plants * P L A N T * brrrr * Hydroponics actually work! How about that? * Reuse resource path in visualizer * They lied to us. * Several stuffs * more werk * Add a bunch of plants * Logs go brr. * Brrr moment. * Remove unused method * Important comment. * Seed inventory, yo! * tomato moment * Balance consumption * Makes hydroponics pourable * Adds plant metabolism effect for sugar, the same as glucose. * Eggplant moment * Apple moment * Corn moment * Chanterelle mushroom moment * prototype tweaks * Seed extractor moment * typo * IPlantMetabolizable doc improvement * I should trust my gut instinct more often. * egg-plant..... * localization * Make WaterLevel and NutritionLevel setters private * Less code repetition! Wooo!
This commit is contained in:
committed by
GitHub
parent
7c57d10531
commit
484eb0bba4
@@ -1,22 +1,41 @@
|
||||
using System;
|
||||
using Content.Shared.GameObjects.Components.Atmos;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Interfaces.GameObjects.Components;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Utility;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
|
||||
namespace Content.Client.GameObjects.Components.Atmos
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class FireVisualizer : AppearanceVisualizer
|
||||
{
|
||||
private int _fireStackAlternateState = 3;
|
||||
private string _normalState;
|
||||
private string _alternateState;
|
||||
private string _sprite;
|
||||
|
||||
public override void InitializeEntity(IEntity entity)
|
||||
{
|
||||
base.InitializeEntity(entity);
|
||||
|
||||
var sprite = entity.GetComponent<ISpriteComponent>();
|
||||
|
||||
sprite.LayerMapReserveBlank(FireVisualLayers.Fire);
|
||||
sprite.LayerSetVisible(FireVisualLayers.Fire, false);
|
||||
}
|
||||
|
||||
public override void LoadData(YamlMappingNode node)
|
||||
{
|
||||
base.LoadData(node);
|
||||
|
||||
if (node.TryGetNode("sprite", out var sprite))
|
||||
{
|
||||
_sprite = sprite.AsString();
|
||||
}
|
||||
|
||||
if (node.TryGetNode("fireStackAlternateState", out var fireStack))
|
||||
{
|
||||
_fireStackAlternateState = fireStack.AsInt();
|
||||
@@ -52,6 +71,7 @@ namespace Content.Client.GameObjects.Components.Atmos
|
||||
{
|
||||
var sprite = component.Owner.GetComponent<ISpriteComponent>();
|
||||
|
||||
sprite.LayerSetRSI(FireVisualLayers.Fire, _sprite);
|
||||
sprite.LayerSetVisible(FireVisualLayers.Fire, onFire);
|
||||
|
||||
if(fireStacks > _fireStackAlternateState && !string.IsNullOrEmpty(_alternateState))
|
||||
|
||||
Reference in New Issue
Block a user