mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Merge branch 'master' of https://github.com/Baystation12/Baystation12
This commit is contained in:
@@ -1,38 +1,168 @@
|
||||
// BEDSHEET BIN
|
||||
/*
|
||||
CONTAINS:
|
||||
BEDSHEETS
|
||||
LINEN BINS
|
||||
*/
|
||||
|
||||
/obj/item/weapon/bedsheet
|
||||
name = "bedsheet"
|
||||
desc = "A surprisingly soft linen bedsheet."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "sheet"
|
||||
item_state = "bedsheet"
|
||||
layer = 4.0
|
||||
throwforce = 1
|
||||
throw_speed = 1
|
||||
throw_range = 2
|
||||
w_class = 1.0
|
||||
color = "white"
|
||||
|
||||
|
||||
/obj/item/weapon/bedsheet/attack_self(mob/user as mob)
|
||||
user.drop_item()
|
||||
if(layer == initial(layer))
|
||||
layer = 5
|
||||
else
|
||||
layer = initial(layer)
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/bedsheet/blue
|
||||
icon_state = "sheetblue"
|
||||
color = "blue"
|
||||
|
||||
/obj/item/weapon/bedsheet/green
|
||||
icon_state = "sheetgreen"
|
||||
color = "green"
|
||||
|
||||
/obj/item/weapon/bedsheet/orange
|
||||
icon_state = "sheetorange"
|
||||
color = "orange"
|
||||
|
||||
/obj/item/weapon/bedsheet/purple
|
||||
icon_state = "sheetpurple"
|
||||
color = "purple"
|
||||
|
||||
/obj/item/weapon/bedsheet/rainbow
|
||||
icon_state = "sheetrainbow"
|
||||
color = "rainbow"
|
||||
|
||||
/obj/item/weapon/bedsheet/red
|
||||
icon_state = "sheetred"
|
||||
color = "red"
|
||||
|
||||
/obj/item/weapon/bedsheet/yellow
|
||||
icon_state = "sheetyellow"
|
||||
color = "yellow"
|
||||
|
||||
/obj/item/weapon/bedsheet/mime
|
||||
icon_state = "sheetmime"
|
||||
color = "mime"
|
||||
|
||||
/obj/item/weapon/bedsheet/clown
|
||||
icon_state = "sheetclown"
|
||||
color = "clown"
|
||||
|
||||
/obj/item/weapon/bedsheet/captain
|
||||
icon_state = "sheetcaptain"
|
||||
color = "captain"
|
||||
|
||||
/obj/item/weapon/bedsheet/rd
|
||||
icon_state = "sheetrd"
|
||||
color = "director"
|
||||
|
||||
/obj/item/weapon/bedsheet/medical
|
||||
icon_state = "sheetmedical"
|
||||
color = "medical"
|
||||
|
||||
/obj/item/weapon/bedsheet/hos
|
||||
icon_state = "sheethos"
|
||||
color = "hosred"
|
||||
|
||||
/obj/item/weapon/bedsheet/hop
|
||||
icon_state = "sheethop"
|
||||
color = "hop"
|
||||
|
||||
/obj/item/weapon/bedsheet/ce
|
||||
icon_state = "sheetce"
|
||||
color = "chief"
|
||||
|
||||
/obj/item/weapon/bedsheet/brown
|
||||
icon_state = "sheetbrown"
|
||||
color = "brown"
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/structure/bedsheetbin
|
||||
name = "linen bin"
|
||||
desc = "A bin for containing bedsheets. It looks rather cosy."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "bedbin"
|
||||
var/amount = 23.0
|
||||
anchored = 1.0
|
||||
desc = "A linen bin. It looks rather cosy."
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon_state = "linenbin-full"
|
||||
anchored = 1
|
||||
var/amount = 20
|
||||
var/list/sheets = list()
|
||||
var/obj/item/hidden = null
|
||||
|
||||
/obj/structure/bedsheetbin/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/bedsheet))
|
||||
del(W)
|
||||
src.amount++
|
||||
return
|
||||
|
||||
/obj/structure/bedsheetbin/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/structure/bedsheetbin/attack_hand(mob/user as mob)
|
||||
if (src.amount >= 1)
|
||||
src.amount--
|
||||
new /obj/item/weapon/bedsheet( src.loc )
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/structure/bedsheetbin/examine()
|
||||
set src in oview(1)
|
||||
|
||||
src.amount = round(src.amount)
|
||||
if (src.amount <= 0)
|
||||
src.amount = 0
|
||||
usr << desc
|
||||
if(amount < 1)
|
||||
usr << "There are no bed sheets in the bin."
|
||||
else
|
||||
if (src.amount == 1)
|
||||
usr << "There is one bed sheet in the bin."
|
||||
return
|
||||
if(amount == 1)
|
||||
usr << "There is one bed sheet in the bin."
|
||||
return
|
||||
usr << "There are [amount] bed sheets in the bin."
|
||||
|
||||
|
||||
/obj/structure/bedsheetbin/update_icon()
|
||||
switch(amount)
|
||||
if(0) icon_state = "linenbin-empty"
|
||||
if(1 to amount / 2) icon_state = "linenbin-half"
|
||||
else icon_state = "linenbin-full"
|
||||
|
||||
|
||||
/obj/structure/bedsheetbin/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/bedsheet))
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
sheets.Add(I)
|
||||
amount++
|
||||
user << "<span class='notice'>You put [I] in [src].</span>"
|
||||
else if(amount && !hidden && I.w_class < 4) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
hidden = I
|
||||
user << "<span class='notice'>You hide [I] among the sheets.</span>"
|
||||
|
||||
|
||||
|
||||
/obj/structure/bedsheetbin/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/structure/bedsheetbin/attack_hand(mob/user as mob)
|
||||
if(amount >= 1)
|
||||
amount--
|
||||
|
||||
var/obj/item/weapon/bedsheet/B
|
||||
if(sheets.len > 0)
|
||||
B = sheets[sheets.len]
|
||||
sheets.Remove(B)
|
||||
|
||||
else
|
||||
usr << text("There are [] bed sheets in the bin.", src.amount)
|
||||
return
|
||||
B = new /obj/item/weapon/bedsheet(loc)
|
||||
|
||||
B.loc = user.loc
|
||||
user.put_in_hands(B)
|
||||
user << "<span class='notice'>You take [B] out of [src].</span>"
|
||||
|
||||
if(hidden)
|
||||
hidden.loc = user.loc
|
||||
user << "<span class='notice'>[hidden] falls out of [B]!</span>"
|
||||
hidden = null
|
||||
|
||||
|
||||
add_fingerprint(user)
|
||||
@@ -15,6 +15,14 @@
|
||||
var/storage_capacity = 20 //This is so that someone can't pack hundreds of items in a locker/crate
|
||||
//then open it in a populated area to crash clients.
|
||||
|
||||
/obj/structure/closet/New()
|
||||
..()
|
||||
spawn(1)
|
||||
if(!opened) // if closed, any item at the crate's loc is put in the contents
|
||||
for(var/obj/item/I in src.loc)
|
||||
if(I.density || I.anchored || I == src) continue
|
||||
I.loc = src
|
||||
|
||||
/obj/structure/closet/alter_health()
|
||||
return get_turf(src)
|
||||
|
||||
@@ -147,6 +155,13 @@
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/closet/attack_animal(mob/living/simple_animal/user as mob)
|
||||
if(user.wall_smash)
|
||||
visible_message("\red [user] destroys the [src]. ")
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
|
||||
// this should probably use dump_contents()
|
||||
/obj/structure/closet/blob_act()
|
||||
if(prob(75))
|
||||
|
||||
@@ -141,7 +141,6 @@
|
||||
/*
|
||||
* Radiation Closet
|
||||
*/
|
||||
|
||||
/obj/structure/closet/radiation
|
||||
name = "radiation suit closet"
|
||||
desc = "It's a storage unit for rad-protective suits."
|
||||
@@ -157,7 +156,7 @@
|
||||
/*
|
||||
* Bombsuit closet
|
||||
*/
|
||||
/obj/structure/closet/bombcloset
|
||||
/obj/structure/closet/bombcloset
|
||||
name = "\improper EOD closet"
|
||||
desc = "It's a storage unit for explosion-protective suits."
|
||||
icon_state = "bombsuit"
|
||||
|
||||
@@ -197,13 +197,6 @@
|
||||
// new /obj/item/weapon/pestspray(src)
|
||||
// new /obj/item/weapon/pestspray(src)
|
||||
|
||||
/obj/structure/closet/crate/New()
|
||||
..()
|
||||
spawn(1)
|
||||
if(!opened) // if closed, any item at the crate's loc is put in the contents
|
||||
for(var/obj/item/I in src.loc)
|
||||
if(I.density || I.anchored || I == src) continue
|
||||
I.loc = src
|
||||
|
||||
/obj/structure/closet/crate/secure/New()
|
||||
..()
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
var/turf/T = get_turf(src)
|
||||
user.visible_message("[user] tightens some bolts on the wall.", "You tighten the bolts on the wall.")
|
||||
if(!mineral)
|
||||
if(!mineral || mineral == "metal")
|
||||
T.ReplaceWithWall()
|
||||
else
|
||||
T.ReplaceWithMineralWall(mineral)
|
||||
|
||||
@@ -14,212 +14,208 @@
|
||||
var/destroyed = 0
|
||||
explosion_resistance = 5
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
/obj/structure/grille/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if(prob(50))
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if(prob(25))
|
||||
src.health -= 11
|
||||
healthcheck()
|
||||
return
|
||||
if(3.0)
|
||||
if(prob(25))
|
||||
src.health -= 11
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
/obj/structure/grille/blob_act()
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/structure/grille/Bumped(atom/user)
|
||||
if(ismob(user)) shock(user, 70)
|
||||
|
||||
|
||||
blob_act()
|
||||
del(src)
|
||||
return
|
||||
|
||||
Bumped(atom/user)
|
||||
if(ismob(user)) shock(user, 70)
|
||||
/obj/structure/grille/meteorhit(var/obj/M)
|
||||
if (M.icon_state == "flaming")
|
||||
src.health -= 2
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
|
||||
meteorhit(var/obj/M)
|
||||
if (M.icon_state == "flaming")
|
||||
src.health -= 2
|
||||
healthcheck()
|
||||
return
|
||||
/obj/structure/grille/attack_hand(var/mob/user)
|
||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
user.visible_message("[user.name] kicks the [src.name].", \
|
||||
"You kick the [src.name].", \
|
||||
"You hear a noise")
|
||||
if((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
|
||||
src.health -= 5
|
||||
else if(!shock(user, 70))
|
||||
src.health -= 3
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
|
||||
attack_hand(var/mob/user)
|
||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
user.visible_message("[user.name] kicks the [src.name].", \
|
||||
"You kick the [src.name].", \
|
||||
"You hear a noise")
|
||||
if((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
|
||||
src.health -= 5
|
||||
else if(!shock(user, 70))
|
||||
src.health -= 3
|
||||
/obj/structure/grille/attack_paw(var/mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
|
||||
/obj/structure/grille/attack_alien(var/mob/user)
|
||||
if (istype(usr, /mob/living/carbon/alien/larva)) return
|
||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
user.visible_message("[user.name] mangles the [src.name].", \
|
||||
"You mangle the [src.name].", \
|
||||
"You hear a noise")
|
||||
if(!shock(usr, 70))
|
||||
src.health -= 5
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
/obj/structure/grille/attack_metroid(var/mob/user)
|
||||
if(!istype(usr, /mob/living/carbon/metroid/adult)) return
|
||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
user.visible_message("[user.name] smashes against the [src.name].", \
|
||||
"You smash against the [src.name].", \
|
||||
"You hear a noise")
|
||||
src.health -= rand(2,3)
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
attack_paw(var/mob/user)
|
||||
attack_hand(user)
|
||||
/obj/structure/grille/attack_animal(var/mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0) return
|
||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
M.visible_message("[M.name] smashes against the [src.name].", \
|
||||
"You smash against the [src.name].", \
|
||||
"You hear a noise")
|
||||
src.health -= M.melee_damage_upper
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
|
||||
attack_alien(var/mob/user)
|
||||
if (istype(usr, /mob/living/carbon/alien/larva)) return
|
||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
user.visible_message("[user.name] mangles the [src.name].", \
|
||||
"You mangle the [src.name].", \
|
||||
"You hear a noise")
|
||||
if(!shock(usr, 70))
|
||||
src.health -= 5
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
attack_metroid(var/mob/user)
|
||||
if(!istype(usr, /mob/living/carbon/metroid/adult)) return
|
||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
user.visible_message("[user.name] smashes against the [src.name].", \
|
||||
"You smash against the [src.name].", \
|
||||
"You hear a noise")
|
||||
src.health -= rand(2,3)
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
attack_animal(var/mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0) return
|
||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
M.visible_message("[M.name] smashes against the [src.name].", \
|
||||
"You smash against the [src.name].", \
|
||||
"You hear a noise")
|
||||
src.health -= M.melee_damage_upper
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
if(istype(mover) && mover.checkpass(PASSGRILLE))
|
||||
return 1
|
||||
/obj/structure/grille/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
if(istype(mover) && mover.checkpass(PASSGRILLE))
|
||||
return 1
|
||||
else
|
||||
if (istype(mover, /obj/item/projectile))
|
||||
return prob(30)
|
||||
else
|
||||
if (istype(mover, /obj/item/projectile))
|
||||
return prob(30)
|
||||
return !src.density
|
||||
|
||||
|
||||
/obj/structure/grille/attackby(obj/item/weapon/W, mob/user)
|
||||
if(iswirecutter(W))
|
||||
if(!shock(user, 100))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
|
||||
src.health = 0
|
||||
if(!destroyed)
|
||||
src.health = -100
|
||||
else if ((isscrewdriver(W)) && (istype(src.loc, /turf/simulated) || src.anchored))
|
||||
if(!shock(user, 90))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
src.anchored = !( src.anchored )
|
||||
user << (src.anchored ? "You have fastened the grille to the floor." : "You have unfastened the grill.")
|
||||
for(var/mob/O in oviewers())
|
||||
O << text("\red [user] [src.anchored ? "fastens" : "unfastens"] the grille.")
|
||||
return
|
||||
else if( istype(W,/obj/item/stack/sheet/rglass) || istype(W,/obj/item/stack/sheet/glass) )
|
||||
var/dir_to_set = 1
|
||||
if(src.loc == usr.loc)
|
||||
dir_to_set = usr.dir
|
||||
else
|
||||
if( ( src.x == usr.x ) || (src.y == usr.y) ) //Only supposed to work for cardinal directions.
|
||||
if( src.x == usr.x )
|
||||
if( src.y > usr.y )
|
||||
dir_to_set = 2
|
||||
else
|
||||
dir_to_set = 1
|
||||
else if( src.y == usr.y )
|
||||
if( src.x > usr.x )
|
||||
dir_to_set = 8
|
||||
else
|
||||
dir_to_set = 4
|
||||
else
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/structure/cable/C = T.get_cable_node()
|
||||
if(C)
|
||||
if (C.powernet.avail)
|
||||
if (istype(mover, /obj/item))
|
||||
var/obj/item/i = mover
|
||||
if (i.m_amt)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
return !src.density
|
||||
|
||||
|
||||
attackby(obj/item/weapon/W, mob/user)
|
||||
if(iswirecutter(W))
|
||||
if(!shock(user, 100))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
|
||||
src.health = 0
|
||||
if(!destroyed)
|
||||
src.health = -100
|
||||
else if ((isscrewdriver(W)) && (istype(src.loc, /turf/simulated) || src.anchored))
|
||||
if(!shock(user, 90))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
src.anchored = !( src.anchored )
|
||||
user << (src.anchored ? "You have fastened the grille to the floor." : "You have unfastened the grill.")
|
||||
for(var/mob/O in oviewers())
|
||||
O << text("\red [user] [src.anchored ? "fastens" : "unfastens"] the grille.")
|
||||
usr << "\red You can't reach there.."
|
||||
return //Only works for cardinal direcitons, diagonals aren't supposed to work like this.
|
||||
for(var/obj/structure/window/WINDOW in src.loc)
|
||||
if(WINDOW.dir == dir_to_set)
|
||||
usr << "\red There is already a window facing this way there."
|
||||
return
|
||||
else if( istype(W,/obj/item/stack/sheet/rglass) || istype(W,/obj/item/stack/sheet/glass) )
|
||||
var/dir_to_set = 1
|
||||
if(src.loc == usr.loc)
|
||||
dir_to_set = usr.dir
|
||||
else
|
||||
if( ( src.x == usr.x ) || (src.y == usr.y) ) //Only supposed to work for cardinal directions.
|
||||
if( src.x == usr.x )
|
||||
if( src.y > usr.y )
|
||||
dir_to_set = 2
|
||||
else
|
||||
dir_to_set = 1
|
||||
else if( src.y == usr.y )
|
||||
if( src.x > usr.x )
|
||||
dir_to_set = 8
|
||||
else
|
||||
dir_to_set = 4
|
||||
else
|
||||
usr << "\red You can't reach there.."
|
||||
return //Only works for cardinal direcitons, diagonals aren't supposed to work like this.
|
||||
usr << "\blue You start placing the window"
|
||||
if(do_after(user,20))
|
||||
if(!src) return //Grille destroyed while waiting
|
||||
for(var/obj/structure/window/WINDOW in src.loc)
|
||||
if(WINDOW.dir == dir_to_set)
|
||||
if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
|
||||
usr << "\red There is already a window facing this way there."
|
||||
return
|
||||
usr << "\blue You start placing the window"
|
||||
if(do_after(user,20))
|
||||
if(!src) return //Grille destroyed while waiting
|
||||
for(var/obj/structure/window/WINDOW in src.loc)
|
||||
if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
|
||||
usr << "\red There is already a window facing this way there."
|
||||
return
|
||||
var/obj/structure/window/WD
|
||||
if(istype(W,/obj/item/stack/sheet/rglass))
|
||||
WD = new/obj/structure/window(src.loc,1) //reinforced window
|
||||
else
|
||||
WD = new/obj/structure/window(src.loc,0) //normal window
|
||||
WD.dir = dir_to_set
|
||||
WD.ini_dir = dir_to_set
|
||||
WD.anchored = 0
|
||||
WD.state = 0
|
||||
var/obj/item/stack/ST = W
|
||||
ST.use(1)
|
||||
usr << "\blue You place the [WD] on the [src]"
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/shard))
|
||||
src.health -= W.force * 0.1
|
||||
else if(!shock(user, 70))
|
||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
switch(W.damtype)
|
||||
if("fire")
|
||||
src.health -= W.force
|
||||
if("brute")
|
||||
src.health -= W.force * 0.1
|
||||
src.healthcheck()
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
proc/healthcheck()
|
||||
if (src.health <= 0)
|
||||
if (!( src.destroyed ))
|
||||
src.icon_state = "brokengrille"
|
||||
src.density = 0
|
||||
src.destroyed = 1
|
||||
new /obj/item/stack/rods( src.loc )
|
||||
|
||||
var/obj/structure/window/WD
|
||||
if(istype(W,/obj/item/stack/sheet/rglass))
|
||||
WD = new/obj/structure/window(src.loc,1) //reinforced window
|
||||
else
|
||||
if (src.health <= -10.0)
|
||||
new /obj/item/stack/rods( src.loc )
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
WD = new/obj/structure/window(src.loc,0) //normal window
|
||||
WD.dir = dir_to_set
|
||||
WD.ini_dir = dir_to_set
|
||||
WD.anchored = 0
|
||||
WD.state = 0
|
||||
var/obj/item/stack/ST = W
|
||||
ST.use(1)
|
||||
usr << "\blue You place the [WD] on the [src]"
|
||||
return
|
||||
else if(istype(W, /obj/item/weapon/shard))
|
||||
src.health -= W.force * 0.1
|
||||
else if(!shock(user, 70))
|
||||
playsound(src.loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
switch(W.damtype)
|
||||
if("fire")
|
||||
src.health -= W.force
|
||||
if("brute")
|
||||
src.health -= W.force * 0.1
|
||||
src.healthcheck()
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/grille/proc/healthcheck()
|
||||
if (src.health <= 0)
|
||||
if (!( src.destroyed ))
|
||||
src.icon_state = "brokengrille"
|
||||
src.density = 0
|
||||
src.destroyed = 1
|
||||
new /obj/item/stack/rods( src.loc )
|
||||
|
||||
else
|
||||
if (src.health <= -10.0)
|
||||
new /obj/item/stack/rods( src.loc )
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
return
|
||||
|
||||
// shock user with probability prb (if all connections & power are working)
|
||||
// returns 1 if shocked, 0 otherwise
|
||||
|
||||
proc/shock(mob/user, prb)
|
||||
if(!anchored || destroyed) // anchored/destroyed grilles are never connected
|
||||
return 0
|
||||
if(!prob(prb))
|
||||
return 0
|
||||
if(!in_range(src, usr))//To prevent TK and mech users from getting shocked
|
||||
return 0
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/structure/cable/C = T.get_cable_node()
|
||||
if(C)
|
||||
if (electrocute_mob(user, C, src))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
/obj/structure/grille/proc/shock(mob/user, prb)
|
||||
if(!anchored || destroyed) // anchored/destroyed grilles are never connected
|
||||
return 0
|
||||
if(!prob(prb))
|
||||
return 0
|
||||
if(!in_range(src, usr))//To prevent TK and mech users from getting shocked
|
||||
return 0
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/structure/cable/C = T.get_cable_node()
|
||||
if(C)
|
||||
if (electrocute_mob(user, C, src))
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
return 0
|
||||
|
||||
/obj/structure/grille/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(!destroyed)
|
||||
if(exposed_temperature > T0C + 1500)
|
||||
src.health -= 1
|
||||
healthcheck()
|
||||
..()
|
||||
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
SAFES
|
||||
FLOOR SAFES
|
||||
*/
|
||||
|
||||
//SAFES
|
||||
/obj/structure/safe
|
||||
name = "safe"
|
||||
desc = "A huge chunk of metal with a dial embedded in it. Fine print on the dial reads \"Scarborough Arms - 2 tumbler safe, guaranteed thermite resistant, explosion resistant, and assistant resistant.\""
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon_state = "safe"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/open = 0 //is the safe open?
|
||||
var/tumbler_1_pos //the tumbler position- from 0 to 72
|
||||
var/tumbler_1_open //the tumbler position to open at- 0 to 72
|
||||
var/tumbler_2_pos
|
||||
var/tumbler_2_open
|
||||
var/dial = 0 //where is the dial pointing?
|
||||
var/space = 0 //the combined w_class of everything in the safe
|
||||
var/maxspace = 24 //the maximum combined w_class of stuff in the safe
|
||||
|
||||
|
||||
/obj/structure/safe/New()
|
||||
tumbler_1_pos = rand(0, 72)
|
||||
tumbler_1_open = rand(0, 72)
|
||||
|
||||
tumbler_2_pos = rand(0, 72)
|
||||
tumbler_2_open = rand(0, 72)
|
||||
|
||||
|
||||
/obj/structure/safe/initialize()
|
||||
for(var/obj/item/I in loc)
|
||||
if(space >= maxspace)
|
||||
return
|
||||
if(I.w_class + space <= maxspace)
|
||||
space += I.w_class
|
||||
I.loc = src
|
||||
|
||||
|
||||
/obj/structure/safe/proc/check_unlocked(mob/user as mob, canhear)
|
||||
if(user && canhear)
|
||||
if(tumbler_1_pos == tumbler_1_open)
|
||||
user << "<span class='notice'>You hear a [pick("tonk", "krunk", "plunk")] from [src].</span>"
|
||||
if(tumbler_2_pos == tumbler_2_open)
|
||||
user << "<span class='notice'>You hear a [pick("tink", "krink", "plink")] from [src].</span>"
|
||||
if(tumbler_1_pos == tumbler_1_open && tumbler_2_pos == tumbler_2_open)
|
||||
if(user) visible_message("<b>[pick("Spring", "Sprang", "Sproing", "Clunk", "Krunk")]!</b>")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/obj/structure/safe/proc/decrement(num)
|
||||
num -= 1
|
||||
if(num < 0)
|
||||
num = 71
|
||||
return num
|
||||
|
||||
|
||||
/obj/structure/safe/proc/increment(num)
|
||||
num += 1
|
||||
if(num > 71)
|
||||
num = 0
|
||||
return num
|
||||
|
||||
|
||||
/obj/structure/safe/update_icon()
|
||||
if(open)
|
||||
icon_state = "[initial(icon_state)]-open"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
|
||||
/obj/structure/safe/attack_hand(mob/user as mob)
|
||||
user.machine = src
|
||||
var/dat = "<center>"
|
||||
dat += "<a href='?src=\ref[src];open=1'>[open ? "Close" : "Open"] [src]</a> | <a href='?src=\ref[src];decrement=1'>-</a> [dial * 5] <a href='?src=\ref[src];increment=1'>+</a>"
|
||||
if(open)
|
||||
dat += "<table>"
|
||||
for(var/i = contents.len, i>=1, i--)
|
||||
var/obj/item/P = contents[i]
|
||||
dat += "<tr><td><a href='?src=\ref[src];retrieve=\ref[P]'>[P.name]</a></td></tr>"
|
||||
dat += "</table></center>"
|
||||
user << browse("<html><head><title>[name]</title></head><body>[dat]</body></html>", "window=safe;size=350x300")
|
||||
|
||||
|
||||
/obj/structure/safe/Topic(href, href_list)
|
||||
if(!ishuman(usr)) return
|
||||
var/mob/living/carbon/human/user = usr
|
||||
|
||||
var/canhear = 0
|
||||
if(istype(user.l_hand, /obj/item/clothing/tie/stethoscope) || istype(user.r_hand, /obj/item/clothing/tie/stethoscope))
|
||||
canhear = 1
|
||||
|
||||
if(href_list["open"])
|
||||
if(check_unlocked())
|
||||
user << "<span class='notice'>You [open ? "close" : "open"] [src].</span>"
|
||||
open = !open
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
return
|
||||
else
|
||||
user << "<span class='notice'>You can't [open ? "close" : "open"] [src], the lock is engaged!</span>"
|
||||
return
|
||||
|
||||
if(href_list["decrement"])
|
||||
dial = decrement(dial)
|
||||
if(dial == tumbler_1_pos + 1 || dial == tumbler_1_pos - 71)
|
||||
tumbler_1_pos = decrement(tumbler_1_pos)
|
||||
if(canhear)
|
||||
user << "<span class='notice'>You hear a [pick("clack", "scrape", "clank")] from [src].</span>"
|
||||
if(tumbler_1_pos == tumbler_2_pos + 37 || tumbler_1_pos == tumbler_2_pos - 35)
|
||||
tumbler_2_pos = decrement(tumbler_2_pos)
|
||||
if(canhear)
|
||||
user << "<span class='notice'>You hear a [pick("click", "chink", "clink")] from [src].</span>"
|
||||
check_unlocked(user, canhear)
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
if(href_list["increment"])
|
||||
dial = increment(dial)
|
||||
if(dial == tumbler_1_pos - 1 || dial == tumbler_1_pos + 71)
|
||||
tumbler_1_pos = increment(tumbler_1_pos)
|
||||
if(canhear)
|
||||
user << "<span class='notice'>You hear a [pick("clack", "scrape", "clank")] from [src].</span>"
|
||||
if(tumbler_1_pos == tumbler_2_pos - 37 || tumbler_1_pos == tumbler_2_pos + 35)
|
||||
tumbler_2_pos = increment(tumbler_2_pos)
|
||||
if(canhear)
|
||||
user << "<span class='notice'>You hear a [pick("click", "chink", "clink")] from [src].</span>"
|
||||
check_unlocked(user, canhear)
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
if(href_list["retrieve"])
|
||||
user << browse("", "window=safe") // Close the menu
|
||||
|
||||
var/obj/item/P = locate(href_list["retrieve"])
|
||||
if(P && in_range(src, user))
|
||||
user.put_in_hands(P)
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
/obj/structure/safe/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(open)
|
||||
if(I.w_class + space <= maxspace)
|
||||
space += I.w_class
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
user << "<span class='notice'>You put [I] in [src].</span>"
|
||||
updateUsrDialog()
|
||||
return
|
||||
else
|
||||
user << "<span class='notice'>[I] won't fit in [src].</span>"
|
||||
return
|
||||
else
|
||||
if(istype(I, /obj/item/clothing/tie/stethoscope))
|
||||
user << "Hold [I] in one of your hands while you manipulate the dial."
|
||||
return
|
||||
|
||||
|
||||
obj/structure/safe/blob_act()
|
||||
return
|
||||
|
||||
|
||||
obj/structure/safe/ex_act(severity)
|
||||
return
|
||||
|
||||
|
||||
obj/structure/safe/meteorhit(obj/O as obj)
|
||||
return
|
||||
|
||||
|
||||
//FLOOR SAFES
|
||||
/obj/structure/safe/floor
|
||||
name = "floor safe"
|
||||
icon_state = "floorsafe"
|
||||
density = 0
|
||||
level = 1 //underfloor
|
||||
layer = 2.5
|
||||
|
||||
|
||||
/obj/structure/safe/floor/initialize()
|
||||
..()
|
||||
var/turf/T = loc
|
||||
hide(T.intact)
|
||||
|
||||
|
||||
/obj/structure/safe/floor/hide(var/intact)
|
||||
invisibility = intact ? 101 : 0
|
||||
@@ -49,6 +49,11 @@
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(!usr || !isturf(usr.loc))
|
||||
return
|
||||
if(usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
src.dir = turn(src.dir, 90)
|
||||
handle_rotation()
|
||||
return
|
||||
|
||||
@@ -243,9 +243,7 @@
|
||||
/obj/structure/table/attack_paw(mob/user as mob)
|
||||
if ((HULK in usr.mutations))
|
||||
usr << "\blue You destroy the table."
|
||||
for(var/mob/O in oviewers())
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << "\red [user] smashes the table apart!"
|
||||
visible_message("\red [user] smashes the table apart!")
|
||||
if(istype(src, /obj/structure/table/reinforced))
|
||||
new /obj/item/weapon/table_parts/reinforced( src.loc )
|
||||
else if(istype(src, /obj/structure/table/woodentable))
|
||||
@@ -258,18 +256,14 @@
|
||||
step(user, get_dir(user, src))
|
||||
if (user.loc == src.loc)
|
||||
user.layer = TURF_LAYER
|
||||
for(var/mob/O in oviewers())
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << "[user] hides under the table!"
|
||||
visible_message("[user] hides under the table!")
|
||||
//Foreach goto(69)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/table/attack_alien(mob/user as mob) //Removed code for larva since it doesn't work. Previous code is now a larva ability. /N
|
||||
usr << "\green You destroy the table."
|
||||
for(var/mob/O in oviewers())
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << "\red [user] slices the table apart!"
|
||||
visible_message("\red [user] slices the table apart!")
|
||||
if(istype(src, /obj/structure/table/reinforced))
|
||||
new /obj/item/weapon/table_parts/reinforced( src.loc )
|
||||
else if(istype(src, /obj/structure/table/woodentable))
|
||||
@@ -281,12 +275,10 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/table/attack_animal(mob/living/simple_animal/user as mob) //Removed code for larva since it doesn't work. Previous code is now a larva ability. /N
|
||||
/obj/structure/table/attack_animal(mob/living/simple_animal/user as mob)
|
||||
if(user.wall_smash)
|
||||
usr << "\red You destroy the table."
|
||||
for(var/mob/O in oviewers())
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << "\red [user] smashes the table apart!"
|
||||
visible_message("\red [user] smahes the table apart!")
|
||||
if(istype(src, /obj/structure/table/reinforced))
|
||||
new /obj/item/weapon/table_parts/reinforced( src.loc )
|
||||
else if(istype(src, /obj/structure/table/woodentable))
|
||||
@@ -303,9 +295,7 @@
|
||||
/obj/structure/table/attack_hand(mob/user as mob)
|
||||
if ((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
|
||||
usr << "\blue You destroy the table."
|
||||
for(var/mob/O in oviewers())
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << "\red [user] smashes the table apart!"
|
||||
visible_message("\red [user] smahes the table apart!")
|
||||
if(istype(src, /obj/structure/table/reinforced))
|
||||
new /obj/item/weapon/table_parts/reinforced( src.loc )
|
||||
else if(istype(src, /obj/structure/table/woodentable))
|
||||
@@ -346,9 +336,7 @@
|
||||
return
|
||||
G.affecting.loc = src.loc
|
||||
G.affecting.Weaken(5)
|
||||
for(var/mob/O in viewers(world.view, src))
|
||||
if (O.client)
|
||||
O << "\red [G.assailant] puts [G.affecting] on the table."
|
||||
visible_message("\red [G.assailant] puts [G.affecting] on the table.")
|
||||
del(W)
|
||||
return
|
||||
|
||||
@@ -400,9 +388,7 @@
|
||||
return
|
||||
G.affecting.loc = src.loc
|
||||
G.affecting.Weaken(5)
|
||||
for(var/mob/O in viewers(world.view, src))
|
||||
if (O.client)
|
||||
O << "\red [G.assailant] puts [G.affecting] on the wooden table."
|
||||
visible_message("\red [G.assailant] puts [G.affecting] on the table.")
|
||||
del(W)
|
||||
return
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
@@ -451,9 +437,7 @@
|
||||
return
|
||||
G.affecting.loc = src.loc
|
||||
G.affecting.Weaken(5)
|
||||
for(var/mob/O in viewers(world.view, src))
|
||||
if (O.client)
|
||||
O << "\red [G.assailant] puts [G.affecting] on the reinforced table."
|
||||
visible_message("\red [G.assailant] puts [G.affecting] on the table.")
|
||||
del(W)
|
||||
return
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/obj/structure/dispenser
|
||||
name = "tank storage unit"
|
||||
desc = "A simple yet bulky storage device for gas tanks. Has room for up to ten oxygen tanks, and ten plasma tanks."
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "dispenser"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/oxygentanks = 10
|
||||
var/plasmatanks = 10
|
||||
var/list/oxytanks = list() //sorry for the similar var names
|
||||
var/list/platanks = list()
|
||||
|
||||
|
||||
/obj/structure/dispenser/oxygen
|
||||
plasmatanks = 0
|
||||
|
||||
/obj/structure/dispenser/plasma
|
||||
oxygentanks = 0
|
||||
|
||||
|
||||
/obj/structure/dispenser/New()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/structure/dispenser/update_icon()
|
||||
overlays = null
|
||||
switch(oxygentanks)
|
||||
if(1 to 3) overlays += "oxygen-[oxygentanks]"
|
||||
if(4 to INFINITY) overlays += "oxygen-4"
|
||||
switch(plasmatanks)
|
||||
if(1 to 4) overlays += "plasma-[plasmatanks]"
|
||||
if(5 to INFINITY) overlays += "plasma-5"
|
||||
|
||||
|
||||
/obj/structure/dispenser/attack_hand(mob/user as mob)
|
||||
user.machine = src
|
||||
var/dat = "[src]<br><br>"
|
||||
dat += "Oxygen tanks: [oxygentanks] - [oxygentanks ? "<A href='?src=\ref[src];oxygen=1'>Dispense</A>" : "empty"]<br>"
|
||||
dat += "Plasma tanks: [plasmatanks] - [plasmatanks ? "<A href='?src=\ref[src];plasma=1'>Dispense</A>" : "empty"]"
|
||||
user << browse(dat, "window=dispenser")
|
||||
onclose(user, "dispenser")
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/dispenser/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/tank/oxygen) || istype(I, /obj/item/weapon/tank/air) || istype(I, /obj/item/weapon/tank/anesthetic))
|
||||
if(oxygentanks < 10)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
oxytanks.Add(I)
|
||||
oxygentanks++
|
||||
user << "<span class='notice'>You put [I] in [src].</span>"
|
||||
else
|
||||
user << "<span class='notice'>[src] is full.</span>"
|
||||
if(istype(I, /obj/item/weapon/tank/plasma))
|
||||
if(plasmatanks < 10)
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
platanks.Add(I)
|
||||
plasmatanks++
|
||||
user << "<span class='notice'>You put [I] in [src].</span>"
|
||||
else
|
||||
user << "<span class='notice'>[src] is full.</span>"
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
/obj/structure/dispenser/Topic(href, href_list)
|
||||
if(usr.stat || usr.restrained())
|
||||
return
|
||||
if(get_dist(src, usr) <= 1)
|
||||
usr.machine = src
|
||||
if(href_list["oxygen"])
|
||||
if(oxygentanks > 0)
|
||||
var/obj/item/weapon/tank/oxygen/O
|
||||
if(oxytanks.len == oxygentanks)
|
||||
O = oxytanks[1]
|
||||
oxytanks.Remove(O)
|
||||
else
|
||||
O = new /obj/item/weapon/tank/oxygen(loc)
|
||||
O.loc = loc
|
||||
usr << "<span class='notice'>You take [O] out of [src].</span>"
|
||||
oxygentanks--
|
||||
update_icon()
|
||||
if(href_list["plasma"])
|
||||
if(plasmatanks > 0)
|
||||
var/obj/item/weapon/tank/plasma/P
|
||||
if(platanks.len == plasmatanks)
|
||||
P = platanks[1]
|
||||
platanks.Remove(P)
|
||||
else
|
||||
P = new /obj/item/weapon/tank/plasma(loc)
|
||||
P.loc = loc
|
||||
usr << "<span class='notice'>You take [P] out of [src].</span>"
|
||||
plasmatanks--
|
||||
update_icon()
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
else
|
||||
usr << browse(null, "window=dispenser")
|
||||
return
|
||||
return
|
||||
@@ -227,33 +227,38 @@
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 75, 1)
|
||||
user << (state ? "You have pried the window into the frame." : "You have pried the window out of the frame.")
|
||||
else
|
||||
|
||||
var/aforce = W.force
|
||||
if(reinf) aforce /= 2.0
|
||||
if(W.damtype == BRUTE || W.damtype == BURN)
|
||||
src.health = max(0, src.health - aforce)
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
if (src.health <= 7)
|
||||
src.anchored = 0
|
||||
update_nearby_icons()
|
||||
step(src, get_dir(user, src))
|
||||
if (src.health <= 0)
|
||||
if (src.dir == SOUTHWEST)
|
||||
var/index = null
|
||||
index = 0
|
||||
while(index < 2)
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
if(reinf) new /obj/item/stack/rods( src.loc)
|
||||
index++
|
||||
else
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
if(reinf) new /obj/item/stack/rods( src.loc)
|
||||
src.density = 0
|
||||
del(src)
|
||||
return
|
||||
hit(W.force)
|
||||
if (src.health <= 7)
|
||||
src.anchored = 0
|
||||
update_nearby_icons()
|
||||
step(src, get_dir(user, src))
|
||||
else
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/structure/window/proc/hit(var/damage, var/sound_effect = 1)
|
||||
|
||||
if(reinf) damage /= 2.0
|
||||
src.health = max(0, src.health - damage)
|
||||
if(sound_effect)
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||
if (src.health <= 0)
|
||||
if (src.dir == SOUTHWEST)
|
||||
var/index = null
|
||||
index = 0
|
||||
while(index < 2)
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
if(reinf) new /obj/item/stack/rods( src.loc)
|
||||
index++
|
||||
else
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
if(reinf) new /obj/item/stack/rods( src.loc)
|
||||
src.density = 0
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/window/verb/rotate()
|
||||
set name = "Rotate Window Counter-Clockwise"
|
||||
@@ -409,6 +414,11 @@
|
||||
|
||||
return
|
||||
|
||||
/obj/structure/window/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > T0C + 800)
|
||||
hit(round(exposed_volume / 100), 0)
|
||||
..()
|
||||
|
||||
|
||||
|
||||
/obj/structure/window/basic
|
||||
|
||||
Reference in New Issue
Block a user