Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KayzelW committed Sep 27, 2024
1 parent a1d5bb5 commit d92bf43
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 114 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Backmen/Blob/BlobMobSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private void OnSpokeName(Entity<BlobSpeakComponent> ent, ref TransformSpeakerNam
{
return;
}
args.Name = Loc.GetString(ent.Comp.Name);
args.VoiceName = Loc.GetString(ent.Comp.Name);
}

private void OnSpokeCan(Entity<BlobSpeakComponent> ent, ref SpeakAttemptEvent args)
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Backmen/Shipwrecked/ShipwreckedRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ private void OnAskGeneratorUnlock(EntityUid uid, ShipwreckedNPCHecateComponent c
continue;
if (TryComp<AirlockComponent>(row, out var airlock) && !airlock.EmergencyAccess)
{
_airlockSystem.ToggleEmergencyAccess(row, airlock);
_airlockSystem.SetEmergencyAccess((row, airlock), true);
continue;
}
_lockSystem.Unlock(row, uid);
Expand Down Expand Up @@ -1833,7 +1833,7 @@ private void OnAskWeaponsUnlock(EntityUid uid, ShipwreckedNPCHecateComponent com
}
if (TryComp<AirlockComponent>(row, out var airlock) && !airlock.EmergencyAccess)
{
_airlockSystem.ToggleEmergencyAccess(row, airlock);
_airlockSystem.SetEmergencyAccess((row, airlock), true);
continue;
}
_lockSystem.Unlock(row, uid);
Expand Down
1 change: 1 addition & 0 deletions Content.Server/Backmen/Supermatter/SupermatterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Content.Shared.Backmen.CCVar;
using Content.Shared.Backmen.Supermatter;
using Content.Shared.Backmen.Supermatter.Components;
using Content.Shared.Explosion.Components;
using Content.Shared.Interaction;
using Content.Shared.Mobs.Components;
using Content.Shared.Projectiles;
Expand Down
26 changes: 13 additions & 13 deletions Content.Server/Corvax/TTS/VoiceMaskSystem.TTS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ private void OnChangeVoice(EntityUid uid, VoiceMaskComponent component, VoiceMas

_popupSystem.PopupEntity(Loc.GetString("voice-mask-voice-popup-success"), uid);

TrySetLastKnownVoice(uid, message.Voice);
// TrySetLastKnownVoice(uid, message.Voice);

UpdateUI(uid, component);
UpdateUI((uid, component));
}

private void TrySetLastKnownVoice(EntityUid maskWearer, string? voiceId)
{
if (!HasComp<VoiceMaskComponent>(maskWearer)
|| !_inventory.TryGetSlotEntity(maskWearer, MaskSlot, out var maskEntity)
|| !TryComp<VoiceMaskerComponent>(maskEntity, out var maskComp))
{
return;
}

maskComp.LastSetVoice = voiceId;
}
// private void TrySetLastKnownVoice(EntityUid maskWearer, string? voiceId)
// {
// if (!HasComp<VoiceMaskComponent>(maskWearer)
// || ! _inventory.TryGetSlotEntity(maskWearer, MaskSlot, out var maskEntity)
// || !TryComp<VoiceMaskerComponent>(maskEntity, out var maskComp))
// {
// return;
// }
//
// maskComp.LastSetVoice = voiceId;
// }
}
10 changes: 4 additions & 6 deletions Content.Server/VoiceMask/VoiceMaskSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ public override void Initialize()
SubscribeLocalEvent<VoiceMaskComponent, InventoryRelayedEvent<TransformSpeakerNameEvent>>(OnTransformSpeakerName);
SubscribeLocalEvent<VoiceMaskComponent, VoiceMaskChangeNameMessage>(OnChangeName);
SubscribeLocalEvent<VoiceMaskComponent, VoiceMaskChangeVerbMessage>(OnChangeVerb);
SubscribeLocalEvent<VoiceMaskComponent, WearerMaskToggledEvent>(OnMaskToggled);
SubscribeLocalEvent<VoiceMaskerComponent, ClothingGotEquippedEvent>(OnEquip);
SubscribeLocalEvent<VoiceMaskerComponent, ClothingGotUnequippedEvent>(OnUnequip);
SubscribeLocalEvent<VoiceMaskSetNameEvent>(OnSetName);
// SubscribeLocalEvent<VoiceMaskerComponent, GetVerbsEvent<AlternativeVerb>>(GetVerbs);
SubscribeLocalEvent<VoiceMaskComponent, ClothingGotEquippedEvent>(OnEquip);
InitializeTTS(); // Corvax-TTS
SubscribeLocalEvent<VoiceMaskSetNameEvent>(OpenUI);

}

private void OnTransformSpeakerName(Entity<VoiceMaskComponent> entity, ref InventoryRelayedEvent<TransformSpeakerNameEvent> args)
Expand Down Expand Up @@ -95,7 +92,8 @@ private void OpenUI(VoiceMaskSetNameEvent ev)
private void UpdateUI(Entity<VoiceMaskComponent> entity)
{
if (_uiSystem.HasUi(entity, VoiceMaskUIKey.Key))
_uiSystem.SetUiState(entity.Owner, VoiceMaskUIKey.Key, new VoiceMaskBuiState(GetCurrentVoiceName(entity), entity.Comp.VoiceMaskSpeechVerb));
_uiSystem.SetUiState(entity.Owner, VoiceMaskUIKey.Key, new VoiceMaskBuiState(GetCurrentVoiceName(entity), entity.Comp.VoiceId, entity.Comp.VoiceMaskSpeechVerb));

}
#endregion

Expand Down
135 changes: 67 additions & 68 deletions Content.Shared/_EinsteinEngines/Showers/SharedShowerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,88 +5,87 @@
using Robust.Shared.Random;
using Robust.Shared.Utility;

namespace Content.Shared.Showers
namespace Content.Shared.Showers;

public abstract class SharedShowerSystem : EntitySystem
{
public abstract class SharedShowerSystem : EntitySystem
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ShowerComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<ShowerComponent, GetVerbsEvent<AlternativeVerb>>(OnToggleShowerVerb);
SubscribeLocalEvent<ShowerComponent, ActivateInWorldEvent>(OnActivateInWorld);
}
private void OnMapInit(EntityUid uid, ShowerComponent component, MapInitEvent args)
{
if (_random.Prob(0.5f))
component.ToggleShower = true;
UpdateAppearance(uid);
}
private void OnToggleShowerVerb(EntityUid uid, ShowerComponent component, GetVerbsEvent<AlternativeVerb> args)
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
public override void Initialize()
if (!args.CanInteract || !args.CanAccess || args.Hands == null)
return;

AlternativeVerb toggleVerb = new()
{
base.Initialize();
SubscribeLocalEvent<ShowerComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<ShowerComponent, GetVerbsEvent<AlternativeVerb>>(OnToggleShowerVerb);
SubscribeLocalEvent<ShowerComponent, ActivateInWorldEvent>(OnActivateInWorld);
}
private void OnMapInit(EntityUid uid, ShowerComponent component, MapInitEvent args)
Act = () => ToggleShowerHead(uid, args.User, component)
};

if (component.ToggleShower)
{
if (_random.Prob(0.5f))
component.ToggleShower = true;
UpdateAppearance(uid);
toggleVerb.Text = Loc.GetString("shower-turn-on");
toggleVerb.Icon =
new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/VerbIcons/open.svg.192dpi.png"));
}
private void OnToggleShowerVerb(EntityUid uid, ShowerComponent component, GetVerbsEvent<AlternativeVerb> args)
else
{
if (!args.CanInteract || !args.CanAccess || args.Hands == null)
return;

AlternativeVerb toggleVerb = new()
{
Act = () => ToggleShowerHead(uid, args.User, component)
};

if (component.ToggleShower)
{
toggleVerb.Text = Loc.GetString("shower-turn-on");
toggleVerb.Icon =
new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/VerbIcons/open.svg.192dpi.png"));
}
else
{
toggleVerb.Text = Loc.GetString("shower-turn-off");
toggleVerb.Icon =
new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/VerbIcons/close.svg.192dpi.png"));
}
args.Verbs.Add(toggleVerb);
toggleVerb.Text = Loc.GetString("shower-turn-off");
toggleVerb.Icon =
new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/VerbIcons/close.svg.192dpi.png"));
}
private void OnActivateInWorld(EntityUid uid, ShowerComponent comp, ActivateInWorldEvent args)
{
if (args.Handled)
return;
args.Verbs.Add(toggleVerb);
}
private void OnActivateInWorld(EntityUid uid, ShowerComponent comp, ActivateInWorldEvent args)
{
if (args.Handled)
return;

args.Handled = true;
ToggleShowerHead(uid, args.User, comp);
args.Handled = true;
ToggleShowerHead(uid, args.User, comp);

_audio.PlayPvs(comp.EnableShowerSound, uid);
}
public void ToggleShowerHead(EntityUid uid, EntityUid? user = null, ShowerComponent? component = null, MetaDataComponent? meta = null)
{
if (!Resolve(uid, ref component))
return;
_audio.PlayPvs(comp.EnableShowerSound, uid);
}
public void ToggleShowerHead(EntityUid uid, EntityUid? user = null, ShowerComponent? component = null, MetaDataComponent? meta = null)
{
if (!Resolve(uid, ref component))
return;

component.ToggleShower = !component.ToggleShower;
component.ToggleShower = !component.ToggleShower;

UpdateAppearance(uid, component);
}
private void UpdateAppearance(EntityUid uid, ShowerComponent? component = null)
{
if (!Resolve(uid, ref component))
return;
UpdateAppearance(uid, component);
}
private void UpdateAppearance(EntityUid uid, ShowerComponent? component = null)
{
if (!Resolve(uid, ref component))
return;

_appearance.SetData(uid, ShowerVisuals.ShowerVisualState, component.ToggleShower ? ShowerVisualState.On : ShowerVisualState.Off);
_appearance.SetData(uid, ShowerVisuals.ShowerVisualState, component.ToggleShower ? ShowerVisualState.On : ShowerVisualState.Off);

if (component.ToggleShower)
{
if (component.PlayingStream == null)
{
component.PlayingStream = _audio.PlayPvs(component.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5)).Value.Entity;
}
}
else
if (component.ToggleShower)
{
if (component.PlayingStream == null)
{
component.PlayingStream = _audio.Stop(component.PlayingStream);
component.PlayingStream = null;
component.PlayingStream = _audio.PlayPvs(component.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5))?.Entity;
}
}
else
{
component.PlayingStream = _audio.Stop(component.PlayingStream);
component.PlayingStream = null;
}
}
}
}
13 changes: 0 additions & 13 deletions Resources/Prototypes/Corvax/Entities/Objects/Misc/rubber_stamp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,3 @@
sprite: Corvax/Objects/Misc/stamps.rsi
state: stamp-iaa

- type: entity
name: psychologist's rubber stamp
parent: RubberStampBase
id: RubberStampPsychologist
suffix: DO NOT MAP
components:
- type: Stamp
stampedName: stamp-component-stamped-name-psychologist
stampedColor: "#0082AE"
stampState: "paper_stamp-psychologist"
- type: Sprite
sprite: Corvax/Objects/Misc/stamps.rsi
state: stamp-psychologist
2 changes: 1 addition & 1 deletion Resources/Prototypes/Corvax/Maps/Pools/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- CorvaxAvrite
- CorvaxAstra
- CorvaxPilgrim
- CorvaxGlacier
# - CorvaxGlacier
- Box
# Midpop
- CorvaxPaper
Expand Down
1 change: 0 additions & 1 deletion Resources/Prototypes/Maps/omega.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#Lawyer: [ 1, 1 ] # Corvax-IAA
#supply
Quartermaster: [ 1, 1 ]
Paramedic: [ 0, 1 ] # backmen-Paramedic
Brigmedic: [ 0, 1 ] # backmen-Brigmedic
SalvageSpecialist: [ 2, 2 ]
CargoTechnician: [ 2, 2 ]
Expand Down
8 changes: 4 additions & 4 deletions Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -869,10 +869,10 @@
factor: 2
- !type:SatiateHunger
factor: -2
conditions:
- !type:OrganType
type: Vampiric
shouldHave: false
conditions:
- !type:OrganType
type: Vampiric
shouldHave: false
- !type:AdjustReagent
reagent: Ethanol
amount: 0.05
Expand Down
10 changes: 5 additions & 5 deletions Resources/Prototypes/_Backmen/Entities/Effects/lightning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
name: lightning
id: Lightning_Backmen
parent: BaseLightning_Backmen
noSpawn: false
categories: [ ]
components:
- type: Lightning
canArc: true
Expand All @@ -40,7 +40,7 @@
name: spooky lightning
id: LightningRevenant_Backmen
parent: BaseLightning_Backmen
noSpawn: false
categories: [ ]
components:
- type: Sprite
sprite: /Textures/Effects/lightning.rsi
Expand All @@ -64,7 +64,7 @@
name: charged lightning
id: ChargedLightning_Backmen
parent: BaseLightning_Backmen
noSpawn: false
categories: [ ]
components:
- type: Sprite
sprite: /Textures/Effects/lightning.rsi
Expand All @@ -83,7 +83,7 @@
name: supercharged lightning
id: SuperchargedLightning_Backmen
parent: ChargedLightning_Backmen
noSpawn: false
categories: [ ]
components:
- type: Sprite
sprite: /Textures/Effects/lightning.rsi
Expand All @@ -109,7 +109,7 @@
name: hypercharged lightning
id: HyperchargedLightning_Backmen
parent: ChargedLightning_Backmen
noSpawn: false
categories: [ ]
components:
- type: Sprite
sprite: /Textures/Effects/lightning.rsi
Expand Down

0 comments on commit d92bf43

Please sign in to comment.