fix incorrect match path

can butcher with any sharp item on harm intent
simple_animal/attacked_by()
moved var/foldable to box level
some fixes with attack code
updated slime code, can now mousedrop as a slime to feed on mobs
adds sound to simple_animal/attackby
This commit is contained in:
uraniummeltdown
2018-03-04 13:52:53 +05:00
parent 01551ec248
commit d6a277a224
9 changed files with 96 additions and 88 deletions
+4 -4
View File
@@ -168,10 +168,10 @@
location.hotspot_expose(700, 5)
return
/obj/item/match/fire_act()
/obj/item/weapon/match/fire_act()
matchignite()
/obj/item/match/proc/matchignite()
/obj/item/weapon/match/proc/matchignite()
if(!lit && !burnt)
lit = TRUE
icon_state = "match_lit"
@@ -185,7 +185,7 @@
processing_objects.Add(src)
update_icon()
/obj/item/match/proc/matchburnout()
/obj/item/weapon/match/proc/matchburnout()
if(lit)
lit = FALSE
burnt = TRUE
@@ -198,7 +198,7 @@
attack_verb = list("flicked")
processing_objects.Remove(src)
/obj/item/match/dropped(mob/user)
/obj/item/weapon/match/dropped(mob/user)
matchburnout()
. = ..()
@@ -25,14 +25,40 @@
icon_state = "box"
item_state = "syringe_kit"
burn_state = FLAMMABLE
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
var/foldable = /obj/item/stack/sheet/cardboard
/obj/item/weapon/storage/box/attack_self(mob/user)
..()
if(!foldable)
return
if(contents.len)
to_chat(user, "<span class='warning'>You can't fold this box with items still inside!</span>")
return
if(!ispath(foldable))
return
// Close any open UI windows first
var/found = 0
for(var/mob/M in range(1))
if(M.s_active == src)
close(M)
if(M == user)
found = 1
if(!found) // User is too far away
return
to_chat(user, "<span class='notice'>You fold [src] flat.</span>")
var/obj/item/I = new foldable(get_turf(src))
user.put_in_hands(I)
qdel(src)
/obj/item/weapon/storage/box/large
name = "large box"
desc = "You could build a fort with this."
icon_state = "largebox"
w_class = 42 // Big, bulky.
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
foldable = /obj/item/stack/sheet/cardboard
storage_slots = 21
max_combined_w_class = 42 // 21*2
@@ -678,7 +704,7 @@
icon_state = "light"
desc = "This box is shaped on the inside so that only light tubes and bulbs fit."
item_state = "syringe_kit"
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
foldable = /obj/item/stack/sheet/cardboard
storage_slots=21
can_hold = list(/obj/item/weapon/light/tube, /obj/item/weapon/light/bulb)
max_combined_w_class = 21
@@ -22,7 +22,6 @@
var/allow_quick_empty //Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.
var/allow_quick_gather //Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
var/collection_mode = 1; //0 = pick one at a time, 1 = pick all on tile
var/foldable = null // BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard
var/use_sound = "rustle" //sound played when used. null for no sound.
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
@@ -474,35 +473,12 @@
for(var/obj/O in contents)
O.hear_message(M, msg)
// BubbleWrap - A box can be folded up to make card
/obj/item/weapon/storage/attack_self(mob/user as mob)
/obj/item/weapon/storage/attack_self(mob/user)
//Clicking on itself will empty it, if it has the verb to do that.
if(user.is_in_active_hand(src))
if(src.verbs.Find(/obj/item/weapon/storage/verb/quick_empty))
src.quick_empty()
return
//Otherwise we'll try to fold it.
if( contents.len )
return
if( !ispath(src.foldable) )
return
var/found = 0
// Close any open UI windows first
for(var/mob/M in range(1))
if(M.s_active == src)
src.close(M)
if( M == user )
found = 1
if( !found ) // User is too far away
return
// Now make the cardboard
to_chat(user, "<span class='notice'>You fold [src] flat.</span>")
new src.foldable(get_turf(src))
qdel(src)
//BubbleWrap END
if(verbs.Find(/obj/item/weapon/storage/verb/quick_empty))
quick_empty()
//Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area).
//Returns -1 if the atom was not found on container.