Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Sh1ntra elzuos #362

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Content.Server/Corvax/AutoDeleteItems/AutoDeleteSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override void Update(float frameTime)
{
return;
}

if (autoDeleteComponent.NextTimeToCheck > _gameTiming.CurTime)
return;

Expand All @@ -47,12 +47,12 @@ public override void Update(float frameTime)
{
autoDeleteComponent.IsSSDNear = false;
}

if (iterator.Owner == uid)
continue;

var humanoids = new HashSet<Entity<HumanoidAppearanceComponent>>();

_lookup.GetEntitiesInRange(xform.Coordinates, autoDeleteComponent.DistanceToCheck, humanoids);

if (humanoids.Count > 0 && !autoDeleteComponent.IsSSDNear)
Expand Down
20 changes: 20 additions & 0 deletions Content.Server/Corvax/Elzuosa/ElzuosaColorComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Robust.Shared.Audio;

namespace Content.Server.Corvax.Elzuosa
{
[RegisterComponent]
public sealed partial class ElzuosaColorComponent : Component
{
public Color SkinColor { get; set; }

public bool Hacked { get; set; } = false;

[DataField("cycleRate")]
public float CycleRate = 1f;
}
}
37 changes: 37 additions & 0 deletions Content.Server/Corvax/Elzuosa/ElzuosaColorSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Content.Shared.Humanoid;
using Content.Shared.Preferences;
using Robust.Server.GameObjects;
using Content.Server.GameTicking;
namespace Content.Server.Corvax.Elzuosa
{
public sealed class ElzuosaColorSystem : EntitySystem
{
[Dependency] private readonly PointLightSystem _pointLightSystem = default!;
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<ElzuosaColorComponent, PlayerSpawnCompleteEvent>(OnPlayerSpawn);
}

private void OnPlayerSpawn(EntityUid uid, ElzuosaColorComponent comp, PlayerSpawnCompleteEvent args)
{
if (!HasComp<HumanoidAppearanceComponent>(uid))
return;
if (args == null)
return;
var profile = args.Profile;
SetEntityPointLightColor(uid, profile);
}

public void SetEntityPointLightColor(EntityUid uid, HumanoidCharacterProfile? profile)
{
if (profile == null)
return;

var color = profile.Appearance.SkinColor;
_pointLightSystem.SetColor(uid,color);

}
}
}
2 changes: 2 additions & 0 deletions Resources/Prototypes/Corvax/Entities/Mobs/Species/elzuosa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: Urist McElzuosa
abstract: true
components:
- type: ElzuosaColor
- type: Hunger # Corvax-Frontier
starvationDamage:
types:
Expand Down Expand Up @@ -42,6 +43,7 @@
- type: PointLight
enabled: true
radius: 2
cycleRate: 0.01
- type: InteractionPopup
successChance: 1
interactSuccessString: pat-success-elzuosa
Expand Down
Loading