Skip to content

Commit

Permalink
[Bounty] Adds sechailer, and fixes the single problem it had (Bubbers…
Browse files Browse the repository at this point in the history
…tation#1912)

## About The Pull Request
does as title says

## Why It's Good For The Game
was a bounty to finish Bubberstation#1401

## Proof Of Testing

![image](https://github.com/user-attachments/assets/f51990f0-5078-40e6-958b-433b5497120c)
I kept trying to get a video but it kept being too big womp womp, the
issue is fixed though

## Changelog

:cl:
add: Adds sec hailer
/:cl:

---------

Co-authored-by: Waterpig <[email protected]>
Co-authored-by: Waterpig <[email protected]>
  • Loading branch information
3 people authored Aug 12, 2024
1 parent 4e2687f commit 420622e
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
73 changes: 73 additions & 0 deletions modular_zubbers/code/game/Items/sec_hailer.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/obj/item/clothing/mask/gas/sechailer
// Did the hailer get EMP'd?
var/emped = FALSE
var/obj/item/radio/intercom/radio
COOLDOWN_DECLARE(backup_cooldown)
actions_types = list(/datum/action/item_action/backup, /datum/action/item_action/halt, /datum/action/item_action/adjust)

// Swat Mask too
/obj/item/clothing/mask/gas/sechailer/swat
actions_types = list(/datum/action/item_action/backup, /datum/action/item_action/halt)

/datum/action/item_action/backup
name = "BACKUP!"

/// Add the Radio
/obj/item/clothing/mask/gas/sechailer/Initialize(mapload)
. = ..()
AddElement(/datum/element/empprotection, EMP_PROTECT_CONTENTS)
radio = new(src)
radio.set_frequency(FREQ_SECURITY)
radio.set_listening(FALSE, FALSE)
radio.recalculateChannels()

/obj/item/clothing/mask/gas/sechailer/Destroy()
QDEL_NULL(radio)
. = ..()

/// If EMP'd, become EMP'd
/obj/item/clothing/mask/gas/sechailer/emp_act(severity)
. = ..()
if(!emped)
balloon_alert_to_viewers("Backup Hailer Malfunctioning!", vision_distance = 1)
emped = TRUE
addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/item/clothing/mask/gas/sechailer, emp_reset)), 2 MINUTES)

/// Reset EMP after 2 minutes
/obj/item/clothing/mask/gas/sechailer/proc/emp_reset()
SIGNAL_HANDLER

balloon_alert(src, "Backup Hailer Recalibrated")
emped = FALSE

/obj/item/clothing/mask/gas/sechailer/ui_action_click(mob/user, action)
if (istype(action, /datum/action/item_action/backup))
backup()
else if (istype(action, /datum/action/item_action/halt))
halt()
else
adjust_visor(user)

/obj/item/clothing/mask/gas/sechailer/proc/backup()
var/turf/turf_location = get_turf(src)
var/location = get_area_name(turf_location)

if (!isliving(usr) || !can_use(usr))
return
if (!COOLDOWN_FINISHED(src, backup_cooldown))
balloon_alert(usr, "On Cooldown!")
return
if (emped)
balloon_alert(usr, "Backup Malfunctioning!")
return
if (!is_station_level(turf_location.z))
balloon_alert(usr, "Out of Range!")
return

COOLDOWN_START(src, backup_cooldown, 1 MINUTES)
radio.talk_into(usr, "Backup Requested in [location]!", RADIO_CHANNEL_SECURITY)
usr.audible_message("<font color='red' size='5'><b>BACKUP REQUESTED!</b></font>")
balloon_alert_to_viewers("Backup Requested!", "Backup Requested!", 7)
log_combat(usr, src, "has called for backup")
playsound(usr, 'sound/misc/whistle.ogg', 50, FALSE, 4)

1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -8605,6 +8605,7 @@
#include "modular_zubbers\code\game\Items\coins.dm"
#include "modular_zubbers\code\game\Items\nerdcrowbar.dm"
#include "modular_zubbers\code\game\Items\plushes.dm"
#include "modular_zubbers\code\game\Items\sec_hailer.dm"
#include "modular_zubbers\code\game\Items\storage\backpack.dm"
#include "modular_zubbers\code\game\Items\storage\medkit.dm"
#include "modular_zubbers\code\game\machinery\crew_monitor.dm"
Expand Down

0 comments on commit 420622e

Please sign in to comment.