diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 3ac1ccf973c..f2417fb0295 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -54,6 +54,8 @@ GLOBAL_LIST_INIT(turfs_openspace, typecacheof(list( #define isplatingturf(A) (istype(A, /turf/open/floor/plating)) +#define isasteroidturf(A) (istype(A, /turf/open/misc/asteroid)) + #define istransparentturf(A) (HAS_TRAIT(A, TURF_Z_TRANSPARENT_TRAIT)) //Mobs diff --git a/code/datums/components/food/decomposition.dm b/code/datums/components/food/decomposition.dm index 8a233cfb86b..f7abb7a6d00 100644 --- a/code/datums/components/food/decomposition.dm +++ b/code/datums/components/food/decomposition.dm @@ -73,7 +73,7 @@ var/turf/open/open_turf = food.loc - if(!istype(open_turf) || islava(open_turf) || istype(open_turf, /turf/open/misc/asteroid)) //Are we actually in a valid open turf? + if(!istype(open_turf) || islava(open_turf) || isasteroidturf(open_turf)) //Are we actually in a valid open turf? remove_timer() return diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm index c009ed2925c..f53a0741c1b 100644 --- a/code/game/turfs/closed/minerals.dm +++ b/code/game/turfs/closed/minerals.dm @@ -177,6 +177,9 @@ /turf/closed/mineral/ex_act(severity, target) . = ..() + if(target == src) + gets_drilled(null, FALSE) + return switch(severity) if(EXPLODE_DEVASTATE) gets_drilled(null, FALSE) @@ -186,7 +189,6 @@ if(EXPLODE_LIGHT) if(prob(75)) gets_drilled(null, FALSE) - return /turf/closed/mineral/blob_act(obj/structure/blob/B) if(prob(50)) @@ -652,11 +654,16 @@ det_time = rand(8,10) //So you don't know exactly when the hot potato will explode . = ..() -/turf/closed/mineral/gibtonite/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/mining_scanner) || istype(I, /obj/item/t_scanner/adv_mining_scanner) && stage == 1) - user.visible_message(span_notice("[user] holds [I] to [src]..."), span_notice("You use [I] to locate where to cut off the chain reaction and attempt to stop it...")) +/turf/closed/mineral/gibtonite/attackby(obj/item/attacking_item, mob/living/user, params) + var/previous_stage = stage + if(istype(attacking_item, /obj/item/mining_scanner) || istype(attacking_item, /obj/item/t_scanner/adv_mining_scanner) && stage == GIBTONITE_ACTIVE) + user.visible_message(span_notice("[user] holds [attacking_item] to [src]..."), span_notice("You use [attacking_item] to locate where to cut off the chain reaction and attempt to stop it...")) defuse() ..() + if(istype(attacking_item, /obj/item/clothing/gloves/gauntlets) && previous_stage == GIBTONITE_UNSTRUCK && stage == GIBTONITE_ACTIVE && istype(user)) + user.Immobilize(0.5 SECONDS) + user.throw_at(get_ranged_target_turf(src, get_dir(src, user), 5), range = 5, speed = 3, spin = FALSE) + user.visible_message(span_danger("[user] hit gibtonite with [attacking_item.name], launching [user.p_them()] back!"), span_danger("You've struck gibtonite! Your [attacking_item.name] launched you back!")) /turf/closed/mineral/gibtonite/proc/explosive_reaction(mob/user = null) if(stage == GIBTONITE_UNSTRUCK) diff --git a/code/modules/mining/aux_base.dm b/code/modules/mining/aux_base.dm index 76c03c397a4..e849b653aef 100644 --- a/code/modules/mining/aux_base.dm +++ b/code/modules/mining/aux_base.dm @@ -164,7 +164,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/auxiliary_base, 32) for(var/z_level in SSmapping.levels_by_trait(ZTRAIT_MINING)) all_mining_turfs += Z_TURFS(z_level) var/turf/LZ = pick(all_mining_turfs) //Pick a random mining Z-level turf - if(!ismineralturf(LZ) && !istype(LZ, /turf/open/misc/asteroid)) + if(!ismineralturf(LZ) && !isasteroidturf(LZ)) //Find a suitable mining turf. Reduces chance of landing in a bad area to_chat(usr, span_warning("Landing zone scan failed. Please try again.")) return diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm index af9328183a7..7f41754597f 100644 --- a/code/modules/mining/lavaland/tendril_loot.dm +++ b/code/modules/mining/lavaland/tendril_loot.dm @@ -613,11 +613,11 @@ UnregisterSignal(user, COMSIG_HUMAN_EARLY_UNARMED_ATTACK) UnregisterSignal(user, COMSIG_MOVABLE_BUMP) -/obj/item/clothing/gloves/gauntlets/proc/rocksmash(mob/living/carbon/human/H, atom/A, proximity) +/obj/item/clothing/gloves/gauntlets/proc/rocksmash(mob/living/carbon/human/user, atom/rocks, proximity) SIGNAL_HANDLER - if(!ismineralturf(A)) + if(!ismineralturf(rocks) && !isasteroidturf(rocks)) return - A.attackby(src, H) + rocks.attackby(src, user) return COMPONENT_CANCEL_ATTACK_CHAIN /obj/item/clothing/suit/hooded/berserker diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm index 83f485144ab..02f373347ec 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/goldgrub.dm @@ -72,7 +72,7 @@ if(G.stat == DEAD) return var/turf/T = get_turf(G) - if (!istype(T, /turf/open/misc/asteroid) || !do_after(G, 30, target = T)) + if (!isasteroidturf(T) || !do_after(G, 30, target = T)) to_chat(G, span_warning("You can only burrow in and out of mining turfs and must stay still!")) return if (get_dist(G, T) != 0) diff --git a/code/modules/mod/modules/modules_supply.dm b/code/modules/mod/modules/modules_supply.dm index 7a90c90dfa0..7e840910a96 100644 --- a/code/modules/mod/modules/modules_supply.dm +++ b/code/modules/mod/modules/modules_supply.dm @@ -146,7 +146,7 @@ var/turf/closed/mineral/mineral_turf = target mineral_turf.gets_drilled(mod.wearer) drain_power(use_power_cost) - else if(istype(target, /turf/open/misc/asteroid)) + else if(isasteroidturf(target)) var/turf/open/misc/asteroid/sand_turf = target if(!sand_turf.can_dig(mod.wearer)) return