Skip to content
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

Closed
wants to merge 20 commits into from
Closed
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions Content.Client/Aliens/JumpVisualsComponent.cs
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...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary needed

/// </summary>
[RegisterComponent]
public sealed partial class JumpVisualsComponent : Component
{

}

public enum JumpLayers : byte
{
Jumping
}
43 changes: 43 additions & 0 deletions Content.Client/Aliens/Systems/AlienSystem.cs
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...
Copy link
Member

Choose a reason for hiding this comment

The 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)
Copy link
Member

Choose a reason for hiding this comment

The 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);
}
}
13 changes: 13 additions & 0 deletions Content.Client/Aliens/Systems/PlasmaVesselSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Content.Client.Aliens.Systems;

/// <summary>
/// This handles...
Copy link
Member

Choose a reason for hiding this comment

The 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()
{

}
}
6 changes: 5 additions & 1 deletion Content.Client/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,15 @@ public void SendMessage(string text, ChatSelectChannel channel)
_consoleHost.ExecuteCommand($"tsay \"{CommandParsing.Escape(str)}\"");
break;

case ChatSelectChannel.XenoHivemind:
_consoleHost.ExecuteCommand($"aliensay \"{CommandParsing.Escape(str)}\"");
break;

default:
throw new ArgumentOutOfRangeException(nameof(channel), channel, null);
}
}
//Nyano - Summary: fires off the update permissions script.
//Nyano - Summary: fires off the update permissions script.
public void UpdatePermissions()
{
PermissionsUpdated?.Invoke();
Expand Down
40 changes: 40 additions & 0 deletions Content.Client/Overlays/ShowInfectedIconsSystem.cs
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...
Copy link
Member

Choose a reason for hiding this comment

The 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);
}

}
}
14 changes: 12 additions & 2 deletions Content.Client/UserInterface/Systems/Chat/ChatUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ public sealed class ChatUIController : UIController
{SharedChatSystem.AdminPrefix, ChatSelectChannel.Admin},
{SharedChatSystem.RadioCommonPrefix, ChatSelectChannel.Radio},
{SharedChatSystem.DeadPrefix, ChatSelectChannel.Dead},
{SharedChatSystem.TelepathicPrefix, ChatSelectChannel.Telepathic} //Nyano - Summary: adds the telepathic prefix =.
{SharedChatSystem.TelepathicPrefix, ChatSelectChannel.Telepathic}, //Nyano - Summary: adds the telepathic prefix =.
{SharedChatSystem.XenoHivemindPrefix, ChatSelectChannel.XenoHivemind}
};

public static readonly Dictionary<ChatSelectChannel, char> ChannelPrefixes = new()
Expand All @@ -96,7 +97,8 @@ public sealed class ChatUIController : UIController
{ChatSelectChannel.Admin, SharedChatSystem.AdminPrefix},
{ChatSelectChannel.Radio, SharedChatSystem.RadioCommonPrefix},
{ChatSelectChannel.Dead, SharedChatSystem.DeadPrefix},
{ChatSelectChannel.Telepathic, SharedChatSystem.TelepathicPrefix } //Nyano - Summary: associates telepathic with =.
{ChatSelectChannel.Telepathic, SharedChatSystem.TelepathicPrefix }, //Nyano - Summary: associates telepathic with =.
{ChatSelectChannel.XenoHivemind, SharedChatSystem.XenoHivemindPrefix }
};

/// <summary>
Expand Down Expand Up @@ -221,6 +223,9 @@ public override void Initialize()
_input.SetInputCommand(ContentKeyFunctions.FocusConsoleChat,
InputCmdHandler.FromDelegate(_ => FocusChannel(ChatSelectChannel.Console)));

_input.SetInputCommand(ContentKeyFunctions.FocusXenoHivemindChat,
InputCmdHandler.FromDelegate(_ => FocusChannel(ChatSelectChannel.XenoHivemind)));

_input.SetInputCommand(ContentKeyFunctions.CycleChatChannelForward,
InputCmdHandler.FromDelegate(_ => CycleChatChannel(true)));

Expand Down Expand Up @@ -499,6 +504,7 @@ private void UpdateChannelPermissions()
FilterableChannels |= ChatChannel.Emotes;
FilterableChannels |= ChatChannel.Notifications;


// Can only send local / radio / emote when attached to a non-ghost entity.
// TODO: this logic is iffy (checking if controlling something that's NOT a ghost), is there a better way to check this?
if (_ghost is not {IsGhost: true})
Expand All @@ -507,6 +513,9 @@ private void UpdateChannelPermissions()
CanSendChannels |= ChatSelectChannel.Whisper;
CanSendChannels |= ChatSelectChannel.Radio;
CanSendChannels |= ChatSelectChannel.Emotes;

CanSendChannels |= ChatSelectChannel.XenoHivemind;
FilterableChannels |= ChatChannel.XenoHivemind;
}
}

Expand Down Expand Up @@ -535,6 +544,7 @@ private void UpdateChannelPermissions()
}
// /Nyano - End modified code block


SelectableChannels = CanSendChannels;

// Necessary so that we always have a channel to fall back to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public sealed partial class ChannelFilterPopup : Popup
ChatChannel.Admin,
ChatChannel.AdminAlert,
ChatChannel.AdminChat,
ChatChannel.XenoHivemind,
ChatChannel.Server
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public Color ChannelSelectColor(ChatSelectChannel channel)
ChatSelectChannel.OOC => Color.LightSkyBlue,
ChatSelectChannel.Dead => Color.MediumPurple,
ChatSelectChannel.Admin => Color.HotPink,
ChatSelectChannel.Telepathic => Color.PaleVioletRed, //Nyano - Summary: determines the color for the chat.
ChatSelectChannel.Telepathic => Color.PaleVioletRed, //Nyano - Summary: determines the color for the chat.
ChatSelectChannel.XenoHivemind => Color.FromHex("#5b0c82"),
_ => Color.DarkGray
};
}
Expand Down
14 changes: 14 additions & 0 deletions Content.Server/Aliens/Components/AlienAcidComponent.cs
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...
Copy link
Member

Choose a reason for hiding this comment

The 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";
}
17 changes: 17 additions & 0 deletions Content.Server/Aliens/Components/AlienEggHatchComponent.cs
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...
Copy link
Member

Choose a reason for hiding this comment

The 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;
}
25 changes: 25 additions & 0 deletions Content.Server/Aliens/Components/QueenEvolutionComponent.cs
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...
Copy link
Member

Choose a reason for hiding this comment

The 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;
}
36 changes: 36 additions & 0 deletions Content.Server/Aliens/Systems/AlienAcidSystem.cs
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...
Copy link
Member

Choose a reason for hiding this comment

The 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());
}
}
}
}
51 changes: 51 additions & 0 deletions Content.Server/Aliens/Systems/AlienEggHatchSystem.cs
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...
Copy link
Member

Choose a reason for hiding this comment

The 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);
}
}
}
}
Loading
Loading