Files
Paradise/code/modules/paperwork/handlabeler.dm
Charlie Nolan 5c5f7842df Secondary goals (#24599)
* Extract requests console message sending code.

* Add secondary goals

* Converted supply shuttle to a signal-based system.

* Lint.

* Review suggestions.

* Secondary goals can now check the supply shuttle for their requirements.

* Remove redundant completion variable, undef what we define.

* Made the request console refuse to issue a secondary goal until you finish the current one.

* Made the shuttle blacklist error more specific, added locked/manifest-attached crates to blacklist.

* Added round end secondary goal report.

* Lint

* Add tags to reagents for secondary goals to use.

* Extracted the reagent logic from the bar goal, used reagent tags.

* Added the Variety of Drinks Bar goal.

* Added variety drinks goal for the Bar.

* CC no longer complains about sending stuff in containers, but the shuttle will refuse lockboxes without goal items.

* Allow unlocked lockboxes on the shuttle.

* Added kitchen goals.

* Lint

* More lint

* Add goals for scichem and medchem, pending reagent labelling.

* Added Kudzu goal for botany.

* I forgot to rename them, oops.

* Lint

* Made mechs sellable, configurable goal rewards.

* Balancing changes.

* Added random Ripley goal.

* Add Clear Task Backlog station goal.

* Lint

* Oops.

* did i even do this right

* Lint

* Excluded drinks available from upgraded booze dispenser.

* Such bugs. Much fix. Wow.

* Goal notice formatting.

* Apply suggestions from code review

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Made storage nesting better, improved consistency between storage types.

* Out, er, space.

* Added a proc for sending a requests console message.

* Added error messages to Virology Goals.

Backported a few small things from Secondary Goals to make this easier.

* Extracted out the three-way reward code into a proc.

* Update code/__DEFINES/dcs/signals.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Removed redundant SIGNAL_HANDLER labels.

* Yes, that should be a proc.

* Enforce important parent calls.

* Thank you, DreamChecker

* Undid accidental merge of #24699

* Removed a testing proc that wasn't intended for this PR.

* Removed parts of #24750 that also crept in.

* Made the variety of [x] goals more explicit that they want 50u of each.

* Reduced Kudzu trait requirement to 1.

* Request consoles now output the list of valid departments if you're at an unsupported one.

* Added personal crates.

* Added a supply pack of personal crates.

* Added special cargo handling for personal crates.

* Added automatic personal crate when requesting a goal.

* Required personal crates for most secondary goals.

* Add goal labels to the hand labeler, require them for mech goals.

* Made secondary goals one-per-person, not one-per-department.

* Added support for multi-line system messages to the request consoles.

* Made the RC message for goals nicer.

* Send goal crates even if no normal crates are ready, name and access-lock them properly.

* Don't double-label.

* Let's not use registered_account, names are fine.

* Add a ton of blackbox data to cargo and secondary goals.

* Fix a few bugs.

* More bugfixing, couple more stats.

* Even more stats.

* Text fix.

* Made cargo fines more consistent with other cargo feedback.

* Fixed a bug that prevented non-top-level items from being checked for CARGO_REQUIRE_PRIORITY.

* Blocked large crates from being sent back unopened.

* Enum values should probably be different from each other.

* Correct a bitflag mishap.

* Removed redundant supply shuttle docking and buy/sell attempts.

* Tweak message about personal crates to inlclude that they need to lock it.

* Add /Crates to the Personal Lockers description.

* Less pretty alignment, less complaining linters.

* Corrected a bad name in stats tracking.

* Reduced SciChem variety goal to 5 types.

* Toned down Task Backlog a bit.

* Fixed a bug that made unsellable items nested in containers be stolen by CC (qdeleted).

* Don't require bluespace 8, that's silly.

* Made secondary goals modifiable in the Modify Station Goals UI.

* Whoops, that was supposed to be 600u.

* i ded pls nerf

---------

Co-authored-by: synthtee <127706731+SynthTwo@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
2024-04-01 07:50:07 +00:00

96 lines
3.4 KiB
Plaintext

#define LABEL_MODE_OFF 0
#define LABEL_MODE_NORMAL 1
#define LABEL_MODE_GOAL 2
/obj/item/hand_labeler
name = "hand labeler"
desc = "A combined label printer, applicator, and remover, all in a single portable device. Designed to be easy to operate and use."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "labeler0"
item_state = "flight"
var/label = null
var/labels_left = 30
var/mode = LABEL_MODE_OFF
/obj/item/hand_labeler/afterattack(atom/A, mob/user, proximity)
if(!proximity)
return
if(mode == LABEL_MODE_OFF) //if it's off, give up.
return
if(!labels_left)
to_chat(user, "<span class='warning'>No labels left!</span>")
return
if(!label || !length(label))
to_chat(user, "<span class='warning'>No text set!</span>")
return
if(ismob(A))
to_chat(user, "<span class='warning'>You can't label creatures!</span>") // use a collar
return
if(mode == LABEL_MODE_GOAL)
if(istype(A, /obj/item))
to_chat(user, "<span class='warning'>Put it in a personal crate instead!</span>")
return
user.visible_message("<span class='notice'>[user] labels [A] as part of a secondary goal for [label].</span>", \
"<span class='notice'>You label [A] as part of a secondary goal for [label].</span>")
A.AddComponent(/datum/component/label/goal, label)
return
if(length(A.name) + length(label) > 64)
to_chat(user, "<span class='warning'>Label too big!</span>")
return
user.visible_message("<span class='notice'>[user] labels [A] as [label].</span>", \
"<span class='notice'>You label [A] as [label].</span>")
investigate_log("[key_name(user)] ([ADMIN_FLW(user,"FLW")]) labelled \"[A]\" ([ADMIN_VV(A, "VV")]) with \"[label]\" at [COORD(A.loc)] [ADMIN_JMP(A)].", INVESTIGATE_RENAME) // Investigate goes BEFORE rename so the original name is preserved in the log
A.AddComponent(/datum/component/label, label)
playsound(A, 'sound/items/handling/component_pickup.ogg', 20, TRUE)
labels_left--
/obj/item/hand_labeler/attack_self(mob/user as mob)
// off -> normal
// normal or goal -> off
mode = !mode
icon_state = "labeler[mode]"
if(mode)
to_chat(user, "<span class='notice'>You turn on \the [src].</span>")
//Now let them chose the text.
var/str = reject_bad_text(tgui_input_text(user,"Label text?", "Set label"))
if(!str || !length(str))
to_chat(user, "<span class='notice'>Invalid text.</span>")
return
label = str
to_chat(user, "<span class='notice'>You set the text to '[str]'.</span>")
else
to_chat(user, "<span class='notice'>You turn off \the [src].</span>")
/obj/item/hand_labeler/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/hand_labeler_refill))
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
user.drop_item()
qdel(I)
labels_left = initial(labels_left) //Yes, it's capped at its initial value
else if(istype(I, /obj/item/card/id))
var/obj/item/card/id/id = I
if(istype(id, /obj/item/card/id/guest) || !id.registered_name)
to_chat(user, "<span class='warning'>Invalid ID card.</span>")
return
label = id.registered_name
mode = LABEL_MODE_GOAL
to_chat(user, "<span class='notice'>You configure the hand labeler with [I].</span>")
icon_state = "labeler1"
/obj/item/hand_labeler_refill
name = "hand labeler paper roll"
icon = 'icons/obj/bureaucracy.dmi'
desc = "A roll of paper. Use it on a hand labeler to refill it."
icon_state = "labeler_refill"
item_state = "electropack"
w_class = WEIGHT_CLASS_TINY
#undef LABEL_MODE_OFF
#undef LABEL_MODE_NORMAL
#undef LABEL_MODE_GOAL