Moves most screwdriver checks to screwdriver_act (#19024)

* screwdriver_act my beloved

* convert to returns instead of . / lewcc review

* it will be done

* i'm a little bit stupid, but now time to test

* sometimes I get excited and press the commit

* The great test has been completed

* oh wow oh wow, lewc review

* found one last one

* Steel review

* Lewc review

* quick sirryan review

* removes stupid comments (old coders I blame)

* sirryan review two

* whoops...

* hal review

* the fix to the fix to the fix

* Revert "the fix to the fix to the fix"

FUCK I pushed to the wrong branch
This reverts commit a96fe98781.
This commit is contained in:
Contrabang
2022-10-06 09:30:33 +01:00
committed by GitHub
parent 6933ed99fd
commit 8418997ed8
39 changed files with 572 additions and 468 deletions
+17 -16
View File
@@ -89,22 +89,6 @@
pick_sign()
/obj/structure/sign/barsign/attackby(obj/item/I, mob/user)
if( istype(I, /obj/item/screwdriver))
if(!panel_open)
to_chat(user, "<span class='notice'>You open the maintenance panel.</span>")
set_sign(new /datum/barsign/hiddensigns/signoff)
panel_open = TRUE
else
to_chat(user, "<span class='notice'>You close the maintenance panel.</span>")
if(!broken && !emagged)
set_sign(prev_sign)
set_light(1, LIGHTING_MINIMUM_POWER)
else if(emagged)
set_sign(new /datum/barsign/hiddensigns/syndibarsign)
else
set_sign(new /datum/barsign/hiddensigns/empbarsign)
panel_open = FALSE
if(istype(I, /obj/item/stack/cable_coil) && panel_open)
var/obj/item/stack/cable_coil/C = I
if(emagged) //Emagged, not broken by EMP
@@ -122,6 +106,23 @@
else
return ..()
/obj/structure/sign/barsign/screwdriver_act(mob/user, obj/item/I)
if(!panel_open)
to_chat(user, "<span class='notice'>You open the maintenance panel.</span>")
prev_sign = current_sign
set_sign(new /datum/barsign/hiddensigns/signoff)
else
to_chat(user, "<span class='notice'>You close the maintenance panel.</span>")
if(!broken && !emagged)
set_sign(prev_sign)
set_light(1, LIGHTING_MINIMUM_POWER)
else if(emagged)
set_sign(new /datum/barsign/hiddensigns/syndibarsign)
else
set_sign(new /datum/barsign/hiddensigns/empbarsign)
panel_open = !panel_open
return TRUE
/obj/structure/sign/barsign/emp_act(severity)
set_sign(new /datum/barsign/hiddensigns/empbarsign)
broken = TRUE
+19 -14
View File
@@ -113,23 +113,28 @@
to_chat(user, "<span class='warning'>You must wait until the door has stopped moving.</span>")
return
if(density)
var/turf/T = get_turf(src)
if(T.density)
to_chat(user, "<span class='warning'>[src] is blocked!</span>")
return
if(istype(W, /obj/item/screwdriver))
if(!istype(T, /turf/simulated/floor))
to_chat(user, "<span class='warning'>[src] bolts must be tightened on the floor!</span>")
return
user.visible_message("<span class='notice'>[user] tightens some bolts on the wall.</span>", "<span class='warning'>You tighten the bolts on the wall.</span>")
ChangeToWall()
else
to_chat(user, "<span class='warning'>You can't reach, close it first!</span>")
if(istype(W, /obj/item/gun/energy/plasmacutter) || istype(W, /obj/item/pickaxe/drill/diamonddrill) || istype(W, /obj/item/pickaxe/drill/jackhammer) || istype(W, /obj/item/melee/energy/blade) || istype(W, /obj/item/twohanded/required/pyro_claws))
dismantle(user, TRUE)
/obj/structure/falsewall/screwdriver_act(mob/living/user, obj/item/I)
if(opening)
to_chat(user, "<span class='warning'>You must wait until the door has stopped moving.</span>")
return TRUE
if(!density)
to_chat(user, "<span class='warning'>You can't reach, close it first!</span>")
return TRUE
var/turf/T = get_turf(src)
if(T.density)
to_chat(user, "<span class='warning'>[src] is blocked!</span>")
return TRUE
if(!istype(T, /turf/simulated/floor))
to_chat(user, "<span class='warning'>[src] bolts must be tightened on the floor!</span>")
return TRUE
user.visible_message("<span class='notice'>[user] tightens some bolts on the wall.</span>", "<span class='warning'>You tighten the bolts on the wall.</span>")
ChangeToWall()
return TRUE
/obj/structure/falsewall/welder_act(mob/user, obj/item/I)
if(!density)
return
+28 -26
View File
@@ -59,32 +59,34 @@
resistance_flags = FLAMMABLE
var/sign_state = ""
/obj/item/sign/attackby(obj/item/tool as obj, mob/user as mob) //construction
if(istype(tool, /obj/item/screwdriver) && isturf(user.loc))
var/direction = input("In which direction?", "Select direction.") in list("North", "East", "South", "West", "Cancel")
if(direction == "Cancel")
return
if(QDELETED(src))
return
var/obj/structure/sign/S = new(user.loc)
switch(direction)
if("North")
S.pixel_y = 32
if("East")
S.pixel_x = 32
if("South")
S.pixel_y = -32
if("West")
S.pixel_x = -32
else
return
S.name = name
S.desc = desc
S.icon_state = sign_state
to_chat(user, "You fasten \the [S] with your [tool].")
qdel(src)
else
return ..()
/obj/item/sign/screwdriver_act(mob/living/user, obj/item/I)
if(!isturf(user.loc)) // Why does this use user? This should just be loc.
return
var/direction = input("In which direction?", "Select direction.") in list("North", "East", "South", "West", "Cancel")
if(direction == "Cancel")
return TRUE // These gotta be true or we stab the sign
if(QDELETED(src))
return TRUE // Unsure about this, but stabbing something that doesnt exist seems like a bad idea
var/obj/structure/sign/S = new(user.loc) //This is really awkward to use user.loc
switch(direction)
if("North")
S.pixel_y = 32
if("East")
S.pixel_x = 32
if("South")
S.pixel_y = -32
if("West")
S.pixel_x = -32
else
return TRUE // We dont want to stab it or place it, so we return
S.name = name
S.desc = desc
S.icon_state = sign_state
to_chat(user, "<span class='notice'>You fasten [S] with your [I].</span>")
qdel(src)
return TRUE
/obj/structure/sign/double/map
name = "station map"