Merge pull request #8804 from MistakeNot4892/crafts

Craftable poncho and cloaks.
This commit is contained in:
Spookerton
2022-10-31 12:31:36 +00:00
committed by GitHub
22 changed files with 343 additions and 109 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ var/global/datum/antagonist/raider/raiders
/obj/item/clothing/suit/storage/toggle/hoodie,
/obj/item/clothing/suit/storage/toggle/hoodie/black,
/obj/item/clothing/suit/unathi/mantle,
/obj/item/clothing/accessory/poncho,
/obj/item/clothing/accessory/storage/poncho,
)
var/list/raider_guns = list(
@@ -185,32 +185,32 @@
/datum/gear/suit/poncho
display_name = "poncho selection"
description = "A selection of ponchos in basic and departmental colours."
path = /obj/item/clothing/accessory/poncho
path = /obj/item/clothing/accessory/storage/poncho
/datum/gear/suit/poncho/New()
..()
var/list/ponchos = list()
for(var/poncho_style in (typesof(/obj/item/clothing/accessory/poncho) - typesof(/obj/item/clothing/accessory/poncho/roles/cloak)))
var/obj/item/clothing/accessory/poncho/poncho = poncho_style
for(var/poncho_style in (typesof(/obj/item/clothing/accessory/storage/poncho) - typesof(/obj/item/clothing/accessory/storage/poncho/roles/cloak)))
var/obj/item/clothing/accessory/storage/poncho/poncho = poncho_style
ponchos[initial(poncho.name)] = poncho
gear_tweaks += new/datum/gear_tweak/path(sortAssoc(ponchos))
/datum/gear/suit/cloak_department
display_name = "cloak, departmental selection"
description = "A selection of cloaks in departmental colours."
path = /obj/item/clothing/accessory/poncho/roles/cloak/cargo
path = /obj/item/clothing/accessory/storage/poncho/roles/cloak/cargo
/datum/gear/suit/cloak_department/New()
..()
var/list/cloaks = list()
for(var/cloak_style in (typesof(/obj/item/clothing/accessory/poncho/roles/cloak)))
var/obj/item/clothing/accessory/poncho/roles/cloak/cloak = cloak_style
for(var/cloak_style in (typesof(/obj/item/clothing/accessory/storage/poncho/roles/cloak)))
var/obj/item/clothing/accessory/storage/poncho/roles/cloak/cloak = cloak_style
cloaks[initial(cloak.name)] = cloak
gear_tweaks += new/datum/gear_tweak/path(sortAssoc(cloaks))
/datum/gear/suit/cloak_custom //A colorable cloak
display_name = "cloak (colorable)"
path = /obj/item/clothing/accessory/poncho/roles/cloak/custom
path = /obj/item/clothing/accessory/storage/poncho/roles/cloak/custom
/datum/gear/suit/cloak_custom/New()
..()
@@ -43,14 +43,13 @@
/*
* Poncho
*/
/obj/item/clothing/accessory/poncho
/obj/item/clothing/accessory/storage/poncho
name = "poncho"
desc = "A simple, comfortable poncho."
icon_state = "classicponcho"
item_state = "classicponcho"
icon_override = 'icons/mob/ties.dmi'
var/icon_override_state /// Change this for mid-round and paintkit.
var/fire_resist = T0C+100
slots = 2
allowed = list(/obj/item/tank/emergency/oxygen)
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
slot_flags = SLOT_OCLOTHING | SLOT_TIE
@@ -61,8 +60,10 @@
sprite_sheets = list(
SPECIES_TESHARI = 'icons/mob/species/teshari/suit.dmi'
)
var/icon_override_state /// Change this for mid-round and paintkit.
var/fire_resist = T0C+100
/obj/item/clothing/accessory/poncho/equipped() /// Sets override, allows for mid-round changes && custom items. If you improve this code, please update paintkit.dm to accept it.
/obj/item/clothing/accessory/storage/poncho/equipped() /// Sets override, allows for mid-round changes && custom items. If you improve this code, please update paintkit.dm to accept it.
..()
var/mob/living/carbon/human/H = loc
if(istype(H) && H.wear_suit == src)
@@ -71,16 +72,16 @@
else if(icon_override_state)
icon_override = icon_override_state
else
icon_override = 'icons/mob/ties.dmi'
icon_override = initial(icon_override)
H.update_inv_wear_suit()
/obj/item/clothing/accessory/poncho/dropped() // Reset override
/obj/item/clothing/accessory/storage/poncho/dropped() // Reset override
if(icon_override_state)
icon_override = icon_override_state
else
icon_override = 'icons/mob/ties.dmi'
icon_override = initial(icon_override)
/obj/item/clothing/accessory/poncho/on_attached(obj/item/clothing/S, mob/user) /// Otherwise gives teshari normal icon.
/obj/item/clothing/accessory/storage/poncho/on_attached(obj/item/clothing/S, mob/user) /// Otherwise gives teshari normal icon.
. = ..()
if(icon_override_state)
icon_override = icon_override_state
@@ -89,57 +90,57 @@
if(H.species.name == SPECIES_TESHARI)
icon_override = sprite_sheets[SPECIES_TESHARI]
else
icon_override = 'icons/mob/ties.dmi'
icon_override = initial(icon_override)
/obj/item/clothing/accessory/poncho/green
/obj/item/clothing/accessory/storage/poncho/green
name = "green poncho"
desc = "A simple, comfortable cloak without sleeves. This one is green."
icon_state = "greenponcho"
item_state = "greenponcho"
/obj/item/clothing/accessory/poncho/red
/obj/item/clothing/accessory/storage/poncho/red
name = "red poncho"
desc = "A simple, comfortable cloak without sleeves. This one is red."
icon_state = "redponcho"
item_state = "redponcho"
/obj/item/clothing/accessory/poncho/purple
/obj/item/clothing/accessory/storage/poncho/purple
name = "purple poncho"
desc = "A simple, comfortable cloak without sleeves. This one is purple."
icon_state = "purpleponcho"
item_state = "purpleponcho"
/obj/item/clothing/accessory/poncho/blue
/obj/item/clothing/accessory/storage/poncho/blue
name = "blue poncho"
desc = "A simple, comfortable cloak without sleeves. This one is blue."
icon_state = "blueponcho"
item_state = "blueponcho"
/obj/item/clothing/accessory/poncho/roles/security
/obj/item/clothing/accessory/storage/poncho/roles/security
name = "security poncho"
desc = "A simple, comfortable cloak without sleeves. This one is black and red, standard NanoTrasen Security colors."
icon_state = "secponcho"
item_state = "secponcho"
/obj/item/clothing/accessory/poncho/roles/medical
/obj/item/clothing/accessory/storage/poncho/roles/medical
name = "medical poncho"
desc = "A simple, comfortable cloak without sleeves. This one is white with green and blue tint, standard Medical colors."
icon_state = "medponcho"
item_state = "medponcho"
/obj/item/clothing/accessory/poncho/roles/engineering
/obj/item/clothing/accessory/storage/poncho/roles/engineering
name = "engineering poncho"
desc = "A simple, comfortable cloak without sleeves. This one is yellow and orange, standard Engineering colors."
icon_state = "engiponcho"
item_state = "engiponcho"
/obj/item/clothing/accessory/poncho/roles/science
/obj/item/clothing/accessory/storage/poncho/roles/science
name = "science poncho"
desc = "A simple, comfortable cloak without sleeves. This one is white with purple trim, standard NanoTrasen Science colors."
icon_state = "sciponcho"
item_state = "sciponcho"
/obj/item/clothing/accessory/poncho/roles/cargo
/obj/item/clothing/accessory/storage/poncho/roles/cargo
name = "cargo poncho"
desc = "A simple, comfortable cloak without sleeves. This one is tan and grey, the colors of Cargo."
icon_state = "cargoponcho"
@@ -148,105 +149,105 @@
/*
* Cloak
*/
/obj/item/clothing/accessory/poncho/roles/cloak
/obj/item/clothing/accessory/storage/poncho/roles/cloak
name = "quartermaster's cloak"
desc = "An elaborate brown and gold cloak."
icon_state = "qmcloak"
item_state = "qmcloak"
body_parts_covered = null
/obj/item/clothing/accessory/poncho/roles/cloak/ce
/obj/item/clothing/accessory/storage/poncho/roles/cloak/ce
name = "chief engineer's cloak"
desc = "An elaborate cloak worn by the chief engineer."
icon_state = "cecloak"
item_state = "cecloak"
/obj/item/clothing/accessory/poncho/roles/cloak/cmo
/obj/item/clothing/accessory/storage/poncho/roles/cloak/cmo
name = "chief medical officer's cloak"
desc = "An elaborate cloak meant to be worn by the chief medical officer."
icon_state = "cmocloak"
item_state = "cmocloak"
/obj/item/clothing/accessory/poncho/roles/cloak/hop
/obj/item/clothing/accessory/storage/poncho/roles/cloak/hop
name = "head of personnel's cloak"
desc = "An elaborate cloak meant to be worn by the head of personnel."
icon_state = "hopcloak"
item_state = "hopcloak"
/obj/item/clothing/accessory/poncho/roles/cloak/rd
/obj/item/clothing/accessory/storage/poncho/roles/cloak/rd
name = "research director's cloak"
desc = "An elaborate cloak meant to be worn by the research director."
icon_state = "rdcloak"
item_state = "rdcloak"
/obj/item/clothing/accessory/poncho/roles/cloak/qm
/obj/item/clothing/accessory/storage/poncho/roles/cloak/qm
name = "quartermaster's cloak"
desc = "An elaborate cloak meant to be worn by the quartermaster."
icon_state = "qmcloak"
item_state = "qmcloak"
/obj/item/clothing/accessory/poncho/roles/cloak/hos
/obj/item/clothing/accessory/storage/poncho/roles/cloak/hos
name = "head of security's cloak"
desc = "An elaborate cloak meant to be worn by the head of security."
icon_state = "hoscloak"
item_state = "hoscloak"
/obj/item/clothing/accessory/poncho/roles/cloak/captain
/obj/item/clothing/accessory/storage/poncho/roles/cloak/captain
name = "site manager's cloak"
desc = "An elaborate cloak meant to be worn by the site manager."
icon_state = "capcloak"
item_state = "capcloak"
/obj/item/clothing/accessory/poncho/roles/cloak/cargo
/obj/item/clothing/accessory/storage/poncho/roles/cloak/cargo
name = "brown cloak"
desc = "A simple brown and black cloak."
icon_state = "cargocloak"
item_state = "cargocloak"
/obj/item/clothing/accessory/poncho/roles/cloak/mining
/obj/item/clothing/accessory/storage/poncho/roles/cloak/mining
name = "trimmed purple cloak"
desc = "A trimmed purple and brown cloak."
icon_state = "miningcloak"
item_state = "miningcloak"
/obj/item/clothing/accessory/poncho/roles/cloak/security
/obj/item/clothing/accessory/storage/poncho/roles/cloak/security
name = "red cloak"
desc = "A simple red and black cloak."
icon_state = "seccloak"
item_state = "seccloak"
/obj/item/clothing/accessory/poncho/roles/cloak/service
/obj/item/clothing/accessory/storage/poncho/roles/cloak/service
name = "green cloak"
desc = "A simple green and blue cloak."
icon_state = "servicecloak"
item_state = "servicecloak"
/obj/item/clothing/accessory/poncho/roles/cloak/engineer
/obj/item/clothing/accessory/storage/poncho/roles/cloak/engineer
name = "gold cloak"
desc = "A simple gold and brown cloak."
icon_state = "engicloak"
item_state = "engicloak"
/obj/item/clothing/accessory/poncho/roles/cloak/atmos
/obj/item/clothing/accessory/storage/poncho/roles/cloak/atmos
name = "yellow cloak"
desc = "A trimmed yellow and blue cloak."
icon_state = "atmoscloak"
item_state = "atmoscloak"
/obj/item/clothing/accessory/poncho/roles/cloak/research
/obj/item/clothing/accessory/storage/poncho/roles/cloak/research
name = "purple cloak"
desc = "A simple purple and white cloak."
icon_state = "scicloak"
item_state = "scicloak"
/obj/item/clothing/accessory/poncho/roles/cloak/medical
/obj/item/clothing/accessory/storage/poncho/roles/cloak/medical
name = "blue cloak"
desc = "A simple blue and white cloak."
icon_state = "medcloak"
item_state = "medcloak"
/obj/item/clothing/accessory/poncho/roles/cloak/custom //A colorable cloak
/obj/item/clothing/accessory/storage/poncho/roles/cloak/custom //A colorable cloak
name = "cloak"
desc = "A simple, bland cloak."
icon_state = "colorcloak"
@@ -428,4 +429,4 @@
/obj/item/clothing/accessory/asymovercoat
name = "orange asymmetrical overcoat"
desc = "An asymmetrical orange overcoat in a 2560's fashion."
icon_state = "asymovercoat"
icon_state = "asymovercoat"
@@ -0,0 +1,175 @@
/obj/item/clothing/accessory/storage/poncho/crafted
name = "poncho"
desc = "A handmade poncho, little more than a rough sheet with a neckhole in it."
icon_state = "poncho_base"
item_state = "poncho_base"
default_material = MAT_CLOTH
material_slowdown_multiplier = 0
icon = 'icons/obj/clothing/crafted_poncho.dmi'
icon_override = 'icons/mob/crafted_poncho.dmi'
sprite_sheets = list(
SPECIES_TESHARI = 'icons/mob/species/teshari/crafted_poncho.dmi'
)
var/dyed = FALSE
var/list/initial_armor
var/list/plates
var/max_plates = 3
var/static/list/accepts_dyes = list(
"sifsap",
"crayon_dust",
"crayon_dust_red",
"crayon_dust_orange",
"crayon_dust_yellow",
"crayon_dust_green",
"crayon_dust_blue",
"crayon_dust_purple",
"crayon_dust_grey",
"crayon_dust_brown",
"marker_ink",
"marker_ink_black",
"marker_ink_red",
"marker_ink_orange",
"marker_ink_yellow",
"marker_ink_green",
"marker_ink_blue",
"marker_ink_purple",
"marker_ink_grey",
"marker_ink_brown",
"paint"
)
/obj/item/clothing/accessory/storage/poncho/crafted/cloak
name = "cloak"
desc = "A handmade cloak, little more than a rough shroud with a collar and clasp attacked."
icon_state = "cloak_base"
item_state = "cloak_base"
icon = 'icons/obj/clothing/crafted_cloak.dmi'
icon_override = 'icons/mob/crafted_cloak.dmi'
sprite_sheets = list(
SPECIES_TESHARI = 'icons/mob/species/teshari/crafted_cloak.dmi'
)
/obj/item/clothing/accessory/storage/poncho/crafted/Initialize()
. = ..()
update_icon()
/obj/item/clothing/accessory/storage/poncho/crafted/Destroy()
QDEL_NULL_LIST(plates)
return ..()
/obj/item/clothing/accessory/storage/poncho/crafted/update_clothing_icon()
if(ismob(loc))
var/mob/M = src.loc
M.update_inv_wear_suit()
. = ..()
/obj/item/clothing/accessory/storage/poncho/crafted/proc/recalculate_armor()
LAZYINITLIST(armor)
if(!initial_armor)
initial_armor = armor.Copy()
else
armor = initial_armor.Copy()
if(length(plates))
var/list/averaged_plate_armour = list()
for(var/obj/item/clothing/accessory/plate in plates)
for(var/armor_key in plate.armor)
averaged_plate_armour[armor_key] = averaged_plate_armour[armor_key] + plate.armor[armor_key]
for(var/armor_key in averaged_plate_armour)
armor[armor_key] = max(armor[armor_key], round(averaged_plate_armour[armor_key] / max_plates))
update_icon()
update_clothing_icon()
/obj/item/clothing/accessory/storage/poncho/crafted/make_worn_icon(var/body_type, var/slot_name, var/inhands, var/default_icon, var/default_layer, var/icon/clip_mask = null)
var/image/standing = ..()
if(standing && slot_name == slot_wear_suit_str)
var/use_icon = LAZYACCESS(sprite_sheets, body_type) || icon_override
if(use_icon)
var/list/plate_overlays = list()
for(var/i = 1 to length(plates))
var/atom/plate = plates[i]
var/image/I = image(use_icon, "[icon_state]_plate[i]")
I.appearance_flags |= RESET_COLOR
I.color = plate.color
plate_overlays += I
standing.overlays = plate_overlays
return standing
/obj/item/clothing/accessory/storage/poncho/crafted/update_icon()
cut_overlays()
for(var/i = 1 to length(plates))
var/atom/plate = plates[i]
var/image/I = image(icon, "[icon_state]_plate[i]")
I.appearance_flags |= RESET_COLOR
I.color = plate.color
add_overlay(I)
/obj/item/clothing/accessory/storage/poncho/crafted/attackby(var/obj/item/O, var/mob/user)
if(istype(O, /obj/item/clothing/accessory/armor) || istype(O, /obj/item/clothing/accessory/material/makeshift))
if(length(plates) >= max_plates)
to_chat(user, SPAN_WARNING("\The [src] is already plated with [length(plates)] plate\s, and cannot support more."))
else if(user.unEquip(O, src))
O.forceMove(src)
LAZYADD(plates, O)
user.visible_message(SPAN_NOTICE("\The [user] secures \the [O] to \the [src]."))
recalculate_armor()
return TRUE
if(O.is_wirecutter())
if(!length(plates))
to_chat(user, SPAN_WARNING("\The [src] has no plating to remove."))
else
var/obj/item/plate = plates[1]
user.visible_message(SPAN_NOTICE("\The [user] removes \the [plate] from \the [src]."))
plate.dropInto(user.loc)
LAZYREMOVE(plates, plate)
recalculate_armor()
return TRUE
if(istype(O, /obj/item/reagent_containers/glass))
var/obj/item/reagent_containers/glass/vessel = O
// If it's closed, handle it as a normal attackby.
if(!vessel.is_open_container())
return ..()
// Check some general preconditions...
if(dyed)
to_chat(user, SPAN_WARNING("\The [src] has already been dyed; the material won't take another pigment."))
return TRUE
if(!isturf(loc))
to_chat(user, SPAN_WARNING("\The [src] must be on the ground before you can get to work."))
return TRUE
if(!vessel.reagents?.total_volume)
to_chat(user, SPAN_WARNING("\The [vessel] is empty."))
return TRUE
// Look for a valid pigment and sufficient reagents.
var/has_pigment = FALSE
for(var/datum/reagent/R in vessel.reagents.reagent_list)
if(R.id in accepts_dyes)
has_pigment = TRUE
break
if(!has_pigment)
to_chat(user, SPAN_WARNING("There is nothing in \the [vessel] that will bind to \the [src]."))
return TRUE
if(vessel.reagents.total_volume < 10)
to_chat(user, SPAN_WARNING("You will need at least 10u of pigment to dye \the [src]."))
return TRUE
// Do the actual dye operation.
var/apply_colour = vessel.reagents.get_color() // Keep this so when we remove on the next step it doesn't change.
vessel.reagents.remove_any(10)
visible_message(SPAN_NOTICE("\The [user] lays out \the [src] and begins soaking it with the contents of \the [vessel]."))
user.setClickCooldown(5 SECONDS) // Prevents spamming the dye interaction.
if(!do_after(user, 5 SECONDS, src) || QDELETED(src) || QDELETED(vessel))
to_chat(user, SPAN_WARNING("You fail to dye \the [src], wasting the pigment."))
return TRUE
visible_message(SPAN_NOTICE("\The [user] dyes \the [src] with the contents of \the [vessel]."))
color = apply_colour
applies_material_color = FALSE
return TRUE
return ..()
@@ -1,5 +1,5 @@
/obj/item/clothing/accessory/poncho/thermal
/obj/item/clothing/accessory/storage/poncho/thermal
name = "thermal poncho"
desc = "A simple, comfortable poncho with a thermal foil layer."
slot_flags = SLOT_OCLOTHING | SLOT_TIE
@@ -11,55 +11,55 @@
min_cold_protection_temperature = T0C - 40
max_heat_protection_temperature = ARMOR_MAX_HEAT_PROTECTION_TEMPERATURE
/obj/item/clothing/accessory/poncho/thermal/green
/obj/item/clothing/accessory/storage/poncho/thermal/green
name = "green thermal poncho"
desc = "A simple, comfortable poncho with a thermal foil layer. This one is green."
icon_state = "greenponcho"
item_state = "greenponcho"
/obj/item/clothing/accessory/poncho/thermal/red
/obj/item/clothing/accessory/storage/poncho/thermal/red
name = "red thermal poncho"
desc = "A simple, comfortable poncho with a thermal foil layer. This one is red."
icon_state = "redponcho"
item_state = "redponcho"
/obj/item/clothing/accessory/poncho/thermal/purple
/obj/item/clothing/accessory/storage/poncho/thermal/purple
name = "purple thermal poncho"
desc = "A simple, comfortable poncho with a thermal foil layer. This one is purple."
icon_state = "purpleponcho"
item_state = "purpleponcho"
/obj/item/clothing/accessory/poncho/thermal/blue
/obj/item/clothing/accessory/storage/poncho/thermal/blue
name = "blue thermal poncho"
desc = "A simple, comfortable poncho with a thermal foil layer. This one is blue."
icon_state = "blueponcho"
item_state = "blueponcho"
/obj/item/clothing/accessory/poncho/thermal/security
/obj/item/clothing/accessory/storage/poncho/thermal/security
name = "security thermal poncho"
desc = "A simple, comfortable poncho with a thermal foil layer. This one is black and red, standard NanoTrasen Security colors."
icon_state = "secponcho"
item_state = "secponcho"
/obj/item/clothing/accessory/poncho/thermal/medical
/obj/item/clothing/accessory/storage/poncho/thermal/medical
name = "medical thermal poncho"
desc = "A simple, comfortable poncho with a thermal foil layer. This one is white with green and blue tint, standard Medical colors."
icon_state = "medponcho"
item_state = "medponcho"
/obj/item/clothing/accessory/poncho/thermal/engineering
/obj/item/clothing/accessory/storage/poncho/thermal/engineering
name = "engineering thermal poncho"
desc = "A simple, comfortable poncho with a thermal foil layer. This one is yellow and orange, standard Engineering colors."
icon_state = "engiponcho"
item_state = "engiponcho"
/obj/item/clothing/accessory/poncho/thermal/science
/obj/item/clothing/accessory/storage/poncho/thermal/science
name = "science thermal poncho"
desc = "A simple, comfortable poncho with a thermal foil layer. This one is white with purple trim, standard NanoTrasen Science colors."
icon_state = "sciponcho"
item_state = "sciponcho"
/obj/item/clothing/accessory/poncho/thermal/cargo
/obj/item/clothing/accessory/storage/poncho/thermal/cargo
name = "cargo thermal poncho"
desc = "A simple, comfortable poncho with a thermal foil layer. This one is tan and grey, the colors of Cargo."
icon_state = "cargoponcho"
@@ -13,6 +13,8 @@
/datum/material/cloth/generate_recipes()
recipes = list(
new /datum/stack_recipe("poncho", /obj/item/clothing/accessory/storage/poncho/crafted, 8, time = 5 SECONDS, pass_stack_color = TRUE, supplied_material = "[name]"),
new /datum/stack_recipe("cloak", /obj/item/clothing/accessory/storage/poncho/crafted/cloak, 8, time = 5 SECONDS, pass_stack_color = TRUE, supplied_material = "[name]"),
new /datum/stack_recipe("woven net", /obj/item/material/fishing_net, 10, time = 30 SECONDS, pass_stack_color = TRUE, supplied_material = "[name]"),
new /datum/stack_recipe("bedsheet", /obj/item/bedsheet, 10, time = 30 SECONDS, pass_stack_color = TRUE, recycle_material = "[name]"),
new /datum/stack_recipe("uniform", /obj/item/clothing/under/color/white, 8, time = 15 SECONDS, pass_stack_color = TRUE, recycle_material = "[name]"),
@@ -14,6 +14,8 @@
/datum/material/leather/generate_recipes()
recipes = list(
new /datum/stack_recipe("poncho", /obj/item/clothing/accessory/storage/poncho/crafted, 8, time = 5 SECONDS, pass_stack_color = TRUE, supplied_material = "[name]"),
new /datum/stack_recipe("cloak", /obj/item/clothing/accessory/storage/poncho/crafted/cloak, 8, time = 5 SECONDS, pass_stack_color = TRUE, supplied_material = "[name]"),
new /datum/stack_recipe("bedsheet", /obj/item/bedsheet, 10, time = 30 SECONDS, pass_stack_color = TRUE, recycle_material = "[name]"),
new /datum/stack_recipe("uniform", /obj/item/clothing/under/color/white, 8, time = 15 SECONDS, pass_stack_color = TRUE, recycle_material = "[name]"),
new /datum/stack_recipe("foot wraps", /obj/item/clothing/shoes/footwraps, 2, time = 5 SECONDS, pass_stack_color = TRUE, recycle_material = "[name]"),
@@ -277,42 +277,103 @@
unacidable = 0
drop_sound = 'sound/items/drop/helm.ogg'
pickup_sound = 'sound/items/pickup/helm.ogg'
var/obj/item/holding
var/helmet_type = /obj/item/clothing/head/helmet/bucket
var/static/list/accept_items_for_mashing = list(
/obj/item/reagent_containers/food/snacks,
/obj/item/material/snow/snowball,
/obj/item/stack/material/snow
)
/obj/item/reagent_containers/glass/bucket/attackby(var/obj/item/D, mob/user as mob)
/obj/item/reagent_containers/glass/bucket/attackby(var/obj/item/D, mob/user)
// Turn bucket into a janibot.
if(isprox(D))
to_chat(user, "You add [D] to [src].")
qdel(D)
user.put_in_hands(new /obj/item/bucket_sensor)
user.drop_from_inventory(src)
qdel(src)
return
else if(D.is_wirecutter())
to_chat(user, "<span class='notice'>You cut a big hole in \the [src] with \the [D]. It's kinda useless as a bucket now.</span>")
user.put_in_hands(new /obj/item/clothing/head/helmet/bucket)
return TRUE
// Turn bucket into a helmet.
if(D.is_wirecutter() && helmet_type)
to_chat(user, SPAN_NOTICE("You cut a big hole in \the [src] with \the [D]. It's kinda useless as a bucket now."))
user.put_in_hands(new helmet_type)
user.drop_from_inventory(src)
qdel(src)
return
else if(istype(D, /obj/item/stack/material) && D.get_material_name() == MAT_STEEL)
return TRUE
// Turn bucket into a robot assembly.
if(istype(D, /obj/item/stack/material) && D.get_material_name() == MAT_STEEL)
var/obj/item/stack/material/M = D
if (M.use(1))
var/obj/item/secbot_assembly/edCLN_assembly/B = new /obj/item/secbot_assembly/edCLN_assembly
B.loc = get_turf(src)
to_chat(user, "<span class='notice'>You armed the robot frame.</span>")
to_chat(user, SPAN_NOTICE("You armed the robot frame."))
if (user.get_inactive_hand()==src)
user.remove_from_mob(src)
user.put_in_inactive_hand(B)
qdel(src)
else
to_chat(user, "<span class='warning'>You need one sheet of metal to arm the robot frame.</span>")
else if(istype(D, /obj/item/mop))
to_chat(user, SPAN_WARNING("You need one sheet of metal to arm the robot frame."))
return TRUE
// Wet mop with reagents in bucket.
if(istype(D, /obj/item/mop))
if(reagents.total_volume < 1)
to_chat(user, "<span class='warning'>\The [src] is empty!</span>")
to_chat(user, SPAN_WARNING("\The [src] is empty!"))
else
reagents.trans_to_obj(D, 5)
to_chat(user, "<span class='notice'>You wet \the [D] in \the [src].</span>")
to_chat(user, SPAN_NOTICE("You wet \the [D] in \the [src]."))
playsound(src, 'sound/effects/slosh.ogg', 25, 1)
else
return ..()
return TRUE
// Put a fruit or snack into the bucket for mashing.
if(!holding)
var/is_mashable = FALSE
for(var/mashable_type in accept_items_for_mashing)
if(istype(D, mashable_type))
is_mashable = TRUE
break
if(!is_mashable)
return ..()
if(reagents.total_volume >= reagents.maximum_volume)
to_chat(user, SPAN_WARNING("\The [src] is almost overflowing; pour some liquid out first."))
return TRUE
if(user.unEquip(D, target = src))
holding = D
visible_message(SPAN_NOTICE("\The [user] drops \the [D] into \the [src]."))
return TRUE
// Mash the fruit in the bucket. This `else` is not accidental!
else if(!(D.item_flags & NOBLUDGEON))
visible_message("\The [user] begins mashing \the [holding] with \the [D]...")
if(do_after(user, 3 SECONDS, src) && !QDELETED(src) && reagents.total_volume < reagents.maximum_volume)
visible_message("\The [user] finishes mashing \the [holding] with \the [D].")
if(holding.reagents)
holding.reagents.trans_to_obj(src, holding.reagents.total_volume)
QDEL_NULL(holding)
return TRUE
return ..()
/obj/item/reagent_containers/glass/bucket/Destroy()
QDEL_NULL(holding)
return ..()
/obj/item/reagent_containers/glass/bucket/examine(mob/user)
. = ..()
if(loc == user && holding)
. += "There is \a [holding] in \the [src]."
/obj/item/reagent_containers/glass/bucket/attack_self(mob/user)
if(holding)
holding.dropInto(get_turf(user))
visible_message(SPAN_NOTICE("\The [user] tips \the [holding] out of \the [src]."))
holding = null
return TRUE
. = ..()
/obj/item/reagent_containers/glass/bucket/update_icon()
cut_overlays()
@@ -340,22 +401,7 @@
if(isprox(D))
to_chat(user, "This wooden bucket doesn't play well with electronics.")
return
else if(istype(D, /obj/item/material/knife/machete/hatchet))
to_chat(user, "<span class='notice'>You cut a big hole in \the [src] with \the [D]. It's kinda useless as a bucket now.</span>")
user.put_in_hands(new /obj/item/clothing/head/helmet/bucket/wood)
user.drop_from_inventory(src)
qdel(src)
return
else if(istype(D, /obj/item/mop))
if(reagents.total_volume < 1)
to_chat(user, "<span class='warning'>\The [src] is empty!</span>")
else
reagents.trans_to_obj(D, 5)
to_chat(user, "<span class='notice'>You wet \the [D] in \the [src].</span>")
playsound(src, 'sound/effects/slosh.ogg', 25, 1)
return
else
return ..()
return ..()
/obj/item/reagent_containers/glass/cooler_bottle
desc = "A bottle for a water-cooler."