Skip to content

Commit

Permalink
Adds hana paperwork forms into the photocopier for City Fishers (#2653)
Browse files Browse the repository at this point in the history
* Improve the bureaucracy system (#61323)

Adds a blank printing system.

Virtually every Space Station 13 server has its own system of bureaucracy. As a rule, it is some kind of Wiki page with markup tags and a few sample forms. And that's usually the end of it. With stamps and a filing system in place, people rarely use them. This PR takes it upon itself to remedy this situation by introducing form standards into the game itself and adding the ability to print them.

Co-authored-by: twilightwanderer <[email protected]>
Co-authored-by: tralezab <[email protected]>
Co-authored-by: Aleksej Komarov <[email protected]>

* Fix hints (#63287)

* adds fixer forms

* Fixes linters

* severe pain of mis-spelling

* adds toner cartridges to city maps

---------

Co-authored-by: twilightwanderer <[email protected]>
Co-authored-by: twilightwanderer <[email protected]>
Co-authored-by: tralezab <[email protected]>
Co-authored-by: Aleksej Komarov <[email protected]>
  • Loading branch information
5 people authored Jan 14, 2025
1 parent 60a0857 commit df67d99
Show file tree
Hide file tree
Showing 6 changed files with 1,129 additions and 8 deletions.
31 changes: 26 additions & 5 deletions _maps/map_files/Event/city.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@
"fM" = (
/obj/machinery/light,
/obj/structure/table/wood,
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/turf/open/floor/facility/white,
/area/city/fixers)
"fP" = (
Expand Down Expand Up @@ -1019,12 +1024,28 @@
/turf/open/floor/plating/beach/sand,
/area/city)
"mV" = (
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/obj/item/folder,
/obj/structure/table/wood,
/obj/item/toner/large{
pixel_x = 2;
pixel_y = -8
},
/obj/item/toner/large{
pixel_y = -4;
pixel_x = 1
},
/obj/item/toner/large,
/obj/item/toner/large{
pixel_y = 4;
pixel_x = -1
},
/obj/item/toner/large{
pixel_y = 8;
pixel_x = -2
},
/obj/item/toner/large{
pixel_y = 12;
pixel_x = -3
},
/turf/open/floor/facility/white,
/area/city/fixers)
"mW" = (
Expand Down
11 changes: 11 additions & 0 deletions _maps/map_files/Event/city_fixer.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,17 @@
"jP" = (
/obj/structure/table/wood,
/obj/item/modular_computer/laptop/preset/civilian,
/obj/item/toner/large{
pixel_y = 4;
pixel_x = 4
},
/obj/item/toner/large{
pixel_y = 8
},
/obj/item/toner/large{
pixel_y = 12;
pixel_x = -4
},
/turf/open/floor/facility/white,
/area/city/fixers)
"ka" = (
Expand Down
41 changes: 41 additions & 0 deletions code/modules/paperwork/photocopier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
var/color_mode = PHOTO_COLOR
/// Indicates whether the printer is currently busy copying or not.
var/busy = FALSE
/// Variable needed to determine the selected category of forms on Photocopier.js
var/category

/obj/machinery/photocopier/Initialize()
. = ..()
Expand All @@ -60,6 +62,18 @@
data["has_item"] = !copier_empty()
data["num_copies"] = num_copies

try
// var/list/blanks = json_decode(file2text("config/blanks.json")) LOBOTOMYCORPORATION EDIT OLD
var/list/blanks = (SSmaptype.maptype in SSmaptype.citymaps) ? json_decode(file2text("config/blanks_city.json")) : json_decode(file2text("config/blanks.json")) // LOBOTOMYCORPORATION EDIT NEW
if (blanks != null)
data["blanks"] = blanks
data["category"] = category
data["forms_exist"] = TRUE
else
data["forms_exist"] = FALSE
catch()
data["forms_exist"] = FALSE

if(photo_copy)
data["is_photo"] = TRUE
data["color_mode"] = color_mode
Expand Down Expand Up @@ -156,6 +170,27 @@
if("set_copies")
num_copies = clamp(text2num(params["num_copies"]), 1, MAX_COPIES_AT_ONCE)
return TRUE
// Changes the forms displayed on Photocopier.js when you switch categories
if("choose_category")
category = params["category"]
return TRUE
// Called when you press print blank
if("print_blank")
if(busy)
to_chat(usr, span_warning("[src] is currently busy copying something. Please wait until it is finished."))
return FALSE
if (toner_cartridge.charges - PAPER_TONER_USE < 0)
to_chat(usr, span_warning("There is not enough toner in [src] to print the form, please replace the cartridge."))
return FALSE
do_copy_loop(CALLBACK(src, PROC_REF(make_blank_print)), usr)
var/obj/item/paper/printblank = new /obj/item/paper (loc)
var/printname = params["name"]
var/list/printinfo
for(var/infoline as anything in params["info"])
printinfo += infoline
printblank.name = printname
printblank.info = printinfo
return printblank

/**
* Determines if the photocopier has enough toner to create `num_copies` amount of copies of the currently inserted item.
Expand Down Expand Up @@ -267,6 +302,12 @@
give_pixel_offset(copied_doc)
toner_cartridge.charges -= DOCUMENT_TONER_USE

/**
* The procedure is called when printing a blank to write off toner consumption.
*/
/obj/machinery/photocopier/proc/make_blank_print()
toner_cartridge.charges -= PAPER_TONER_USE

/**
* Handles the copying of an ass photo.
*
Expand Down
Loading

0 comments on commit df67d99

Please sign in to comment.