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

Update 12/11/2024 #113

Merged
merged 29 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ec650c4
Uplink: Remove Deception Category (#1309)
sleepyyapril Dec 7, 2024
5d64873
Automatic Changelog Update (#1309)
SimpleStation14 Dec 7, 2024
0c60671
[Feat] Bring Back Die Glorious Death, Hijack And Ian's Meat Traitor O…
Remuchi Dec 7, 2024
3ae4370
Automatic Changelog Update (#1323)
SimpleStation14 Dec 7, 2024
c40af73
The Throwing Update (#1307)
angelofallars Dec 8, 2024
33f80d6
Automatic Changelog Update (#1307)
SimpleStation14 Dec 8, 2024
8216a6e
Replace Direct Uses of GameTicker Dictionary with `TryGetValue` (#332…
rbertoche Dec 9, 2024
ca7e576
Fix Debug Assert. (#1325)
sleepyyapril Dec 9, 2024
f913393
Fix Melee Weapon Attack Speed (#1330)
dge21 Dec 10, 2024
1592c0e
Automatic Changelog Update (#1330)
SimpleStation14 Dec 10, 2024
34209e6
CVar CharacterRequirement (#1322)
sleepyyapril Dec 10, 2024
49b9c34
Update Credits (#1326)
github-actions[bot] Dec 10, 2024
6b1feac
Back Out "Flash Now Flashes Black Instead of White. (#14642)" (#1331)
stellar-novas Dec 10, 2024
48951ff
Automatic Changelog Update (#1331)
SimpleStation14 Dec 10, 2024
142ff10
Nix housekeeping
stellar-novas Dec 10, 2024
a668d35
Nix Housekeeping (#1332)
DEATHB4DEFEAT Dec 11, 2024
3e93876
Port N14 Mapper Assets (#1315)
VMSolidus Dec 11, 2024
b4e9e44
Automatic Changelog Update (#1315)
SimpleStation14 Dec 11, 2024
0ed26ce
Billions Must Flip (#1318)
sleepyyapril Dec 11, 2024
39d250f
Automatic Changelog Update (#1318)
SimpleStation14 Dec 11, 2024
946b766
Re-Enable Clown/Mime Hardsuit and Clown Snoring (#1324)
angelofallars Dec 11, 2024
48d63ba
Automatic Changelog Update (#1324)
SimpleStation14 Dec 11, 2024
975c673
Blood Cult DLC 1: Make It an Actually Playable Game (Mode) (#1276)
Remuchi Dec 11, 2024
149afb6
Automatic Changelog Update (#1276)
SimpleStation14 Dec 11, 2024
5899f4e
Pistol-Whipping (Guns as Melee Weapons) (#1335)
angelofallars Dec 11, 2024
478e159
Automatic Changelog Update (#1335)
SimpleStation14 Dec 11, 2024
f63d9e7
Merge remote-tracking branch 'EE-Master/master' into Update-12/11/2024
VMSolidus Dec 11, 2024
b3b3388
Disable shit tier events
VMSolidus Dec 11, 2024
2b51f9c
Guh
VMSolidus Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
fi
use flake
use nix
5 changes: 5 additions & 0 deletions Content.Client/Damage/DamageOtherOnHitSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Content.Shared.Damage.Systems;

namespace Content.Client.Damage;

public sealed class DamageOtherOnHitSystem : SharedDamageOtherOnHitSystem;
121 changes: 121 additions & 0 deletions Content.Client/Emoting/AnimatedEmotesSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
using Robust.Client.Animations;
using Robust.Shared.Animations;
using Robust.Shared.GameStates;
using Robust.Client.GameObjects;
using Content.Shared.Emoting;
using System.Numerics;
using Robust.Shared.Prototypes;
using Content.Shared.Chat.Prototypes;

namespace Content.Client.Emoting;

public sealed partial class AnimatedEmotesSystem : SharedAnimatedEmotesSystem
{
[Dependency] private readonly AnimationPlayerSystem _anim = default!;
[Dependency] private readonly IPrototypeManager _prot = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<AnimatedEmotesComponent, ComponentHandleState>(OnHandleState);

SubscribeLocalEvent<AnimatedEmotesComponent, AnimationFlipEmoteEvent>(OnFlip);
SubscribeLocalEvent<AnimatedEmotesComponent, AnimationSpinEmoteEvent>(OnSpin);
SubscribeLocalEvent<AnimatedEmotesComponent, AnimationJumpEmoteEvent>(OnJump);
}

public void PlayEmote(EntityUid uid, Animation anim, string animationKey = "emoteAnimKeyId")
{
if (_anim.HasRunningAnimation(uid, animationKey))
return;

_anim.Play(uid, anim, animationKey);
}

private void OnHandleState(EntityUid uid, AnimatedEmotesComponent component, ref ComponentHandleState args)
{
if (args.Current is not AnimatedEmotesComponentState state
|| !_prot.TryIndex<EmotePrototype>(state.Emote, out var emote))
return;

if (emote.Event != null)
RaiseLocalEvent(uid, emote.Event);
}

private void OnFlip(Entity<AnimatedEmotesComponent> ent, ref AnimationFlipEmoteEvent args)
{
var a = new Animation
{
Length = TimeSpan.FromMilliseconds(500),
AnimationTracks =
{
new AnimationTrackComponentProperty
{
ComponentType = typeof(SpriteComponent),
Property = nameof(SpriteComponent.Rotation),
InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(Angle.Zero, 0f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(180), 0.25f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(360), 0.25f),
}
}
}
};
PlayEmote(ent, a);
}
private void OnSpin(Entity<AnimatedEmotesComponent> ent, ref AnimationSpinEmoteEvent args)
{
var a = new Animation
{
Length = TimeSpan.FromMilliseconds(600),
AnimationTracks =
{
new AnimationTrackComponentProperty
{
ComponentType = typeof(TransformComponent),
Property = nameof(TransformComponent.LocalRotation),
InterpolationMode = AnimationInterpolationMode.Linear,
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(0), 0f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(90), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(180), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(270), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.Zero, 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(90), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(180), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.FromDegrees(270), 0.075f),
new AnimationTrackProperty.KeyFrame(Angle.Zero, 0.075f),
}
}
}
};
PlayEmote(ent, a, "emoteAnimSpin");
}
private void OnJump(Entity<AnimatedEmotesComponent> ent, ref AnimationJumpEmoteEvent args)
{
var a = new Animation
{
Length = TimeSpan.FromMilliseconds(250),
AnimationTracks =
{
new AnimationTrackComponentProperty
{
ComponentType = typeof(SpriteComponent),
Property = nameof(SpriteComponent.Offset),
InterpolationMode = AnimationInterpolationMode.Cubic,
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(Vector2.Zero, 0f),
new AnimationTrackProperty.KeyFrame(new Vector2(0, .35f), 0.125f),
new AnimationTrackProperty.KeyFrame(Vector2.Zero, 0.125f),
}
}
}
};
PlayEmote(ent, a);
}
}
2 changes: 1 addition & 1 deletion Content.Client/ListViewSelector/ListViewSelectorBUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void PopulateWindow(List<ListViewSelectorEntry> items)
{
var itemName = item.Name;
var itemDesc = item.Description;
if (_prototypeManager.TryIndex(item.Id, out var itemPrototype))
if (_prototypeManager.TryIndex(item.Id, out var itemPrototype, false))
{
itemName = itemPrototype.Name;
itemDesc = itemPrototype.Description;
Expand Down
10 changes: 10 additions & 0 deletions Content.Client/Weapons/Melee/MeleeWeaponSystem.Effects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ private Animation GetThrustAnimation(SpriteComponent sprite, float distance, Ang
{
const float thrustEnd = 0.05f;
const float length = 0.15f;
var rotation = sprite.Rotation + spriteRotation;
var startOffset = sprite.Rotation.RotateVec(new Vector2(0f, -distance / 5f));
var endOffset = sprite.Rotation.RotateVec(new Vector2(0f, -distance));

Expand All @@ -144,6 +145,15 @@ private Animation GetThrustAnimation(SpriteComponent sprite, float distance, Ang
Length = TimeSpan.FromSeconds(length),
AnimationTracks =
{
new AnimationTrackComponentProperty()
{
ComponentType = typeof(SpriteComponent),
Property = nameof(SpriteComponent.Rotation),
KeyFrames =
{
new AnimationTrackProperty.KeyFrame(rotation, 0f),
}
},
new AnimationTrackComponentProperty()
{
ComponentType = typeof(SpriteComponent),
Expand Down
37 changes: 21 additions & 16 deletions Content.Client/Weapons/Melee/MeleeWeaponSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Wieldable.Components;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
Expand Down Expand Up @@ -71,34 +72,36 @@ public override void Update(float frameTime)
return;
}

var useDown = _inputSystem.CmdStates.GetState(EngineKeyFunctions.Use);
var altDown = _inputSystem.CmdStates.GetState(EngineKeyFunctions.UseSecondary);
var useDown = _inputSystem.CmdStates.GetState(EngineKeyFunctions.Use) == BoundKeyState.Down;
var altDown = _inputSystem.CmdStates.GetState(EngineKeyFunctions.UseSecondary) == BoundKeyState.Down;

if (weapon.AutoAttack || useDown != BoundKeyState.Down && altDown != BoundKeyState.Down)
// Disregard inputs to the shoot binding
if (TryComp<GunComponent>(weaponUid, out var gun) &&
// Except if can't shoot due to being unwielded
(!HasComp<GunRequiresWieldComponent>(weaponUid) ||
(TryComp<WieldableComponent>(weaponUid, out var wieldable) && wieldable.Wielded)))
{
if (gun.UseKey)
useDown = false;
else
altDown = false;
}

if (weapon.AutoAttack || !useDown && !altDown)
{
if (weapon.Attacking)
{
RaisePredictiveEvent(new StopAttackEvent(GetNetEntity(weaponUid)));
}
}

if (weapon.Attacking || weapon.NextAttack > Timing.CurTime)
if (weapon.Attacking || weapon.NextAttack > Timing.CurTime || (!useDown && !altDown))
{
return;
}

// TODO using targeted actions while combat mode is enabled should NOT trigger attacks.

// TODO: Need to make alt-fire melee its own component I guess?
// Melee and guns share a lot in the middle but share virtually nothing at the start and end so
// it's kinda tricky.
// I think as long as we make secondaries their own component it's probably fine
// as long as guncomp has an alt-use key then it shouldn't be too much of a PITA to deal with.
if (TryComp<GunComponent>(weaponUid, out var gun) && gun.UseKey)
{
return;
}

var mousePos = _eyeManager.PixelToMap(_inputManager.MouseScreenPosition);

if (mousePos.MapId == MapId.Nullspace)
Expand All @@ -118,7 +121,8 @@ public override void Update(float frameTime)
}

// Heavy attack.
if (altDown == BoundKeyState.Down)
if (!weapon.DisableHeavy &&
(!weapon.SwapKeys ? altDown : useDown))
{
// If it's an unarmed attack then do a disarm
if (weapon.AltDisarm && weaponUid == entity)
Expand All @@ -139,7 +143,8 @@ public override void Update(float frameTime)
}

// Light attack
if (useDown == BoundKeyState.Down)
if (!weapon.DisableClick &&
(!weapon.SwapKeys ? useDown : altDown))
{
var attackerPos = Transform(entity).MapPosition;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Content.Shared.WhiteDream.BloodCult.Constructs.PhaseShift;

namespace Content.Client.WhiteDream.BloodCult.PhaseShift;

public sealed class PhaseShiftSystem : SharedPhaseShiftSystem;
61 changes: 29 additions & 32 deletions Content.Client/WhiteDream/BloodCult/Runes/UI/RuneDrawerBUI.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Linq;
using System.Numerics;
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared.WhiteDream.BloodCult.Runes;
using JetBrains.Annotations;
Expand All @@ -23,71 +22,72 @@ public sealed class RuneDrawerBUI : BoundUserInterface
[Dependency] private readonly IInputManager _inputManager = default!;

private readonly SpriteSystem _spriteSystem;

private RadialMenu? _menu;
private readonly RadialMenu _menu;

public RuneDrawerBUI(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
_spriteSystem = _entManager.System<SpriteSystem>();
_menu = new()
{
HorizontalExpand = true,
VerticalExpand = true,
BackButtonStyleClass = "RadialMenuBackButton",
CloseButtonStyleClass = "RadialMenuCloseButton"
};
}

protected override void Open()
{
_menu = FormMenu();
_menu.OnClose += Close;
_menu.OpenCenteredAt(_inputManager.MouseScreenPosition.Position / _displayManager.ScreenSize);
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing)
_menu?.Dispose();
_menu.Close();
}

private RadialMenu FormMenu()
protected override void UpdateState(BoundUserInterfaceState state)
{
var menu = new RadialMenu
{
HorizontalExpand = true,
VerticalExpand = true,
BackButtonStyleClass = "RadialMenuBackButton",
CloseButtonStyleClass = "RadialMenuCloseButton"
};

if (!_entManager.HasComponent<RuneDrawerComponent>(Owner))
return menu;
if (state is RuneDrawerMenuState runeDrawerState)
FillMenu(runeDrawerState.AvailalbeRunes);
}

var runeSelectorArray = _protoManager.EnumeratePrototypes<RuneSelectorPrototype>().OrderBy(r => r.ID).ToArray();
private void FillMenu(List<ProtoId<RuneSelectorPrototype>>? runes = null)
{
if (runes is null)
return;

var mainContainer = new RadialContainer
var container = new RadialContainer
{
Radius = 36f / (runeSelectorArray.Length == 1
? 1
: MathF.Sin(MathF.PI / runeSelectorArray.Length))
Radius = 48f + 24f * MathF.Log(runes.Count)
};

foreach (var runeSelector in runeSelectorArray)
_menu.AddChild(container);

foreach (var runeSelector in runes)
{
if (!_protoManager.TryIndex(runeSelector.Prototype, out var proto))
if (!_protoManager.TryIndex(runeSelector, out var runeSelectorProto) ||
!_protoManager.TryIndex(runeSelectorProto.Prototype, out var runeProto))
continue;

var itemSize = new Vector2(64f, 64f);
var button = new RadialMenuTextureButton
{
ToolTip = Loc.GetString(proto.Name),
ToolTip = Loc.GetString(runeProto.Name),
StyleClasses = { "RadialMenuButton" },
SetSize = itemSize
};

var runeIcon = _spriteSystem.Frame0(proto);
var runeIcon = _spriteSystem.Frame0(runeProto);
var runeScale = itemSize / runeIcon.Size;

var texture = new TextureRect
{
VerticalAlignment = Control.VAlignment.Center,
HorizontalAlignment = Control.HAlignment.Center,
Texture = _spriteSystem.Frame0(proto),
Texture = _spriteSystem.Frame0(runeProto),
TextureScale = runeScale
};

Expand All @@ -99,10 +99,7 @@ private RadialMenu FormMenu()
Close();
};

mainContainer.AddChild(button);
container.AddChild(button);
}

menu.AddChild(mainContainer);
return menu;
}
}
2 changes: 1 addition & 1 deletion Content.Server/Antag/AntagSelectionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected override void Started(EntityUid uid, AntagSelectionComponent component
return;

var players = _playerManager.Sessions
.Where(x => GameTicker.PlayerGameStatuses[x.UserId] == PlayerGameStatus.JoinedGame)
.Where(x => GameTicker.PlayerGameStatuses.TryGetValue(x.UserId, out var status) && status == PlayerGameStatus.JoinedGame)
.ToList();

ChooseAntags((uid, component), players);
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Chat/Systems/ChatSystem.Emote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private void TryEmoteChatInput(EntityUid uid, string textInput)
private void InvokeEmoteEvent(EntityUid uid, EmotePrototype proto)
{
var ev = new EmoteEvent(proto);
RaiseLocalEvent(uid, ref ev);
RaiseLocalEvent(uid, ref ev, true); // goob edit
}
}

Expand Down
Loading
Loading