Overhauled holsters and webbings

This commit is contained in:
ZomgPonies
2014-07-15 04:02:24 -04:00
parent c54b9e3626
commit 1eb02b5cf4
9 changed files with 56 additions and 99 deletions
+2 -69
View File
@@ -267,12 +267,6 @@ BLIND // can't see anything
I.loc = src
user << "<span class='notice'>You attach [I] to [src].</span>"
if (istype(hastie,/obj/item/clothing/tie/holster))
verbs += /obj/item/clothing/under/proc/holster
if (istype(hastie,/obj/item/clothing/tie/storage))
verbs += /obj/item/clothing/under/proc/storage
if(istype(loc, /mob/living/carbon/human))
var/mob/living/carbon/human/H = loc
H.update_inv_w_uniform()
@@ -284,7 +278,7 @@ BLIND // can't see anything
/obj/item/clothing/under/attack_hand(mob/user as mob)
//only forward to the attached accessory if the clothing is equipped (not in a storage)
if(hastie && src.loc == user)
hastie.attack_hand(user)
removetie()
return
if ((ishuman(usr) || ismonkey(usr)) && src.loc == user) //make it harder to accidentally undress yourself
@@ -368,9 +362,7 @@ BLIND // can't see anything
else
usr << "<span class='notice'>You cannot roll down the uniform!</span>"
/obj/item/clothing/under/verb/removetie()
set name = "Remove Accessory"
set category = "Object"
/obj/item/clothing/under/proc/removetie()
set src in usr
if(!istype(usr, /mob/living)) return
if(usr.stat) return
@@ -379,11 +371,7 @@ BLIND // can't see anything
usr.put_in_hands(hastie)
hastie = null
if (istype(hastie,/obj/item/clothing/tie/holster))
verbs -= /obj/item/clothing/under/proc/holster
if (istype(hastie,/obj/item/clothing/tie/storage))
verbs -= /obj/item/clothing/under/proc/storage
var/obj/item/clothing/tie/storage/W = hastie
if (W.hold)
W.hold.loc = hastie
@@ -396,59 +384,4 @@ BLIND // can't see anything
sensor_mode = pick(0,1,2,3)
..()
/obj/item/clothing/under/proc/holster()
set name = "Holster"
set category = "Object"
set src in usr
if(!istype(usr, /mob/living)) return
if(usr.stat) return
if (!hastie || !istype(hastie,/obj/item/clothing/tie/holster))
usr << "\red You need a holster for that!"
return
var/obj/item/clothing/tie/holster/H = hastie
if(!H.holstered)
if(!istype(usr.get_active_hand(), /obj/item/weapon/gun))
usr << "\blue You need your gun equiped to holster it."
return
var/obj/item/weapon/gun/W = usr.get_active_hand()
if (!W.isHandgun())
usr << "\red This gun won't fit in \the [H]!"
return
H.holstered = usr.get_active_hand()
usr.drop_item()
H.holstered.loc = src
usr.visible_message("\blue \The [usr] holsters \the [H.holstered].", "You holster \the [H.holstered].")
else
if(istype(usr.get_active_hand(),/obj) && istype(usr.get_inactive_hand(),/obj))
usr << "\red You need an empty hand to draw the gun!"
else
if(usr.a_intent == "harm")
usr.visible_message("\red \The [usr] draws \the [H.holstered], ready to shoot!", \
"\red You draw \the [H.holstered], ready to shoot!")
else
usr.visible_message("\blue \The [usr] draws \the [H.holstered], pointing it at the ground.", \
"\blue You draw \the [H.holstered], pointing it at the ground.")
usr.put_in_hands(H.holstered)
H.holstered = null
/obj/item/clothing/under/proc/storage()
set name = "Look in storage"
set category = "Object"
set src in usr
if(!istype(usr, /mob/living)) return
if(usr.stat) return
if (!hastie || !istype(hastie,/obj/item/clothing/tie/storage))
usr << "\red You need something to store items in for that!"
return
var/obj/item/clothing/tie/storage/W = hastie
if (!istype(W.hold))
return
W.hold.loc = usr
W.hold.attack_hand(usr)
+1 -3
View File
@@ -34,9 +34,7 @@
toggle()
/obj/item/clothing/head/welding/verb/toggle()
set category = "Object"
set name = "Adjust welding mask"
/obj/item/clothing/head/welding/proc/toggle()
set src in usr
if(usr.canmove && !usr.stat && !usr.restrained())
+40 -23
View File
@@ -162,6 +162,39 @@
icon_state = "holster"
_color = "holster"
var/obj/item/weapon/gun/holstered = null
icon_action_button = "action_holster"
/obj/item/clothing/tie/holster/attack_self()
holster()
/obj/item/clothing/tie/holster/proc/holster()
if(!istype(usr, /mob/living)) return
if(usr.stat) return
if(!holstered)
if(!istype(usr.get_active_hand(), /obj/item/weapon/gun))
usr << "\blue You need your gun equiped to holster it."
return
var/obj/item/weapon/gun/W = usr.get_active_hand()
if (!W.isHandgun())
usr << "\red This gun won't fit in \the [src]!"
return
holstered = usr.get_active_hand()
usr.drop_item()
holstered.loc = src
usr.visible_message("\blue \The [usr] holsters \the [holstered].", "You holster \the [holstered].")
else
if(istype(usr.get_active_hand(),/obj) && istype(usr.get_inactive_hand(),/obj))
usr << "\red You need an empty hand to draw the gun!"
else
if(usr.a_intent == "harm")
usr.visible_message("\red \The [usr] draws \the [holstered], ready to shoot!", \
"\red You draw \the [holstered], ready to shoot!")
else
usr.visible_message("\blue \The [usr] draws \the [holstered], pointing it at the ground.", \
"\blue You draw \the [holstered], pointing it at the ground.")
usr.put_in_hands(holstered)
holstered = null
/obj/item/clothing/tie/holster/armpit
name = "shoulder holster"
@@ -169,12 +202,6 @@
icon_state = "holster"
_color = "holster"
/obj/item/clothing/tie/holster/waist
name = "shoulder holster"
desc = "A handgun holster. Made of expensive leather."
icon_state = "holster"
_color = "holster_low"
/obj/item/clothing/tie/storage
name = "load bearing equipment"
desc = "Used to hold things when you don't have enough hands for that."
@@ -182,19 +209,20 @@
_color = "webbing"
var/slots = 3
var/obj/item/weapon/storage/pockets/hold
icon_action_button = "action_storage"
/obj/item/clothing/tie/storage/New()
hold = new /obj/item/weapon/storage/pockets(src)
hold.master_item = src
hold.storage_slots = slots
/obj/item/clothing/tie/storage/attack_self(mob/user as mob)
user << "<span class='notice'>You empty [src].</span>"
var/turf/T = get_turf(src)
hold.hide_from(usr)
for(var/obj/item/I in hold.contents)
hold.remove_from_storage(I, T)
src.add_fingerprint(user)
if (!istype(hold))
return
hold.loc = user
hold.attack_hand(user)
/obj/item/clothing/tie/storage/attackby(obj/item/weapon/W as obj, mob/user as mob)
hold.attackby(W,user)
@@ -335,14 +363,3 @@
..()
new /obj/item/weapon/hatchet/unathiknife(hold)
new /obj/item/weapon/hatchet/unathiknife(hold)
/////////////////
//Miscellaneous//
/////////////////
/obj/item/clothing/tie/accessory/gunholster
name = "gun holster"
desc = "When you just HAVE to show off your guns"
icon_state = "gunhulster"
_color = "gunhulster"