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

Radio station #674

Merged
merged 11 commits into from
Nov 12, 2024
4 changes: 4 additions & 0 deletions Content.Server/Radio/Components/RadioSpeakerComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ public sealed partial class RadioSpeakerComponent : Component

[DataField("enabled")]
public bool Enabled;

[DataField("IsSpeaker")] // Set to true for broadcast radio speakers so that it speaks instead of whispers the message.
public bool IsSpeaker;

}
4 changes: 3 additions & 1 deletion Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ private void OnReceiveRadio(EntityUid uid, RadioSpeakerComponent component, ref

// log to chat so people can identity the speaker/source, but avoid clogging ghost chat if there are many radios
var message = args.OriginalChatMsg.Message; // The chat system will handle the rest and re-obfuscate if needed.
_chat.TrySendInGameICMessage(uid, message, InGameICChatType.Whisper, ChatTransmitRange.GhostRangeLimit, nameOverride: name, checkRadioPrefix: false, languageOverride: args.Language);
var chatType = component.IsSpeaker ? InGameICChatType.Speak : InGameICChatType.Whisper;
_chat.TrySendInGameICMessage(uid, message, chatType, ChatTransmitRange.GhostRangeLimit, nameOverride: name, checkRadioPrefix: false, languageOverride: args.Language);

}

private void OnBeforeIntercomUiOpen(EntityUid uid, IntercomComponent component, BeforeActivatableUIOpenEvent args)
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_Nuclear14/headset-component.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ chat-radio-bosmidwest = Brotherhood Midwest
chat-radio-boswashington = Brotherhood Washington
chat-radio-enclave = Enclave
chat-radio-ncr = NCR
chat-radio-pbs = Public Broadcast
141 changes: 140 additions & 1 deletion Resources/Prototypes/_Nuclear14/Entities/Structures/Misc/radio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,143 @@
mask:
- MachineMask
layer:
- LowImpassable
- LowImpassable

- type: entity # radio station microphone
parent: BaseStructure
id: RadioDJMicrophone
name: radio microphone
description: An decent quality professional microphone for use in DJ booths.
components:
- type: Sprite
sprite: _Nuclear14/Structures/Misc/radiostation/microphones.rsi
layers:
- state: base
- state: on
map: ["enum.PowerDeviceVisualLayers.Powered"]
shader: unshaded
- state: off
map: [ "disabled"]
- type: Appearance
- type: GenericVisualizer
visuals:
enum.PowerDeviceVisuals.Powered:
enum.PowerDeviceVisualLayers.Powered:
True: {visible: true}
False: {visible: false}
- type: ApcPowerReceiver
- type: Electrified
enabled: false
usesApcPower: true
- type: ExtensionCableReceiver
- type: RadioMicrophone
powerRequired: true
broadcastChannel: PBS
toggleOnInteract: true
frequency: 1667
listenRange: 2
- type: Clickable
- type: InteractionOutline
- type: WiresVisuals
- type: Transform
noRot: false
anchored: true
- type: ActiveRadio
channels:
- PBS
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeCircle
radius: 0.20
density: 1000
mask:
- MachineMask
layer:
- MachineLayer

- type: entity # Prototype for radio receivers
name: table radio
description: A simple tabletop radio
parent: BaseStructure
id: N14RadioTable
components:
- type: Sprite #states aren't quite working, will need to address, would like to have it toggle state when you turn on and off the radio
sprite: _Nuclear14/Structures/Misc/radiostation/tableradio.rsi
offset: 0,0.25
drawdepth: SmallObjects
layers:
- sprite: _Nuclear14/Structures/Misc/radiostation/tableradio.rsi
state: base
map: [ "base" ]
- state: on
map: [ "enabled" ]
shader: unshaded
- state: off
map: [ "disabled" ]
- type: RadioSpeaker
channels:
- PBS
enabled: true
toggleOnInteract: true
IsSpeaker: true
- type: Tag
tags:
- Radio
- type: Speech
speechVerb: Robotic
- type: ActiveRadio
channels:
- PBS
- type: RadioMicrophone
broadcastChannel: PBS
toggleOnInteract: false
frequency: 1667
listenRange: 0

- type: entity # Prototype for radio receivers
name: standing microphone
description: A microphone stand and microphone
parent: BaseStructure
id: N14MicrophoneStand
components:
- type: Sprite
sprite: _Nuclear14/Structures/Misc/radiostation/standmicrophones.rsi
state: base
- type: RadioMicrophone
broadcastChannel: PBS
toggleOnInteract: true
frequency: 1667
listenRange: 2
- type: ActiveRadio
channels:
- PBS
listenRange: 2
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.25,0.5,0,-0.5"
layer:
- LowImpassable

- type: entity
parent: PoweredSmallLight
id: N14LightRadioOnAirSign
name: radio on air sign
components:
- type: Sprite
sprite: _Nuclear14/Structures/Misc/radiostation/radioonair.rsi
state: base
layers:
- state: off
- state: on
map: ["enum.PoweredLightLayers.Base"]

- type: WallMount
- type: PointLight
radius: 7
energy: 0.6
softness: 0.4
8 changes: 8 additions & 0 deletions Resources/Prototypes/_Nuclear14/radio_channels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
frequency: 1546
color: "#801c14"

- type: radioChannel
id: PBS
name: chat-radio-pbs
keycode: 'o'
frequency: 1667
color: "#c44508"
longRange: true

# Zetan

# - type: radioChannel
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 1,
"license": "CC-BY-NC-SA-3.0",
"copyright": "made by maxxorion for nuclear14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "base"
},
{
"name": "on"
},
{
"name": "off"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 1,
"license": "CC-BY-NC-SA-3.0",
"copyright": "made by maxxorion for nuclear14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "base"
},
{
"name": "on"
},
{
"name": "off"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": 1,
"license": "CC-BY-NC-SA-3.0",
"copyright": "made by maxxorion for nuclear14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "base",
"directions": 4
},
{
"name": "on"
},
{
"name": "off"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 1,
"license": "CC-BY-NC-SA-3.0",
"copyright": "made by maxxorion for nuclear14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "base"
},
{
"name": "on"
},
{
"name": "off"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading