mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Merge pull request #15951 from SonixApache/remove_src_windoors
remove src from windoors
This commit is contained in:
@@ -27,9 +27,9 @@
|
|||||||
|
|
||||||
/obj/machinery/door/window/New()
|
/obj/machinery/door/window/New()
|
||||||
..()
|
..()
|
||||||
if ((istype(src.req_access) && src.req_access.len) || istext(req_access))
|
if ((istype(req_access) && req_access.len) || istext(req_access))
|
||||||
src.icon_state = "[src.icon_state]"
|
icon_state = "[icon_state]"
|
||||||
src.base_state = src.icon_state
|
base_state = icon_state
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/machinery/door/window/Destroy()
|
/obj/machinery/door/window/Destroy()
|
||||||
@@ -58,26 +58,26 @@
|
|||||||
if (!ismob(AM))
|
if (!ismob(AM))
|
||||||
var/obj/machinery/bot/bot = AM
|
var/obj/machinery/bot/bot = AM
|
||||||
if(istype(bot))
|
if(istype(bot))
|
||||||
if(density && src.check_access(bot.botcard))
|
if(density && check_access(bot.botcard))
|
||||||
open()
|
open()
|
||||||
sleep(50)
|
sleep(50)
|
||||||
close()
|
close()
|
||||||
else if(istype(AM, /obj/mecha))
|
else if(istype(AM, /obj/mecha))
|
||||||
var/obj/mecha/mecha = AM
|
var/obj/mecha/mecha = AM
|
||||||
if(density)
|
if(density)
|
||||||
if(mecha.occupant && src.allowed(mecha.occupant))
|
if(mecha.occupant && allowed(mecha.occupant))
|
||||||
open()
|
open()
|
||||||
sleep(50)
|
sleep(50)
|
||||||
close()
|
close()
|
||||||
return
|
return
|
||||||
if (!( ticker ))
|
if (!( ticker ))
|
||||||
return
|
return
|
||||||
if (src.operating)
|
if (operating)
|
||||||
return
|
return
|
||||||
if (src.density && src.allowed(AM))
|
if (density && allowed(AM))
|
||||||
open()
|
open()
|
||||||
// What.
|
// What.
|
||||||
if(src.check_access(null))
|
if(check_access(null))
|
||||||
sleep(50)
|
sleep(50)
|
||||||
else //secure doors close faster
|
else //secure doors close faster
|
||||||
sleep(20)
|
sleep(20)
|
||||||
@@ -115,37 +115,37 @@
|
|||||||
/obj/machinery/door/window/open()
|
/obj/machinery/door/window/open()
|
||||||
if (!density) //it's already open you silly cunt
|
if (!density) //it's already open you silly cunt
|
||||||
return 0
|
return 0
|
||||||
if (src.operating == 1) //doors can still open when emag-disabled
|
if (operating == 1) //doors can still open when emag-disabled
|
||||||
return 0
|
return 0
|
||||||
if (!ticker)
|
if (!ticker)
|
||||||
return 0
|
return 0
|
||||||
if(!src.operating) //in case of emag
|
if(!operating) //in case of emag
|
||||||
src.operating = 1
|
operating = 1
|
||||||
flick(text("[]opening", src.base_state), src)
|
flick(text("[]opening", base_state), src)
|
||||||
playsound(get_turf(src), soundeffect, 100, 1)
|
playsound(get_turf(src), soundeffect, 100, 1)
|
||||||
src.icon_state = text("[]open", src.base_state)
|
icon_state = text("[]open", base_state)
|
||||||
sleep(animation_delay)
|
sleep(animation_delay)
|
||||||
|
|
||||||
explosion_resistance = 0
|
explosion_resistance = 0
|
||||||
src.density = 0
|
density = 0
|
||||||
if (smartwindow && opacity)
|
if (smartwindow && opacity)
|
||||||
set_opacity(0) //Else we'd get opaque open windoors!
|
set_opacity(0) //Else we'd get opaque open windoors!
|
||||||
was_opaque = 1
|
was_opaque = 1
|
||||||
update_nearby_tiles()
|
update_nearby_tiles()
|
||||||
|
|
||||||
if(operating == 1) //emag again
|
if(operating == 1) //emag again
|
||||||
src.operating = 0
|
operating = 0
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/obj/machinery/door/window/close()
|
/obj/machinery/door/window/close()
|
||||||
if (src.operating)
|
if (operating)
|
||||||
return 0
|
return 0
|
||||||
src.operating = 1
|
operating = 1
|
||||||
flick(text("[]closing", src.base_state), src)
|
flick(text("[]closing", base_state), src)
|
||||||
playsound(get_turf(src), soundeffect, 100, 1)
|
playsound(get_turf(src), soundeffect, 100, 1)
|
||||||
src.icon_state = src.base_state
|
icon_state = base_state
|
||||||
|
|
||||||
src.density = 1
|
density = 1
|
||||||
explosion_resistance = initial(explosion_resistance)
|
explosion_resistance = initial(explosion_resistance)
|
||||||
if (smartwindow && was_opaque)
|
if (smartwindow && was_opaque)
|
||||||
set_opacity(1)
|
set_opacity(1)
|
||||||
@@ -154,14 +154,14 @@
|
|||||||
|
|
||||||
sleep(animation_delay)
|
sleep(animation_delay)
|
||||||
|
|
||||||
src.operating = 0
|
operating = 0
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
/obj/machinery/door/window/proc/take_damage(var/damage)
|
/obj/machinery/door/window/proc/take_damage(var/damage)
|
||||||
src.health = max(0, src.health - damage)
|
health = max(0, health - damage)
|
||||||
if (src.health <= 0)
|
if (health <= 0)
|
||||||
getFromPool(shard, loc)
|
getFromPool(shard, loc)
|
||||||
getFromPool(/obj/item/stack/cable_coil,src.loc,2)
|
getFromPool(/obj/item/stack/cable_coil,loc,2)
|
||||||
eject_electronics()
|
eject_electronics()
|
||||||
qdel(src)
|
qdel(src)
|
||||||
return
|
return
|
||||||
@@ -187,55 +187,55 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
/obj/machinery/door/window/attack_ai(mob/user as mob)
|
/obj/machinery/door/window/attack_ai(mob/user as mob)
|
||||||
src.add_hiddenprint(user)
|
add_hiddenprint(user)
|
||||||
return src.attack_hand(user)
|
return attack_hand(user)
|
||||||
|
|
||||||
/obj/machinery/door/window/attack_paw(mob/living/user as mob)
|
/obj/machinery/door/window/attack_paw(mob/living/user as mob)
|
||||||
if(istype(user, /mob/living/carbon/alien/humanoid) || istype(user, /mob/living/carbon/slime/adult))
|
if(istype(user, /mob/living/carbon/alien/humanoid) || istype(user, /mob/living/carbon/slime/adult))
|
||||||
if(src.operating)
|
if(operating)
|
||||||
return
|
return
|
||||||
user.delayNextAttack(8)
|
user.delayNextAttack(8)
|
||||||
user.do_attack_animation(src, user)
|
user.do_attack_animation(src, user)
|
||||||
src.health = max(0, src.health - 25)
|
health = max(0, health - 25)
|
||||||
playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)
|
playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)
|
||||||
visible_message("<span class='warning'>\The [user] smashes against \the [src.name].</span>", 1)
|
visible_message("<span class='warning'>\The [user] smashes against \the [name].</span>", 1)
|
||||||
if (src.health <= 0)
|
if (health <= 0)
|
||||||
getFromPool(shard, loc)
|
getFromPool(shard, loc)
|
||||||
getFromPool(/obj/item/stack/cable_coil, loc, 2)
|
getFromPool(/obj/item/stack/cable_coil, loc, 2)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
else
|
else
|
||||||
return src.attack_hand(user)
|
return attack_hand(user)
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/door/window/attack_animal(mob/living/user as mob)
|
/obj/machinery/door/window/attack_animal(mob/living/user as mob)
|
||||||
if(src.operating)
|
if(operating)
|
||||||
return
|
return
|
||||||
var/mob/living/simple_animal/M = user
|
var/mob/living/simple_animal/M = user
|
||||||
if(M.melee_damage_upper <= 0)
|
if(M.melee_damage_upper <= 0)
|
||||||
return
|
return
|
||||||
user.do_attack_animation(src, user)
|
user.do_attack_animation(src, user)
|
||||||
user.delayNextAttack(8)
|
user.delayNextAttack(8)
|
||||||
src.health = max(0, src.health - M.melee_damage_upper)
|
health = max(0, health - M.melee_damage_upper)
|
||||||
playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)
|
playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)
|
||||||
visible_message("<span class='warning'>\The [M] [M.attacktext] against \the [src.name].</span>", 1)
|
visible_message("<span class='warning'>\The [M] [M.attacktext] against \the [name].</span>", 1)
|
||||||
if (src.health <= 0)
|
if (health <= 0)
|
||||||
getFromPool(shard, loc)
|
getFromPool(shard, loc)
|
||||||
getFromPool(/obj/item/stack/cable_coil, loc, 2)
|
getFromPool(/obj/item/stack/cable_coil, loc, 2)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/door/window/attack_hand(mob/user as mob)
|
/obj/machinery/door/window/attack_hand(mob/user as mob)
|
||||||
return src.attackby(user, user)
|
return attackby(user, user)
|
||||||
|
|
||||||
/obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/living/user as mob)
|
/obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/living/user as mob)
|
||||||
// Make emagged/open doors able to be deconstructed
|
// Make emagged/open doors able to be deconstructed
|
||||||
if (!src.density && src.operating != 1 && iscrowbar(I))
|
if (!density && operating != 1 && iscrowbar(I))
|
||||||
user.visible_message("[user] removes the electronics from the windoor assembly.", "You start to remove the electronics from the windoor assembly.")
|
user.visible_message("[user] removes the electronics from the windoor assembly.", "You start to remove the electronics from the windoor assembly.")
|
||||||
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 100, 1)
|
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 100, 1)
|
||||||
if (do_after(user, src, 40) && src && !src.density && src.operating != 1)
|
if (do_after(user, src, 40) && src && !density && operating != 1)
|
||||||
to_chat(user, "<span class='notice'>You removed the windoor electronics!</span>")
|
to_chat(user, "<span class='notice'>You removed the windoor electronics!</span>")
|
||||||
make_assembly(user)
|
make_assembly(user)
|
||||||
src.dismantled = 1 // Don't play the glass shatter sound
|
dismantled = 1 // Don't play the glass shatter sound
|
||||||
if(smartwindow)
|
if(smartwindow)
|
||||||
qdel(smartwindow)
|
qdel(smartwindow)
|
||||||
smartwindow = null
|
smartwindow = null
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
//If it's in the process of opening/closing or emagged, ignore the click
|
//If it's in the process of opening/closing or emagged, ignore the click
|
||||||
if (src.operating)
|
if (operating)
|
||||||
return
|
return
|
||||||
|
|
||||||
//If it's Smartglass shit, smartglassify it.
|
//If it's Smartglass shit, smartglassify it.
|
||||||
@@ -269,33 +269,33 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
//If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway)
|
//If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway)
|
||||||
if(src.density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card))
|
if(density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card))
|
||||||
var/aforce = I.force
|
var/aforce = I.force
|
||||||
user.do_attack_animation(src, I)
|
user.do_attack_animation(src, I)
|
||||||
user.delayNextAttack(8)
|
user.delayNextAttack(8)
|
||||||
if(I.damtype == BRUTE || I.damtype == BURN)
|
if(I.damtype == BRUTE || I.damtype == BURN)
|
||||||
src.health = max(0, src.health - aforce)
|
health = max(0, health - aforce)
|
||||||
playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)
|
playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)
|
||||||
visible_message("<span class='danger'>[src] was hit by [I].</span>")
|
visible_message("<span class='danger'>[src] was hit by [I].</span>")
|
||||||
if (src.health <= 0)
|
if (health <= 0)
|
||||||
getFromPool(shard, loc)
|
getFromPool(shard, loc)
|
||||||
getFromPool(/obj/item/stack/cable_coil, src.loc, 2)
|
getFromPool(/obj/item/stack/cable_coil, loc, 2)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
src.add_fingerprint(user)
|
add_fingerprint(user)
|
||||||
if (!src.requiresID())
|
if (!requiresID())
|
||||||
//don't care who they are or what they have, act as if they're NOTHING
|
//don't care who they are or what they have, act as if they're NOTHING
|
||||||
user = null
|
user = null
|
||||||
|
|
||||||
if (isrobot(user))
|
if (isrobot(user))
|
||||||
if (src.density)
|
if (density)
|
||||||
return open()
|
return open()
|
||||||
else
|
else
|
||||||
return close()
|
return close()
|
||||||
|
|
||||||
if (!src.allowed(user) && src.density)
|
if (!allowed(user) && density)
|
||||||
flick(text("[]deny", src.base_state), src)
|
flick(text("[]deny", base_state), src)
|
||||||
|
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
@@ -304,12 +304,12 @@
|
|||||||
return hackOpen(used_emag, user)
|
return hackOpen(used_emag, user)
|
||||||
|
|
||||||
/obj/machinery/door/window/proc/hackOpen(obj/item/I, mob/user)
|
/obj/machinery/door/window/proc/hackOpen(obj/item/I, mob/user)
|
||||||
src.operating = -1
|
operating = -1
|
||||||
|
|
||||||
if (src.electronics)
|
if (electronics)
|
||||||
src.electronics.icon_state = "door_electronics_smoked"
|
electronics.icon_state = "door_electronics_smoked"
|
||||||
|
|
||||||
flick("[src.base_state]spark", src)
|
flick("[base_state]spark", src)
|
||||||
sleep(6)
|
sleep(6)
|
||||||
open()
|
open()
|
||||||
return 1
|
return 1
|
||||||
@@ -322,7 +322,7 @@
|
|||||||
* w.r.t. the tile it is on.
|
* w.r.t. the tile it is on.
|
||||||
*/
|
*/
|
||||||
/obj/machinery/door/window/proc/is_left_opening()
|
/obj/machinery/door/window/proc/is_left_opening()
|
||||||
return src.base_state == "left" || src.base_state == "leftsecure"
|
return base_state == "left" || base_state == "leftsecure"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deconstructs a windoor properly. You probably want to delete
|
* Deconstructs a windoor properly. You probably want to delete
|
||||||
@@ -331,41 +331,41 @@
|
|||||||
*/
|
*/
|
||||||
/obj/machinery/door/window/proc/make_assembly(mob/user as mob)
|
/obj/machinery/door/window/proc/make_assembly(mob/user as mob)
|
||||||
// Windoor assembly
|
// Windoor assembly
|
||||||
var/obj/structure/windoor_assembly/WA = new /obj/structure/windoor_assembly(src.loc)
|
var/obj/structure/windoor_assembly/WA = new /obj/structure/windoor_assembly(loc)
|
||||||
set_assembly(user, WA)
|
set_assembly(user, WA)
|
||||||
return WA
|
return WA
|
||||||
|
|
||||||
/obj/machinery/door/window/proc/set_assembly(mob/user as mob, var/obj/structure/windoor_assembly/WA)
|
/obj/machinery/door/window/proc/set_assembly(mob/user as mob, var/obj/structure/windoor_assembly/WA)
|
||||||
WA.name = "Near finished Windoor Assembly"
|
WA.name = "Near finished Windoor Assembly"
|
||||||
WA.dir = src.dir
|
WA.dir = dir
|
||||||
WA.anchored = 1
|
WA.anchored = 1
|
||||||
WA.facing = (is_left_opening() ? "l" : "r")
|
WA.facing = (is_left_opening() ? "l" : "r")
|
||||||
WA.secure = ""
|
WA.secure = ""
|
||||||
WA.state = "02"
|
WA.state = "02"
|
||||||
WA.update_icon()
|
WA.update_icon()
|
||||||
|
|
||||||
WA.fingerprints += src.fingerprints
|
WA.fingerprints += fingerprints
|
||||||
WA.fingerprintshidden += src.fingerprints
|
WA.fingerprintshidden += fingerprints
|
||||||
WA.fingerprintslast = user.ckey
|
WA.fingerprintslast = user.ckey
|
||||||
|
|
||||||
// Pop out electronics
|
// Pop out electronics
|
||||||
eject_electronics()
|
eject_electronics()
|
||||||
|
|
||||||
/obj/machinery/door/window/proc/eject_electronics()
|
/obj/machinery/door/window/proc/eject_electronics()
|
||||||
var/obj/item/weapon/circuitboard/airlock/AE = (src.electronics ? src.electronics : new /obj/item/weapon/circuitboard/airlock(src.loc))
|
var/obj/item/weapon/circuitboard/airlock/AE = (electronics ? electronics : new /obj/item/weapon/circuitboard/airlock(loc))
|
||||||
if (src.electronics)
|
if (electronics)
|
||||||
src.electronics = null
|
electronics = null
|
||||||
AE.installed = 0
|
AE.installed = 0
|
||||||
else
|
else
|
||||||
if(operating == -1)
|
if(operating == -1)
|
||||||
AE.icon_state = "door_electronics_smoked"
|
AE.icon_state = "door_electronics_smoked"
|
||||||
// Straight from /obj/machinery/door/airlock/attackby()
|
// Straight from /obj/machinery/door/airlock/attackby()
|
||||||
if (src.req_access && src.req_access.len > 0)
|
if (req_access && req_access.len > 0)
|
||||||
AE.conf_access = src.req_access
|
AE.conf_access = req_access
|
||||||
else if (src.req_one_access && src.req_one_access.len > 0)
|
else if (req_one_access && req_one_access.len > 0)
|
||||||
AE.conf_access = src.req_one_access
|
AE.conf_access = req_one_access
|
||||||
AE.one_access = 1
|
AE.one_access = 1
|
||||||
AE.forceMove(src.loc)
|
AE.forceMove(loc)
|
||||||
|
|
||||||
/obj/machinery/door/window/brigdoor
|
/obj/machinery/door/window/brigdoor
|
||||||
name = "Secure Window Door"
|
name = "Secure Window Door"
|
||||||
@@ -394,7 +394,7 @@
|
|||||||
|
|
||||||
/obj/machinery/door/window/plasma/make_assembly(mob/user as mob)
|
/obj/machinery/door/window/plasma/make_assembly(mob/user as mob)
|
||||||
// Windoor assembly
|
// Windoor assembly
|
||||||
var/obj/structure/windoor_assembly/plasma/WA = new /obj/structure/windoor_assembly/plasma(src.loc)
|
var/obj/structure/windoor_assembly/plasma/WA = new /obj/structure/windoor_assembly/plasma(loc)
|
||||||
set_assembly(user, WA)
|
set_assembly(user, WA)
|
||||||
return WA
|
return WA
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user