mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Splits beds and chairs
Adds deconstruct structure helper Moves chair sprites from objects.dmi to chairs.dmi Fixes check shields passing proper flags on unarmed attacks Makes stools and chairs able to be picked up
This commit is contained in:
@@ -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), \
|
||||
|
||||
@@ -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("<span class='notice'>[user] begins to tie a noose with the [src.name]'s cord! It looks like \he's trying to commit suicide.</span>")
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] is strangling \himself with the [src.name]'s cord! It looks like \he's trying to commit suicide.</span>")
|
||||
|
||||
@@ -43,3 +43,6 @@
|
||||
/obj/structure/ui_act(action, params)
|
||||
..()
|
||||
add_fingerprint(usr)
|
||||
|
||||
/obj/structure/proc/deconstruct(forced = FALSE)
|
||||
qdel(src)
|
||||
|
||||
@@ -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].", "<span class='notice'>You collapse \the [src.name].</span>")
|
||||
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].", "<span class='notice'>You collapse \the [src.name].</span>")
|
||||
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"
|
||||
@@ -1,27 +1,59 @@
|
||||
/obj/structure/bed/chair
|
||||
/obj/structure/chair
|
||||
name = "chair"
|
||||
desc = "You sit in this. Either by will or force.\n<span class='notice'>Alt-click to rotate it clockwise.</span>"
|
||||
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 << "<span class='warning'>You can't do that right now!</span>"
|
||||
@@ -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.\n<span class='notice'>Alt-click to rotate it clockwise.</span>"
|
||||
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("<span class='notice'>[usr] grabs \the [src.name].</span>", "<span class='notice'>You grab \the [src.name].</span>")
|
||||
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("<span class='notice'>[user] rights \the [src.name].</span>", "<span class='notice'>You right \the [src.name].</span>")
|
||||
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("<span class='danger'>[owner] fends off [attack_text] with [src]!</span>")
|
||||
return 1
|
||||
return 0
|
||||
@@ -1,34 +1,26 @@
|
||||
/obj/structure/bed/chair/e_chair
|
||||
/obj/structure/chair/e_chair
|
||||
name = "electric chair"
|
||||
desc = "Looks absolutely SHOCKING!\n<span class='notice'>Alt-click to rotate it clockwise.</span>"
|
||||
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 << "<span class='userdanger'>You feel a deep shock course through your body!</span>"
|
||||
sleep(1)
|
||||
buckled_mob.electrocute_act(85, src, 1)
|
||||
visible_message("<span class='danger'>The electric chair went off!</span>", "<span class='italics'>You hear a deep sharp shock!</span>")
|
||||
|
||||
A.power_light = light
|
||||
A.updateicon()
|
||||
return
|
||||
visible_message("<span class='danger'>The electric chair went off!</span>", "<span class='italics'>You hear a deep sharp shock!</span>")
|
||||
Reference in New Issue
Block a user