-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package Delivery Expansion #20003
base: master
Are you sure you want to change the base?
Package Delivery Expansion #20003
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/proc/get_cargo_package_delivery_point(var/atom/atom, var/horizon_only = FALSE) | ||
var/obj/effect/overmap/visitable/ship/horizon | ||
if(SSatlas.current_map.overmap_visitable_type) | ||
horizon = SSshuttle.ship_by_type(SSatlas.current_map.overmap_visitable_type) | ||
|
||
var/turf/current_turf = get_turf(atom) | ||
|
||
var/list/eligible_delivery_points = list() | ||
for(var/obj/structure/cargo_receptacle/delivery_point in all_cargo_receptacles) | ||
var/obj/effect/overmap/visitable/my_sector = GLOB.map_sectors["[current_turf.z]"] | ||
var/obj/effect/overmap/visitable/delivery_point_sector = GLOB.map_sectors["[delivery_point.z]"] | ||
// no delivering to ourselves | ||
if(my_sector == delivery_point_sector) | ||
continue | ||
// guaranteed horizon, has to go to horizon | ||
if(horizon_only && horizon && delivery_point_sector != horizon) | ||
continue | ||
eligible_delivery_points += delivery_point | ||
|
||
if(!length(eligible_delivery_points)) | ||
return | ||
|
||
return pick(eligible_delivery_points) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,9 @@ | |
icon_state = "express_package" | ||
item_state = "express_package" | ||
contained_sprite = TRUE | ||
update_icon_on_init = TRUE | ||
has_accents = TRUE | ||
|
||
w_class = WEIGHT_CLASS_HUGE | ||
force = 15 | ||
|
||
|
@@ -41,7 +44,7 @@ | |
pay_amount = rand(12, 17) * 1000 | ||
if(delivery_point) | ||
setup_delivery_point(delivery_point) | ||
color = pick("#FFFFFF", "#EEEEEE", "#DDDDDD", "#CCCCCC", "#BBBBBB", "#FFDDDD", "#DDDDFF", "#FFFFDD", "#886600") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should stay |
||
accent_color = pick(COLOR_RED, COLOR_AMBER, COLOR_PINK, COLOR_YELLOW, COLOR_LIME) | ||
|
||
/obj/item/cargo_package/proc/setup_delivery_point(var/obj/structure/cargo_receptacle/delivery_point) | ||
associated_delivery_point = WEAKREF(delivery_point) | ||
|
@@ -131,27 +134,10 @@ | |
addtimer(CALLBACK(src, PROC_REF(get_delivery_point)), 3 MINUTES) | ||
|
||
/obj/item/cargo_package/offship/proc/get_delivery_point() | ||
var/obj/effect/overmap/visitable/ship/horizon = SSshuttle.ship_by_type(/obj/effect/overmap/visitable/ship/sccv_horizon) | ||
|
||
var/turf/current_turf = get_turf(src) | ||
|
||
var/list/eligible_delivery_points = list() | ||
for(var/obj/structure/cargo_receptacle/delivery_point in all_cargo_receptacles) | ||
var/obj/effect/overmap/visitable/my_sector = GLOB.map_sectors["[current_turf.z]"] | ||
var/obj/effect/overmap/visitable/delivery_point_sector = GLOB.map_sectors["[delivery_point.z]"] | ||
// no delivering to ourselves | ||
if(my_sector == delivery_point_sector) | ||
continue | ||
// guaranteed horizon, has to go to horizon | ||
if(horizon_delivery && delivery_point_sector.name != horizon.name) | ||
continue | ||
eligible_delivery_points += delivery_point | ||
|
||
if(!length(eligible_delivery_points)) | ||
var/obj/structure/cargo_receptacle/selected_delivery_point = get_cargo_package_delivery_point(src, horizon_delivery) | ||
if(!selected_delivery_point) | ||
qdel(src) | ||
return | ||
|
||
var/obj/structure/cargo_receptacle/selected_delivery_point = pick(eligible_delivery_points) | ||
setup_delivery_point(selected_delivery_point) | ||
|
||
/obj/item/cargo_package/offship/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -82,11 +82,23 @@ var/global/list/all_cargo_receptacles = list() | |||||
visible_message(SPAN_WARNING("\The [src] buzzes harshly, \"Invalid package! Check the delivery ID!\"")) | ||||||
return | ||||||
|
||||||
var/pays_horizon_account = package.pays_horizon_account | ||||||
|
||||||
user.visible_message("<b>[user]</b> starts heaving \the [attacking_item] into \the [src]...", SPAN_NOTICE("You start heaving \the [attacking_item] into \the [src]...")) | ||||||
if(do_after(user, 1 SECONDS, src, DO_UNIQUE)) | ||||||
user.drop_from_inventory(attacking_item, src) | ||||||
pay_account(user, attacking_item) | ||||||
qdel(attacking_item) | ||||||
|
||||||
var/obj/structure/cargo_receptacle/selected_delivery_point = get_cargo_package_delivery_point(src) | ||||||
if(selected_delivery_point) | ||||||
visible_message("\The [src] beeps, \"[SPAN_NOTICE("New package available for delivery.")]\"") | ||||||
playsound(loc, /singleton/sound_category/print_sound, 50, TRUE) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There shouldn't be a need to use |
||||||
|
||||||
var/obj/item/cargo_package/printed_package = new /obj/item/cargo_package/offship(get_turf(user), selected_delivery_point) | ||||||
printed_package.pays_horizon_account = pays_horizon_account | ||||||
animate(printed_package, alpha = 0, alpha = 255, time = 1 SECOND) // Makes them fade in | ||||||
|
||||||
return | ||||||
return ..() | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
author: Geeves | ||
|
||
delete-after: True | ||
|
||
changes: | ||
- rscadd: "Cargo delivery packages now have colored tags on them which should hopefully make it easier to distinguish between them, instead of changing the entire package's color." | ||
- rscadd: "Delivering a package now outputs another, allowing you to continuously deliver throughout the round, should you choose to." | ||
- bugfix: "Fixed cargo packages runtiming on the runtime map." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this is clearer