mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-28 01:51:46 +00:00
* Kills research scanner toggle, moves functionality to examine_more. Improves research scanner code and fixes a modsuit bug. (#66415) * FINALLY. I'VE KILLED IT. I CAN LIVE MY LIFE NOW. I hate the fucking Toggle Research Scanner action button so god damn much. Why the fuck would I ever not want this to be on? Why do you think I'm wearing the fucking goggles? That stupid button is so annoying to use. Even if I'm NOT using the research scanner aspect of the goggles, that little shit floats there, taking up space on my screen, taunting me. Co-authored-by: Fikou <23585223+Fikou@ users.noreply.github.com> * Kills research scanner toggle, moves functionality to examine_more. Improves research scanner code and fixes a modsuit bug. Co-authored-by: Vladin Heir <44104681+VladinXXV@users.noreply.github.com> Co-authored-by: Fikou <23585223+Fikou@ users.noreply.github.com>
133 lines
5.0 KiB
Plaintext
133 lines
5.0 KiB
Plaintext
//Science modules for MODsuits
|
|
|
|
///Reagent Scanner - Lets the user scan reagents.
|
|
/obj/item/mod/module/reagent_scanner
|
|
name = "MOD reagent scanner module"
|
|
desc = "A module based off research-oriented Nanotrasen HUDs, this is capable of scanning the contents of \
|
|
containers and projecting the information in an easy-to-read format on the wearer's display. \
|
|
It cannot detect flavors, so that's up to you."
|
|
icon_state = "scanner"
|
|
module_type = MODULE_TOGGLE
|
|
complexity = 1
|
|
active_power_cost = DEFAULT_CHARGE_DRAIN * 0.2
|
|
incompatible_modules = list(/obj/item/mod/module/reagent_scanner)
|
|
cooldown_time = 0.5 SECONDS
|
|
|
|
/obj/item/mod/module/reagent_scanner/on_activation()
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
ADD_TRAIT(mod.wearer, TRAIT_REAGENT_SCANNER, MOD_TRAIT)
|
|
|
|
/obj/item/mod/module/reagent_scanner/on_deactivation(display_message = TRUE, deleting = FALSE)
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
REMOVE_TRAIT(mod.wearer, TRAIT_REAGENT_SCANNER, MOD_TRAIT)
|
|
|
|
/obj/item/mod/module/reagent_scanner/advanced
|
|
name = "MOD advanced reagent scanner module"
|
|
complexity = 0
|
|
removable = FALSE
|
|
var/explosion_detection_dist = 21
|
|
|
|
/obj/item/mod/module/reagent_scanner/advanced/on_activation()
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
ADD_TRAIT(mod.wearer, TRAIT_RESEARCH_SCANNER, MOD_TRAIT)
|
|
RegisterSignal(SSdcs, COMSIG_GLOB_EXPLOSION, .proc/sense_explosion)
|
|
|
|
/obj/item/mod/module/reagent_scanner/advanced/on_deactivation(display_message = TRUE, deleting = FALSE)
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
REMOVE_TRAIT(mod.wearer, TRAIT_RESEARCH_SCANNER, MOD_TRAIT)
|
|
UnregisterSignal(SSdcs, COMSIG_GLOB_EXPLOSION)
|
|
|
|
/obj/item/mod/module/reagent_scanner/advanced/proc/sense_explosion(datum/source, turf/epicenter,
|
|
devastation_range, heavy_impact_range, light_impact_range, took, orig_dev_range, orig_heavy_range, orig_light_range)
|
|
SIGNAL_HANDLER
|
|
var/turf/wearer_turf = get_turf(mod.wearer)
|
|
if(wearer_turf.z != epicenter.z)
|
|
return
|
|
if(get_dist(epicenter, wearer_turf) > explosion_detection_dist)
|
|
return
|
|
to_chat(mod.wearer, span_notice("Explosion detected! Epicenter: [devastation_range], Outer: [heavy_impact_range], Shock: [light_impact_range]"))
|
|
|
|
///Anti-Gravity - Makes the user weightless.
|
|
/obj/item/mod/module/anomaly_locked/antigrav
|
|
name = "MOD anti-gravity module"
|
|
desc = "A module that uses a gravitational core to make the user completely weightless."
|
|
icon_state = "antigrav"
|
|
module_type = MODULE_TOGGLE
|
|
complexity = 3
|
|
active_power_cost = DEFAULT_CHARGE_DRAIN * 0.7
|
|
incompatible_modules = list(/obj/item/mod/module/anomaly_locked, /obj/item/mod/module/atrocinator)
|
|
cooldown_time = 0.5 SECONDS
|
|
accepted_anomalies = list(/obj/item/assembly/signaler/anomaly/grav)
|
|
|
|
/obj/item/mod/module/anomaly_locked/antigrav/on_activation()
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
if(mod.wearer.has_gravity())
|
|
new /obj/effect/temp_visual/mook_dust(get_turf(src))
|
|
mod.wearer.AddElement(/datum/element/forced_gravity, 0)
|
|
mod.wearer.update_gravity(mod.wearer.has_gravity())
|
|
playsound(src, 'sound/effects/gravhit.ogg', 50)
|
|
|
|
/obj/item/mod/module/anomaly_locked/antigrav/on_deactivation(display_message = TRUE, deleting = FALSE)
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
mod.wearer.RemoveElement(/datum/element/forced_gravity, 0)
|
|
mod.wearer.update_gravity(mod.wearer.has_gravity())
|
|
if(deleting)
|
|
return
|
|
if(mod.wearer.has_gravity())
|
|
new /obj/effect/temp_visual/mook_dust(get_turf(src))
|
|
playsound(src, 'sound/effects/gravhit.ogg', 50)
|
|
|
|
/obj/item/mod/module/anomaly_locked/antigrav/prebuilt
|
|
prebuilt = TRUE
|
|
|
|
///Teleporter - Lets the user teleport to a nearby location.
|
|
/obj/item/mod/module/anomaly_locked/teleporter
|
|
name = "MOD teleporter module"
|
|
desc = "A module that uses a bluespace core to let the user transport their particles elsewhere."
|
|
icon_state = "teleporter"
|
|
module_type = MODULE_ACTIVE
|
|
complexity = 3
|
|
use_power_cost = DEFAULT_CHARGE_DRAIN * 5
|
|
cooldown_time = 5 SECONDS
|
|
accepted_anomalies = list(/obj/item/assembly/signaler/anomaly/bluespace)
|
|
/// Time it takes to teleport
|
|
var/teleport_time = 3 SECONDS
|
|
|
|
/obj/item/mod/module/anomaly_locked/teleporter/on_select_use(atom/target)
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
var/turf/open/target_turf = get_turf(target)
|
|
if(!istype(target_turf) || target_turf.is_blocked_turf_ignore_climbable() || !(target_turf in view(mod.wearer)))
|
|
balloon_alert(mod.wearer, "invalid target!")
|
|
return
|
|
balloon_alert(mod.wearer, "teleporting...")
|
|
var/matrix/pre_matrix = matrix()
|
|
pre_matrix.Scale(4, 0.25)
|
|
var/matrix/post_matrix = matrix()
|
|
post_matrix.Scale(0.25, 4)
|
|
animate(mod.wearer, teleport_time, color = COLOR_CYAN, transform = pre_matrix.Multiply(mod.wearer.transform), easing = EASE_OUT)
|
|
if(!do_after(mod.wearer, teleport_time, target = mod))
|
|
balloon_alert(mod.wearer, "interrupted!")
|
|
animate(mod.wearer, teleport_time*0.1, color = null, transform = post_matrix.Multiply(mod.wearer.transform), easing = EASE_IN)
|
|
return
|
|
animate(mod.wearer, teleport_time*0.1, color = null, transform = post_matrix.Multiply(mod.wearer.transform), easing = EASE_IN)
|
|
if(!do_teleport(mod.wearer, target_turf, asoundin = 'sound/effects/phasein.ogg'))
|
|
return
|
|
drain_power(use_power_cost)
|
|
|
|
/obj/item/mod/module/anomaly_locked/teleporter/prebuilt
|
|
prebuilt = TRUE
|