forked from Bubberstation/Bubberstation
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bounty] Adds sechailer, and fixes the single problem it had (Bubbers…
…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
1 parent
4e2687f
commit 420622e
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters