mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 02:56:14 +01:00
Explosives science experiments (#19359)
* yay explosions * i have no idea what i am doing with tgui * experiment stuff done * time title * tabs * . * searh handling * - * make it a bit easier to understand * use correct time * tuned --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -134,22 +134,23 @@
|
||||
to_chat(user, span_notice("[target] is not related to your currently selected experiment."))
|
||||
|
||||
/**
|
||||
* Hooks on destructive scans to try and run an experiment (When using a handheld handler)
|
||||
* Hooks on destructive scans to try and run a destructive analyzer experiment.
|
||||
*/
|
||||
/datum/component/experiment_handler/proc/try_run_destructive_experiment(datum/source, atom/scan_target)
|
||||
/datum/component/experiment_handler/proc/try_run_destructive_experiment(obj/source, atom/scan_target)
|
||||
SIGNAL_HANDLER
|
||||
var/atom/movable/our_scanner = parent
|
||||
if (selected_experiment == null && !(config_flags & EXPERIMENT_CONFIG_ALWAYS_ACTIVE) )
|
||||
if(!(config_flags & EXPERIMENT_CONFIG_SILENT_FAIL))
|
||||
playsound(our_scanner, 'sound/machines/buzz-sigh.ogg', 25)
|
||||
to_chat(our_scanner, span_notice("No experiment selected!"))
|
||||
return
|
||||
|
||||
if(action_experiment(source, scan_target))
|
||||
playsound(our_scanner, 'sound/machines/ping.ogg', 25)
|
||||
to_chat(our_scanner, span_notice("The scan succeeds."))
|
||||
else if(!(config_flags & EXPERIMENT_CONFIG_SILENT_FAIL))
|
||||
playsound(src, 'sound/machines/buzz-sigh.ogg', 25)
|
||||
our_scanner.atom_say("The scan did not result in anything.")
|
||||
playsound(source, 'sound/machines/ping.ogg', 25)
|
||||
source.atom_say("Destructive analysis complete.")
|
||||
|
||||
/**
|
||||
* Hooks on doppler array scans to try and run a explosive experiment.
|
||||
*/
|
||||
/datum/component/experiment_handler/proc/try_run_ordinance_experiment(obj/source, turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, seconds_taken)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(action_experiment(source, epicenter, devastation_range, heavy_impact_range, light_impact_range, seconds_taken))
|
||||
playsound(source, 'sound/machines/ping.ogg', 25)
|
||||
|
||||
/// Hooks on a successful autopsy experiment
|
||||
/datum/component/experiment_handler/proc/try_run_autopsy_experiment(obj/source, mob/living/target)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/datum/experiment/ordnance/lowyieldbomb
|
||||
name = "Explosive Sensor Test"
|
||||
description = "Detonate a simple explosive and record observations using a doppler array."
|
||||
required_devastation_range = 1
|
||||
required_heavy_impact_range = 1
|
||||
|
||||
/datum/experiment/ordnance/highyieldbomb
|
||||
name = "High Yield Explosives Test"
|
||||
description = "Detonate a much bigger explosive and record observations using a doppler array."
|
||||
required_devastation_range = 3
|
||||
required_heavy_impact_range = 5
|
||||
@@ -0,0 +1,30 @@
|
||||
/datum/experiment/ordnance
|
||||
name = "Explosives Research"
|
||||
description = "An experiment conducted in the phoronics subdepartment."
|
||||
exp_tag = EXPERIMENT_TAG_ORDINANCE
|
||||
performance_hint = "Perform research using explosive devices."
|
||||
allowed_experimentors = list(/obj/machinery/doppler_array)
|
||||
var/required_devastation_range = 0
|
||||
var/required_heavy_impact_range = 0
|
||||
var/required_light_impact_range = 0
|
||||
var/explosion_criteria_met = FALSE
|
||||
|
||||
/datum/experiment/ordnance/is_complete()
|
||||
return explosion_criteria_met
|
||||
|
||||
/datum/experiment/ordnance/check_progress()
|
||||
var/status_message = "Detonate an explosive of sufficient size and detect it with a doppler array."
|
||||
. += EXPERIMENT_PROG_BOOL(status_message, is_complete())
|
||||
|
||||
/datum/experiment/ordnance/actionable(datum/component/experiment_handler/experiment_handler)
|
||||
return !is_complete()
|
||||
|
||||
/datum/experiment/ordnance/perform_experiment_actions(datum/component/experiment_handler/experiment_handler, turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, seconds_taken)
|
||||
if(devastation_range < required_devastation_range)
|
||||
return FALSE
|
||||
if(heavy_impact_range < required_heavy_impact_range)
|
||||
return FALSE
|
||||
if(light_impact_range < required_light_impact_range)
|
||||
return FALSE
|
||||
explosion_criteria_met = TRUE
|
||||
return TRUE
|
||||
@@ -38,6 +38,7 @@ It is used to destroy hand-held objects and advance technological research. Used
|
||||
)
|
||||
. = ..()
|
||||
default_apply_parts()
|
||||
ADD_TRAIT(src, TRAIT_ALT_CLICK_BLOCKER, ROUNDSTART_TRAIT)
|
||||
|
||||
/obj/machinery/rnd/destructive_analyzer/Destroy()
|
||||
rmat = null
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
"large_Grenade",
|
||||
)
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = TECHWEB_TIER_3_POINTS)
|
||||
// required_experiments = list(/datum/experiment/ordnance/explosive/lowyieldbomb)
|
||||
required_experiments = list(/datum/experiment/ordnance/lowyieldbomb)
|
||||
announce_channels = list(CHANNEL_SECURITY, CHANNEL_MEDICAL)
|
||||
|
||||
/datum/techweb_node/exotic_ammo
|
||||
@@ -308,7 +308,7 @@
|
||||
// "techshotshell",
|
||||
)
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = TECHWEB_TIER_4_POINTS)
|
||||
// discount_experiments = list(/datum/experiment/ordnance/explosive/highyieldbomb = TECHWEB_TIER_4_POINTS)
|
||||
discount_experiments = list(/datum/experiment/ordnance/highyieldbomb = TECHWEB_TIER_4_POINTS)
|
||||
announce_channels = list(CHANNEL_SECURITY)
|
||||
|
||||
/datum/techweb_node/electric_weapons
|
||||
|
||||
Reference in New Issue
Block a user