mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-18 18:46:24 +01:00
Mouse hole...
This commit is contained in:
@@ -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("<span class = 'warning'>\The [src] collapses!</span>")
|
||||
for(var/mob/thing in src.contents)
|
||||
visible_message("<span class = 'warning'>\The [thing] tumbles out!</span>")
|
||||
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("<span class = 'warning'>\The [src] collapses!</span>")
|
||||
for(var/mob/thing in src.contents)
|
||||
visible_message("<span class = 'warning'>\The [thing] tumbles out!</span>")
|
||||
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, "<span class = 'warning'>There are no other tunnels connected to this one!</span>")
|
||||
return
|
||||
choice = tgui_input_list(user, "Where would you like to go?", "Pick a tunnel", destinations)
|
||||
to_chat(user,"<span class = 'notice'>You begin moving...</span>")
|
||||
if(!choice)
|
||||
return
|
||||
to_chat(user,"<span class = 'notice'>You begin moving...</span>")
|
||||
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("<span class = 'warning'>\The [user] reaches into \the [src]. . .</span>","<span class = 'warning'>You reach into \the [src]. . .</span>")
|
||||
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("<span class = 'notice'>\The [k] climbs into \the [src]!</span>")
|
||||
k.forceMove(src)
|
||||
to_chat(k,"<span class = 'notice'>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.</span>")
|
||||
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("<span class = 'warning'>Something moves inside of \the [src]. . .</span>")
|
||||
|
||||
/obj/structure/micro_structure/tunnel/magic
|
||||
/obj/structure/micro_tunnel/magic
|
||||
magic = TRUE
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 563 B |
Reference in New Issue
Block a user