Errors fix

This commit is contained in:
Aviu00
2024-01-13 09:14:00 +03:00
parent e968fb695b
commit f4d3e0e920
19 changed files with 71 additions and 69 deletions

View File

@@ -235,9 +235,10 @@ namespace Content.Server.Body.Systems
// WD start // WD start
private void OnHandInteract(EntityUid uid, RespiratorComponent component, InteractHandEvent args) private void OnHandInteract(EntityUid uid, RespiratorComponent component, InteractHandEvent args)
{ {
if (CanCPR(uid, component, args.User)) if (!CanCPR(uid, component, args.User))
DoCPR(uid, component, args.User); return;
DoCPR(uid, component, args.User);
args.Handled = true; args.Handled = true;
} }

View File

@@ -4,7 +4,7 @@ namespace Content.Server.Carrying
/// Stores the carrier of an entity being carried. /// Stores the carrier of an entity being carried.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent]
public sealed class BeingCarriedComponent : Component public sealed partial class BeingCarriedComponent : Component
{ {
public EntityUid Carrier = default!; public EntityUid Carrier = default!;
} }

View File

@@ -3,7 +3,7 @@ using System.Threading;
namespace Content.Server.Carrying namespace Content.Server.Carrying
{ {
[RegisterComponent] [RegisterComponent]
public sealed class CarriableComponent : Component public sealed partial class CarriableComponent : Component
{ {
/// <summary> /// <summary>
/// Number of free hands required /// Number of free hands required

View File

@@ -4,7 +4,7 @@ namespace Content.Server.Carrying
/// Added to an entity when they are carrying somebody. /// Added to an entity when they are carrying somebody.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent]
public sealed class CarryingComponent : Component public sealed partial class CarryingComponent : Component
{ {
public EntityUid Carried = default!; public EntityUid Carried = default!;
} }

View File

@@ -1,11 +1,9 @@
using System.Threading; using System.Threading;
using Content.Server.DoAfter; using Content.Server.DoAfter;
using Content.Server.Body.Systems;
using Content.Server.Hands.Systems; using Content.Server.Hands.Systems;
using Content.Server.Resist; using Content.Server.Resist;
using Content.Server.Popups; using Content.Server.Popups;
using Content.Server.Contests; using Content.Server.Contests;
using Content.Server.Climbing;
using Content.Shared.Mobs; using Content.Shared.Mobs;
using Content.Shared.DoAfter; using Content.Shared.DoAfter;
using Content.Shared.Buckle.Components; using Content.Shared.Buckle.Components;
@@ -21,6 +19,7 @@ using Content.Shared.Pulling;
using Content.Shared.Pulling.Components; using Content.Shared.Pulling.Components;
using Content.Shared.Standing; using Content.Shared.Standing;
using Content.Shared.ActionBlocker; using Content.Shared.ActionBlocker;
using Content.Shared.Climbing.Events;
using Content.Shared.Throwing; using Content.Shared.Throwing;
using Content.Shared.Physics.Pull; using Content.Shared.Physics.Pull;
using Content.Shared.Mobs.Systems; using Content.Shared.Mobs.Systems;
@@ -225,7 +224,7 @@ namespace Content.Server.Carrying
component.CancelToken = new CancellationTokenSource(); component.CancelToken = new CancellationTokenSource();
var ev = new CarryDoAfterEvent(); var ev = new CarryDoAfterEvent();
var args = new DoAfterArgs(carrier, length, ev, carried, target: carried) var args = new DoAfterArgs(EntityManager, carrier, length, ev, carried, target: carried)
{ {
BreakOnTargetMove = true, BreakOnTargetMove = true,
BreakOnUserMove = true, BreakOnUserMove = true,

View File

@@ -1,7 +1,7 @@
namespace Content.Server.Abilities.Felinid namespace Content.Server.Abilities.Felinid
{ {
[RegisterComponent] [RegisterComponent]
public sealed class CoughingUpHairballComponent : Component public sealed partial class CoughingUpHairballComponent : Component
{ {
[DataField("accumulator")] [DataField("accumulator")]
public float Accumulator = 0f; public float Accumulator = 0f;

View File

@@ -1,12 +1,10 @@
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Content.Shared.Actions.ActionTypes;
using Robust.Shared.Utility;
namespace Content.Server.Abilities.Felinid namespace Content.Server.Abilities.Felinid
{ {
[RegisterComponent] [RegisterComponent]
public sealed class FelinidComponent : Component public sealed partial class FelinidComponent : Component
{ {
/// <summary> /// <summary>
/// The hairball prototype to use. /// The hairball prototype to use.
@@ -14,8 +12,9 @@ namespace Content.Server.Abilities.Felinid
[DataField("hairballPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] [DataField("hairballPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string HairballPrototype = "Hairball"; public string HairballPrototype = "Hairball";
[DataField("hairballAction")] public EntityUid? HairballAction;
public InstantAction? HairballAction;
public EntityUid? EatMouseAction;
public EntityUid? PotentialTarget = null; public EntityUid? PotentialTarget = null;
} }

View File

@@ -1,6 +1,6 @@
namespace Content.Server.Abilities.Felinid namespace Content.Server.Abilities.Felinid
{ {
[RegisterComponent] [RegisterComponent]
public sealed class FelinidFoodComponent : Component public sealed partial class FelinidFoodComponent : Component
{} {}
} }

View File

@@ -1,22 +1,20 @@
using Content.Shared.Actions; using Content.Shared.Actions;
using Content.Shared.Audio;
using Content.Shared.StatusEffect; using Content.Shared.StatusEffect;
using Content.Shared.Throwing; using Content.Shared.Throwing;
using Content.Shared.Item; using Content.Shared.Item;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Shared.Hands; using Content.Shared.Hands;
using Content.Shared.Actions.ActionTypes;
using Content.Shared.IdentityManagement; using Content.Shared.IdentityManagement;
using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Nutrition.EntitySystems;
using Content.Server.Body.Components; using Content.Server.Body.Components;
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Medical; using Content.Server.Medical;
using Content.Server.Nutrition.EntitySystems;
using Content.Server.Nutrition.Components; using Content.Server.Nutrition.Components;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Popups; using Content.Server.Popups;
using Content.Shared.White.Events;
using Robust.Server.Audio;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
@@ -24,7 +22,6 @@ namespace Content.Server.Abilities.Felinid
{ {
public sealed class FelinidSystem : EntitySystem public sealed class FelinidSystem : EntitySystem
{ {
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!; [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
[Dependency] private readonly HungerSystem _hungerSystem = default!; [Dependency] private readonly HungerSystem _hungerSystem = default!;
[Dependency] private readonly VomitSystem _vomitSystem = default!; [Dependency] private readonly VomitSystem _vomitSystem = default!;
@@ -32,7 +29,7 @@ namespace Content.Server.Abilities.Felinid
[Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly InventorySystem _inventorySystem = default!; [Dependency] private readonly InventorySystem _inventorySystem = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly AudioSystem _audio = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -71,11 +68,7 @@ namespace Content.Server.Abilities.Felinid
private void OnInit(EntityUid uid, FelinidComponent component, ComponentInit args) private void OnInit(EntityUid uid, FelinidComponent component, ComponentInit args)
{ {
if (!_prototypeManager.TryIndex<InstantActionPrototype>("HairballAction", out var hairball)) _actionsSystem.AddAction(uid, ref component.HairballAction, "HairballAction");
return;
component.HairballAction = new InstantAction(hairball);
_actionsSystem.AddAction(uid, component.HairballAction, uid);
} }
private void OnEquipped(EntityUid uid, FelinidComponent component, DidEquipHandEvent args) private void OnEquipped(EntityUid uid, FelinidComponent component, DidEquipHandEvent args)
@@ -85,8 +78,7 @@ namespace Content.Server.Abilities.Felinid
component.PotentialTarget = args.Equipped; component.PotentialTarget = args.Equipped;
if (_prototypeManager.TryIndex<InstantActionPrototype>("EatMouse", out var eatMouse)) _actionsSystem.AddAction(uid, ref component.EatMouseAction, "EatMouse");
_actionsSystem.AddAction(uid, new InstantAction(eatMouse), null);
} }
private void OnUnequipped(EntityUid uid, FelinidComponent component, DidUnequipHandEvent args) private void OnUnequipped(EntityUid uid, FelinidComponent component, DidUnequipHandEvent args)
@@ -94,8 +86,7 @@ namespace Content.Server.Abilities.Felinid
if (args.Unequipped == component.PotentialTarget) if (args.Unequipped == component.PotentialTarget)
{ {
component.PotentialTarget = null; component.PotentialTarget = null;
if (_prototypeManager.TryIndex<InstantActionPrototype>("EatMouse", out var eatMouse)) _actionsSystem.RemoveAction(uid, component.EatMouseAction);
_actionsSystem.RemoveAction(uid, eatMouse);
} }
} }
@@ -110,7 +101,7 @@ namespace Content.Server.Abilities.Felinid
} }
_popupSystem.PopupEntity(Loc.GetString("hairball-cough", ("name", Identity.Entity(uid, EntityManager))), uid); _popupSystem.PopupEntity(Loc.GetString("hairball-cough", ("name", Identity.Entity(uid, EntityManager))), uid);
SoundSystem.Play("/Audio/White/Felinid/hairball.ogg", Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.15f)); _audio.PlayPvs("/Audio/White/Felinid/hairball.ogg", uid, AudioParams.Default.WithVariation(0.15f));
EnsureComp<CoughingUpHairballComponent>(uid); EnsureComp<CoughingUpHairballComponent>(uid);
args.Handled = true; args.Handled = true;
@@ -140,18 +131,17 @@ namespace Content.Server.Abilities.Felinid
if (component.HairballAction != null) if (component.HairballAction != null)
{ {
_actionsSystem.SetCharges(component.HairballAction, component.HairballAction.Charges + 1); _actionsSystem.AddCharges(component.HairballAction, 1);
_actionsSystem.SetEnabled(component.HairballAction, true); _actionsSystem.SetEnabled(component.HairballAction, true);
} }
Del(component.PotentialTarget.Value); Del(component.PotentialTarget.Value);
component.PotentialTarget = null; component.PotentialTarget = null;
SoundSystem.Play("/Audio/Items/eatfood.ogg", Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.15f)); _audio.PlayPvs("/Audio/Items/eatfood.ogg", uid, AudioParams.Default.WithVariation(0.15f));
_hungerSystem.ModifyHunger(uid, 70f, hunger); _hungerSystem.ModifyHunger(uid, 70f, hunger);
if (_prototypeManager.TryIndex<InstantActionPrototype>("EatMouse", out var eatMouse)) _actionsSystem.RemoveAction(uid, component.EatMouseAction);
_actionsSystem.RemoveAction(uid, eatMouse);
} }
private void SpawnHairball(EntityUid uid, FelinidComponent component) private void SpawnHairball(EntityUid uid, FelinidComponent component)
@@ -159,13 +149,13 @@ namespace Content.Server.Abilities.Felinid
var hairball = EntityManager.SpawnEntity(component.HairballPrototype, Transform(uid).Coordinates); var hairball = EntityManager.SpawnEntity(component.HairballPrototype, Transform(uid).Coordinates);
var hairballComp = Comp<HairballComponent>(hairball); var hairballComp = Comp<HairballComponent>(hairball);
if (TryComp<BloodstreamComponent>(uid, out var bloodstream)) if (TryComp<BloodstreamComponent>(uid, out var bloodstream) && bloodstream.ChemicalSolution != null)
{ {
var temp = bloodstream.ChemicalSolution.SplitSolution(20); var temp = _solutionSystem.SplitSolution(bloodstream.ChemicalSolution.Value, 20);
if (_solutionSystem.TryGetSolution(hairball, hairballComp.SolutionName, out var hairballSolution)) if (_solutionSystem.TryGetSolution(hairball, hairballComp.SolutionName, out var hairballSolution))
{ {
_solutionSystem.TryAddSolution(hairball, hairballSolution, temp); _solutionSystem.TryAddSolution(hairballSolution.Value, temp);
} }
} }
} }
@@ -189,7 +179,4 @@ namespace Content.Server.Abilities.Felinid
} }
} }
} }
public sealed class HairballActionEvent : InstantActionEvent {}
public sealed class EatMouseActionEvent : InstantActionEvent {}
} }

View File

@@ -1,7 +1,7 @@
namespace Content.Server.Abilities.Felinid namespace Content.Server.Abilities.Felinid
{ {
[RegisterComponent] [RegisterComponent]
public sealed class HairballComponent : Component public sealed partial class HairballComponent : Component
{ {
public string SolutionName = "hairball"; public string SolutionName = "hairball";
} }

View File

@@ -4,7 +4,7 @@ using Content.Shared.DoAfter;
namespace Content.Shared.Carrying namespace Content.Shared.Carrying
{ {
[Serializable, NetSerializable] [Serializable, NetSerializable]
public sealed class CarryDoAfterEvent : SimpleDoAfterEvent public sealed partial class CarryDoAfterEvent : SimpleDoAfterEvent
{ {
} }
} }

View File

@@ -5,7 +5,7 @@ namespace Content.Shared.Carrying
{ {
[RegisterComponent, NetworkedComponent, Access(typeof(CarryingSlowdownSystem))] [RegisterComponent, NetworkedComponent, Access(typeof(CarryingSlowdownSystem))]
public sealed class CarryingSlowdownComponent : Component public sealed partial class CarryingSlowdownComponent : Component
{ {
[DataField("walkModifier", required: true)] [ViewVariables(VVAccess.ReadWrite)] [DataField("walkModifier", required: true)] [ViewVariables(VVAccess.ReadWrite)]
public float WalkModifier = 1.0f; public float WalkModifier = 1.0f;

View File

@@ -0,0 +1,11 @@
using Content.Shared.Actions;
namespace Content.Shared.White.Events;
public sealed partial class HairballActionEvent : InstantActionEvent
{
}
public sealed partial class EatMouseActionEvent : InstantActionEvent
{
}

View File

@@ -4,7 +4,7 @@ using Content.Shared.DoAfter;
namespace Content.Shared.Item.PseudoItem namespace Content.Shared.Item.PseudoItem
{ {
[Serializable, NetSerializable] [Serializable, NetSerializable]
public sealed class PseudoItemInsertDoAfterEvent : SimpleDoAfterEvent public sealed partial class PseudoItemInsertDoAfterEvent : SimpleDoAfterEvent
{ {
} }
} }

View File

@@ -6,6 +6,11 @@ hairball-cough = {CAPITALIZE(THE($name))} пытается выкашлять к
action-name-eat-mouse = Съесть мышь. action-name-eat-mouse = Съесть мышь.
action-description-eat-mouse = Съешьте мышь в своей руке, получая питательные вещества и заряд комка шерсти. action-description-eat-mouse = Съешьте мышь в своей руке, получая питательные вещества и заряд комка шерсти.
ent-HairballAction = Откашлять комок шерсти.
.desc = Люди это не любят.
ent-EatMouse = Съесть мышь.
.desc = Съешьте мышь в своей руке, получая питательные вещества и заряд комка шерсти.
marking-FelinidEarsBasic = Обычные ушки marking-FelinidEarsBasic = Обычные ушки
marking-FelinidEarsBasic-basic_outer = Внешняя часть уха marking-FelinidEarsBasic-basic_outer = Внешняя часть уха

View File

@@ -1,4 +1,4 @@
- type: entity - type: entity
name: Engineer loot spawner name: Engineer loot spawner
id: EngiLootSpawner id: EngiLootSpawner
parent: MarkerBase parent: MarkerBase
@@ -59,7 +59,7 @@
layers: layers:
- state: red - state: red
- sprite: Objects/Specific/Janitorial/soap.rsi - sprite: Objects/Specific/Janitorial/soap.rsi
state: omega state: omega-4
- type: RandomSpawner - type: RandomSpawner
rarePrototypes: rarePrototypes:
- FoamBlade - FoamBlade

View File

@@ -31,9 +31,6 @@
- type: CameraRecoil - type: CameraRecoil
- type: Examiner - type: Examiner
- type: CanHostGuardian - type: CanHostGuardian
- type: Faction
factions:
- NanoTrasen
- type: Felinid #since this just adds an action... - type: Felinid #since this just adds an action...
- type: InteractionPopup - type: InteractionPopup
successChance: 1 successChance: 1

View File

@@ -115,12 +115,6 @@
types: types:
Blunt: 1 Blunt: 1
Slash: 5 Slash: 5
- type: DiseaseCarrier
naturalImmunities:
- OwOnavirus
- type: Thieving
stealthy: true
stripTimeReduction: 1
- type: Speech - type: Speech
speechSounds: Alto speechSounds: Alto
- type: DamageOnHighSpeedImpact - type: DamageOnHighSpeedImpact

View File

@@ -1,14 +1,23 @@
- type: instantAction - type: entity
id: EatMouse id: EatMouse
name: action-name-eat-mouse name: Eat mouse
description: action-description-eat-mouse description: Eat the mouse in your hand, receiving nutrients and a hairball charge.
nospawn: true
components:
- type: InstantAction
icon: White/Icons/verbiconfangs.png icon: White/Icons/verbiconfangs.png
serverEvent: !type:EatMouseActionEvent event: !type:EatMouseActionEvent
- type: instantAction - type: entity
id: HairballAction id: HairballAction
name: hairball-action name: Cough up a hairball.
description: hairball-action-desc description: People don't like that.
nospawn: true
components:
- type: InstantAction
icon:
sprite: White/Specific/Species/felinid.rsi
state: icon
event: !type:HairballActionEvent
charges: 1 charges: 1
useDelay: 30 useDelay: 30
serverEvent: !type:HairballActionEvent