From 06fbd006c2b755ffe9f6fc17d0edafc843ff68e5 Mon Sep 17 00:00:00 2001 From: mentgah <52985409+mentgah@users.noreply.github.com> Date: Fri, 25 Apr 2025 12:04:31 +0200 Subject: [PATCH 1/2] ladder adminbus update --- code/game/objects/structures/ladders.dm | 43 ++++++++++++++----------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index 029ac53730ab..1c37d34eb97f 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -6,6 +6,13 @@ var/list/ladders = list() icon = 'icons/obj/structures.dmi' icon_state = "ladder11" anchored = 1 + var/custom_message_up = "climb up" + var/custom_message_down = "climb down" + var/custom_message_others_up = "climbs up" + var/custom_message_others_down = "climbs down" + var/custom_upanddown = "Go up or down the ladder?" + var/custom_upanddown_up = "Up" + var/custom_upanddown_down = "Down" var/id = null var/height = 0 //the 'height' of the ladder. higher numbers are considered physically higher var/obj/structure/ladder/down = null //the ladder below this one @@ -80,34 +87,34 @@ var/list/ladders = list() /obj/structure/ladder/attack_hand(mob/user as mob) if(up && down) - switch( alert("Go up or down the ladder?", "Ladder", "Up", "Down", "Cancel") ) - if("Up") - user.visible_message("[user] climbs up \the [src]!", \ - "You climb up \the [src]!") - climb(user, get_turf(up)) - up.add_fingerprint(user) - if("Down") - user.visible_message("[user] climbs down \the [src]!", \ - "You climb down \the [src]!") - climb(user, get_turf(down)) - down.add_fingerprint(user) - if("Cancel") - return + var/choice = alert("[custom_upanddown]", "[src]", "[custom_upanddown_up]", "[custom_upanddown_down]", "Cancel") + if(choice == "[custom_upanddown_up]") + user.visible_message("[user] [custom_message_others_up] \the [src]!", \ + "You [custom_message_up] \the [src]!") + climb(user, get_turf(up)) + up.add_fingerprint(user) + if(choice == "[custom_upanddown_down]") + user.visible_message("[user] [custom_message_others_down] \the [src]!", \ + "You [custom_message_down] \the [src]!") + climb(user, get_turf(down)) + down.add_fingerprint(user) + if(choice == "Cancel") + return else if(up) - user.visible_message("[user] climbs up \the [src]!", \ - "You climb up \the [src]!") + user.visible_message("[user] [custom_message_others_up] \the [src]!", \ + "You [custom_message_up] \the [src]!") climb(user, get_turf(up)) up.add_fingerprint(user) else if(down) - user.visible_message("[user] climbs down \the [src]!", \ - "You climb down \the [src]!") + user.visible_message("[user] [custom_message_others_down] \the [src]!", \ + "You [custom_message_down] \the [src]!") climb(user, get_turf(down)) down.add_fingerprint(user) else - to_chat(user, "This ladder is broken!") + to_chat(user, "This [src] is broken!") add_fingerprint(user) From 10c55f87b6516dcb9efa0ca217236aadb9df7744 Mon Sep 17 00:00:00 2001 From: mentgah <52985409+mentgah@users.noreply.github.com> Date: Fri, 25 Apr 2025 15:59:58 +0200 Subject: [PATCH 2/2] better i think --- code/game/objects/structures/ladders.dm | 56 ++++++++++++------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index 1c37d34eb97f..018ff1284b0e 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -6,13 +6,13 @@ var/list/ladders = list() icon = 'icons/obj/structures.dmi' icon_state = "ladder11" anchored = 1 - var/custom_message_up = "climb up" - var/custom_message_down = "climb down" - var/custom_message_others_up = "climbs up" - var/custom_message_others_down = "climbs down" - var/custom_upanddown = "Go up or down the ladder?" - var/custom_upanddown_up = "Up" - var/custom_upanddown_down = "Down" + var/custom_message_up = "" + var/custom_message_down = "" + var/custom_message_others_up = "" + var/custom_message_others_down = "" + var/custom_upanddown = "" + var/custom_upanddown_up = "" + var/custom_upanddown_down = "" var/id = null var/height = 0 //the 'height' of the ladder. higher numbers are considered physically higher var/obj/structure/ladder/down = null //the ladder below this one @@ -85,34 +85,30 @@ var/list/ladders = list() else //wtf make your ladders properly assholes icon_state = "ladder00" -/obj/structure/ladder/attack_hand(mob/user as mob) +/obj/structure/ladder/proc/go_up(mob/user) + user.visible_message("[user] [custom_message_others_up? custom_message_others_up : "climbs up the ladder!"]", \ + "You [custom_message_up? custom_message_up : "climb up the ladder!"]") + climb(user, get_turf(up)) + up.add_fingerprint(user) +/obj/structure/ladder/proc/go_down(mob/user) + user.visible_message("[user] [custom_message_others_down? custom_message_others_down : "climbs down the ladder!"]", \ + "You [custom_message_down? custom_message_down : "climb down the ladder!"]") + climb(user, get_turf(down)) + down.add_fingerprint(user) + +/obj/structure/ladder/attack_hand(mob/user) if(up && down) - var/choice = alert("[custom_upanddown]", "[src]", "[custom_upanddown_up]", "[custom_upanddown_down]", "Cancel") - if(choice == "[custom_upanddown_up]") - user.visible_message("[user] [custom_message_others_up] \the [src]!", \ - "You [custom_message_up] \the [src]!") - climb(user, get_turf(up)) - up.add_fingerprint(user) - if(choice == "[custom_upanddown_down]") - user.visible_message("[user] [custom_message_others_down] \the [src]!", \ - "You [custom_message_down] \the [src]!") - climb(user, get_turf(down)) - down.add_fingerprint(user) + var/choice = alert("[custom_upanddown?custom_upanddown : "Go up or down the ladder?"]", "[src]", "[custom_upanddown_up?custom_upanddown_up : "Up"]", "[custom_upanddown_down?custom_upanddown_down : "Down"]", "Cancel") + if(choice == "[custom_upanddown_up]" || choice == "Up") + go_up(user) + if(choice == "[custom_upanddown_down]" || choice == "Down") + go_down(user) if(choice == "Cancel") return - else if(up) - user.visible_message("[user] [custom_message_others_up] \the [src]!", \ - "You [custom_message_up] \the [src]!") - climb(user, get_turf(up)) - up.add_fingerprint(user) - + go_up(user) else if(down) - user.visible_message("[user] [custom_message_others_down] \the [src]!", \ - "You [custom_message_down] \the [src]!") - climb(user, get_turf(down)) - down.add_fingerprint(user) - + go_down(user) else to_chat(user, "This [src] is broken!")