Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Barsign Wallmounts and Cargo Pack #852

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 64 additions & 10 deletions code/game/machinery/barsigns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION * 0.15
/// Selected barsign being used
var/datum/barsign/chosen_sign
/// Do we attempt to rename the area we occupy when the chosen sign is changed?
var/change_area_name = FALSE

/datum/armor/sign_barsign
melee = 20
Expand All @@ -23,14 +25,16 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32)

/obj/machinery/barsign/Initialize(mapload)
. = ..()
//Roundstart/map specific barsigns "belong" in their area and should be renaming it, signs created from wallmounts will not.
change_area_name = mapload
set_sign(new /datum/barsign/hiddensigns/signoff)
find_and_hang_on_wall()

/obj/machinery/barsign/proc/set_sign(datum/barsign/sign)
if(!istype(sign))
return

if(sign.rename_area)
if(change_area_name && sign.rename_area)
rename_area(src, sign.name)

chosen_sign = sign
Expand Down Expand Up @@ -86,8 +90,13 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32)
set_sign(new /datum/barsign/hiddensigns/signoff)

/obj/machinery/barsign/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/iron(drop_location(), 2)
new /obj/item/stack/cable_coil(drop_location(), 2)
if(!(flags_1 & NODECONSTRUCT_1))
if(disassembled)
new /obj/item/wallframe/barsign(loc)
else
new /obj/item/stack/sheet/iron(drop_location(), 2)
new /obj/item/stack/cable_coil(drop_location(), 2)

qdel(src)

/obj/machinery/barsign/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
Expand Down Expand Up @@ -129,9 +138,34 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32)

return TOOL_ACT_TOOLTYPE_SUCCESS

/obj/machinery/barsign/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/stack/cable_coil) && panel_open)
var/obj/item/stack/cable_coil/wire = I
/obj/machinery/barsign/wrench_act(mob/living/user, obj/item/tool)
. = ..()
if(!panel_open)
balloon_alert(user, "open the panel first!")
return FALSE

tool.play_tool_sound(src)
if(!do_after(user, (10 SECONDS), target = src))
return FALSE

tool.play_tool_sound(src)
deconstruct(disassembled = TRUE)
return TOOL_ACT_TOOLTYPE_SUCCESS


/obj/machinery/barsign/attackby(obj/item/attacking_item, mob/user)

if(istype(attacking_item, /obj/item/areaeditor/blueprints) && !change_area_name)
if(!panel_open)
balloon_alert(user, "open the panel first!")
return TRUE

change_area_name = TRUE
balloon_alert(user, "sign registered")
return TRUE

if(istype(attacking_item, /obj/item/stack/cable_coil) && panel_open)
var/obj/item/stack/cable_coil/wire = attacking_item

if(atom_integrity >= max_integrity)
balloon_alert(user, "doesn't need repairs!")
Expand All @@ -147,10 +181,6 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32)
update_appearance()
return TRUE

// if barsigns ever become a craftable or techweb wall mount then remove this
if(machine_stat & BROKEN)
return TRUE

return ..()

/obj/machinery/barsign/emp_act(severity)
Expand Down Expand Up @@ -459,3 +489,27 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32)
req_access = null

MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign/all_access, 32)

/obj/item/wallframe/barsign
name = "bar sign frame"
desc = "Used to help draw the rabble into your bar. Some assembly required."
icon = 'icons/obj/machines/wallmounts.dmi'
icon_state = "barsign"
result_path = /obj/machinery/barsign
custom_materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT,
)
pixel_shift = 32

/obj/item/wallframe/barsign/Initialize(mapload)
. = ..()
desc += " Can be registered with a set of [span_bold("station blueprints")] to associate the sign with the area it occupies."

/obj/item/wallframe/barsign/try_build(turf/on_wall, mob/user)
. = ..()
if(!.)
return .

if(isopenturf(get_step(on_wall, EAST))) //This takes up 2 tiles so we want to make sure we have two tiles to hang it from.
balloon_alert(user, "needs more support!")
return FALSE
8 changes: 8 additions & 0 deletions code/modules/cargo/packs/service.dm
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,11 @@
)
crate_name = "aquarium kit crate"
crate_type = /obj/structure/closet/crate/wooden

/// Spare bar sign wallmount
/datum/supply_pack/service/bar_sign
name = "Bar Sign Replacement Kit"
desc = "A replacement bar sign, perfect for drawing in customers to your bar, tavern, inn, nightclub, or even coffeehouse!"
cost = CARGO_CRATE_VALUE * 14
contains = list(/obj/item/wallframe/barsign)
crate_name = "bar sign replacement crate"
Binary file modified icons/obj/machines/wallmounts.dmi
Binary file not shown.
Loading