Various cow fixes (#18602)

Reparent cow outputs to the correct grid.

Adjust produce so that cows and other multi-stomached animals can eat most produce.

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-08-04 08:15:05 +01:00
committed by GitHub
parent b74bd10c32
commit e05bac1c15
4 changed files with 13 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
@@ -28,13 +29,15 @@ public sealed class CreateEntityReactionEffect : ReagentEffect
public override void Effect(ReagentEffectArgs args)
{
var transform = args.EntityManager.GetComponent<TransformComponent>(args.SolutionEntity);
var transformSystem = args.EntityManager.System<SharedTransformSystem>();
var quantity = Number * args.Quantity.Int();
for (var i = 0; i < quantity; i++)
{
args.EntityManager.SpawnEntity(Entity, transform.MapPosition);
var uid = args.EntityManager.SpawnEntity(Entity, transform.MapPosition);
transformSystem.AttachToGridOrMap(uid);
// TODO figure out how to spawn inside of containers
// TODO figure out how to properly spawn inside of containers
// e.g. cheese:
// if the user is holding a bowl milk & enzyme, should drop to floor, not attached to the user.
// if reaction happens in a backpack, should insert cheese into backpack.

View File

@@ -21,15 +21,16 @@ namespace Content.Server.Nutrition.EntitySystems;
/// </summary>
public sealed class AnimalHusbandrySystem : EntitySystem
{
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
[Dependency] private readonly HungerSystem _hunger = default!;
[Dependency] private readonly IAdminLogManager _adminLog = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
[Dependency] private readonly HungerSystem _hunger = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
private readonly HashSet<EntityUid> _failedAttempts = new();
@@ -197,6 +198,7 @@ public sealed class AnimalHusbandrySystem : EntitySystem
foreach (var spawn in spawns)
{
var offspring = Spawn(spawn, xform.Coordinates.Offset(_random.NextVector2(0.3f)));
_transform.AttachToGridOrMap(offspring);
if (component.MakeOffspringInfant)
{
var infant = AddComp<InfantComponent>(offspring);

View File

@@ -8,6 +8,9 @@
- type: SolutionContainerManager
- type: Sprite
state: produce
# let cows eat raw produce like wheat and oats
- type: Food
requiredStomachs: 2
- type: Produce
- type: PotencyVisuals
- type: Appearance
@@ -981,6 +984,7 @@
seedId: flyAmanita
- type: Extractable
grindableSolutionName: food
- type: BadFood
- type: entity
name: gatfruit

View File

@@ -83,7 +83,6 @@
nodeGroupID: Spreader
- type: Food
requiredStomachs: 2 # ruminants have 4 stomachs but i dont care to give them literally 4 stomachs. 2 is good
# TODO make botany plants edible to ruminants as well ...
delay: 0.5
- type: FlavorProfile
flavors: