Skip to content

Commit 2811262

Browse files
committed
Merge branch 'mech-changes' of github.com:Coolsurf6/starlight-14 into mech-changes
2 parents 9d79e8b + 4e1903f commit 2811262

40 files changed

Lines changed: 85288 additions & 82186 deletions

File tree

Content.Client/Weapons/Melee/MeleeWeaponSystem.Effects.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ public override void DoLunge(EntityUid user, EntityUid weapon, Angle angle, Vect
3232
if (localPos == Vector2.Zero || animation == null)
3333
return;
3434

35-
if (!_xformQuery.TryGetComponent(user, out var userXform) || userXform.MapID == MapId.Nullspace)
35+
// Starlight Begin - Mech wideswing
36+
var originEntity = GetOriginEntity(user);
37+
38+
if (!_xformQuery.TryGetComponent(originEntity, out var userXform) || userXform.MapID == MapId.Nullspace)
3639
return;
40+
// Starlight End
3741

3842
var animationUid = Spawn(animation, userXform.Coordinates);
3943

Content.Client/Weapons/Melee/MeleeWeaponSystem.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,11 @@ private void ClientHeavyAttack(EntityUid user, EntityCoordinates coordinates, En
232232
var direction = targetMap.Position - userPos;
233233
var distance = MathF.Min(component.Range, direction.Length());
234234

235+
var ignoreUid = GetOriginEntity(user); // Starlight - Mech wideswing handling
236+
235237
// This should really be improved. GetEntitiesInArc uses pos instead of bounding boxes.
236238
// Server will validate it with InRangeUnobstructed.
237-
var entities = GetNetEntityList(ArcRayCast(userPos, direction.ToWorldAngle(), component.Angle, distance, userXform.MapID, user).ToList());
239+
var entities = GetNetEntityList(ArcRayCast(userPos, direction.ToWorldAngle(), component.Angle, distance, userXform.MapID, ignoreUid).ToList()); // Starlight
238240
RaisePredictiveEvent(new HeavyAttackEvent(GetNetEntity(meleeUid), entities.GetRange(0, Math.Min(MaxTargets, entities.Count)), GetNetCoordinates(coordinates)));
239241
}
240242

Content.IntegrationTests/Tests/_StarLight/Power/GridPowerTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public sealed class GridPowerTests
5353
new("/Maps/_Starlight/Shuttles/ShuttleEvent/UnknownShuttleFireResponse.yml"),
5454
new("/Maps/_Starlight/Shuttles/ShuttleEvent/abductor_shuttle.yml"),
5555
new("/Maps/_Starlight/Shuttles/ShuttleEvent/syndie_evacpod.yml"),
56+
new("/Maps/_Starlight/Shuttles/ShuttleEvent/incorporation.yml"),
5657
new("/Maps/_Starlight/Shuttles/Signaleer.yml"),
5758
new("/Maps/_Starlight/Shuttles/VoxATS.yml"),
5859
new("/Maps/_Starlight/Shuttles/blackhorse.yml"),

Content.Shared/Mech/EntitySystems/SharedMechSystem.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
using Content.Shared.Power.Components;
3434
using Content.Shared.Power.EntitySystems;
3535
using Content.Shared._Starlight.Mech;
36+
using Content.Shared._Starlight.Weapons.Melee.Events;
3637
#endregion
3738

3839
namespace Content.Shared.Mech.EntitySystems;
@@ -72,6 +73,7 @@ public override void Initialize()
7273
SubscribeLocalEvent<MechComponent, CanDropTargetEvent>(OnCanDragDrop);
7374
SubscribeLocalEvent<MechComponent, GotEmaggedEvent>(OnEmagged);
7475

76+
SubscribeLocalEvent<MechPilotComponent, GetMeleeOriginEvent>(OnGetMeleeOrigin); // Starlight
7577
SubscribeLocalEvent<MechPilotComponent, GetMeleeWeaponEvent>(OnGetMeleeWeapon);
7678
SubscribeLocalEvent<MechPilotComponent, CanAttackFromContainerEvent>(OnCanAttackFromContainer);
7779
SubscribeLocalEvent<MechPilotComponent, AttackAttemptEvent>(OnAttackAttempt);
@@ -618,6 +620,20 @@ private void OnPilotRemoved(EntityUid uid, MechPilotComponent component, EntGotR
618620
UpdateAppearance(component.Mech, mechComp);
619621
}
620622

623+
#region Starlight
624+
private void OnGetMeleeOrigin(EntityUid uid, MechPilotComponent component, GetMeleeOriginEvent args)
625+
{
626+
if (args.Handled)
627+
return;
628+
629+
if (!HasComp<MechComponent>(component.Mech))
630+
return;
631+
632+
args.OriginEntity = component.Mech;
633+
args.Handled = true;
634+
}
635+
#endregion
636+
621637
private void OnGetMeleeWeapon(EntityUid uid, MechPilotComponent component, GetMeleeWeaponEvent args)
622638
{
623639
if (args.Handled)

Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,9 +994,13 @@ private bool DoDisarm(EntityUid user, DisarmAttackEvent ev, EntityUid meleeUid,
994994

995995
private void DoLungeAnimation(EntityUid user, EntityUid weapon, Angle angle, MapCoordinates coordinates, float length, string? animation)
996996
{
997+
// Starlight Begin - mech wideswing handling
998+
var originEntity = GetOriginEntity(user);
999+
9971000
// TODO: Assert that offset eyes are still okay.
998-
if (!TryComp(user, out TransformComponent? userXform))
1001+
if (!TryComp(originEntity, out TransformComponent? userXform))
9991002
return;
1003+
// Starlight End
10001004

10011005
var invMatrix = TransformSystem.GetInvWorldMatrix(userXform);
10021006
var localPos = Vector2.Transform(coordinates.Position, invMatrix);
@@ -1123,4 +1127,20 @@ private void DoScreenshake(EntityUid weapon, DamageSpecifier damage, EntityUid a
11231127
_shake.Screenshake(attacker, null, userRotation);
11241128
}
11251129
//Starlight end
1130+
1131+
// Starlight begin - mech wideswing
1132+
/// <summary>
1133+
/// Get the apparent origin entity for transforms (e.g. when the entity is piloting a mech)
1134+
/// returns the user if none are found
1135+
/// </summary>
1136+
protected EntityUid GetOriginEntity(EntityUid user)
1137+
{
1138+
var originEntity = user;
1139+
var originEv = new GetMeleeOriginEvent();
1140+
RaiseLocalEvent(user, originEv);
1141+
if (originEv.Handled && originEv.OriginEntity.HasValue)
1142+
originEntity = originEv.OriginEntity.Value;
1143+
return originEntity;
1144+
}
1145+
// Starlight end
11261146
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Content.Shared._Starlight.Weapons.Melee.Events;
2+
3+
// Allows for a melee attack to be treated as originating from another entity
4+
public sealed class GetMeleeOriginEvent : HandledEntityEventArgs
5+
{
6+
public EntityUid? OriginEntity = null;
7+
}

Resources/Changelog/ChangelogStarlight.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36226,5 +36226,84 @@ Entries:
3622636226
id: 398801
3622736227
time: '2026-03-29T09:43:08.000000+00:00'
3622836228
url: https://github.com/ss14Starlight/space-station-14/pull/3988
36229+
- author: wonderfulnewworld
36230+
changes:
36231+
- message: HoP can give Mail Access now.
36232+
type: Fix
36233+
id: 402801
36234+
time: '2026-04-05T18:32:53.000000+00:00'
36235+
url: https://github.com/ss14Starlight/space-station-14/pull/4028
36236+
- author: redmushie
36237+
changes:
36238+
- message: Added Blackstar PDA, ID card, job icon and access.
36239+
type: Add
36240+
- message: Added doors with Communist, Wizard and Blackstar access for mapping use
36241+
(such as for shuttles).
36242+
type: Add
36243+
- message: Blackstar radio now works without telecomms server.
36244+
type: Tweak
36245+
- message: Renamed Commie access level to Communist.
36246+
type: Tweak
36247+
- message: Soviet ID card now actually has Communist access.
36248+
type: Fix
36249+
id: 398601
36250+
time: '2026-04-05T19:45:27.000000+00:00'
36251+
url: https://github.com/ss14Starlight/space-station-14/pull/3986
36252+
- author: Conflee
36253+
changes:
36254+
- message: Added the NanoMed Security vending machine, to be mapped in Brig Medical
36255+
and has Medical and Security access. Contains the normal medical supplies, plus
36256+
body bags and small bottles of basic chems to give Brigmed a decent starting
36257+
supply for basic treatments until Chem is up and stocked.
36258+
type: Add
36259+
id: 399001
36260+
time: '2026-04-05T19:57:36.000000+00:00'
36261+
url: https://github.com/ss14Starlight/space-station-14/pull/3990
36262+
- author: CawsForConcern
36263+
changes:
36264+
- message: (Lobster) Security doors leading towards GenPop corrected to Brig access
36265+
(for IAAs, Magistrates).
36266+
type: Fix
36267+
- message: (Serpentcrest) Security doors leading towards GenPop corrected to Brig
36268+
access (for IAAs, Magistrates).
36269+
type: Fix
36270+
id: 398701
36271+
time: '2026-04-05T20:13:50.000000+00:00'
36272+
url: https://github.com/ss14Starlight/space-station-14/pull/3987
36273+
- author: neurovermi
36274+
changes:
36275+
- message: Mech wideswing and melee sprite issues.
36276+
type: Fix
36277+
id: 401901
36278+
time: '2026-04-05T20:25:55.000000+00:00'
36279+
url: https://github.com/ss14Starlight/space-station-14/pull/4019
36280+
- author: CawsForConcern
36281+
changes:
36282+
- message: (Sepultum) NCT Office front is not locked.
36283+
type: Tweak
36284+
id: 402101
36285+
time: '2026-04-05T20:36:56.000000+00:00'
36286+
url: https://github.com/ss14Starlight/space-station-14/pull/4021
36287+
- author: CawsForConcern
36288+
changes:
36289+
- message: Overloaded APCs on the "NT Incorporation" visitor shuttle have been fixed.
36290+
type: Fix
36291+
id: 402201
36292+
time: '2026-04-05T20:44:24.000000+00:00'
36293+
url: https://github.com/ss14Starlight/space-station-14/pull/4022
36294+
- author: Tess the Evil
36295+
changes:
36296+
- message: Filled n2o tanks.
36297+
type: Tweak
36298+
id: 399301
36299+
time: '2026-04-05T20:51:46.000000+00:00'
36300+
url: https://github.com/ss14Starlight/space-station-14/pull/3993
36301+
- author: neurovermi
36302+
changes:
36303+
- message: Mechs now throw when punching with no equipment.
36304+
type: Add
36305+
id: 402001
36306+
time: '2026-04-05T21:01:24.000000+00:00'
36307+
url: https://github.com/ss14Starlight/space-station-14/pull/4020
3622936308
Order: -1
3623036309

Resources/Locale/en-US/_Starlight/job/job.ftl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ job-title-borgi = Borgi
2222
job-title-tsf-Phantom = Phantom Marine
2323
job-title-tsf-MARSOC = MARSOC Marine
2424
25+
job-name-blackstar = Blackstar Mercenary
26+
2527
job-greet-information-rules = {$jobRules}
2628
2729
role-type-corporate-aligned-name = Corporate Aligned

Resources/Locale/en-US/_Starlight/prototypes/access/accesses.ftl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ id-card-access-level-debug3 = Debug3
2020
id-card-access-level-debug4 = Debug4
2121
id-card-access-level-debug5 = Debug5
2222
23-
id-card-access-level-commie = Commie
23+
id-card-access-level-communist = Communist
2424
2525
id-card-access-level-salvagelead = Salvage Lead
2626
id-card-access-level-mining = Mining
@@ -29,3 +29,4 @@ id-card-access-level-mail = Mail
2929
id-card-access-level-solgov = SolGov
3030
3131
id-card-access-level-pirate = Pirate
32+
id-card-access-level-blackstar = Blackstar

0 commit comments

Comments
 (0)