mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 23:53:47 +01:00
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:
@@ -20,6 +20,9 @@
|
||||
. += "<span class='notice'>The label is currently set to \"[label]\".</span>"
|
||||
|
||||
/obj/item/hand_labeler/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
if(iseffect(target))
|
||||
to_chat(user, "<span class='warning'>\The [target] doesn't seem solid enough to label!</span>")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
if(!mode == LABEL_MODE_OFF)
|
||||
apply_label(target, user)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
@@ -44,8 +47,8 @@
|
||||
return
|
||||
|
||||
if(mode == LABEL_MODE_GOAL)
|
||||
if(istype(target, /obj/item))
|
||||
to_chat(user, "<span class='warning'>Put it in a personal crate instead!</span>")
|
||||
if(isturf(target))
|
||||
to_chat(user, "<span class='warning'>You can't just claim a bit of [target] as yours!</span>")
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] labels [target] as part of a secondary goal for [label].</span>", \
|
||||
"<span class='notice'>You label [target] as part of a secondary goal for [label].</span>")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Shuttle on-movement //
|
||||
/atom/movable/proc/onShuttleMove(turf/oldT, turf/T1, rotation, mob/calling_mob)
|
||||
SEND_SIGNAL(src, COMSIG_MOVABLE_ON_SHUTTLE_MOVE, T1)
|
||||
var/turf/newT = get_turf(src)
|
||||
if(newT.z != oldT.z)
|
||||
on_changed_z_level(oldT, newT)
|
||||
|
||||
@@ -139,12 +139,9 @@
|
||||
break
|
||||
|
||||
var/obj/structure/closet/crate/secure/personal/PC = new(T)
|
||||
if(SG.requester_name)
|
||||
PC.name = "goal crate ([SG.requester_name] in [SG.department])"
|
||||
PC.desc = "This personal crate has been configured by CC for [SG.requester_name]'s use in completing the secondary goal [SG.name]."
|
||||
PC.registered_name = SG.requester_name
|
||||
else
|
||||
PC.name = "goal crate (Unknown in [SG.department])"
|
||||
PC.name = "goal crate"
|
||||
PC.registered_name = SG.requester_name
|
||||
PC.AddComponent(/datum/component/label/goal, SG.requester_name, SG.department, TRUE)
|
||||
PC.locked = FALSE
|
||||
PC.update_icon()
|
||||
|
||||
@@ -336,7 +333,7 @@
|
||||
if(department_messages[department][message_piece] > 1)
|
||||
count = " (x[department_messages[department][message_piece]])"
|
||||
rc_message += "[message_piece][count]"
|
||||
send_requests_console_message(rc_message, "Central Command", department, "Stamped with the Central Command rubber stamp.", "Verified by the Central Command receiving department.", RQ_NORMALPRIORITY)
|
||||
send_requests_console_message(rc_message, "Procurement Office", department, "Stamped with the Central Command rubber stamp.", "Verified by the Central Command receiving department.", RQ_NORMALPRIORITY)
|
||||
|
||||
SSeconomy.centcom_message += "[msg]<hr>"
|
||||
manifest = new
|
||||
@@ -852,6 +849,12 @@
|
||||
SSblackbox.record_feedback("nested tally", "cargo salvage sold", count, list(salvage_name, "count"))
|
||||
SSblackbox.record_feedback("nested tally", "cargo salvage sold", item.credits, list(salvage_name, "credits"))
|
||||
|
||||
/datum/economy/simple_seller/shelved_items
|
||||
|
||||
/datum/economy/simple_seller/shelved_items/check_sell(obj/docking_port/mobile/supply/S, atom/movable/AM)
|
||||
if(AM.GetComponent(/datum/component/shelved))
|
||||
return COMSIG_CARGO_IS_SECURED
|
||||
|
||||
/datum/economy/cargo_shuttle_manifest
|
||||
var/list/items_to_sell = list()
|
||||
var/list/line_items = list()
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -24,6 +24,8 @@ GLOBAL_LIST_EMPTY(archived_virology_goals)
|
||||
SIGNAL_HANDLER // COMSIG_CARGO_CHECK_SELL
|
||||
if(istype(thing, /obj/item/reagent_containers))
|
||||
var/obj/item/reagent_containers/C = thing
|
||||
if(!thing.reagents?.has_reagent("blood"))
|
||||
return
|
||||
if(check_viruses(C.reagents.reagent_list))
|
||||
return COMSIG_CARGO_SELL_PRIORITY
|
||||
return COMSIG_CARGO_SELL_WRONG
|
||||
|
||||
Reference in New Issue
Block a user