Mob inventory cleanup

This commit is contained in:
Kelenius
2016-03-15 16:39:40 +03:00
parent 5104957ff8
commit afbc235b96
59 changed files with 432 additions and 390 deletions
@@ -12,7 +12,7 @@
var/code = 2
/obj/item/device/radio/electropack/attack_hand(mob/user as mob)
/obj/item/device/radio/electropack/attack_hand(mob/living/user as mob)
if(src == user.back)
user << "<span class='notice'>You need help taking this off!</span>"
return
+1 -1
View File
@@ -209,7 +209,7 @@
amount = 5
max_amount = 5
/obj/item/stack/medical/splint/attack(mob/living/carbon/M as mob, mob/user as mob)
/obj/item/stack/medical/splint/attack(mob/living/carbon/M as mob, mob/living/user as mob)
if(..())
return 1
+1 -14
View File
@@ -160,20 +160,7 @@
P.icon_state = "paper_words"
if(istype(usr,/mob/living/carbon))
// place the item in the usr's hand if possible
if(!usr.r_hand)
P.loc = usr
usr.r_hand = P
P.layer = 20
else if(!usr.l_hand)
P.loc = usr
usr.l_hand = P
P.layer = 20
if (ismob(src.loc))
var/mob/M = src.loc
M.update_inv_l_hand()
M.update_inv_r_hand()
usr.put_in_hands(src)
/obj/item/weapon/autopsy_scanner/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
if(!istype(M))
@@ -445,39 +445,36 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/weapon/flame/lighter/attack_self(mob/living/user)
if(!base_state)
base_state = icon_state
if(user.r_hand == src || user.l_hand == src)
if(!lit)
lit = 1
icon_state = "[base_state]on"
item_state = "[base_state]on"
if(istype(src, /obj/item/weapon/flame/lighter/zippo) )
user.visible_message("<span class='rose'>Without even breaking stride, [user] flips open and lights [src] in one smooth movement.</span>")
else
if(prob(95))
user.visible_message("<span class='notice'>After a few attempts, [user] manages to light the [src].</span>")
else
user << "<span class='warning'>You burn yourself while lighting the lighter.</span>"
if (user.l_hand == src)
user.apply_damage(2,BURN,"l_hand")
else
user.apply_damage(2,BURN,"r_hand")
user.visible_message("<span class='notice'>After a few attempts, [user] manages to light the [src], they however burn their finger in the process.</span>")
set_light(2)
processing_objects.Add(src)
if(!lit)
lit = 1
icon_state = "[base_state]on"
item_state = "[base_state]on"
if(istype(src, /obj/item/weapon/flame/lighter/zippo) )
user.visible_message("<span class='rose'>Without even breaking stride, [user] flips open and lights [src] in one smooth movement.</span>")
else
lit = 0
icon_state = "[base_state]"
item_state = "[base_state]"
if(istype(src, /obj/item/weapon/flame/lighter/zippo) )
user.visible_message("<span class='rose'>You hear a quiet click, as [user] shuts off [src] without even looking at what they're doing.</span>")
if(prob(95))
user.visible_message("<span class='notice'>After a few attempts, [user] manages to light the [src].</span>")
else
user.visible_message("<span class='notice'>[user] quietly shuts off the [src].</span>")
user << "<span class='warning'>You burn yourself while lighting the lighter.</span>"
if (user.get_left_hand() == src)
user.apply_damage(2,BURN,"l_hand")
else
user.apply_damage(2,BURN,"r_hand")
user.visible_message("<span class='notice'>After a few attempts, [user] manages to light the [src], they however burn their finger in the process.</span>")
set_light(0)
processing_objects.Remove(src)
set_light(2)
processing_objects.Add(src)
else
return ..()
lit = 0
icon_state = "[base_state]"
item_state = "[base_state]"
if(istype(src, /obj/item/weapon/flame/lighter/zippo) )
user.visible_message("<span class='rose'>You hear a quiet click, as [user] shuts off [src] without even looking at what they're doing.</span>")
else
user.visible_message("<span class='notice'>[user] quietly shuts off the [src].</span>")
set_light(0)
processing_objects.Remove(src)
return
+2 -4
View File
@@ -77,7 +77,5 @@
icon_state = "purplecomb"
item_state = "purplecomb"
/obj/item/weapon/haircomb/attack_self(mob/user)
if(user.r_hand == src || user.l_hand == src)
user.visible_message(text("<span class='notice'>[] uses [] to comb their hair with incredible style and sophistication. What a [].</span>", user, src, user.gender == FEMALE ? "lady" : "guy"))
return
/obj/item/weapon/haircomb/attack_self(mob/living/user)
user.visible_message(text("<span class='notice'>[] uses [] to comb their hair with incredible style and sophistication. What a [].</span>", user, src, user.gender == FEMALE ? "lady" : "guy"))
@@ -39,8 +39,8 @@
return null
var/turf/location = loc
if(istype(location, /mob/))
var/mob/M = location
if(M.l_hand == src || M.r_hand == src)
var/mob/living/M = location
if(M.item_is_in_hands(src))
location = M.loc
if(isturf(location)) //start a fire if possible
location.hotspot_expose(700, 2)
@@ -125,12 +125,12 @@
icon_state = "wrap_paper"
var/amount = 20.0
/obj/item/weapon/wrapping_paper/attackby(obj/item/weapon/W as obj, mob/user as mob)
/obj/item/weapon/wrapping_paper/attackby(obj/item/weapon/W as obj, mob/living/user as mob)
..()
if (!( locate(/obj/structure/table, src.loc) ))
user << "<span class='warning'>You MUST put the paper on a table!</span>"
if (W.w_class < 4)
if ((istype(user.l_hand, /obj/item/weapon/wirecutters) || istype(user.r_hand, /obj/item/weapon/wirecutters)))
if (user.get_type_in_hands(/obj/item/weapon/wirecutters))
var/a_used = 2 ** (src.w_class - 1)
if (src.amount < a_used)
user << "<span class='warning'>You need more paper!</span>"
@@ -24,8 +24,8 @@
return
attack_hand(mob/user as mob)
if ((src.case && (user.l_hand == src || user.r_hand == src)))
attack_hand(mob/living/user as mob)
if ((src.case && user.item_is_in_hands(src)))
user.put_in_active_hand(case)
src.case.add_fingerprint(user)
@@ -29,7 +29,7 @@
/obj/item/weapon/material/twohanded/update_held_icon()
var/mob/living/M = loc
if(istype(M) && !issmall(M) && ((M.r_hand == src && !M.l_hand) || (M.l_hand == src && !M.r_hand)))
if(istype(M) && !issmall(M) && M.item_is_in_hands(src) && !M.hands_are_full())
wielded = 1
force = force_wielded
name = "[base_name] (wielded)"
@@ -214,7 +214,7 @@
spawn(1) if(src) qdel(src)
/obj/item/weapon/melee/energy/blade/process()
if(!creator || loc != creator || (creator.l_hand != src && creator.r_hand != src))
if(!creator || loc != creator || !creator.item_is_in_hands(src))
// Tidy up a bit.
if(istype(loc,/mob/living))
var/mob/living/carbon/human/host = loc
@@ -59,7 +59,7 @@
spawn(1) if(src) del(src)
/obj/item/weapon/mop_deploy/process()
if(!creator || loc != creator || (creator.l_hand != src && creator.r_hand != src))
if(!creator || loc != creator || !creator.item_is_in_hands(src))
// Tidy up a bit.
if(istype(loc,/mob/living))
var/mob/living/carbon/human/host = loc
@@ -21,7 +21,7 @@
var/linked
/obj/item/weapon/storage/laundry_basket/attack_hand(mob/user as mob)
/obj/item/weapon/storage/laundry_basket/attack_hand(mob/living/user as mob)
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/temp = H.get_organ("r_hand")
+4 -4
View File
@@ -173,7 +173,7 @@
user << text("\icon[] [] contains []/[] units of fuel!", src, src.name, get_fuel(),src.max_fuel )
/obj/item/weapon/weldingtool/attackby(obj/item/W as obj, mob/user as mob)
/obj/item/weapon/weldingtool/attackby(obj/item/W as obj, mob/living/user as mob)
if(istype(W,/obj/item/weapon/screwdriver))
if(welding)
user << "<span class='danger'>Stop welding first!</span>"
@@ -222,9 +222,9 @@
//I'm not sure what this does. I assume it has to do with starting fires...
//...but it doesnt check to see if the welder is on or not.
var/turf/location = src.loc
if(istype(location, /mob/))
var/mob/M = location
if(M.l_hand == src || M.r_hand == src)
if(istype(location, /mob/living))
var/mob/living/M = location
if(M.item_is_in_hands(src))
location = get_turf(M)
if (istype(location, /turf))
location.hotspot_expose(700, 5)