Skip to content

Commit

Permalink
Merge branch 'master' into vent-crwaling-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
honeyed-lemons authored Dec 22, 2024
2 parents b80ccb3 + 7efb0c7 commit 32f3e60
Show file tree
Hide file tree
Showing 156 changed files with 1,835 additions and 304 deletions.
38 changes: 17 additions & 21 deletions Content.Server/Holopad/HolopadSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ private void OnHolopadAnswerCall(Entity<HolopadComponent> receiver, ref HolopadA
var source = GetLinkedHolopads(receiver).FirstOrNull();

if (source != null)

{
// Close any AI request windows
if (_stationAiSystem.TryGetStationAiCore(args.Actor, out var stationAiCore) && stationAiCore != null)
Expand All @@ -128,16 +127,15 @@ private void OnHolopadAnswerCall(Entity<HolopadComponent> receiver, ref HolopadA
// Try to warn the AI if the source of the call is out of its range
if (TryComp<TelephoneComponent>(stationAiCore, out var stationAiTelephone) &&
TryComp<TelephoneComponent>(source, out var sourceTelephone) &&
!_telephoneSystem.IsSourceInRangeOfReceiver((stationAiCore.Value.Owner, stationAiTelephone),
(source.Value.Owner, sourceTelephone)))
!_telephoneSystem.IsSourceInRangeOfReceiver((stationAiCore.Value.Owner, stationAiTelephone), (source.Value.Owner, sourceTelephone)))
{
_popupSystem.PopupEntity(Loc.GetString("holopad-ai-is-unable-to-reach-holopad"),
receiver,
args.Actor);
_popupSystem.PopupEntity(Loc.GetString("holopad-ai-is-unable-to-reach-holopad"), receiver, args.Actor);
return;
}

ActivateProjector(source.Value, args.Actor);
}

return;
}

Expand All @@ -161,8 +159,7 @@ private void OnHolopadEndCall(Entity<HolopadComponent> entity, ref HolopadEndCal
!_stationAiSystem.TryGetStationAiCore((args.Actor, stationAiHeld), out var stationAiCore))
return;

if (TryComp<TelephoneComponent>(stationAiCore, out var telephone) &&
telephone.CurrentState != TelephoneState.EndingCall && telephone.CurrentState != TelephoneState.Idle)
if (TryComp<TelephoneComponent>(stationAiCore, out var telephone))
_telephoneSystem.EndTelephoneCalls((stationAiCore.Value, telephone));
}

Expand Down Expand Up @@ -216,7 +213,8 @@ private void OnHolopadStationAiRequest(Entity<HolopadComponent> entity, ref Holo
{
var receiver = new Entity<TelephoneComponent>(receiverUid, receiverTelephone);

if (!_telephoneSystem.IsSourceAbleToReachReceiver(source, receiver))
// Check if the core can reach the call source, rather than the other way around
if (!_telephoneSystem.IsSourceAbleToReachReceiver(receiver, source))
continue;

if (_telephoneSystem.IsTelephoneEngaged(receiver))
Expand All @@ -231,10 +229,9 @@ private void OnHolopadStationAiRequest(Entity<HolopadComponent> entity, ref Holo
LinkHolopadToUser(entity, args.Actor);
}

if (!reachableAiCores.Any())
return;

_telephoneSystem.BroadcastCallToTelephones(source, reachableAiCores, args.Actor);
// Ignore range so that holopads that ignore other devices on the same grid can request the AI
var options = new TelephoneCallOptions { IgnoreRange = true };
_telephoneSystem.BroadcastCallToTelephones(source, reachableAiCores, args.Actor, options);
}

#endregion
Expand Down Expand Up @@ -355,6 +352,9 @@ private void OnHolopadUserInit(Entity<HolopadUserComponent> entity, ref Componen

private void OnHolopadShutdown(Entity<HolopadComponent> entity, ref ComponentShutdown args)
{
if (TryComp<TelephoneComponent>(entity, out var telphone) && _telephoneSystem.IsTelephoneEngaged((entity.Owner, telphone)))
_telephoneSystem.EndTelephoneCalls((entity, telphone));

ShutDownHolopad(entity);
SetHolopadAmbientState(entity, false);
}
Expand Down Expand Up @@ -611,15 +611,8 @@ private void ShutDownHolopad(Entity<HolopadComponent> entity)
UnlinkHolopadFromUser(entity, entity.Comp.User.Value);

if (TryComp<StationAiCoreComponent>(entity, out var stationAiCore))
{
_stationAiSystem.SwitchRemoteEntityMode((entity.Owner, stationAiCore), true);


if (TryComp<TelephoneComponent>(entity, out var stationAiCoreTelphone) &&
stationAiCoreTelphone.CurrentState != TelephoneState.EndingCall && stationAiCoreTelphone.CurrentState != TelephoneState.Idle)
_telephoneSystem.EndTelephoneCalls((entity, stationAiCoreTelphone));
}

Dirty(entity);
}

Expand Down Expand Up @@ -670,8 +663,12 @@ private void ActivateProjector(Entity<HolopadComponent> entity, EntityUid user)

var source = new Entity<TelephoneComponent>(stationAiCore.Value, stationAiTelephone);

// Check if the AI is unable to activate the projector (unlikely this will ever pass; its just a safeguard)
if (!_telephoneSystem.IsSourceInRangeOfReceiver(source, receiver))
{
_popupSystem.PopupEntity(Loc.GetString("holopad-ai-is-unable-to-activate-projector"), receiver, user);
return;
}

// Terminate any calls that the core is hosting and immediately connect to the receiver
_telephoneSystem.TerminateTelephoneCalls(source);
Expand Down Expand Up @@ -716,7 +713,6 @@ private void ExecuteBroadcast(Entity<HolopadComponent> source, EntityUid user)
var receiverTelephoneEntity = new Entity<TelephoneComponent>(receiver, receiverTelephone);

if (sourceTelephoneEntity == receiverTelephoneEntity ||
receiverTelephone.UnlistedNumber ||
!_telephoneSystem.IsSourceAbleToReachReceiver(sourceTelephoneEntity, receiverTelephoneEntity))
continue;

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Telephone/TelephoneSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void CallTelephone(Entity<TelephoneComponent> source, Entity<TelephoneCom

private bool TryCallTelephone(Entity<TelephoneComponent> source, Entity<TelephoneComponent> receiver, EntityUid user, TelephoneCallOptions? options = null)
{
if (!IsSourceAbleToReachReceiver(source, receiver))
if (!IsSourceAbleToReachReceiver(source, receiver) && options?.IgnoreRange != true)
return false;

if (IsTelephoneEngaged(receiver) &&
Expand Down
1 change: 1 addition & 0 deletions Content.Shared/Telephone/TelephoneComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public record struct TelephoneCallEndedEvent();
[Serializable, NetSerializable]
public struct TelephoneCallOptions
{
public bool IgnoreRange; // The source can always reach its target
public bool ForceConnect; // The source immediately starts a call with the receiver, potentially interrupting a call that is already in progress
public bool ForceJoin; // The source smoothly joins a call in progress, or starts a normal call with the receiver if there is none
public bool MuteSource; // Chatter from the source is not transmitted - could be used for eavesdropping when combined with 'ForceJoin'
Expand Down
128 changes: 64 additions & 64 deletions Resources/Changelog/Impstation.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,4 @@
Entries:
- author: hivehum
changes:
- message: More items can be put in the candy bowl.
type: Tweak
id: 278
time: '2024-09-28T00:12:40.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/359
- author: Darkmajia
changes:
- message: Brigmedics now spawn with a survival box.
type: Fix
id: 279
time: '2024-09-28T00:12:16.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/357
- author: AirFryerBuyOneGetOneFree
changes:
- message: A new type of mouse has been added.
type: Add
id: 280
time: '2024-09-28T00:14:41.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/360
- author: Darkmajia
changes:
- message: Brigmedics now have their own winter coat and boots.
type: Add
- message: Security and medical winter boots have been removed from the Brigmedic
loadout.
type: Remove
id: 281
time: '2024-09-28T00:13:06.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/362
- author: TheGrimbeeper
changes:
- message: Artifacts can now spawn non-random books (e.g Book of Nar'sie, Parker's
TEG guide, etc)
type: Add
- message: Added some parts of The Great Gatsby by F. Scott Fitzgerald, which is
under public domain. By sections, I mean Added the entirety of The Great Gatsby
by F. Scott Fitzgerald, which is under public domain.
type: Add
id: 282
time: '2024-09-28T00:13:26.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/354
- author: Sha-Seng
changes:
- message: A new prestige neck item for quartermasters
type: Add
- message: Some veteran captain sprite adjustments
type: Tweak
id: 283
time: '2024-09-28T00:47:17.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/364
- author: formlessnameless
changes:
- message: Made the upstream Frezon and N2O nerfs around half as harsh. If it's
still wild, we'll revisit it later.
type: Tweak
- message: Fixed variable name after VoiceMask refactor
type: Fix
- message: Made SVS less common, matching revs and zombies
type: Tweak
id: 284
time: '2024-09-28T01:04:02.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/365
- author: Darkmajia
changes:
- message: Fixed Saltern.
Expand Down Expand Up @@ -4523,3 +4459,67 @@
id: 777
time: '2024-12-20T16:54:25.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1087
- author: AftrLite
changes:
- message: Ongoing respriting efforts. Keep an eye out!
type: Tweak
- message: Fixed the InHands for Chaplain's Null Rod quiver's arrow.
type: Fix
id: 778
time: '2024-12-21T11:31:01.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1085
- author: honeyed-lemons
changes:
- message: Various holopad fixes
type: Fix
id: 779
time: '2024-12-21T11:37:30.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1091
- author: Sha-Seng
changes:
- message: Slime hair is now 75% opacity (up from 65%)
type: Tweak
- message: Gathered Low hairstyle touchups (more body in profile, clearer silhouette,
etc)
type: Tweak
id: 780
time: '2024-12-21T11:37:01.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1090
- author: Sha-Seng
changes:
- message: Removed security breath mask from HoS loadout options since it's already
in the locker lol
type: Remove
- message: HoS Mantle is now 10 hours to account for the 90 hour unlock requirement
of the job
type: Tweak
- message: HoS prestige coat, armor, and headset are now 25 hours
type: Tweak
id: 781
time: '2024-12-21T11:41:49.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1089
- author: AftrLite
changes:
- message: Fixed Freezer/Heater sprites, which got accidentally reverted.
type: Fix
id: 782
time: '2024-12-21T15:08:45.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1095
- author: kipdotnet
changes:
- message: Added the Mini Television for mapping.
type: Add
- message: Added the handheld quantum camera for mapping.
type: Add
- message: Updated banana.
type: Tweak
id: 783
time: '2024-12-21T15:09:21.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1092
- author: Darkmajia
changes:
- message: Beer is no longer 5x as alcoholic as it was meant to be.
type: Fix
id: 784
time: '2024-12-21T15:12:02.0000000+00:00'
url: https://github.com/impstation/imp-station-14/pull/1094
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ loadout-group-tank-harness-with-outerwear-aquatic = Tank harness for water-breat
loadout-group-tank-harness-command-with-outerwear-aquatic = Command tank harness for water-breathers (in inventory)
loadout-group-breath-tool-decapoid = Vaporizer for decapoids
loadout-group-breath-tool-inventory-decapoid = Vaporizer for decapoids (in inventory)
loadout-group-head-of-security-mask = Head of Security mask
loadout-group-hop-shoes = Head of Personnel shoes
loadout-group-clown-mask = Clown mask
loadout-group-clown-neck = Clown neck
Expand Down
1 change: 1 addition & 0 deletions Resources/Locale/en-US/holopad/holopad.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ holopad-hologram-name = hologram of {THE($name)}
# Holopad actions
holopad-activate-projector-verb = Activate holopad projector
holopad-ai-is-unable-to-reach-holopad = You are unable to interface with the source of the call, it is too far from your core.
holopad-ai-is-unable-to-activate-projector = You are unable to activate the holopad's projector, it is too far from your core.
# Mapping prototypes
# General
holopad-general-tools = General - Tools
Expand Down
Loading

0 comments on commit 32f3e60

Please sign in to comment.