diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 81be748b997..bf1fb52ccd8 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -114,14 +114,14 @@ /obj/screen/storage/Click() if(!usr.canClick()) - return 1 + return TRUE if(usr.stat || usr.paralysis || usr.stunned || usr.weakened) - return 1 + return TRUE if(master) var/obj/item/I = usr.get_active_hand() if(I) usr.ClickOn(master) - return 1 + return TRUE /obj/screen/zone_sel name = "damage zone" diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 6d8a4bd841b..61e576bb186 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -183,12 +183,17 @@ if(!temp) to_chat(user, "You try to use your hand, but realize it is no longer attached!") return - if(!src.Adjacent(user)) + var/obj/item/storage/S + var/storage_depth_matters = TRUE + if(istype(src.loc, /obj/item/storage)) + S = src.loc + if(!S.care_about_storage_depth) + storage_depth_matters = FALSE + if(storage_depth_matters && !src.Adjacent(user)) to_chat(user, span("notice", "\The [src] slips out of your grasp before you can grab it!")) // because things called before this can move it return // please don't pick things up src.pickup(user) - if (istype(src.loc, /obj/item/storage)) - var/obj/item/storage/S = src.loc + if(S) S.remove_from_storage(src) src.throwing = 0 diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index ea4fde672d1..94e29d6da9b 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -30,6 +30,7 @@ var/obj/screen/storage/stored_continue var/obj/screen/storage/stored_end var/obj/screen/close/closer + var/care_about_storage_depth = TRUE var/use_to_pickup //Set this to make it possible to use this item in an inverse way, so you can have the item in your hand and click items on the floor to pick them up. var/list/pickup_blacklist = list() // If you click a blacklisted item, it won't try to pick it up if use_to_pickup is true var/display_contents_with_number //Set this to make the storage item group contents of the same type and display them as a number. @@ -403,23 +404,24 @@ queue_icon_update() //Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target -/obj/item/storage/proc/remove_from_storage(obj/item/W as obj, atom/new_location) - if(!istype(W)) return 0 +/obj/item/storage/proc/remove_from_storage(obj/item/W, atom/new_location) + if(!istype(W)) + return FALSE if(istype(src, /obj/item/storage/fancy)) var/obj/item/storage/fancy/F = src - F.update_icon(1) + F.update_icon(TRUE) - for(var/mob/M in range(1, src.loc)) - if (M.s_active == src) - if (M.client) + for(var/mob/M in range(1, get_turf(src))) + if(M.s_active == src) + if(M.client) M.client.screen -= W if(new_location) if(ismob(loc)) W.dropped(usr) if(ismob(new_location)) - W.layer = SCREEN_LAYER+0.01 + W.layer = SCREEN_LAYER + 0.01 else W.layer = initial(W.layer) W.forceMove(new_location) @@ -434,31 +436,30 @@ W.maptext = "" W.on_exit_storage(src) update_icon() - return 1 + return TRUE /obj/item/storage/proc/remove_from_storage_deferred(obj/item/W, atom/new_location, mob/user) - if (!istype(W)) + if(!istype(W)) return FALSE // fuck if I know. - for(var/mob/M in range(1, src.loc)) - if (M.s_active == src) - if (M.client) + for(var/mob/M in range(1, get_turf(src))) + if(M.s_active == src) + if(M.client) M.client.screen -= W - if (new_location) - if (ismob(loc)) + if(new_location) + if(ismob(loc)) W.dropped(user) - if (ismob(new_location)) - W.layer = SCREEN_LAYER+0.01 + if(ismob(new_location)) + W.layer = SCREEN_LAYER + 0.01 else W.layer = initial(W.layer) - W.forceMove(new_location) else W.forceMove(get_turf(src)) - if (W.maptext) + if(W.maptext) W.maptext = "" W.on_exit_storage(src) @@ -684,6 +685,11 @@ var/depth = 0 var/atom/cur_atom = src + if(istype(cur_atom.loc, /obj/item/storage)) + var/obj/item/storage/S = cur_atom.loc + if(!S.care_about_storage_depth) + return 1 + while (cur_atom && !(cur_atom in container.contents)) if (isarea(cur_atom)) return -1 @@ -702,6 +708,11 @@ var/depth = 0 var/atom/cur_atom = src + if(istype(cur_atom.loc, /obj/item/storage)) + var/obj/item/storage/S = cur_atom.loc + if(!S.care_about_storage_depth) + return 1 + while (cur_atom && !isturf(cur_atom)) if (isarea(cur_atom)) return -1 diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm index f6fc9279651..a7d55483496 100644 --- a/code/modules/vehicles/bike.dm +++ b/code/modules/vehicles/bike.dm @@ -1,6 +1,7 @@ /obj/vehicle/bike name = "space-bike" - desc = "Space wheelies! Woo! " + desc = "Space wheelies! Woo!" + desc_info = "Drag yourself onto the bike to mount it, toggle the engine to be able to drive around. Deploy the kickstand to prevent movement by driving and dragging. Drag it onto yourself to access its mounted storage. Resist to get off." icon = 'icons/obj/bike.dmi' icon_state = "bike_off" dir = SOUTH @@ -14,10 +15,12 @@ brute_dam_coeff = 0.5 var/protection_percent = 60 - var/land_speed = 10 //if 0 it can't go on turf + var/land_speed = 5 //if 0 it can't go on turf var/space_speed = 1 var/bike_icon = "bike" + var/storage_type = /obj/item/storage/toolbox/bike_storage + var/obj/item/storage/storage_compartment var/datum/effect_system/ion_trail/ion var/kickstand = TRUE var/can_hover = TRUE @@ -28,6 +31,8 @@ turn_off() add_overlay(image('icons/obj/bike.dmi', "[icon_state]_off_overlay", MOB_LAYER + 1)) icon_state = "[bike_icon]_off" + if(storage_type) + storage_compartment = new storage_type(src) /obj/vehicle/bike/verb/toggle() set name = "Toggle Engine" @@ -75,6 +80,11 @@ return 0 return ..(M) +/obj/vehicle/bike/MouseDrop(atom/over) + if(usr == over && ishuman(over)) + var/mob/living/carbon/human/H = over + storage_compartment.open(H) + /obj/vehicle/bike/MouseDrop_T(var/atom/movable/C, mob/user as mob) if(!load(C)) to_chat(user, "You were unable to load \the [C] onto \the [src].") @@ -224,11 +234,13 @@ fire_dam_coeff = 0.5 brute_dam_coeff = 0.4 + storage_type = /obj/item/storage/toolbox/bike_storage/speeder bike_icon = "speeder" /obj/vehicle/bike/monowheel name = "adhomian monowheel" desc = "A one-wheeled vehicle, fairly popular with Little Adhomai's greasers." + desc_info = "Drag yourself onto the monowheel to mount it, toggle the engine to be able to drive around. Deploy the kickstand to prevent movement by driving and dragging. Drag it onto yourself to access its mounted storage. Resist to get off." icon_state = "monowheel_off" health = 250 @@ -239,6 +251,7 @@ mob_offset_y = 1 + storage_type = /obj/item/storage/toolbox/bike_storage/monowheel bike_icon = "monowheel" dir = EAST @@ -265,3 +278,15 @@ return TRUE else return FALSE + +/obj/item/storage/toolbox/bike_storage + name = "bike storage" + max_w_class = ITEMSIZE_LARGE + max_storage_space = 50 + care_about_storage_depth = FALSE + +/obj/item/storage/toolbox/bike_storage/speeder + name = "speeder storage" + +/obj/item/storage/toolbox/bike_storage/monowheel + name = "monowheel storage" \ No newline at end of file diff --git a/html/changelogs/geeves-spacebike_storage.yml b/html/changelogs/geeves-spacebike_storage.yml new file mode 100644 index 00000000000..39746d7e9ca --- /dev/null +++ b/html/changelogs/geeves-spacebike_storage.yml @@ -0,0 +1,7 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Spacebikes, speeders, and monowheels now have storage compartments accessible by dragging it onto your sprite." + - tweak: "Spacebikes and speeders now drive a bit faster on non-space tiles." \ No newline at end of file