-
Notifications
You must be signed in to change notification settings - Fork 399
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
Add space ferrets as a midround event #1045
Closed
NullWanderer
wants to merge
44
commits into
DeltaV-Station:master
from
NullWanderer:2024/04/01-Slugcats
Closed
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
f341a4a
Skug brainrot wawa rain world backflip cat (#26168)
FairlySadPanda 07c6750
Quick hotfix since panda is screaming at me in vc
VasilisThePikachu 524b1bc
Skug
NullWanderer 2588150
Unrot the brain
NullWanderer ddd1218
Its just spaceferret now
NullWanderer c039441
Wawa!
NullWanderer 95d664d
Wawa?
NullWanderer d56e2df
Deshitter the species part 1
NullWanderer d11b4d7
Separate out upstream changes
NullWanderer 9b6c8c2
Remove csproj brainrot
NullWanderer 4219094
Finally cut everything out into separate files
NullWanderer f8779fc
Wawa...
NullWanderer ab0245f
Localized wawa
NullWanderer be49ffc
Am kinda dum
NullWanderer 04d6d28
Event
NullWanderer f38f97b
Wawa
NullWanderer b196164
Hopefully the final wa
NullWanderer 4ddea05
He do flip tho
NullWanderer a0a494e
Brainrot
NullWanderer 2305f30
Fix inventory
NullWanderer 28025c9
Objective
NullWanderer 8457d90
Whoops!
NullWanderer 2f4ee71
Name
NullWanderer 7bf955e
100 nutrients instead of 300, should make them slightly less shit
NullWanderer 353057c
No more ID card
NullWanderer 1904830
Remove ability to wear a headset
NullWanderer 0865d08
No more nom, no more nyoom
NullWanderer 993ddf7
Play time requirement
NullWanderer 36000ff
Rule changes
NullWanderer 56b4138
Merge branch 'master' into 2024/04/01-Slugcats
NullWanderer 2345cd6
Actually commit the hunger change
NullWanderer c176c31
Merge remote-tracking branch 'origin/2024/04/01-Slugcats' into 2024/0…
NullWanderer 577b6cd
Remove last LDSF mentions and replace them with just space ferret. No…
NullWanderer eda1502
Add notes for core modifications
NullWanderer 32d8f2b
Backflip event cleanup
NullWanderer 18215a2
Purge last LDSF mentions
NullWanderer 7bb068b
Put objective localization in the prototype
NullWanderer 301fca8
CanHibernate changes, may need to come back to this one...
NullWanderer f104fef
Wawa!
NullWanderer 6ac2aec
The brainrot is getting to me
NullWanderer 48d02ce
Misc changes
NullWanderer 7b50156
Revert Content.Shared.csproj changes
NullWanderer 6a9ea44
I think I need eepy irl
NullWanderer 3a0722a
Merge branch 'master' into 2024/04/01-Slugcats
A-z-z-y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using Content.Shared.DeltaV.SpaceFerret; | ||
using Content.Shared.DeltaV.SpaceFerret.Events; | ||
using Robust.Client.Animations; | ||
using Robust.Client.Audio; | ||
using Robust.Client.GameObjects; | ||
using Robust.Shared.Animations; | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Player; | ||
|
||
namespace Content.Client.DeltaV.SpaceFerret; | ||
|
||
public sealed class CanBackflipSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly AnimationPlayerSystem _animation = default!; | ||
[Dependency] private readonly AudioSystem _audio = default!; | ||
|
||
public const string BackflipKey = "backflip"; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeNetworkEvent<DoABackFlipEvent>(OnBackflipEvent); | ||
} | ||
|
||
public void OnBackflipEvent(DoABackFlipEvent args) | ||
{ | ||
if (!TryGetEntity(args.Actioner, out var uid) || !TryComp<CanBackflipComponent>(uid, out var comp)) | ||
{ | ||
return; | ||
} | ||
|
||
_animation.Play(uid.Value, new Animation | ||
{ | ||
Length = TimeSpan.FromSeconds(0.66), | ||
AnimationTracks = | ||
{ | ||
new AnimationTrackComponentProperty() | ||
{ | ||
ComponentType = typeof(SpriteComponent), | ||
Property = nameof(SpriteComponent.Rotation), | ||
InterpolationMode = AnimationInterpolationMode.Linear, | ||
KeyFrames = | ||
{ | ||
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(0), 0f), | ||
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(180), 0.33f), | ||
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(360), 0.33f), | ||
} | ||
} | ||
} | ||
}, BackflipKey); | ||
|
||
_audio.PlayPvs(comp.ClappaSfx, uid.Value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Content.Client.DamageState; | ||
using Content.Shared.DeltaV.SpaceFerret; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client.DeltaV.SpaceFerret; | ||
|
||
public sealed class CanHibernateSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeNetworkEvent<EntityHasHibernated>(OnHibernateEvent); | ||
} | ||
|
||
public void OnHibernateEvent(EntityHasHibernated args) | ||
{ | ||
if (!TryGetEntity(args.Hibernator, out var uid) | !TryComp<CanHibernateComponent>(uid, out var comp)) | ||
return; | ||
|
||
if (!TryComp<SpriteComponent>(uid, out var sprite)) | ||
return; | ||
|
||
if (!sprite.TryGetLayer((int) DamageStateVisualLayers.Base, out var layer)) | ||
return; | ||
|
||
layer.SetState(comp!.SpriteStateId); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Content.Server/DeltaV/SpaceFerret/Components/SpaceFerretRoleComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using Content.Server.DeltaV.SpaceFerret.Systems; | ||
using Content.Shared.Roles; | ||
|
||
namespace Content.Server.DeltaV.SpaceFerret.Components; | ||
|
||
[RegisterComponent, Access(typeof(SpaceFerretSystem)), ExclusiveAntagonist] | ||
public sealed partial class SpaceFerretRoleComponent : AntagonistRoleComponent; |
30 changes: 30 additions & 0 deletions
30
Content.Server/DeltaV/SpaceFerret/Systems/CanBackflipSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Content.Server.Actions; | ||
using Content.Shared.DeltaV.SpaceFerret; | ||
using Content.Shared.DeltaV.SpaceFerret.Events; | ||
|
||
namespace Content.Server.DeltaV.SpaceFerret.Systems; | ||
|
||
public sealed class CanBackflipSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ActionsSystem _actions = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<CanBackflipComponent, MapInitEvent>(OnInit); | ||
SubscribeLocalEvent<CanBackflipComponent, BackflipActionEvent>(OnBackflipAction); | ||
} | ||
|
||
private void OnInit(EntityUid uid, CanBackflipComponent component, MapInitEvent args) | ||
{ | ||
_actions.AddAction(uid, ref component.BackflipActionEntity, component.BackflipAction, uid); | ||
} | ||
|
||
public void OnBackflipAction(EntityUid uid, CanBackflipComponent comp, BackflipActionEvent args) | ||
{ | ||
RaiseNetworkEvent(new DoABackFlipEvent(GetNetEntity(uid))); | ||
|
||
args.Handled = true; | ||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
Content.Server/DeltaV/SpaceFerret/Systems/CanHibernateSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
using Content.Server.Actions; | ||
using Content.Server.Atmos.Piping.Unary.Components; | ||
using Content.Server.GameTicking; | ||
using Content.Server.Ghost.Roles.Components; | ||
using Content.Server.Popups; | ||
using Content.Shared.DeltaV.SpaceFerret; | ||
using Content.Shared.Interaction.Components; | ||
using Content.Shared.Mind; | ||
using Content.Shared.NPC; | ||
using Content.Shared.Popups; | ||
using Robust.Server.Audio; | ||
using Robust.Shared.Audio; | ||
|
||
namespace Content.Server.DeltaV.SpaceFerret.Systems; | ||
|
||
public sealed class CanHibernateSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ActionsSystem _actions = default!; | ||
[Dependency] private readonly EntityLookupSystem _lookup = default!; | ||
[Dependency] private readonly PopupSystem _popup = default!; | ||
[Dependency] private readonly SharedMindSystem _mind = default!; | ||
[Dependency] private readonly GameTicker _ticker = default!; | ||
[Dependency] private readonly AudioSystem _audio = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<CanHibernateComponent, MapInitEvent>(OnInit); | ||
SubscribeLocalEvent<CanHibernateComponent, EepyActionEvent>(OnEepyAction); | ||
} | ||
|
||
private void OnInit(EntityUid uid, CanHibernateComponent component, MapInitEvent args) | ||
{ | ||
_actions.AddAction(uid, ref component.EepyActionEntity, component.EepyAction, uid); | ||
} | ||
|
||
public void OnEepyAction(EntityUid uid, CanHibernateComponent comp, EepyActionEvent args) | ||
{ | ||
// If you require food before hibernating, assert that this condition has been fulfilled. | ||
if (_mind.TryGetObjectiveComp<ConsumeNutrientsConditionComponent>(uid, out var nutrientsCondition) && nutrientsCondition.NutrientsConsumed / nutrientsCondition.NutrientsRequired < 1.0) | ||
{ | ||
_popup.PopupEntity(Loc.GetString(comp.NotEnoughNutrientsMessage), uid, PopupType.SmallCaution); | ||
|
||
return; | ||
} | ||
|
||
// Assert that you're near a hibernation point (scrubbers) | ||
var scrubbers = _lookup.GetEntitiesInRange<GasVentScrubberComponent>(Transform(uid).Coordinates, 2f); | ||
if (scrubbers.Count <= 0) | ||
{ | ||
_popup.PopupEntity(Loc.GetString(comp.TooFarFromHibernationSpot), uid, PopupType.SmallCaution); | ||
|
||
return; | ||
} | ||
|
||
if (_mind.TryGetObjectiveComp<HibernateConditionComponent>(uid, out var hibernateCondition)) | ||
{ | ||
_audio.PlayPvs(hibernateCondition.SuccessSfx, uid); | ||
_popup.PopupEntity(Loc.GetString(hibernateCondition.SuccessMessage), uid, PopupType.Large); | ||
hibernateCondition.Hibernated = true; | ||
} | ||
|
||
// Kick player out | ||
var mind = _mind.GetMind(uid); | ||
if (mind != null) | ||
{ | ||
_ticker.OnGhostAttempt(mind.Value, false); | ||
} | ||
|
||
// End ghost-role | ||
AddComp<BlockMovementComponent>(uid); | ||
RemComp<ActiveNPCComponent>(uid); | ||
RemComp<GhostTakeoverAvailableComponent>(uid); | ||
|
||
// Notify | ||
RaiseNetworkEvent(new EntityHasHibernated(GetNetEntity(uid))); | ||
|
||
args.Handled = true; | ||
} | ||
} | ||
|
||
public struct EntityHibernateAttemptSuccessEvent(EntityUid entity) | ||
{ | ||
public EntityUid Entity = entity; | ||
} |
19 changes: 19 additions & 0 deletions
19
Content.Server/DeltaV/SpaceFerret/Systems/ConsumeNutrientsObjective.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Content.Shared.DeltaV.SpaceFerret; | ||
using Content.Shared.Objectives.Components; | ||
|
||
namespace Content.Server.DeltaV.SpaceFerret.Systems; | ||
|
||
public sealed class ConsumeNutrientsObjectiveSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ConsumeNutrientsConditionComponent, ObjectiveGetProgressEvent>(OnConsumeNutrientsGetProgress); | ||
} | ||
|
||
private static void OnConsumeNutrientsGetProgress(EntityUid uid, ConsumeNutrientsConditionComponent comp, ref ObjectiveGetProgressEvent args) | ||
{ | ||
args.Progress = comp.NutrientsConsumed / comp.NutrientsRequired; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
Content.Server/DeltaV/SpaceFerret/Systems/HibernateObjectiveSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Content.Shared.DeltaV.SpaceFerret; | ||
using Content.Shared.Objectives.Components; | ||
|
||
namespace Content.Server.DeltaV.SpaceFerret.Systems; | ||
|
||
public sealed class HibernateObjectiveSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<HibernateConditionComponent, ObjectiveGetProgressEvent>(OnHibernateGetProgress); | ||
} | ||
|
||
private static void OnHibernateGetProgress(EntityUid uid, HibernateConditionComponent comp, ref ObjectiveGetProgressEvent args) | ||
{ | ||
args.Progress = comp.Hibernated ? 1.0f : 0.0f; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
Content.Server/DeltaV/SpaceFerret/Systems/SpaceFerretSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using Content.Server.Chat.Managers; | ||
using Content.Server.DeltaV.SpaceFerret.Components; | ||
using Content.Server.GenericAntag; | ||
using Content.Server.Roles; | ||
using Content.Shared.DeltaV.Interaction.Events; | ||
using Content.Shared.DeltaV.Nutrition; | ||
using Content.Shared.DeltaV.SpaceFerret; | ||
using Content.Shared.DeltaV.SpaceFerret.Events; | ||
using Content.Shared.Interaction.Events; | ||
using Content.Shared.Mind; | ||
using Content.Shared.Nutrition; | ||
|
||
namespace Content.Server.DeltaV.SpaceFerret.Systems; | ||
|
||
public sealed class SpaceFerretSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly RoleSystem _role = default!; | ||
[Dependency] private readonly IChatManager _chatMan = default!; | ||
[Dependency] private readonly SharedMindSystem _mind = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<SpaceFerretComponent, GenericAntagCreatedEvent>(OnInit); | ||
SubscribeLocalEvent<SpaceFerretComponent, InteractionAttemptFailed>(OnInteractFailed); | ||
SubscribeLocalEvent<SpaceFerretComponent, HungerModifiedEvent>(OnHungerModified); | ||
} | ||
|
||
private void OnInit(EntityUid uid, SpaceFerretComponent component, GenericAntagCreatedEvent args) | ||
{ | ||
var mind = args.Mind; | ||
|
||
if (mind.Session == null) | ||
return; | ||
|
||
var session = mind.Session; | ||
_role.MindAddRole(args.MindId, new RoleBriefingComponent | ||
{ | ||
Briefing = Loc.GetString(component.RoleBriefing) | ||
}, mind); | ||
_role.MindAddRole(args.MindId, new SpaceFerretRoleComponent() | ||
{ | ||
PrototypeId = component.AntagProtoId | ||
}, mind); | ||
_role.MindPlaySound(args.MindId, component.RoleIntroSfx, mind); | ||
_chatMan.DispatchServerMessage(session, Loc.GetString(component.RoleGreeting)); | ||
} | ||
|
||
public void OnInteractFailed(EntityUid uid, SpaceFerretComponent _, InteractionAttemptFailed args) | ||
{ | ||
RaiseLocalEvent(uid, new BackflipActionEvent()); | ||
} | ||
|
||
private void OnHungerModified(EntityUid uid, SpaceFerretComponent comp, HungerModifiedEvent args) | ||
{ | ||
if (_mind.TryGetObjectiveComp<ConsumeNutrientsConditionComponent>(uid, out var nutrientsCondition) && args.Amount > 0) | ||
{ | ||
nutrientsCondition.NutrientsConsumed += args.Amount; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
Content.Shared/DeltaV/Interaction/Events/InteractionAttemptFailedEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Content.Shared.DeltaV.Interaction.Events; | ||
|
||
public sealed class InteractionAttemptFailed(EntityUid target) | ||
{ | ||
public EntityUid Target = target; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Content.Shared.DeltaV.Nutrition; | ||
|
||
public sealed class HungerModifiedEvent(float amount) : EntityEventArgs | ||
NullWanderer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
public float Amount = amount; | ||
} |
17 changes: 17 additions & 0 deletions
17
Content.Shared/DeltaV/SpaceFerret/Components/CanBackflipComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Shared.DeltaV.SpaceFerret; | ||
|
||
[RegisterComponent] | ||
public sealed partial class CanBackflipComponent : Component | ||
{ | ||
[DataField] | ||
public EntProtoId BackflipAction = "ActionBackflip"; | ||
|
||
[DataField] | ||
public EntityUid? BackflipActionEntity; | ||
|
||
[DataField] | ||
public SoundSpecifier ClappaSfx = new SoundPathSpecifier("/Audio/DeltaV/Animals/slugclappa.ogg"); | ||
} |
24 changes: 24 additions & 0 deletions
24
Content.Shared/DeltaV/SpaceFerret/Components/CanHibernateComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Content.Shared.Actions; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Serialization; | ||
|
||
namespace Content.Shared.DeltaV.SpaceFerret; | ||
|
||
[RegisterComponent] | ||
public sealed partial class CanHibernateComponent : Component | ||
{ | ||
[DataField(required: true)] | ||
public EntProtoId EepyAction = "ActionEepy"; | ||
|
||
[DataField] | ||
public EntityUid? EepyActionEntity; | ||
|
||
[DataField(required: true)] | ||
public LocId NotEnoughNutrientsMessage = "spaceferret-not-enough-nutrients"; | ||
|
||
[DataField(required: true)] | ||
public LocId TooFarFromHibernationSpot = "spaceferret-out-of-range"; | ||
|
||
[DataField(required: true)] | ||
public string SpriteStateId = ""; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
no validation of any kind here either...
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.
Not sure what you mean here?
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.
it used to let malf clients play any sound which is Not Good
now it cant do that, also can probably get mob from message session so player cant even spoof the entity of an actual ferret