All Secondary Goals use labels (#29776)

* All Secondary Goals use labels

* Fixes.

* Fixes.

* Update code/__DEFINES/dcs/basetype_signals.dm

Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>

---------

Signed-off-by: Charlie Nolan <funnyman3595@gmail.com>
Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
This commit is contained in:
Charlie Nolan
2025-07-31 06:01:26 +00:00
committed by GitHub
co-authored by PollardTheDragon
parent 97d72d6e22
commit 435637e257
17 changed files with 107 additions and 58 deletions
@@ -51,8 +51,8 @@
/datum/secondary_goal_progress/random_kudzu/update(atom/movable/AM, datum/economy/cargo_shuttle_manifest/manifest = null)
// Not in a matching personal crate? Ignore.
if(!check_personal_crate(AM))
// Not properly labeled for this goal? Ignore.
if(!check_goal_label(AM))
return
if(!istype(AM, /obj/item/seeds/kudzu))
@@ -65,8 +65,8 @@
sent_this_shipment = 0
/datum/secondary_goal_progress/random_bulk_food/update(atom/movable/AM, datum/economy/cargo_shuttle_manifest/manifest = null)
// Not in a matching personal crate? Ignore.
if(!check_personal_crate(AM))
// Not properly labeled for this goal? Ignore.
if(!check_goal_label(AM))
return
if(!istype(AM, food_type))
@@ -53,8 +53,8 @@
return copy
/datum/secondary_goal_progress/variety_food/update(obj/item/food/food, datum/economy/cargo_shuttle_manifest/manifest = null)
// Not in a matching personal crate? Ignore.
if(!check_personal_crate(food))
// Not properly labeled for this goal? Ignore.
if(!check_goal_label(food))
return
// Not food? Ignore.
@@ -71,8 +71,8 @@
return copy
/datum/secondary_goal_progress/random_bulk_reagent/update(atom/movable/AM, datum/economy/cargo_shuttle_manifest/manifest = null)
// Not in a matching personal crate? Ignore.
if(!check_personal_crate(AM))
// Not properly labeled for this goal? Ignore.
if(!check_goal_label(AM))
return
var/amount = AM.reagents?.get_reagent_amount(initial(reagent_type.id))
@@ -57,7 +57,7 @@
/datum/secondary_goal_progress/random_ripley/update(atom/movable/AM, datum/economy/cargo_shuttle_manifest/manifest = null)
// Not labelled for this goal? Ignore.
if(!check_personal_crate(AM))
if(!check_goal_label(AM))
return
if(!istype(AM, /obj/mecha/working/ripley))
return
@@ -45,13 +45,15 @@
message_parts += "Suitable task found. Task details:"
message_parts += ""
message_parts += report_message
message_parts += ""
message_parts += "All requested materials must be properly labeled for transport, or be inside a properly-labeled container. You can configure a hand labeler to create suitable labels by by swiping your ID card on it."
if(should_send_crate)
message_parts += "You must submit this in a locked personal crate. One will be sent to your Cargo department. More can be ordered if needed."
send_requests_console_message(message_parts, "Central Command", department, "Stamped with the Central Command rubber stamp.", "Verified by A.L.I.C.E (CentCom AI)", RQ_HIGHPRIORITY)
message_parts += "For your convenience, a pre-labeled personal crate will be sent to your cargo department."
send_requests_console_message(message_parts, "Procurement Office", department, "Stamped with the Central Command rubber stamp.", "Verified by A.L.I.C.E (CentCom AI)", RQ_HIGHPRIORITY)
if(department != "Captain's Desk")
send_requests_console_message(message_parts, "Central Command", "Captain's Desk", "Stamped with the Central Command rubber stamp.", "Verified by A.L.I.C.E (CentCom AI)", RQ_NORMALPRIORITY)
send_requests_console_message(message_parts, "Procurement Office", "Captain's Desk", "Stamped with the Central Command rubber stamp.", "Verified by A.L.I.C.E (CentCom AI)", RQ_NORMALPRIORITY)
if(department != "Bridge")
send_requests_console_message(message_parts, "Central Command", "Bridge", "Stamped with the Central Command rubber stamp.", "Verified by A.L.I.C.E (CentCom AI)", RQ_NORMALPRIORITY)
send_requests_console_message(message_parts, "Procurement Office", "Bridge", "Stamped with the Central Command rubber stamp.", "Verified by A.L.I.C.E (CentCom AI)", RQ_NORMALPRIORITY)
/proc/init_secondary_goal_grab_bags()
SSticker.mode.secondary_goal_grab_bags = list()
@@ -97,17 +97,23 @@
/datum/secondary_goal_progress/proc/check_complete(datum/economy/cargo_shuttle_manifest/manifest)
return FALSE
/datum/secondary_goal_progress/proc/check_personal_crate(atom/movable/AM)
// Accept stuff that is properly labelled with a hand labeller.
var/datum/component/label/goal/label = AM.GetComponent(/datum/component/label/goal)
if(istype(label))
return !goal_requester || label.label_name == goal_requester
/datum/secondary_goal_progress/proc/check_goal_label(atom/movable/AM)
// Look for a secondary goal label on this atom or anything it's inside.
var/atom/current_layer = AM
while(current_layer && isobj(current_layer))
// If it has a goal label, check the label's owner.
var/datum/component/label/goal/label = current_layer.GetComponent(/datum/component/label/goal)
if(istype(label))
return !goal_requester || label.person == goal_requester
// Accept stuff in matching personal crates.
var/obj/structure/closet/crate/secure/personal/PC = get_atom_on_turf(AM, /obj/structure/closet/crate/secure/personal)
if(!istype(PC))
return FALSE
return !goal_requester || PC.registered_name == goal_requester
// Otherwise, move to whatever's holding us, and check again.
var/datum/component/shelved/shelving = current_layer.GetComponent(/datum/component/shelved)
var/obj/shelf = locateUID(shelving?.shelf_uid)
if(istype(shelf))
current_layer = shelf
else
current_layer = current_layer.loc
return FALSE
/datum/secondary_goal_progress/proc/three_way_reward(datum/economy/cargo_shuttle_manifest/manifest, department, department_account, reward, message)
SSblackbox.record_feedback("nested tally", "secondary goals", 1, list(goal_name, "payments made"))
@@ -113,8 +113,8 @@
return TRUE
/datum/secondary_goal_progress/random_smithed_item/update(atom/movable/AM, datum/economy/cargo_shuttle_manifest/manifest = null)
// Not in a matching personal crate? Ignore.
if(!check_personal_crate(AM))
// Not properly labeled for this goal? Ignore.
if(!check_goal_label(AM))
return
if(!istype(AM, /obj/item/smithed_item))
@@ -45,8 +45,8 @@
return copy
/datum/secondary_goal_progress/variety_reagent/update(atom/movable/AM, datum/economy/cargo_shuttle_manifest/manifest = null)
// Not in a matching personal crate? Ignore.
if(!check_personal_crate(AM))
// Not properly labeled for this goal? Ignore.
if(!check_goal_label(AM))
return
// No reagents? Ignore.