Adds a pry var to objects, which checks if the obj can open doors

This commit is contained in:
Anewbe
2016-07-09 00:24:12 -05:00
parent 42a0e259a4
commit f27fa6cc2b
7 changed files with 23 additions and 4 deletions
@@ -32,6 +32,7 @@
force = 40
sharp = 1
edge = 1
pry = 1
anchored = 1
throwforce = 0 //Just to be on the safe side
throw_range = 0
+2 -2
View File
@@ -727,7 +727,7 @@ About the new airlock wires panel:
update_icon()
return 1
/obj/machinery/door/airlock/attackby(C as obj, mob/user as mob)
/obj/machinery/door/airlock/attackby(obj/C as obj, mob/user as mob)
//world << text("airlock attackby src [] obj [] mob []", src, C, user)
if(!istype(usr, /mob/living/silicon))
if(src.isElectrified())
@@ -810,7 +810,7 @@ About the new airlock wires panel:
spawn(0) close(1)
// Check if we're using a crowbar or armblade, and if the airlock's unpowered for whatever reason (off, broken, etc).
else if( (istype(C, /obj/item/weapon/material/twohanded/fireaxe) || istype(C, /obj/item/weapon/melee/arm_blade) ) && !arePowerSystemsOn())
else if((C.pry == 1) && !arePowerSystemsOn())
if(locked)
user << "<span class='notice'>The airlock's bolts prevent it from being forced.</span>"
else if( !welded && !operating )
+1 -1
View File
@@ -90,7 +90,7 @@
// This only works on broken doors or doors without power. Also allows repair with Plasteel.
/obj/machinery/door/blast/attackby(obj/item/weapon/C as obj, mob/user as mob)
src.add_fingerprint(user)
if(istype(C, /obj/item/weapon/crowbar) || istype(C, /obj/item/weapon/material/twohanded/fireaxe) || istype(C, /obj/item/weapon/melee/arm_blade))
if(C.pry == 1)
if(istype(C,/obj/item/weapon/material/twohanded/fireaxe))
var/obj/item/weapon/material/twohanded/fireaxe/F = C
if(!F.wielded)
+1 -1
View File
@@ -235,7 +235,7 @@
user << "<span class='danger'>\The [src] is welded shut!</span>"
return
if(istype(C, /obj/item/weapon/crowbar) || istype(C,/obj/item/weapon/material/twohanded/fireaxe) || istype(C, /obj/item/weapon/melee/arm_blade))
if(C.pry == 1)
if(operating)
return
@@ -93,6 +93,22 @@
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
applies_material_colour = 0
/obj/item/weapon/material/twohanded/fireaxe/update_held_icon()
var/mob/living/M = loc
if(istype(M) && !issmall(M) && M.item_is_in_hands(src) && !M.hands_are_full())
wielded = 1
pry = 1
force = force_wielded
name = "[base_name] (wielded)"
update_icon()
else
wielded = 0
pry = 0
force = force_unwielded
name = "[base_name]"
update_icon()
..()
/obj/item/weapon/material/twohanded/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity)
if(!proximity) return
..()
+1
View File
@@ -413,6 +413,7 @@
slot_flags = SLOT_BELT
force = 5.0
throwforce = 7.0
pry = 1
item_state = "crowbar"
w_class = 2.0
origin_tech = list(TECH_ENGINEERING = 1)
+1
View File
@@ -7,6 +7,7 @@
var/throwforce = 1
var/sharp = 0 // whether this object cuts
var/edge = 0 // whether this object is more likely to dismember
var/pry = 0 //Used in attackby() to open doors
var/in_use = 0 // If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING!
var/damtype = "brute"
var/armor_penetration = 0