/mob/living/silicon/robot/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE) . = ..() if(robot_resting) robot_resting = FALSE on_standing_up() update_icons() /mob/living/silicon/robot/toggle_resting() robot_lay_down() /mob/living/silicon/robot/on_lying_down(new_lying_angle) if(layer == initial(layer)) //to avoid things like hiding larvas. layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs density = FALSE // We lose density and stop bumping passable dense things. if(model && model.model_features && ((TRAIT_R_TALL in model.model_features) || (TRAIT_R_BIG in model.model_features))) maptext_height = 32 //Offset base chat-height value // Resting effects var/turf/sit_pos = get_turf(src) var/obj/structure/table/tabled = locate(/obj/structure/table) in sit_pos.contents if(!tabled) new /obj/effect/temp_visual/mook_dust/robot(get_turf(src)) playsound(src, 'modular_skyrat/master_files/sound/effects/robot_sit.ogg', 25, TRUE) return else new /obj/effect/temp_visual/mook_dust/robot/table(get_turf(src)) playsound(src, 'modular_skyrat/master_files/sound/effects/robot_bump.ogg', 50, TRUE) var/list/items_to_move = list() for(var/obj/item/gen_item in sit_pos.contents) if(!gen_item.anchored) items_to_move += gen_item if(items_to_move.len >= 8) break for(var/obj/item/table_contents in items_to_move) table_contents.throw_at(get_ranged_target_turf(table_contents, pick(GLOB.cardinals), range = 1), range = 1, speed = 1) /mob/living/silicon/robot/on_standing_up() if(layer == LYING_MOB_LAYER) layer = initial(layer) density = initial(density) // We were prone before, so we become dense and things can bump into us again. if(model && model.model_features && (TRAIT_R_TALL in model.model_features)) maptext_height = 48 //Offset value of tallborgs if(model && model.model_features && (TRAIT_R_BIG in model.model_features)) maptext_height = 64 /mob/living/silicon/robot/proc/rest_style() set name = "Switch Rest Style" set category = "AI Commands" set desc = "Select your resting pose." if(!can_rest()) to_chat(src, span_warning("You can't do that!")) return var/choice = tgui_alert(src, "Select resting pose", "", list("Resting", "Sitting", "Belly up")) switch(choice) if("Resting") robot_rest_style = ROBOT_REST_NORMAL if("Sitting") robot_rest_style = ROBOT_REST_SITTING if("Belly up") robot_rest_style = ROBOT_REST_BELLY_UP robot_resting = robot_rest_style if (robot_resting) on_lying_down() update_icons() /mob/living/silicon/robot/proc/robot_lay_down() set name = "Lay down" set category = "AI Commands" if(!can_rest()) to_chat(src, span_warning("You can't do that!")) return if(stat != CONSCIOUS) //Make sure we don't enable movement when not concious return if(robot_resting) to_chat(src, span_notice("You are now getting up.")) robot_resting = FALSE mobility_flags = MOBILITY_FLAGS_DEFAULT on_standing_up() else to_chat(src, span_notice("You are now laying down.")) robot_resting = robot_rest_style on_lying_down() update_icons() /mob/living/silicon/robot/update_resting() . = ..() if(can_rest()) robot_resting = FALSE update_icons() /mob/living/silicon/robot/update_worn_icons() if(!hat_overlay) return cut_overlay(hat_overlay) var/list/offset_list = ((robot_resting && model.rest_hat_offset) ? model.rest_hat_offset : model.hat_offset) if(islist(offset_list)) var/list/offset = offset_list[ISDIAGONALDIR(dir) ? dir2text(dir & (WEST|EAST)) : dir2text(dir)] if(offset) hat_overlay.pixel_w = offset[1] hat_overlay.pixel_z = offset[2] add_overlay(hat_overlay) /mob/living/silicon/robot/update_module_innate() ..() var/atom/movable/screen/robot_hands = hud_used?.screen_objects[HUD_CYBORG_HANDS] if(robot_hands) robot_hands.icon = (model.model_select_alternate_icon ? model.model_select_alternate_icon : initial(robot_hands.icon)) /** * Safe check of the cyborg's model_features list. * * model_features is defined in modular_skyrat\modules\altborgs\code\modules\mob\living\silicon\robot\robot_model.dm. */ /mob/living/silicon/robot/proc/can_rest() if(model && model.model_features && ((TRAIT_R_WIDE in model.model_features) || (TRAIT_R_TALL in model.model_features) || (TRAIT_R_SQUADRUPED in model.model_features) || (TRAIT_R_BIG in model.model_features))) if(TRAIT_IMMOBILIZED in _status_traits) return FALSE return TRUE return FALSE