Files
Bubberstation/code/game/objects/structures/ladders.dm
Cyberboss 9e1ef0ffe2 Global variable wrappers (#25325)
* Add the system for managed global variables

* Travis ban old globals

* So you CAN inline proccall, that's neat

* Fix that

* master.dm

* Remove the hack procs

* Move InitGlobals to the proper spot

* configuration.dm

* Fix the missing pre-slash

* clockcult.dm

* This is probably for the best

* Doy

* Fix shit

* Rest of the DEFINES tree

* Fix

* Use global. for access

* Update find_references_in_globals

Always hated that proc

Whoever made it must've bee a r e a l idiot...

* __HELPERS tree

* Move global initialization to master.

Fix the declaration

* database.dm

* Dat newline

* I said DECLARATIVE order!

* Here's something you can chew on @Iamgoofball

* game_modes.dm

* Fix this

* genetics.dm

* flavor_misc.dm

* More stuff

* Do it mso's way. Keep the controllers as global

* Make master actually see it

* Fix

* Finish _globalvars/lists

* Finish the rest of the _globalvars tree

* This is weird

* Migrate the controllers

* SLOTH -> GLOB

* Lighting globals

* round_start_time -> ticker

* PAI card list -> pai SS

* record_id_num -> static

* Diseases list -> SSdisease

* More disease globals to the SS

* More disease stuff

* Emote list

* Better and better

* Bluh

* So much stuff

* Ahh

* Wires

* dview

* station_areas

* Teleportlocs

* blood_splatter_icons

* Stuff and such

* More stuff

* RAD IO

* More stuff and such

* Blob shit

* Changeling stuff

* Add "Balance" to changelogs

* Balance for changelog compiler + Auto Tagging

* Update the PR template

* hivemind_bank

* Bip

* sacrificed

* Good shit

* Better define

* More cult shit

* Devil shit

* Gang shit

* > borers

Fix shit

* Rename the define

* Nuke

* Objectives

* Sandbox

* Multiverse sword

* Announce systems

* Stuff and such

* TC con

* Airlock

* doppllllerrrrrr

* holopads

* Shut up byond you inconsistent fuck

* Sneaky fuck

* Burp

* Bip

* Fixnshit

* Port without regard

* askdlfjs;

* asdfjasoidojfi

* Protected globals and more

* SO MANY

* ajsimkvahsaoisd

* akfdsiaopwimfeoiwafaw

* gsdfigjosidjfgiosdg

* AHHHHHHHHHHHHHHHHHHHHHHH!!!!!

* facerolll

* ASDFASDFASDF

* Removes the unused parts of dmm_suite

* WIP

* Fix quote

* asdfjauwfnkjs

* afwlunhskjfda

* asfjlaiwuefhaf

* SO CLOSE

* wwwweeeeeewwwww

* agdgmoewranwg

* HOLY MOTHER OF FUCK AND THATS JUST HALF THE JOB?!?

* Fix syntax errors

* 100 errors

* Another 100

* So many...

* Ugh

* More shit

* kilme

* Stuuuuuufffff

* ajrgmrlshio;djfa;sdkl

* jkbhkhjbmjvjmh

* soi soi soi

* butt

* TODAY WE LEARNED THAT GLOBAL AND STATIC ARE THE EXACT SAME FUCKING THING

* lllllllllllllllllllllllllllllllllllllllllll

* afsdijfiawhnflnjhnwsdfs

* yugykihlugk,kj

* time to go

* STUFFF!!!

* AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!

* ngoaijdjlfkamsdlkf

* Break time

* aufjsdklfalsjfi

* CONTROL KAY AND PRAY

* IT COMPILEELEELELAKLJFKLDAFJLKFDJLADKJHFLJKAJGAHIEJALDFJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

* Goteem

* Fix testing mode

* This does not belong in this PR

* Convert it to a controller

* Eh, fuck this option

* Revert controllerization Ill do it some other time

* Fix

* Working controllerization

* FOR THE LOVE OF CHRIST PROTECT THE LOGS

* Protect admins and deadmins

* Use the inbuilt proc
2017-04-06 23:26:13 -06:00

114 lines
2.9 KiB
Plaintext

/obj/structure/ladder
name = "ladder"
desc = "A sturdy metal ladder."
icon = 'icons/obj/structures.dmi'
icon_state = "ladder11"
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
var/obj/structure/ladder/up = null //the ladder above this one
/obj/structure/ladder/unbreakable //mostly useful for awaymissions to prevent halting progress in a mission
name = "sturdy ladder"
desc = "An extremely sturdy metal ladder."
/obj/structure/ladder/Initialize(mapload)
if(!initialized)
GLOB.ladders += src
..()
if(mapload)
return TRUE
update_link()
/obj/structure/ladder/Destroy()
GLOB.ladders -= src
. = ..()
/obj/structure/ladder/proc/update_link()
for(var/obj/structure/ladder/L in GLOB.ladders)
if(L.id == id)
if(L.height == (height - 1))
down = L
continue
if(L.height == (height + 1))
up = L
continue
if(up && down) //if both our connections are filled
break
update_icon()
/obj/structure/ladder/update_icon()
if(up && down)
icon_state = "ladder11"
else if(up)
icon_state = "ladder10"
else if(down)
icon_state = "ladder01"
else //wtf make your ladders properly assholes
icon_state = "ladder00"
/obj/structure/ladder/proc/go_up(mob/user,is_ghost)
if(!is_ghost)
show_fluff_message(1,user)
up.add_fingerprint(user)
user.loc = get_turf(up)
/obj/structure/ladder/proc/go_down(mob/user,is_ghost)
if(!is_ghost)
show_fluff_message(0,user)
down.add_fingerprint(user)
user.loc = get_turf(down)
/obj/structure/ladder/proc/use(mob/user,is_ghost=0)
if(up && down)
switch( alert("Go up or down the ladder?", "Ladder", "Up", "Down", "Cancel") )
if("Up")
go_up(user,is_ghost)
if("Down")
go_down(user,is_ghost)
if("Cancel")
return
else if(up)
go_up(user,is_ghost)
else if(down)
go_down(user,is_ghost)
else
to_chat(user, "<span class='warning'>[src] doesn't seem to lead anywhere!</span>")
if(!is_ghost)
add_fingerprint(user)
/obj/structure/ladder/attack_hand(mob/user)
if(can_use(user))
use(user)
/obj/structure/ladder/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/ladder/attackby(obj/item/weapon/W, mob/user, params)
return attack_hand(user)
/obj/structure/ladder/attack_ghost(mob/dead/observer/user)
use(user,1)
/obj/structure/ladder/proc/show_fluff_message(up,mob/user)
if(up)
user.visible_message("[user] climbs up \the [src].","<span class='notice'>You climb up \the [src].</span>")
else
user.visible_message("[user] climbs down \the [src].","<span class='notice'>You climb down \the [src].</span>")
/obj/structure/ladder/proc/can_use(mob/user)
return 1
/obj/structure/ladder/unbreakable/Destroy(force)
if(force)
. = ..()
else
return QDEL_HINT_LETMELIVE