mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-20 19:49:39 +01:00
# Conflicts: # .github/CODEOWNERS # .github/workflows/compile_changelogs.yml # .github/workflows/stale.yml # SQL/database_changelog.md # _maps/map_files/CatwalkStation/CatwalkStation_2023.dmm # code/__DEFINES/atom_hud.dm # code/__DEFINES/inventory.dm # code/__DEFINES/mobs.dm # code/__DEFINES/species_clothing_paths.dm # code/__DEFINES/subsystems.dm # code/__DEFINES/surgery.dm # code/__HELPERS/global_lists.dm # code/_globalvars/lists/maintenance_loot.dm # code/_globalvars/traits/_traits.dm # code/controllers/subsystem/minor_mapping.dm # code/controllers/subsystem/processing/quirks.dm # code/controllers/subsystem/shuttle.dm # code/datums/components/palette.dm # code/datums/components/surgery_initiator.dm # code/datums/diseases/advance/advance.dm # code/datums/hud.dm # code/datums/mood.dm # code/datums/mutations/chameleon.dm # code/datums/quirks/negative_quirks/nyctophobia.dm # code/datums/status_effects/debuffs/debuffs.dm # code/datums/status_effects/debuffs/drunk.dm # code/datums/status_effects/debuffs/slime/slime_leech.dm # code/datums/weather/weather.dm # code/game/data_huds.dm # code/game/objects/items.dm # code/game/objects/items/devices/scanners/health_analyzer.dm # code/game/objects/items/frog_statue.dm # code/game/objects/items/rcd/RLD.dm # code/game/objects/items/robot/items/hypo.dm # code/game/objects/items/stacks/medical.dm # code/game/objects/items/stacks/wrap.dm # code/game/objects/items/storage/garment.dm # code/game/objects/items/tools/medical/defib.dm # code/game/objects/items/weaponry.dm # code/game/objects/items/weaponry/melee/misc.dm # code/game/objects/structures/crates_lockers/closets/secure/security.dm # code/game/objects/structures/curtains.dm # code/game/objects/structures/dresser.dm # code/game/objects/structures/girders.dm # code/game/objects/structures/maintenance.dm # code/game/objects/structures/mirror.dm # code/modules/admin/greyscale_modify_menu.dm # code/modules/admin/verbs/light_debug.dm # code/modules/antagonists/ashwalker/ashwalker.dm # code/modules/antagonists/heretic/knowledge/starting_lore.dm # code/modules/antagonists/ninja/ninjaDrainAct.dm # code/modules/art/paintings.dm # code/modules/client/preferences.dm # code/modules/client/verbs/ooc.dm # code/modules/clothing/head/wig.dm # code/modules/events/disease_outbreak.dm # code/modules/holodeck/holo_effect.dm # code/modules/jobs/job_types/head_of_security.dm # code/modules/jobs/job_types/security_officer.dm # code/modules/library/skill_learning/generic_skillchips/point.dm # code/modules/mining/lavaland/ash_flora.dm # code/modules/mining/lavaland/mining_loot/megafauna/ash_drake.dm # code/modules/mob/dead/new_player/new_player.dm # code/modules/mob/living/basic/guardian/guardian.dm # code/modules/mob/living/basic/space_fauna/space_dragon/space_dragon.dm # code/modules/mob/living/carbon/carbon.dm # code/modules/mob/living/carbon/human/human.dm # code/modules/mob/living/carbon/human/human_defines.dm # code/modules/mob/living/carbon/life.dm # code/modules/mob/living/living.dm # code/modules/mob/living/living_defines.dm # code/modules/mob/mob.dm # code/modules/mob_spawn/ghost_roles/mining_roles.dm # code/modules/mod/mod_control.dm # code/modules/mod/modules/modules_general.dm # code/modules/modular_computers/computers/item/computer_ui.dm # code/modules/paperwork/paper.dm # code/modules/paperwork/paperbin.dm # code/modules/power/lighting/light.dm # code/modules/projectiles/guns/energy/kinetic_accelerator.dm # code/modules/projectiles/projectile.dm # code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm # code/modules/reagents/chemistry/reagents/food_reagents.dm # code/modules/reagents/chemistry/reagents/other_reagents.dm # code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm # code/modules/research/xenobiology/crossbreeding/_clothing.dm # code/modules/research/xenobiology/crossbreeding/prismatic.dm # code/modules/surgery/advanced/brainwashing.dm # code/modules/surgery/advanced/lobotomy.dm # code/modules/surgery/amputation.dm # code/modules/surgery/blood_filter.dm # code/modules/surgery/bodyparts/_bodyparts.dm # code/modules/surgery/brain_surgery.dm # code/modules/surgery/cavity_implant.dm # code/modules/surgery/coronary_bypass.dm # code/modules/surgery/gastrectomy.dm # code/modules/surgery/healing.dm # code/modules/surgery/limb_augmentation.dm # code/modules/surgery/organ_manipulation.dm # code/modules/surgery/revival.dm # code/modules/surgery/sleeper_protocol.dm # code/modules/surgery/surgery_helpers.dm # code/modules/surgery/surgery_step.dm # code/modules/unit_tests/_unit_tests.dm # code/modules/unit_tests/designs.dm # code/modules/unit_tests/icon_state_worn.dm # code/modules/unit_tests/screenshots/screenshot_antag_icons_cultist.png # code/modules/unit_tests/screenshots/screenshot_antag_icons_headrevolutionary.png # code/modules/unit_tests/screenshots/screenshot_antag_icons_provocateur.png # code/modules/unit_tests/screenshots/screenshot_husk_body.png # code/modules/unit_tests/screenshots/screenshot_husk_body_missing_limbs.png # icons/map_icons/clothing/head/_head.dmi # icons/map_icons/clothing/shoes.dmi # icons/map_icons/items/_item.dmi # icons/mob/huds/hud.dmi # icons/mob/inhands/64x64_lefthand.dmi # icons/mob/inhands/64x64_righthand.dmi # icons/obj/machines/computer.dmi # tgui/packages/tgui/interfaces/OperatingComputer.jsx # tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferences/MainPage.tsx # tgui/packages/tgui/interfaces/PreferencesMenu/types.ts # tgui/packages/tgui/interfaces/SurgeryInitiator.tsx # tools/icon_cutter/check.py
267 lines
9.6 KiB
Plaintext
267 lines
9.6 KiB
Plaintext
/obj/item/radio/intercom //ICON OVERRIDDEN IN SKYRAT AESTHETICS - SEE MODULE
|
|
name = "station intercom"
|
|
desc = "A trusty station intercom, ready to spring into action even when the headsets go silent."
|
|
icon = 'icons/obj/machines/wallmounts.dmi'
|
|
icon_state = "intercom"
|
|
anchored = TRUE
|
|
w_class = WEIGHT_CLASS_BULKY
|
|
canhear_range = 2
|
|
dog_fashion = null
|
|
unscrewed = FALSE
|
|
item_flags = NO_BLOOD_ON_ITEM
|
|
|
|
overlay_speaker_idle = "intercom_s"
|
|
overlay_speaker_active = "intercom_receive"
|
|
|
|
overlay_mic_idle = "intercom_m"
|
|
overlay_mic_active = null
|
|
|
|
///The icon of intercom while its turned off
|
|
var/icon_off = "intercom-p"
|
|
|
|
/obj/item/radio/intercom/unscrewed
|
|
unscrewed = TRUE
|
|
|
|
/obj/item/radio/intercom/prison
|
|
name = "receive-only intercom"
|
|
desc = "A station intercom. It looks like it has been modified to not broadcast."
|
|
icon_state = "intercom_prison"
|
|
icon_off = "intercom_prison-p"
|
|
|
|
/obj/item/radio/intercom/prison/Initialize(mapload)
|
|
. = ..()
|
|
wires?.cut(WIRE_TX)
|
|
|
|
/obj/item/radio/intercom/Initialize(mapload)
|
|
. = ..()
|
|
var/area/current_area = get_area(src)
|
|
if(!current_area)
|
|
return
|
|
RegisterSignal(current_area, COMSIG_AREA_POWER_CHANGE, PROC_REF(AreaPowerCheck))
|
|
if(mapload)
|
|
find_and_mount_on_atom()
|
|
GLOB.intercoms_list += src
|
|
|
|
/obj/item/radio/intercom/Destroy()
|
|
GLOB.intercoms_list -= src
|
|
return ..()
|
|
|
|
/obj/item/radio/intercom/examine(mob/user)
|
|
. = ..()
|
|
. += span_notice("Use [MODE_TOKEN_INTERCOM] when nearby to speak into it.")
|
|
if(!unscrewed)
|
|
. += span_notice("It's <b>screwed</b> and secured to the wall.")
|
|
else
|
|
. += span_notice("It's <i>unscrewed</i> from the wall, and can be <b>detached</b>.")
|
|
|
|
if(anonymize)
|
|
. += span_notice("Speaking through this intercom will anonymize your voice.")
|
|
|
|
if(freqlock == RADIO_FREQENCY_UNLOCKED)
|
|
if(obj_flags & EMAGGED)
|
|
. += span_warning("Its frequency lock has been shorted...")
|
|
else
|
|
. += span_notice("It has a frequency lock set to [frequency/10].")
|
|
|
|
/obj/item/radio/intercom/add_context(atom/source, list/context, obj/item/held_item, mob/user)
|
|
. = ..()
|
|
if(held_item?.tool_behaviour == TOOL_SCREWDRIVER)
|
|
context[SCREENTIP_CONTEXT_RMB] = unscrewed ? "Secure to wall" : "Unscrew from wall"
|
|
context[SCREENTIP_CONTEXT_LMB] = isnull(keyslot) ? context[SCREENTIP_CONTEXT_RMB] : "Remove encryption key" // sometimes same behavior
|
|
. = CONTEXTUAL_SCREENTIP_SET
|
|
|
|
if(held_item?.tool_behaviour == TOOL_WRENCH && unscrewed)
|
|
context[SCREENTIP_CONTEXT_RMB] = "Detach from wall"
|
|
context[SCREENTIP_CONTEXT_LMB] = context[SCREENTIP_CONTEXT_LMB] // same behavior
|
|
. = CONTEXTUAL_SCREENTIP_SET
|
|
|
|
/obj/item/radio/intercom/screwdriver_act_secondary(mob/living/user, obj/item/tool)
|
|
if(unscrewed)
|
|
user.visible_message(span_notice("[user] starts tightening [src]'s screws..."), span_notice("You start screwing in [src]..."))
|
|
if(tool.use_tool(src, user, 30, volume=50))
|
|
user.visible_message(span_notice("[user] tightens [src]'s screws!"), span_notice("You tighten [src]'s screws."))
|
|
unscrewed = FALSE
|
|
update_appearance(UPDATE_OVERLAYS)
|
|
else
|
|
user.visible_message(span_notice("[user] starts loosening [src]'s screws..."), span_notice("You start unscrewing [src]..."))
|
|
if(tool.use_tool(src, user, 40, volume=50))
|
|
user.visible_message(span_notice("[user] loosens [src]'s screws!"), span_notice("You unscrew [src], loosening it from the wall."))
|
|
unscrewed = TRUE
|
|
update_appearance(UPDATE_OVERLAYS)
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
/obj/item/radio/intercom/screwdriver_act(mob/living/user, obj/item/tool)
|
|
if(isnull(keyslot))
|
|
return screwdriver_act_secondary(user, tool)
|
|
return ..()
|
|
|
|
/obj/item/radio/intercom/wrench_act(mob/living/user, obj/item/tool)
|
|
if(!unscrewed)
|
|
to_chat(user, span_warning("You need to unscrew [src] from the wall first!"))
|
|
return ITEM_INTERACT_BLOCKING
|
|
user.visible_message(span_notice("[user] starts unsecuring [src]..."), span_notice("You start unsecuring [src]..."))
|
|
tool.play_tool_sound(src)
|
|
if(tool.use_tool(src, user, 80))
|
|
user.visible_message(span_notice("[user] unsecures [src]!"), span_notice("You detach [src] from the wall."))
|
|
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
|
|
deconstruct(TRUE)
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
/obj/item/radio/intercom/wrench_act_secondary(mob/living/user, obj/item/tool)
|
|
return wrench_act(user, tool)
|
|
|
|
/**
|
|
* Override attack_tk_grab instead of attack_tk because we actually want attack_tk's
|
|
* functionality. What we DON'T want is attack_tk_grab attempting to pick up the
|
|
* intercom as if it was an ordinary item.
|
|
*/
|
|
/obj/item/radio/intercom/attack_tk_grab(mob/user)
|
|
interact(user)
|
|
return COMPONENT_CANCEL_ATTACK_CHAIN
|
|
|
|
|
|
/obj/item/radio/intercom/attack_ai(mob/user)
|
|
interact(user)
|
|
|
|
/obj/item/radio/intercom/attack_robot(mob/user)
|
|
interact(user)
|
|
|
|
/obj/item/radio/intercom/attack_hand(mob/user, list/modifiers)
|
|
. = ..()
|
|
if(.)
|
|
return
|
|
interact(user)
|
|
|
|
/obj/item/radio/intercom/ui_state(mob/user)
|
|
return GLOB.default_state
|
|
|
|
/obj/item/radio/intercom/can_receive(freq, list/levels)
|
|
if(levels != RADIO_NO_Z_LEVEL_RESTRICTION)
|
|
var/turf/position = get_turf(src)
|
|
if(isnull(position) || !(position.z in levels))
|
|
return FALSE
|
|
|
|
if(freq == FREQ_SYNDICATE)
|
|
if(!(special_channels &= RADIO_SPECIAL_SYNDIE))
|
|
return FALSE//Prevents broadcast of messages over devices lacking the encryption
|
|
|
|
return TRUE
|
|
|
|
/obj/item/radio/intercom/Hear(atom/movable/speaker, message_langs, raw_message, radio_freq, radio_freq_name, radio_freq_color, list/spans, list/message_mods = list(), message_range)
|
|
if(message_mods[RADIO_EXTENSION] == MODE_INTERCOM)
|
|
return // Avoid hearing the same thing twice
|
|
return ..()
|
|
|
|
/obj/item/radio/intercom/emp_act(severity)
|
|
. = ..() // Parent call here will set `on` to FALSE.
|
|
update_appearance()
|
|
|
|
/obj/item/radio/intercom/end_emp_effect(curremp)
|
|
. = ..()
|
|
AreaPowerCheck() // Make sure the area/local APC is powered first before we actually turn back on.
|
|
|
|
/obj/item/radio/intercom/emag_act(mob/user, obj/item/card/emag/emag_card)
|
|
. = ..()
|
|
|
|
if(obj_flags & EMAGGED)
|
|
return
|
|
|
|
switch(freqlock)
|
|
// Emagging an intercom with an emaggable lock will remove the lock
|
|
if(RADIO_FREQENCY_EMAGGABLE_LOCK)
|
|
balloon_alert(user, "frequency lock cleared")
|
|
playsound(src, SFX_SPARKS, 75, TRUE, SILENCED_SOUND_EXTRARANGE)
|
|
freqlock = RADIO_FREQENCY_UNLOCKED
|
|
obj_flags |= EMAGGED
|
|
return TRUE
|
|
|
|
// A fully locked one will do nothing, as locked is intended to be used for stuff that should never be changed
|
|
if(RADIO_FREQENCY_LOCKED)
|
|
balloon_alert(user, "can't override frequency lock!")
|
|
playsound(src, 'sound/machines/buzz/buzz-two.ogg', 50, FALSE, SILENCED_SOUND_EXTRARANGE)
|
|
return
|
|
|
|
// Emagging an unlocked one will do nothing, for now
|
|
else
|
|
return
|
|
|
|
/obj/item/radio/intercom/update_icon_state()
|
|
icon_state = on ? initial(icon_state) : icon_off
|
|
return ..()
|
|
|
|
/**
|
|
* Proc called whenever the intercom's area loses or gains power. Responsible for setting the `on` variable and calling `update_icon()`.
|
|
*
|
|
* Normally called after the intercom's area receives the `COMSIG_AREA_POWER_CHANGE` signal, but it can also be called directly.
|
|
* Arguments:
|
|
* * source - the area that just had a power change.
|
|
*/
|
|
/obj/item/radio/intercom/proc/AreaPowerCheck(datum/source)
|
|
SIGNAL_HANDLER
|
|
var/area/current_area = get_area(src)
|
|
if(!current_area)
|
|
set_on(FALSE)
|
|
else
|
|
set_on(current_area.powered(AREA_USAGE_EQUIP)) // set "on" to the equipment power status of our area.
|
|
update_appearance()
|
|
|
|
/**
|
|
* Called by the wall mount component and reused during the tool deconstruction proc.
|
|
*/
|
|
/obj/item/radio/intercom/atom_deconstruct(disassembled)
|
|
new/obj/item/wallframe/intercom(get_turf(src))
|
|
|
|
//Created through the autolathe or through deconstructing intercoms. Can be applied to wall to make a new intercom on it!
|
|
/obj/item/wallframe/intercom
|
|
name = "intercom frame"
|
|
desc = "A ready-to-go intercom. Just slap it on a wall and screw it in!"
|
|
icon = 'icons/obj/machines/wallmounts.dmi'
|
|
icon_state = "intercom"
|
|
result_path = /obj/item/radio/intercom/unscrewed
|
|
pixel_shift = 26
|
|
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
|
|
|
|
MAPPING_DIRECTIONAL_HELPERS(/obj/item/radio/intercom, 27)
|
|
|
|
/obj/item/radio/intercom/chapel
|
|
name = "Confessional intercom"
|
|
desc = "Talk through this... to confess your many sins. Conceals your voice, to keep them secret."
|
|
anonymize = TRUE
|
|
freqlock = RADIO_FREQENCY_EMAGGABLE_LOCK
|
|
|
|
/obj/item/radio/intercom/chapel/Initialize(mapload)
|
|
. = ..()
|
|
set_frequency(1481)
|
|
set_broadcasting(TRUE)
|
|
|
|
/obj/item/radio/intercom/command
|
|
name = "command intercom"
|
|
desc = "The command's special free-frequency intercom. It's a versatile tool that can be tuned to any frequency, granting you access to channels you're not supposed to be on. Plus, it comes equipped with a built-in voice amplifier for crystal-clear communication."
|
|
icon_state = "intercom_command"
|
|
freerange = TRUE
|
|
command = TRUE
|
|
icon_off = "intercom_command-p"
|
|
|
|
/obj/item/radio/intercom/syndicate
|
|
name = "syndicate intercom"
|
|
desc = "Talk smack through this."
|
|
command = TRUE
|
|
special_channels = RADIO_SPECIAL_SYNDIE
|
|
|
|
/obj/item/radio/intercom/syndicate/freerange
|
|
name = "syndicate wide-band intercom"
|
|
desc = "A custom-made Syndicate-issue intercom used to transmit on all Nanotrasen frequencies. Particularly expensive."
|
|
freerange = TRUE
|
|
|
|
/obj/item/radio/intercom/mi13
|
|
name = "intercom"
|
|
desc = "Talk through this to talk to whoever is in this facility with you."
|
|
freerange = TRUE
|
|
|
|
MAPPING_DIRECTIONAL_HELPERS(/obj/item/radio/intercom/prison, 27)
|
|
MAPPING_DIRECTIONAL_HELPERS(/obj/item/radio/intercom/chapel, 27)
|
|
MAPPING_DIRECTIONAL_HELPERS(/obj/item/radio/intercom/command, 27)
|
|
MAPPING_DIRECTIONAL_HELPERS(/obj/item/radio/intercom/syndicate, 27)
|
|
MAPPING_DIRECTIONAL_HELPERS(/obj/item/radio/intercom/syndicate/freerange, 27)
|
|
MAPPING_DIRECTIONAL_HELPERS(/obj/item/radio/intercom/mi13, 27)
|