Files
Nadyr 592aacac6e -Adds as many colored couches as there are comfy chairs
-Reclassifies current couch as "old couch," still buildable
-Fixes the directions on the corner couch sprite to rotate like it should
2019-06-01 05:48:26 -05:00

362 lines
11 KiB
Plaintext

/obj/structure/bed/chair //YES, chairs are a type of bed, which are a type of stool. This works, believe me. -Pete
name = "chair"
desc = "You sit in this. Either by will or force."
icon = 'icons/obj/furniture_vr.dmi' //VOREStation Edit - Using Eris furniture
icon_state = "chair_preview"
color = "#666666"
base_icon = "chair"
buckle_dir = 0
buckle_lying = 0 //force people to sit up in chairs when buckled
var/propelled = 0 // Check for fire-extinguisher-driven chairs
/obj/structure/bed/chair/New()
..() //Todo make metal/stone chairs display as thrones
spawn(3) //sorry. i don't think there's a better way to do this.
update_layer()
return
/obj/structure/bed/chair/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(!padding_material && istype(W, /obj/item/assembly/shock_kit))
var/obj/item/assembly/shock_kit/SK = W
if(!SK.status)
user << "<span class='notice'>\The [SK] is not ready to be attached!</span>"
return
user.drop_item()
var/obj/structure/bed/chair/e_chair/E = new (src.loc, material.name)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
E.set_dir(dir)
E.part = SK
SK.loc = E
SK.master = E
qdel(src)
/obj/structure/bed/chair/attack_tk(mob/user as mob)
if(has_buckled_mobs())
..()
else
rotate()
return
/obj/structure/bed/chair/post_buckle_mob()
update_icon()
/obj/structure/bed/chair/update_icon()
..()
if(has_buckled_mobs() && padding_material)
var/cache_key = "[base_icon]-armrest-[padding_material.name]"
if(isnull(stool_cache[cache_key]))
var/image/I = image(icon, "[base_icon]_armrest")
I.layer = MOB_LAYER + 0.1
I.plane = MOB_PLANE
I.color = padding_material.icon_colour
stool_cache[cache_key] = I
overlays |= stool_cache[cache_key]
/obj/structure/bed/chair/proc/update_layer()
if(src.dir == NORTH)
plane = MOB_PLANE
layer = MOB_LAYER + 0.1
else
reset_plane_and_layer()
/obj/structure/bed/chair/set_dir()
..()
update_layer()
if(has_buckled_mobs())
for(var/A in buckled_mobs)
var/mob/living/L = A
L.set_dir(dir)
/obj/structure/bed/chair/verb/rotate()
set name = "Rotate Chair"
set category = "Object"
set src in oview(1)
if(config.ghost_interaction)
src.set_dir(turn(src.dir, 90))
return
else
if(istype(usr,/mob/living/simple_animal/mouse))
return
if(!usr || !isturf(usr.loc))
return
if(usr.stat || usr.restrained())
return
src.set_dir(turn(src.dir, 90))
return
/obj/structure/bed/chair/shuttle
name = "chair"
desc = "You sit in this. Either by will or force."
icon_state = "shuttle_chair"
color = null
base_icon = "shuttle_chair"
applies_material_colour = 0
// Leaving this in for the sake of compilation.
/obj/structure/bed/chair/comfy
desc = "It's a chair. It looks comfy."
icon_state = "comfychair_preview"
/obj/structure/bed/chair/comfy/brown/New(var/newloc,var/newmaterial)
..(newloc,"steel","leather")
/obj/structure/bed/chair/comfy/red/New(var/newloc,var/newmaterial)
..(newloc,"steel","carpet")
/obj/structure/bed/chair/comfy/teal/New(var/newloc,var/newmaterial)
..(newloc,"steel","teal")
/obj/structure/bed/chair/comfy/black/New(var/newloc,var/newmaterial)
..(newloc,"steel","black")
/obj/structure/bed/chair/comfy/green/New(var/newloc,var/newmaterial)
..(newloc,"steel","green")
/obj/structure/bed/chair/comfy/purp/New(var/newloc,var/newmaterial)
..(newloc,"steel","purple")
/obj/structure/bed/chair/comfy/blue/New(var/newloc,var/newmaterial)
..(newloc,"steel","blue")
/obj/structure/bed/chair/comfy/beige/New(var/newloc,var/newmaterial)
..(newloc,"steel","beige")
/obj/structure/bed/chair/comfy/lime/New(var/newloc,var/newmaterial)
..(newloc,"steel","lime")
/obj/structure/bed/chair/office
anchored = 0
buckle_movable = 1
/obj/structure/bed/chair/office/update_icon()
return
/obj/structure/bed/chair/office/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/stack) || istype(W, /obj/item/weapon/wirecutters))
return
..()
/obj/structure/bed/chair/office/Move()
..()
if(has_buckled_mobs())
for(var/A in buckled_mobs)
var/mob/living/occupant = A
occupant.buckled = null
occupant.Move(src.loc)
occupant.buckled = src
if (occupant && (src.loc != occupant.loc))
if (propelled)
for (var/mob/O in src.loc)
if (O != occupant)
Bump(O)
else
unbuckle_mob()
/obj/structure/bed/chair/office/Bump(atom/A)
..()
if(!has_buckled_mobs()) return
if(propelled)
for(var/a in buckled_mobs)
var/mob/living/occupant = unbuckle_mob(a)
var/def_zone = ran_zone()
var/blocked = occupant.run_armor_check(def_zone, "melee")
var/soaked = occupant.get_armor_soak(def_zone, "melee")
occupant.throw_at(A, 3, propelled)
occupant.apply_effect(6, STUN, blocked)
occupant.apply_effect(6, WEAKEN, blocked)
occupant.apply_effect(6, STUTTER, blocked)
occupant.apply_damage(10, BRUTE, def_zone, blocked, soaked)
playsound(src.loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
if(istype(A, /mob/living))
var/mob/living/victim = A
def_zone = ran_zone()
blocked = victim.run_armor_check(def_zone, "melee")
soaked = victim.get_armor_soak(def_zone, "melee")
victim.apply_effect(6, STUN, blocked)
victim.apply_effect(6, WEAKEN, blocked)
victim.apply_effect(6, STUTTER, blocked)
victim.apply_damage(10, BRUTE, def_zone, blocked, soaked)
occupant.visible_message("<span class='danger'>[occupant] crashed into \the [A]!</span>")
/obj/structure/bed/chair/office/light
icon_state = "officechair_white"
/obj/structure/bed/chair/office/dark
icon_state = "officechair_dark"
/obj/structure/bed/chair/oldsofa //Original Paradise port kept in the event players like these couches.
name = "sofa"
desc = "It's a couch. It looks kinda dingy."
icon_state = "sofamiddleOLD"
base_icon = "sofamiddleOLD"
applies_material_colour = 0
/obj/structure/bed/chair/oldsofa/left
icon_state = "sofaend_leftOLD"
base_icon = "sofaend_leftOLD"
/obj/structure/bed/chair/oldsofa/right
icon_state = "sofaend_rightOLD"
base_icon = "sofaend_rightOLD"
/obj/structure/bed/chair/oldsofa/corner
icon_state = "sofacornerOLD"
base_icon = "sofacornerOLD"
//Middle couch pieces.
/obj/structure/bed/chair/sofa
name = "sofa"
desc = "It's a couch. It looks comfy."
icon_state = "sofamiddle"
base_icon = "sofamiddle"
/obj/structure/bed/chair/sofa/brown/New(var/newloc,var/newmaterial)
..(newloc,"steel","leather")
/obj/structure/bed/chair/sofa/red/New(var/newloc,var/newmaterial)
..(newloc,"steel","carpet")
/obj/structure/bed/chair/sofa/teal/New(var/newloc,var/newmaterial)
..(newloc,"steel","teal")
/obj/structure/bed/chair/sofa/black/New(var/newloc,var/newmaterial)
..(newloc,"steel","black")
/obj/structure/bed/chair/sofa/green/New(var/newloc,var/newmaterial)
..(newloc,"steel","green")
/obj/structure/bed/chair/sofa/purp/New(var/newloc,var/newmaterial)
..(newloc,"steel","purple")
/obj/structure/bed/chair/sofa/blue/New(var/newloc,var/newmaterial)
..(newloc,"steel","blue")
/obj/structure/bed/chair/sofa/beige/New(var/newloc,var/newmaterial)
..(newloc,"steel","beige")
/obj/structure/bed/chair/sofa/lime/New(var/newloc,var/newmaterial)
..(newloc,"steel","lime")
//Left couch pieces.
/obj/structure/bed/chair/sofa/left
icon_state = "sofaend_left"
base_icon = "sofaend_left"
/obj/structure/bed/chair/sofa/left/brown/New(var/newloc,var/newmaterial)
..(newloc,"steel","leather")
/obj/structure/bed/chair/sofa/left/red/New(var/newloc,var/newmaterial)
..(newloc,"steel","carpet")
/obj/structure/bed/chair/sofa/left/teal/New(var/newloc,var/newmaterial)
..(newloc,"steel","teal")
/obj/structure/bed/chair/sofa/left/black/New(var/newloc,var/newmaterial)
..(newloc,"steel","black")
/obj/structure/bed/chair/sofa/left/green/New(var/newloc,var/newmaterial)
..(newloc,"steel","green")
/obj/structure/bed/chair/sofa/left/purp/New(var/newloc,var/newmaterial)
..(newloc,"steel","purple")
/obj/structure/bed/chair/sofa/left/blue/New(var/newloc,var/newmaterial)
..(newloc,"steel","blue")
/obj/structure/bed/chair/sofa/left/beige/New(var/newloc,var/newmaterial)
..(newloc,"steel","beige")
/obj/structure/bed/chair/sofa/left/lime/New(var/newloc,var/newmaterial)
..(newloc,"steel","lime")
//Right couch pieces.
/obj/structure/bed/chair/sofa/right
icon_state = "sofaend_right"
base_icon = "sofaend_right"
/obj/structure/bed/chair/sofa/right/brown/New(var/newloc,var/newmaterial)
..(newloc,"steel","leather")
/obj/structure/bed/chair/sofa/right/red/New(var/newloc,var/newmaterial)
..(newloc,"steel","carpet")
/obj/structure/bed/chair/sofa/right/teal/New(var/newloc,var/newmaterial)
..(newloc,"steel","teal")
/obj/structure/bed/chair/sofa/right/black/New(var/newloc,var/newmaterial)
..(newloc,"steel","black")
/obj/structure/bed/chair/sofa/right/green/New(var/newloc,var/newmaterial)
..(newloc,"steel","green")
/obj/structure/bed/chair/sofa/right/purp/New(var/newloc,var/newmaterial)
..(newloc,"steel","purple")
/obj/structure/bed/chair/sofa/right/blue/New(var/newloc,var/newmaterial)
..(newloc,"steel","blue")
/obj/structure/bed/chair/sofa/right/beige/New(var/newloc,var/newmaterial)
..(newloc,"steel","beige")
/obj/structure/bed/chair/sofa/right/lime/New(var/newloc,var/newmaterial)
..(newloc,"steel","lime")
//Corner couch pieces.
/obj/structure/bed/chair/sofa/corner
icon_state = "sofacorner"
base_icon = "sofacorner"
/obj/structure/bed/chair/sofa/corner/brown/New(var/newloc,var/newmaterial)
..(newloc,"steel","leather")
/obj/structure/bed/chair/sofa/corner/red/New(var/newloc,var/newmaterial)
..(newloc,"steel","carpet")
/obj/structure/bed/chair/sofa/corner/teal/New(var/newloc,var/newmaterial)
..(newloc,"steel","teal")
/obj/structure/bed/chair/sofa/corner/black/New(var/newloc,var/newmaterial)
..(newloc,"steel","black")
/obj/structure/bed/chair/sofa/corner/green/New(var/newloc,var/newmaterial)
..(newloc,"steel","green")
/obj/structure/bed/chair/sofa/corner/purp/New(var/newloc,var/newmaterial)
..(newloc,"steel","purple")
/obj/structure/bed/chair/sofa/corner/blue/New(var/newloc,var/newmaterial)
..(newloc,"steel","blue")
/obj/structure/bed/chair/sofa/corner/beige/New(var/newloc,var/newmaterial)
..(newloc,"steel","beige")
/obj/structure/bed/chair/sofa/corner/lime/New(var/newloc,var/newmaterial)
..(newloc,"steel","lime")
// Chair types
/obj/structure/bed/chair/wood
name = "wooden chair"
desc = "Old is never too old to not be in fashion."
icon_state = "wooden_chair"
/obj/structure/bed/chair/wood/update_icon()
return
/obj/structure/bed/chair/wood/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/stack) || istype(W, /obj/item/weapon/wirecutters))
return
..()
/obj/structure/bed/chair/wood/New(var/newloc)
..(newloc, "wood")
/obj/structure/bed/chair/wood/wings
icon_state = "wooden_chair_wings"