/tg/ Station 13 - Modules - TypesVar Details - Proc Details

photocopier

Vars

assA reference to a mob on top of the photocopier trying to copy their ass. Null if there is no mob.
busyIndicates whether the printer is currently busy copying or not.
categoryVariable needed to determine the selected category of forms on Photocopier.js
color_modeUsed with photos. Determines if the copied photo will be in greyscale or color.
copies_leftVariable for the UI telling us how many copies are in the queue.
num_copiesHow many copies will be printed with one click of the "copy" button.
object_copyVariable that holds a reference to any object supported for photocopying inside the photocopier
paper_stackA stack for all the empty paper we have newly inserted (LIFO)
starting_paperThe amount of paper this photocoper starts with.
toner_cartridgeA reference to the toner cartridge that's inserted into the copier. Null if there is no cartridge.

Procs

check_assChecks the living mob ass exists and its location is the same as the photocopier.
check_busyDetermines if the printer is currently busy, informs the user if it is.
copier_blockedChecks if the copier is deleted, or has something dense at its location. Called in MouseDrop_T()
copier_emptyChecks if there is an item inserted into the copier or a mob sitting on top of it.
delete_paperRemoves an amount of paper from the printer's storage. This lets us pretend we actually consumed paper when we were actually printing something that wasn't paper.
do_copiesWill invoke do_copy_loop asynchronously. Passes the supplied arguments on to it.
do_copy_loopWill invoke the passed in copy_cb callback in 4 second intervals, and charge the user 5 credits for each copy made.
get_empty_paperReturns an empty paper, used for blanks and paper copies. Prioritizes paper_stack, creates new paper in case paper_stack is empty.
get_paper_countGets the total amount of paper this printer has stored.
get_toner_colorReturns the color used for the printing operation. If the color is below TONER_LOW_PERCENTAGE, it returns a gray color.
give_pixel_offsetGives items a random x and y pixel offset, between -10 and 10 for each.
insert_empty_paperProc that handles insertion of empty paper, useful for copying later.
make_ass_copyHandles the copying of an ass photo.
make_blank_printHandles the copying of blanks. No mutating state, so this should not fail.
make_document_copyHandles the copying of documents.
make_paper_copyHandles the copying of paper. Transfers all the text, stamps and so on from the old paper, to the copy.
make_paperwork_copyHandles the copying of documents.
make_photo_copyHandles the copying of photos, which can be printed in either color or greyscale.
remove_photocopyCalled when someone hits the "remove item" button on the copier UI.
reset_busySets busy to FALSE.
setup_componentsSimply adds the necessary components for this to function.

Var Details

ass

A reference to a mob on top of the photocopier trying to copy their ass. Null if there is no mob.

busy

Indicates whether the printer is currently busy copying or not.

category

Variable needed to determine the selected category of forms on Photocopier.js

color_mode

Used with photos. Determines if the copied photo will be in greyscale or color.

copies_left

Variable for the UI telling us how many copies are in the queue.

num_copies

How many copies will be printed with one click of the "copy" button.

object_copy

Variable that holds a reference to any object supported for photocopying inside the photocopier

paper_stack

A stack for all the empty paper we have newly inserted (LIFO)

starting_paper

The amount of paper this photocoper starts with.

toner_cartridge

A reference to the toner cartridge that's inserted into the copier. Null if there is no cartridge.

Proc Details

check_ass

Checks the living mob ass exists and its location is the same as the photocopier.

Returns FALSE if ass doesn't exist or is not at the copier's location. Returns TRUE otherwise.

check_busy

Determines if the printer is currently busy, informs the user if it is.

copier_blocked

Checks if the copier is deleted, or has something dense at its location. Called in MouseDrop_T()

copier_empty

Checks if there is an item inserted into the copier or a mob sitting on top of it.

Return FALSE is the copier has something inside of it. Returns TRUE if it doesn't.

delete_paper

Removes an amount of paper from the printer's storage. This lets us pretend we actually consumed paper when we were actually printing something that wasn't paper.

do_copies

Will invoke do_copy_loop asynchronously. Passes the supplied arguments on to it.

do_copy_loop

Will invoke the passed in copy_cb callback in 4 second intervals, and charge the user 5 credits for each copy made.

Arguments:

get_empty_paper

Returns an empty paper, used for blanks and paper copies. Prioritizes paper_stack, creates new paper in case paper_stack is empty.

get_paper_count

Gets the total amount of paper this printer has stored.

get_toner_color

Returns the color used for the printing operation. If the color is below TONER_LOW_PERCENTAGE, it returns a gray color.

give_pixel_offset

Gives items a random x and y pixel offset, between -10 and 10 for each.

This is done that when someone prints multiple papers, we dont have them all appear to be stacked in the same exact location.

Arguments:

insert_empty_paper

Proc that handles insertion of empty paper, useful for copying later.

make_ass_copy

Handles the copying of an ass photo.

Calls check_ass() first to make sure that ass exists, among other conditions. Since this proc is called from a timer, it's possible that it was removed. Additionally checks that the mob has their clothes off.

make_blank_print

Handles the copying of blanks. No mutating state, so this should not fail.

make_document_copy

Handles the copying of documents.

Checks first if document_copy exists. Since this proc is called from a timer, it's possible that it was removed.

make_paper_copy

Handles the copying of paper. Transfers all the text, stamps and so on from the old paper, to the copy.

Checks first if paper_copy exists. Since this proc is called from a timer, it's possible that it was removed.

make_paperwork_copy

Handles the copying of documents.

Checks first if paperwork_copy exists. Since this proc is called from a timer, it's possible that it was removed. Copies the stamp from a given piece of paperwork if it is already stamped, allowing for you to sell photocopied paperwork at the risk of losing budget money.

make_photo_copy

Handles the copying of photos, which can be printed in either color or greyscale.

Checks first if picture exists. Since this proc is called from a timer, it's possible that it was removed.

remove_photocopy

Called when someone hits the "remove item" button on the copier UI.

If the user is a silicon, it drops the object at the location of the copier. If the user is not a silicon, it tries to put the object in their hands first. Sets busy to FALSE because if the inserted item is removed, the copier should halt copying.

Arguments:

reset_busy

Sets busy to FALSE.

setup_components

Simply adds the necessary components for this to function.