Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rxup committed Dec 13, 2024
1 parent 22f2b63 commit 9900b29
Show file tree
Hide file tree
Showing 19 changed files with 263 additions and 18 deletions.
10 changes: 10 additions & 0 deletions Content.Client/Backmen/FootPrint/FootPrintsVisualizerSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Shared.Backmen.FootPrint;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.GameStates;
using Robust.Shared.Random;
using Robust.Shared.Utility;

Expand All @@ -17,6 +18,15 @@ public override void Initialize()

SubscribeLocalEvent<FootPrintComponent, ComponentInit>(OnInitialized);
SubscribeLocalEvent<FootPrintComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<FootPrintComponent, ComponentHandleState>(OnHandleState);
}

private void OnHandleState(Entity<FootPrintComponent> ent, ref ComponentHandleState args)
{
if (args.Current is not FootPrintState state || !TryGetEntity(state.PrintOwner, out var entity))
return;

ent.Comp.PrintOwner = entity.Value;
}

private void OnInitialized(EntityUid uid, FootPrintComponent comp, ComponentInit args)
Expand Down
11 changes: 9 additions & 2 deletions Content.Server/Backmen/FootPrint/FootPrintsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Gravity;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Random;

Expand Down Expand Up @@ -39,9 +40,15 @@ public override void Initialize()

SubscribeLocalEvent<FootPrintsComponent, ComponentStartup>(OnStartupComponent);
SubscribeLocalEvent<FootPrintsComponent, MoveEvent>(OnMove);
SubscribeLocalEvent<FootPrintComponent, ComponentGetState>(OnGetState);
}

private void OnStartupComponent(EntityUid uid, FootPrintsComponent comp, ComponentStartup args)
private void OnGetState(Entity<FootPrintComponent> ent, ref ComponentGetState args)
{
args.State = new FootPrintState(TerminatingOrDeleted(ent.Comp.PrintOwner) ? NetEntity.Invalid : GetNetEntity(ent.Comp.PrintOwner));
}

private void OnStartupComponent(EntityUid uid, FootPrintsComponent comp, ComponentStartup args)
{
comp.StepSize += _random.NextFloat(-0.05f, 0.05f);
}
Expand All @@ -52,7 +59,7 @@ private void OnMove(EntityUid uid, FootPrintsComponent comp, ref MoveEvent args)
if (comp.PrintsColor.A <= 0f)
return;

if (!_transformQuery.TryComp(uid, out var transform))
if (TerminatingOrDeleted(uid) || !_transformQuery.TryComp(uid, out var transform))
return;

if (_gravity.IsWeightless(uid, xform: transform))
Expand Down
19 changes: 14 additions & 5 deletions Content.Server/Backmen/FootPrint/PuddleFootPrintsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,28 @@ public sealed class PuddleFootPrintsSystem : EntitySystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
private EntityQuery<AppearanceComponent> _appearanceQuery;
private EntityQuery<PuddleComponent> _puddleQuery;
private EntityQuery<FootPrintsComponent> _footPrintsQuery;
private EntityQuery<SolutionContainerManagerComponent> _solutionContainerManageQuery;

public override void Initialize()
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PuddleFootPrintsComponent, EndCollideEvent>(OnStepTrigger);

_appearanceQuery = GetEntityQuery<AppearanceComponent>();
_puddleQuery = GetEntityQuery<PuddleComponent>();
_footPrintsQuery = GetEntityQuery<FootPrintsComponent>();
_solutionContainerManageQuery = GetEntityQuery<SolutionContainerManagerComponent>();
}

private void OnStepTrigger(EntityUid uid, PuddleFootPrintsComponent comp, ref EndCollideEvent args)
{
if (!TryComp<AppearanceComponent>(uid, out var appearance) ||
!TryComp<PuddleComponent>(uid, out var puddle) ||
!TryComp<FootPrintsComponent>(args.OtherEntity, out var tripper) ||
!TryComp<SolutionContainerManagerComponent>(uid, out var solutionManager))
if (!_appearanceQuery.TryComp(uid, out var appearance) ||
!_puddleQuery.TryComp(uid, out var puddle) ||
!_footPrintsQuery.TryComp(args.OtherEntity, out var tripper) ||
!_solutionContainerManageQuery.TryComp(uid, out var solutionManager))
{
return;
}
Expand Down
7 changes: 7 additions & 0 deletions Content.Server/Backmen/Xeno/Components/XenoAgentComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Content.Server.Backmen.Xeno.Components;

[RegisterComponent]
public sealed partial class XenoAgentComponent : Component
{

}
9 changes: 9 additions & 0 deletions Content.Server/Backmen/Xeno/Roles/XenoAgentRoleComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Content.Shared.Roles;

namespace Content.Server.Backmen.Blob.Roles;

[RegisterComponent]
public sealed partial class XenoAgentRoleComponent : BaseMindRoleComponent
{

}
32 changes: 32 additions & 0 deletions Content.Server/Backmen/Xeno/XenoAgentSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Content.Server.Backmen.Language;
using Content.Server.Backmen.Language.Events;
using Content.Server.Backmen.Xeno.Components;
using Content.Shared.Backmen.Language;

namespace Content.Server.Backmen.Xeno;

public sealed class XenoAgentSystem : EntitySystem
{
[Dependency] private readonly LanguageSystem _language = default!;
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<XenoAgentComponent, MapInitEvent>(OnInit);
SubscribeLocalEvent<XenoAgentComponent, DetermineEntityLanguagesEvent>(OnApplyLanguages);
}

[ValidatePrototypeId<LanguagePrototype>]
private const string XenoLanguage = "Xeno";

private void OnApplyLanguages(Entity<XenoAgentComponent> ent, ref DetermineEntityLanguagesEvent args)
{
args.SpokenLanguages.Add(XenoLanguage);
args.UnderstoodLanguages.Add(XenoLanguage);
}

private void OnInit(Entity<XenoAgentComponent> ent, ref MapInitEvent args)
{
_language.UpdateEntityLanguages(ent.Owner);
}
}
6 changes: 4 additions & 2 deletions Content.Server/StationEvents/Events/MeteorSwarmSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Linq;
using System.Numerics;
using Content.Server.Chat.Systems;
using Content.Server.GameTicking.Rules;
Expand Down Expand Up @@ -44,11 +45,12 @@ protected override void ActiveTick(EntityUid uid, MeteorSwarmComponent component

component.NextWaveTime += TimeSpan.FromSeconds(component.WaveCooldown.Next(RobustRandom));

var stations = _station.GetStations().Where(HasComp<StationEventEligibleComponent>).ToList();

if (_station.GetStations().Count == 0)
if (stations.Count == 0)
return;

var station = RobustRandom.Pick(_station.GetStations());
var station = RobustRandom.Pick(stations); // backmen: centcomm
if (_station.GetLargestGrid(Comp<StationDataComponent>(station)) is not { } grid)
return;

Expand Down
4 changes: 2 additions & 2 deletions Content.Shared/Backmen/FootPrint/FootPrintComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ namespace Content.Shared.Backmen.FootPrint;
/// <summary>
/// This is used for marking footsteps, handling footprint drawing.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[RegisterComponent, NetworkedComponent]
public sealed partial class FootPrintComponent : Component
{
/// <summary>
/// Owner (with <see cref="FootPrintsComponent"/>) of a print (this component).
/// </summary>
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
[ViewVariables(VVAccess.ReadWrite)]
public EntityUid PrintOwner;

[DataField("solution")] public string SolutionName = "step";
Expand Down
9 changes: 9 additions & 0 deletions Content.Shared/Backmen/FootPrint/FootPrintState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Robust.Shared.Serialization;

namespace Content.Shared.Backmen.FootPrint;

[Serializable, NetSerializable]
public sealed class FootPrintState(NetEntity netEntity) : ComponentState
{
public NetEntity PrintOwner { get; private set; } = netEntity;
}
5 changes: 3 additions & 2 deletions Content.Shared/Backmen/FootPrint/FootPrintsComponent.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

namespace Content.Shared.Backmen.FootPrint;

[RegisterComponent]
[RegisterComponent, NetworkedComponent]
public sealed partial class FootPrintsComponent : Component
{
[ViewVariables(VVAccess.ReadOnly), DataField("path")]
Expand Down Expand Up @@ -36,7 +37,7 @@ public sealed partial class FootPrintsComponent : Component

[ViewVariables(VVAccess.ReadOnly), DataField("protoId")]
public EntProtoId<FootPrintComponent> StepProtoId = "Footstep";

[ViewVariables(VVAccess.ReadWrite), DataField]
public Vector2 OffsetPrint = new(0.1f, 0f);

Expand Down
7 changes: 5 additions & 2 deletions Resources/Locale/ru-RU/backmen/reagents/toxins.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ reagent-desc-lotophagoi-oil = Сверхсильный наркотик, кот
reagent-name-bloodsucker-toxin = вампирский вирус
reagent-desc-bloodsucker-toxin = Многие называют это лекарством от старости, его состав говорит о том что он относится к классу токсинов и вызывает множество негативных мутаций.
reagent-name-slerm = слерма ксено
reagent-desc-slerm = Самая мерзкая жидкость в галактике, которая при попадании на кожу вызывает сильные мутации.
reagent-name-slerm = слерм
reagent-desc-slerm = Вкуснейший напиток в галактике
reagent-name-slerm-queen = слерм королевский
reagent-desc-slerm-queen = Вкуснейший деликатес! Секретный ингредиент который не так просто получить!
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
snap:
- Wall
components:
- type: MobThresholds
thresholds:
0: Alive
currentThresholdState: Alive
showOverlays: false
- type: MobState
- type: ZombieImmune
- type: StatusEffects
allowed:
Expand Down
12 changes: 11 additions & 1 deletion Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/xeno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,19 @@
state: running
noRot: true
netsync: false
- type: SolutionContainerManager
solutions:
udder:
maxVol: 250
reagents:
- ReagentId: Slerm
Quantity: 30
- type: Udder
reagentId: Slerm
quantityPerUpdate: 25
growthDelay: 30
- type: Clickable
- type: InteractionOutline
- type: SolutionContainerManager
- type: AtmosExposed
- type: MobThresholds
thresholds:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
- type: MovementSpeedModifier
baseWalkSpeed: 2.5
baseSprintSpeed: 5.0
- type: FootPrints

- type: entity
save: false
Expand Down
33 changes: 33 additions & 0 deletions Resources/Prototypes/_Backmen/GameRules/roundstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
max: 2
playerRatio: 40 #players = 2 blobs
allowNonHumans: true
components:
- type: BlobCarrier
blacklist:
components:
- AntagImmune
Expand Down Expand Up @@ -291,3 +293,34 @@
components:
- type: GameRule
- type: BabelTowerRule

#xeno
- type: entity
id: XenoAgentGameMode
parent: BaseGameRule
categories: [ HideSpawnMenu ]
components:
- type: GameRule
minPlayers: 15
#delay: # 7-10 minutes
# min: 420
# max: 600
- type: AntagSelection
definitions:
- prefRoles: [ XenoAgent ]
min: 1
max: 2
playerRatio: 40 #players = 2 blobs
allowNonHumans: true
components:
- type: XenoAgent
- type: NpcFactionMember
factions:
- Xeno
- NanoTrasen
- type: XenoAcidSpiller
blacklist:
components:
- AntagImmune
mindRoles:
- MindRoleXenoAgent
73 changes: 71 additions & 2 deletions Resources/Prototypes/_Backmen/Reagents/toxins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
# Xeno maid liquid real
- type: reagent
id: SlermQueenPlus
name: reagent-name-slerm
name: reagent-name-slerm-queen
group: Toxins
desc: reagent-desc-slerm
desc: reagent-desc-slerm-queen
physicalDesc: reagent-physical-desc-bubbling
flavor: bitter
color: "#b428c9"
Expand Down Expand Up @@ -55,4 +55,73 @@
min: 5
causeChance: 0.3
disease: XenoMaidVirus
- !type:GenericStatusEffect
key: SeeingRainbows
component: SeeingRainbows
type: Add
time: 5
refresh: false
- !type:ChemAddMoodlet
moodPrototype: SpaceDrugsBenefit
conditions:
- !type:ReagentThreshold
reagent: Slerm
min: 6
# end-backmen: Disease

- type: reagent
id: Slerm
name: reagent-name-slerm
group: Narcotics
desc: reagent-desc-slerm
physicalDesc: reagent-physical-desc-bubbling
flavor: soda
color: "#b428c9"
metabolisms:
Narcotic:
effects:
- !type:GenericStatusEffect
key: SeeingRainbows
component: SeeingRainbows
type: Add
time: 5
refresh: false
- !type:ChemAddMoodlet
moodPrototype: SpaceDrugsBenefit
conditions:
- !type:ReagentThreshold
reagent: Slerm
min: 6
# end-backmen: Disease

- type: entity
parent: DrinkGlass
id: DrinkSlermGlass
suffix: Slerm
components:
- type: SolutionContainerManager
solutions:
drink:
maxVol: 30
reagents:
- ReagentId: Slerm
Quantity: 30
- type: Icon
sprite: Objects/Consumable/Drinks/gsodaglass.rsi
state: icon

- type: entity
parent: DrinkGlass
id: DrinkSlermPlusGlass
suffix: Slerm Plus
components:
- type: SolutionContainerManager
solutions:
drink:
maxVol: 30
reagents:
- ReagentId: SlermQueenPlus
Quantity: 30
- type: Icon
sprite: Objects/Consumable/Drinks/gsodaglass.rsi
state: icon
Loading

0 comments on commit 9900b29

Please sign in to comment.