Merge branch 'dev' into ofClicksAndCooldowns

Conflicts:
	code/game/turfs/simulated/walls.dm
	code/modules/mob/living/carbon/resist.dm
	code/modules/mob/mob_grab.dm
This commit is contained in:
Kelenius
2015-05-21 17:00:50 +03:00
581 changed files with 11886 additions and 16041 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
icon = 'icons/obj/coatrack.dmi'
icon_state = "coatrack0"
var/obj/item/clothing/suit/coat
var/list/allowed = list(/obj/item/clothing/suit/storage/labcoat, /obj/item/clothing/suit/storage/toggle/labcoat, /obj/item/clothing/suit/storage/det_suit)
var/list/allowed = list(/obj/item/clothing/suit/storage/toggle/labcoat, /obj/item/clothing/suit/storage/det_suit)
/obj/structure/coatrack/attack_hand(mob/user as mob)
user.visible_message("[user] takes [coat] off \the [src].", "You take [coat] off the \the [src]")
@@ -24,9 +24,39 @@
/obj/structure/closet/initialize()
if(!opened) // if closed, any item at the crate's loc is put in the contents
for(var/obj/item/I in src.loc)
var/obj/item/I
for(I in src.loc)
if(I.density || I.anchored || I == src) continue
I.loc = src
// adjust locker size to hold all items with 5 units of free store room
var/content_size = 0
for(I in src.contents)
content_size += Ceiling(I.w_class/2)
if(content_size > storage_capacity-5)
storage_capacity = content_size + 5
/obj/structure/closet/examine(mob/user)
if(get_dist(src, user) > 1)
return ..(user)
if(opened)
var/content_size = 0
for(var/obj/item/I in src.contents)
if(!I.anchored)
content_size += Ceiling(I.w_class/2)
if(!content_size)
user << "It is empty."
else if(storage_capacity > content_size*4)
user << "It is barely filled."
else if(storage_capacity > content_size*2)
user << "It is less than half full."
else if(storage_capacity > content_size)
user << "There is still some free space."
else
user << "It is full."
/obj/structure/closet/alter_health()
return get_turf(src)
@@ -332,25 +362,25 @@
//okay, so the closet is either welded or locked... resist!!!
escapee << "<span class='warning'>You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)</span>"
visible_message("<span class='danger'>The [src] begins to shake violently!</span>")
breakout = 1 //can't think of a better way to do this right now.
for(var/i in 1 to (6*breakout_time * 2)) //minutes * 6 * 5seconds * 2
playsound(src.loc, 'sound/effects/grillehit.ogg', 100, 1)
animate_shake()
if(!do_after(escapee, 50)) //5 seconds
breakout = 0
return
if(!escapee || escapee.stat || escapee.loc != src)
if(!escapee || escapee.stat || escapee.loc != src)
breakout = 0
return //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
//Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
if(!req_breakout())
breakout = 0
return
//Well then break it!
breakout = 0
escapee << "<span class='warning'>You successfully break out!</span>"
@@ -7,7 +7,7 @@
icon_opened = "medicalopen"
icon_broken = "medicalbroken"
icon_off = "medicaloff"
req_access = list(access_medical)
req_access = list(access_medical_equip)
New()
@@ -52,7 +52,7 @@
/obj/structure/closet/secure_closet/medical3
name = "medical doctor's locker"
req_access = list(access_medical)
req_access = list(access_medical_equip)
icon_state = "securemed1"
icon_closed = "securemed"
icon_locked = "securemed1"
@@ -187,7 +187,7 @@
anchored = 1
density = 0
wall_mounted = 1
req_access = list(access_medical)
req_access = list(access_medical_equip)
/obj/structure/closet/secure_closet/medical_wall/update_icon()
if(broken)
@@ -166,7 +166,7 @@
/obj/structure/closet/secure_closet/security
name = "security officer's locker"
req_access = list(access_security)
req_access = list(access_brig)
icon_state = "sec1"
icon_closed = "sec"
icon_locked = "sec1"
@@ -286,8 +286,8 @@
New()
..()
new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src)
new /obj/item/weapon/reagent_containers/ld50_syringe/choral(src)
new /obj/item/weapon/reagent_containers/syringe/ld50_syringe/choral(src)
new /obj/item/weapon/reagent_containers/syringe/ld50_syringe/choral(src)
return
@@ -23,44 +23,7 @@
return attack_hand(user)
/obj/structure/largecrate/mule
icon_state = "mulecrate"
/obj/structure/largecrate/lisa
icon_state = "lisacrate"
/obj/structure/largecrate/lisa/attackby(obj/item/weapon/W as obj, mob/user as mob) //ugly but oh well
if(istype(W, /obj/item/weapon/crowbar))
new /mob/living/simple_animal/corgi/Lisa(loc)
..()
/obj/structure/largecrate/cow
name = "cow crate"
icon_state = "lisacrate"
/obj/structure/largecrate/cow/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/crowbar))
new /mob/living/simple_animal/cow(loc)
..()
/obj/structure/largecrate/goat
name = "goat crate"
icon_state = "lisacrate"
/obj/structure/largecrate/goat/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/crowbar))
new /mob/living/simple_animal/hostile/retaliate/goat(loc)
..()
/obj/structure/largecrate/chick
name = "chicken crate"
icon_state = "lisacrate"
/obj/structure/largecrate/chick/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/crowbar))
var/num = rand(4, 6)
for(var/i = 0, i < num, i++)
new /mob/living/simple_animal/chick(loc)
..()
name = "MULE crate"
/obj/structure/largecrate/hoverpod
name = "\improper Hoverpod assembly crate"
@@ -71,9 +34,43 @@
if(istype(W, /obj/item/weapon/crowbar))
var/obj/item/mecha_parts/mecha_equipment/ME
var/obj/mecha/working/hoverpod/H = new (loc)
ME = new /obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp
ME.attach(H)
ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger
ME.attach(H)
..()
/obj/structure/largecrate/animal
icon_state = "mulecrate"
var/held_count = 1
var/held_type
/obj/structure/largecrate/animal/New()
..()
for(var/i = 1;i<=held_count;i++)
new held_type(src)
/obj/structure/largecrate/animal/corgi
name = "corgi carrier"
held_type = /mob/living/simple_animal/corgi
/obj/structure/largecrate/animal/cow
name = "cow crate"
held_type = /mob/living/simple_animal/cow
/obj/structure/largecrate/animal/goat
name = "goat crate"
held_type = /mob/living/simple_animal/hostile/retaliate/goat
/obj/structure/largecrate/animal/cat
name = "cat carrier"
held_type = /mob/living/simple_animal/cat
/obj/structure/largecrate/animal/cat/bones
held_type = /mob/living/simple_animal/cat/fluff/bones
/obj/structure/largecrate/animal/chick
name = "chicken crate"
held_count = 5
held_type = /mob/living/simple_animal/chick
+2 -2
View File
@@ -1,5 +1,5 @@
#define SHOWER_OPEN_LAYER MOB_LAYER + 0.1
#define SHOWER_CLOSED_LAYER OBJ_LAYER + 0.4
#define SHOWER_OPEN_LAYER OBJ_LAYER + 0.4
#define SHOWER_CLOSED_LAYER MOB_LAYER + 0.1
/obj/structure/curtain
name = "curtain"
-333
View File
@@ -1,333 +0,0 @@
/*
* False Walls
*/
/obj/structure/falsewall
name = "wall"
desc = "A huge chunk of metal used to seperate rooms."
anchored = 1
icon = 'icons/turf/walls.dmi'
var/mineral = "metal"
var/opening = 0
/obj/structure/falsewall/New()
relativewall_neighbours()
..()
/obj/structure/falsewall/Destroy()
var/temploc = src.loc
spawn(10)
for(var/turf/simulated/wall/W in range(temploc,1))
W.relativewall()
for(var/obj/structure/falsewall/W in range(temploc,1))
W.relativewall()
for(var/obj/structure/falserwall/W in range(temploc,1))
W.relativewall()
..()
/obj/structure/falsewall/relativewall()
if(!density)
icon_state = "[mineral]fwall_open"
return
var/junction = 0 //will be used to determine from which side the wall is connected to other walls
for(var/turf/simulated/wall/W in orange(src,1))
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
if(src.mineral == W.mineral)//Only 'like' walls connect -Sieve
junction |= get_dir(src,W)
for(var/obj/structure/falsewall/W in orange(src,1))
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
if(src.mineral == W.mineral)
junction |= get_dir(src,W)
for(var/obj/structure/falserwall/W in orange(src,1))
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
if(src.mineral == W.mineral)
junction |= get_dir(src,W)
icon_state = "[mineral][junction]"
return
/obj/structure/falsewall/attack_hand(mob/user as mob)
if(opening)
return
if(density)
opening = 1
icon_state = "[mineral]fwall_open"
flick("[mineral]fwall_opening", src)
sleep(15)
src.density = 0
SetOpacity(0)
opening = 0
else
opening = 1
flick("[mineral]fwall_closing", src)
icon_state = "[mineral]0"
density = 1
sleep(15)
SetOpacity(1)
src.relativewall()
opening = 0
/obj/structure/falsewall/update_icon()//Calling icon_update will refresh the smoothwalls if it's closed, otherwise it will make sure the icon is correct if it's open
..()
if(density)
icon_state = "[mineral]0"
src.relativewall()
else
icon_state = "[mineral]fwall_open"
/obj/structure/falsewall/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(opening)
user << "\red You must wait until the door has stopped moving."
return
if(density)
var/turf/T = get_turf(src)
if(T.density)
user << "\red The wall is blocked!"
return
if(istype(W, /obj/item/weapon/screwdriver))
user.visible_message("[user] tightens some bolts on the wall.", "You tighten the bolts on the wall.")
if(!mineral || mineral == "metal")
T.ChangeTurf(/turf/simulated/wall)
else
T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
qdel(src)
if( istype(W, /obj/item/weapon/weldingtool) )
var/obj/item/weapon/weldingtool/WT = W
if( WT:welding )
if(!mineral)
T.ChangeTurf(/turf/simulated/wall)
else
T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
if(mineral != "phoron")//Stupid shit keeps me from pushing the attackby() to phoron walls -Sieve
T = get_turf(src)
T.attackby(W,user)
qdel(src)
else
user << "\blue You can't reach, close it first!"
if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
var/turf/T = get_turf(src)
if(!mineral)
T.ChangeTurf(/turf/simulated/wall)
else
T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
if(mineral != "phoron")
T = get_turf(src)
T.attackby(W,user)
qdel(src)
//DRILLING
else if (istype(W, /obj/item/weapon/pickaxe/diamonddrill))
var/turf/T = get_turf(src)
if(!mineral)
T.ChangeTurf(/turf/simulated/wall)
else
T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
T = get_turf(src)
T.attackby(W,user)
qdel(src)
else if( istype(W, /obj/item/weapon/melee/energy/blade) )
var/turf/T = get_turf(src)
if(!mineral)
T.ChangeTurf(/turf/simulated/wall)
else
T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
if(mineral != "phoron")
T = get_turf(src)
T.attackby(W,user)
qdel(src)
/obj/structure/falsewall/update_icon()//Calling icon_update will refresh the smoothwalls if it's closed, otherwise it will make sure the icon is correct if it's open
..()
if(density)
icon_state = "[mineral]0"
src.relativewall()
else
icon_state = "[mineral]fwall_open"
/*
* False R-Walls
*/
/obj/structure/falserwall
name = "reinforced wall"
desc = "A huge chunk of reinforced metal used to seperate rooms."
icon = 'icons/turf/walls.dmi'
icon_state = "r_wall"
density = 1
opacity = 1
anchored = 1
var/mineral = "metal"
var/opening = 0
/obj/structure/falserwall/New()
relativewall_neighbours()
..()
/obj/structure/falserwall/attack_hand(mob/user as mob)
if(opening)
return
if(density)
opening = 1
// Open wall
icon_state = "frwall_open"
flick("frwall_opening", src)
sleep(15)
density = 0
SetOpacity(0)
opening = 0
else
opening = 1
icon_state = "r_wall"
flick("frwall_closing", src)
density = 1
sleep(15)
SetOpacity(1)
relativewall()
opening = 0
/obj/structure/falserwall/relativewall()
if(!density)
icon_state = "frwall_open"
return
var/junction = 0 //will be used to determine from which side the wall is connected to other walls
for(var/turf/simulated/wall/W in orange(src,1))
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
if(src.mineral == W.mineral)//Only 'like' walls connect -Sieve
junction |= get_dir(src,W)
for(var/obj/structure/falsewall/W in orange(src,1))
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
if(src.mineral == W.mineral)
junction |= get_dir(src,W)
for(var/obj/structure/falserwall/W in orange(src,1))
if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
if(src.mineral == W.mineral)
junction |= get_dir(src,W)
icon_state = "rwall[junction]"
return
/obj/structure/falserwall/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(opening)
user << "\red You must wait until the door has stopped moving."
return
if(istype(W, /obj/item/weapon/screwdriver))
var/turf/T = get_turf(src)
user.visible_message("[user] tightens some bolts on the r wall.", "You tighten the bolts on the wall.")
T.ChangeTurf(/turf/simulated/wall) //Intentionally makes a regular wall instead of an r-wall (no cheap r-walls for you).
qdel(src)
if( istype(W, /obj/item/weapon/weldingtool) )
var/obj/item/weapon/weldingtool/WT = W
if( WT.remove_fuel(0,user) )
var/turf/T = get_turf(src)
T.ChangeTurf(/turf/simulated/wall)
T = get_turf(src)
T.attackby(W,user)
qdel(src)
else if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
var/turf/T = get_turf(src)
T.ChangeTurf(/turf/simulated/wall)
T = get_turf(src)
T.attackby(W,user)
qdel(src)
//DRILLING
else if (istype(W, /obj/item/weapon/pickaxe/diamonddrill))
var/turf/T = get_turf(src)
T.ChangeTurf(/turf/simulated/wall)
T = get_turf(src)
T.attackby(W,user)
qdel(src)
else if( istype(W, /obj/item/weapon/melee/energy/blade) )
var/turf/T = get_turf(src)
T.ChangeTurf(/turf/simulated/wall)
T = get_turf(src)
T.attackby(W,user)
qdel(src)
/*
* Uranium Falsewalls
*/
/obj/structure/falsewall/uranium
name = "uranium wall"
desc = "A wall with uranium plating. This is probably a bad idea."
icon_state = ""
mineral = "uranium"
var/active = null
var/last_event = 0
/obj/structure/falsewall/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob)
radiate()
..()
/obj/structure/falsewall/uranium/attack_hand(mob/user as mob)
radiate()
..()
/obj/structure/falsewall/uranium/proc/radiate()
if(!active)
if(world.time > last_event+15)
active = 1
for(var/mob/living/L in range(3,src))
L.apply_effect(12,IRRADIATE,0)
for(var/turf/simulated/wall/mineral/uranium/T in range(3,src))
T.radiate()
last_event = world.time
active = null
return
return
/*
* Other misc falsewall types
*/
/obj/structure/falsewall/gold
name = "gold wall"
desc = "A wall with gold plating. Swag!"
icon_state = ""
mineral = "gold"
/obj/structure/falsewall/silver
name = "silver wall"
desc = "A wall with silver plating. Shiny."
icon_state = ""
mineral = "silver"
/obj/structure/falsewall/diamond
name = "diamond wall"
desc = "A wall with diamond plating. You monster."
icon_state = ""
mineral = "diamond"
/obj/structure/falsewall/phoron
name = "phoron wall"
desc = "A wall with phoron plating. This is definately a bad idea."
icon_state = ""
mineral = "phoron"
/obj/structure/falsewall/sandstone
name = "sandstone wall"
desc = "A wall with sandstone plating."
icon_state = ""
mineral = "sandstone"
+129 -174
View File
@@ -6,6 +6,13 @@
var/state = 0
var/health = 200
var/cover = 50 //how much cover the girder provides against projectiles.
var/material/reinf_material
/obj/structure/girder/displaced
icon_state = "displaced"
anchored = 0
health = 50
cover = 25
/obj/structure/girder/attack_generic(var/mob/user, var/damage, var/attack_message = "smashes apart", var/wallbreaker)
if(!damage || !wallbreaker)
@@ -30,156 +37,165 @@
health -= damage
..()
if(health <= 0)
new /obj/item/stack/sheet/metal(get_turf(src))
qdel(src)
dismantle()
return
/obj/structure/girder/proc/reset_girder()
cover = initial(cover)
health = min(health,initial(health))
state = 0
icon_state = initial(icon_state)
if(reinf_material)
reinforce_girder()
/obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench) && state == 0)
if(anchored && !istype(src,/obj/structure/girder/displaced))
if(anchored && !reinf_material)
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "\blue Now disassembling the girder"
user << "<span class='notice'>Now disassembling the girder...</span>"
if(do_after(user,40))
if(!src) return
user << "\blue You dissasembled the girder!"
user << "<span class='notice'>You dissasembled the girder!</span>"
dismantle()
else if(!anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "\blue Now securing the girder"
user << "<span class='notice'>Now securing the girder...</span>"
if(get_turf(user, 40))
user << "\blue You secured the girder!"
new/obj/structure/girder( src.loc )
qdel(src)
user << "<span class='notice'>You secured the girder!</span>"
reset_girder()
else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
user << "\blue Now slicing apart the girder"
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,30))
if(!src) return
user << "\blue You slice apart the girder!"
user << "<span class='notice'>You slice apart the girder!</span>"
dismantle()
else if(istype(W, /obj/item/weapon/pickaxe/diamonddrill))
user << "\blue You drill through the girder!"
user << "<span class='notice'>You drill through the girder!</span>"
dismantle()
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 && istype(src,/obj/structure/girder/reinforced))
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user << "\blue Now unsecuring support struts"
user << "<span class='notice'>Now unsecuring support struts...</span>"
if(do_after(user,40))
if(!src) return
user << "\blue You unsecured the support struts!"
user << "<span class='notice'>You unsecured the support struts!</span>"
state = 1
else if(istype(W, /obj/item/weapon/wirecutters) && istype(src,/obj/structure/girder/reinforced) && state == 1)
else if(istype(W, /obj/item/weapon/wirecutters) && state == 1)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user << "\blue Now removing support struts"
user << "<span class='notice'>Now removing support struts...</span>"
if(do_after(user,40))
if(!src) return
user << "\blue You removed the support struts!"
new/obj/structure/girder( src.loc )
qdel(src)
user << "<span class='notice'>You removed the support struts!</span>"
reinf_material.place_dismantled_product(get_turf(src))
reinf_material = null
reset_girder()
else if(istype(W, /obj/item/weapon/crowbar) && state == 0 && anchored )
else if(istype(W, /obj/item/weapon/crowbar) && state == 0 && anchored)
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user << "\blue Now dislodging the girder"
user << "<span class='notice'>Now dislodging the girder...</span>"
if(do_after(user, 40))
if(!src) return
user << "\blue You dislodged the girder!"
new/obj/structure/girder/displaced( src.loc )
qdel(src)
user << "<span class='notice'>You dislodged the girder!</span>"
icon_state = "displaced"
anchored = 0
health = 50
cover = 25
else if(istype(W, /obj/item/stack/sheet))
var/obj/item/stack/sheet/S = W
switch(S.type)
if(S.get_amount() < 2)
return ..()
if(/obj/item/stack/sheet/metal, /obj/item/stack/sheet/metal/cyborg)
if(!anchored)
if(S.use(2))
user << "<span class='notice'>You create a false wall! Push on it to open or close the passage.</span>"
new /obj/structure/falsewall (src.loc)
qdel(src)
else
if(S.get_amount() < 2) return ..()
user << "<span class='notice'>Now adding plating...</span>"
if (do_after(user,40))
if (S.use(2))
user << "<span class='notice'>You added the plating!</span>"
var/turf/Tsrc = get_turf(src)
Tsrc.ChangeTurf(/turf/simulated/wall)
for(var/turf/simulated/wall/X in Tsrc.loc)
if(X) X.add_hiddenprint(usr)
qdel(src)
return
if(/obj/item/stack/sheet/plasteel, /obj/item/stack/sheet/plasteel/cyborg)
if(!anchored)
if(S.use(2))
user << "\blue You create a false wall! Push on it to open or close the passage."
new /obj/structure/falserwall (src.loc)
qdel(src)
else
if (src.icon_state == "reinforced") //I cant believe someone would actually write this line of code...
if(S.get_amount() < 1) return ..()
user << "<span class='notice'>Now finalising reinforced wall.</span>"
if(do_after(user, 50))
if (S.use(1))
user << "<span class='notice'>Wall fully reinforced!</span>"
var/turf/Tsrc = get_turf(src)
Tsrc.ChangeTurf(/turf/simulated/wall/r_wall)
for(var/turf/simulated/wall/r_wall/X in Tsrc.loc)
if(X) X.add_hiddenprint(usr)
qdel(src)
return
else
if(S.get_amount() < 1) return ..()
user << "<span class='notice'>Now reinforcing girders...</span>"
if (do_after(user,60))
if(S.use(1))
user << "<span class='notice'>Girders reinforced!</span>"
new/obj/structure/girder/reinforced( src.loc )
qdel(src)
return
if(S.sheettype)
var/M = S.sheettype
// Ugly hack, will suffice for now. Need to fix it upstream as well, may rewrite mineral walls. ~Z
if(M in list("mhydrogen","osmium","tritium","platinum","iron"))
user << "You cannot plate the girder in that material."
return
if(!anchored)
if(S.amount < 2) return
S.use(2)
user << "\blue You create a false wall! Push on it to open or close the passage."
var/F = text2path("/obj/structure/falsewall/[M]")
new F (src.loc)
qdel(src)
else
if(S.amount < 2) return ..()
user << "\blue Now adding plating..."
if (do_after(user,40))
if(!src || !S || S.amount < 2) return
S.use(2)
user << "\blue You added the plating!"
var/turf/Tsrc = get_turf(src)
Tsrc.ChangeTurf(text2path("/turf/simulated/wall/mineral/[M]"))
for(var/turf/simulated/wall/mineral/X in Tsrc.loc)
if(X) X.add_hiddenprint(usr)
qdel(src)
return
var/material/M = name_to_material[S.sheettype]
if(!istype(M))
return ..()
var/wall_fake
add_hiddenprint(usr)
if(M.integrity < 50)
user << "<span class='notice'>This material is too soft for use in wall construction.</span>"
return
user << "<span class='notice'>You begin adding the plating...</span>"
if(!do_after(user,40) || !S.use(2))
return
if(anchored)
user << "<span class='notice'>You added the plating!</span>"
else
user << "<span class='notice'>You create a false wall! Push on it to open or close the passage.</span>"
wall_fake = 1
var/turf/Tsrc = get_turf(src)
Tsrc.ChangeTurf(/turf/simulated/wall)
var/turf/simulated/wall/T = get_turf(src)
T.set_material(M, reinf_material)
if(wall_fake)
T.can_open = 1
T.add_hiddenprint(usr)
qdel(src)
return
else if(istype(W, /obj/item/pipe))
var/obj/item/pipe/P = W
if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
user.drop_item()
P.loc = src.loc
user << "\blue You fit the pipe into the [src]!"
user << "<span class='notice'>You fit the pipe into the [src]!"
else
..()
/obj/structure/girder/proc/reinforce_girder()
cover = reinf_material.hardness
health = 500
state = 2
icon_state = "reinforced"
/obj/structure/girder/verb/reinforce_with_material()
set name = "Reinforce girder"
set desc = "Reinforce a girder with metal."
set src in view(1)
var/mob/living/user = usr
if(!istype(user) || !(user.l_hand || user.r_hand))
return
if(reinf_material)
user << "\The [src] is already reinforced."
return
var/obj/item/stack/sheet/S = user.l_hand
if(!istype(S))
S = user.r_hand
if(!istype(S))
user << "You cannot plate \the [src] with that."
return
if(S.get_amount() < 2)
user << "There is not enough material here to reinforce the girder."
return
var/material/M = name_to_material[S.sheettype]
if(!istype(M) || M.integrity < 50)
user << "You cannot reinforce \the [src] with that; it is too soft."
return
user << "<span class='notice'>Now reinforcing...</span>"
if (!do_after(user,40) || !S.use(2))
return
user << "<span class='notice'>You added reinforcement!</span>"
reinf_material = M
reinforce_girder()
/obj/structure/girder/proc/dismantle()
new /obj/item/stack/sheet/metal(get_turf(src))
qdel(src)
@@ -203,101 +219,40 @@
return
if(2.0)
if (prob(30))
var/remains = pick(/obj/item/stack/rods,/obj/item/stack/sheet/metal)
new remains(loc)
qdel(src)
dismantle()
return
if(3.0)
if (prob(5))
var/remains = pick(/obj/item/stack/rods,/obj/item/stack/sheet/metal)
new remains(loc)
qdel(src)
dismantle()
return
else
return
/obj/structure/girder/displaced
icon_state = "displaced"
anchored = 0
health = 50
cover = 25
/obj/structure/girder/reinforced
icon_state = "reinforced"
state = 2
health = 500
cover = 80
/obj/structure/cultgirder
/obj/structure/girder/cult
icon= 'icons/obj/cult.dmi'
icon_state= "cultgirder"
anchored = 1
density = 1
layer = 2
var/health = 250
var/cover = 70
health = 250
cover = 70
/obj/structure/cultgirder/attack_generic(var/mob/user, var/damage, var/attack_message = "smashes apart", var/wallbreaker)
if(!damage || !wallbreaker)
return 0
visible_message("<span class='danger'>[user] [attack_message] the [src]!</span>")
dismantle()
return 1
/obj/structure/cultgirder/proc/dismantle()
/obj/structure/girder/cult/dismantle()
new /obj/effect/decal/remains/human(get_turf(src))
qdel(src)
/obj/structure/cultgirder/attackby(obj/item/W as obj, mob/user as mob)
/obj/structure/girder/cult/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user << "\blue Now disassembling the girder"
user << "<span class='notice'>Now disassembling the girder...</span>"
if(do_after(user,40))
user << "\blue You dissasembled the girder!"
user << "<span class='notice'>You dissasembled the girder!</span>"
dismantle()
else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
user << "\blue Now slicing apart the girder"
user << "<span class='notice'>Now slicing apart the girder..."
if(do_after(user,30))
user << "\blue You slice apart the girder!"
user << "<span class='notice'>You slice apart the girder!</span>"
dismantle()
else if(istype(W, /obj/item/weapon/pickaxe/diamonddrill))
user << "\blue You drill through the girder!"
user << "<span class='notice'>You drill through the girder!</span>"
new /obj/effect/decal/remains/human(get_turf(src))
dismantle()
/obj/structure/cultgirder/blob_act()
if(prob(40))
dismantle()
/obj/structure/cultgirder/bullet_act(var/obj/item/projectile/Proj) //No beam check- How else will you destroy the cult girder with silver bullets?????
//Girders only provide partial cover. There's a chance that the projectiles will just pass through. (unless you are trying to shoot the girder)
if(Proj.original != src && !prob(cover))
return -1 //pass through
//Tasers and the like should not damage cultgirders.
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
health -= Proj.damage
..()
if(health <= 0)
dismantle()
return
/obj/structure/cultgirder/ex_act(severity)
switch(severity)
if(1.0)
qdel(src)
return
if(2.0)
if (prob(30))
dismantle()
return
if(3.0)
if (prob(5))
dismantle()
return
else
return
@@ -111,6 +111,7 @@
if(isobserver(usr)) //to stop ghosts from deflating
return
verbs -= /obj/structure/inflatable/verb/hand_deflate
deflate()
/obj/structure/inflatable/attack_generic(var/mob/user, var/damage, var/attack_verb)
+2 -2
View File
@@ -39,7 +39,7 @@
if(reagents.total_volume < 1)
user << "[src] is out of water!</span>"
else
reagents.trans_to(I, 5) //
reagents.trans_to_obj(I, 5) //
user << "<span class='notice'>You wet [I] in [src].</span>"
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return
@@ -186,7 +186,7 @@
/obj/structure/bed/chair/janicart/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/mop))
if(reagents.total_volume > 1)
reagents.trans_to(I, 2)
reagents.trans_to_obj(I, 2)
user << "<span class='notice'>You wet [I] in the [callme].</span>"
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
else
+7 -21
View File
@@ -10,7 +10,7 @@
icon = 'icons/obj/doors/mineral_doors.dmi'
icon_state = "metal"
var/mineralType = "metal"
var/mineralType = DEFAULT_WALL_MATERIAL
var/state = 0 //closed, 1 == open
var/isSwitchingStates = 0
var/hardness = 1
@@ -119,24 +119,10 @@
Dismantle(1)
proc/Dismantle(devastated = 0)
if(!devastated)
if (mineralType == "metal")
var/ore = /obj/item/stack/sheet/metal
for(var/i = 1, i <= oreAmount, i++)
new ore(get_turf(src))
else
var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
for(var/i = 1, i <= oreAmount, i++)
new ore(get_turf(src))
else
if (mineralType == "metal")
var/ore = /obj/item/stack/sheet/metal
for(var/i = 3, i <= oreAmount, i++)
new ore(get_turf(src))
else
var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
for(var/i = 3, i <= oreAmount, i++)
new ore(get_turf(src))
var/material/M = name_to_material[mineralType]
if(istype(M))
for(var/i = (devastated? 1 : 3), i <= oreAmount, i++)
new M.stack_type(get_turf(src))
qdel(src)
ex_act(severity = 1)
@@ -155,7 +141,7 @@
return
/obj/structure/mineral_door/iron
mineralType = "metal"
mineralType = "iron"
hardness = 3
/obj/structure/mineral_door/silver
@@ -168,7 +154,7 @@
/obj/structure/mineral_door/uranium
mineralType = "uranium"
hardness = 3
luminosity = 2
light_range = 2
/obj/structure/mineral_door/sandstone
mineralType = "sandstone"
+1 -1
View File
@@ -22,6 +22,6 @@
if(reagents.total_volume < 1)
user << "[src] is out of water!</span>"
else
reagents.trans_to(I, 5)
reagents.trans_to_obj(I, 5)
user << "<span class='notice'>You wet [I] in [src].</span>"
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
@@ -41,6 +41,15 @@
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
new /obj/item/stack/sheet/metal(src.loc)
qdel(src)
else if(istype(W, /obj/item/weapon/grab))
user.visible_message("<span class='notice'>[user] attempts to buckle [W:affecting] into \the [src]!</span>")
if(do_after(user, 20))
W:affecting.loc = loc
if(buckle_mob(W:affecting))
W:affecting.visible_message(\
"<span class='danger'>[W:affecting.name] is buckled to [src] by [user.name]!</span>",\
"<span class='danger'>You are buckled to [src] by [user.name]!</span>",\
"<span class='notice'>You hear metal clanking.</span>")
else
..()
@@ -1,558 +0,0 @@
// Tables and racks.
/obj/structure/table
name = "table"
desc = "A square piece of metal standing on four metal legs. It can not move."
icon = 'icons/obj/structures.dmi'
icon_state = "table"
density = 1
anchored = 1
layer = 2.8
throwpass = 1
climbable = 1
breakable = 1
parts = /obj/item/weapon/table_parts
var/flipped = 0
var/health = 100
/obj/structure/table/woodentable
name = "wooden table"
desc = "Do not apply fire to this. Rumour says it burns easily."
icon_state = "wood_table"
parts = /obj/item/weapon/table_parts/wood
health = 50
/obj/structure/table/gamblingtable
name = "gambling table"
desc = "A curved wooden table with a thin carpet of green fabric."
icon_state = "gamble_table"
parts = /obj/item/weapon/table_parts/gambling
health = 50
/obj/structure/table/reinforced
icon_state = "reinf_table"
health = 200
parts = /obj/item/weapon/table_parts/reinforced
/obj/structure/table/rack
name = "rack"
desc = "Different from the Middle Ages version."
icon = 'icons/obj/objects.dmi'
icon_state = "rack"
health = 100
parts = /obj/item/weapon/table_parts/rack
flipped = -1 //Cannot flip.
/obj/structure/table/examine()
..()
if(health > 100)
usr << "This one looks like it has been reinforced."
/obj/structure/table/proc/update_adjacent()
for(var/direction in list(1,2,4,8,5,6,9,10))
if(locate(/obj/structure/table,get_step(src,direction)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
T.update_icon()
/obj/structure/table/New()
..()
for(var/obj/structure/table/T in src.loc)
if(T != src)
qdel(T)
update_icon()
update_adjacent()
/obj/structure/table/Destroy()
update_adjacent()
..()
/obj/structure/table/update_icon()
if(health > 100)
name = "reinforced [initial(name)]"
spawn(2) //So it properly updates when deleting
if(flipped == 1)
var/type = 0
var/tabledirs = 0
for(var/direction in list(turn(dir,90), turn(dir,-90)) )
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
if (T && T.flipped == 1 && T.dir == src.dir)
type++
tabledirs |= direction
var/base = "table"
if (istype(src, /obj/structure/table/woodentable))
base = "wood"
if (istype(src, /obj/structure/table/reinforced))
base = "rtable"
icon_state = "[base]flip[type]"
if (type==1)
if (tabledirs & turn(dir,90))
icon_state = icon_state+"-"
if (tabledirs & turn(dir,-90))
icon_state = icon_state+"+"
return 1
var/dir_sum = 0
for(var/direction in list(1,2,4,8,5,6,9,10))
var/skip_sum = 0
for(var/obj/structure/window/W in src.loc)
if(W.dir == direction) //So smooth tables don't go smooth through windows
skip_sum = 1
continue
var/inv_direction //inverse direction
switch(direction)
if(1)
inv_direction = 2
if(2)
inv_direction = 1
if(4)
inv_direction = 8
if(8)
inv_direction = 4
if(5)
inv_direction = 10
if(6)
inv_direction = 9
if(9)
inv_direction = 6
if(10)
inv_direction = 5
for(var/obj/structure/window/W in get_step(src,direction))
if(W.dir == inv_direction) //So smooth tables don't go smooth through windows when the window is on the other table's tile
skip_sum = 1
continue
if(!skip_sum) //means there is a window between the two tiles in this direction
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
if(T && T.flipped == 0) // This should let us ignore racks for table icons/flipping. Should.
if(direction <5)
dir_sum += direction
else
if(direction == 5) //This permits the use of all table directions. (Set up so clockwise around the central table is a higher value, from north)
dir_sum += 16
if(direction == 6)
dir_sum += 32
if(direction == 8) //Aherp and Aderp. Jezes I am stupid. -- SkyMarshal
dir_sum += 8
if(direction == 10)
dir_sum += 64
if(direction == 9)
dir_sum += 128
var/table_type = 0 //stand_alone table
if(dir_sum%16 in cardinal)
table_type = 1 //endtable
dir_sum %= 16
if(dir_sum%16 in list(3,12))
table_type = 2 //1 tile thick, streight table
if(dir_sum%16 == 3) //3 doesn't exist as a dir
dir_sum = 2
if(dir_sum%16 == 12) //12 doesn't exist as a dir.
dir_sum = 4
if(dir_sum%16 in list(5,6,9,10))
if(locate(/obj/structure/table,get_step(src.loc,dir_sum%16)))
table_type = 3 //full table (not the 1 tile thick one, but one of the 'tabledir' tables)
else
table_type = 2 //1 tile thick, corner table (treated the same as streight tables in code later on)
dir_sum %= 16
if(dir_sum%16 in list(13,14,7,11)) //Three-way intersection
table_type = 5 //full table as three-way intersections are not sprited, would require 64 sprites to handle all combinations. TOO BAD -- SkyMarshal
switch(dir_sum%16) //Begin computation of the special type tables. --SkyMarshal
if(7)
if(dir_sum == 23)
table_type = 6
dir_sum = 8
else if(dir_sum == 39)
dir_sum = 4
table_type = 6
else if(dir_sum == 55 || dir_sum == 119 || dir_sum == 247 || dir_sum == 183)
dir_sum = 4
table_type = 3
else
dir_sum = 4
if(11)
if(dir_sum == 75)
dir_sum = 5
table_type = 6
else if(dir_sum == 139)
dir_sum = 9
table_type = 6
else if(dir_sum == 203 || dir_sum == 219 || dir_sum == 251 || dir_sum == 235)
dir_sum = 8
table_type = 3
else
dir_sum = 8
if(13)
if(dir_sum == 29)
dir_sum = 10
table_type = 6
else if(dir_sum == 141)
dir_sum = 6
table_type = 6
else if(dir_sum == 189 || dir_sum == 221 || dir_sum == 253 || dir_sum == 157)
dir_sum = 1
table_type = 3
else
dir_sum = 1
if(14)
if(dir_sum == 46)
dir_sum = 1
table_type = 6
else if(dir_sum == 78)
dir_sum = 2
table_type = 6
else if(dir_sum == 110 || dir_sum == 254 || dir_sum == 238 || dir_sum == 126)
dir_sum = 2
table_type = 3
else
dir_sum = 2 //These translate the dir_sum to the correct dirs from the 'tabledir' icon_state.
if(dir_sum%16 == 15)
table_type = 4 //4-way intersection, the 'middle' table sprites will be used.
if(istype(src,/obj/structure/table/reinforced))
switch(table_type)
if(0)
icon_state = "reinf_table"
if(1)
icon_state = "reinf_1tileendtable"
if(2)
icon_state = "reinf_1tilethick"
if(3)
icon_state = "reinf_tabledir"
if(4)
icon_state = "reinf_middle"
if(5)
icon_state = "reinf_tabledir2"
if(6)
icon_state = "reinf_tabledir3"
else if(istype(src,/obj/structure/table/woodentable))
switch(table_type)
if(0)
icon_state = "wood_table"
if(1)
icon_state = "wood_1tileendtable"
if(2)
icon_state = "wood_1tilethick"
if(3)
icon_state = "wood_tabledir"
if(4)
icon_state = "wood_middle"
if(5)
icon_state = "wood_tabledir2"
if(6)
icon_state = "wood_tabledir3"
else if(istype(src,/obj/structure/table/gamblingtable))
switch(table_type)
if(0)
icon_state = "gamble_table"
if(1)
icon_state = "gamble_1tileendtable"
if(2)
icon_state = "gamble_1tilethick"
if(3)
icon_state = "gamble_tabledir"
if(4)
icon_state = "gamble_middle"
if(5)
icon_state = "gamble_tabledir2"
if(6)
icon_state = "gamble_tabledir3"
else
switch(table_type)
if(0)
icon_state = "table"
if(1)
icon_state = "table_1tileendtable"
if(2)
icon_state = "table_1tilethick"
if(3)
icon_state = "tabledir"
if(4)
icon_state = "table_middle"
if(5)
icon_state = "tabledir2"
if(6)
icon_state = "tabledir3"
if (dir_sum in list(1,2,4,8,5,6,9,10))
set_dir(dir_sum)
else
set_dir(2)
/obj/structure/table/attack_tk() // no telehulk sorry
return
/obj/structure/table/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover,/obj/item/projectile))
return (check_cover(mover,target))
if(istype(mover) && mover.checkpass(PASSTABLE))
return 1
if(locate(/obj/structure/table) in get_turf(mover))
return 1
if (flipped == 1)
if (get_dir(loc, target) == dir)
return !density
else
return 1
return 0
//checks if projectile 'P' from turf 'from' can hit whatever is behind the table. Returns 1 if it can, 0 if bullet stops.
/obj/structure/table/proc/check_cover(obj/item/projectile/P, turf/from)
var/turf/cover
if(flipped==1)
cover = get_turf(src)
else if(flipped==0)
cover = get_step(loc, get_dir(from, loc))
if(!cover)
return 1
if (get_dist(P.starting, loc) <= 1) //Tables won't help you if people are THIS close
return 1
if (get_turf(P.original) == cover)
var/chance = 20
if (ismob(P.original))
var/mob/M = P.original
if (M.lying)
chance += 20 //Lying down lets you catch less bullets
if(flipped==1)
if(get_dir(loc, from) == dir) //Flipped tables catch mroe bullets
chance += 20
else
return 1 //But only from one side
if(prob(chance))
health -= P.damage/2
if (health > 0)
visible_message("<span class='warning'>[P] hits \the [src]!</span>")
return 0
else
visible_message("<span class='warning'>[src] breaks down!</span>")
qdel(src)
return 1
return 1
/obj/structure/table/CheckExit(atom/movable/O as mob|obj, target as turf)
if(istype(O) && O.checkpass(PASSTABLE))
return 1
if (flipped==1)
if (get_dir(loc, target) == dir)
return !density
else
return 1
return 1
/obj/structure/table/MouseDrop_T(obj/O as obj, mob/user as mob)
if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O))
return ..()
if(isrobot(user))
return
user.drop_item()
if (O.loc != src.loc)
step(O, get_dir(O, src))
return
/obj/structure/table/attackby(obj/item/W as obj, mob/user as mob)
if (!W) return
// Handle harm intent grabbing/tabling.
if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
var/obj/item/weapon/grab/G = W
if (istype(G.affecting, /mob/living))
var/mob/living/M = G.affecting
if (G.state < 2)
if(user.a_intent == I_HURT)
if (prob(15)) M.Weaken(5)
M.apply_damage(8,def_zone = "head")
visible_message("<span class='danger'>[G.assailant] slams [G.affecting]'s face against \the [src]!</span>")
playsound(src.loc, 'sound/weapons/tablehit1.ogg', 50, 1)
else
user << "<span class='danger'>You need a better grip to do that!</span>"
return
else
G.affecting.loc = src.loc
G.affecting.Weaken(5)
visible_message("<span class='danger'>[G.assailant] puts [G.affecting] on \the [src].</span>")
qdel(W)
return
// Handle dissembly.
if (istype(W, /obj/item/weapon/wrench))
if(health > 100)
user << "<span class='danger'>\The [src] is too well constructed to be collapsed. Weaken it first.</span>"
return
user << "<span class='notice'>You locate the bolts and begin disassembling \the [src]...</span>"
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user,50))
qdel(src)
return
// Handle weakening.
if (istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.isOn())
if(initial(health)>100)
if(WT.remove_fuel(0, user))
if(src.health>100)
user << "<span class='notice'>You start weakening \the [src]...</span>"
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
if(!do_after(user, 50) || !src || health<100 || !WT.isOn())
return
user << "<span class='notice'>You have weakened \the [src].</span>"
health -= 100
else if(src.health <= 100)
user << "<span class='notice'>You start strengthening \the [src]...</span>"
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
if(!do_after(user, 50) || !src || health > 100 || !WT.isOn())
return
user << "<span class='notice'>You have strengthened \the [src].</span>"
health += 100
update_icon()
else
user << "<span class='notice'>\The [src] is too flimsy to be reinforced or weakened.</span>"
return
// Handle dismantling or placing things on the table from here on.
if(isrobot(user))
return
if(W.loc != user) // This should stop mounted modules ending up outside the module.
return
if(istype(W, /obj/item/weapon/melee/energy/blade))
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src.loc)
spark_system.start()
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
user.visible_message("<span class='danger'>The [src] was sliced apart by [user]!</span>")
qdel(src)
user.drop_item(src.loc)
return
/obj/structure/table/proc/straight_table_check(var/direction)
var/obj/structure/table/T
for(var/angle in list(-90,90))
T = locate() in get_step(src.loc,turn(direction,angle))
if(T && T.flipped == 0)
return 0
T = locate() in get_step(src.loc,direction)
if (!T || T.flipped == 1)
return 1
if (istype(T,/obj/structure/table/reinforced/))
var/obj/structure/table/reinforced/R = T
if (R.health > 100)
return 0
return T.straight_table_check(direction)
/obj/structure/table/verb/do_flip()
set name = "Flip table"
set desc = "Flips a non-reinforced table"
set category = "Object"
set src in oview(1)
if (!can_touch(usr) || ismouse(usr))
return
if(flipped < 0 || !flip(get_cardinal_dir(usr,src)))
usr << "<span class='notice'>It won't budge.</span>"
return
usr.visible_message("<span class='warning'>[usr] flips \the [src]!</span>")
if(climbable)
structure_shaken()
return
/obj/structure/table/proc/unflipping_check(var/direction)
for(var/mob/M in oview(src,0))
return 0
var/obj/occupied = turf_is_crowded()
if(occupied)
usr << "There's \a [occupied] in the way."
return 0
var/list/L = list()
if(direction)
L.Add(direction)
else
L.Add(turn(src.dir,-90))
L.Add(turn(src.dir,90))
for(var/new_dir in L)
var/obj/structure/table/T = locate() in get_step(src.loc,new_dir)
if(T)
if(T.flipped == 1 && T.dir == src.dir && !T.unflipping_check(new_dir))
return 0
return 1
/obj/structure/table/proc/do_put()
set name = "Put table back"
set desc = "Puts flipped table back"
set category = "Object"
set src in oview(1)
if (!can_touch(usr))
return
if (!unflipping_check())
usr << "<span class='notice'>It won't budge.</span>"
return
unflip()
/obj/structure/table/proc/flip(var/direction)
if( !straight_table_check(turn(direction,90)) || !straight_table_check(turn(direction,-90)) )
return 0
verbs -=/obj/structure/table/verb/do_flip
verbs +=/obj/structure/table/proc/do_put
var/list/targets = list(get_step(src,dir),get_step(src,turn(dir, 45)),get_step(src,turn(dir, -45)))
for (var/atom/movable/A in get_turf(src))
if (!A.anchored)
spawn(0)
A.throw_at(pick(targets),1,1)
set_dir(direction)
if(dir != NORTH)
layer = 5
climbable = 0 //flipping tables allows them to be used as makeshift barriers
flipped = 1
flags |= ON_BORDER
for(var/D in list(turn(direction, 90), turn(direction, -90)))
var/obj/structure/table/T = locate() in get_step(src,D)
if(T && T.flipped == 0)
T.flip(direction)
update_icon()
update_adjacent()
return 1
/obj/structure/table/proc/unflip()
verbs -=/obj/structure/table/proc/do_put
verbs +=/obj/structure/table/verb/do_flip
layer = initial(layer)
flipped = 0
climbable = initial(climbable)
flags &= ~ON_BORDER
for(var/D in list(turn(dir, 90), turn(dir, -90)))
var/obj/structure/table/T = locate() in get_step(src.loc,D)
if(T && T.flipped == 1 && T.dir == src.dir)
T.unflip()
update_icon()
update_adjacent()
return 1
// No need to handle any of this, racks are not contiguous..
/obj/structure/table/rack/update_icon()
return
/obj/structure/table/rack/update_adjacent()
return
+2 -2
View File
@@ -482,10 +482,10 @@
/obj/structure/window/reinforced/polarized/proc/toggle()
if(opacity)
animate(src, color="#FFFFFF", time=5)
SetOpacity(0)
set_opacity(0)
else
animate(src, color="#222222", time=5)
SetOpacity(1)
set_opacity(1)