diff --git a/code/__DEFINES/components.dm b/code/__DEFINES/components.dm index 9b17907f006..b2e7ad91160 100644 --- a/code/__DEFINES/components.dm +++ b/code/__DEFINES/components.dm @@ -92,6 +92,8 @@ #define COMSIG_ATOM_NARSIE_ACT "atom_narsie_act" //from base of atom/narsie_act(): () #define COMSIG_ATOM_RCD_ACT "atom_rcd_act" //from base of atom/rcd_act(): (/mob, /obj/item/construction/rcd, passed_mode) #define COMSIG_ATOM_SING_PULL "atom_sing_pull" //from base of atom/singularity_pull(): (S, current_size) +#define COMSIG_ATOM_BSA_BEAM "atom_bsa_beam_pass" //from obj/machinery/bsa/full/proc/fire(): () + #define COMSIG_ATOM_BLOCKS_BSA_BEAM 1 #define COMSIG_ATOM_SET_LIGHT "atom_set_light" //from base of atom/set_light(): (l_range, l_power, l_color) #define COMSIG_ATOM_DIR_CHANGE "atom_dir_change" //from base of atom/setDir(): (old_dir, new_dir) #define COMSIG_ATOM_CONTENTS_DEL "atom_contents_del" //from base of atom/handle_atom_del(): (atom/deleted) diff --git a/code/datums/elements/bsa_blocker.dm b/code/datums/elements/bsa_blocker.dm new file mode 100644 index 00000000000..61140ad0ed5 --- /dev/null +++ b/code/datums/elements/bsa_blocker.dm @@ -0,0 +1,10 @@ +//blocks bluespace artillery beams that try to fly through +//look not all elements need to be fancy +/datum/element/bsa_blocker/Attach(datum/target) + if(!isatom(target)) + return ELEMENT_INCOMPATIBLE + RegisterSignal(target, COMSIG_ATOM_BSA_BEAM, .proc/block_bsa) + return ..() + +/datum/element/bsa_blocker/proc/block_bsa() + return COMSIG_ATOM_BLOCKS_BSA_BEAM diff --git a/code/modules/power/singularity/narsie.dm b/code/modules/power/singularity/narsie.dm index 0282511d3de..8de860dd0fe 100644 --- a/code/modules/power/singularity/narsie.dm +++ b/code/modules/power/singularity/narsie.dm @@ -36,6 +36,7 @@ var/mutable_appearance/alert_overlay = mutable_appearance('icons/effects/cult_effects.dmi', "ghostalertsie") notify_ghosts("Nar'Sie has risen in \the [A.name]. Reach out to the Geometer to be given a new shell for your soul.", source = src, alert_overlay = alert_overlay, action=NOTIFY_ATTACK) INVOKE_ASYNC(src, .proc/narsie_spawn_animation) + UnregisterSignal(src, COMSIG_ATOM_BSA_BEAM) //set up in /singularity/Initialize() /obj/singularity/narsie/large/cult // For the new cult ending, guaranteed to end the round within 3 minutes var/list/souls_needed = list() diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index d3865389d89..0b59011422b 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -43,7 +43,8 @@ if(singubeacon.active) target = singubeacon break - return + AddElement(/datum/element/bsa_blocker) + RegisterSignal(src, COMSIG_ATOM_BSA_BEAM, .proc/bluespace_reaction) /obj/singularity/Destroy() STOP_PROCESSING(SSobj, src) @@ -447,6 +448,10 @@ qdel(src) return(gain) +/obj/singularity/proc/bluespace_reaction() + investigate_log("has been shot by bluespace artillery and destroyed.", INVESTIGATE_SINGULO) + qdel(src) + /obj/singularity/deadchat_controlled move_self = FALSE diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 88296432ca9..f3e386621cc 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -179,6 +179,9 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) if(is_main_engine) GLOB.main_supermatter_engine = src + AddElement(/datum/element/bsa_blocker) + RegisterSignal(src, COMSIG_ATOM_BSA_BEAM, .proc/call_explode) + soundloop = new(list(src), TRUE) /obj/machinery/power/supermatter_crystal/Destroy() @@ -306,6 +309,10 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) E.energy = power qdel(src) +//this is here to eat arguments +/obj/machinery/power/supermatter_crystal/proc/call_explode() + explode() + /obj/machinery/power/supermatter_crystal/process_atmos() var/turf/T = loc diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index 502fd567a60..2a4ce51d42a 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -178,17 +178,38 @@ reload() /obj/machinery/bsa/full/proc/fire(mob/user, turf/bullseye) + reload() + var/turf/point = get_front_turf() - for(var/turf/T in getline(get_step(point,dir),get_target_turf())) - T.ex_act(EXPLODE_DEVASTATE) - point.Beam(get_target_turf(),icon_state="bsa_beam",time=50,maxdistance = world.maxx) //ZZZAP + var/turf/target = get_target_turf() + var/atom/movable/blocker + for(var/T in getline(get_step(point, dir), target)) + var/turf/tile = T + if(SEND_SIGNAL(tile, COMSIG_ATOM_BSA_BEAM) & COMSIG_ATOM_BLOCKS_BSA_BEAM) + blocker = tile + else + for(var/AM in tile) + var/atom/movable/stuff = AM + if(SEND_SIGNAL(stuff, COMSIG_ATOM_BSA_BEAM) & COMSIG_ATOM_BLOCKS_BSA_BEAM) + blocker = stuff + break + if(blocker) + target = tile + break + else + tile.ex_act(EXPLODE_DEVASTATE) //also fucks everything else on the turf + + point.Beam(target, icon_state = "bsa_beam", time = 50, maxdistance = world.maxx) //ZZZAP new /obj/effect/temp_visual/bsa_splash(point, dir) - message_admins("[ADMIN_LOOKUPFLW(user)] has launched an artillery strike targeting [ADMIN_VERBOSEJMP(bullseye)].") - log_game("[key_name(user)] has launched an artillery strike targeting [AREACOORD(bullseye)].") - explosion(bullseye,ex_power,ex_power*2,ex_power*4) + if(!blocker) + message_admins("[ADMIN_LOOKUPFLW(user)] has launched an artillery strike targeting [ADMIN_VERBOSEJMP(bullseye)].") + log_game("[key_name(user)] has launched an artillery strike targeting [AREACOORD(bullseye)].") + explosion(bullseye, ex_power, ex_power*2, ex_power*4) + else + message_admins("[ADMIN_LOOKUPFLW(user)] has launched an artillery strike targeting [ADMIN_VERBOSEJMP(bullseye)] but it was blocked by [blocker] at [ADMIN_VERBOSEJMP(target)].") + log_game("[key_name(user)] has launched an artillery strike targeting [AREACOORD(bullseye)] but it was blocked by [blocker] at [AREACOORD(target)].") - reload() /obj/machinery/bsa/full/proc/reload() ready = FALSE @@ -279,8 +300,9 @@ /obj/machinery/computer/bsa_control/proc/get_impact_turf() if(istype(target, /area)) return pick(get_area_turfs(target)) - else if(istype(target, /obj/item/gps)) - return get_turf(target) + else if(istype(target, /datum/component/gps)) + var/datum/component/gps/G = target + return get_turf(G.parent) /obj/machinery/computer/bsa_control/proc/fire(mob/user) if(cannon.stat) diff --git a/tgstation.dme b/tgstation.dme index 16de7a29949..fef983b280e 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -505,6 +505,7 @@ #include "code\datums\diseases\advance\symptoms\weight.dm" #include "code\datums\diseases\advance\symptoms\youth.dm" #include "code\datums\elements\_element.dm" +#include "code\datums\elements\bsa_blocker.dm" #include "code\datums\elements\cleaning.dm" #include "code\datums\elements\digitalcamo.dm" #include "code\datums\elements\earhealing.dm"