diff --git a/_maps/RandomRuins/LavaRuins/lavaland_gym.dmm b/_maps/RandomRuins/LavaRuins/lavaland_gym.dmm deleted file mode 100644 index c6485f19bd7..00000000000 --- a/_maps/RandomRuins/LavaRuins/lavaland_gym.dmm +++ /dev/null @@ -1,53 +0,0 @@ -"a" = (/turf/closed/mineral/volcanic/lava_land_surface,/area/lavaland/surface/outdoors) -"b" = (/turf/open/floor/plating/asteroid/basalt/lava_land_surface,/area/lavaland/surface/outdoors) -"c" = (/turf/closed/wall/r_wall,/area/ruin/powered) -"d" = (/obj/structure/closet,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"e" = (/obj/structure/closet,/mob/living/simple_animal/hostile/zombie,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"f" = (/obj/structure/punching_bag,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"g" = (/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"h" = (/obj/structure/window{icon_state = "window";dir = 1},/obj/item/weapon/shard{icon_state = "medium"},/mob/living/simple_animal/hostile/zombie/gymboss,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"i" = (/obj/structure/window{icon_state = "window";dir = 1},/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"j" = (/obj/structure/window{icon_state = "window";dir = 1},/obj/structure/window{icon_state = "window";dir = 4},/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"k" = (/obj/effect/decal/cleanable/blood,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"l" = (/obj/structure/weightlifter,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"m" = (/obj/structure/window{icon_state = "window";dir = 8},/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"n" = (/obj/structure/window{icon_state = "window";dir = 4},/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"o" = (/obj/structure/stacklifter,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"p" = (/obj/structure/window,/obj/structure/window{icon_state = "window";dir = 8},/obj/effect/decal/cleanable/blood,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"q" = (/obj/structure/window,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"r" = (/obj/structure/window,/obj/item/weapon/shard,/mob/living/simple_animal/hostile/zombie/darkholme,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"s" = (/obj/effect/decal/cleanable/blood/tracks{tag = "icon-splatter4 (NORTH)";icon_state = "splatter4";dir = 1},/turf/open/floor/plating/asteroid/basalt/lava_land_surface,/area/lavaland/surface/outdoors) -"t" = (/obj/effect/decal/cleanable/blood/tracks{tag = "icon-splatter6 (EAST)";icon_state = "splatter6";dir = 4},/obj/effect/decal/cleanable/blood/tracks{tag = "icon-tracks (NORTH)";icon_state = "tracks";dir = 1},/obj/effect/decal/cleanable/blood/tracks{tag = "icon-gib3";icon_state = "gib3"},/turf/open/floor/plating/asteroid/basalt/lava_land_surface,/area/lavaland/surface/outdoors) -"u" = (/obj/machinery/door/airlock/external,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"v" = (/obj/effect/decal/cleanable/blood/tracks{tag = "icon-tracks (EAST)";icon_state = "tracks";dir = 4},/obj/effect/decal/cleanable/blood/tracks{tag = "icon-tracks (NORTHEAST)";icon_state = "tracks";dir = 5},/turf/open/floor/plating/asteroid/basalt/lava_land_surface,/area/lavaland/surface/outdoors) -"w" = (/obj/effect/decal/cleanable/blood/tracks{tag = "icon-tracks (EAST)";icon_state = "tracks";dir = 4},/obj/effect/decal/cleanable/blood/tracks{tag = "icon-tracks (SOUTHEAST)";icon_state = "tracks";dir = 6},/turf/open/floor/plating/asteroid/basalt/lava_land_surface,/area/lavaland/surface/outdoors) -"x" = (/obj/effect/decal/cleanable/blood/tracks{tag = "icon-splatter5";icon_state = "splatter5"},/obj/effect/decal/cleanable/blood/tracks{tag = "icon-tracks (EAST)";icon_state = "tracks";dir = 4},/turf/open/floor/plating/asteroid/basalt/lava_land_surface,/area/lavaland/surface/outdoors) -"y" = (/obj/effect/decal/cleanable/blood/tracks{tag = "icon-splatter4 (NORTH)";icon_state = "splatter4";dir = 1},/obj/effect/decal/cleanable/blood/tracks{tag = "icon-splatter6 (NORTH)";icon_state = "splatter6";dir = 1},/turf/open/floor/plating/asteroid/basalt/lava_land_surface,/area/lavaland/surface/outdoors) -"z" = (/obj/effect/decal/cleanable/blood/tracks{tag = "icon-splatter5";icon_state = "splatter5"},/turf/open/floor/plating/asteroid/basalt/lava_land_surface,/area/lavaland/surface/outdoors) -"A" = (/mob/living/simple_animal/hostile/zombie,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"B" = (/obj/structure/window{icon_state = "window";dir = 1},/obj/machinery/shower,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"C" = (/obj/structure/window{icon_state = "window";dir = 1},/obj/machinery/shower,/mob/living/simple_animal/hostile/zombie,/turf/open/floor/plasteel/freezer{baseturf = /turf/open/floor/plating/lava/smooth},/area/ruin/powered) -"D" = (/turf/template_noop,/area/template_noop) - -(1,1,1) = {" -DDDDDDDDDDDDDDDDDDDD -DDDDDDDDDDDDDDDDDDDD -DDDDDDDDDDDDDDDDDDDD -DDDDDDDDDDDDDDDDDDDD -DDDccccccccccccDDDDD -DDDcdeddddddedcbDDDD -DDDcfgghiijkglcbaDDD -DDDcfggmgkngglcbbbDD -DDDcfggmggnggocbbbDD -DDDcfggpqqrggocstbbD -DDDcgkgggggggkuvwxbD -DDDcuucccccccccyzbbD -DDDcgAgggggggAcbbbbD -DDDcggggggAgggcbbbDD -DDDcBCBBggBBBBcbbDDD -DDDcgggggggAggcbDDDD -DDDccccccccccccbDDDD -DDDDDDDDDDDDDDDDDDDD -DDDDDDDDDDDDDDDDDDDD -DDDDDDDDDDDDDDDDDDDD -"} diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 57b2c9c959e..d27566ed208 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -99122,7 +99122,7 @@ /obj/docking_port/stationary{ dheight = 0; dir = 2; - dwidth = 10; + dwidth = 9; height = 25; id = "emergency_home"; name = "MetaStation emergency evac bay"; diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index 04e5a8fbf0d..2458519c4e6 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -39,11 +39,10 @@ //Grab levels -#define GRAB_PASSIVE 1 -#define GRAB_AGGRESSIVE 2 -#define GRAB_NECK 3 -#define GRAB_UPGRADING 4 -#define GRAB_KILL 5 +#define GRAB_PASSIVE 0 +#define GRAB_AGGRESSIVE 1 +#define GRAB_NECK 2 +#define GRAB_KILL 3 //Hostile Mob AI Status diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm new file mode 100644 index 00000000000..06c7f4151df --- /dev/null +++ b/code/__DEFINES/layers.dm @@ -0,0 +1,54 @@ +//Defines for atom layers +//KEEP THESE IN A NICE ACSCENDING ORDER, PLEASE + +//#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define +#define ABOVE_OPEN_TURF_LAYER 2.01 +#define CLOSED_TURF_LAYER 2.05 +#define ABOVE_NORMAL_TURF_LAYER 2.08 +#define LATTICE_LAYER 2.2 +#define DISPOSAL_PIPE_LAYER 2.3 +#define GAS_PIPE_LAYER 2.35 +#define WIRE_LAYER 2.4 +#define WIRE_TERMINAL_LAYER 2.45 +#define LOW_OBJ_LAYER 2.5 + +#define OPEN_DOOR_LAYER 2.7 +#define PROJECTILE_HIT_THRESHHOLD_LAYER 2.75 //projectiles won't hit objects at or below this layer if possible +#define TABLE_LAYER 2.8 +#define BELOW_OBJ_LAYER 2.9 +#define LOW_ITEM_LAYER 2.95 +//#define OBJ_LAYER 3 //For easy recordkeeping; this is a byond define +#define CLOSED_DOOR_LAYER 3.1 +#define CLOSED_FIREDOOR_LAYER 3.11 +#define ABOVE_OBJ_LAYER 3.2 +#define SIGN_LAYER 3.4 +#define HIGH_OBJ_LAYER 3.5 + +#define BELOW_MOB_LAYER 3.7 +#define LYING_MOB_LAYER 3.8 +//#define MOB_LAYER 4 //For easy recordkeeping; this is a byond define +#define ABOVE_MOB_LAYER 4.1 +#define WALL_OBJ_LAYER 4.25 +#define EDGED_TURF_LAYER 4.3 +#define ON_EDGED_TURF_LAYER 4.35 +#define LARGE_MOB_LAYER 4.4 +#define ABOVE_ALL_MOB_LAYER 4.5 + +#define SPACEVINE_LAYER 4.8 +#define SPACEVINE_MOB_LAYER 4.9 +//#define FLY_LAYER 5 //For easy recordkeeping; this is a byond define + +#define GHOST_LAYER 6 +#define AREA_LAYER 10 +#define MASSIVE_OBJ_LAYER 11 +#define POINT_LAYER 12 +#define LIGHTING_LAYER 15 + +//HUD layer defines +#define FLASH_LAYER 17.9 +#define FULLSCREEN_LAYER 18 +#define DAMAGE_LAYER 18.1 +#define BLIND_LAYER 18.2 +#define CRIT_LAYER 18.3 +#define HUD_LAYER 19 +#define ABOVE_HUD_LAYER 19.1 diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 153ab82e1f3..1b78d640dbe 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -150,8 +150,9 @@ #define CLICK_CD_RANGE 4 #define CLICK_CD_BREAKOUT 100 #define CLICK_CD_HANDCUFFED 10 -#define CLICK_CD_TKSTRANGLE 10 #define CLICK_CD_RESIST 20 +#define CLICK_CD_GRABBING 10 + //click cooldowns, in tenths of a second @@ -426,3 +427,7 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE // Defib stats #define DEFIB_TIME_LIMIT 120 #define DEFIB_TIME_LOSS 60 + +// Diagonal movement +#define FIRST_DIAG_STEP 1 +#define SECOND_DIAG_STEP 2 diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 826a61fb9ab..756a6a73834 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -77,7 +77,7 @@ CtrlClickOn(A) return - if(stat || paralysis || stunned || weakened || sleeping) + if(incapacitated(ignore_restraints = 1)) return face_atom(A) diff --git a/code/_onclick/hud/blob_overmind.dm b/code/_onclick/hud/blob_overmind.dm index 8e3dcd2aa39..66e4e1fd3c4 100644 --- a/code/_onclick/hud/blob_overmind.dm +++ b/code/_onclick/hud/blob_overmind.dm @@ -125,7 +125,7 @@ blobpwrdisplay.icon_state = "block" blobpwrdisplay.screen_loc = ui_health blobpwrdisplay.mouse_opacity = 0 - blobpwrdisplay.layer = 20 + blobpwrdisplay.layer = ABOVE_HUD_LAYER infodisplay += blobpwrdisplay healths = new /obj/screen/healths/blob() diff --git a/code/_onclick/hud/demon.dm b/code/_onclick/hud/demon.dm index fc0d923e080..5ed4f9847b9 100644 --- a/code/_onclick/hud/demon.dm +++ b/code/_onclick/hud/demon.dm @@ -35,7 +35,7 @@ using.icon = ui_style using.icon_state = "swap_1_m" using.screen_loc = ui_swaphand1 - using.layer = 19 + using.layer = HUD_LAYER static_inventory += using using = new /obj/screen/inventory() @@ -43,7 +43,7 @@ using.icon = ui_style using.icon_state = "swap_2" using.screen_loc = ui_swaphand2 - using.layer = 19 + using.layer = HUD_LAYER static_inventory += using zone_select = new /obj/screen/zone_sel() diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm index a0a74545db8..4831d736969 100644 --- a/code/_onclick/hud/fullscreen.dm +++ b/code/_onclick/hud/fullscreen.dm @@ -1,7 +1,3 @@ -#define FULLSCREEN_LAYER 18 -#define DAMAGE_LAYER FULLSCREEN_LAYER + 0.1 -#define BLIND_LAYER DAMAGE_LAYER + 0.1 -#define CRIT_LAYER BLIND_LAYER + 0.1 /mob var/list/screens = list() @@ -110,8 +106,3 @@ icon = 'icons/mob/screen_gen.dmi' screen_loc = "WEST,SOUTH to EAST,NORTH" icon_state = "druggy" - -#undef FULLSCREEN_LAYER -#undef BLIND_LAYER -#undef DAMAGE_LAYER -#undef CRIT_LAYER diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm index e1bacf6922d..2bbc92c7cd4 100644 --- a/code/_onclick/hud/other_mobs.dm +++ b/code/_onclick/hud/other_mobs.dm @@ -31,11 +31,11 @@ name = "Faith" icon_state = "deity_power" screen_loc = ui_deitypower - layer = 20 + layer = HUD_LAYER /obj/screen/deity_follower_display name = "Followers" icon_state = "deity_followers" screen_loc = ui_deityfollowers - layer = 20 + layer = HUD_LAYER diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index b13623a9bfd..7c69ae2a8a9 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -197,7 +197,7 @@ A.screen_loc = "CENTER[x]:16,SOUTH+[y]:7" else A.screen_loc = "CENTER+[x]:16,SOUTH+[y]:7" - A.layer = 20 + A.layer = ABOVE_HUD_LAYER x++ if(x == 4) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 72e5ae3c0f9..8fe5ec01029 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -9,7 +9,7 @@ /obj/screen name = "" icon = 'icons/mob/screen_gen.dmi' - layer = 20 + layer = ABOVE_HUD_LAYER unacidable = 1 appearance_flags = APPEARANCE_UI var/obj/master = null //A reference to the object in the slot. Grabs or items, generally. @@ -29,7 +29,7 @@ maptext_width = 480 /obj/screen/swap_hand - layer = 19 + layer = HUD_LAYER name = "swap hand" /obj/screen/swap_hand/Click() @@ -60,7 +60,7 @@ var/slot_id // The indentifier for the slot. It has nothing to do with ID cards. var/icon_empty // Icon when empty. For now used only by humans. var/icon_full // Icon when contains an item. For now used only by humans. - layer = 19 + layer = HUD_LAYER /obj/screen/inventory/Click() // At this point in client Click() code we have passed the 1/10 sec check and little else @@ -154,25 +154,11 @@ name = "drop" icon = 'icons/mob/screen_midnight.dmi' icon_state = "act_drop" - layer = 19 + layer = HUD_LAYER /obj/screen/drop/Click() usr.drop_item_v() -/obj/screen/grab - name = "grab" - -/obj/screen/grab/Click() - var/obj/item/weapon/grab/G = master - G.s_click(src) - return 1 - -/obj/screen/grab/attack_hand() - return - -/obj/screen/grab/attackby() - return - /obj/screen/act_intent name = "intent" icon_state = "help" @@ -303,7 +289,7 @@ name = "resist" icon = 'icons/mob/screen_midnight.dmi' icon_state = "act_resist" - layer = 19 + layer = HUD_LAYER /obj/screen/resist/Click() if(isliving(usr)) @@ -417,7 +403,7 @@ icon_state = "blank" blend_mode = BLEND_ADD screen_loc = "WEST,SOUTH to EAST,NORTH" - layer = 17 + layer = FLASH_LAYER /obj/screen/damageoverlay icon = 'icons/mob/screen_full.dmi' @@ -426,7 +412,7 @@ blend_mode = BLEND_MULTIPLY screen_loc = "CENTER-7,CENTER-7" mouse_opacity = 0 - layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top. + layer = DAMAGE_LAYER /obj/screen/healths name = "health" diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index a8fbcf17bb9..50438376e89 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -71,7 +71,7 @@ var/const/tk_maxrange = 15 flags = NOBLUDGEON | ABSTRACT //item_state = null w_class = 10 - layer = 20 + layer = ABOVE_HUD_LAYER var/last_throw = 0 var/atom/movable/focus = null diff --git a/code/datums/diseases/advance/symptoms/choking.dm b/code/datums/diseases/advance/symptoms/choking.dm index e5b338728d0..ffe25551553 100644 --- a/code/datums/diseases/advance/symptoms/choking.dm +++ b/code/datums/diseases/advance/symptoms/choking.dm @@ -43,11 +43,11 @@ Bonus return /datum/symptom/choking/proc/Choke_stage_3_4(mob/living/M, datum/disease/advance/A) - var/get_damage = (sqrt(20+A.totalStageSpeed())/2)+(sqrt(16+A.totalStealth())*1) + var/get_damage = sqrt(21+A.totalStageSpeed()*0.5)+sqrt(16+A.totalStealth()) M.adjustOxyLoss(get_damage) return 1 /datum/symptom/choking/proc/Choke(mob/living/M, datum/disease/advance/A) - var/get_damage = (sqrt(20+A.totalStageSpeed())/2)+(sqrt(16+A.totalStealth()*5)) + var/get_damage = sqrt(21+A.totalStageSpeed()*0.5)+sqrt(16+A.totalStealth()*5) M.adjustOxyLoss(get_damage) return 1 \ No newline at end of file diff --git a/code/datums/diseases/transformation.dm b/code/datums/diseases/transformation.dm index 0eedaa98f70..f3054dcaeb3 100644 --- a/code/datums/diseases/transformation.dm +++ b/code/datums/diseases/transformation.dm @@ -45,10 +45,6 @@ if(affected_mob.notransform) return affected_mob.notransform = 1 - affected_mob.canmove = 0 - affected_mob.icon = null - affected_mob.overlays.Cut() - affected_mob.invisibility = INVISIBILITY_ABSTRACT for(var/obj/item/W in affected_mob) if(istype(W, /obj/item/weapon/implant)) qdel(W) diff --git a/code/datums/martial.dm b/code/datums/martial.dm index 46e18dde7d7..226da8d5e57 100644 --- a/code/datums/martial.dm +++ b/code/datums/martial.dm @@ -323,10 +323,16 @@ add_to_streak("G",D) if(check_streak(A,D)) return 1 - D.grabbedby(A,1) - var/obj/item/weapon/grab/G = A.get_active_hand() - if(G) - G.state = GRAB_AGGRESSIVE //Instant aggressive grab + if(A.grab_state > GRAB_AGGRESSIVE) + D.grabbedby(A, 1) + else + A.start_pulling(D, 1) + if(A.pulling) + D.drop_r_hand() + D.drop_l_hand() + D.stop_pulling() + A.grab_state = GRAB_AGGRESSIVE //Instant aggressive grab + return 1 /datum/martial_art/the_sleeping_carp/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) add_to_streak("H",D) diff --git a/code/datums/ruins/lavaland.dm b/code/datums/ruins/lavaland.dm index 06b00e1be8f..9a404f07680 100644 --- a/code/datums/ruins/lavaland.dm +++ b/code/datums/ruins/lavaland.dm @@ -167,14 +167,6 @@ suffix = "lavaland_fountain_hall.dmm" cost = 5 -/datum/map_template/ruin/lavaland/zombie_gym - name = "Zombie Gym" - id = "zombie-gym" - description = "The patrons at this gym are serious about health, and \ - making sure people work on their cardio." - suffix = "lavaland_gym.dmm" - cost = 10 - /datum/map_template/ruin/lavaland/survivalcapsule name = "Survival Capsule Ruins" id = "survivalcapsule" diff --git a/code/game/area/Space_Station_13_areas.dm b/code/game/area/Space_Station_13_areas.dm index bb4f8d28ffa..1077f37946c 100644 --- a/code/game/area/Space_Station_13_areas.dm +++ b/code/game/area/Space_Station_13_areas.dm @@ -19,7 +19,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "Space" icon = 'icons/turf/areas.dmi' icon_state = "unknown" - layer = 10 + layer = AREA_LAYER mouse_opacity = 0 invisibility = INVISIBILITY_LIGHTING diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index d556f2a5b2e..2f7d234255b 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -26,7 +26,7 @@ /area/New() icon_state = "" - layer = 10 + layer = AREA_LAYER master = src uid = ++global_uid related = list(src) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 99e5a8205b7..4a2c0a330ee 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1,5 +1,5 @@ /atom - layer = 2 + layer = TURF_LAYER var/level = 2 var/flags = 0 var/list/fingerprints diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 63c03c9c2dd..8d6d5705654 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -1,5 +1,5 @@ /atom/movable - layer = 3 + layer = OBJ_LAYER var/last_move = null var/anchored = 0 var/throwing = 0 @@ -13,10 +13,12 @@ var/verb_yell = "yells" var/inertia_dir = 0 var/pass_flags = 0 + var/moving_diagonally = 0 //0: not doing a diagonal move. 1 and 2: doing the first/second step of the diagonal move glide_size = 8 appearance_flags = TILE_BOUND + /atom/movable/Move(atom/newloc, direct = 0) if(!loc || !newloc) return 0 var/atom/oldloc = loc @@ -25,28 +27,38 @@ if (!(direct & (direct - 1))) //Cardinal move . = ..() else //Diagonal move, split it into cardinal moves + moving_diagonally = FIRST_DIAG_STEP if (direct & 1) if (direct & 4) if (step(src, NORTH)) + moving_diagonally = SECOND_DIAG_STEP . = step(src, EAST) else if (step(src, EAST)) + moving_diagonally = SECOND_DIAG_STEP . = step(src, NORTH) else if (direct & 8) if (step(src, NORTH)) + moving_diagonally = SECOND_DIAG_STEP . = step(src, WEST) else if (step(src, WEST)) + moving_diagonally = SECOND_DIAG_STEP . = step(src, NORTH) else if (direct & 2) if (direct & 4) if (step(src, SOUTH)) + moving_diagonally = SECOND_DIAG_STEP . = step(src, EAST) else if (step(src, EAST)) + moving_diagonally = SECOND_DIAG_STEP . = step(src, SOUTH) else if (direct & 8) if (step(src, SOUTH)) + moving_diagonally = SECOND_DIAG_STEP . = step(src, WEST) else if (step(src, WEST)) + moving_diagonally = SECOND_DIAG_STEP . = step(src, SOUTH) + moving_diagonally = 0 if(!loc || (loc == oldloc && oldloc != newloc)) last_move = 0 @@ -80,10 +92,8 @@ qdel(AM) loc = null invisibility = INVISIBILITY_ABSTRACT - if (pulledby) - if (pulledby.pulling == src) - pulledby.pulling = null - pulledby = null + if(pulledby) + pulledby.stop_pulling() // Previously known as HasEntered() @@ -104,6 +114,8 @@ /atom/movable/proc/forceMove(atom/destination) if(destination) + if(pulledby) + pulledby.stop_pulling() var/atom/oldloc = loc if(oldloc) oldloc.Exited(src, destination) @@ -123,8 +135,6 @@ /mob/living/forceMove(atom/destination) stop_pulling() - if(pulledby) - pulledby.stop_pulling() if(buckled) buckled.unbuckle_mob(src,force=1) if(buckled_mobs.len) @@ -199,6 +209,9 @@ return 0 //use a modified version of Bresenham's algorithm to get from the atom's current position to that of the target + if(pulledby) + pulledby.stop_pulling() + throwing = 1 if(spin) //if we don't want the /atom/movable to spin. SpinAnimation(5, 1) diff --git a/code/game/gamemodes/changeling/powers/absorb.dm b/code/game/gamemodes/changeling/powers/absorb.dm index da36d8f6d96..57f0c27dab5 100644 --- a/code/game/gamemodes/changeling/powers/absorb.dm +++ b/code/game/gamemodes/changeling/powers/absorb.dm @@ -15,23 +15,21 @@ user << "We are already absorbing!" return - var/obj/item/weapon/grab/G = user.get_active_hand() - if(!istype(G)) - user << "We must be grabbing a creature in our active hand to absorb them!" + if(!user.pulling || !iscarbon(user.pulling)) + user << "We must be grabbing a creature to absorb them!" return - if(G.state <= GRAB_NECK) + if(user.grab_state <= GRAB_NECK) user << "We must have a tighter grip to absorb this creature!" return - var/mob/living/carbon/target = G.affecting + var/mob/living/carbon/target = user.pulling return changeling.can_absorb_dna(user,target) /obj/effect/proc_holder/changeling/absorbDNA/sting_action(mob/user) var/datum/changeling/changeling = user.mind.changeling - var/obj/item/weapon/grab/G = user.get_active_hand() - var/mob/living/carbon/human/target = G.affecting + var/mob/living/carbon/human/target = user.pulling changeling.isabsorbing = 1 for(var/stage = 1, stage<=3, stage++) switch(stage) @@ -122,11 +120,10 @@ /obj/effect/proc_holder/changeling/swap_form/can_sting(mob/living/carbon/user) if(!..()) return - var/obj/item/weapon/grab/G = user.get_active_hand() - if(!istype(G) || (G.state < GRAB_AGGRESSIVE)) - user << "We must have an aggressive grab on creature in our active hand to do this!" + if(!user.pulling || !iscarbon(user.pulling) || user.grab_state < GRAB_AGGRESSIVE) + user << "We must have an aggressive grab on creature to do this!" return - var/mob/living/carbon/target = G.affecting + var/mob/living/carbon/target = user.pulling if((target.disabilities & NOCLONE) || (target.disabilities & HUSK)) user << "DNA of [target] is ruined beyond usability!" return @@ -137,8 +134,7 @@ /obj/effect/proc_holder/changeling/swap_form/sting_action(mob/living/carbon/user) - var/obj/item/weapon/grab/G = user.get_active_hand() - var/mob/living/carbon/target = G.affecting + var/mob/living/carbon/target = user.pulling var/datum/changeling/changeling = user.mind.changeling user << "We tighen our grip. We must hold still...." diff --git a/code/game/gamemodes/changeling/powers/linglink.dm b/code/game/gamemodes/changeling/powers/linglink.dm index 31de5f47be6..3b90ee14bd5 100644 --- a/code/game/gamemodes/changeling/powers/linglink.dm +++ b/code/game/gamemodes/changeling/powers/linglink.dm @@ -10,11 +10,16 @@ if(!..()) return var/datum/changeling/changeling = user.mind.changeling - var/obj/item/weapon/grab/G = user.get_active_hand() - var/mob/living/carbon/target = G.affecting if(changeling.islinking) user << "We have already formed a link with the victim!" return + if(!user.pulling) + user << "We must be tightly grabbing a creature to link with them!" + return + if(!iscarbon(user.pulling)) + user << "We cannot link with this creature!" + return + var/mob/living/carbon/target = user.pulling if(!target.mind) user << "The victim has no mind to link to!" return @@ -23,19 +28,15 @@ return if(target.mind.changeling) user << "The victim is already a part of the hivemind!" - return - if(!istype(G)) - user << "We must be tightly grabbing a creature in our active hand to link with them!" return - if(G.state <= GRAB_NECK) + if(user.grab_state <= GRAB_NECK) user << "We must have a tighter grip to link with this creature!" return return changeling.can_absorb_dna(user,target) /obj/effect/proc_holder/changeling/linglink/sting_action(mob/user) var/datum/changeling/changeling = user.mind.changeling - var/obj/item/weapon/grab/G = user.get_active_hand() - var/mob/living/carbon/human/target = G.affecting + var/mob/living/carbon/human/target = user.pulling changeling.islinking = 1 for(var/i in 1 to 3) switch(i) diff --git a/code/game/gamemodes/clock_cult/clock_objects.dm b/code/game/gamemodes/clock_cult/clock_objects.dm index e0567ee1af1..ee80c39f8cb 100644 --- a/code/game/gamemodes/clock_cult/clock_objects.dm +++ b/code/game/gamemodes/clock_cult/clock_objects.dm @@ -1317,7 +1317,7 @@ icon = 'icons/effects/96x96.dmi' pixel_x = -30 pixel_y = -30 - layer = 2.01 + layer = ABOVE_OPEN_TURF_LAYER /obj/effect/clockwork/judicial_marker/New() ..() @@ -1374,6 +1374,14 @@ user << "This gateway can only [sender ? "send" : "receive"] objects." /obj/effect/clockwork/spatial_gateway/attack_hand(mob/living/user) + if(user.pulling && user.a_intent == "grab" && isliving(user.pulling)) + var/mob/living/L = user.pulling + if(L.buckled || L.anchored || L.buckled_mobs.len) + return 0 + user.visible_message("[user] shoves [L] into [src]!", "You shove [L] into [src]!") + user.stop_pulling() + pass_through_gateway(L) + return 1 if(!user.canUseTopic(src)) return 0 user.visible_message("[user] climbs through [src]!", "You brace yourself and step through [src]...") @@ -1386,14 +1394,6 @@ qdel(linked_gateway) qdel(src) return 1 - if(istype(I, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = I - if(!G.affecting) - return 0 - user.visible_message("[user] shoves [G.affecting] into [src]!", "You shove [G.affecting] into [src]!") - pass_through_gateway(G.affecting) - qdel(G) - return 1 if(user.drop_item()) pass_through_gateway(I) ..() @@ -1438,7 +1438,7 @@ desc = "Some big guy." clockwork_desc = "One of Ratvar's generals." alpha = 200 - layer = 10 + layer = MASSIVE_OBJ_LAYER /obj/effect/clockwork/general_marker/New() ..() diff --git a/code/game/gamemodes/clock_cult/clock_ratvar.dm b/code/game/gamemodes/clock_cult/clock_ratvar.dm index c3cbc6f5aac..2d10a958b95 100644 --- a/code/game/gamemodes/clock_cult/clock_ratvar.dm +++ b/code/game/gamemodes/clock_cult/clock_ratvar.dm @@ -1,7 +1,7 @@ /obj/structure/clockwork/massive //For objects that are typically very large name = "massive construct" desc = "A very large construction." - layer = 10 + layer = MASSIVE_OBJ_LAYER /obj/structure/clockwork/massive/celestial_gateway //The gateway to Reebe, from which Ratvar emerges name = "Gateway to the Celestial Derelict" diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index ebc7070d780..73ec9b1982c 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -189,7 +189,7 @@ /obj/item/clothing/suit/hooded/cultrobes/cult_shield/worn_overlays(isinhands) . = list() if(!isinhands && current_charges) - . += image(layer = MOB_LAYER+0.05, icon = 'icons/effects/effects.dmi', icon_state = "shield-cult") + . += image(layer = MOB_LAYER+0.01, icon = 'icons/effects/effects.dmi', icon_state = "shield-cult") /obj/item/clothing/suit/hooded/cultrobes/berserker name = "flagellant's robes" diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index ba4d77b455c..293ccca04ae 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -22,7 +22,7 @@ To draw a rune, use an arcane tome. icon = 'icons/obj/rune.dmi' icon_state = "1" unacidable = 1 - layer = TURF_LAYER + 0.08 + layer = ABOVE_NORMAL_TURF_LAYER color = rgb(255,0,0) var/invocation = "Aiy ele-mayo!" //This is said by cultists when the rune is invoked. diff --git a/code/game/gamemodes/demon/true_demon/inventory.dm b/code/game/gamemodes/demon/true_demon/inventory.dm index 23035370135..b288fab269c 100644 --- a/code/game/gamemodes/demon/true_demon/inventory.dm +++ b/code/game/gamemodes/demon/true_demon/inventory.dm @@ -20,7 +20,7 @@ hands_overlays += r_hand_image if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) - r_hand.layer = 20 + r_hand.layer = ABOVE_HUD_LAYER r_hand.screen_loc = ui_rhand client.screen |= r_hand @@ -35,7 +35,7 @@ hands_overlays += l_hand_image if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) - l_hand.layer = 20 + l_hand.layer = ABOVE_HUD_LAYER l_hand.screen_loc = ui_lhand client.screen |= l_hand if(hands_overlays.len) diff --git a/code/game/gamemodes/gang/dominator.dm b/code/game/gamemodes/gang/dominator.dm index bc1236d7d0e..d53fe91186a 100644 --- a/code/game/gamemodes/gang/dominator.dm +++ b/code/game/gamemodes/gang/dominator.dm @@ -5,7 +5,7 @@ icon_state = "dominator" density = 1 anchored = 1 - layer = 3.6 + layer = HIGH_OBJ_LAYER var/maxhealth = 200 var/health = 200 var/datum/gang/gang diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index 4aa0633f3be..aac99630f9e 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -389,7 +389,7 @@ /obj/effect/overlay/temp/swarmer //temporary swarmer visual feedback objects icon = 'icons/mob/swarmer.dmi' - layer = MOB_LAYER + layer = BELOW_MOB_LAYER /obj/effect/overlay/temp/swarmer/disintegration icon_state = "disintegrate" diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index 7ca8a800923..8f30a8bfca4 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -18,7 +18,7 @@ invisibility = INVISIBILITY_REVENANT health = INFINITY //Revenants don't use health, they use essence instead maxHealth = INFINITY - layer = 5 + layer = GHOST_LAYER healable = 0 sight = SEE_SELF see_invisible = SEE_INVISIBLE_NOLIGHTING diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 418a878733d..67600b7e11a 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -48,7 +48,7 @@ var/bomb_set icon = 'icons/obj/machines/nuke_terminal.dmi' icon_state = "nuclearbomb_base" anchored = 1 //stops it being moved - layer = 4 + layer = MOB_LAYER /obj/machinery/nuclearbomb/syndicate diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index 748b9f8a3e7..d13a9d588fd 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -27,7 +27,7 @@ var/hsboxspawn = 1 var/hsbinfo = null //items that shouldn't spawn on the floor because they would bug or act weird var/global/list/spawn_forbidden = list( - /obj/item/weapon/grab, /obj/item/tk_grab, /obj/item/weapon/implant, // not implanter, the actual thing that is inside you + /obj/item/tk_grab, /obj/item/weapon/implant, // not implanter, the actual thing that is inside you /obj/item/assembly,/obj/item/device/onetankbomb, /obj/item/radio, /obj/item/device/pda/ai, /obj/item/device/uplink, /obj/item/smallDelivery, /obj/item/missile,/obj/item/projectile, /obj/item/borg/sight,/obj/item/borg/stun,/obj/item/weapon/robot_module) @@ -145,28 +145,28 @@ var/hsboxspawn = 1 P.wear_suit.layer = initial(P.wear_suit.layer) P.wear_suit = null P.wear_suit = new/obj/item/clothing/suit/space(P) - P.wear_suit.layer = 20 + P.wear_suit.layer = ABOVE_HUD_LAYER P.update_inv_wear_suit() if(P.head) P.head.loc = P.loc P.head.layer = initial(P.head.layer) P.head = null P.head = new/obj/item/clothing/head/helmet/space(P) - P.head.layer = 20 + P.head.layer = ABOVE_HUD_LAYER P.update_inv_head() if(P.wear_mask) P.wear_mask.loc = P.loc P.wear_mask.layer = initial(P.wear_mask.layer) P.wear_mask = null P.wear_mask = new/obj/item/clothing/mask/gas(P) - P.wear_mask.layer = 20 + P.wear_mask.layer = ABOVE_HUD_LAYER P.update_inv_wear_mask() if(P.back) P.back.loc = P.loc P.back.layer = initial(P.back.layer) P.back = null P.back = new/obj/item/weapon/tank/jetpack/oxygen(P) - P.back.layer = 20 + P.back.layer = ABOVE_HUD_LAYER P.update_inv_back() P.internal = P.back P.update_internals_hud_icon(1) diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm index 4121a1baefd..a995968f4f0 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -5,7 +5,7 @@ name = "bluespace gigabeacon" desc = "A device that draws power from bluespace and creates a permanent tracking beacon." level = 1 // underfloor - layer = 2.5 + layer = LOW_OBJ_LAYER anchored = 1 use_power = 1 idle_power_usage = 0 diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm index acf294fd25c..e75c9827e14 100644 --- a/code/game/machinery/ai_slipper.dm +++ b/code/game/machinery/ai_slipper.dm @@ -2,7 +2,7 @@ name = "\improper AI liquid dispenser" icon = 'icons/obj/device.dmi' icon_state = "motion3" - layer = 3 + layer = PROJECTILE_HIT_THRESHHOLD_LAYER anchored = 1 var/uses = 20 var/disabled = 1 diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index b916029f14e..5ba7192f8bd 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -10,7 +10,7 @@ use_power = 2 idle_power_usage = 5 active_power_usage = 10 - layer = MOB_LAYER + 0.25 + layer = WALL_OBJ_LAYER var/health = 50 var/list/network = list("SS13") diff --git a/code/game/machinery/dna_scanner.dm b/code/game/machinery/dna_scanner.dm index 45f7b995486..3fee54bb4e0 100644 --- a/code/game/machinery/dna_scanner.dm +++ b/code/game/machinery/dna_scanner.dm @@ -152,19 +152,6 @@ if(default_deconstruction_crowbar(I)) return - if(istype(I, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = I - if(!ismob(G.affecting)) - return - - if(!state_open) - user << "Open the scanner first." - return - - var/mob/M = G.affecting - M.forceMove(loc) - qdel(G) - return return ..() /obj/machinery/dna_scannernew/attack_hand(mob/user) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 5a4292e3e42..b57a640508d 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -986,7 +986,7 @@ var/list/airlock_overlays = list() sleep(5) src.density = 0 sleep(9) - src.layer = 2.7 + src.layer = OPEN_DOOR_LAYER update_icon(AIRLOCK_OPEN, 1) SetOpacity(0) operating = 0 @@ -1023,7 +1023,7 @@ var/list/airlock_overlays = list() return 1 operating = 1 update_icon(AIRLOCK_CLOSING, 1) - src.layer = 3.1 + src.layer = CLOSED_DOOR_LAYER sleep(5) src.density = 1 if(!safe) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 81f3a3af60d..015c78b195a 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -6,7 +6,7 @@ anchored = 1 opacity = 1 density = 1 - layer = 2.7 + layer = OPEN_DOOR_LAYER power_channel = ENVIRON var/secondsElectrified = 0 @@ -19,7 +19,7 @@ var/heat_proof = 0 // For rglass-windowed airlocks and firedoors var/emergency = 0 // Emergency access override var/sub_door = 0 // 1 if it's meant to go under another door. - var/closingLayer = 3.1 + var/closingLayer = CLOSED_DOOR_LAYER var/autoclose = 0 //does it automatically close after some time var/safe = 1 //whether the door detects things and mobs in its way and reopen or crushes them. var/locked = 0 //whether the door is bolted or not. @@ -29,9 +29,9 @@ /obj/machinery/door/New() ..() if(density) - layer = 3.1 //Above most items if closed + layer = CLOSED_DOOR_LAYER //Above most items if closed else - layer = 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6 + layer = OPEN_DOOR_LAYER //Under all objects if opened. 2.7 due to tables being at 2.6 update_freelook_sight() air_update_turf(1) airlocks += src @@ -245,7 +245,7 @@ obj/machinery/door/proc/try_to_crowbar(obj/item/I, mob/user) sleep(5) density = 0 sleep(5) - layer = 2.7 + layer = OPEN_DOOR_LAYER update_icon() SetOpacity(0) operating = 0 diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index e2d5046c0d3..b94612e7d3f 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -18,7 +18,7 @@ glass = 1 var/nextstate = null sub_door = 1 - closingLayer = 3.11 + closingLayer = CLOSED_FIREDOOR_LAYER /obj/machinery/door/firedoor/Bumped(atom/AM) if(panel_open || operating) diff --git a/code/game/machinery/doors/shutters.dm b/code/game/machinery/doors/shutters.dm index 75fa01a2979..9c114009071 100644 --- a/code/game/machinery/doors/shutters.dm +++ b/code/game/machinery/doors/shutters.dm @@ -3,7 +3,7 @@ name = "shutters" desc = "Heavy duty metal shutters that opens mechanically." icon = 'icons/obj/doors/shutters.dmi' - layer = 3.1 + layer = CLOSED_DOOR_LAYER /obj/machinery/door/poddoor/shutters/preopen icon_state = "open" @@ -15,14 +15,14 @@ /obj/machinery/door/poddoor/shutters/New() ..() - layer = 3.1 //to handle /obj/machinery/door/New() resetting the layer. + layer = CLOSED_DOOR_LAYER //to handle /obj/machinery/door/New() resetting the layer. /obj/machinery/door/poddoor/shutters/open(ignorepower = 0) ..() - layer = 3.1 + layer = CLOSED_DOOR_LAYER /obj/machinery/door/poddoor/shutters/close(ignorepower = 0) ..() - layer = 3.1 \ No newline at end of file + layer = CLOSED_DOOR_LAYER \ No newline at end of file diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 49bf6e7d916..f776b3929fd 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -35,7 +35,7 @@ var/const/HOLOPAD_MODE = RANGE_BASED name = "\improper AI holopad" desc = "It's a floor-mounted device for projecting holographic images. It is activated remotely." icon_state = "holopad0" - layer = 2.1 + layer = LOW_OBJ_LAYER flags = HEAR languages = ROBOT | HUMAN var/list/masters = list()//List of AIs that use the holopad diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 0eb8c805d4c..56267483da4 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -11,7 +11,7 @@ name = "electromagnetic generator" desc = "A device that uses station power to create points of magnetic energy." level = 1 // underfloor - layer = 2.5 + layer = LOW_OBJ_LAYER anchored = 1 use_power = 1 idle_power_usage = 50 diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 0bf936413c2..9b644c909bc 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -8,7 +8,7 @@ name = "navigation beacon" desc = "A radio beacon used for bot navigation." level = 1 // underfloor - layer = 2.5 + layer = LOW_OBJ_LAYER anchored = 1 var/open = 0 // true if cover is open diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm index a920d418d14..06c78ba1905 100644 --- a/code/game/machinery/overview.dm +++ b/code/game/machinery/overview.dm @@ -178,7 +178,7 @@ qdel(I) qdel(J) H.icon = HI - H.layer = 25 + H.layer = ABOVE_HUD_LAYER usr.mapobjs += H #else @@ -296,7 +296,7 @@ H.icon = I qdel(I) - H.layer = 25 + H.layer = ABOVE_HUD_LAYER usr.mapobjs += H #endif diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index d015bb1a975..6a67e4e3f07 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -3,7 +3,7 @@ icon = 'icons/obj/turrets.dmi' icon_state = "grey_target_prism" anchored = 1 - layer = 3 + layer = OBJ_LAYER invisibility = INVISIBILITY_OBSERVER //the turret is invisible if it's inside its cover density = 1 use_power = 1 //this turret uses and requires power @@ -502,7 +502,7 @@ if(cover) cover.icon_state = "openTurretCover" raised = 1 - layer = 4 + layer = MOB_LAYER /obj/machinery/porta_turret/proc/popDown() //pops the turret down if(disabled) @@ -511,7 +511,7 @@ return if(stat & BROKEN) return - layer = 3 + layer = OBJ_LAYER raising = 1 if(cover) flick("popdown", cover) diff --git a/code/game/machinery/porta_turret/portable_turret_cover.dm b/code/game/machinery/porta_turret/portable_turret_cover.dm index a65694405a7..bb399096382 100644 --- a/code/game/machinery/porta_turret/portable_turret_cover.dm +++ b/code/game/machinery/porta_turret/portable_turret_cover.dm @@ -8,7 +8,7 @@ icon = 'icons/obj/turrets.dmi' icon_state = "turretCover" anchored = 1 - layer = 3.5 + layer = HIGH_OBJ_LAYER density = 0 var/obj/machinery/porta_turret/parent_turret = null diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 473f0ead2c6..f98ac6d0605 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -5,7 +5,7 @@ var/const/SAFETY_COOLDOWN = 100 desc = "A large crushing machine which is used to recycle small items ineffeciently; there are lights on the side of it." icon = 'icons/obj/recycling.dmi' icon_state = "grinder-o0" - layer = MOB_LAYER+1 // Overhead + layer = ABOVE_ALL_MOB_LAYER // Overhead anchored = 1 density = 1 var/safety_mode = FALSE // Temporarily stops machine if it detects a mob diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 8cc117ac3b1..4cebbf7c5ce 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -111,7 +111,7 @@ anchored = 0 density = 1 - layer = MOB_LAYER - 0.2 //so people can't hide it and it's REALLY OBVIOUS + layer = BELOW_MOB_LAYER //so people can't hide it and it's REALLY OBVIOUS stat = 0 var/active = 0 diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 34a0b766469..c31202c2c1b 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -7,7 +7,7 @@ anchored = 0 density = 0 - layer = MOB_LAYER - 0.2 //so people can't hide it and it's REALLY OBVIOUS + layer = BELOW_MOB_LAYER //so people can't hide it and it's REALLY OBVIOUS unacidable = 1 var/timer = 60 diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index 1b18ea95e3a..3145ab44da8 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -3,7 +3,7 @@ desc = "A large metallic machine with an entrance and an exit. A sign on the side reads, 'human go in, robot come out', human must be lying down and alive. Has to cooldown between each use." icon = 'icons/obj/recycling.dmi' icon_state = "separator-AO1" - layer = MOB_LAYER+1 // Overhead + layer = ABOVE_ALL_MOB_LAYER // Overhead anchored = 1 density = 0 var/transform_dead = 0 diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 53800726166..edfe1f58dc8 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -15,7 +15,7 @@ desc = "A generic vending machine." icon = 'icons/obj/vending.dmi' icon_state = "generic" - layer = 2.9 + layer = BELOW_OBJ_LAYER anchored = 1 density = 1 verb_say = "beeps" diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index eb062334719..f43d5b07698 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -192,14 +192,6 @@ if(default_deconstruction_screwdriver(user, null, null, W)) update_icon() return - else if(istype(W,/obj/item/weapon/grab)) - if(state_open) - var/obj/item/weapon/grab/G = W - if(iscorgi(G.affecting)) - has_corgi = 1 - G.affecting.loc = src - qdel(G) - update_icon() else if(user.a_intent != "harm") @@ -232,6 +224,17 @@ user << "[src] is busy." return + if(user.pulling && user.a_intent == "grab" && isliving(user.pulling)) + var/mob/living/L = user.pulling + if(L.buckled || L.buckled_mobs.len) + return + if(state_open) + if(iscorgi(L)) + has_corgi = 1 + L.forceMove(src) + update_icon() + return + if(!state_open) open_machine() else diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index df4289934f0..0665c68b80b 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -20,7 +20,7 @@ opacity = 1 ///opaque. Menacing. anchored = 1 //no pulling around. unacidable = 1 //and no deleting hoomans inside - layer = MOB_LAYER - 0.2//icon draw layer + layer = BELOW_MOB_LAYER//icon draw layer infra_luminosity = 15 //byond implementation is bugged. force = 5 flags = HEAR diff --git a/code/game/objects/effects/decals/Cleanable/aliens.dm b/code/game/objects/effects/decals/Cleanable/aliens.dm index 7e358f18fb4..36bf7577bb1 100644 --- a/code/game/objects/effects/decals/Cleanable/aliens.dm +++ b/code/game/objects/effects/decals/Cleanable/aliens.dm @@ -5,7 +5,7 @@ desc = "It's green and acidic. It looks like... blood?" gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/effects/blood.dmi' icon_state = "xfloor1" random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7") diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index 20c32cca078..e6e90cbde1c 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -3,7 +3,7 @@ desc = "It's red and gooey. Perhaps it's the chef's cooking?" gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/effects/blood.dmi' icon_state = "floor1" random_icon_states = list("floor1", "floor2", "floor3", "floor4", "floor5", "floor6", "floor7") @@ -38,7 +38,7 @@ desc = "Your instincts say you shouldn't be following these." gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER random_icon_states = null var/list/existing_dirs = list() blood_DNA = list() @@ -53,7 +53,7 @@ desc = "They look bloody and gruesome." gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/effects/blood.dmi' icon_state = "gibbl5" random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6") diff --git a/code/game/objects/effects/decals/Cleanable/misc.dm b/code/game/objects/effects/decals/Cleanable/misc.dm index b4d66d84595..f7f4f5fe953 100644 --- a/code/game/objects/effects/decals/Cleanable/misc.dm +++ b/code/game/objects/effects/decals/Cleanable/misc.dm @@ -3,7 +3,7 @@ desc = "Someone should clean that up." gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/obj/objects.dmi' icon_state = "shards" @@ -26,7 +26,7 @@ icon_state = "dirt" gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER mouse_opacity = 0 /obj/effect/decal/cleanable/flour @@ -34,7 +34,7 @@ desc = "It's still good. Four second rule!" gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon_state = "flour" /obj/effect/decal/cleanable/greenglow @@ -42,7 +42,7 @@ desc = "Jeez. I hope that's not for lunch." gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER luminosity = 1 icon_state = "greenglow" @@ -53,7 +53,7 @@ name = "cobweb" desc = "Somebody should remove that." density = 0 - layer = 3 + layer = OBJ_LAYER icon_state = "cobweb1" burntime = 1 @@ -64,7 +64,7 @@ name = "gooey grey mass" desc = "It looks like a melted... something." density = 0 - layer = 3 + layer = OBJ_LAYER icon = 'icons/obj/chemical.dmi' icon_state = "molten" @@ -72,7 +72,7 @@ name = "cobweb" desc = "Somebody should remove that." density = 0 - layer = 3 + layer = OBJ_LAYER icon_state = "cobweb2" //Vomit (sorry) @@ -81,7 +81,7 @@ desc = "Gosh, how unpleasant." gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/effects/blood.dmi' icon_state = "vomit_1" random_icon_states = list("vomit_1", "vomit_2", "vomit_3", "vomit_4") @@ -113,14 +113,14 @@ name = "tomato smudge" desc = "It's red." density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/effects/tomatodecal.dmi' random_icon_states = list("tomato_floor1", "tomato_floor2", "tomato_floor3") /obj/effect/decal/cleanable/plant_smudge name = "plant smudge" density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/effects/tomatodecal.dmi' random_icon_states = list("smashed_plant") @@ -128,7 +128,7 @@ name = "smashed egg" desc = "Seems like this one won't hatch." density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/effects/tomatodecal.dmi' random_icon_states = list("smashed_egg1", "smashed_egg2", "smashed_egg3") @@ -136,7 +136,7 @@ name = "smashed pie" desc = "It's pie cream from a cream pie." density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/effects/tomatodecal.dmi' random_icon_states = list("smashed_pie") @@ -153,7 +153,7 @@ icon_state = "shreds" gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER /obj/effect/decal/cleanable/shreds/New() pixel_x = rand(-5, 5) diff --git a/code/game/objects/effects/decals/Cleanable/robots.dm b/code/game/objects/effects/decals/Cleanable/robots.dm index af2ff562590..e255f497ca2 100644 --- a/code/game/objects/effects/decals/Cleanable/robots.dm +++ b/code/game/objects/effects/decals/Cleanable/robots.dm @@ -5,7 +5,7 @@ desc = "It's a useless heap of junk... or is it?" gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/mob/robots.dmi' icon_state = "gib1" random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7") @@ -44,7 +44,7 @@ desc = "It's black and greasy. Looks like Beepsky made another mess." gender = PLURAL density = 0 - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/mob/robots.dmi' icon_state = "floor1" var/viruses = list() diff --git a/code/game/objects/effects/decals/crayon.dm b/code/game/objects/effects/decals/crayon.dm index 2f5bd9ea000..2948ada90d0 100644 --- a/code/game/objects/effects/decals/crayon.dm +++ b/code/game/objects/effects/decals/crayon.dm @@ -3,7 +3,7 @@ desc = "Graffiti. Damn kids." icon = 'icons/effects/crayondecal.dmi' icon_state = "rune1" - layer = 2.1 + layer = ABOVE_NORMAL_TURF_LAYER var/do_icon_rotate = TRUE /obj/effect/decal/cleanable/crayon/examine() @@ -31,7 +31,7 @@ /obj/effect/decal/cleanable/crayon/gang - layer = 3.6 //Harder to hide + layer = HIGH_OBJ_LAYER //Harder to hide do_icon_rotate = FALSE //These are designed to always face south, so no rotation please. var/datum/gang/gang diff --git a/code/game/objects/effects/decals/misc.dm b/code/game/objects/effects/decals/misc.dm index 8daf88c6c42..762c702df1c 100644 --- a/code/game/objects/effects/decals/misc.dm +++ b/code/game/objects/effects/decals/misc.dm @@ -2,7 +2,7 @@ name = "pointer" icon = 'icons/mob/screen_gen.dmi' icon_state = "arrow" - layer = 16 + layer = POINT_LAYER duration = 25 /obj/effect/overlay/temp/point/New(atom/target, set_invis = 0) @@ -12,23 +12,18 @@ pixel_y = target.pixel_y invisibility = set_invis -// Used for spray that you spray at walls, tables, hydrovats etc -/obj/effect/decal/spraystill - density = 0 - layer = 50 - //Used by spraybottles. /obj/effect/decal/chempuff name = "chemicals" icon = 'icons/obj/chempuff.dmi' pass_flags = PASSTABLE | PASSGRILLE - layer = 5 + layer = FLY_LAYER /obj/effect/decal/sandeffect name = "sandy tile" icon = 'icons/turf/floors.dmi' icon_state = "sandeffect" - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER /obj/effect/decal/fakelattice name = "lattice" diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index 54e57af855e..6dbf2b473e9 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -7,7 +7,7 @@ opacity = 0 anchored = 1 density = 0 - layer = MOB_LAYER + 0.5 + layer = ABOVE_ALL_MOB_LAYER mouse_opacity = 0 var/amount = 3 animate_movement = 0 diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 47dabfaf579..fd07e31986d 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -7,7 +7,7 @@ density = 0 icon = 'icons/obj/lighting.dmi' icon_state = "glowshroom" //replaced in New - layer = 2.1 + layer = ABOVE_NORMAL_TURF_LAYER var/endurance = 30 var/potency = 30 var/delay = 1200 diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index d39257edbcf..8c16eb5533f 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -3,7 +3,6 @@ desc = "Better stay away from that thing." density = 0 anchored = 1 - layer = 3 icon = 'icons/obj/weapons.dmi' icon_state = "uglymine" var/triggered = 0 diff --git a/code/game/objects/effects/misc.dm b/code/game/objects/effects/misc.dm index 4d621cf0fdd..712d8c6c59f 100644 --- a/code/game/objects/effects/misc.dm +++ b/code/game/objects/effects/misc.dm @@ -7,15 +7,6 @@ density = 1 anchored = 0 -/obj/effect/mark - var/mark = "" - icon = 'icons/misc/mark.dmi' - icon_state = "blank" - anchored = 1 - layer = 99 - mouse_opacity = 0 - unacidable = 1//Just to be sure. - /obj/effect/beam name = "beam" unacidable = 1//Just to be sure. diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index c929d74e5ca..79ce9abe797 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -22,7 +22,7 @@ /obj/effect/overlay/temp icon_state = "nothing" anchored = 1 - layer = 4.1 + layer = ABOVE_MOB_LAYER mouse_opacity = 0 var/duration = 10 var/randomdir = 1 @@ -117,7 +117,7 @@ /obj/effect/overlay/temp/cult/door name = "unholy glow" icon_state = "doorglow" - layer = 3.17 //above closed doors + layer = CLOSED_FIREDOOR_LAYER //above closed doors /obj/effect/overlay/temp/cult/door/unruned icon_state = "unruneddoorglow" @@ -125,7 +125,7 @@ /obj/effect/overlay/temp/cult/turf name = "unholy glow" icon_state = "wallglow" - layer = TURF_LAYER + 0.07 + layer = ABOVE_NORMAL_TURF_LAYER /obj/effect/overlay/temp/cult/turf/open/floor icon_state = "floorglow" @@ -179,7 +179,7 @@ icon = 'icons/misc/beach2.dmi' icon_state = "palm1" density = 1 - layer = 5 + layer = WALL_OBJ_LAYER anchored = 1 /obj/effect/overlay/palmtree_l @@ -187,7 +187,7 @@ icon = 'icons/misc/beach2.dmi' icon_state = "palm2" density = 1 - layer = 5 + layer = WALL_OBJ_LAYER anchored = 1 /obj/effect/overlay/coconut diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm index 47c439f0a4e..e4c4ba33fa4 100644 --- a/code/game/objects/effects/spawners/lootdrop.dm +++ b/code/game/objects/effects/spawners/lootdrop.dm @@ -94,7 +94,7 @@ /obj/item/stack/rods{amount = 50} = 1, /obj/item/stack/sheet/cardboard = 2, /obj/item/stack/sheet/metal{amount = 20} = 1, - /obj/item/stack/sheet/mineral/plasma{layer = 2.9} = 1, + /obj/item/stack/sheet/mineral/plasma = 1, /obj/item/stack/sheet/rglass = 1, /obj/item/weapon/book/manual/wiki/engineering_construction = 1, /obj/item/weapon/book/manual/wiki/engineering_hacking = 1, diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index b8d0a99bba9..2ed341eca59 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -98,7 +98,7 @@ desc = "It never stays still for long." icon_state = "spiderling" anchored = 0 - layer = 2.75 + layer = PROJECTILE_HIT_THRESHHOLD_LAYER health = 3 var/amount_grown = 0 var/grow_as = null diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 196de8d7fe1..54a33a19464 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -405,7 +405,7 @@ obj/item/proc/item_action_slot_check(slot, mob/user) set category = "Object" set name = "Pick up" - if(usr.stat || usr.restrained() || !Adjacent(usr) || usr.stunned || usr.weakened || usr.lying) + if(usr.incapacitated() || !Adjacent(usr) || usr.lying) return if(usr.get_active_hand() == null) // Let me know if this has any problems -Yota diff --git a/code/game/objects/items/documents.dm b/code/game/objects/items/documents.dm index 043fcd80cb0..1fbfb9490a6 100644 --- a/code/game/objects/items/documents.dm +++ b/code/game/objects/items/documents.dm @@ -8,7 +8,7 @@ w_class = 1 throw_range = 1 throw_speed = 1 - layer = 4 + layer = MOB_LAYER pressure_resistance = 1 /obj/item/documents/nanotrasen diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index 9b8c98c5155..ee43c27dc91 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -153,7 +153,7 @@ var/global/list/datum/stack_recipe/sinew_recipes = list ( \ singular_name = "hide plate" flags = NOBLUDGEON w_class = 3 - layer = 4 + layer = MOB_LAYER /obj/item/stack/sheet/animalhide/ashdrake name = "ash drake hide" @@ -163,7 +163,7 @@ var/global/list/datum/stack_recipe/sinew_recipes = list ( \ singular_name = "drake plate" flags = NOBLUDGEON w_class = 3 - layer = 4 + layer = MOB_LAYER //Step one - dehairing. diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index c6826df71e8..bbfb0fe0140 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -62,7 +62,7 @@ var/global/list/datum/stack_recipe/sandstone_recipes = list ( \ icon = 'icons/obj/items.dmi' icon_state = "sandbags" singular_name = "sandbag" - layer = 2.95 + layer = LOW_ITEM_LAYER origin_tech = "materials=2" var/global/list/datum/stack_recipe/sandbag_recipes = list ( \ diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm index 29c3e7af930..fd681c0138e 100644 --- a/code/game/objects/items/weapons/implants/implantchair.dm +++ b/code/game/objects/items/weapons/implants/implantchair.dm @@ -69,24 +69,7 @@ add_implants() ready = 1 - src.updateUsrDialog() - return - - -/obj/machinery/implantchair/attackby(obj/item/weapon/W, mob/user, params) - if(istype(W, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = W - if(!ismob(G.affecting)) - return - var/mob/M = G.affecting - if(M.buckled_mobs.len) - user << "[M] will not fit into [src] because they have a creature on them!" - return - if(put_mob(M)) - qdel(G) - updateUsrDialog() - else - return ..() + updateUsrDialog() /obj/machinery/implantchair/go_out(mob/M) diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm index 8bc7ddce955..58c8b914446 100644 --- a/code/game/objects/items/weapons/storage/backpack.dm +++ b/code/game/objects/items/weapons/storage/backpack.dm @@ -82,7 +82,7 @@ qdel(src) singulo.process() return - ..() + . = ..() /obj/item/weapon/storage/backpack/holding/singularity_act(current_size) var/dist = max((current_size - 2),1) diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index 3c4d49efdb4..1c9d4aa82bf 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -201,6 +201,8 @@ if(!S.amount) qdel(S) else + if(S.pulledby) + S.pulledby.stop_pulling() S.loc = src orient2hud(usr) @@ -345,7 +347,7 @@ /obj/item/weapon/storage/bag/tray/handle_item_insertion(obj/item/I, prevent_warning = 0) overlays += image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = -1) - ..() + . = ..() /* diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 88b479e8591..7947a228a35 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -157,7 +157,7 @@ boxes.screen_loc = "[tx]:,[ty] to [mx],[my]" for(var/obj/O in contents) O.screen_loc = "[cx],[cy]" - O.layer = 20 + O.layer = ABOVE_HUD_LAYER cx++ if(cx > mx) cx = tx @@ -176,7 +176,7 @@ ND.sample_object.mouse_opacity = 2 ND.sample_object.screen_loc = "[cx]:16,[cy]:16" ND.sample_object.maptext = "[(ND.number > 1)? "[ND.number]" : ""]" - ND.sample_object.layer = 20 + ND.sample_object.layer = ABOVE_HUD_LAYER cx++ if(cx > (4+cols)) cx = 4 @@ -186,7 +186,7 @@ O.mouse_opacity = 2 //This is here so storage items that spawn with contents correctly have the "click around item to equip" O.screen_loc = "[cx]:16,[cy]:16" O.maptext = "" - O.layer = 20 + O.layer = ABOVE_HUD_LAYER cx++ if(cx > (4+cols)) cx = 4 @@ -301,6 +301,8 @@ return 0 if(silent) prevent_warning = 1 + if(W.pulledby) + W.pulledby.stop_pulling() W.loc = src W.on_enter_storage(src) if(usr) @@ -462,11 +464,11 @@ boxes.master = src boxes.icon_state = "block" boxes.screen_loc = "7,7 to 10,8" - boxes.layer = 19 + boxes.layer = HUD_LAYER closer = new /obj/screen/close() closer.master = src closer.icon_state = "backpack_close" - closer.layer = 20 + closer.layer = ABOVE_HUD_LAYER orient2hud() diff --git a/code/game/objects/items/weapons/storage/wallets.dm b/code/game/objects/items/weapons/storage/wallets.dm index d3b45dcf87b..cc861ffaeb6 100644 --- a/code/game/objects/items/weapons/storage/wallets.dm +++ b/code/game/objects/items/weapons/storage/wallets.dm @@ -51,7 +51,7 @@ combined_access |= I.access /obj/item/weapon/storage/wallet/handle_item_insertion(obj/item/W, prevent_warning = 0) - . = ..(W, prevent_warning) + . = ..() if(.) if(istype(W, /obj/item/weapon/card/id)) refreshID() diff --git a/code/game/objects/structures/aliens.dm b/code/game/objects/structures/aliens.dm index ffe82b4c3c3..be576ce514b 100644 --- a/code/game/objects/structures/aliens.dm +++ b/code/game/objects/structures/aliens.dm @@ -162,7 +162,7 @@ desc = "A thick resin surface covers the floor." anchored = 1 density = 0 - layer = TURF_LAYER + 0.09 + layer = TURF_LAYER icon_state = "weeds" health = 15 var/obj/structure/alien/weeds/node/linked_node = null diff --git a/code/game/objects/structures/beds_chairs/alien_nest.dm b/code/game/objects/structures/beds_chairs/alien_nest.dm index 5186309b65e..afa7633b420 100644 --- a/code/game/objects/structures/beds_chairs/alien_nest.dm +++ b/code/game/objects/structures/beds_chairs/alien_nest.dm @@ -14,7 +14,7 @@ var/image/nest_overlay /obj/structure/bed/nest/New() - nest_overlay = image('icons/mob/alien.dmi', "nestoverlay", layer=MOB_LAYER - 0.2) + nest_overlay = image('icons/mob/alien.dmi', "nestoverlay", layer=LYING_MOB_LAYER) return ..() /obj/structure/bed/nest/user_unbuckle_mob(mob/living/buckled_mob, mob/living/user) @@ -73,7 +73,7 @@ if(M in buckled_mobs) M.pixel_y = 0 M.pixel_x = initial(M.pixel_x) + 2 - M.layer = MOB_LAYER - 0.3 + M.layer = BELOW_MOB_LAYER overlays += nest_overlay else M.pixel_x = M.get_standard_pixel_x_offset(M.lying) diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index faf3b4b8cb3..c91e5d5978e 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -162,7 +162,7 @@ /obj/structure/chair/comfy/New() armrest = image("icons/obj/chairs.dmi", "comfychair_armrest") - armrest.layer = MOB_LAYER + 0.1 + armrest.layer = ABOVE_MOB_LAYER return ..() diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 415139938a2..535966a09f8 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -11,7 +11,7 @@ LINEN BINS icon_state = "sheetwhite" item_state = "bedsheet" slot_flags = SLOT_BACK - layer = 4 + layer = MOB_LAYER throwforce = 0 throw_speed = 1 throw_range = 2 @@ -28,9 +28,11 @@ LINEN BINS /obj/item/weapon/bedsheet/attack_self(mob/user) user.drop_item() if(layer == initial(layer)) - layer = 5 + layer = ABOVE_MOB_LAYER + user << "You cover yourself with [src]." else layer = initial(layer) + user << "You smooth [src] out beneath you." add_fingerprint(user) return diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index 8bf04d32eea..46d5f54b002 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -8,7 +8,7 @@ anchored = 1 density = 1 pixel_x = -16 - layer = 9 + layer = FLY_LAYER var/cut = FALSE var/log_amount = 10 diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 6d2412589de..ed54a367368 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -9,7 +9,7 @@ icon_state = "girder" anchored = 1 density = 1 - layer = 2.9 + layer = BELOW_OBJ_LAYER var/state = GIRDER_NORMAL var/girderpasschance = 20 // percentage chance that a projectile passes through the girder. var/can_displace = TRUE //If the girder can be moved around by wrenching it @@ -291,7 +291,6 @@ anchored = 0 state = GIRDER_DISPLACED girderpasschance = 25 - layer = 2.45 /obj/structure/girder/reinforced name = "reinforced girder" diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 745d27a0e5c..b2b5bf94732 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -7,7 +7,7 @@ anchored = 1 flags = CONDUCT pressure_resistance = 5*ONE_ATMOSPHERE - layer = 2.9 + layer = BELOW_OBJ_LAYER var/health = 10 var/destroyed = 0 var/obj/item/stack/rods/stored diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm index fb32d2d03ba..998a6820328 100644 --- a/code/game/objects/structures/kitchen_spike.dm +++ b/code/game/objects/structures/kitchen_spike.dm @@ -50,38 +50,37 @@ qdel(src) else user << "You can't do that while something's on the spike!" - - else if(istype(I, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = I - if(istype(G.affecting, /mob/living/)) - if(!buckled_mobs.len) - if(do_mob(user, src, 120)) - if(buckled_mobs.len) //to prevent spam/queing up attacks - return - if(G.affecting.buckled) - return - var/mob/living/H = G.affecting - playsound(src.loc, "sound/effects/splat.ogg", 25, 1) - H.visible_message("[user] slams [G.affecting] onto the meat spike!", "[user] slams you onto the meat spike!", "You hear a squishy wet noise.") - H.loc = src.loc - H.emote("scream") - if(istype(H, /mob/living/carbon/human)) //So you don't get human blood when you spike a giant spidere - var/turf/pos = get_turf(H) - pos.add_blood_floor(H) - H.adjustBruteLoss(30) - H.buckled = src - H.dir = 2 - buckle_mob(H, force=1) - var/matrix/m180 = matrix(H.transform) - m180.Turn(180) - animate(H, transform = m180, time = 3) - H.pixel_y = H.get_standard_pixel_y_offset(180) - qdel(G) - return - user << "You can't use that on the spike!" else return ..() +/obj/structure/kitchenspike/attack_hand(mob/user) + if(user.pulling && isliving(user.pulling) && user.a_intent == "grab" && !buckled_mobs.len) + var/mob/living/L = user.pulling + if(do_mob(user, src, 120)) + if(buckled_mobs.len) //to prevent spam/queing up attacks + return + if(L.buckled) + return + playsound(src.loc, "sound/effects/splat.ogg", 25, 1) + L.visible_message("[user] slams [L] onto the meat spike!", "[user] slams you onto the meat spike!", "You hear a squishy wet noise.") + L.loc = src.loc + L.emote("scream") + if(ishuman(L)) //So you don't get human blood when you spike a giant spider + var/turf/pos = get_turf(L) + pos.add_blood_floor(L) + L.adjustBruteLoss(30) + L.buckled = src + L.dir = 2 + buckle_mob(L, force=1) + var/matrix/m180 = matrix(L.transform) + m180.Turn(180) + animate(L, transform = m180, time = 3) + L.pixel_y = L.get_standard_pixel_y_offset(180) + else + ..() + + + /obj/structure/kitchenspike/user_buckle_mob(mob/living/M, mob/living/user) //Don't want them getting put on the rack other than by spiking return diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index c676d5882ce..399253f5a17 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -5,7 +5,7 @@ icon_state = "lattice" density = 0 anchored = 1 - layer = 2.3 //under pipes + layer = LATTICE_LAYER //under pipes var/obj/item/stack/rods/stored canSmoothWith = list(/obj/structure/lattice, /turf/open/floor, diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 03b9f323307..e142ca61091 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -211,7 +211,7 @@ var/global/list/crematoriums = new/list() /obj/structure/tray icon = 'icons/obj/stationobjs.dmi' density = 1 - layer = 2.9 + layer = BELOW_OBJ_LAYER var/obj/structure/bodycontainer/connected = null anchored = 1 pass_flags = LETPASSTHROW diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index ee8c28788a9..69603d9c9ed 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -5,7 +5,7 @@ icon_state = "plasticflaps" density = 0 anchored = 1 - layer = 4 + layer = ABOVE_MOB_LAYER /obj/structure/plasticflaps/CanAStarPass(ID, to_dir, caller) if(istype(caller, /mob/living)) diff --git a/code/game/objects/structures/reflector.dm b/code/game/objects/structures/reflector.dm index 1fd47bc35e9..ce55d863179 100644 --- a/code/game/objects/structures/reflector.dm +++ b/code/game/objects/structures/reflector.dm @@ -5,7 +5,7 @@ desc = "An angled mirror for reflecting lasers. This one does so at a 90 degree angle." anchored = 0 density = 1 - layer = 2.9 + layer = BELOW_OBJ_LAYER var/finished = 0 var/admin = 0 //Can't be rotated or deconstructed var/framebuildstacktype = /obj/item/stack/sheet/metal diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index 51679ceedf2..8cd1b6b101d 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -177,7 +177,7 @@ obj/structure/safe/ex_act(severity, target) icon_state = "floorsafe" density = 0 level = 1 //underfloor - layer = 2.5 + layer = LOW_OBJ_LAYER /obj/structure/safe/floor/initialize() diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm index 28cc59a701b..df5050da450 100644 --- a/code/game/objects/structures/signs.dm +++ b/code/game/objects/structures/signs.dm @@ -3,7 +3,7 @@ anchored = 1 opacity = 0 density = 0 - layer = 3.5 + layer = SIGN_LAYER /obj/structure/sign/basic name = "blank sign" diff --git a/code/game/objects/structures/table_frames.dm b/code/game/objects/structures/table_frames.dm index c9e6167f88f..7dc62153c5d 100644 --- a/code/game/objects/structures/table_frames.dm +++ b/code/game/objects/structures/table_frames.dm @@ -16,7 +16,7 @@ icon_state = "table_frame" density = 0 anchored = 0 - layer = 2.8 + layer = PROJECTILE_HIT_THRESHHOLD_LAYER var/framestack = /obj/item/stack/rods var/framestackamount = 2 diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 5efd453e419..a4dfb691ee1 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -19,7 +19,7 @@ icon_state = "table" density = 1 anchored = 1 - layer = 2.8 + layer = TABLE_LAYER climbable = TRUE pass_flags = LETPASSTHROW //You can throw objects over this, despite it's density.") var/frame = /obj/structure/table_frame @@ -97,6 +97,19 @@ take_damage(rand(180,280), BRUTE, 0) return 1 +/obj/structure/table/attack_hand(mob/living/user) + if(user.a_intent == "grab" && user.pulling && isliving(user.pulling)) + var/mob/living/pushed_mob = user.pulling + if(pushed_mob.buckled) + user << "[pushed_mob] is buckled to [pushed_mob.buckled]!" + return + if(user.grab_state < GRAB_AGGRESSIVE) + user << "You need a better grip to do that!" + return + tablepush(user, pushed_mob) + user.stop_pulling() + else + ..() /obj/structure/table/attack_tk() // no telehulk sorry return @@ -123,39 +136,15 @@ var/atom/movable/mover = caller . = . || mover.checkpass(PASSTABLE) -/obj/structure/table/proc/tablepush(obj/item/I, mob/user) - if(get_dist(src, user) < 2) - var/obj/item/weapon/grab/G = I - if(G.affecting.buckled) - user << "[G.affecting] is buckled to [G.affecting.buckled]!" - return 0 - if(G.state < GRAB_AGGRESSIVE) - user << "You need a better grip to do that!" - return 0 - if(!G.confirm()) - return 0 - G.affecting.forceMove(src.loc) - if(istype(src, /obj/structure/table/optable)) - var/obj/structure/table/optable/OT = src - G.affecting.resting = 1 - G.affecting.update_canmove() - visible_message("[G.assailant] has laid [G.affecting] on [src].") - OT.patient = G.affecting - OT.check_patient() - qdel(I) - return 1 - G.affecting.Weaken(2) - G.affecting.visible_message("[G.assailant] pushes [G.affecting] onto [src].", \ - "[G.assailant] pushes [G.affecting] onto [src].") - add_logs(G.assailant, G.affecting, "pushed") - qdel(I) - return 1 - qdel(I) +/obj/structure/table/proc/tablepush(mob/living/user, mob/living/pushed_mob) + pushed_mob.forceMove(src.loc) + pushed_mob.Weaken(2) + pushed_mob.visible_message("[user] pushes [pushed_mob] onto [src].", \ + "[user] pushes [pushed_mob] onto [src].") + add_logs(user, pushed_mob, "pushed") + /obj/structure/table/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/weapon/grab)) - tablepush(I, user) - return if(!(flags & NODECONSTRUCT)) if(istype(I, /obj/item/weapon/screwdriver) && deconstruction_ready) table_deconstruct(user, 1) @@ -297,10 +286,12 @@ /obj/structure/table/glass/proc/table_shatter(mob/M) visible_message("[src] breaks!", "You hear breaking glass.") - playsound(src.loc, "shatter", 50, 1) - for(var/i in debris) - var/atom/movable/AM = i - AM.loc = get_turf(src) + var/turf/T = get_turf(src) + playsound(T, "shatter", 50, 1) + for(var/I in debris) + var/atom/movable/AM = I + AM.forceMove(T) + debris -= AM if(istype(AM, /obj/item/weapon/shard)) AM.throw_impact(M) M.Weaken(5) @@ -401,6 +392,13 @@ computer.table = src break +/obj/structure/table/optable/tablepush(mob/living/user, mob/living/pushed_mob) + pushed_mob.forceMove(src.loc) + pushed_mob.resting = 1 + pushed_mob.update_canmove() + visible_message("[user] has laid [pushed_mob] on [src].") + check_patient() + /obj/structure/table/optable/proc/check_patient() var/mob/M = locate(/mob/living/carbon/human, loc) if(M) diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm index 0c931eb3b53..0a0d96eac20 100644 --- a/code/game/objects/structures/target_stake.dm +++ b/code/game/objects/structures/target_stake.dm @@ -27,7 +27,7 @@ pinned_target = T T.pinnedLoc = src T.density = 1 - T.layer = OBJ_LAYER + 0.1 + T.layer = OBJ_LAYER + 0.01 T.loc = loc user << "You slide the target into the stake." diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm index e4bbee8dcf7..0f4e8e3f431 100644 --- a/code/game/objects/structures/transit_tubes/station.dm +++ b/code/game/objects/structures/transit_tubes/station.dm @@ -60,41 +60,44 @@ /obj/structure/transit_tube/station/attack_hand(mob/user) if(!pod_moving) - for(var/obj/structure/transit_tube_pod/pod in loc) - if(!pod.moving && pod.dir in directions()) - if(icon_state == "closed") - open_animation() + if(user.pulling && user.a_intent == "grab" && isliving(user.pulling)) + if(icon_state == "open") + var/mob/living/GM = user.pulling + if(user.grab_state >= GRAB_AGGRESSIVE) + if(GM.buckled || GM.buckled_mobs.len) + user << "[GM] is attached to something!" + return + for(var/obj/structure/transit_tube_pod/pod in loc) + pod.visible_message("[user] starts putting [GM] into the [pod]!") + if(do_after(user, 15, target = src)) + if(GM && user.grab_state >= GRAB_AGGRESSIVE && user.pulling == GM && !GM.buckled && !GM.buckled_mobs.len) + GM.Weaken(5) + src.Bumped(GM) + break + else + for(var/obj/structure/transit_tube_pod/pod in loc) + if(!pod.moving && pod.dir in directions()) + if(icon_state == "closed") + open_animation() - else if(icon_state == "open") - if(pod.contents.len && user.loc != pod) - user.visible_message("[user] starts emptying [pod]'s contents onto the floor.", "You start emptying [pod]'s contents onto the floor...") - if(do_after(user, 10, target = src)) //So it doesn't default to close_animation() on fail - if(pod.loc == loc) - for(var/atom/movable/AM in pod) - AM.loc = get_turf(user) - if(ismob(AM)) - var/mob/M = AM - M.Weaken(5) + else if(icon_state == "open") + if(pod.contents.len && user.loc != pod) + user.visible_message("[user] starts emptying [pod]'s contents onto the floor.", "You start emptying [pod]'s contents onto the floor...") + if(do_after(user, 10, target = src)) //So it doesn't default to close_animation() on fail + if(pod.loc == loc) + for(var/atom/movable/AM in pod) + AM.loc = get_turf(user) + if(ismob(AM)) + var/mob/M = AM + M.Weaken(5) - else - close_animation() - break + else + close_animation() + break /obj/structure/transit_tube/station/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/weapon/grab)) - if(icon_state == "open") - var/obj/item/weapon/grab/G = W - if(ismob(G.affecting) && G.state >= GRAB_AGGRESSIVE) - var/mob/GM = G.affecting - for(var/obj/structure/transit_tube_pod/pod in loc) - pod.visible_message("[user] starts putting [GM] into the [pod]!") - if(do_after(user, 15, target = src) && GM && G && G.affecting == GM) - GM.Weaken(5) - src.Bumped(GM) - qdel(G) - break - else if(istype(W, /obj/item/weapon/crowbar)) + if(istype(W, /obj/item/weapon/crowbar)) for(var/obj/structure/transit_tube_pod/pod in loc) if(pod.contents) user << "Empty the pod first!" diff --git a/code/game/objects/structures/transit_tubes/transit_tube.dm b/code/game/objects/structures/transit_tubes/transit_tube.dm index bb7cc05d07c..5c42bb22445 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube.dm @@ -6,7 +6,7 @@ icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi' icon_state = "E-W" density = 1 - layer = 3.1 + layer = ABOVE_OBJ_LAYER anchored = 1 var/tube_construction = /obj/structure/c_transit_tube var/list/tube_dirs = null diff --git a/code/game/objects/structures/transit_tubes/transit_tube_construction.dm b/code/game/objects/structures/transit_tubes/transit_tube_construction.dm index ffcacef2f4b..8ce01aa0305 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_construction.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_construction.dm @@ -6,7 +6,7 @@ icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi' icon_state = "E-W" //icon_state decides which tube will be built density = 0 - layer = 3.1 //same as the built tube + layer = ABOVE_OBJ_LAYER //same as the built tube anchored = 0 /obj/structure/c_transit_tube/examine(mob/user) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index b555f251230..fea81bd9dcc 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -22,12 +22,37 @@ playsound(src.loc, "swing_hit", 25, 1) swirlie.visible_message("[user] slams the toilet seat onto [swirlie]'s head!", "[user] slams the toilet seat onto your head!", "You hear reverberating porcelain.") swirlie.adjustBruteLoss(5) - return - if(cistern && !open) + else if(user.pulling && user.a_intent == "grab" && isliving(user.pulling)) + user.changeNext_move(CLICK_CD_MELEE) + var/mob/living/GM = user.pulling + if(user.grab_state >= GRAB_AGGRESSIVE) + if(GM.loc != get_turf(src)) + user << "[GM] needs to be on [src]!" + return + if(!swirlie) + if(open) + GM.visible_message("[user] starts to give [GM] a swirlie!", "[user] starts to give you a swirlie...") + swirlie = GM + if(do_after(user, 30, 0, target = src)) + GM.visible_message("[user] gives [GM] a swirlie!", "[user] gives you a swirlie!", "You hear a toilet flushing.") + if(iscarbon(GM)) + var/mob/living/carbon/C = GM + if(!C.internal) + C.adjustOxyLoss(5) + else + GM.adjustOxyLoss(5) + swirlie = null + else + playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) + GM.visible_message("[user] slams [GM.name] into [src]!", "[user] slams you into [src]!") + GM.adjustBruteLoss(5) + else + user << "You need a tighter grip!" + + else if(cistern && !open) if(!contents.len) user << "The cistern is empty." - return else var/obj/item/I = pick(contents) if(ishuman(user)) @@ -36,10 +61,9 @@ I.loc = get_turf(src) user << "You find [I] in the cistern." w_items -= I.w_class - return - - open = !open - update_icon() + else + open = !open + update_icon() /obj/structure/toilet/update_icon() @@ -54,7 +78,6 @@ user.visible_message("[user] [cistern ? "replaces the lid on the cistern" : "lifts the lid off the cistern"]!", "You [cistern ? "replace the lid on the cistern" : "lift the lid off the cistern"]!", "You hear grinding porcelain.") cistern = !cistern update_icon() - return else if(cistern) if(user.a_intent != "harm") @@ -70,7 +93,6 @@ I.loc = src w_items += I.w_class user << "You carefully place [I] into the cistern." - return else if(istype(I, /obj/item/weapon/reagent_containers)) if (!open) @@ -78,39 +100,6 @@ var/obj/item/weapon/reagent_containers/RG = I RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this)) user << "You fill [RG] from [src]. Gross." - return - - else if(istype(I, /obj/item/weapon/grab)) - user.changeNext_move(CLICK_CD_MELEE) - var/obj/item/weapon/grab/G = I - if(!G.confirm()) - return - if(isliving(G.affecting)) - var/mob/living/GM = G.affecting - if(G.state >= GRAB_AGGRESSIVE) - if(GM.loc != get_turf(src)) - user << "[GM] needs to be on [src]!" - return - if(!swirlie) - if(open) - GM.visible_message("[user] starts to give [GM] a swirlie!", "[user] starts to give you a swirlie...") - swirlie = GM - if(do_after(user, 30, 0, target = src)) - GM.visible_message("[user] gives [GM] a swirlie!", "[user] gives you a swirlie!", "You hear a toilet flushing.") - if(iscarbon(GM)) - var/mob/living/carbon/C = GM - if(!C.internal) - C.adjustOxyLoss(5) - else - GM.adjustOxyLoss(5) - swirlie = null - else - playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) - GM.visible_message("[user] slams [GM.name] into [src]!", "[user] slams you into [src]!") - GM.adjustBruteLoss(5) - else - user << "You need a tighter grip!" - else return ..() @@ -125,24 +114,20 @@ anchored = 1 -/obj/structure/urinal/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = I - if(!G.confirm()) - return - if(isliving(G.affecting)) - var/mob/living/GM = G.affecting - if(G.state >= GRAB_AGGRESSIVE) - if(GM.loc != get_turf(src)) - user << "[GM.name] needs to be on [src]." - return - user.changeNext_move(CLICK_CD_MELEE) - user.visible_message("[user] slams [GM] into [src]!", "You slam [GM] into [src]!") - GM.adjustBruteLoss(8) - else - user << "You need a tighter grip!" +/obj/structure/urinal/attack_hand(mob/user) + if(user.pulling && user.a_intent == "grab" && isliving(user.pulling)) + var/mob/living/GM = user.pulling + if(user.grab_state >= GRAB_AGGRESSIVE) + if(GM.loc != get_turf(src)) + user << "[GM.name] needs to be on [src]." + return + user.changeNext_move(CLICK_CD_MELEE) + user.visible_message("[user] slams [GM] into [src]!", "You slam [GM] into [src]!") + GM.adjustBruteLoss(8) + else + user << "You need a tighter grip!" else - return ..() + ..() /obj/machinery/shower name = "shower" @@ -162,7 +147,7 @@ name = "mist" icon = 'icons/obj/watercloset.dmi' icon_state = "mist" - layer = MOB_LAYER + 1 + layer = FLY_LAYER anchored = 1 mouse_opacity = 0 diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 5b37185a6b2..15f57b2c55e 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -3,7 +3,7 @@ desc = "A window." icon_state = "window" density = 1 - layer = 3.2//Just above doors + layer = ABOVE_OBJ_LAYER //Just above doors pressure_resistance = 4*ONE_ATMOSPHERE anchored = 1 //initially is 0 for tile smoothing flags = ON_BORDER diff --git a/code/game/turfs/closed.dm b/code/game/turfs/closed.dm index 8384ac130e1..69058118212 100644 --- a/code/game/turfs/closed.dm +++ b/code/game/turfs/closed.dm @@ -1,6 +1,6 @@ /turf/closed var/thermite = 0 - + layer = CLOSED_TURF_LAYER opacity = 1 density = 1 blocks_air = 1 @@ -9,7 +9,6 @@ name = "wall" icon = 'icons/turf/walls.dmi' explosion_block = 50 - layer = TURF_LAYER + 0.05 /turf/closed/indestructible/splashscreen name = "Space Station 13" diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 98c55e9c555..bec463937c6 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -5,7 +5,6 @@ icon_state = "wall" var/mineral = "metal" explosion_block = 1 - layer = TURF_LAYER + 0.05 thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT heat_capacity = 312500 //a little over 5 cm thick , 312500 for 1 m by 2.5 m by 0.25 m plasteel wall @@ -223,7 +222,7 @@ O.anchored = 1 O.opacity = 1 O.density = 1 - O.layer = 5 + O.layer = FLY_LAYER playsound(src, 'sound/items/Welder.ogg', 100, 1) diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm index 893df8ead12..8f43cb52da0 100644 --- a/code/modules/atmospherics/environmental/LINDA_fire.dm +++ b/code/modules/atmospherics/environmental/LINDA_fire.dm @@ -49,7 +49,7 @@ unacidable = 1//So you can't melt fire with acid. icon = 'icons/effects/fire.dmi' icon_state = "1" - layer = TURF_LAYER + layer = ABOVE_OPEN_TURF_LAYER luminosity = 3 var/volume = 125 diff --git a/code/modules/atmospherics/gasmixtures/gas_types.dm b/code/modules/atmospherics/gasmixtures/gas_types.dm index 5188750f085..244f8b1cd71 100644 --- a/code/modules/atmospherics/gasmixtures/gas_types.dm +++ b/code/modules/atmospherics/gasmixtures/gas_types.dm @@ -76,7 +76,7 @@ var/list/hardcoded_gases = list("o2","n2","co2","plasma") //the main four gases, /obj/effect/overlay/gas/ icon = 'icons/effects/tile_effects.dmi' mouse_opacity = 0 - layer = 5 + layer = FLY_LAYER appearance_flags = RESET_COLOR|TILE_BOUND /obj/effect/overlay/gas/New(state) diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index 7997c832e00..891c4bb1e5d 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -15,6 +15,7 @@ Pipelines + Other Objects -> Pipe network active_power_usage = 0 power_channel = ENVIRON on_blueprints = TRUE + layer = GAS_PIPE_LAYER //under wires var/nodealert = 0 var/can_unwrench = 0 var/initialize_directions = 0 diff --git a/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm b/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm index f2dfa858d17..807980318e1 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/unary_devices.dm @@ -2,7 +2,6 @@ icon = 'icons/obj/atmospherics/components/unary_devices.dmi' dir = SOUTH initialize_directions = SOUTH - layer = TURF_LAYER+0.1 device_type = UNARY /obj/machinery/atmospherics/components/unary/SetInitDirections() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index 55ac2266861..06a369e647e 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -259,7 +259,7 @@ user.visible_message("[user] unwelds the vent.", "You unweld the vent.", "You hear welding.") welded = 0 update_icon() - pipe_vision_img = image(src, loc, layer = 20, dir = dir) + pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir) return 0 else return ..() @@ -289,7 +289,7 @@ user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the vent", "You hear loud scraping noises.") welded = 0 update_icon() - pipe_vision_img = image(src, loc, layer = 20, dir = dir) + pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir) playsound(loc, 'sound/weapons/bladeslice.ogg', 100, 1) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index b9c727da0a6..5c60897d1dc 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -308,7 +308,7 @@ user.visible_message("[user] unwelds the scrubber.", "You unweld the scrubber.", "You hear welding.") welded = 0 update_icon() - pipe_vision_img = image(src, loc, layer = 20, dir = dir) + pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir) return 0 else return ..() @@ -329,7 +329,7 @@ user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the scrubber.", "You hear loud scraping noises.") welded = 0 update_icon() - pipe_vision_img = image(src, loc, layer = 20, dir = dir) + pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir) playsound(loc, 'sound/weapons/bladeslice.ogg', 100, 1) diff --git a/code/modules/atmospherics/machinery/pipes/pipes.dm b/code/modules/atmospherics/machinery/pipes/pipes.dm index 94898fcd009..fc412840ebe 100644 --- a/code/modules/atmospherics/machinery/pipes/pipes.dm +++ b/code/modules/atmospherics/machinery/pipes/pipes.dm @@ -3,7 +3,6 @@ var/volume = 0 level = 1 - layer = 2.4 //under wires with their 2.44 use_power = 0 can_unwrench = 1 diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index 4a744ef7100..460e53bfd1d 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -120,14 +120,10 @@ desc = "What is that thing?" density = 1 anchored = 1 - layer = 3 icon = 'icons/mob/blob.dmi' icon_state = "blobpod" var/triggered = 0 -/obj/effect/meatgrinder/New() - icon_state = "blobpod" - /obj/effect/meatgrinder/Crossed(AM as mob|obj) Bumped(AM) diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm index 2d863a0079e..075ef8b3df6 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -64,9 +64,10 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away /proc/seedRuins(z_level = 1, budget = 0, whitelist = /area/space, list/potentialRuins = space_ruins_templates) var/overall_sanity = 100 - var/ruins = potentialRuins.Copy() + world << "Loading ruins..." + while(budget > 0 && overall_sanity > 0) // Pick a ruin var/datum/map_template/ruin/ruin = ruins[pick(ruins)] @@ -77,6 +78,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away // If so, try to place it var/sanity = 100 // And if we can't fit it anywhere, give up, try again + while(sanity > 0) sanity-- var/turf/T = locate(rand(25, world.maxx - 25), rand(25, world.maxy - 25), z_level) @@ -103,6 +105,7 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away if(!overall_sanity) world.log << "Ruin loader gave up with [budget] left to spend." + /obj/effect/ruin_loader name = "random ruin" icon = 'icons/obj/weapons.dmi' @@ -115,17 +118,15 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away var/datum/map_template/T = potentialRuins[A] if(!T.loaded) possible_ruins += T - world << "Loading ruins..." if(!template && possible_ruins.len) template = safepick(possible_ruins) if(!template) - world << "No ruins found." - return + return FALSE for(var/i in template.get_affected_turfs(get_turf(src), 1)) var/turf/T = i for(var/mob/living/simple_animal/monster in T) qdel(monster) template.load(get_turf(src),centered = TRUE) template.loaded++ - world << "Ruins loaded." qdel(src) + return TRUE diff --git a/code/modules/events/anomaly_bluespace.dm b/code/modules/events/anomaly_bluespace.dm index bfb574706cc..19b3ac4abfa 100644 --- a/code/modules/events/anomaly_bluespace.dm +++ b/code/modules/events/anomaly_bluespace.dm @@ -65,7 +65,7 @@ blueeffect.screen_loc = "WEST,SOUTH to EAST,NORTH" blueeffect.icon = 'icons/effects/effects.dmi' blueeffect.icon_state = "shieldsparkles" - blueeffect.layer = 17 + blueeffect.layer = FLASH_LAYER blueeffect.mouse_opacity = 0 M.client.screen += blueeffect sleep(20) diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 793f267c948..23e4ee960d3 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -327,8 +327,7 @@ /datum/spacevine_mutation/flowering/on_grow(obj/effect/spacevine/holder) if(holder.energy == 2 && prob(severity) && !locate(/obj/structure/alien/resin/flower_bud_enemy) in range(5,holder)) - var/obj/structure/alien/resin/flower_bud_enemy/FBE = new /obj/structure/alien/resin/flower_bud_enemy (get_turf(holder)) - FBE.layer = holder.layer+0.1 + new/obj/structure/alien/resin/flower_bud_enemy(get_turf(holder)) /datum/spacevine_mutation/flowering/on_cross(obj/effect/spacevine/holder, mob/living/crosser) @@ -344,7 +343,7 @@ icon_state = "Light1" anchored = 1 density = 0 - layer = MOB_LAYER + 0.8 + layer = SPACEVINE_LAYER mouse_opacity = 2 //Clicking anywhere on the turf is good enough pass_flags = PASSTABLE | PASSGRILLE var/energy = 0 @@ -532,7 +531,6 @@ src.icon_state = pick("Med1", "Med2", "Med3") energy = 1 SetOpacity(1) - layer = 5 else src.icon_state = pick("Hvy1", "Hvy2", "Hvy3") energy = 2 diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 9eca1592029..46998855692 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -227,7 +227,7 @@ Gunshots/explosions/opening doors/less rare audio (done) /obj/effect/hallucination/simple/singularity image_icon = 'icons/effects/224x224.dmi' image_state = "singularity_s7" - image_layer = 6 + image_layer = MASSIVE_OBJ_LAYER px = -96 py = -96 @@ -635,7 +635,7 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite if(!H.r_store) slots_free += ui_storage2 if(slots_free.len) halitem.screen_loc = pick(slots_free) - halitem.layer = 50 + halitem.layer = ABOVE_HUD_LAYER switch(rand(1,6)) if(1) //revolver halitem.icon = 'icons/obj/guns/projectile.dmi' diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index 577954beaa7..60ce3eda30f 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -95,16 +95,13 @@ if(operating) user << "It's locked and running." return - else - src.startgibbing(user) -/obj/machinery/gibber/attackby(obj/item/P, mob/user, params) - if(istype(P, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = P - if(!iscarbon(G.affecting)) + if(user.pulling && user.a_intent == "grab" && isliving(user.pulling)) + var/mob/living/L = user.pulling + if(!iscarbon(L)) user << "This item is not suitable for the gibber!" return - var/mob/living/carbon/C = G.affecting + var/mob/living/carbon/C = L if(C.buckled ||C.buckled_mobs.len) user << "[C] is attached to something!" return @@ -112,17 +109,19 @@ user << "Subject may not have abiotic items on." return - user.visible_message("[user] starts to put [G.affecting] into the gibber!") + user.visible_message("[user] starts to put [C] into the gibber!") src.add_fingerprint(user) - if(do_after(user, gibtime, target = src) && G && G.affecting && G.affecting == C && !C.buckled && !C.buckled_mobs.len && !occupant) - user.visible_message("[user] stuffs [G.affecting] into the gibber!") - C.reset_perspective(src) - C.loc = src - occupant = C - qdel(G) - update_icon() + if(do_after(user, gibtime, target = src)) + if(C && user.pulling == C && !C.buckled && !C.buckled_mobs.len && !occupant) + user.visible_message("[user] stuffs [C] into the gibber!") + C.forceMove(src) + occupant = C + update_icon() + else + startgibbing(user) - else if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", P)) +/obj/machinery/gibber/attackby(obj/item/P, mob/user, params) + if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", P)) return else if(exchange_parts(user, P)) diff --git a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm index e88e4e784cb..48dfb294839 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm @@ -13,6 +13,7 @@ density = 1 anchored = 0 use_power = 0 + layer = BELOW_OBJ_LAYER var/list/product_types = list() var/dispense_flavour = ICECREAM_VANILLA var/flavour_name = "vanilla" @@ -180,7 +181,6 @@ desc = "Delicious waffle cone, but no ice cream." icon = 'icons/obj/kitchen.dmi' icon_state = "icecream_cone_waffle" //default for admin-spawned cones, href_list["cone"] should overwrite this all the time - layer = 3.1 var/ice_creamed = 0 var/cone_type bitesize = 3 diff --git a/code/modules/food_and_drinks/kitchen_machinery/juicer.dm b/code/modules/food_and_drinks/kitchen_machinery/juicer.dm index 82f3ba80eb5..19c3112b320 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/juicer.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/juicer.dm @@ -3,7 +3,7 @@ name = "juicer" icon = 'icons/obj/kitchen.dmi' icon_state = "juicer1" - layer = 2.9 + layer = BELOW_OBJ_LAYER density = 1 anchored = 0 use_power = 1 diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm index ce2c6c94cec..5ab3d08e7d5 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm @@ -3,7 +3,7 @@ desc = "Cooks and boils stuff." icon = 'icons/obj/kitchen.dmi' icon_state = "mw" - layer = 2.9 + layer = BELOW_OBJ_LAYER density = 1 anchored = 1 use_power = 1 diff --git a/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm b/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm index a446c16d444..6b2c96d505d 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm @@ -3,7 +3,7 @@ desc = "A machine used for recycling dead monkeys into monkey cubes. It currently produces 1 cube for every 5 monkeys inserted." // except it literally never does icon = 'icons/obj/kitchen.dmi' icon_state = "grinder" - layer = 2.9 + layer = BELOW_OBJ_LAYER density = 1 anchored = 1 use_power = 1 @@ -57,18 +57,6 @@ if(stat) //NOPOWER etc return - if(istype(O, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = O - if(!user.Adjacent(G.affecting)) - return - var/grabbed = G.affecting - if(ismonkey(grabbed)) - var/mob/living/carbon/monkey/target = grabbed - stuff_monkey_in(target, user) - user.drop_item() - return - else - user << "The machine only accepts monkeys!" else return ..() diff --git a/code/modules/food_and_drinks/kitchen_machinery/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm index f0c41e5f082..96d32d3902b 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/processor.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm @@ -4,7 +4,7 @@ desc = "An industrial grinder used to process meat and other foods. Keep hands clear of intake area while operating." icon = 'icons/obj/kitchen.dmi' icon_state = "processor" - layer = 2.9 + layer = BELOW_OBJ_LAYER density = 1 anchored = 1 var/broken = 0 @@ -182,22 +182,12 @@ if(default_deconstruction_crowbar(O)) return - var/atom/movable/what = O - if(istype(O, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = O - if(!user.Adjacent(G.affecting)) - return - if(G.affecting.buckled || G.affecting.buckled_mobs.len) - user << "[G.affecting] is attached to somthing!" - return - what = G.affecting - - var/datum/food_processor_process/P = select_recipe(what) + var/datum/food_processor_process/P = select_recipe(O) if(P) - user.visible_message("[user] put [what] into [src].", \ - "You put the [what] into [src].") + user.visible_message("[user] put [O] into [src].", \ + "You put the [O] into [src].") user.drop_item() - what.loc = src + O.loc = src return 1 else if(user.a_intent != "harm") diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index ca330eeddef..afa3d9cead9 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -6,7 +6,7 @@ desc = "Keeps cold things cold and hot things cold." icon = 'icons/obj/vending.dmi' icon_state = "smartfridge" - layer = 2.9 + layer = BELOW_OBJ_LAYER density = 1 anchored = 1 use_power = 1 diff --git a/code/modules/holiday/easter.dm b/code/modules/holiday/easter.dm index d233ea1362c..baf31192aa7 100644 --- a/code/modules/holiday/easter.dm +++ b/code/modules/holiday/easter.dm @@ -81,7 +81,7 @@ countEggs() /obj/item/weapon/storage/bag/easterbasket/handle_item_insertion(obj/item/I, prevent_warning = 0) - ..() + . = ..() countEggs() //Bunny Suit diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm index dc710200724..18e378d9e5a 100644 --- a/code/modules/holodeck/items.dm +++ b/code/modules/holodeck/items.dm @@ -82,7 +82,7 @@ M.apply_damage(10, STAMINA) if(prob(5)) M.Weaken(3) - visible_message("[M] is knocked right off \his feet!", 3) + visible_message("[M] is knocked right off \his feet!") // // Structures @@ -97,20 +97,22 @@ density = 1 /obj/structure/holohoop/attackby(obj/item/weapon/W as obj, mob/user as mob, params) - if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) - var/obj/item/weapon/grab/G = W - if(G.state < GRAB_AGGRESSIVE) + if(get_dist(src,user)<2) + if(user.drop_item(src)) + visible_message(" [user] dunks [W] into \the [src]!") + +/obj/structure/holohoop/attack_hand(mob/user) + if(user.pulling && user.a_intent == "grab" && isliving(user.pulling)) + var/mob/living/L = user.pulling + if(user.grab_state < GRAB_AGGRESSIVE) user << "You need a better grip to do that!" return - G.affecting.loc = src.loc - G.affecting.Weaken(5) - visible_message("[G.assailant] dunks [G.affecting] into \the [src]!", 3) - qdel(W) - return - else if (istype(W, /obj/item) && get_dist(src,user)<2) - user.drop_item(src) - visible_message(" [user] dunks [W] into \the [src]!", 3) - return + L.loc = src.loc + L.Weaken(5) + visible_message("[user] dunks [L] into \the [src]!") + user.stop_pulling() + else + ..() /obj/structure/holohoop/CanPass(atom/movable/mover, turf/target, height=0) if (istype(mover,/obj/item) && mover.throwing) @@ -119,12 +121,12 @@ return if(prob(50)) I.loc = src.loc - visible_message(" Swish! \the [I] lands in \the [src].", 3) + visible_message(" Swish! \the [I] lands in \the [src].") else - visible_message(" \the [I] bounces off of \the [src]'s rim!", 3) + visible_message(" \the [I] bounces off of \the [src]'s rim!") return 0 else - return ..(mover, target, height) + return ..() diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 9ddebbef5ba..2393b7601d1 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -278,7 +278,7 @@ else var/t_growthstate = min(round((age / myseed.maturation) * myseed.growthstages), myseed.growthstages) I = image('icons/obj/hydroponics/growing.dmi', icon_state = "[myseed.icon_grow][t_growthstate]") - I.layer = MOB_LAYER + 0.1 + I.layer = OBJ_LAYER + 0.01 overlays += I /obj/machinery/hydroponics/proc/update_icon_lights() diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index bdad0908afe..003bb9ceb26 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -512,22 +512,33 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums /obj/machinery/bookbinder/attackby(obj/O, mob/user, params) if(istype(O, /obj/item/weapon/paper)) - if(busy) - user << "The book binder is busy. Please wait for completion of previous operation." - return - if(!user.drop_item()) - return - O.loc = src - user.visible_message("[user] loads some paper into [src].", "You load some paper into [src].") - src.visible_message("[src] begins to hum as it warms up its printing drums.") - busy = 1 - sleep(rand(200,400)) - busy = 0 - src.visible_message("[src] whirs as it prints and binds a new book.") - var/obj/item/weapon/book/b = new(src.loc) - b.dat = O:info - b.name = "Print Job #" + "[rand(100, 999)]" - b.icon_state = "book[rand(1,7)]" - qdel(O) + bind_book(user, O) + else if(default_unfasten_wrench(user, O)) + return 1 else return ..() + +/obj/machinery/bookbinder/proc/bind_book(mob/user, obj/item/weapon/paper/P) + if(stat) + return + if(busy) + user << "The book binder is busy. Please wait for completion of previous operation." + return + if(!user.drop_item()) + return + P.loc = src + user.visible_message("[user] loads some paper into [src].", "You load some paper into [src].") + audible_message("[src] begins to hum as it warms up its printing drums.") + busy = 1 + sleep(rand(200,400)) + busy = 0 + if(P) + if(!stat) + visible_message("[src] whirs as it prints and binds a new book.") + var/obj/item/weapon/book/B = new(src.loc) + B.dat = P.info + B.name = "Print Job #" + "[rand(100, 999)]" + B.icon_state = "book[rand(1,7)]" + qdel(P) + else + P.loc = loc \ No newline at end of file diff --git a/code/modules/lighting/lighting_system.dm b/code/modules/lighting/lighting_system.dm index 4cd39bcbf8d..5f9d1048e2e 100644 --- a/code/modules/lighting/lighting_system.dm +++ b/code/modules/lighting/lighting_system.dm @@ -27,7 +27,7 @@ */ #define LIGHTING_CIRCULAR 1 //Comment this out to use old square lighting effects. -#define LIGHTING_LAYER 15 //Drawing layer for lighting +//#define LIGHTING_LAYER 15 //Drawing layer for lighting, moved to layers.dm #define LIGHTING_CAP 10 //The lumcount level at which alpha is 0 and we're fully lit. #define LIGHTING_CAP_FRAC (255/LIGHTING_CAP) //A precal'd variable we'll use in turf/redraw_lighting() #define LIGHTING_ICON 'icons/effects/alphacolors.dmi' @@ -365,7 +365,6 @@ T.init_lighting() T.update_lumcount(0) -#undef LIGHTING_LAYER #undef LIGHTING_CIRCULAR #undef LIGHTING_ICON #undef LIGHTING_ICON_STATE diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm index ccb2863f4a6..475413ffdd9 100644 --- a/code/modules/mining/equipment_locker.dm +++ b/code/modules/mining/equipment_locker.dm @@ -649,7 +649,7 @@ desc = "A resonating field that significantly damages anything inside of it when the field eventually ruptures." icon = 'icons/effects/effects.dmi' icon_state = "shield1" - layer = 4.1 + layer = ABOVE_ALL_MOB_LAYER mouse_opacity = 0 var/resonance_damage = 20 @@ -1035,7 +1035,7 @@ var/client/C = user.client for(var/turf/closed/mineral/M in minerals) var/turf/F = get_turf(M) - var/image/I = image('icons/turf/smoothrocks.dmi', loc = F, icon_state = M.scan_state, layer = 18) + var/image/I = image('icons/turf/smoothrocks.dmi', loc = F, icon_state = M.scan_state, layer = FLASH_LAYER) C.images += I spawn(30) if(C) @@ -1053,7 +1053,7 @@ C.icon_state = M.scan_state /obj/effect/overlay/temp/mining_overlay - layer = 20 + layer = FLASH_LAYER icon = 'icons/turf/smoothrocks.dmi' anchored = 1 mouse_opacity = 0 diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 198f92cdb58..97a8d178266 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -124,7 +124,7 @@ icon_state = "orb" var/obj/item/device/wisp_lantern/home luminosity = 7 - layer = FLY_LAYER - 0.3 + layer = ABOVE_ALL_MOB_LAYER /obj/item/device/warp_cube name = "blue cube" diff --git a/code/modules/mining/lavaland/ruins/gym.dm b/code/modules/mining/lavaland/ruins/gym.dm index 6a538ae54b7..e945319d161 100644 --- a/code/modules/mining/lavaland/ruins/gym.dm +++ b/code/modules/mining/lavaland/ruins/gym.dm @@ -4,7 +4,7 @@ icon = 'goon/icons/obj/fitness.dmi' icon_state = "punchingbag" anchored = 1 - layer = MOB_LAYER+1 // TODO LAYER + layer = WALL_OBJ_LAYER var/list/hit_sounds = list('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg',\ 'sound/weapons/punch1.ogg', 'sound/weapons/punch2.ogg', 'sound/weapons/punch3.ogg', 'sound/weapons/punch4.ogg') @@ -69,7 +69,7 @@ user.Stun(4) user.loc = src.loc var/image/W = image('goon/icons/obj/fitness.dmi',"fitnessweight-w") - W.layer = MOB_LAYER+1 + W.layer = WALL_OBJ_LAYER overlays += W var/bragmessage = pick("pushing it to the limit","going into overdrive","burning with determination","rising up to the challenge", "getting strong now","getting ripped") user.visible_message("[user] is [bragmessage]!") diff --git a/code/modules/mining/lavaland/weather.dm b/code/modules/mining/lavaland/weather.dm index fed8c95c19f..6415b41e024 100644 --- a/code/modules/mining/lavaland/weather.dm +++ b/code/modules/mining/lavaland/weather.dm @@ -22,7 +22,7 @@ var/start_up_overlay = "lava" var/duration_overlay = "lava" - var/overlay_layer = 10 //This is the default area layer, and above everything else. 2 is floors/below walls and mobs. + var/overlay_layer = AREA_LAYER //This is the default area layer, and above everything else. TURF_LAYER is floors/below walls and mobs. var/purely_aesthetic = FALSE //If we just want gentle rain that doesn't hurt people var/list/impacted_areas = list() var/immunity_type = "storm" @@ -95,6 +95,6 @@ if(END_STAGE) N.icon_state = initial(N.icon_state) N.icon = 'icons/turf/areas.dmi' - N.layer = 10 //Just default back to normal area stuff since I assume setting a var is faster than initial + N.layer = AREA_LAYER //Just default back to normal area stuff since I assume setting a var is faster than initial N.invisibility = INVISIBILITY_MAXIMUM N.opacity = 0 \ No newline at end of file diff --git a/code/modules/mining/lavaland/weather_types.dm b/code/modules/mining/lavaland/weather_types.dm index 1f75b7daa07..dc3f35f6d9c 100644 --- a/code/modules/mining/lavaland/weather_types.dm +++ b/code/modules/mining/lavaland/weather_types.dm @@ -16,7 +16,7 @@ start_up_overlay = "lava" duration_overlay = "lava" - overlay_layer = 2 //Covers floors only + overlay_layer = ABOVE_OPEN_TURF_LAYER //Covers floors only immunity_type = "lava" @@ -50,7 +50,7 @@ start_up_overlay = "" duration_overlay = "" - overlay_layer = 10 + overlay_layer = AREA_LAYER /datum/weather/advanced_darkness/update_areas() for(var/area/A in impacted_areas) @@ -80,7 +80,7 @@ start_up_overlay = "light_ash" duration_overlay = "ash_storm" - overlay_layer = 10 + overlay_layer = AREA_LAYER immunity_type = "ash" diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index c55864ff347..85fa5cf0af0 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -36,7 +36,6 @@ /obj/structure/closet/secure_closet/miner/New() ..() - new /obj/item/stack/sheet/mineral/sandbags(src, 5) new /obj/item/weapon/storage/box/emptysandbags(src) new /obj/item/device/radio/headset/headset_cargo(src) new /obj/item/device/t_scanner/adv_mining_scanner/lesser(src) @@ -46,6 +45,7 @@ new /obj/item/weapon/gun/energy/kinetic_accelerator(src) new /obj/item/clothing/glasses/meson(src) new /obj/item/weapon/survivalcapsule(src) + new /obj/item/stack/sheet/mineral/sandbags(src, 5) /**********************Shuttle Computer**************************/ @@ -512,7 +512,7 @@ /obj/structure/fans/tiny name = "tiny fan" desc = "A tiny fan, releasing a thin gust of air." - layer = TURF_LAYER + 0.8 + layer = ABOVE_NORMAL_TURF_LAYER density = 0 icon_state = "fan_tiny" buildstackamount = 2 @@ -548,5 +548,5 @@ icon = 'icons/obj/lavaland/survival_pod.dmi' name = "tubes" anchored = 1 - layer = MOB_LAYER - 0.2 + layer = BELOW_MOB_LAYER density = 0 diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index f9f5ed6caf1..8fe9e12e507 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -12,7 +12,7 @@ opacity = 1 density = 1 blocks_air = 1 - layer = MOB_LAYER + 0.05 + layer = EDGED_TURF_LAYER temperature = TCMB var/environment_type = "asteroid" var/turf/open/floor/plating/turf_type = /turf/open/floor/plating/asteroid/airless @@ -179,7 +179,7 @@ /turf/closed/mineral/gibtonite/proc/explosive_reaction(mob/user = null, triggered_by_explosion = 0) if(stage == 0) - var/image/I = image('icons/turf/smoothrocks.dmi', loc = src, icon_state = "rock_Gibtonite_active", layer = 4.06) + var/image/I = image('icons/turf/smoothrocks.dmi', loc = src, icon_state = "rock_Gibtonite_active", layer = ON_EDGED_TURF_LAYER) overlays += I activated_image = I name = "gibtonite deposit" @@ -217,7 +217,7 @@ /turf/closed/mineral/gibtonite/proc/defuse() if(stage == 1) overlays -= activated_image - var/image/I = image('icons/turf/smoothrocks.dmi', loc = src, icon_state = "rock_Gibtonite_inactive", layer = 4.06) + var/image/I = image('icons/turf/smoothrocks.dmi', loc = src, icon_state = "rock_Gibtonite_inactive", layer = ON_EDGED_TURF_LAYER) overlays += I desc = "An inactive gibtonite reserve. The ore can be extracted." stage = 2 diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 3c1e42f0166..3d60378e0f4 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -7,7 +7,7 @@ var/list/image/ghost_images_simple = list() //this is a list of all ghost images desc = "It's a g-g-g-g-ghooooost!" //jinkies! icon = 'icons/mob/mob.dmi' icon_state = "ghost" - layer = MOB_LAYER + 1 + layer = GHOST_LAYER stat = DEAD density = 0 canmove = 0 diff --git a/code/modules/mob/interactive.dm b/code/modules/mob/interactive.dm index 6301af936fa..8c1c8ea5149 100644 --- a/code/modules/mob/interactive.dm +++ b/code/modules/mob/interactive.dm @@ -581,12 +581,11 @@ update_icons() update_hands = 0 - if(grabbed_by.len > 0) - for(var/obj/item/weapon/grab/G in grabbed_by) - if(Adjacent(G)) - a_intent = "disarm" - G.assailant.attack_hand(src) - inactivity_period = 10 + if(pulledby) + if(Adjacent(pulledby)) + a_intent = "disarm" + pulledby.attack_hand(src) + inactivity_period = 10 if(buckled) resist() diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 3a8e0dcaaa6..065717a47d0 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -29,10 +29,10 @@ if(!l_hand) W.loc = src //TODO: move to equipped? l_hand = W - W.layer = 20 //TODO: move to equipped? + W.layer = ABOVE_HUD_LAYER //TODO: move to equipped? W.equipped(src,slot_l_hand) - if(pulling == W) - stop_pulling() + if(W.pulledby) + W.pulledby.stop_pulling() update_inv_l_hand() W.pixel_x = initial(W.pixel_x) W.pixel_y = initial(W.pixel_y) @@ -47,10 +47,10 @@ if(!r_hand) W.loc = src r_hand = W - W.layer = 20 + W.layer = ABOVE_HUD_LAYER W.equipped(src,slot_r_hand) - if(pulling == W) - stop_pulling() + if(W.pulledby) + W.pulledby.stop_pulling() update_inv_r_hand() W.pixel_x = initial(W.pixel_x) W.pixel_y = initial(W.pixel_y) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 6dd329ceeb8..f2521cecaaf 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -83,10 +83,8 @@ playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) visible_message("[M] has attempted to disarm [src]!") -/mob/living/carbon/alien/humanoid/restrained() - if (handcuffed) - return 1 - return 0 +/mob/living/carbon/alien/humanoid/restrained(ignore_grab) + . = handcuffed /mob/living/carbon/alien/humanoid/show_inv(mob/user) @@ -127,6 +125,12 @@ playsound(src, 'sound/voice/hiss5.ogg', 40, 1, 1) //Alien roars when starting to break free ..(I, cuff_break = 1) +/mob/living/carbon/alien/humanoid/resist_grab(moving_resist) + if(pulledby.grab_state) + visible_message("[src] has broken free of [pulledby]'s grip!") + pulledby.stop_pulling() + . = 0 + /mob/living/carbon/alien/humanoid/get_standard_pixel_y_offset(lying = 0) if(leaping) return -32 @@ -172,4 +176,10 @@ proc/alien_type_present(var/alienpath) /mob/living/carbon/alien/humanoid/check_breath(datum/gas_mixture/breath) if(breath && breath.total_moles() > 0 && !sneaking) playsound(get_turf(src), pick('sound/voice/lowHiss2.ogg', 'sound/voice/lowHiss3.ogg', 'sound/voice/lowHiss4.ogg'), 50, 0, -5) - ..() \ No newline at end of file + ..() + +/mob/living/carbon/alien/humanoid/grabbedby(mob/living/carbon/user, supress_message = 0) + if(user == src && pulling && grab_state >= GRAB_AGGRESSIVE && !pulling.anchored && iscarbon(pulling)) + devour_mob(pulling, devour_time = 60) + else + ..() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index c93ad1ead74..49c8ea62f4a 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -7,7 +7,7 @@ pixel_x = -16 bubble_icon = "alienroyal" mob_size = MOB_SIZE_LARGE - layer = MOB_LAYER + 0.5 //above most mobs, but below speechbubbles + layer = LARGE_MOB_LAYER //above most mobs, but below speechbubbles pressure_resistance = 200 //Because big, stompy xenos should not be blown around like paper. butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab/xeno = 20, /obj/item/stack/sheet/animalhide/xeno = 3) diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index be000619379..46d5bab8fc3 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -70,8 +70,8 @@ return -/mob/living/carbon/alien/larva/restrained() - return 0 +/mob/living/carbon/alien/larva/restrained(ignore_grab) + . = 0 // new damage icon system // now constructs damage icon for each organ from mask * damage field diff --git a/code/modules/mob/living/carbon/alien/larva/powers.dm b/code/modules/mob/living/carbon/alien/larva/powers.dm index d575ba5f4f8..642031e8541 100644 --- a/code/modules/mob/living/carbon/alien/larva/powers.dm +++ b/code/modules/mob/living/carbon/alien/larva/powers.dm @@ -9,8 +9,8 @@ if(user.stat != CONSCIOUS) return - if (user.layer != TURF_LAYER+0.2) - user.layer = TURF_LAYER+0.2 + if (user.layer != ABOVE_NORMAL_TURF_LAYER) + user.layer = ABOVE_NORMAL_TURF_LAYER user.visible_message("[user] scurries to the ground!", \ "You are now hiding.") else diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 1cfbae231cc..aca51f6cb36 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -8,6 +8,7 @@ return 0 var/toxins_used = 0 + var/tox_detect_threshold = 0.02 var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME var/list/breath_gases = breath.gases @@ -16,7 +17,7 @@ //Partial pressure of the toxins in our breath var/Toxins_pp = (breath_gases["plasma"][MOLES]/breath.total_moles())*breath_pressure - if(Toxins_pp) // Detect toxins in air + if(Toxins_pp > tox_detect_threshold) // Detect toxins in air adjustPlasma(breath_gases["plasma"][MOLES]*250) throw_alert("alien_tox", /obj/screen/alert/alien_tox) diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index ca54cf71405..6b6ba71043a 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -4,7 +4,7 @@ icon_state = "brain" throw_speed = 3 throw_range = 5 - layer = 4.1 + layer = ABOVE_MOB_LAYER zone = "head" slot = "brain" vital = 1 diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 334125e45cd..75ae791a001 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -214,24 +214,20 @@ var/atom/movable/thrown_thing var/obj/item/I = src.get_active_hand() - if(!I || (I.flags & NODROP)) - return + if(!I) + if(pulling && isliving(pulling) && grab_state >= GRAB_AGGRESSIVE) + var/mob/living/throwable_mob = pulling + if(!throwable_mob.buckled) + thrown_thing = throwable_mob + stop_pulling() + var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors + var/turf/end_T = get_turf(target) + if(start_T && end_T) + var/start_T_descriptor = "tile at [start_T.x], [start_T.y], [start_T.z] in area [get_area(start_T)]" + var/end_T_descriptor = "tile at [end_T.x], [end_T.y], [end_T.z] in area [get_area(end_T)]" + add_logs(src, throwable_mob, "thrown", addition="from [start_T_descriptor] with the target [end_T_descriptor]") - if(istype(I, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = I - var/mob/throwable_mob = G.get_mob_if_throwable() //throw the person instead of the grab - qdel(G) //We delete the grab. - if(throwable_mob) - thrown_thing = throwable_mob - var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors - var/turf/end_T = get_turf(target) - if(start_T && end_T) - var/start_T_descriptor = "tile at [start_T.x], [start_T.y], [start_T.z] in area [get_area(start_T)]" - var/end_T_descriptor = "tile at [end_T.x], [end_T.y], [end_T.z] in area [get_area(end_T)]" - - add_logs(src, throwable_mob, "thrown", addition="from [start_T_descriptor] with the target [end_T_descriptor]") - - else if(!(I.flags & ABSTRACT)) //can't throw abstract items + else if(!(I.flags & (NODROP|ABSTRACT))) thrown_thing = I unEquip(I) @@ -240,10 +236,8 @@ newtonian_move(get_dir(target, src)) thrown_thing.throw_at(target, thrown_thing.throw_range, thrown_thing.throw_speed, src) -/mob/living/carbon/restrained() - if (handcuffed) - return 1 - return +/mob/living/carbon/restrained(ignore_grab) + . = (handcuffed || (!ignore_grab && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE)) /mob/living/carbon/proc/canBeHandcuffed() return 0 @@ -541,40 +535,43 @@ add_abilities_to_panel() -/mob/living/carbon/proc/vomit(var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0, var/message = 1) - if(src.is_muzzled()) - if(message) - src << "The muzzle prevents you from vomiting!" - return 0 - if(stun) - Stun(4) +/mob/living/carbon/proc/vomit(var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0, var/message = 1, var/toxic = 0) if(nutrition < 100 && !blood) if(message) visible_message("[src] dry heaves!", \ "You try to throw up, but there's nothing your stomach!") if(stun) Weaken(10) + return 1 + + if(is_mouth_covered()) //make this add a blood/vomit overlay later it'll be hilarious + if(message) + visible_message("[src] throws up all over themself!", \ + "You throw up all over yourself!") + distance = 0 else if(message) - visible_message("[src] throws up!", \ - "You throw up!") - playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1) - var/turf/T = get_turf(src) - for(var/i=0 to distance) - if(blood) - if(T) - T.add_blood_floor(src) - if(stun) - adjustBruteLoss(3) - else - if(T) - T.add_vomit_floor(src) - nutrition -= lost_nutrition - if(stun) - adjustToxLoss(-3) - T = get_step(T, dir) - if (is_blocked_turf(T)) - break + visible_message("[src] throws up!", "You throw up!") + + if(stun) + Stun(4) + + playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1) + var/turf/T = get_turf(src) + for(var/i=0 to distance) + if(blood) + if(T) + T.add_blood_floor(src) + if(stun) + adjustBruteLoss(3) + else + if(T) + T.add_vomit_floor(src, 0)//toxic barf looks different + nutrition -= lost_nutrition + adjustToxLoss(-3) + T = get_step(T, dir) + if (is_blocked_turf(T)) + break return 1 diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index bde5baef416..56d75b56517 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -94,3 +94,15 @@ adjustFireLoss(M.powerlevel * rand(6,10)) updatehealth() return 1 + +/mob/living/carbon/proc/devour_mob(mob/living/carbon/C, devour_time = 130) + C.visible_message("[src] is attempting to devour [C]!", \ + "[src] is attempting to devour you!") + if(!do_mob(src, C, devour_time)) + return + if(pulling && pulling == C && grab_state >= GRAB_AGGRESSIVE && a_intent == "grab") + C.visible_message("[src] devours [C]!", \ + "[src] devours you!") + C.forceMove(src) + stomach_contents.Add(C) + add_logs(src, C, "devoured") \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm index 2e77a20baa8..5fdfa802698 100644 --- a/code/modules/mob/living/carbon/carbon_movement.dm +++ b/code/modules/mob/living/carbon/carbon_movement.dm @@ -1,5 +1,6 @@ /mob/living/carbon/movement_delay() . = ..() + . += grab_state * 3 if(legcuffed) . += legcuffed.slowdown diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm index 21f8bdb6cb4..6842d856b03 100644 --- a/code/modules/mob/living/carbon/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -46,6 +46,9 @@ if(fire_stacks < 0) msg += "It's soaked in water.\n" + if(pulledby && pulledby.grab_state) + msg += "It's restrained by [pulledby]'s grip.\n" + if(stat == UNCONSCIOUS) msg += "It isn't responding to anything around it; it seems to be asleep.\n" msg += "" diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 71ec592a7a8..b2fa55a403d 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -236,6 +236,9 @@ msg += "[t_He] looks a little soaked.\n" + if(pulledby && pulledby.grab_state) + msg += "[t_He] [t_is] restrained by [pulledby]'s grip.\n" + if(nutrition < NUTRITION_LEVEL_STARVING - 50) msg += "[t_He] [t_is] severely malnourished.\n" else if(nutrition >= NUTRITION_LEVEL_FAT) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index b1718b26f9a..ee109955a12 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -919,7 +919,7 @@ for(var/mob/M in viewers(src)) if(M.client) viewing += M.client - flick_overlay(image(icon,src,"electrocuted_generic",MOB_LAYER+1), viewing, anim_duration) + flick_overlay(image(icon,src,"electrocuted_generic",ABOVE_MOB_LAYER), viewing, anim_duration) /mob/living/carbon/human/canUseTopic(atom/movable/M, be_close = 0) if(incapacitated() || lying ) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 7eab6c1d4f0..84381f3d17b 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -264,11 +264,6 @@ I.acid_act(acidpwr, acid_volume_left) acid_volume_left = max(acid_volume_left - acid_decay, 0) -/mob/living/carbon/human/grabbedby(mob/living/user) - if(w_uniform) - w_uniform.add_fingerprint(user) - ..() - /mob/living/carbon/human/attack_animal(mob/living/simple_animal/M) if(..()) @@ -369,3 +364,14 @@ skipcatch = 1 //can't catch the now embedded item return ..() + +/mob/living/carbon/human/grabbedby(mob/living/carbon/user, supress_message = 0) + if(user == src && pulling && !pulling.anchored && grab_state >= GRAB_AGGRESSIVE && (disabilities & FAT) && ismonkey(pulling)) + devour_mob(pulling) + else + ..() + +/mob/living/carbon/human/grippedby(mob/living/user) + if(w_uniform) + w_uniform.add_fingerprint(user) + ..() diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 0bc8696500f..feb477023af 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -1,10 +1,7 @@ -/mob/living/carbon/human/restrained() - if (handcuffed) - return 1 - if (wear_suit && wear_suit.breakouttime) - return 1 - return 0 +/mob/living/carbon/human/restrained(ignore_grab) + . = ((wear_suit && wear_suit.breakouttime) || ..()) + /mob/living/carbon/human/canBeHandcuffed() return 1 diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 3e0ad9b5b3c..870f2cf032c 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -89,6 +89,7 @@ if(I.flags_inv & HIDEJUMPSUIT) update_inv_w_uniform() if(wear_suit.breakouttime) //when equipping a straightjacket + stop_pulling() //can't pull if restrained update_action_buttons_icon() //certain action buttons will no longer be usable. update_inv_wear_suit() if(slot_w_uniform) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index ad5a44c60b1..3d1635fe0db 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -253,28 +253,17 @@ reagents.metabolize(src, can_overdose=1) dna.species.handle_chemicals_in_body(src) + /mob/living/carbon/human/handle_random_events() - // Puke if toxloss is too high + //Puke if toxloss is too high if(!stat) - if (getToxLoss() >= 45 && nutrition > 20) + if(getToxLoss() >= 45 && nutrition > 20) lastpuke ++ if(lastpuke >= 25) // about 25 second delay I guess - Stun(5) - - visible_message("[src] throws up!", \ - "[src] throws up!") - playsound(loc, 'sound/effects/splat.ogg', 50, 1) - - var/turf/location = loc - if (istype(location, /turf)) - location.add_vomit_floor(src, 1) - - nutrition -= 20 - adjustToxLoss(-3) - - // make it so you can only puke so fast + vomit(20, 0, 1, 0, 1, 1) lastpuke = 0 + /mob/living/carbon/human/has_smoke_protection() if(wear_mask) if(wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT) @@ -288,6 +277,8 @@ if(NOBREATH in dna.species.specflags) . = 1 return . + + /mob/living/carbon/human/proc/handle_embedded_objects() for(var/X in bodyparts) var/obj/item/bodypart/BP = X @@ -304,6 +295,7 @@ if(!has_embedded_objects()) clear_alert("embeddedobject") + /mob/living/carbon/human/proc/handle_heart() CHECK_DNA_AND_SPECIES(src) var/needs_heart = (!(NOBLOOD in dna.species.specflags)) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index ce9096b4c34..6276b1fec89 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1020,22 +1020,6 @@ H.visible_message("[M] has broken [H]'s grip on [H.pulling]!") talked = 1 H.stop_pulling() - - //BubbleWrap: Disarming also breaks a grab - this will also stop someone being choked, won't it? - if(istype(H.l_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/lgrab = H.l_hand - if(lgrab.affecting) - H.visible_message("[M] has broken [H]'s grip on [lgrab.affecting]!") - talked = 1 - spawn(1) - qdel(lgrab) - if(istype(H.r_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/rgrab = H.r_hand - if(rgrab.affecting) - H.visible_message("[M] has broken [H]'s grip on [rgrab.affecting]!") - talked = 1 - spawn(1) - qdel(rgrab) //End BubbleWrap if(!talked) //BubbleWrap diff --git a/code/modules/mob/living/carbon/human/species_types.dm b/code/modules/mob/living/carbon/human/species_types.dm index e0672de9cee..eb87e5eae71 100644 --- a/code/modules/mob/living/carbon/human/species_types.dm +++ b/code/modules/mob/living/carbon/human/species_types.dm @@ -397,9 +397,9 @@ /datum/species/fly/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H) if(istype(chem,/datum/reagent/consumable)) var/datum/reagent/consumable/nutri_check = chem - if(nutri_check.nutriment_factor >0) + if(nutri_check.nutriment_factor > 0) var/turf/pos = get_turf(H) - H.vomit() + H.vomit(0, 0, 0, 1, 1) playsound(pos, 'sound/effects/splat.ogg', 50, 1) H.visible_message("[H] vomits on the floor!", \ "You throw up on the floor!") diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm index 00efe469b81..6ad159851dd 100644 --- a/code/modules/mob/living/carbon/inventory.dm +++ b/code/modules/mob/living/carbon/inventory.dm @@ -29,10 +29,13 @@ else if(I == r_hand) r_hand = null + if(I.pulledby) + I.pulledby.stop_pulling() + I.screen_loc = null // will get moved if inventory is visible I.loc = src I.equipped(src, slot) - I.layer = 20 + I.layer = ABOVE_HUD_LAYER switch(slot) if(slot_back) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 067d3cc0d06..c055c89375a 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -17,14 +17,6 @@ for(var/obj/item/organ/O in internal_organs) O.on_life() - //grab processing - if(istype(l_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = l_hand - G.process() - if(istype(r_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = r_hand - G.process() - //Updates the number of stored chemicals for powers handle_changeling() @@ -54,7 +46,7 @@ var/datum/gas_mixture/breath - if(health <= config.health_threshold_crit) + if(health <= config.health_threshold_crit || (pulledby && pulledby.grab_state >= GRAB_KILL && !getorganslot("breathing_tube"))) losebreath++ //Suffocate diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index cdc9b8350c5..f3e208b6e95 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -13,7 +13,7 @@ ..() if(!client && stat == CONSCIOUS) - if(prob(33) && canmove && isturf(loc) && !pulledby && !grabbed_by.len) + if(prob(33) && canmove && isturf(loc) && !pulledby) step(src, pick(cardinal)) if(prob(1)) emote(pick("scratch","jump","roll","tail")) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 2e077506d22..0209d40b126 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -105,7 +105,7 @@ Sorry Giacom. Please don't be mad :( //Should stop you pushing a restrained person out of the way if(isliving(M)) var/mob/living/L = M - if((L.pulledby && L.restrained()) || L.grabbed_by.len) + if(L.pulledby && L.pulledby != src && L.restrained()) if(!(world.time % 5)) src << "[L] is restrained, you cannot push past." return 1 @@ -118,32 +118,42 @@ Sorry Giacom. Please don't be mad :( src << "[L] is restraining [P], you cannot push past." return 1 - //switch our position with M - //BubbleWrap: people in handcuffs are always switched around as if they were on 'help' intent to prevent a person being pulled from being seperated from their puller - if((M.a_intent == "help" || M.restrained()) && (a_intent == "help" || restrained()) && M.canmove && canmove && !M.buckled && !M.buckled_mobs.len) // mutual brohugs all around! - if(loc && !loc.Adjacent(M.loc)) - return 1 - now_pushing = 1 - var/oldloc = loc - var/oldMloc = M.loc - - - var/M_passmob = (M.pass_flags & PASSMOB) // we give PASSMOB to both mobs to avoid bumping other mobs during swap. - var/src_passmob = (pass_flags & PASSMOB) - M.pass_flags |= PASSMOB - pass_flags |= PASSMOB - - M.Move(oldloc) - Move(oldMloc) - - if(!src_passmob) - pass_flags &= ~PASSMOB - if(!M_passmob) - M.pass_flags &= ~PASSMOB - - now_pushing = 0 + if(moving_diagonally)//no mob swap during diagonal moves. return 1 + if(!M.buckled && !M.buckled_mobs.len) + var/mob_swap + //the puller can always swap with its victim if on grab intent + if(M.pulledby == src && a_intent == "grab") + mob_swap = 1 + //restrained people act if they were on 'help' intent to prevent a person being pulled from being seperated from their puller + else if((M.restrained() || M.a_intent == "help") && (restrained() || a_intent == "help")) + mob_swap = 1 + if(mob_swap) + //switch our position with M + if(loc && !loc.Adjacent(M.loc)) + return 1 + now_pushing = 1 + var/oldloc = loc + var/oldMloc = M.loc + + + var/M_passmob = (M.pass_flags & PASSMOB) // we give PASSMOB to both mobs to avoid bumping other mobs during swap. + var/src_passmob = (pass_flags & PASSMOB) + M.pass_flags |= PASSMOB + pass_flags |= PASSMOB + + M.Move(oldloc) + Move(oldMloc) + + if(!src_passmob) + pass_flags &= ~PASSMOB + if(!M_passmob) + M.pass_flags &= ~PASSMOB + + now_pushing = 0 + return 1 + //okay, so we didn't switch. but should we push? //not if he's not CANPUSH of course if(!(M.status_flags & CANPUSH)) @@ -162,6 +172,8 @@ Sorry Giacom. Please don't be mad :( /mob/living/proc/PushAM(atom/movable/AM) if(now_pushing) return 1 + if(moving_diagonally)// no pushing during diagonal moves. + return 1 if(!client && (mob_size < MOB_SIZE_SMALL)) return if(!AM.anchored) @@ -191,7 +203,7 @@ Sorry Giacom. Please don't be mad :( //same as above /mob/living/pointed(atom/A as mob|obj|turf in view()) - if(src.stat || !src.canmove || src.restrained()) + if(incapacitated()) return 0 if(src.status_flags & FAKEDEATH) return 0 @@ -546,67 +558,29 @@ Sorry Giacom. Please don't be mad :( else return 0 - if (restrained()) + var/atom/movable/pullee = pulling + if(pullee && get_dist(src, pullee) > 1) stop_pulling() - - - var/cuff_dragged = 0 - if (restrained()) - for(var/mob/living/M in range(1, src)) - if (M.pulling == src && !M.incapacitated()) - cuff_dragged = 1 - if (!cuff_dragged && pulling && !throwing && (get_dist(src, pulling) <= 1 || pulling.loc == loc)) - var/turf/T = loc - . = ..() - - if (pulling && pulling.loc) - if(!isturf(pulling.loc)) - stop_pulling() - return - else - if(Debug) - diary <<"pulling disappeared? at [__LINE__] in mob.dm - pulling = [pulling]" - diary <<"REPORT THIS" - - ///// - if(pulling && pulling.anchored) + var/turf/T = loc + . = ..() + if(. && pulling && pulling == pullee) //we were pulling a thing and didn't lose it during our move. + if(pulling.anchored) stop_pulling() return - if (!restrained()) - var/diag = get_dir(src, pulling) - if ((diag - 1) & diag) - else - diag = null - if ((get_dist(src, pulling) > 1 || diag)) - if (isliving(pulling)) - var/mob/living/M = pulling - var/pull_ok = 1 - if (M.grabbed_by.len) - if (prob(75)) - var/obj/item/weapon/grab/G = pick(M.grabbed_by) - visible_message("[src] has pulled [G.affecting] from [G.assailant]'s grip.") - qdel(G) - else - pull_ok = 0 - if (M.grabbed_by.len) - pull_ok = 0 - if (pull_ok) - var/atom/movable/t = M.pulling - M.stop_pulling() + var/pull_dir = get_dir(src, pulling) + if(get_dist(src, pulling) > 1 || ((pull_dir - 1) & pull_dir)) //puller and pullee more than one tile away or in diagonal position + if(isliving(pulling)) + var/mob/living/M = pulling + if(M.lying && !M.buckled && (prob(M.getBruteLoss() / 2))) + makeTrail(T, M) + pulling.Move(T, get_dir(pulling, T)) //the pullee tries to reach our previous position + if(pulling && get_dist(src, pulling) > 1) //the pullee couldn't keep up + stop_pulling() + + if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1)//separated from our puller and not in the middle of a diagonal move. + pulledby.stop_pulling() - //this is the gay blood on floor shit -- Added back -- Skie - if(M.lying && !M.buckled && (prob(M.getBruteLoss() / 2))) - makeTrail(T, M) - pulling.Move(T, get_dir(pulling, T)) - if(M) - M.start_pulling(t) - else - if (pulling) - pulling.Move(T, get_dir(pulling, T)) - else - stop_pulling() - . = ..() if (s_active && !(s_active in contents) && !(s_active.loc in contents)) // It's ugly. But everything related to inventory/storage is. -- c0 s_active.close(src) @@ -662,34 +636,15 @@ Sorry Giacom. Please don't be mad :( set name = "Resist" set category = "IC" - if(!isliving(src) || next_move > world.time || stat || weakened || stunned || paralysis) + if(!isliving(src) || next_move > world.time || incapacitated(ignore_restraints = 1)) return changeNext_move(CLICK_CD_RESIST) //resisting grabs (as if it helps anyone...) - if(!restrained()) - var/resisting = 0 - for(var/obj/O in requests) - qdel(O) - resisting++ - for(var/X in grabbed_by) - var/obj/item/weapon/grab/G = X - resisting++ - if(G.state == GRAB_PASSIVE) - qdel(G) - else - if(G.state == GRAB_AGGRESSIVE) - if(prob(25)) - visible_message("[src] has broken free of [G.assailant]'s grip!") - qdel(G) - else - if(G.state == GRAB_NECK) - if(prob(5)) - visible_message("[src] has broken free of [G.assailant]'s headlock!") - qdel(G) - if(resisting) - visible_message("[src] resists!") - return + if(!restrained(ignore_grab = 1) && pulledby) + visible_message("[src] resists against [pulledby]'s grip!") + resist_grab() + return //unbuckling yourself if(buckled && last_special <= world.time) @@ -707,6 +662,22 @@ Sorry Giacom. Please don't be mad :( resist_restraints() //trying to remove cuffs. +/mob/proc/resist_grab(moving_resist) + return 1 //returning 0 means we successfully broke free + +/mob/living/resist_grab(moving_resist) + . = 1 + if(pulledby.grab_state) + if(prob(30/pulledby.grab_state)) + visible_message("[src] has broken free of [pulledby]'s grip!") + pulledby.stop_pulling() + return 0 + if(moving_resist && client) //we resisted by trying to move + client.move_delay = world.time + 20 + else + pulledby.stop_pulling() + return 0 + /mob/living/proc/resist_buckle() buckled.user_unbuckle_mob(src,src) @@ -840,9 +811,9 @@ Sorry Giacom. Please don't be mad :( // What icon do we use for the attack? var/image/I if(hand && l_hand) // Attacked with item in left hand. - I = image(l_hand.icon, A, l_hand.icon_state, A.layer + 1) + I = image(l_hand.icon, A, l_hand.icon_state, A.layer + 0.1) else if(!hand && r_hand) // Attacked with item in right hand. - I = image(r_hand.icon, A, r_hand.icon_state, A.layer + 1) + I = image(r_hand.icon, A, r_hand.icon_state, A.layer + 0.1) else // Attacked with a fist? return @@ -1025,6 +996,10 @@ Sorry Giacom. Please don't be mad :( return 1 return 0 +/mob/living/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0) + stop_pulling() + . = ..() + // Called when we are hit by a bolt of polymorph and changed // Generally the mob we are currently in, is about to be deleted /mob/living/proc/wabbajack_act(mob/living/new_mob) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 2ae03291140..8cb1c7c4a49 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -208,28 +208,51 @@ /mob/living/acid_act(acidpwr, toxpwr, acid_volume) take_organ_damage(min(10*toxpwr, acid_volume * toxpwr)) -/mob/living/proc/grabbedby(mob/living/carbon/user,supress_message = 0) +/mob/living/proc/grabbedby(mob/living/carbon/user, supress_message = 0) if(user == src || anchored) return 0 + if(!user.pulling || user.pulling != src) + user.start_pulling(src, supress_message) + return + if(!(status_flags & CANPUSH)) + user << "[src] can't be grabbed more aggressively!" return 0 + grippedby(user) - add_logs(user, src, "grabbed", addition="passively") - - if(anchored || !Adjacent(user)) - return 0 - if(buckled) - user << "You cannot grab [src], \he is buckled in!" - return 0 - var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(user, src) - if(!user.put_in_active_hand(G)) //if we can't put the grab in our hand for some reason, we delete it. - qdel(G) - G.synch() - LAssailant = user - - playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - if(!supress_message) - visible_message("[user] has grabbed [src] passively!") +//proc to upgrade a simple pull into a more aggressive grab. +/mob/living/proc/grippedby(mob/living/carbon/user) + if(user.grab_state < GRAB_KILL) + user.changeNext_move(CLICK_CD_GRABBING) + playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + var/old_grab_state = user.grab_state + var/grab_upgrade_time = 40 + visible_message("[user] starts to tighten \his grip on [src]!", \ + "[user] starts to tighten \his grip on you!") + if(do_mob(user, src, grab_upgrade_time)) + if(user.pulling && user.pulling == src && user.grab_state == old_grab_state && user.a_intent == "grab") + user.grab_state++ + switch(user.grab_state) + if(GRAB_AGGRESSIVE) + add_logs(user, src, "grabbed", addition="aggressively") + visible_message("[user] has grabbed [src] aggressively!", \ + "[user] has grabbed [src] aggressively!") + drop_r_hand() + drop_l_hand() + stop_pulling() + if(GRAB_NECK) + visible_message("[user] has grabbed [src] by the neck!",\ + "[user] has grabbed you by the neck!") + update_canmove() //we fall down + if(!buckled && !density) + Move(user.loc) + if(GRAB_KILL) + visible_message("[user] is strangling [src]!", \ + "[user] is strangling you!") + update_canmove() //we fall down + if(!buckled && !density) + Move(user.loc) + return 1 /mob/living/attack_slime(mob/living/simple_animal/slime/M) @@ -329,8 +352,8 @@ M.do_attack_animation(src) return 1 -/mob/living/incapacitated() - if(stat || paralysis || stunned || weakened || restrained()) +/mob/living/incapacitated(ignore_restraints, ignore_grab) + if(stat || paralysis || stunned || weakened || (!ignore_restraints && restrained(ignore_grab))) return 1 //Looking for irradiate()? It's been moved to radiation.dm under the rad_act() for mobs. diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 8ac3547f12b..b95db4d75f0 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -157,7 +157,7 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) for(var/mob/M in listening) if(M.client) speech_bubble_recipients.Add(M.client) - var/image/I = image('icons/mob/talk.dmi', src, "[bubble_type][say_test(message)]", MOB_LAYER+1) + var/image/I = image('icons/mob/talk.dmi', src, "[bubble_type][say_test(message)]", FLY_LAYER) I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA spawn(0) flick_overlay(I, speech_bubble_recipients, 30) @@ -219,7 +219,7 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) if(1) if(prob(40)) M << "We can faintly sense an outsider trying to communicate through the hivemind..." - return 1 + return 1 if(2) var/msg = "[mind.changeling.changelingID]: [message]" log_say("[mind.changeling.changelingID]/[src.key] : [message]") @@ -229,7 +229,7 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) else switch(M.lingcheck()) if(3) - M << msg + M << msg if(2) M << msg if(1) @@ -289,7 +289,7 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) return NOPASS return 0 -/mob/living/lingcheck() //1 is ling w/ no hivemind. 2 is ling w/hivemind. 3 is ling victim being linked into hivemind. +/mob/living/lingcheck() //1 is ling w/ no hivemind. 2 is ling w/hivemind. 3 is ling victim being linked into hivemind. if(mind && mind.changeling) if(mind.changeling.changeling_speak) return 2 diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 58d25079b3e..30de1ef4dd9 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -357,8 +357,8 @@ var/list/ai_list = list() return 1 return 0 -/mob/living/silicon/ai/restrained() - return 0 +/mob/living/silicon/ai/restrained(ignore_grab) + . = 0 /mob/living/silicon/ai/emp_act(severity) if (prob(30)) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index ec801c34740..11849bdb578 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -95,8 +95,8 @@ /mob/living/silicon/pai/blob_act(obj/effect/blob/B) return 0 -/mob/living/silicon/pai/restrained() - return 0 +/mob/living/silicon/pai/restrained(ignore_grab) + . = 0 /mob/living/silicon/pai/emp_act(severity) // 20% chance to kill diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index 91413e2e1ad..4b4a65f12c0 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -48,7 +48,7 @@ if(!module_state_1) O.mouse_opacity = initial(O.mouse_opacity) module_state_1 = O - O.layer = 20 + O.layer = ABOVE_HUD_LAYER O.screen_loc = inv1.screen_loc contents += O if(istype(module_state_1,/obj/item/borg/sight)) @@ -58,7 +58,7 @@ else if(!module_state_2) O.mouse_opacity = initial(O.mouse_opacity) module_state_2 = O - O.layer = 20 + O.layer = ABOVE_HUD_LAYER O.screen_loc = inv2.screen_loc contents += O if(istype(module_state_2,/obj/item/borg/sight)) @@ -68,7 +68,7 @@ else if(!module_state_3) O.mouse_opacity = initial(O.mouse_opacity) module_state_3 = O - O.layer = 20 + O.layer = ABOVE_HUD_LAYER O.screen_loc = inv3.screen_loc contents += O if(istype(module_state_3,/obj/item/borg/sight)) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index dd48ae69ce5..55de2e3253e 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -84,7 +84,7 @@ robot_modules_background = new() robot_modules_background.icon_state = "block" - robot_modules_background.layer = 19 //Objects that appear on screen are on layer 20, UI should be just below it. + robot_modules_background.layer = HUD_LAYER //Objects that appear on screen are on layer ABOVE_HUD_LAYER, UI should be just below it. ident = rand(1, 999) update_icons() @@ -390,8 +390,8 @@ if(connected_ai) stat("Master AI:", connected_ai.name) -/mob/living/silicon/robot/restrained() - return 0 +/mob/living/silicon/robot/restrained(ignore_grab) + . = 0 /mob/living/silicon/robot/ex_act(severity, target) switch(severity) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 42d1c25a729..3148c0b72f4 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -467,7 +467,7 @@ if (aicamera) return aicamera.selectpicture(aicamera) -/mob/living/silicon/grabbedby(mob/living/user) +/mob/living/silicon/grippedby(mob/living/user) return /mob/living/silicon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/noise) diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index 1257e7d0ab4..ce5d311e7bf 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -132,7 +132,7 @@ var/global/mulebot_count = 0 if(load && !ismob(load))//buckling handles the mob offsets load.pixel_y = initial(load.pixel_y) + 9 if(load.layer < layer) - load.layer = layer + 0.1 + load.layer = layer + 0.01 overlays += load return @@ -384,7 +384,7 @@ var/global/mulebot_count = 0 if(M in buckled_mobs) //post buckling M.pixel_y = initial(M.pixel_y) + 9 if(M.layer < layer) - M.layer = layer + 0.1 + M.layer = layer + 0.01 else //post unbuckling load = null diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index cdedc564910..45f8b884801 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -207,7 +207,7 @@ if(change) if(change > 0) if(M && stat != DEAD) - flick_overlay(image('icons/mob/animal.dmi', src, "heart-ani2", MOB_LAYER+1), list(M.client), 20) + flick_overlay(image('icons/mob/animal.dmi', src, "heart-ani2", ABOVE_MOB_LAYER), list(M.client), 20) emote("me", 1, "purrs!") else if(M && stat != DEAD) diff --git a/code/modules/mob/living/simple_animal/friendly/cockroach.dm b/code/modules/mob/living/simple_animal/friendly/cockroach.dm index e9f1c512b42..9d6a9ab7f64 100644 --- a/code/modules/mob/living/simple_animal/friendly/cockroach.dm +++ b/code/modules/mob/living/simple_animal/friendly/cockroach.dm @@ -53,4 +53,4 @@ icon = 'icons/effects/blood.dmi' icon_state = "xfloor1" random_icon_states = list("xfloor1", "xfloor2", "xfloor3", "xfloor4", "xfloor5", "xfloor6", "xfloor7") - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index 7e14553ce1c..43a1ce548b1 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -534,7 +534,7 @@ if(change) if(change > 0) if(M && stat != DEAD) // Added check to see if this mob (the dog) is dead to fix issue 2454 - flick_overlay(image('icons/mob/animal.dmi',src,"heart-ani2",MOB_LAYER+1), list(M.client), 20) + flick_overlay(image('icons/mob/animal.dmi',src,"heart-ani2",ABOVE_MOB_LAYER), list(M.client), 20) emote("me", 1, "yaps happily!") else if(M && stat != DEAD) // Same check here, even though emote checks it as well (poor form to check it only in the help case) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm index 7c710cf6c8c..f651188ee5a 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm @@ -81,10 +81,9 @@ drop_r_hand() var/obj/item/clothing/head/drone_holder/DH = new /obj/item/clothing/head/drone_holder(src) DH.updateVisualAppearence(src) - DH.contents += src DH.drone = src user.put_in_hands(DH) - src.loc = DH + forceMove(DH) return ..() diff --git a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm index cc56e9382a9..51bc2316b5b 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm @@ -91,10 +91,13 @@ r_hand = null update_inv_hands() + if(I.pulledby) + I.pulledby.stop_pulling() + I.screen_loc = null // will get moved if inventory is visible I.loc = src I.equipped(src, slot) - I.layer = 20 + I.layer = ABOVE_HUD_LAYER switch(slot) if(slot_head) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm index 4b3e79d22f3..19d54f72bdd 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm @@ -37,7 +37,7 @@ hands_overlays += r_hand_image if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) - r_hand.layer = 20 + r_hand.layer = ABOVE_HUD_LAYER r_hand.screen_loc = ui_rhand client.screen |= r_hand @@ -54,7 +54,7 @@ hands_overlays += l_hand_image if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) - l_hand.layer = 20 + l_hand.layer = ABOVE_HUD_LAYER l_hand.screen_loc = ui_lhand client.screen |= l_hand diff --git a/code/modules/mob/living/simple_animal/guardian/types/lightning.dm b/code/modules/mob/living/simple_animal/guardian/types/lightning.dm index ca1c4e8d22e..deaef1dbe72 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/lightning.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/lightning.dm @@ -1,7 +1,7 @@ //Beam /obj/effect/ebeam/chain name = "lightning chain" - layer = MOB_LAYER - 0.1 + layer = LYING_MOB_LAYER /mob/living/simple_animal/hostile/guardian/beam melee_damage_lower = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm index 1114228f1ce..249bf3bbe36 100644 --- a/code/modules/mob/living/simple_animal/hostile/bees.dm +++ b/code/modules/mob/living/simple_animal/hostile/bees.dm @@ -32,7 +32,7 @@ environment_smash = 0 mouse_opacity = 2 pass_flags = PASSTABLE | PASSGRILLE | PASSMOB - mob_size = MOB_SIZE_SMALL + mob_size = MOB_SIZE_TINY flying = 1 gold_core_spawnable = 1 search_objects = 1 //have to find those plant trays! diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm index 6e5d69f172c..d71a079b733 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm @@ -70,7 +70,7 @@ icon_state = "fireball" name = "fireball" desc = "Get out of the way!" - layer = 6 + layer = FLY_LAYER randomdir = 0 duration = 10 pixel_z = 500 @@ -78,7 +78,7 @@ /obj/effect/overlay/temp/target icon = 'icons/mob/actions.dmi' icon_state = "sniper_zoom" - layer = MOB_LAYER - 0.1 + layer = BELOW_MOB_LAYER luminosity = 2 duration = 10 @@ -87,7 +87,7 @@ desc = "Don't just stand there, move!" icon = 'icons/effects/96x96.dmi' icon_state = "rune_large" - layer = MOB_LAYER - 0.1 + layer = BELOW_MOB_LAYER pixel_x = -32 pixel_y = -32 color = "#FF0000" diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm index f9ff4a3762d..09c51bde9be 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -12,7 +12,7 @@ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 maxbodytemp = INFINITY - layer = MOB_LAYER + 0.5 //Looks weird with them slipping under mineral walls and cameras and shit otherwise + layer = LARGE_MOB_LAYER //Looks weird with them slipping under mineral walls and cameras and shit otherwise /mob/living/simple_animal/hostile/megafauna/death(gibbed) if(health > 0) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm index 2cbaff85393..ba2db3344ed 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm @@ -77,8 +77,8 @@ aggro_vision_range = 9 idle_vision_range = 2 turns_per_move = 5 - loot = list(/obj/item/weapon/ore/diamond{layer = 4.1}, - /obj/item/weapon/ore/diamond{layer = 4.1}) + loot = list(/obj/item/weapon/ore/diamond{layer = ABOVE_MOB_LAYER}, + /obj/item/weapon/ore/diamond{layer = ABOVE_MOB_LAYER}) /obj/item/projectile/temp/basilisk name = "freezing blast" @@ -463,7 +463,7 @@ mob_size = MOB_SIZE_LARGE var/pre_attack = 0 var/pre_attack_icon = "Goliath_preattack" - loot = list(/obj/item/stack/sheet/animalhide/goliath_hide{layer = 4.1}) + loot = list(/obj/item/stack/sheet/animalhide/goliath_hide{layer = ABOVE_MOB_LAYER}) /mob/living/simple_animal/hostile/asteroid/goliath/Life() ..() @@ -558,7 +558,7 @@ icon_state = "goliath_hide" flags = NOBLUDGEON w_class = 3 - layer = 4 + layer = MOB_LAYER /obj/item/stack/sheet/animalhide/goliath_hide/afterattack(atom/target, mob/user, proximity_flag) if(proximity_flag) @@ -629,7 +629,7 @@ environment_smash = 0 var/wumbo = 0 var/inflate_cooldown = 0 - loot = list(/obj/item/asteroid/fugu_gland{layer = 4.1}) + loot = list(/obj/item/asteroid/fugu_gland{layer = ABOVE_MOB_LAYER}) /mob/living/simple_animal/hostile/asteroid/fugu/Life() if(!wumbo) @@ -705,7 +705,7 @@ icon_state = "fugu_gland" flags = NOBLUDGEON w_class = 3 - layer = 4 + layer = MOB_LAYER origin_tech = "biotech=6" var/list/banned_mobs() @@ -1005,7 +1005,6 @@ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 5, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 maxbodytemp = INFINITY - layer = MOB_LAYER-0.1 loot = list(/obj/effect/collapse, /obj/structure/closet/crate/necropolis/tendril) del_on_death = 1 var/gps = null @@ -1021,7 +1020,7 @@ /obj/effect/collapse name = "collapsing necropolis tendril" desc = "Get clear!" - layer = 2 + layer = ABOVE_OPEN_TURF_LAYER icon = 'icons/mob/nest.dmi' icon_state = "tendril" anchored = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/skeleton.dm b/code/modules/mob/living/simple_animal/hostile/skeleton.dm index e550017407c..9d6491c3770 100644 --- a/code/modules/mob/living/simple_animal/hostile/skeleton.dm +++ b/code/modules/mob/living/simple_animal/hostile/skeleton.dm @@ -29,7 +29,6 @@ faction = list("skeleton") see_invisible = SEE_INVISIBLE_MINIMUM see_in_dark = 8 - layer = MOB_LAYER - 0.1 deathmessage = "collapses into a pile of bones!" del_on_death = 1 loot = list(/obj/effect/decal/remains/human) diff --git a/code/modules/mob/living/simple_animal/hostile/statue.dm b/code/modules/mob/living/simple_animal/hostile/statue.dm index cd450b1ba34..739a332d653 100644 --- a/code/modules/mob/living/simple_animal/hostile/statue.dm +++ b/code/modules/mob/living/simple_animal/hostile/statue.dm @@ -228,7 +228,7 @@ /mob/living/simple_animal/hostile/statue/sentience_act() faction -= "neutral" -/mob/living/simple_animal/hostile/statue/restrained() +/mob/living/simple_animal/hostile/statue/restrained(ignore_grab) . = ..() if(can_be_seen(loc)) return 1 diff --git a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm index 14583cd85fd..7d57ca55b42 100644 --- a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm +++ b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm @@ -5,7 +5,7 @@ desc = "a large pulsating plant..." icon = 'icons/effects/spacevines.dmi' icon_state = "flower_bud" - layer = MOB_LAYER + 0.9 + layer = SPACEVINE_MOB_LAYER opacity = 0 canSmoothWith = list() smooth = SMOOTH_FALSE @@ -49,7 +49,7 @@ name = "venus human trap" desc = "now you know how the fly feels" icon_state = "venus_human_trap" - layer = MOB_LAYER + 0.9 + layer = SPACEVINE_MOB_LAYER health = 50 maxHealth = 50 ranged = 1 diff --git a/code/modules/mob/living/simple_animal/hostile/zombie.dm b/code/modules/mob/living/simple_animal/hostile/zombie.dm index cf71e21028e..11d2a8704c0 100644 --- a/code/modules/mob/living/simple_animal/hostile/zombie.dm +++ b/code/modules/mob/living/simple_animal/hostile/zombie.dm @@ -24,16 +24,15 @@ environment_smash = 1 robust_searching = 1 stat_attack = 2 - gold_core_spawnable = 1 + gold_core_spawnable = 0 faction = list("zombie") var/mob/living/carbon/human/stored_corpse = null butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab/human/mutant/zombie = 3) see_invisible = SEE_INVISIBLE_MINIMUM see_in_dark = 8 - layer = MOB_LAYER - 0.1 var/removingairlock = 0 -/mob/living/simple_animal/hostile/zombie/darkholme //BOY♂NEXT♂RUIN +/mob/living/simple_animal/hostile/zombie/darkholme //BOY?NEXT?RUIN desc = "This guy seems to have gotten lost on his way to the leather club." gold_core_spawnable = 0 @@ -199,4 +198,4 @@ mob/living/simple_animal/hostile/zombie/gymboss if(src && istype(loc, /mob/living/carbon/human)) var/mob/living/carbon/human/H = loc Zombify(H) - qdel(src) + qdel(src) \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 75d8731296e..45442b8f7cc 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -172,6 +172,9 @@ /mob/living/simple_animal/handle_environment(datum/gas_mixture/environment) var/atmos_suitable = 1 + if(pulledby && pulledby.grab_state >= GRAB_KILL && atmos_requirements["min_oxy"]) + atmos_suitable = 0 //getting choked + var/atom/A = src.loc if(isturf(A)) var/turf/T = A diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm index 5fedf3b3a81..a7498e11397 100644 --- a/code/modules/mob/living/simple_animal/slime/powers.dm +++ b/code/modules/mob/living/simple_animal/slime/powers.dm @@ -79,6 +79,7 @@ /mob/living/simple_animal/slime/proc/Feedon(mob/living/M) M.unbuckle_all_mobs(force=1) //Slimes rip other mobs (eg: shoulder parrots) off (Slimes Vs Slimes is already handled in CanFeedon()) if(M.buckle_mob(src, force=1)) + layer = M.layer+0.01 //appear above the target mob M.visible_message("The [name] has latched onto [M]!", \ "The [name] has latched onto [M]!") else @@ -94,6 +95,7 @@ if(!silent) visible_message("[src] has let go of [buckled]!", \ "I stopped feeding.") + layer = initial(layer) buckled.unbuckle_mob(src,force=1) /mob/living/simple_animal/slime/verb/Evolve() diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index 7f67da0ad76..22178caa4bf 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -24,8 +24,6 @@ var/list/slime_colours = list("rainbow", "grey", "purple", "metal", "orange", speak_emote = list("telepathically chirps") bubble_icon = "slime" - layer = 5 - atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) maxHealth = 150 @@ -401,7 +399,7 @@ var/list/slime_colours = list("rainbow", "grey", "purple", "metal", "orange", sleep(3) if(user) step_away(src,user,15) - canmove = 1 + update_canmove() /mob/living/simple_animal/slime/pet docile = 1 diff --git a/code/modules/mob/living/simple_animal/spawner.dm b/code/modules/mob/living/simple_animal/spawner.dm index 204d2b400f7..bd01da0b97a 100644 --- a/code/modules/mob/living/simple_animal/spawner.dm +++ b/code/modules/mob/living/simple_animal/spawner.dm @@ -18,7 +18,7 @@ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 5, "min_n2" = 0, "max_n2" = 0) minbodytemp = 0 maxbodytemp = 350 - layer = MOB_LAYER-0.1 + layer = BELOW_MOB_LAYER sentience_type = SENTIENCE_BOSS diff --git a/code/modules/mob/living/ventcrawling.dm b/code/modules/mob/living/ventcrawling.dm index d01b00ceaeb..c32a82c7865 100644 --- a/code/modules/mob/living/ventcrawling.dm +++ b/code/modules/mob/living/ventcrawling.dm @@ -92,7 +92,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary for(var/X in totalMembers) var/obj/machinery/atmospherics/A = X //all elements in totalMembers are necessarily of this type. if(!A.pipe_vision_img) - A.pipe_vision_img = image(A, A.loc, layer = 20, dir = A.dir) + A.pipe_vision_img = image(A, A.loc, layer = ABOVE_HUD_LAYER, dir = A.dir) //20 for being above darkness pipes_shown += A.pipe_vision_img if(client) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 676a97d7035..d5647ed98dc 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -179,44 +179,10 @@ var/next_mob_id = 0 return r_hand return null -/mob/proc/ret_grab(obj/effect/list_container/mobl/L, flag) - if ((!( istype(l_hand, /obj/item/weapon/grab) ) && !( istype(r_hand, /obj/item/weapon/grab) ))) - if (!( L )) - return null - else - return L.container - else - if (!( L )) - L = new /obj/effect/list_container/mobl( null ) - L.container += src - L.master = src - if (istype(l_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = l_hand - if (!( L.container.Find(G.affecting) )) - L.container += G.affecting - if (G.affecting) - G.affecting.ret_grab(L, 1) - if (istype(r_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = r_hand - if (!( L.container.Find(G.affecting) )) - L.container += G.affecting - if (G.affecting) - G.affecting.ret_grab(L, 1) - if (!( flag )) - if (L.master == src) - var/list/temp = list( ) - temp += L.container - //L = null - qdel(L) - return temp - else - return L.container +/mob/proc/restrained(ignore_grab) return -/mob/proc/restrained() - return - -/mob/proc/incapacitated() +/mob/proc/incapacitated(ignore_restraints, ignore_grab) return //This proc is called whenever someone clicks an inventory ui slot. @@ -333,12 +299,14 @@ var/next_mob_id = 0 return 1 //this and stop_pulling really ought to be /mob/living procs -/mob/proc/start_pulling(atom/movable/AM) +/mob/proc/start_pulling(atom/movable/AM, supress_message = 0) if(!AM || !src) return if(AM == src || !isturf(AM.loc)) return - if(AM.anchored) + if(AM.anchored || AM.throwing) + return + if(throwing || incapacitated()) return AM.add_fingerprint(src) @@ -350,13 +318,21 @@ var/next_mob_id = 0 return stop_pulling() + changeNext_move(CLICK_CD_GRABBING) + + if(AM.pulledby) + visible_message("[src] has pulled [AM] from [AM.pulledby]'s grip.") + AM.pulledby.stop_pulling() //an object can't be pulled by two mobs at once. + pulling = AM AM.pulledby = src - + playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) update_pull_hud_icon() if(ismob(AM)) var/mob/M = AM + if(!supress_message) + visible_message("[src] has grabbed [M] passively!") if(!iscarbon(src)) M.LAssailant = null else @@ -368,11 +344,15 @@ var/next_mob_id = 0 if(pulling) pulling.pulledby = null + if(ismob(pulling)) + var/mob/M = pulling + M.update_canmove()// mob gets up if it was lyng down in a chokehold pulling = null + grab_state = 0 update_pull_hud_icon() /mob/proc/update_pull_hud_icon() - if(client && hud_used) + if(hud_used) if(hud_used.pull_icon) hud_used.pull_icon.update_icon(src) @@ -677,10 +657,11 @@ var/next_mob_id = 0 //Robots, animals and brains have their own version so don't worry about them /mob/proc/update_canmove() var/ko = weakened || paralysis || stat || (status_flags & FAKEDEATH) + var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK var/buckle_lying = !(buckled && !buckled.buckle_lying) var/has_legs = get_num_legs() var/has_arms = get_num_arms() - if(ko || resting || stunned) + if(ko || resting || stunned || chokehold) drop_r_hand() drop_l_hand() unset_machine() @@ -691,16 +672,18 @@ var/next_mob_id = 0 if(buckled) lying = 90*buckle_lying - else - if((ko || resting || !has_legs) && !lying) - fall(ko) - canmove = !(ko || resting || stunned || buckled || (!has_legs && !has_arms)) + else if(!lying) + if(resting) + fall() + else if(ko || !has_legs || chokehold) + fall(forced = 1) + canmove = !(ko || resting || stunned || chokehold || buckled || (!has_legs && !has_arms)) density = !lying if(lying) if(layer == initial(layer)) //to avoid special cases like hiding larvas. - layer = MOB_LAYER - 0.2 //so mob lying always appear behind standing mobs + layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs else - if(layer == MOB_LAYER - 0.2) + if(layer == LYING_MOB_LAYER) layer = initial(layer) update_transform() update_action_buttons_icon() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 2d8684ded9d..e6d1f17a3dc 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -1,6 +1,6 @@ /mob density = 1 - layer = 4 + layer = MOB_LAYER animate_movement = 2 flags = HEAR hud_possible = list(ANTAG_HUD) @@ -32,7 +32,10 @@ var/other_mobs = null var/memory = "" var/disabilities = 0 //Carbon + var/atom/movable/pulling = null + var/grab_state = 0 + var/next_move = null var/notransform = null //Carbon var/hand = null @@ -86,9 +89,6 @@ var/research_scanner = 0 //For research scanner equipped mobs. Enable to show research data when examining. - var/list/grabbed_by = list( ) - var/list/requests = list( ) - var/list/mapobjs = list() var/in_throw_mode = 0 diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm deleted file mode 100644 index c89cf9ac1a8..00000000000 --- a/code/modules/mob/mob_grab.dm +++ /dev/null @@ -1,223 +0,0 @@ -#define UPGRADE_COOLDOWN 40 -#define UPGRADE_KILL_TIMER 100 - -/obj/item/weapon/grab - name = "grab" - flags = NOBLUDGEON | ABSTRACT - var/obj/screen/grab/hud = null - var/mob/affecting = null - var/mob/assailant = null - var/state = GRAB_PASSIVE - - var/allow_upgrade = 1 - var/last_upgrade = 0 - - layer = 21 - item_state = "nothing" - w_class = 5 - - -/obj/item/weapon/grab/New(mob/user, mob/victim) - ..() - assailant = user - affecting = victim - - hud = new /obj/screen/grab(src) - hud.icon_state = "reinforce" - hud.name = "reinforce grab" - hud.master = src - - affecting.grabbed_by += src - - -/obj/item/weapon/grab/Destroy() - if(affecting) - affecting.grabbed_by -= src - affecting = null - if(assailant) - if(assailant.client) - assailant.client.screen -= hud - assailant = null - qdel(hud) - return ..() - -//Used by throw code to hand over the mob, instead of throwing the grab. The grab is then deleted by the throw code. -/obj/item/weapon/grab/proc/get_mob_if_throwable() - if(affecting) - if(affecting.buckled) - return null - if(state >= GRAB_AGGRESSIVE) - return affecting - return null - - -//This makes sure that the grab screen object is displayed in the correct hand. -/obj/item/weapon/grab/proc/synch() - if(affecting) - if(assailant.r_hand == src) - hud.screen_loc = ui_rhand - else - hud.screen_loc = ui_lhand - - -/obj/item/weapon/grab/process() - if(!confirm()) - return 0 - - if(assailant.client) - assailant.client.screen -= hud - assailant.client.screen += hud - - if(assailant.pulling == affecting) - assailant.stop_pulling() - - if(state <= GRAB_AGGRESSIVE) - allow_upgrade = 1 - if((assailant.l_hand && assailant.l_hand != src && istype(assailant.l_hand, /obj/item/weapon/grab))) - var/obj/item/weapon/grab/G = assailant.l_hand - if(G.affecting != affecting) - allow_upgrade = 0 - if((assailant.r_hand && assailant.r_hand != src && istype(assailant.r_hand, /obj/item/weapon/grab))) - var/obj/item/weapon/grab/G = assailant.r_hand - if(G.affecting != affecting) - allow_upgrade = 0 - if(state == GRAB_AGGRESSIVE) - var/h = affecting.hand - affecting.hand = 0 - affecting.drop_item() - affecting.hand = 1 - affecting.drop_item() - affecting.hand = h - for(var/X in affecting.grabbed_by) - var/obj/item/weapon/grab/G = X - if(G == src) continue - if(G.state == GRAB_AGGRESSIVE) - allow_upgrade = 0 - if(allow_upgrade) - hud.icon_state = "reinforce" - else - hud.icon_state = "!reinforce" - else - if(!affecting.buckled) - affecting.loc = assailant.loc - - var/breathing_tube = affecting.getorganslot("breathing_tube") - - if(state >= GRAB_NECK) - affecting.Stun(5) //It will hamper your voice, being choked and all. - if(isliving(affecting) && !breathing_tube) - var/mob/living/L = affecting - L.adjustOxyLoss(1) - - if(state >= GRAB_KILL) - affecting.Weaken(5) //Should keep you down unless you get help. - if(!breathing_tube) - affecting.losebreath = min(affecting.losebreath + 2, 3) - -/obj/item/weapon/grab/attack_self(mob/user) - s_click(hud) - -/obj/item/weapon/grab/proc/s_click(obj/screen/S) - if(!affecting) - return - if(state == GRAB_UPGRADING) - return - if(world.time < (last_upgrade + UPGRADE_COOLDOWN)) - return - if(!assailant.canmove || assailant.lying) - qdel(src) - return - - last_upgrade = world.time - - if(state < GRAB_AGGRESSIVE) - if(!allow_upgrade) - return - assailant.visible_message("[assailant] grabs [affecting] aggressively!") - state = GRAB_AGGRESSIVE - icon_state = "grabbed1" - else - if(state < GRAB_NECK) - if(isslime(affecting)) - assailant << "You squeeze [affecting], but nothing interesting happens!" - return - - assailant.visible_message("[assailant] moves \his grip to [affecting]'s neck!") - state = GRAB_NECK - icon_state = "grabbed+1" - if(!affecting.buckled) - affecting.loc = assailant.loc - add_logs(assailant, affecting, "neck-grabbed") - hud.icon_state = "disarm/kill" - hud.name = "disarm/kill" - else - if(state < GRAB_UPGRADING) - assailant.visible_message("[assailant] starts to tighten \his grip on [affecting]'s neck!") - hud.icon_state = "disarm/kill1" - state = GRAB_UPGRADING - if(do_after(assailant, UPGRADE_KILL_TIMER, target = affecting)) - if(state == GRAB_KILL) - return - if(!affecting) - qdel(src) - return - if(!assailant.canmove || assailant.lying) - qdel(src) - return - state = GRAB_KILL - assailant.visible_message("[assailant] tightens \his grip on [affecting]'s neck!") - add_logs(assailant, affecting, "strangled") - - assailant.changeNext_move(CLICK_CD_TKSTRANGLE) - if(!affecting.getorganslot("breathing_tube")) - affecting.losebreath += 1 - else - if(assailant) - assailant.visible_message("[assailant] is unable to tighten \his grip on [affecting]'s neck!") - hud.icon_state = "disarm/kill" - state = GRAB_NECK - - -//This is used to make sure the victim hasn't managed to yackety sax away before using the grab. -/obj/item/weapon/grab/proc/confirm() - if(!assailant || !affecting) - qdel(src) - return 0 - - if(affecting) - if(!isturf(assailant.loc) || ( !isturf(affecting.loc) || assailant.loc != affecting.loc && get_dist(assailant, affecting) > 1) ) - qdel(src) - return 0 - - return 1 - - -/obj/item/weapon/grab/attack(mob/M, mob/user) - if(!affecting) - return - - if(M == affecting) - s_click(hud) - return - - if(M == assailant && state >= GRAB_AGGRESSIVE) - if( (ishuman(user) && (user.disabilities & FAT) && ismonkey(affecting) ) || ( isalien(user) && iscarbon(affecting) ) ) - var/mob/living/carbon/attacker = user - user.visible_message("[user] is attempting to devour [affecting]!") - if(istype(user, /mob/living/carbon/alien/humanoid/hunter)) - if(!do_mob(user, affecting, 60)) return - else - if(!do_mob(user, affecting, 130)) return - user.visible_message("[user] devours [affecting]!") - affecting.loc = user - attacker.stomach_contents.Add(affecting) - qdel(src) - - add_logs(user, affecting, "attempted to put", src, "into [M]") - -/obj/item/weapon/grab/dropped() - ..() - qdel(src) - -#undef UPGRADE_COOLDOWN -#undef UPGRADE_KILL_TIMER diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index bb213d051d4..cfba67193ce 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -8,9 +8,6 @@ if(buckled == mover) return 1 if(ismob(mover)) - var/mob/moving_mob = mover - if ((other_mobs && moving_mob.other_mobs)) - return 1 if (mover in buckled_mobs) return 1 return (!mover.density || !density || lying) @@ -114,7 +111,7 @@ Process_Incorpmove(direct) return 0 - if(Process_Grab()) + if(Process_Grab()) //are we restrained by someone's grip? return if(mob.buckled) //if we're buckled to something, tell it we moved. @@ -136,54 +133,10 @@ if(!mob.Process_Spacemove(direct)) return 0 - if(mob.restrained()) //Why being pulled while cuffed prevents you from moving - for(var/mob/M in orange(1, mob)) - if(M.pulling == mob) - if(!M.incapacitated() && mob.Adjacent(M)) - src << "You're restrained! You can't move!" - move_delay = world.time + 10 - return 0 - else - M.stop_pulling() - - //We are now going to move moving = 1 move_delay = mob.movement_delay() + world.time - //Something with pulling things - if(locate(/obj/item/weapon/grab, mob)) - move_delay = max(move_delay, world.time + 7) - var/list/L = mob.ret_grab() - if(istype(L, /list)) - if(L.len == 2) - L -= mob - var/mob/M = L[1] - if(M) - if ((get_dist(mob, M) <= 1 || M.loc == mob.loc)) - . = ..() - if(M)//Mob may get deleted during parent call - if (isturf(M.loc)) - var/diag = get_dir(mob, M) - if ((diag - 1) & diag) - else - diag = null - if ((get_dist(mob, M) > 1 || diag)) - step(M, get_dir(M.loc, mob.loc)) - else - for(var/mob/M in L) - M.other_mobs = 1 - if(mob != M) - M.animate_movement = 3 - for(var/mob/M in L) - spawn( 0 ) - step(M, direct) - return - spawn( 1 ) - M.other_mobs = null - M.animate_movement = 2 - return - if(mob.confused) if(mob.confused > 40) step(mob, pick(cardinal)) @@ -207,39 +160,14 @@ ///Called by client/Move() ///Checks to see if you are being grabbed and if so attemps to break it /client/proc/Process_Grab() - if(mob.grabbed_by.len) - var/list/grabbing = list() + if(mob.pulledby) + if(mob.restrained(ignore_grab = 1)) + move_delay = world.time + 10 + src << "You're restrained! You can't move!" + return 1 + else + return mob.resist_grab(1) - if(istype(mob.l_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = mob.l_hand - grabbing += G.affecting - - if(istype(mob.r_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/G = mob.r_hand - grabbing += G.affecting - - for(var/X in mob.grabbed_by) - var/obj/item/weapon/grab/G = X - switch(G.state) - - if(GRAB_PASSIVE) - if(!grabbing.Find(G.assailant)) //moving always breaks a passive grab unless we are also grabbing our grabber. - qdel(G) - - if(GRAB_AGGRESSIVE) - move_delay = world.time + 10 - if(!prob(25)) - return 1 - mob.visible_message("[mob] has broken free of [G.assailant]'s grip!") - qdel(G) - - if(GRAB_NECK) - move_delay = world.time + 10 - if(!prob(5)) - return 1 - mob.visible_message("[mob] has broken free of [G.assailant]'s headlock!") - qdel(G) - return 0 ///Process_Incorpmove ///Called by client/Move() @@ -352,27 +280,19 @@ /mob/proc/mob_negates_gravity() return 0 +//moves the mob/object we're pulling /mob/proc/Move_Pulled(atom/A) - if (!canmove || restrained() || !pulling) + if (!pulling) return - if (pulling.anchored) - return - if (!pulling.Adjacent(src)) + if (pulling.anchored || !pulling.Adjacent(src)) + stop_pulling() return if (A == loc && pulling.density) return if (!Process_Spacemove(get_dir(pulling.loc, A))) return - if (ismob(pulling)) - var/mob/M = pulling - var/atom/movable/t = M.pulling - M.stop_pulling() - step(pulling, get_dir(pulling.loc, A)) - if(M) - M.start_pulling(t) - else - step(pulling, get_dir(pulling.loc, A)) - return + step(pulling, get_dir(pulling.loc, A)) + /mob/proc/slip(s_amount, w_amount, obj/O, lube) return diff --git a/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm b/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm index eee99a59bd5..04c0c796f23 100644 --- a/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm +++ b/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm @@ -13,7 +13,7 @@ It is possible to destroy the net by the occupant or someone else. opacity = 0//Can see through. mouse_opacity = 1//So you can hit it with stuff. anchored = 1//Can't drag/grab the trapped mob. - + layer = ABOVE_ALL_MOB_LAYER var/health = 25//How much health it has. var/mob/living/affecting = null//Who it is currently affecting, if anyone. var/mob/living/master = null//Who shot web. Will let this person know if the net was successful or failed. diff --git a/code/modules/ninja/suit/n_suit_verbs/ninja_net.dm b/code/modules/ninja/suit/n_suit_verbs/ninja_net.dm index b31d49c1d82..34d47d7e469 100644 --- a/code/modules/ninja/suit/n_suit_verbs/ninja_net.dm +++ b/code/modules/ninja/suit/n_suit_verbs/ninja_net.dm @@ -18,7 +18,6 @@ H.Beam(C,"n_beam",,15) H.say("Get over here!") var/obj/effect/energy_net/E = new /obj/effect/energy_net(C.loc) - E.layer = C.layer+1//To have it appear one layer above the mob. H.visible_message("[H] caught [C] with an energy net!","You caught [C] with an energy net!") E.affecting = C E.master = H diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 29d4bc11de5..98065675712 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -14,7 +14,6 @@ w_class = 1 throw_range = 1 throw_speed = 1 - layer = 3 pressure_resistance = 0 slot_flags = SLOT_HEAD body_parts_covered = HEAD diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 341f7cf7e51..51b6eb9558f 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -33,7 +33,7 @@ By design, d1 is the smallest direction and d2 is the highest icon_state = "0-1" var/d1 = 0 // cable direction 1 (see above) var/d2 = 1 // cable direction 2 (see above) - layer = 2.44 //Just below unary stuff, which is at 2.45 and above pipes, which are at 2.4 + layer = WIRE_LAYER //Above pipes, which are at GAS_PIPE_LAYER var/cable_color = "red" var/obj/item/stack/cable_coil/stored diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index a9780a6f25e..daebb4850a7 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -146,7 +146,7 @@ var/const/GRAV_NEEDS_WRENCH = 3 middle = part if(count <= 3) // Their sprite is the top part of the generator part.density = 0 - part.layer = MOB_LAYER + 0.1 + part.layer = WALL_OBJ_LAYER part.sprite_number = count part.main_part = src parts += part diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index ba4def1b629..a4b9ae8875c 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -32,7 +32,7 @@ icon = 'icons/obj/lighting.dmi' icon_state = "tube-construct-stage1" anchored = 1 - layer = MOB_LAYER + 0.25 + layer = WALL_OBJ_LAYER var/stage = 1 var/fixture_type = "tube" var/sheets_refunded = 2 @@ -131,7 +131,7 @@ icon_state = "tube1" desc = "A lighting fixture." anchored = 1 - layer = MOB_LAYER + 0.25 + layer = WALL_OBJ_LAYER use_power = 2 idle_power_usage = 2 active_power_usage = 20 diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index 0ddbd973c4a..4dc2e7b65d3 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -10,7 +10,7 @@ unacidable = 1 use_power = 0 luminosity = 4 - layer = OBJ_LAYER + 0.1 + layer = ABOVE_OBJ_LAYER var/obj/machinery/field/generator/FG1 = null var/obj/machinery/field/generator/FG2 = null diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index befe71b8071..d9090686d8d 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -7,7 +7,7 @@ icon_state = "singularity_s1" anchored = 1 density = 1 - layer = 6 + layer = MASSIVE_OBJ_LAYER luminosity = 6 unacidable = 1 //Don't comment this out. var/current_size = 1 diff --git a/code/modules/power/terminal.dm b/code/modules/power/terminal.dm index 229c59f9d03..f3fcb43585b 100644 --- a/code/modules/power/terminal.dm +++ b/code/modules/power/terminal.dm @@ -8,10 +8,9 @@ icon_state = "term" desc = "It's an underfloor wiring terminal for power equipment." level = 1 - layer = TURF_LAYER var/obj/machinery/power/master = null anchored = 1 - layer = 2.6 // a bit above wires + layer = WIRE_TERMINAL_LAYER //a bit above wires /obj/machinery/power/terminal/New() diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 83d17c7ebfe..a6b0e4c0c7b 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -129,7 +129,7 @@ if((!( current ) || loc == current)) current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z) step_towards(src, current) - if(original && (original.layer>=2.75) || ismob(original)) + if(original && (original.layer>=PROJECTILE_HIT_THRESHHOLD_LAYER) || ismob(original)) if(loc == get_turf(original)) if(!(original in permutated)) Bump(original, 1) diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 0002f3dbeca..81f9afd7dad 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -162,7 +162,7 @@ name = "kinetic explosion" icon = 'icons/obj/projectiles.dmi' icon_state = "kinetic_blast" - layer = 4.1 + layer = ABOVE_ALL_MOB_LAYER /obj/effect/kinetic_blast/New() spawn(4) diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index e71f8a95b48..479a2ea140b 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -3,7 +3,7 @@ desc = "Used to grind things up into raw materials." icon = 'icons/obj/kitchen.dmi' icon_state = "juicer1" - layer = 2.9 + layer = BELOW_OBJ_LAYER anchored = 1 use_power = 1 idle_power_usage = 5 diff --git a/code/modules/recycling/disposal-structures.dm b/code/modules/recycling/disposal-structures.dm index d5c7403d185..926f2afbb31 100644 --- a/code/modules/recycling/disposal-structures.dm +++ b/code/modules/recycling/disposal-structures.dm @@ -136,7 +136,7 @@ var/dpdir = 0 // bitmask of pipe directions dir = 0 // dir will contain dominant direction for junction pipes var/health = 10 // health points 0-10 - layer = 2.3 // slightly lower than wires and other pipes + layer = DISPOSAL_PIPE_LAYER // slightly lower than wires and other pipes var/base_icon_state // initial icon state on map var/obj/structure/disposalconstruct/stored diff --git a/code/modules/spells/spell_types/ethereal_jaunt.dm b/code/modules/spells/spell_types/ethereal_jaunt.dm index 07623aad297..9afa9929390 100644 --- a/code/modules/spells/spell_types/ethereal_jaunt.dm +++ b/code/modules/spells/spell_types/ethereal_jaunt.dm @@ -27,7 +27,7 @@ animation.density = 0 animation.anchored = 1 animation.icon = 'icons/mob/mob.dmi' - animation.layer = 5 + animation.layer = FLY_LAYER animation.master = holder target.ExtinguishMob() if(target.buckled) diff --git a/code/modules/surgery/bodyparts/head.dm b/code/modules/surgery/bodyparts/head.dm index 3c45a182304..63fbc29203d 100644 --- a/code/modules/surgery/bodyparts/head.dm +++ b/code/modules/surgery/bodyparts/head.dm @@ -5,7 +5,7 @@ max_damage = 200 body_zone = "head" body_part = HEAD - layer = 4.1 //so it isn't hidden behind some objects when on the floor + layer = ABOVE_MOB_LAYER //so it isn't hidden behind some objects when on the floor w_class = 4 //Quite a hefty load slowdown = 1 //Balancing measure throw_range = 2 //No head bowling @@ -163,4 +163,4 @@ /obj/item/bodypart/head/burn() drop_organs() - ..() \ No newline at end of file + ..() diff --git a/code/modules/vehicles/atv.dm b/code/modules/vehicles/atv.dm index 01d440dec03..bf77878eae0 100644 --- a/code/modules/vehicles/atv.dm +++ b/code/modules/vehicles/atv.dm @@ -14,7 +14,7 @@ ..() if(!atvcover) atvcover = image("icons/obj/vehicles.dmi", "atvcover") - atvcover.layer = MOB_LAYER + 0.1 + atvcover.layer = ABOVE_MOB_LAYER obj/vehicle/atv/post_buckle_mob(mob/living/M) @@ -26,7 +26,7 @@ obj/vehicle/atv/post_buckle_mob(mob/living/M) /obj/vehicle/atv/handle_vehicle_layer() if(dir == SOUTH) - layer = MOB_LAYER+0.1 + layer = ABOVE_MOB_LAYER else layer = OBJ_LAYER @@ -51,13 +51,13 @@ obj/vehicle/atv/post_buckle_mob(mob/living/M) /obj/vehicle/atv/turret/handle_vehicle_layer() if(dir == SOUTH) - layer = MOB_LAYER+0.1 + layer = ABOVE_MOB_LAYER else layer = OBJ_LAYER if(turret) if(dir == NORTH) - turret.layer = MOB_LAYER+0.1 + turret.layer = ABOVE_MOB_LAYER else turret.layer = OBJ_LAYER diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index 2e02313105e..e894e3c1c4a 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -15,7 +15,7 @@ /obj/vehicle/scooter/handle_vehicle_layer() if(dir == SOUTH) - layer = MOB_LAYER+0.1 + layer = ABOVE_MOB_LAYER else layer = OBJ_LAYER diff --git a/code/modules/vehicles/speedbike.dm b/code/modules/vehicles/speedbike.dm index 8f374cd6213..7602f9f4356 100644 --- a/code/modules/vehicles/speedbike.dm +++ b/code/modules/vehicles/speedbike.dm @@ -2,7 +2,7 @@ name = "Speedbike" icon = 'icons/obj/bike.dmi' icon_state = "speedbike_blue" - layer = MOB_LAYER - 0.1 + layer = LYING_MOB_LAYER keytype = null vehicle_move_delay = 0 var/overlay_state = "cover_blue" @@ -11,13 +11,13 @@ /obj/vehicle/space/speedbike/New() ..() overlay = image("icons/obj/bike.dmi", overlay_state) - overlay.layer = MOB_LAYER + 0.1 + overlay.layer = ABOVE_MOB_LAYER overlays += overlay /obj/effect/overlay/temp/speedbike_trail name = "speedbike trails" icon_state = "ion_fade" - layer = MOB_LAYER - 0.2 + layer = BELOW_MOB_LAYER duration = 10 randomdir = 0 diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index 2b9890ee8c7..96582344dfc 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -27,7 +27,7 @@ //APPEARANCE /obj/vehicle/proc/handle_vehicle_layer() if(dir != NORTH) - layer = MOB_LAYER+0.1 + layer = ABOVE_MOB_LAYER else layer = OBJ_LAYER @@ -109,7 +109,7 @@ /obj/vehicle/Move(NewLoc,Dir=0,step_x=0,step_y=0) - ..() + . = ..() handle_vehicle_layer() handle_vehicle_offsets() diff --git a/html/changelogs/AutoChangeLog-pr-17896.yml b/html/changelogs/AutoChangeLog-pr-17896.yml new file mode 100644 index 00000000000..1aec622f5dc --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-17896.yml @@ -0,0 +1,5 @@ +author: phil235 +delete-after: True +changes: + - tweak: "Pull and Grab are merged together. Pulling stays unchanged. Using an empty hand with grab intent on a mob will pull them. Using an empty hand with grab intent on a mob that you're already pulling will try to upgrade your grip to aggressive grab>neck grab>kill grab. Aggressive grabs no longer stun you, but they act exactly like a handcuff, preventing you from using your hands until you escape the grip. You can break free from the grip by trying to move or using the resist button." + - tweak: "Someone pulling a restrained mob now swap position with them instead of getting blocked by the mob, unable to even push them." diff --git a/icons/obj/structures.dmi b/icons/obj/structures.dmi index 71f5dd61908..219bb139c66 100644 Binary files a/icons/obj/structures.dmi and b/icons/obj/structures.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 6f81556dafa..fd4a6d24a20 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -33,6 +33,7 @@ #include "code\__DEFINES\genetics.dm" #include "code\__DEFINES\hud.dm" #include "code\__DEFINES\is_helpers.dm" +#include "code\__DEFINES\layers.dm" #include "code\__DEFINES\machines.dm" #include "code\__DEFINES\math.dm" #include "code\__DEFINES\misc.dm" @@ -43,8 +44,8 @@ #include "code\__DEFINES\reagents.dm" #include "code\__DEFINES\role_preferences.dm" #include "code\__DEFINES\say.dm" -#include "code\__DEFINES\sight.dm" #include "code\__DEFINES\shuttles.dm" +#include "code\__DEFINES\sight.dm" #include "code\__DEFINES\stat.dm" #include "code\__DEFINES\tablecrafting.dm" #include "code\__DEFINES\tgui.dm" @@ -1238,7 +1239,6 @@ #include "code\modules\mob\mob.dm" #include "code\modules\mob\mob_cleanup.dm" #include "code\modules\mob\mob_defines.dm" -#include "code\modules\mob\mob_grab.dm" #include "code\modules\mob\mob_helpers.dm" #include "code\modules\mob\mob_movement.dm" #include "code\modules\mob\mob_transformation_simple.dm" diff --git a/tools/github_webhook_processor.php b/tools/github_webhook_processor.php index 766f0310302..39189c88428 100644 --- a/tools/github_webhook_processor.php +++ b/tools/github_webhook_processor.php @@ -20,7 +20,7 @@ //Github lets you have it sign the message with a secret that you can validate. This prevents people from faking events. //This var should match the secret you configured for this webhook on github. -//set to NULL (no quotes) to disable validation. +//This is required as otherwise somebody could trick the script into leaking the api key. $hookSecret = '08ajh0qj93209qj90jfq932j32r'; //Api key for pushing changelogs. @@ -49,21 +49,22 @@ set_exception_handler(function($e) { die(); }); $rawPost = NULL; -if ($hookSecret !== NULL) { - if (!isset($_SERVER['HTTP_X_HUB_SIGNATURE'])) { - throw new \Exception("HTTP header 'X-Hub-Signature' is missing."); - } elseif (!extension_loaded('hash')) { - throw new \Exception("Missing 'hash' extension to check the secret code validity."); - } - list($algo, $hash) = explode('=', $_SERVER['HTTP_X_HUB_SIGNATURE'], 2) + array('', ''); - if (!in_array($algo, hash_algos(), TRUE)) { - throw new \Exception("Hash algorithm '$algo' is not supported."); - } - $rawPost = file_get_contents('php://input'); - if ($hash !== hash_hmac($algo, $rawPost, $hookSecret)) { - throw new \Exception('Hook secret does not match.'); - } +if (!$hookSecret || $hookSecret == '08ajh0qj93209qj90jfq932j32r') + throw new \Exception("Hook secret is required and can not be default"); +if (!isset($_SERVER['HTTP_X_HUB_SIGNATURE'])) { + throw new \Exception("HTTP header 'X-Hub-Signature' is missing."); +} elseif (!extension_loaded('hash')) { + throw new \Exception("Missing 'hash' extension to check the secret code validity."); } +list($algo, $hash) = explode('=', $_SERVER['HTTP_X_HUB_SIGNATURE'], 2) + array('', ''); +if (!in_array($algo, hash_algos(), TRUE)) { + throw new \Exception("Hash algorithm '$algo' is not supported."); +} +$rawPost = file_get_contents('php://input'); +if ($hash !== hash_hmac($algo, $rawPost, $hookSecret)) { + throw new \Exception('Hook secret does not match.'); +} + $contenttype = null; //apache and nginx/fastcgi/phpfpm call this two different things. if (!isset($_SERVER['HTTP_CONTENT_TYPE'])) {