diff --git a/code/game/objects/micro_structures.dm b/code/game/objects/micro_structures.dm
index 72ed290bba..b72f05001a 100644
--- a/code/game/objects/micro_structures.dm
+++ b/code/game/objects/micro_structures.dm
@@ -1,22 +1,40 @@
-/obj/structure/micro_structure/tunnel
+/obj/structure/micro_tunnel
name = "mouse hole"
desc = "A tiny little hole... where does it go?"
- icon_state = "trash_hole"
+ icon = 'icons/obj/structures/micro_structures.dmi'
+ icon_state = "mouse_hole"
anchored = TRUE
- density = TRUE
+ density = FALSE
var/max_accepted_scale = 0.3
var/magic = FALSE //For events and stuff, if true, this tunnel will show up in the list regardless of whether it's in valid range, of if you're in a tunnel with this var, all tunnels of the same faction will show up redardless of range
-/obj/structure/micro_structure/tunnel/Initialize()
+/obj/structure/micro_tunnel/Initialize()
. = ..()
if(name == "mouse hole")
var/area/our_area = get_area(src)
- name = "[our_area.name] hole"
-
+ name = "[our_area.name] mouse hole"
if(pixel_x || pixel_y)
return
+ offset_tunnel()
+
+/obj/structure/micro_tunnel/Destroy()
+ visible_message("\The [src] collapses!")
+ for(var/mob/thing in src.contents)
+ visible_message("\The [thing] tumbles out!")
+ thing.forceMove(get_turf(src.loc))
+
+ return ..()
+
+/obj/structure/micro_tunnel/set_dir(new_dir)
+ . = ..()
+ offset_tunnel()
+
+/obj/structure/micro_tunnel/proc/offset_tunnel()
+
+ pixel_x = 0
+ pixel_y = 0
switch(dir)
if(1)
@@ -28,20 +46,9 @@
if(8)
pixel_x = -32
-/obj/structure/micro_structure/tunnel/Destroy()
- visible_message("\The [src] collapses!")
- for(var/mob/thing in src.contents)
- visible_message("\The [thing] tumbles out!")
- thing.forceMove(get_turf(src.loc))
-
- return ..()
-
-/obj/structure/micro_structure/tunnel/update_icon()
- . = ..()
-
-/obj/structure/micro_structure/tunnel/attack_hand(mob/user)
+/obj/structure/micro_tunnel/attack_hand(mob/user)
if(!isliving(user))
- return
+ return ..()
if(user.loc == src)
var/choice = tgui_alert(user,"It's dark and gloomy in here. What would you like to do?","Tunnel",list("Exit", "Move"))
switch(choice)
@@ -57,7 +64,7 @@
if(myturf.z in P.expected_z_levels)
planet = P
else
- for(var/obj/structure/micro_structure/tunnel/t in world)
+ for(var/obj/structure/micro_tunnel/t in world)
if(t == src)
continue
if(magic || t.magic)
@@ -84,17 +91,16 @@
to_chat(user, "There are no other tunnels connected to this one!")
return
choice = tgui_input_list(user, "Where would you like to go?", "Pick a tunnel", destinations)
- to_chat(user,"You begin moving...")
if(!choice)
return
+ to_chat(user,"You begin moving...")
if(!do_after(user, 10 SECONDS, exclusive = TRUE))
return
user.forceMove(choice)
- tunnel_notify(user)
+ var/obj/structure/micro_tunnel/da_oddawun = choice
+ da_oddawun.tunnel_notify(user)
return
- if(user.a_intent != I_HELP)
- return ..()
if(!can_enter(user))
user.visible_message("\The [user] reaches into \the [src]. . .","You reach into \the [src]. . .")
if(!do_after(user, 3 SECONDS, exclusive = TRUE))
@@ -142,19 +148,17 @@
enter_tunnel(user)
-/obj/structure/micro_structure/tunnel/proc/can_enter(var/mob/living/user)
- if(user.mob_size < MOB_TINY || user.size_multiplier <= max_accepted_scale)
+/obj/structure/micro_tunnel/proc/can_enter(var/mob/living/user)
+ if(user.mob_size <= MOB_TINY || user.size_multiplier <= max_accepted_scale)
return TRUE
return FALSE
-/obj/structure/micro_structure/tunnel/attack_generic(mob/user, damage, attack_verb)
- . = ..()
- if(user.a_intent == I_HURT)
- return ..()
+/obj/structure/micro_tunnel/attack_generic(mob/user, damage, attack_verb)
attack_hand(user)
+ return ..()
-/obj/structure/micro_structure/tunnel/MouseDrop_T(mob/living/M, mob/living/user)
+/obj/structure/micro_tunnel/MouseDrop_T(mob/living/M, mob/living/user)
. = ..()
if(M != user)
return
@@ -171,16 +175,18 @@
enter_tunnel(k)
-/obj/structure/micro_structure/tunnel/proc/enter_tunnel(mob/living/k)
+/obj/structure/micro_tunnel/proc/enter_tunnel(mob/living/k)
k.visible_message("\The [k] climbs into \the [src]!")
k.forceMove(src)
to_chat(k,"You are inside of \the [src]. It's dark and gloomy inside of here. You can click upon the tunnel to exit, or travel to another tunnel if there are other tunnels linked to it.")
tunnel_notify(k)
-/obj/structure/micro_structure/tunnel/proc/tunnel_notify(var/mob/living/user)
+/obj/structure/micro_tunnel/proc/tunnel_notify(var/mob/living/user)
var/our_message = "You can see "
var/found_stuff = FALSE
for(var/thing in src.contents)
+ if(thing == user)
+ continue
found_stuff = TRUE
our_message = "[our_message] [thing], "
if(isliving(thing))
@@ -191,5 +197,5 @@
if(prob(25))
visible_message("Something moves inside of \the [src]. . .")
-/obj/structure/micro_structure/tunnel/magic
+/obj/structure/micro_tunnel/magic
magic = TRUE
diff --git a/icons/obj/structures/micro_structures.dmi b/icons/obj/structures/micro_structures.dmi
new file mode 100644
index 0000000000..f3096a1223
Binary files /dev/null and b/icons/obj/structures/micro_structures.dmi differ