Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aurorastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,7 @@
#include "code\modules\cargo\bounties\slime.dm"
#include "code\modules\cargo\bounties\special.dm"
#include "code\modules\cargo\bounties\weapon_prototype.dm"
#include "code\modules\cargo\delivery\_helpers.dm"
#include "code\modules\cargo\delivery\backpack.dm"
#include "code\modules\cargo\delivery\package.dm"
#include "code\modules\cargo\delivery\receptacle.dm"
Expand Down
23 changes: 23 additions & 0 deletions code/modules/cargo/delivery/_helpers.dm
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)
11 changes: 11 additions & 0 deletions code/modules/cargo/delivery/backpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@
north_overlay.layer = courier.layer + 0.01 // we want the tall backpack to render over hair and helmets
north_overlay.appearance_flags |= KEEP_APART
mob_overlay.AddOverlays(north_overlay)
return add_color_tag_to_overlay(mob_overlay)

/obj/item/cargo_backpack/proc/add_color_tag_to_overlay(var/image/mob_overlay)
if(!mob_overlay)
return
var/package_index = 1
for(var/obj/item/cargo_package/package in contained_packages)
var/image/package_tag = image(icon, icon_state = "package_pack_[package_index]_tag")
package_tag.color = package.accent_color
mob_overlay.AddOverlays(package_tag)
package_index++
Comment on lines +79 to +84
Copy link
Contributor

@FluffyGhoster FluffyGhoster Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var/package_index = 1
for(var/obj/item/cargo_package/package in contained_packages)
var/image/package_tag = image(icon, icon_state = "package_pack_[package_index]_tag")
package_tag.color = package.accent_color
mob_overlay.AddOverlays(package_tag)
package_index++
for(var/package_index in 1 to lenght(contained_packages))
var/obj/item/cargo_package/package = contained_packages[package_index]
var/image/package_tag = image(icon, icon_state = "package_pack_[package_index]_tag")
package_tag.color = package.accent_color
mob_overlay.AddOverlays(package_tag)

Something like this is clearer

return mob_overlay

/obj/item/cargo_backpack/attack_hand(mob/living/carbon/human/user)
Expand Down
26 changes: 6 additions & 20 deletions code/modules/cargo/delivery/package.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should stay
The colors here are like off-white shades of gray-ish
I think it makes sense that the courier packages aren't all perfectly shiny and white and clean
Cause they are used all over the spur and can come from anywhere

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)
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions code/modules/cargo/delivery/receptacle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
playsound(loc, /singleton/sound_category/print_sound, 50, TRUE)
playsound(src, /singleton/sound_category/print_sound, 50, TRUE)

There shouldn't be a need to use loc here, since it's a structure?


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 ..()

Expand Down
8 changes: 8 additions & 0 deletions html/changelogs/geeves-package_delivery_expansion.yml
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."
Binary file modified icons/obj/orion_delivery.dmi
Binary file not shown.
3 changes: 3 additions & 0 deletions maps/_common/mapsystem/map.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
var/bluespace_called_message
var/bluespace_recall_message

/// The typepath of the visitable our main map is, for example /obj/effect/overmap/visitable/ship/sccv_horizon
var/overmap_visitable_type

/// If this map has ports of call and refuels there. Crew are implied to be able to leave to these ports.
/// Ports of call are taken from the current map sector.
var/ports_of_call = FALSE
Expand Down
2 changes: 2 additions & 0 deletions maps/runtime/code/runtime.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
shuttle_called_message = "Attention all hands: Jump sequence initiated. Transit procedures are now in effect. Jump in %ETA%."
shuttle_recall_message = "Attention all hands: Jump sequence aborted, return to normal operating conditions."

overmap_visitable_type = /obj/effect/overmap/visitable/ship/runtime

evac_controller_type = /datum/evacuation_controller/starship

station_networks = list(
Expand Down
4 changes: 3 additions & 1 deletion maps/sccv_horizon/code/sccv_horizon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@
rogue_drone_end_message = "The hostile drone swarm has left the ship's proximity."
rogue_drone_destroyed_message = "Sensors indicate the unidentified drone swarm has left the immediate proximity of the ship."

overmap_visitable_type = /obj/effect/overmap/visitable/ship/sccv_horizon

ports_of_call = TRUE

map_shuttles = list(
Expand Down Expand Up @@ -158,7 +160,7 @@
shuttle_missions = list("Exploration", "Research", "Prospecting", "Transport", "Combat", "Rescue", "Training")

/datum/map/sccv_horizon/send_welcome()
var/obj/effect/overmap/visitable/ship/horizon = SSshuttle.ship_by_type(/obj/effect/overmap/visitable/ship/sccv_horizon)
var/obj/effect/overmap/visitable/ship/horizon = SSshuttle.ship_by_type(overmap_visitable_type)

var/welcome_text = "<center><img src = scclogo.png><br />[FONT_LARGE("<b>SCCV Horizon</b> Ultra-Range Sensor Readings:")]<br>"
welcome_text += "Report generated on [worlddate2text()] at [worldtime2text()]</center><br /><br />"
Expand Down
Loading