mirror of
https://github.com/goonstation/goonstation-2020.git
synced 2026-08-29 15:06:13 +01:00
95 lines
3.9 KiB
Plaintext
95 lines
3.9 KiB
Plaintext
/obj/item/clothing/head/fruithat
|
|
name = "fruit basket hat"
|
|
desc = "Where do these things even come from? It reeks of welch, and it's not the grapes."
|
|
wear_image_icon = 'icons/mob/fruithat.dmi'
|
|
icon_state = "fruithat"
|
|
var/bites = 8
|
|
var/list/youarebad = list("You're a liar.", "You're a cheat.","You're a fraud.") // h e h
|
|
|
|
attack(mob/M as mob, mob/user as mob) //edible hats? why not
|
|
if (M == user)
|
|
if (!src.bites)
|
|
boutput(user, "<span style=\"color:red\">No more bites of \the [src] left, oh no!</span>")
|
|
user.u_equip(src)
|
|
qdel(src)
|
|
else
|
|
M.visible_message("<span style=\"color:blue\">[M] takes a bite of [src]!</span>",\
|
|
"<span style=\"color:blue\">You take a bite of [src]!</span>")
|
|
src.bites--
|
|
M.nutrition += 20
|
|
playsound(M.loc,"sound/items/eatfood.ogg", rand(10,50), 1)
|
|
if (!src.bites)
|
|
M.visible_message("<span style=\"color:red\">[M] finishes eating [src].</span>",\
|
|
"<span style=\"color:red\">You finish eating [src].</span>")
|
|
user.u_equip(src)
|
|
qdel(src)
|
|
sleep(rand(10,50))
|
|
boutput(M, voidSpeak(pick(youarebad)))
|
|
random_brute_damage(user, 5)
|
|
else if(check_target_immunity(M))
|
|
user.visible_message("<span style='color:red'>You try to feed [M] [src], but fail!</span>")
|
|
else
|
|
user.tri_message("<span style=\"color:red\"><b>[user]</b> tries to feed [M] [src]!</span>",\
|
|
user, "<span style=\"color:red\">You try to feed [M] [src]!</span>",\
|
|
M, "<span style=\"color:red\"><b>[user]</b> tries to feed you [src]!</span>")
|
|
if (!do_after(user, 10))
|
|
boutput(user, "<span style=\"color:red\">You were interrupted!</span>")
|
|
return ..()
|
|
else
|
|
user.tri_message("<span style=\"color:red\"><b>[user]</b> feeds [M] [src]!</span>",\
|
|
user, "<span style=\"color:red\">You feed [M] [src]!</span>",\
|
|
M, "<span style=\"color:red\"><b>[user]</b> feeds you [src]!</span>")
|
|
src.bites--
|
|
M.nutrition += 20
|
|
playsound(M.loc, "sound/items/eatfood.ogg", rand(10,50), 1)
|
|
if (!src.amount)
|
|
M.visible_message("<span style=\"color:red\">[M] finishes eating [src].</span>",\
|
|
"<span style=\"color:red\">You finish eating [src].</span>")
|
|
user.u_equip(src)
|
|
qdel(src)
|
|
sleep(rand(10,50))
|
|
boutput(M, voidSpeak(pick(youarebad)))
|
|
random_brute_damage(user, 5)
|
|
|
|
//////////////////////////////////////////////FRUITHAT ASSEMBLIES
|
|
|
|
/obj/item/dynassembly/fruit
|
|
name = "wire" //This gets funky otherwise.
|
|
icon = 'icons/obj/foodNdrink/food_produce.dmi'
|
|
validparts = list(/obj/item/reagent_containers/food/snacks/plant/)
|
|
multipart = 1
|
|
|
|
checkifdone()
|
|
if (src.contents.len >= 8)
|
|
src.product = 1
|
|
src.desc += "<BR><span style=\"color:blue\">It looks like this assembly can be secured with a screwdriver.</span>"
|
|
|
|
createproduct(mob/user)
|
|
if (product == 1)
|
|
var/obj/item/clothing/head/fruithat/N = new /obj/item/clothing/head/fruithat(get_turf(src))
|
|
boutput(user, "You have successfully created \a [N]!")
|
|
return
|
|
|
|
/obj/item/reagent_containers/food/snacks/plant/attackby(obj/item/W as obj, mob/user as mob) //first phase of fruithat construction
|
|
if (istype(W, /obj/item/cable_coil))
|
|
var/obj/item/cable_coil/C = W
|
|
if (src.validforhat == 1) //is it a fruit and not a filthy vegetable?
|
|
if (C.amount <= 7)
|
|
boutput(user, "You don't have enough cable to add to \the [src.name]")
|
|
else
|
|
boutput(user, "<span style=\"color:blue\">You begin adding \the [C.name] to \the [src.name].</span>")
|
|
if (!do_after(user, 30))
|
|
boutput(user, "<span style=\"color:red\">You were interrupted!</span>")
|
|
return ..()
|
|
else
|
|
C.amount -= 8
|
|
C.updateicon()
|
|
user.drop_item()
|
|
var/obj/item/dynassembly/fruit/A = new /obj/item/dynassembly/fruit(get_turf(src))
|
|
A.newpart(A,src,1) //returns assembly we created, fruit we made it from, and 1st run
|
|
var/image/I = new /image('icons/obj/foodNdrink/food_produce.dmi', "hatwires")
|
|
I.layer += 1
|
|
A.overlays += I
|
|
else
|
|
boutput(user, "The [src.name] cannot be wired with the [C.name]")
|
|
return ..() |