mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 07:27:57 +01:00
Merge branch 'master' into findnreplace
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
to_chat(user, "<span class='notice'>You cannot hang [W] on [src]</span>")
|
||||
return ..()
|
||||
|
||||
/obj/structure/coatrack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
/obj/structure/coatrack/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
var/can_hang = 0
|
||||
for(var/T in allowed)
|
||||
if(istype(mover,T))
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
/obj/structure/closet/alter_health()
|
||||
return get_turf(src)
|
||||
|
||||
/obj/structure/closet/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0 || wall_mounted)) return 1
|
||||
/obj/structure/closet/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(height==0 || wall_mounted) return 1
|
||||
return (!density)
|
||||
|
||||
/obj/structure/closet/proc/can_open()
|
||||
@@ -262,7 +262,8 @@
|
||||
return
|
||||
if(isrobot(user))
|
||||
return
|
||||
if(!usr.drop_item())
|
||||
if(!user.drop_item()) //couldn't drop the item
|
||||
to_chat(user, "<span class='notice'>\The [W] is stuck to your hand, you cannot put it in \the [src]!</span>")
|
||||
return
|
||||
if(W)
|
||||
W.forceMove(loc)
|
||||
|
||||
@@ -78,7 +78,9 @@
|
||||
to_chat(user, "<span class='notice'>The locker is too small to stuff [W:affecting] into!</span>")
|
||||
if(isrobot(user))
|
||||
return
|
||||
user.drop_item()
|
||||
if(!user.drop_item()) //couldn't drop the item
|
||||
to_chat(user, "<span class='notice'>\The [W] is stuck to your hand, you cannot put it in \the [src]!</span>")
|
||||
return
|
||||
if(W)
|
||||
W.forceMove(loc)
|
||||
else if((istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && !broken)
|
||||
|
||||
@@ -115,12 +115,6 @@
|
||||
airlock_type = "/multi_tile/glass"
|
||||
glass = -1 //To prevent bugs in deconstruction process.
|
||||
|
||||
/obj/structure/door_assembly/door_assembly_cult
|
||||
base_name = "cult airlock assembly"
|
||||
icon = 'icons/obj/doors/Doorcult.dmi'
|
||||
base_icon_state ="construction"
|
||||
airlock_type = "/cult"
|
||||
|
||||
/obj/structure/door_assembly/multi_tile/New()
|
||||
if(dir in list(EAST, WEST))
|
||||
bound_width = width * world.icon_size
|
||||
@@ -146,7 +140,6 @@
|
||||
airlock_type = "/cult"
|
||||
glass = -1
|
||||
|
||||
|
||||
/obj/structure/door_assembly/door_assembly_cultruned
|
||||
icon = 'icons/obj/doors/Doorcultruned.dmi'
|
||||
base_icon_state = "construction"
|
||||
@@ -154,7 +147,6 @@
|
||||
airlock_type = "/cult/runed"
|
||||
glass = -1
|
||||
|
||||
|
||||
/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = copytext(stripped_input(user, "Enter the name for the door.", src.name, src.created_name),1,MAX_NAME_LEN)
|
||||
@@ -292,6 +284,7 @@
|
||||
else
|
||||
path = text2path("/obj/machinery/door/airlock[airlock_type]")
|
||||
var/obj/machinery/door/airlock/door = new path(src.loc)
|
||||
door.setDir(dir)
|
||||
door.assembly_type = type
|
||||
door.electronics = src.electronics
|
||||
if(src.electronics.one_access)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/obj/structure/window/full/CheckExit(atom/movable/O as mob|obj, target as turf)
|
||||
return 1
|
||||
|
||||
/obj/structure/window/full/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
/obj/structure/window/full/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -7,11 +7,16 @@
|
||||
anchored = 1
|
||||
flags = CONDUCT
|
||||
pressure_resistance = 5*ONE_ATMOSPHERE
|
||||
layer = 2.9
|
||||
var/health = 10
|
||||
var/destroyed = 0
|
||||
layer = BELOW_OBJ_LAYER
|
||||
level = 3
|
||||
|
||||
var/health = 10
|
||||
var/broken = 0
|
||||
var/can_deconstruct = TRUE
|
||||
var/rods_type = /obj/item/stack/rods
|
||||
var/rods_amount = 2
|
||||
var/rods_broken = 1
|
||||
var/grille_type = null
|
||||
var/broken_type = /obj/structure/grille/broken
|
||||
|
||||
/obj/structure/grille/fence/
|
||||
var/width = 3
|
||||
@@ -26,7 +31,6 @@
|
||||
bound_width = world.icon_size
|
||||
bound_height = width * world.icon_size
|
||||
|
||||
|
||||
/obj/structure/grille/fence/east_west
|
||||
//width=80
|
||||
//height=42
|
||||
@@ -38,19 +42,23 @@
|
||||
icon='icons/fence-ns.dmi'
|
||||
|
||||
/obj/structure/grille/ex_act(severity)
|
||||
qdel(src)
|
||||
switch(severity)
|
||||
if(1)
|
||||
qdel(src)
|
||||
else
|
||||
take_damage(rand(5,10), BRUTE, 0)
|
||||
|
||||
/obj/structure/grille/blob_act()
|
||||
qdel(src)
|
||||
if(!broken)
|
||||
obj_break()
|
||||
|
||||
/obj/structure/grille/Bumped(atom/user)
|
||||
if(ismob(user)) shock(user, 70)
|
||||
if(ismob(user))
|
||||
shock(user, 70)
|
||||
|
||||
|
||||
/obj/structure/grille/attack_hand(mob/living/user as mob)
|
||||
/obj/structure/grille/attack_hand(mob/living/user)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(src)
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
user.visible_message("<span class='warning'>[user] kicks [src].</span>", \
|
||||
"<span class='warning'>You kick [src].</span>", \
|
||||
"You hear twisting metal.")
|
||||
@@ -58,26 +66,23 @@
|
||||
if(shock(user, 70))
|
||||
return
|
||||
if(HULK in user.mutations)
|
||||
health -= 5
|
||||
take_damage(5)
|
||||
else
|
||||
health -= 1
|
||||
healthcheck()
|
||||
take_damage(rand(1,2))
|
||||
|
||||
/obj/structure/grille/attack_alien(mob/living/user as mob)
|
||||
if(istype(user, /mob/living/carbon/alien/larva)) return
|
||||
/obj/structure/grille/attack_alien(mob/living/user)
|
||||
if(istype(user, /mob/living/carbon/alien/larva))
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(src)
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
user.visible_message("<span class='warning'>[user] mangles [src].</span>", \
|
||||
"<span class='warning'>You mangle [src].</span>", \
|
||||
"You hear twisting metal.")
|
||||
|
||||
if(!shock(user, 70))
|
||||
health -= 5
|
||||
healthcheck()
|
||||
return
|
||||
take_damage(5)
|
||||
|
||||
/obj/structure/grille/attack_slime(mob/living/user as mob)
|
||||
/obj/structure/grille/attack_slime(mob/living/user)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(src)
|
||||
var/mob/living/carbon/slime/S = user
|
||||
@@ -89,12 +94,11 @@
|
||||
"<span class='warning'>You smash against [src].</span>", \
|
||||
"You hear twisting metal.")
|
||||
|
||||
health -= rand(2,3)
|
||||
healthcheck()
|
||||
return
|
||||
take_damage(rand(1,2))
|
||||
|
||||
/obj/structure/grille/attack_animal(var/mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0) return
|
||||
/obj/structure/grille/attack_animal(mob/living/simple_animal/M)
|
||||
if(M.melee_damage_upper == 0 || (M.melee_damage_type != BRUTE && M.melee_damage_type != BURN))
|
||||
return
|
||||
M.changeNext_move(CLICK_CD_MELEE)
|
||||
M.do_attack_animation(src)
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
@@ -102,18 +106,15 @@
|
||||
"<span class='warning'>You smash against [src].</span>", \
|
||||
"You hear twisting metal.")
|
||||
|
||||
health -= M.melee_damage_upper
|
||||
healthcheck()
|
||||
return
|
||||
take_damage(rand(M.melee_damage_lower,M.melee_damage_upper), M.melee_damage_type)
|
||||
|
||||
/obj/structure/grille/mech_melee_attack(obj/mecha/M)
|
||||
if(..())
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
health -= M.force * 0.5
|
||||
healthcheck()
|
||||
take_damage(M.force * 0.5, M.damtype)
|
||||
|
||||
/obj/structure/grille/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
/obj/structure/grille/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(height==0)
|
||||
return 1
|
||||
if(istype(mover) && mover.checkpass(PASSGRILLE))
|
||||
return 1
|
||||
else
|
||||
@@ -128,118 +129,144 @@
|
||||
var/atom/movable/mover = caller
|
||||
. = . || mover.checkpass(PASSGRILLE)
|
||||
|
||||
/obj/structure/grille/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!Proj)
|
||||
return
|
||||
..()
|
||||
if((Proj.damage_type != STAMINA)) //Grilles can't be exhausted to death
|
||||
src.health -= Proj.damage*0.3
|
||||
healthcheck()
|
||||
return
|
||||
/obj/structure/grille/bullet_act(obj/item/projectile/Proj)
|
||||
. = ..()
|
||||
take_damage(Proj.damage*0.3, Proj.damage_type)
|
||||
|
||||
/obj/structure/grille/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
/obj/structure/grille/attackby(obj/item/weapon/W, mob/user, params)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
add_fingerprint(user)
|
||||
if(iswirecutter(W))
|
||||
if(!shock(user, 100))
|
||||
playsound(loc, W.usesound, 100, 1)
|
||||
if(!destroyed)
|
||||
new /obj/item/stack/rods(loc, 2)
|
||||
else
|
||||
new /obj/item/stack/rods(loc)
|
||||
qdel(src)
|
||||
deconstruct()
|
||||
else if((isscrewdriver(W)) && (istype(loc, /turf/simulated) || anchored))
|
||||
if(!shock(user, 90))
|
||||
playsound(loc, W.usesound, 100, 1)
|
||||
anchored = !anchored
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "fastens" : "unfastens"] the grille.</span>", \
|
||||
"<span class='notice'>You have [anchored ? "fastened the grille to" : "unfastened the grill from"] the floor.</span>")
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "fastens" : "unfastens"] [src].</span>", \
|
||||
"<span class='notice'>You [anchored ? "fasten [src] to" : "unfasten [src] from"] the floor.</span>")
|
||||
return
|
||||
else if(istype(W, /obj/item/stack/rods) && broken)
|
||||
var/obj/item/stack/rods/R = W
|
||||
if(!shock(user, 90))
|
||||
user.visible_message("<span class='notice'>[user] rebuilds the broken grille.</span>", \
|
||||
"<span class='notice'>You rebuild the broken grille.</span>")
|
||||
new grille_type(loc)
|
||||
R.use(1)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
//window placing begin
|
||||
else if( istype(W,/obj/item/stack/sheet/rglass) || istype(W,/obj/item/stack/sheet/glass) || istype(W,/obj/item/stack/sheet/plasmaglass) || istype(W,/obj/item/stack/sheet/plasmarglass) )
|
||||
var/dir_to_set = 1
|
||||
if(loc == user.loc)
|
||||
dir_to_set = user.dir
|
||||
else
|
||||
if( ( x == user.x ) || (y == user.y) ) //Only supposed to work for cardinal directions.
|
||||
if( x == user.x )
|
||||
if( y > user.y )
|
||||
dir_to_set = 2
|
||||
else
|
||||
dir_to_set = 1
|
||||
else if( y == user.y )
|
||||
if( x > user.x )
|
||||
dir_to_set = 8
|
||||
else
|
||||
dir_to_set = 4
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You can't reach.</span>")
|
||||
return //Only works for cardinal direcitons, diagonals aren't supposed to work like this.
|
||||
for(var/obj/structure/window/WINDOW in loc)
|
||||
if(WINDOW.dir == dir_to_set)
|
||||
to_chat(user, "<span class='notice'>There is already a window facing this way there.</span>")
|
||||
else if(istype(W,/obj/item/stack/sheet/rglass) || istype(W,/obj/item/stack/sheet/glass) || istype(W,/obj/item/stack/sheet/plasmaglass) || istype(W,/obj/item/stack/sheet/plasmarglass))
|
||||
if(!broken)
|
||||
var/obj/item/stack/ST = W
|
||||
if (ST.get_amount() < 1)
|
||||
to_chat(user, "<span class='warning'>You need at least one sheet of glass for that!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start placing the window.</span>")
|
||||
if(do_after(user, 20 * W.toolspeed, target = src))
|
||||
if(!src) return //Grille destroyed while waiting
|
||||
var/dir_to_set = NORTH
|
||||
if(!anchored)
|
||||
to_chat(user, "<span class='warning'>[src] needs to be fastened to the floor first!</span>")
|
||||
return
|
||||
if(loc == user.loc)
|
||||
dir_to_set = user.dir
|
||||
else
|
||||
if((x == user.x) || (y == user.y)) //Only supposed to work for cardinal directions.
|
||||
if(x == user.x)
|
||||
if(y > user.y)
|
||||
dir_to_set = SOUTH
|
||||
else
|
||||
dir_to_set = NORTH
|
||||
else if(y == user.y)
|
||||
if(x > user.x)
|
||||
dir_to_set = WEST
|
||||
else
|
||||
dir_to_set = EAST
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You can't reach.</span>")
|
||||
return //Only works for cardinal direcitons, diagonals aren't supposed to work like this.
|
||||
for(var/obj/structure/window/WINDOW in loc)
|
||||
if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
|
||||
if(WINDOW.dir == dir_to_set)
|
||||
to_chat(user, "<span class='notice'>There is already a window facing this way there.</span>")
|
||||
return
|
||||
var/obj/structure/window/WD
|
||||
if(istype(W,/obj/item/stack/sheet/rglass))
|
||||
WD = new/obj/structure/window/reinforced(loc) //reinforced window
|
||||
else if(istype(W,/obj/item/stack/sheet/glass))
|
||||
WD = new/obj/structure/window/basic(loc) //normal window
|
||||
else if(istype(W,/obj/item/stack/sheet/plasmaglass))
|
||||
WD = new/obj/structure/window/plasmabasic(loc) //basic plasma window
|
||||
else
|
||||
WD = new/obj/structure/window/plasmareinforced(loc) //reinforced plasma 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)
|
||||
to_chat(user, "<span class='notice'>You place the [WD] on [src].</span>")
|
||||
WD.update_icon()
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start placing the window...</span>")
|
||||
if(do_after(user, 20 * W.toolspeed, target = src))
|
||||
if(!loc || !anchored) //Grille destroyed or unanchored while waiting
|
||||
return
|
||||
for(var/obj/structure/window/WINDOW in loc)
|
||||
if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
|
||||
to_chat(user, "<span class='notice'>There is already a window facing this way there.</span>")
|
||||
return
|
||||
var/obj/structure/window/WD
|
||||
if(istype(W,/obj/item/stack/sheet/rglass))
|
||||
WD = new/obj/structure/window/reinforced(loc) //reinforced window
|
||||
else if(istype(W,/obj/item/stack/sheet/glass))
|
||||
WD = new/obj/structure/window/basic(loc) //normal window
|
||||
else if(istype(W,/obj/item/stack/sheet/plasmaglass))
|
||||
WD = new/obj/structure/window/plasmabasic(loc) //basic plasma window
|
||||
else
|
||||
WD = new/obj/structure/window/plasmareinforced(loc) //reinforced plasma window
|
||||
WD.setDir(dir_to_set)
|
||||
WD.ini_dir = dir_to_set
|
||||
WD.anchored = 0
|
||||
WD.state = 0
|
||||
ST.use(1)
|
||||
to_chat(user, "<span class='notice'>You place the [WD] on [src].</span>")
|
||||
WD.update_icon()
|
||||
return
|
||||
//window placing end
|
||||
else if(istype(W, /obj/item/weapon/shard) || !shock(user, 70))
|
||||
return attacked_by(W, user)
|
||||
|
||||
else if(istype(W, /obj/item/weapon/shard))
|
||||
health -= W.force * 0.1
|
||||
else if(!shock(user, 70))
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
switch(W.damtype)
|
||||
if("fire")
|
||||
health -= W.force
|
||||
if("brute")
|
||||
health -= W.force * 0.1
|
||||
healthcheck()
|
||||
..()
|
||||
return
|
||||
/obj/structure/grille/proc/attacked_by(obj/item/I, mob/living/user)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(src)
|
||||
if(!(I.flags&NOBLUDGEON))
|
||||
if(I.force)
|
||||
visible_message("<span class='danger'>[user] has hit [src] with [I]!</span>")
|
||||
take_damage(I.force * 0.3, I.damtype)
|
||||
|
||||
/obj/structure/grille/proc/deconstruct(disassembled = TRUE)
|
||||
if(!loc) //if already qdel'd somehow, we do nothing
|
||||
return
|
||||
if(can_deconstruct)
|
||||
var/obj/R = new rods_type(loc, rods_amount)
|
||||
transfer_fingerprints_to(R)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/grille/proc/healthcheck()
|
||||
/obj/structure/grille/proc/obj_break()
|
||||
if(!broken && can_deconstruct)
|
||||
new broken_type(loc)
|
||||
var/obj/R = new rods_type(loc, rods_broken)
|
||||
transfer_fingerprints_to(R)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/grille/proc/take_damage(damage, damage_type = BRUTE, sound_effect = 1)
|
||||
switch(damage_type)
|
||||
if(BURN)
|
||||
if(sound_effect)
|
||||
playsound(loc, 'sound/items/welder.ogg', 80, 1)
|
||||
if(BRUTE)
|
||||
if(sound_effect)
|
||||
if(damage)
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/tap.ogg', 50, 1)
|
||||
else
|
||||
return
|
||||
health -= damage
|
||||
if(health <= 0)
|
||||
if(!destroyed)
|
||||
icon_state = "brokengrille"
|
||||
density = 0
|
||||
destroyed = 1
|
||||
new /obj/item/stack/rods(loc)
|
||||
|
||||
if(!broken)
|
||||
obj_break()
|
||||
else
|
||||
if(health <= -6)
|
||||
new /obj/item/stack/rods(loc)
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
deconstruct()
|
||||
|
||||
// shock user with probability prb (if all connections & power are working)
|
||||
// returns 1 if shocked, 0 otherwise
|
||||
|
||||
/obj/structure/grille/proc/shock(mob/user as mob, prb)
|
||||
if(!anchored || destroyed) // deanchored/destroyed grilles are never connected
|
||||
/obj/structure/grille/proc/shock(mob/user, prb)
|
||||
if(!anchored || broken) // unanchored/broken grilles are never connected
|
||||
return 0
|
||||
if(!prob(prb))
|
||||
return 0
|
||||
@@ -258,8 +285,27 @@
|
||||
return 0
|
||||
|
||||
/obj/structure/grille/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(!destroyed)
|
||||
if(!broken)
|
||||
if(exposed_temperature > T0C + 1500)
|
||||
health -= 1
|
||||
healthcheck()
|
||||
take_damage(1)
|
||||
..()
|
||||
|
||||
/obj/structure/grille/hitby(atom/movable/AM)
|
||||
..()
|
||||
var/tforce = 0
|
||||
if(ismob(AM))
|
||||
tforce = 5
|
||||
else if(isobj(AM))
|
||||
var/obj/item/I = AM
|
||||
tforce = max(0, I.throwforce * 0.5)
|
||||
take_damage(tforce)
|
||||
|
||||
/obj/structure/grille/broken // Pre-broken grilles for map placement
|
||||
icon_state = "brokengrille"
|
||||
density = 0
|
||||
health = 0
|
||||
broken = 1
|
||||
rods_amount = 1
|
||||
rods_broken = 0
|
||||
grille_type = /obj/structure/grille
|
||||
broken_type = null
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
air_update_turf(1)
|
||||
return ..()
|
||||
|
||||
/obj/structure/inflatable/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
/obj/structure/inflatable/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
return 0
|
||||
|
||||
/obj/structure/inflatable/CanAtmosPass(turf/T)
|
||||
@@ -178,9 +178,7 @@
|
||||
/obj/structure/inflatable/door/attack_hand(mob/user as mob)
|
||||
return TryToSwitchState(user)
|
||||
|
||||
/obj/structure/inflatable/door/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group)
|
||||
return state
|
||||
/obj/structure/inflatable/door/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(istype(mover, /obj/effect/beam))
|
||||
return !opacity
|
||||
return !density
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
//NOT using the existing /obj/machinery/door type, since that has some complications on its own, mainly based on its
|
||||
//machineryness
|
||||
|
||||
//NOT using the existing /obj/machinery/door type, since that has some complications on its own, mainly based on its machineryness
|
||||
/obj/structure/mineral_door
|
||||
name = "mineral door"
|
||||
name = "metal door"
|
||||
density = 1
|
||||
anchored = 1
|
||||
opacity = 1
|
||||
@@ -10,16 +8,21 @@
|
||||
icon = 'icons/obj/doors/mineral_doors.dmi'
|
||||
icon_state = "metal"
|
||||
|
||||
var/mineralType = "metal"
|
||||
var/initial_state
|
||||
var/state = 0 //closed, 1 == open
|
||||
var/isSwitchingStates = 0
|
||||
var/close_delay = -1 //-1 if does not auto close.
|
||||
|
||||
var/hardness = 1
|
||||
var/oreAmount = 7
|
||||
var/sheetType = /obj/item/stack/sheet/metal
|
||||
var/sheetAmount = 7
|
||||
var/openSound = 'sound/effects/stonedoor_openclose.ogg'
|
||||
var/closeSound = 'sound/effects/stonedoor_openclose.ogg'
|
||||
var/damageSound = null
|
||||
|
||||
/obj/structure/mineral_door/New(location)
|
||||
..()
|
||||
icon_state = mineralType
|
||||
name = "[mineralType] door"
|
||||
initial_state = icon_state
|
||||
|
||||
/obj/structure/mineral_door/initialize()
|
||||
..()
|
||||
@@ -39,32 +42,38 @@
|
||||
..()
|
||||
if(!state)
|
||||
return TryToSwitchState(user)
|
||||
return
|
||||
|
||||
/obj/structure/mineral_door/attack_ai(mob/user as mob) //those aren't machinery, they're just big fucking slabs of a mineral
|
||||
/obj/structure/mineral_door/attack_ai(mob/user) //those aren't machinery, they're just big fucking slabs of a mineral
|
||||
if(isAI(user)) //so the AI can't open it
|
||||
return
|
||||
else if(isrobot(user)) //but cyborgs can
|
||||
if(get_dist(user,src) <= 1) //not remotely though
|
||||
return TryToSwitchState(user)
|
||||
else if(isrobot(user) && Adjacent(user)) //but cyborgs can, but not remotely
|
||||
return TryToSwitchState(user)
|
||||
|
||||
/obj/structure/mineral_door/attack_hand(mob/user as mob)
|
||||
/obj/structure/mineral_door/attack_hand(mob/user)
|
||||
return TryToSwitchState(user)
|
||||
|
||||
/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group) return 0
|
||||
/obj/structure/mineral_door/attack_animal(mob/user)
|
||||
return TryToSwitchState(user)
|
||||
|
||||
/obj/structure/mineral_door/attack_ghost(mob/user)
|
||||
if(user.can_advanced_admin_interact())
|
||||
SwitchState()
|
||||
|
||||
/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target, height = 0)
|
||||
if(istype(mover, /obj/effect/beam))
|
||||
return !opacity
|
||||
return !density
|
||||
|
||||
/obj/structure/mineral_door/CanAtmosPass()
|
||||
/obj/structure/mineral_door/CanAtmosPass(turf/T)
|
||||
return !density
|
||||
|
||||
/obj/structure/mineral_door/proc/TryToSwitchState(atom/user)
|
||||
if(isSwitchingStates) return
|
||||
if(ismob(user))
|
||||
var/mob/M = user
|
||||
if(world.time - user.last_bumped <= 60) return //NOTE do we really need that?
|
||||
if(isSwitchingStates)
|
||||
return
|
||||
if(isliving(user))
|
||||
var/mob/living/M = user
|
||||
if(world.time - user.last_bumped <= 60)
|
||||
return //NOTE do we really need that?
|
||||
if(M.client)
|
||||
if(iscarbon(M))
|
||||
var/mob/living/carbon/C = M
|
||||
@@ -83,211 +92,175 @@
|
||||
|
||||
/obj/structure/mineral_door/proc/Open()
|
||||
isSwitchingStates = 1
|
||||
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 100, 1)
|
||||
flick("[mineralType]opening",src)
|
||||
playsound(loc, openSound, 100, 1)
|
||||
flick("[initial_state]opening",src)
|
||||
sleep(10)
|
||||
density = 0
|
||||
opacity = 0
|
||||
state = 1
|
||||
air_update_turf(1)
|
||||
update_icon()
|
||||
isSwitchingStates = 0
|
||||
air_update_turf(1)
|
||||
|
||||
if(close_delay != -1)
|
||||
spawn(close_delay)
|
||||
Close()
|
||||
|
||||
/obj/structure/mineral_door/proc/Close()
|
||||
if(isSwitchingStates || state != 1)
|
||||
return
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/mob/living/L in T)
|
||||
return
|
||||
isSwitchingStates = 1
|
||||
playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 100, 1)
|
||||
flick("[mineralType]closing",src)
|
||||
playsound(loc, closeSound, 100, 1)
|
||||
flick("[initial_state]closing",src)
|
||||
sleep(10)
|
||||
density = 1
|
||||
opacity = 1
|
||||
state = 0
|
||||
air_update_turf(1)
|
||||
update_icon()
|
||||
isSwitchingStates = 0
|
||||
air_update_turf(1)
|
||||
|
||||
/obj/structure/mineral_door/update_icon()
|
||||
if(state)
|
||||
icon_state = "[mineralType]open"
|
||||
icon_state = "[initial_state]open"
|
||||
else
|
||||
icon_state = mineralType
|
||||
icon_state = initial_state
|
||||
|
||||
/obj/structure/mineral_door/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
if(istype(W,/obj/item/weapon/pickaxe))
|
||||
/obj/structure/mineral_door/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weapon/pickaxe))
|
||||
var/obj/item/weapon/pickaxe/digTool = W
|
||||
to_chat(user, "You start digging the [name].")
|
||||
if(do_after(user,digTool.digspeed * hardness, target = src) && src)
|
||||
to_chat(user, "You finished digging.")
|
||||
Dismantle()
|
||||
else if(istype(W,/obj/item/weapon)) //not sure, can't not just weapons get passed to this proc?
|
||||
hardness -= W.force/100
|
||||
to_chat(user, "You hit the [name] with your [W.name]!")
|
||||
CheckHardness()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You start digging \the [src].</span>")
|
||||
if(do_after(user, digTool.digspeed * hardness, target = src) && src)
|
||||
to_chat(user, "<span class='notice'>You finished digging.</span>")
|
||||
deconstruct(TRUE)
|
||||
else if(user.a_intent != I_HARM)
|
||||
attack_hand(user)
|
||||
return
|
||||
else
|
||||
attacked_by(W, user)
|
||||
|
||||
/obj/structure/mineral_door/proc/attacked_by(obj/item/I, mob/user)
|
||||
if(I.damtype != STAMINA)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.do_attack_animation(src)
|
||||
visible_message("<span class='notice'>[user] hits \the [src] with \the [I].</span>")
|
||||
if(damageSound)
|
||||
playsound(loc, damageSound, 100, 1)
|
||||
else
|
||||
playsound(loc, I.hitsound, 100, 1)
|
||||
hardness -= I.force / 100
|
||||
CheckHardness()
|
||||
|
||||
/obj/structure/mineral_door/proc/CheckHardness()
|
||||
if(hardness <= 0)
|
||||
Dismantle(1)
|
||||
deconstruct(FALSE)
|
||||
|
||||
/obj/structure/mineral_door/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))
|
||||
/obj/structure/mineral_door/proc/deconstruct(disassembled = TRUE)
|
||||
var/turf/T = get_turf(src)
|
||||
if(sheetType)
|
||||
if(disassembled)
|
||||
new sheetType(T, sheetAmount)
|
||||
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))
|
||||
new sheetType(T, max(sheetAmount - 2, 1))
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/mineral_door/ex_act(severity = 1)
|
||||
switch(severity)
|
||||
if(1)
|
||||
Dismantle(1)
|
||||
deconstruct(FALSE)
|
||||
if(2)
|
||||
if(prob(20))
|
||||
Dismantle(1)
|
||||
deconstruct(FALSE)
|
||||
else
|
||||
hardness--
|
||||
CheckHardness()
|
||||
if(3)
|
||||
hardness -= 0.1
|
||||
CheckHardness()
|
||||
return
|
||||
|
||||
/obj/structure/mineral_door/iron
|
||||
mineralType = "metal"
|
||||
hardness = 3
|
||||
|
||||
/obj/structure/mineral_door/silver
|
||||
mineralType = "silver"
|
||||
name = "silver door"
|
||||
icon_state = "silver"
|
||||
sheetType = /obj/item/stack/sheet/mineral/silver
|
||||
hardness = 3
|
||||
|
||||
/obj/structure/mineral_door/gold
|
||||
mineralType = "gold"
|
||||
name = "gold door"
|
||||
icon_state = "gold"
|
||||
sheetType = /obj/item/stack/sheet/mineral/gold
|
||||
|
||||
/obj/structure/mineral_door/uranium
|
||||
mineralType = "uranium"
|
||||
name = "uranium door"
|
||||
icon_state = "uranium"
|
||||
sheetType = /obj/item/stack/sheet/mineral/uranium
|
||||
hardness = 3
|
||||
light_range = 2
|
||||
|
||||
/obj/structure/mineral_door/sandstone
|
||||
mineralType = "sandstone"
|
||||
name = "sandstone door"
|
||||
icon_state = "sandstone"
|
||||
sheetType = /obj/item/stack/sheet/mineral/sandstone
|
||||
hardness = 0.5
|
||||
|
||||
/obj/structure/mineral_door/transparent
|
||||
opacity = 0
|
||||
|
||||
Close()
|
||||
..()
|
||||
set_opacity(0)
|
||||
/obj/structure/mineral_door/transparent/Close()
|
||||
..()
|
||||
set_opacity(0)
|
||||
|
||||
/obj/structure/mineral_door/transparent/plasma
|
||||
mineralType = "plasma"
|
||||
name = "plasma door"
|
||||
icon_state = "plasma"
|
||||
sheetType = /obj/item/stack/sheet/mineral/plasma
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(is_hot(W))
|
||||
message_admins("Plasma mineral door ignited by [key_name_admin(user)] in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
|
||||
log_game("Plasma mineral door ignited by [key_name(user)] in ([x],[y],[z])")
|
||||
TemperatureAct(100)
|
||||
..()
|
||||
/obj/structure/mineral_door/transparent/plasma/attackby(obj/item/weapon/W, mob/user)
|
||||
if(is_hot(W))
|
||||
message_admins("Plasma mineral door ignited by [key_name_admin(user)] in ([x], [y], [z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)", 0, 1)
|
||||
log_game("Plasma mineral door ignited by [key_name(user)] in ([x], [y], [z])")
|
||||
TemperatureAct(100)
|
||||
else
|
||||
return ..()
|
||||
|
||||
temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 300)
|
||||
TemperatureAct(exposed_temperature)
|
||||
/obj/structure/mineral_door/transparent/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 300)
|
||||
TemperatureAct(exposed_temperature)
|
||||
|
||||
proc/TemperatureAct(temperature)
|
||||
atmos_spawn_air(SPAWN_HEAT | SPAWN_TOXINS, 500)
|
||||
hardness = 0
|
||||
CheckHardness()
|
||||
/obj/structure/mineral_door/transparent/plasma/proc/TemperatureAct(temperature)
|
||||
atmos_spawn_air(SPAWN_HEAT | SPAWN_TOXINS, 500)
|
||||
deconstruct(FALSE)
|
||||
|
||||
/obj/structure/mineral_door/transparent/diamond
|
||||
mineralType = "diamond"
|
||||
name = "diamond door"
|
||||
icon_state = "diamond"
|
||||
sheetType = /obj/item/stack/sheet/mineral/diamond
|
||||
hardness = 10
|
||||
|
||||
/obj/structure/mineral_door/wood
|
||||
mineralType = "wood"
|
||||
name = "wood door"
|
||||
icon_state = "wood"
|
||||
openSound = 'sound/effects/doorcreaky.ogg'
|
||||
closeSound = 'sound/effects/doorcreaky.ogg'
|
||||
sheetType = /obj/item/stack/sheet/wood
|
||||
hardness = 1
|
||||
burn_state = FLAMMABLE
|
||||
burntime = 30
|
||||
|
||||
Open()
|
||||
isSwitchingStates = 1
|
||||
playsound(loc, 'sound/effects/doorcreaky.ogg', 100, 1)
|
||||
flick("[mineralType]opening",src)
|
||||
sleep(10)
|
||||
density = 0
|
||||
set_opacity(0)
|
||||
state = 1
|
||||
update_icon()
|
||||
isSwitchingStates = 0
|
||||
|
||||
Close()
|
||||
isSwitchingStates = 1
|
||||
playsound(loc, 'sound/effects/doorcreaky.ogg', 100, 1)
|
||||
flick("[mineralType]closing",src)
|
||||
sleep(10)
|
||||
density = 1
|
||||
set_opacity(1)
|
||||
state = 0
|
||||
update_icon()
|
||||
isSwitchingStates = 0
|
||||
|
||||
Dismantle(devastated = 0)
|
||||
if(!devastated)
|
||||
for(var/i = 1, i <= oreAmount, i++)
|
||||
new/obj/item/stack/sheet/wood(get_turf(src))
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/mineral_door/resin
|
||||
mineralType = "resin"
|
||||
name = "resin door"
|
||||
icon_state = "resin"
|
||||
hardness = 1.5
|
||||
var/close_delay = 100
|
||||
close_delay = 100
|
||||
openSound = 'sound/effects/attackblob.ogg'
|
||||
closeSound = 'sound/effects/attackblob.ogg'
|
||||
damageSound = 'sound/effects/attackblob.ogg'
|
||||
sheetType = null
|
||||
|
||||
TryToSwitchState(atom/user)
|
||||
if(isalien(user))
|
||||
return ..()
|
||||
|
||||
Open()
|
||||
isSwitchingStates = 1
|
||||
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
|
||||
flick("[mineralType]opening",src)
|
||||
sleep(10)
|
||||
density = 0
|
||||
set_opacity(0)
|
||||
state = 1
|
||||
update_icon()
|
||||
isSwitchingStates = 0
|
||||
|
||||
spawn(close_delay)
|
||||
if(!isSwitchingStates && state == 1)
|
||||
Close()
|
||||
|
||||
Close()
|
||||
isSwitchingStates = 1
|
||||
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
|
||||
flick("[mineralType]closing",src)
|
||||
sleep(10)
|
||||
density = 1
|
||||
set_opacity(1)
|
||||
state = 0
|
||||
update_icon()
|
||||
isSwitchingStates = 0
|
||||
|
||||
Dismantle(devastated = 0)
|
||||
qdel(src)
|
||||
|
||||
CheckHardness()
|
||||
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
|
||||
..()
|
||||
/obj/structure/mineral_door/resin/TryToSwitchState(atom/user)
|
||||
if(isalien(user))
|
||||
return ..()
|
||||
|
||||
@@ -72,4 +72,46 @@
|
||||
user.forceMove(get_turf(src))
|
||||
log_admin("[key_name(user)] was incarnated by a respawner machine.")
|
||||
message_admins("[key_name_admin(user)] was incarnated by a respawner machine.")
|
||||
user.incarnate_ghost()
|
||||
user.incarnate_ghost()
|
||||
|
||||
/obj/structure/ghost_beacon
|
||||
name = "ethereal beacon"
|
||||
desc = "A structure that draws ethereal attention when active. Use an empty hand to activate."
|
||||
icon = 'icons/obj/lavaland/artefacts.dmi'
|
||||
icon_state = "anomaly_crystal"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/active = FALSE
|
||||
var/ghost_alert_delay = 30 SECONDS
|
||||
var/last_ghost_alert
|
||||
|
||||
|
||||
/obj/structure/ghost_beacon/initialize()
|
||||
. = ..()
|
||||
last_ghost_alert = world.time
|
||||
if(active)
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/structure/ghost_beacon/Destroy()
|
||||
if(active)
|
||||
processing_objects.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/structure/ghost_beacon/attack_ghost(mob/dead/observer/user)
|
||||
if(user.can_advanced_admin_interact())
|
||||
attack_hand(user)
|
||||
|
||||
/obj/structure/ghost_beacon/attack_hand(mob/user)
|
||||
if(!is_admin(user))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You [active ? "disable" : "enable"] \the [src].</span>")
|
||||
if(active)
|
||||
processing_objects.Remove(src)
|
||||
else
|
||||
processing_objects.Add(src)
|
||||
active = !active
|
||||
|
||||
/obj/structure/ghost_beacon/process()
|
||||
if(last_ghost_alert + ghost_alert_delay < world.time)
|
||||
notify_ghosts("[src] active in [get_area(src)].", 'sound/effects/ghost2.ogg', source = src)
|
||||
last_ghost_alert = world.time
|
||||
|
||||
@@ -58,16 +58,18 @@
|
||||
qdel(src)
|
||||
|
||||
else if(iswelder(W) && !anchored)
|
||||
playsound(loc, W.usesound, 40, 1)
|
||||
user.visible_message("[user] is slicing apart the [name].", \
|
||||
"<span class='notice'>You are slicing apart the [name]...</span>")
|
||||
if(do_after(user, 40 * W.toolspeed, target = src))
|
||||
if(!loc)
|
||||
return
|
||||
playsound(loc, W.usesound, 50, 1)
|
||||
user.visible_message("[user] slices apart the [name].", \
|
||||
"<span class='notice'>You slice apart the [name]!</span>")
|
||||
Dismantle(TRUE)
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user))
|
||||
playsound(loc, W.usesound, 40, 1)
|
||||
user.visible_message("[user] is slicing apart the [name].", \
|
||||
"<span class='notice'>You are slicing apart the [name]...</span>")
|
||||
if(do_after(user, 40 * W.toolspeed, target = src))
|
||||
if(!loc)
|
||||
return
|
||||
playsound(loc, W.usesound, 50, 1)
|
||||
user.visible_message("[user] slices apart the [name].", \
|
||||
"<span class='notice'>You slice apart the [name]!</span>")
|
||||
Dismantle(TRUE)
|
||||
else
|
||||
hardness -= W.force/100
|
||||
..()
|
||||
|
||||
@@ -126,8 +126,8 @@
|
||||
/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
|
||||
/obj/structure/table/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(height==0) return 1
|
||||
if(istype(mover,/obj/item/projectile))
|
||||
return (check_cover(mover,target))
|
||||
if(ismob(mover))
|
||||
@@ -557,8 +557,8 @@
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/structure/rack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
/obj/structure/rack/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(height==0) return 1
|
||||
if(src.density == 0) //Because broken racks -Agouri |TODO: SPRITE!|
|
||||
return 1
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
|
||||
@@ -45,11 +45,10 @@ obj/structure/windoor_assembly/Destroy()
|
||||
/obj/structure/windoor_assembly/update_icon()
|
||||
icon_state = "[facing]_[secure ? "secure_" : ""]windoor_assembly[state]"
|
||||
|
||||
/obj/structure/windoor_assembly/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
/obj/structure/windoor_assembly/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return 1
|
||||
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
|
||||
if(air_group) return 0
|
||||
return !density
|
||||
else
|
||||
return 1
|
||||
|
||||
@@ -90,7 +90,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
|
||||
return !density
|
||||
return 1
|
||||
|
||||
/obj/structure/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
/obj/structure/window/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return 1
|
||||
if(dir == SOUTHWEST || dir == SOUTHEAST || dir == NORTHWEST || dir == NORTHEAST)
|
||||
|
||||
Reference in New Issue
Block a user