From 3bdbf43455e6a72caef2b38a1e412eea73c2bec1 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Sun, 28 Aug 2022 23:49:50 -0400 Subject: [PATCH] Mouse hole... --- code/game/objects/micro_structures.dm | 74 ++++++++++++---------- icons/obj/structures/micro_structures.dmi | Bin 0 -> 563 bytes 2 files changed, 40 insertions(+), 34 deletions(-) create mode 100644 icons/obj/structures/micro_structures.dmi 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 0000000000000000000000000000000000000000..f3096a12239ebf19d08818794aea62350c9e7722 GIT binary patch literal 563 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=B~>92B`&GO$wiq3C7Jno3=9=> zRF4~SwHOGnUa%_e>i@QA^;;96i6T|3f-=4iyeW&S|LT4#UGHMwlh-y^X741EBho$V zR-LRlJk3_(ZF|r3f**hSpP6z?92J$Hdh~cOmr=9_mz#T<|7%q)H)qwhn}_`R>K?|* z*!5e9cr!3CR(ZNOhE&XXJ1eoT$w0tOezxt6J7+44o~Qjvez`1>d5ggJ;um{bBy`o} z`yEeRIeGWy;WK#+XQR3KcI>_{{eAk!rF;w2Shu_}nZD`#?RW23H0w`rWr$yhVD($D znSZY6h6xY83NZ4^J=p!7`(2&+W_$VR8$VC{H+^NQ+=gQ|_8gTDT7#L^IoxBt!gyr~ zLn(u)rh}}5FIND2z+@&Qp$9x^W!n8u++XH()G%Fjy!}Vc;@Wf$^#xH&8jm{l&Mfuj zDCN`%Td_t?EBd{vpqs2Tf6g~P{eQNmVe0w057PH<2xqkvR9b$h*`6mgx~3qg o!Kz`F$O2Gstzcdu8FzsD@~a77p13qv08;^jr>mdKI;Vst0JG!m@&Et; literal 0 HcmV?d00001