mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 23:14:18 +01:00
Package Delivery Expansion (#20003)
* 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. * Delivering a package now outputs another, allowing you to continuously deliver throughout the round, should you choose to. * Fixed cargo packages runtiming on the runtime map.
This commit is contained in:
@@ -1790,6 +1790,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"
|
||||
|
||||
@@ -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)
|
||||
@@ -71,6 +71,19 @@
|
||||
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
|
||||
|
||||
for(var/package_index = 1 to length(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)
|
||||
package_index++
|
||||
|
||||
return mob_overlay
|
||||
|
||||
/obj/item/cargo_backpack/attack_hand(mob/living/carbon/human/user)
|
||||
|
||||
@@ -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")
|
||||
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)
|
||||
|
||||
@@ -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(src, /singleton/sound_category/print_sound, 50, TRUE)
|
||||
|
||||
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 ..()
|
||||
|
||||
|
||||
@@ -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 not shown.
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.5 KiB |
@@ -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
|
||||
|
||||
@@ -42,6 +42,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(
|
||||
|
||||
@@ -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(
|
||||
@@ -161,7 +163,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 />"
|
||||
|
||||
Reference in New Issue
Block a user