diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 619503cd778..bc01ac315ed 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -12,10 +12,10 @@ * Metal */ var/global/list/datum/stack_recipe/metal_recipes = list ( \ - new/datum/stack_recipe("stool", /obj/structure/bed/stool, one_per_turf = 1, on_floor = 1), \ - new/datum/stack_recipe("chair", /obj/structure/bed/chair, one_per_turf = 1, on_floor = 1), \ - new/datum/stack_recipe("swivel chair", /obj/structure/bed/chair/office/dark, 5, one_per_turf = 1, on_floor = 1), \ - new/datum/stack_recipe("comfy chair", /obj/structure/bed/chair/comfy/beige, 2, one_per_turf = 1, on_floor = 1), \ + new/datum/stack_recipe("stool", /obj/structure/chair/stool, one_per_turf = 1, on_floor = 1), \ + new/datum/stack_recipe("chair", /obj/structure/chair, one_per_turf = 1, on_floor = 1), \ + new/datum/stack_recipe("swivel chair", /obj/structure/chair/office/dark, 5, one_per_turf = 1, on_floor = 1), \ + new/datum/stack_recipe("comfy chair", /obj/structure/chair/comfy/beige, 2, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("bed", /obj/structure/bed, 2, one_per_turf = 1, on_floor = 1), \ null, \ new/datum/stack_recipe("rack parts", /obj/item/weapon/rack_parts), \ @@ -105,7 +105,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list ( \ new/datum/stack_recipe("wood floor tile", /obj/item/stack/tile/wood, 1, 4, 20), \ new/datum/stack_recipe("wood table frame", /obj/structure/table_frame/wood, 2, time = 10), \ new/datum/stack_recipe("rifle stock", /obj/item/weaponcrafting/stock, 10, time = 40), \ - new/datum/stack_recipe("wooden chair", /obj/structure/bed/chair/wood/normal, 3, time = 10, one_per_turf = 1, on_floor = 1), \ + new/datum/stack_recipe("wooden chair", /obj/structure/chair/wood/normal, 3, time = 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("wooden barricade", /obj/structure/barricade/wooden, 5, time = 50, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("wooden door", /obj/structure/mineral_door/wood, 10, time = 20, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("coffin", /obj/structure/closet/coffin, 5, time = 15, one_per_turf = 1, on_floor = 1), \ diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 16a35ee3cc1..382d28f2af2 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -195,7 +195,7 @@ hitsound = 'sound/weapons/ring.ogg' /obj/item/weapon/phone/suicide_act(mob/user) - if(locate(/obj/structure/bed/stool) in user.loc) + if(locate(/obj/structure/chair/stool) in user.loc) user.visible_message("[user] begins to tie a noose with the [src.name]'s cord! It looks like \he's trying to commit suicide.") else user.visible_message("[user] is strangling \himself with the [src.name]'s cord! It looks like \he's trying to commit suicide.") diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 513270b677b..b94f10a3805 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -43,3 +43,6 @@ /obj/structure/ui_act(action, params) ..() add_fingerprint(usr) + +/obj/structure/proc/deconstruct(forced = FALSE) + qdel(src) diff --git a/code/game/objects/structures/beds_chairs/bed.dm b/code/game/objects/structures/beds_chairs/bed.dm index 712d76482a4..d94cd078c99 100644 --- a/code/game/objects/structures/beds_chairs/bed.dm +++ b/code/game/objects/structures/beds_chairs/bed.dm @@ -19,20 +19,18 @@ burntime = 30 var/buildstacktype = /obj/item/stack/sheet/metal var/buildstackamount = 2 - var/foldabletype //to fold into an item (e.g. roller bed item) -/obj/structure/bed/alien - name = "resting contraption" - desc = "This looks similar to contraptions from earth. Could aliens be stealing our technology?" - icon_state = "abed" +/obj/structure/bed/deconstruct() + if(buildstacktype) + new buildstacktype(loc,buildstackamount) + ..() /obj/structure/bed/attack_paw(mob/user) - return src.attack_hand(user) + return attack_hand(user) /obj/structure/bed/attack_animal(mob/living/simple_animal/M)//No more buckling hostile mobs to chairs to render them immobile forever if(M.environment_smash) - new /obj/item/stack/sheet/metal(src.loc) - qdel(src) + deconstruct() /obj/structure/bed/ex_act(severity, target) switch(severity) @@ -41,42 +39,17 @@ return if(2) if(prob(70)) - if(buildstacktype) - new buildstacktype(loc, buildstackamount) - qdel(src) + deconstruct() return if(3) if(prob(50)) - if(buildstacktype) - new buildstacktype(loc, buildstackamount) - qdel(src) + deconstruct() return -/obj/structure/bed/blob_act() - if(buildstacktype) - new buildstacktype(loc, buildstackamount) - qdel(src) - /obj/structure/bed/attackby(obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/weapon/wrench) && !(flags&NODECONSTRUCT)) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - if(buildstacktype) - new buildstacktype(loc, buildstackamount) - qdel(src) - -/obj/structure/bed/MouseDrop(over_object, src_location, over_location) - . = ..() - if(foldabletype) - if(over_object == usr && Adjacent(usr) && (in_range(src, usr) || usr.contents.Find(src))) - if(!ishuman(usr)) - return - if(buckled_mob) - return 0 - usr.visible_message("[usr] collapses \the [src.name].", "You collapse \the [src.name].") - new foldabletype(get_turf(src)) - qdel(src) - - + deconstruct() /* * Roller beds @@ -87,7 +60,18 @@ icon_state = "down" anchored = 0 burn_state = FIRE_PROOF - foldabletype = /obj/item/roller + var/foldabletype = /obj/item/roller + +/obj/structure/bed/roller/MouseDrop(over_object, src_location, over_location) + . = ..() + if(over_object == usr && Adjacent(usr)) + if(!ishuman(usr)) + return + if(buckled_mob) + return 0 + usr.visible_message("[usr] collapses \the [src.name].", "You collapse \the [src.name].") + new foldabletype(get_turf(src)) + qdel(src) /obj/structure/bed/roller/post_buckle_mob(mob/living/M) if(M == buckled_mob) @@ -165,13 +149,7 @@ buildstackamount = 10 -//Stool - -/obj/structure/bed/stool - name = "stool" - desc = "Apply butt." - icon_state = "stool" - can_buckle = 0 - buildstackamount = 1 - - +/obj/structure/bed/alien + name = "resting contraption" + desc = "This looks similar to contraptions from earth. Could aliens be stealing our technology?" + icon_state = "abed" \ No newline at end of file diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 1b1799e4719..bbeeac7535f 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -1,27 +1,59 @@ -/obj/structure/bed/chair +/obj/structure/chair name = "chair" desc = "You sit in this. Either by will or force.\nAlt-click to rotate it clockwise." + icon = 'icons/obj/chairs.dmi' icon_state = "chair" + anchored = 1 + can_buckle = 1 buckle_lying = 0 //you sit in a chair, not lay burn_state = FIRE_PROOF - buildstackamount = 1 + var/buildstacktype = /obj/item/stack/sheet/metal + var/buildstackamount = 1 + var/hold_icon = "chair" // if null it can't be picked up -/obj/structure/bed/chair/New() +/obj/structure/chair/New() ..() - spawn(3) //sorry. i don't think there's a better way to do this. - handle_layer() + handle_layer() -/obj/structure/bed/chair/Move(atom/newloc, direct) +/obj/structure/chair/deconstruct() + if(buildstacktype) + new buildstacktype(loc,buildstackamount) + ..() + +/obj/structure/chair/attack_paw(mob/user) + return attack_hand(user) + +/obj/structure/chair/attack_animal(mob/living/simple_animal/M)//No more buckling hostile mobs to chairs to render them immobile forever + if(M.environment_smash) + deconstruct() + +/obj/structure/chair/Move(atom/newloc, direct) ..() handle_rotation() -/obj/structure/bed/chair/attackby(obj/item/weapon/W, mob/user, params) - ..() - if(istype(W, /obj/item/assembly/shock_kit)) +/obj/structure/chair/ex_act(severity, target) + switch(severity) + if(1) + qdel(src) + return + if(2) + if(prob(70)) + deconstruct() + return + if(3) + if(prob(50)) + deconstruct() + return + +/obj/structure/chair/attackby(obj/item/weapon/W, mob/user, params) + if(istype(W, /obj/item/weapon/wrench) && !(flags&NODECONSTRUCT)) + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + deconstruct() + else if(istype(W, /obj/item/assembly/shock_kit)) if(!user.drop_item()) return var/obj/item/assembly/shock_kit/SK = W - var/obj/structure/bed/chair/e_chair/E = new /obj/structure/bed/chair/e_chair(src.loc) + var/obj/structure/chair/e_chair/E = new /obj/structure/chair/e_chair(src.loc) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) E.dir = dir E.part = SK @@ -29,14 +61,14 @@ SK.master = E qdel(src) -/obj/structure/bed/chair/attack_tk(mob/user) +/obj/structure/chair/attack_tk(mob/user) if(buckled_mob) ..() else rotate() return -/obj/structure/bed/chair/proc/handle_rotation(direction) +/obj/structure/chair/proc/handle_rotation(direction) if(buckled_mob) buckled_mob.buckled = null //Temporary, so Move() succeeds. if(!direction || !buckled_mob.Move(get_step(src, direction), direction)) @@ -47,19 +79,19 @@ handle_layer() return 1 -/obj/structure/bed/chair/proc/handle_layer() +/obj/structure/chair/proc/handle_layer() if(dir == NORTH) - src.layer = FLY_LAYER + layer = FLY_LAYER else - src.layer = OBJ_LAYER + layer = OBJ_LAYER -/obj/structure/bed/chair/proc/spin() - src.dir = turn(src.dir, 90) +/obj/structure/chair/proc/spin() + dir = turn(dir, 90) handle_layer() if(buckled_mob) buckled_mob.dir = dir -/obj/structure/bed/chair/verb/rotate() +/obj/structure/chair/verb/rotate() set name = "Rotate Chair" set category = "Object" set src in oview(1) @@ -73,7 +105,7 @@ return spin() -/obj/structure/bed/chair/AltClick(mob/user) +/obj/structure/chair/AltClick(mob/user) ..() if(user.incapacitated()) user << "You can't do that right now!" @@ -84,23 +116,24 @@ rotate() // Chair types -/obj/structure/bed/chair/wood +/obj/structure/chair/wood burn_state = FLAMMABLE burntime = 20 buildstacktype = /obj/item/stack/sheet/mineral/wood buildstackamount = 3 + hold_icon = null -/obj/structure/bed/chair/wood/normal +/obj/structure/chair/wood/normal icon_state = "wooden_chair" name = "wooden chair" desc = "Old is never too old to not be in fashion." -/obj/structure/bed/chair/wood/wings +/obj/structure/chair/wood/wings icon_state = "wooden_chair_wings" name = "wooden chair" desc = "Old is never too old to not be in fashion." -/obj/structure/bed/chair/comfy +/obj/structure/chair/comfy name = "comfy chair" desc = "It looks comfy.\nAlt-click to rotate it clockwise." icon_state = "comfychair" @@ -109,41 +142,100 @@ burntime = 30 buildstackamount = 2 var/image/armrest = null + hold_icon = null -/obj/structure/bed/chair/comfy/New() - armrest = image("icons/obj/objects.dmi", "comfychair_armrest") +/obj/structure/chair/comfy/New() + armrest = image("icons/obj/chairs.dmi", "comfychair_armrest") armrest.layer = MOB_LAYER + 0.1 return ..() -/obj/structure/bed/chair/comfy/post_buckle_mob(mob/living/M) +/obj/structure/chair/comfy/post_buckle_mob(mob/living/M) if(buckled_mob) overlays += armrest else overlays -= armrest -/obj/structure/bed/chair/comfy/brown +/obj/structure/chair/comfy/brown color = rgb(255,113,0) -/obj/structure/bed/chair/comfy/beige +/obj/structure/chair/comfy/beige color = rgb(255,253,195) -/obj/structure/bed/chair/comfy/teal +/obj/structure/chair/comfy/teal color = rgb(0,255,255) -/obj/structure/bed/chair/comfy/black +/obj/structure/chair/comfy/black color = rgb(167,164,153) -/obj/structure/bed/chair/comfy/lime +/obj/structure/chair/comfy/lime color = rgb(255,251,0) -/obj/structure/bed/chair/office +/obj/structure/chair/office anchored = 0 buildstackamount = 5 + hold_icon = null -/obj/structure/bed/chair/office/light +/obj/structure/chair/office/light icon_state = "officechair_white" -/obj/structure/bed/chair/office/dark +/obj/structure/chair/office/dark icon_state = "officechair_dark" + +//Stool + +/obj/structure/chair/stool + name = "stool" + desc = "Apply butt." + icon_state = "stool" + can_buckle = 0 + buildstackamount = 1 + hold_icon = "stool" + +/obj/structure/chair/MouseDrop(over_object, src_location, over_location) + . = ..() + if(over_object == usr && Adjacent(usr)) + if(!hold_icon || !ishuman(usr) || buckled_mob) + return + usr.visible_message("[usr] grabs \the [src.name].", "You grab \the [src.name].") + var/obj/item/chair/C = new /obj/item/chair(get_turf(src),src) + usr.put_in_hands(C) + qdel(src) + +/obj/item/chair + name = "chair" + desc = "Bar brawl essential." + w_class = 5 + force = 8 + throwforce = 10 + throw_range = 3 + + var/origin_type = /obj/structure/chair + +/obj/item/chair/New(loc,obj/structure/chair/origin) + ..() + name = origin.name + icon = origin.icon + icon_state = "[origin.icon_state]_toppled" + item_state = origin.hold_icon + origin_type = origin.type + hit_reaction_chance = 50 + +/obj/item/chair/attack_hand(mob/user) + if(user.a_intent == "help") + user.visible_message("[user] rights \the [src.name].", "You right \the [src.name].") + plant() + else + ..() + +/obj/item/chair/proc/plant() + var/obj/structure/chair/C = new origin_type(get_turf(loc)) + C.dir = dir + qdel(src) + +/obj/item/chair/hit_reaction(mob/living/carbon/human/owner, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) + if(attack_type == UNARMED_ATTACK && prob(hit_reaction_chance)) + owner.visible_message("[owner] fends off [attack_text] with [src]!") + return 1 + return 0 \ No newline at end of file diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm index 019e596c5db..b89e7357ab5 100644 --- a/code/game/objects/structures/electricchair.dm +++ b/code/game/objects/structures/electricchair.dm @@ -1,34 +1,26 @@ -/obj/structure/bed/chair/e_chair +/obj/structure/chair/e_chair name = "electric chair" desc = "Looks absolutely SHOCKING!\nAlt-click to rotate it clockwise." icon_state = "echair0" var/obj/item/assembly/shock_kit/part = null var/last_time = 1 + hold_icon = null -/obj/structure/bed/chair/e_chair/New() +/obj/structure/chair/e_chair/New() ..() - overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir) - return + overlays += image('icons/obj/chairs.dmi', src, "echair_over", MOB_LAYER + 1) -/obj/structure/bed/chair/e_chair/attackby(obj/item/weapon/W, mob/user, params) +/obj/structure/chair/e_chair/attackby(obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/weapon/wrench)) - var/obj/structure/bed/chair/C = new /obj/structure/bed/chair(loc) + var/obj/structure/chair/C = new /obj/structure/chair(loc) playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) C.dir = dir - part.loc = src.loc + part.loc = loc part.master = null part = null qdel(src) - return - return -/obj/structure/bed/chair/e_chair/rotate() - ..() - overlays.Cut() - overlays += image('icons/obj/objects.dmi', src, "echair_over", MOB_LAYER + 1, dir) //there's probably a better way of handling this, but eh. -Pete - return - -/obj/structure/bed/chair/e_chair/proc/shock() +/obj/structure/chair/e_chair/proc/shock() if(last_time + 50 > world.time) return last_time = world.time @@ -40,10 +32,8 @@ if(!A.powered(EQUIP)) return A.use_power(EQUIP, 5000) - var/light = A.power_light - A.updateicon() - flick("echair1", src) + flick("echair_shock", src) var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(12, 1, src) s.start() @@ -52,8 +42,4 @@ buckled_mob << "You feel a deep shock course through your body!" sleep(1) buckled_mob.electrocute_act(85, src, 1) - visible_message("The electric chair went off!", "You hear a deep sharp shock!") - - A.power_light = light - A.updateicon() - return \ No newline at end of file + visible_message("The electric chair went off!", "You hear a deep sharp shock!") \ No newline at end of file diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm index f3f37d911a0..6637d3667f0 100644 --- a/code/modules/assembly/shock_kit.dm +++ b/code/modules/assembly/shock_kit.dm @@ -36,7 +36,7 @@ return /obj/item/assembly/shock_kit/receive_signal() - if(istype(loc, /obj/structure/bed/chair/e_chair)) - var/obj/structure/bed/chair/e_chair/C = loc + if(istype(loc, /obj/structure/chair/e_chair)) + var/obj/structure/chair/e_chair/C = loc C.shock() return diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm index d8c03fe3c8f..7663c49114d 100644 --- a/code/modules/holodeck/items.dm +++ b/code/modules/holodeck/items.dm @@ -88,18 +88,6 @@ // Structures // -/obj/structure/stool/bed/chair/holo/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W,/obj/item/weapon/wrench)) - user << "It's holographic! There's no taking it apart." - return - ..() - -/obj/structure/stool/bed/chair/holo/comfy - name = "comfy chair" - desc = "It looks comfy." - icon_state = "comfychair" - color = rgb(255,113,0) - /obj/structure/holohoop name = "basketball hoop" desc = "Boom, shakalaka!" diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 2bc0f1ca913..7a2020ef621 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -217,11 +217,11 @@ new /obj/item/weapon/storage/pill_bottle/dice(cur_turf) cur_turf = locate(start_turf.x+1, start_turf.y-1, start_turf.z) - var/obj/structure/bed/chair/comfy/C = new /obj/structure/bed/chair/comfy(cur_turf) + var/obj/structure/chair/comfy/C = new /obj/structure/chair/comfy(cur_turf) C.dir = 1 cur_turf = locate(start_turf.x+1, start_turf.y+1, start_turf.z) - new /obj/structure/bed/chair/comfy(cur_turf) + new /obj/structure/chair/comfy(cur_turf) cur_turf = locate(start_turf.x-1, start_turf.y-1, start_turf.z) var/obj/machinery/sleeper/S = new /obj/machinery/sleeper(cur_turf) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index e8ea256c06a..d789d65410a 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -813,7 +813,7 @@ /datum/species/proc/spec_attack_hand(mob/living/carbon/human/M, mob/living/carbon/human/H) if(!istype(M)) //sanity check for drones. return - if((M != H) && M.a_intent != "help" && H.check_shields(0, M.name)) + if((M != H) && M.a_intent != "help" && H.check_shields(0, M.name, attack_type = UNARMED_ATTACK)) add_logs(M, H, "attempted to touch") H.visible_message("[M] attempted to touch [H]!") return 0 diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 67c109f2d38..86986001a05 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -490,7 +490,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \ update_icon() /obj/item/stack/cable_coil/suicide_act(mob/user) - if(locate(/obj/structure/bed/stool) in user.loc) + if(locate(/obj/structure/chair/stool) in get_turf(user)) user.visible_message("[user] is making a noose with the [src.name]! It looks like \he's trying to commit suicide.") else user.visible_message("[user] is strangling \himself with the [src.name]! It looks like \he's trying to commit suicide.") diff --git a/code/modules/procedural mapping/mapGenerators/syndicate.dm b/code/modules/procedural mapping/mapGenerators/syndicate.dm index a9fe00c8b6d..21055e8ebe4 100644 --- a/code/modules/procedural mapping/mapGenerators/syndicate.dm +++ b/code/modules/procedural mapping/mapGenerators/syndicate.dm @@ -14,7 +14,7 @@ /datum/mapGeneratorModule/syndieFurniture clusterCheckFlags = CLUSTER_CHECK_ALL spawnableTurfs = list() - spawnableAtoms = list(/obj/structure/table = 20,/obj/structure/bed/chair = 15,/obj/structure/bed/stool = 10, \ + spawnableAtoms = list(/obj/structure/table = 20,/obj/structure/chair = 15,/obj/structure/chair/stool = 10, \ /obj/structure/computerframe = 15, /obj/item/weapon/storage/toolbox/syndicate = 15 ,\ /obj/structure/closet/syndicate = 25, /obj/machinery/suit_storage_unit/syndicate = 15) diff --git a/icons/mob/inhands/items_lefthand.dmi b/icons/mob/inhands/items_lefthand.dmi index cc5d4e85bcc..a30af54b015 100644 Binary files a/icons/mob/inhands/items_lefthand.dmi and b/icons/mob/inhands/items_lefthand.dmi differ diff --git a/icons/mob/inhands/items_righthand.dmi b/icons/mob/inhands/items_righthand.dmi index 02e9868c180..822a4fc5a4a 100644 Binary files a/icons/mob/inhands/items_righthand.dmi and b/icons/mob/inhands/items_righthand.dmi differ diff --git a/icons/obj/chairs.dmi b/icons/obj/chairs.dmi new file mode 100644 index 00000000000..4a1444d4372 Binary files /dev/null and b/icons/obj/chairs.dmi differ diff --git a/icons/obj/objects.dmi b/icons/obj/objects.dmi index 2162d2f8210..9a3e8194f4b 100644 Binary files a/icons/obj/objects.dmi and b/icons/obj/objects.dmi differ