-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Benos #413
Benos #413
Changes from all commits
895464d
5ade4b8
52b106d
12e97e9
a14e56c
42f01d1
e74ab1c
0eeb868
e5df433
2d0ddfe
c55e06a
f473692
84f4cc6
683b136
362c17b
e48570b
3eef5a8
efe5290
386bb27
5b85df8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Robust.Client.Graphics; | ||
|
||
namespace Content.Client.Aliens; | ||
|
||
/// <summary> | ||
/// This is used for... | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class JumpVisualsComponent : Component | ||
{ | ||
|
||
} | ||
|
||
public enum JumpLayers : byte | ||
{ | ||
Jumping | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Content.Client.Movement.Systems; | ||
using Content.Shared.Actions; | ||
using Content.Shared.Aliens.Components; | ||
using ToggleLightingAlienActionEvent = Content.Shared.Aliens.Components.ToggleLightingAlienActionEvent; | ||
|
||
namespace Content.Client.Aliens.Systems; | ||
|
||
/// <summary> | ||
/// This handles... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Summary Needed |
||
/// </summary> | ||
public sealed class AlienSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ContentEyeSystem _contentEye = default!; | ||
/// <inheritdoc/> | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<AlienComponent, ComponentStartup>(OnStartup); | ||
|
||
SubscribeLocalEvent<EyeComponent, ToggleLightingAlienActionEvent>(OnToggleLighting); | ||
} | ||
|
||
private void OnStartup(EntityUid uid, AlienComponent component, ComponentStartup args) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is not used at all, is it needed? |
||
{ | ||
// _action.AddAction(uid, ref component.ToggleLightingActionEntity, component.ToggleLightingAction); | ||
} | ||
|
||
private void OnToggleLighting(EntityUid uid, EyeComponent component, ToggleLightingAlienActionEvent args) | ||
{ | ||
if (args.Handled) | ||
return; | ||
|
||
RequestToggleLight(uid, component); | ||
args.Handled = true; | ||
} | ||
|
||
private void RequestToggleLight(EntityUid uid, EyeComponent? eye = null) | ||
{ | ||
if (Resolve(uid, ref eye, false)) | ||
_contentEye.RequestEye(eye.DrawFov, !eye.DrawLight); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Content.Client.Aliens.Systems; | ||
|
||
/// <summary> | ||
/// This handles... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Summary Needed Also is this... System... used for anything? |
||
/// </summary> | ||
public sealed class PlasmaVesselSystem : EntitySystem | ||
{ | ||
/// <inheritdoc/> | ||
public override void Initialize() | ||
{ | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.Linq; | ||
using Content.Shared.Aliens.Components; | ||
using Content.Shared.Mobs; | ||
using Content.Shared.StatusIcon; | ||
using Content.Shared.StatusIcon.Components; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client.Overlays; | ||
|
||
/// <summary> | ||
/// This handles... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Summary Needed |
||
/// </summary> | ||
public sealed class ShowInfectedIconsSystem : EquipmentHudSystem<ShowInfectedIconsComponent> | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototype = default!; | ||
/// <inheritdoc/> | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<AlienInfectedComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent); | ||
} | ||
|
||
private void OnGetStatusIconsEvent(EntityUid uid, AlienInfectedComponent component, ref GetStatusIconsEvent ev) | ||
{ | ||
if (!IsActive) | ||
return; | ||
if (component.GrowthStage <= 5) | ||
{ | ||
if (_prototype.TryIndex(component.InfectedIcons.ElementAt(component.GrowthStage), out var iconPrototype)) | ||
ev.StatusIcons.Add(iconPrototype); | ||
} | ||
else | ||
{ | ||
if (_prototype.TryIndex(component.InfectedIcons.ElementAt(5), out var iconPrototype)) | ||
ev.StatusIcons.Add(iconPrototype); | ||
} | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
|
||
namespace Content.Server.Aliens.Components; | ||
|
||
/// <summary> | ||
/// This is used for... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Summary Needed |
||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class AlienAcidComponent : Component | ||
{ | ||
[DataField("corrosiveAcidPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] | ||
public string AcidPrototype = "CorrosiveAcid"; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Content.Shared.Polymorph; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Aliens.Components; | ||
|
||
/// <summary> | ||
/// This is used for... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Summary Needed |
||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class AlienEggHatchComponent : Component | ||
{ | ||
[DataField(required: true)] | ||
public ProtoId<PolymorphPrototype> PolymorphPrototype; | ||
|
||
[DataField] | ||
public float ActivationRange = 1f; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Content.Shared.Polymorph; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
|
||
namespace Content.Server.Aliens.Components; | ||
|
||
/// <summary> | ||
/// This is used for... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Summary Needed |
||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class QueenEvolutionComponent : Component | ||
{ | ||
[DataField] | ||
public ProtoId<PolymorphPrototype> QueenPolymorphPrototype = "AlienEvolutionQueen"; | ||
|
||
[DataField("queenEvolutionAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] | ||
public string? QueenEvolutionAction = "ActionEvolveQueen"; | ||
|
||
[DataField("queenEvolutionActionEntity")] | ||
public EntityUid? QueenEvolutionActionEntity; | ||
|
||
[DataField("plasmaCost")] | ||
[ViewVariables(VVAccess.ReadWrite)] | ||
public float PlasmaCost = 500f; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Content.Server.Aliens.Components; | ||
using Content.Server.Weapons.Melee; | ||
using Content.Shared.Aliens.Components; | ||
using Content.Shared.Coordinates; | ||
using Content.Shared.Mobs; | ||
using Content.Shared.Mobs.Components; | ||
using Content.Shared.Tag; | ||
using Content.Shared.Weapons.Melee; | ||
using Content.Shared.Weapons.Melee.Events; | ||
|
||
namespace Content.Server.Aliens.Systems; | ||
|
||
/// <summary> | ||
/// This handles... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Summary Needed |
||
/// </summary> | ||
public sealed class AlienAcidSystem : EntitySystem | ||
{ | ||
/// <inheritdoc/> | ||
[Dependency] private readonly MeleeWeaponSystem _meleeWeapon = default!; | ||
[Dependency] private readonly TagSystem _tag = default!; | ||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<AlienAcidComponent, MeleeHitEvent>(OnHit); | ||
} | ||
|
||
private void OnHit(EntityUid uid, AlienAcidComponent component, MeleeHitEvent args) | ||
{ | ||
foreach (var hitEntity in args.HitEntities) | ||
{ | ||
if (_tag.HasTag(hitEntity, "Wall")) | ||
{ | ||
Spawn(component.AcidPrototype, hitEntity.ToCoordinates()); | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Linq; | ||
using Content.Server.Aliens.Components; | ||
using Content.Server.Polymorph.Systems; | ||
using Content.Server.Speech.Components; | ||
using Content.Shared.Aliens.Components; | ||
using Content.Shared.Hands.Components; | ||
using Content.Shared.Humanoid; | ||
using Content.Shared.Interaction; | ||
using Content.Shared.Inventory; | ||
using Content.Shared.Mobs.Components; | ||
using Robust.Server.GameObjects; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Server.Aliens.Systems; | ||
|
||
/// <summary> | ||
/// This handles... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Summary Needed |
||
/// </summary> | ||
public sealed class AlienEggHatchSystem : EntitySystem | ||
{ | ||
/// <inheritdoc/> | ||
[Dependency] private readonly PolymorphSystem _polymorph = default!; | ||
[Dependency] private readonly EntityLookupSystem _lookup = default!; | ||
[Dependency] private readonly InventorySystem _inventory = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<AlienEggHatchComponent, InteractHandEvent>(OnInteract); | ||
} | ||
|
||
private void OnInteract(EntityUid uid, AlienEggHatchComponent component, InteractHandEvent args) | ||
{ | ||
_polymorph.PolymorphEntity(uid, component.PolymorphPrototype); | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
var query = EntityQueryEnumerator<AlienEggHatchComponent>(); | ||
while (query.MoveNext(out var uid, out var alienEgg)) | ||
{ | ||
foreach (var entity in _lookup.GetEntitiesInRange(uid, alienEgg.ActivationRange) | ||
.Where(entity => _inventory.HasSlot(entity, "mask"))) | ||
{ | ||
_polymorph.PolymorphEntity(uid, alienEgg.PolymorphPrototype); | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary needed