Skip to content

Commit bacfb1e

Browse files
authored
Merge branch 'development' into datacore
2 parents cbef86f + ce28eb8 commit bacfb1e

File tree

272 files changed

+14674
-7795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+14674
-7795
lines changed

.github/CODEOWNERS

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# If you are added, then you are expected to review PRs in a timely manner.
77

88
/code/world.dm @Arrow768
9-
/code/controllers/subsystems/supply.dm @Arrow768
9+
/code/controllers/subsystems/cargo.dm @Arrow768
1010
/code/datums/api.dm @Arrow768
1111
/code/datums/cargo.dm @Arrow768
1212
/code/datums/server_greeting.dm @Skull132
@@ -18,6 +18,7 @@
1818
/code/modules/item_worth/ @Arrow768
1919
/code/modules/modular_computers/ @Arrow768
2020
/code/modules/telesci/ @Arrow768
21+
/code/modules/cargo/ @Arrow768
2122
/code/modules/udp/ @Arrow768
2223
/code/modules/vueui/ @Karolis2011
2324
/code/modules/web_interface/ @Arrow768

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
include:
6262
- stage: code check
6363
install:
64+
- chmod +x ./vueui/install
6465
- ./vueui/install
6566
script:
6667
- (! grep 'step_[xy]' maps/**/*.dmm)
@@ -73,4 +74,4 @@ jobs:
7374
- awk -f tools/indentation.awk **/*.dm
7475
- md5sum -c - <<< "94c0d540b3b0f008fbc4353e667de690 *html/changelogs/example.yml"
7576
- md5sum -c - <<< "51704c822012212faa577079db2e11fd *vueui/template.html"
76-
- python tools/TagMatcher/tag-matcher.py ../..
77+
- python tools/TagMatcher/tag-matcher.py ../..

aurorastation.dme

+24-1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
#include "code\controllers\subsystems\ao.dm"
154154
#include "code\controllers\subsystems\arrivals.dm"
155155
#include "code\controllers\subsystems\assets.dm"
156+
#include "code\controllers\subsystems\cargo.dm"
156157
#include "code\controllers\subsystems\chemistry.dm"
157158
#include "code\controllers\subsystems\effects.dm"
158159
#include "code\controllers\subsystems\emergency_shuttle.dm"
@@ -185,7 +186,6 @@
185186
#include "code\controllers\subsystems\statistics.dm"
186187
#include "code\controllers\subsystems\sun.dm"
187188
#include "code\controllers\subsystems\sunlight.dm"
188-
#include "code\controllers\subsystems\supply.dm"
189189
#include "code\controllers\subsystems\ticker.dm"
190190
#include "code\controllers\subsystems\timer.dm"
191191
#include "code\controllers\subsystems\trade.dm"
@@ -1139,7 +1139,30 @@
11391139
#include "code\modules\awaymissions\trigger.dm"
11401140
#include "code\modules\awaymissions\zlevel.dm"
11411141
#include "code\modules\blob\blob.dm"
1142+
#include "code\modules\cargo\bounty.dm"
1143+
#include "code\modules\cargo\export_scanner.dm"
1144+
#include "code\modules\cargo\exports.dm"
11421145
#include "code\modules\cargo\randomstock.dm"
1146+
#include "code\modules\cargo\bounties\assistant.dm"
1147+
#include "code\modules\cargo\bounties\bot.dm"
1148+
#include "code\modules\cargo\bounties\chef.dm"
1149+
#include "code\modules\cargo\bounties\item.dm"
1150+
#include "code\modules\cargo\bounties\mech.dm"
1151+
#include "code\modules\cargo\bounties\reagent.dm"
1152+
#include "code\modules\cargo\bounties\science.dm"
1153+
#include "code\modules\cargo\bounties\security.dm"
1154+
#include "code\modules\cargo\bounties\slime.dm"
1155+
#include "code\modules\cargo\bounties\special.dm"
1156+
#include "code\modules\cargo\bounties\virus.dm"
1157+
#include "code\modules\cargo\bounties\weapon_prototype.dm"
1158+
#include "code\modules\cargo\exports\gear.dm"
1159+
#include "code\modules\cargo\exports\large_objects.dm"
1160+
#include "code\modules\cargo\exports\materials.dm"
1161+
#include "code\modules\cargo\exports\parts.dm"
1162+
#include "code\modules\cargo\exports\seeds.dm"
1163+
#include "code\modules\cargo\exports\sheets.dm"
1164+
#include "code\modules\cargo\exports\tools.dm"
1165+
#include "code\modules\cargo\exports\weapons.dm"
11431166
#include "code\modules\cciaa\cciaa.dm"
11441167
#include "code\modules\cciaa\cciaa_items.dm"
11451168
#include "code\modules\cciaa\ert_cmd.dm"

code/ATMOSPHERICS/pipes.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
var/volume = 0
66
force = 20
77

8-
layer = 2.4 //under wires with their 2.44
8+
layer = PIPE_LAYER
99
use_power = 0
1010

1111
var/alert_pressure = 80*ONE_ATMOSPHERE

code/ZAS/Fire.dm

+6
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
9595
return 0
9696

9797
/turf/simulated/create_fire(fl)
98+
9899
if(fire)
99100
fire.firelevel = max(fl, fire.firelevel)
100101
return 1
@@ -111,6 +112,11 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
111112
if(fuel)
112113
LAZYADD(zone.fuel_objs, fuel)
113114

115+
var/obj/effect/decal/cleanable/foam/extinguisher_foam = locate() in src
116+
if(extinguisher_foam && extinguisher_foam.reagents)
117+
fire.firelevel *= max(0,1 - (extinguisher_foam.reagents.total_volume*0.04))
118+
//25 units will eliminate the fire completely
119+
114120
return 0
115121

116122
/obj/fire

code/__defines/_layers.dm

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#define LOWER_ON_TURF_LAYER (TURF_LAYER + 0.05) // under the below
88
#define ON_TURF_LAYER (TURF_LAYER + 0.1) // sitting on the turf - should be preferred over direct use of TURF_LAYER
99
#define AO_LAYER (ON_TURF_LAYER + 0.1)
10+
#define PIPE_LAYER 2.4 //under wires with their 2.44
11+
#define CABLE_LAYER 2.44
12+
#define ABOVE_CABLE_LAYER (CABLE_LAYER + 0.1)
1013
#define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
1114
#define UNDERDOOR 3.09 //Just barely under a closed door.
1215
#define DOOR_CLOSED_LAYER 3.1 //Above most items if closed

code/__defines/chemistry.dm

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#define CHEM_BLOOD 3
66
#define CHEM_BREATHE 4
77

8+
#define WET_TYPE_WATER 1
9+
#define WET_TYPE_LUBE 2
10+
#define WET_TYPE_ICE 3
11+
812
#define MINIMUM_CHEMICAL_VOLUME 0.01
913

1014
#define SOLID 1

code/__defines/items_clothing.dm

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
#define SLOT_HOLSTER 0x8000 //16th bit - higher than this will overflow
2424

2525
// Flags bitmasks.
26-
#define NOBLUDGEON 0x1 // When an item has this it produces no "X has been hit by Y with Z" message with the default handler.
26+
#define NOBLUDGEON 0x1 // When an item has this it produces no "X has been hit by Y with Z" message with the default handler.
2727
#define CONDUCT 0x2 // Conducts electricity. (metal etc.)
2828
#define ON_BORDER 0x4 // Item has priority to check when entering or leaving.
2929
#define NOBLOODY 0x8 // Used for items if they don't want to get a blood overlay.
30-
#define OPENCONTAINER 0x10 // Is an open container for chemistry purposes.
31-
#define PHORONGUARD 0x20 // Does not get contaminated by phoron.
32-
#define NOREACT 0x40 // Reagents don't react inside this container.
30+
#define OPENCONTAINER 0x10 // Is an open container for chemistry purposes.
31+
#define PHORONGUARD 0x20 // Does not get contaminated by phoron.
32+
#define NOREACT 0x40 // Reagents don't react inside this container.
3333
#define PROXMOVE 0x80 // Does this object require proximity checking in Enter()?
3434

3535
//Flags for items (equipment)

code/__defines/math_physics.dm

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Math constants.
22
#define M_PI 3.14159
3+
#define NUM_E 2.71828183
34

45
#define R_IDEAL_GAS_EQUATION 8.31 // kPa*L/(K*mol).
56
#define ONE_ATMOSPHERE 101.325 // kPa.

code/controllers/subsystems/supply.dm code/controllers/subsystems/cargo.dm

+38-28
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,16 @@ var/datum/controller/subsystem/cargo/SScargo
3939

4040
//shuttle movement
4141
var/movetime = 1200
42+
var/min_movetime = 1200
4243
var/datum/shuttle/ferry/supply/shuttle
4344

4445
//Item vars
4546
var/last_item_id = 0 //The ID of the last item that has been added
4647

48+
//Exports and bounties
49+
var/list/exports_list = list()
50+
var/list/bounties_list = list()
51+
4752
/datum/controller/subsystem/cargo/Recover()
4853
src.shuttle = SScargo.shuttle
4954
src.cargo_items = SScargo.cargo_items
@@ -54,6 +59,8 @@ var/datum/controller/subsystem/cargo/SScargo
5459
src.cargo_handlingfee_change = SScargo.cargo_handlingfee_change
5560
src.supply_account = SScargo.supply_account
5661
src.last_item_id = SScargo.last_item_id
62+
src.exports_list = SScargo.exports_list
63+
src.bounties_list = SScargo.bounties_list
5764

5865
/datum/controller/subsystem/cargo/Initialize(timeofday)
5966
//Generate the ordernumber and shipmentnumber to start with
@@ -73,6 +80,10 @@ var/datum/controller/subsystem/cargo/SScargo
7380
else
7481
log_game("SScargo: invalid load option specified in config")
7582

83+
setupExports()
84+
setupBounties()
85+
86+
//Spawn in the warehouse crap
7687
var/datum/cargospawner/spawner = new
7788
spawner.start()
7889
qdel(spawner)
@@ -201,7 +212,6 @@ var/datum/controller/subsystem/cargo/SScargo
201212
item_query.item[11])
202213
catch(var/exception/ei)
203214
log_debug("SScargo: Error when loading item from sql: [ei]")
204-
return 1
205215

206216
//Loads the cargo data from JSON
207217
/datum/controller/subsystem/cargo/proc/load_from_json()
@@ -555,7 +565,7 @@ var/datum/controller/subsystem/cargo/SScargo
555565
if (shuttle.forbidden_atoms_check())
556566
. = "For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons."
557567
else
558-
movetime = 1200 //It always takes two minutes to get to centcom
568+
movetime = min_movetime //It always takes two minutes to get to centcom
559569
shuttle.launch(src)
560570
. = "Initiating launch sequence"
561571
current_shipment.shuttle_recalled_by = caller_name
@@ -573,9 +583,9 @@ var/datum/controller/subsystem/cargo/SScargo
573583
current_shipment.shuttle_time = get_pending_shipment_time()
574584
current_shipment.shuttle_fee = shipment_cost
575585

576-
if(current_shipment.shuttle_time < 1200)
577-
log_debug("SScargo: Shuttle Time less than 1200: [current_shipment.shuttle_time] - Setting to 1200")
578-
current_shipment.shuttle_time = 1200
586+
if(current_shipment.shuttle_time < min_movetime)
587+
log_debug("SScargo: Shuttle Time less than [min_movetime]: [current_shipment.shuttle_time] - Setting to [min_movetime]")
588+
current_shipment.shuttle_time = min_movetime
579589

580590
movetime = current_shipment.shuttle_time
581591
//Launch it
@@ -609,39 +619,39 @@ var/datum/controller/subsystem/cargo/SScargo
609619

610620
//Sells stuff on the shuttle to centcom
611621
/datum/controller/subsystem/cargo/proc/sell()
612-
//TODO-CARGO: Only pay for specific stuff on the shuttle and not for everything else - Charge a cleanup fee for the rest
613622
var/area/area_shuttle = shuttle.get_location_area()
614623
if(!area_shuttle) return
615624

616-
var/phoron_count = 0
617-
var/plat_count = 0
625+
var/msg = ""
626+
var/matched_bounty = FALSE
627+
var/sold_atoms = ""
618628

619-
for(var/atom/movable/MA in area_shuttle)
620-
if(MA.anchored) continue
629+
for(var/place in area_shuttle)
630+
var/area/shuttle/shuttle_area = place
631+
for(var/atom/movable/AM in shuttle_area)
632+
if(bounty_ship_item_and_contents(AM, dry_run = FALSE))
633+
matched_bounty = TRUE
634+
if(!AM.anchored || istype(AM, /obj/mecha))
635+
sold_atoms += export_item_and_contents(AM, FALSE, FALSE, dry_run = FALSE)
621636

622-
// Must be in a crate!
623-
if(istype(MA,/obj/structure/closet/crate))
624-
callHook("sell_crate", list(MA, area_shuttle))
637+
if(sold_atoms)
638+
sold_atoms += "."
625639

626-
current_shipment.shipment_cost_sell += credits_per_crate
640+
if(matched_bounty)
641+
msg += "Bounty items received. An update has been sent to all bounty consoles.\n"
627642

628-
for(var/atom in MA)
629-
var/atom/A = atom
630-
// Sell phoron and platinum
631-
if(istype(A, /obj/item/stack))
632-
var/obj/item/stack/P = A
633-
switch(P.get_material_name())
634-
if("phoron") phoron_count += P.get_amount()
635-
if("platinum") plat_count += P.get_amount()
636-
qdel(MA)
637-
638-
if(phoron_count)
639-
current_shipment.shipment_cost_sell += phoron_count * credits_per_phoron
643+
for(var/a in exports_list)
644+
var/datum/export/E = a
645+
var/export_text = E.total_printout()
646+
if(!export_text)
647+
continue
640648

641-
if(plat_count)
642-
current_shipment.shipment_cost_sell += plat_count * credits_per_platinum
649+
msg += export_text + "\n"
650+
current_shipment.shipment_cost_sell += E.total_cost
651+
E.export_end()
643652

644653
charge_cargo("Shipment #[current_shipment.shipment_num] - Income", -current_shipment.shipment_cost_sell)
654+
current_shipment.message = msg
645655
current_shipment.generate_invoice()
646656
current_shipment = null //Null the current shipment because its completed
647657

code/datums/cargo.dm

+6-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@
334334
// Returns a Invoice for the Order
335335
/datum/cargo_order/proc/get_report_invoice()
336336
var/list/order_data = list()
337-
order_data += "<h4>Invoice #[order_id]</h4>"
337+
var/invoice_type = "Preliminary"
338+
if(status == "delivered" && paid_by)
339+
invoice_type = "Final"
340+
order_data += "<h4>[invoice_type] Invoice #[order_id]</h4>"
338341
order_data += "<hr>"
339342
//List the personell involved in the order
340343
order_data += "<u>Ordered by:</u> [ordered_by]<br>"
@@ -482,6 +485,7 @@
482485
var/shuttle_called_by //The person that called the shuttle
483486
var/shuttle_recalled_by //The person that recalled the shuttle
484487
var/completed = 0
488+
var/message = null //Message from central
485489

486490
/datum/cargo_shipment/proc/get_list(var/shipment_completion = 1)
487491
if(shipment_completion != completed)
@@ -512,6 +516,7 @@
512516
invoice_data += "shuttle time: [shuttle_time]<br>"
513517
invoice_data += "shuttle called by: [shuttle_called_by]<br>"
514518
invoice_data += "shuttle recalled by: [shuttle_recalled_by]<br>"
519+
invoice_data += "centcom message:<br>[nl2br(message)]"
515520

516521
shipment_invoice = invoice_data.Join("")
517522
completed = 1

code/datums/diseases/advance/advance.dm

+14-5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ var/list/advance_cures = list(
3838
// NEW VARS
3939

4040
var/list/symptoms = list() // The symptoms of the disease.
41+
var/list/properties = list() // List of properties
4142
var/id = ""
4243
var/processing = 0
4344

@@ -168,7 +169,7 @@ var/list/advance_cures = list(
168169

169170
/datum/disease/advance/proc/Refresh(var/new_name = 0)
170171
//world << "[src.name] \ref[src] - REFRESH!"
171-
var/list/properties = GenerateProperties()
172+
GenerateProperties()
172173
AssignProperties(properties)
173174

174175
if(!archive_diseases[GetDiseaseID()])
@@ -187,8 +188,6 @@ var/list/advance_cures = list(
187188
CRASH("We did not have any symptoms before generating properties.")
188189
return
189190

190-
var/list/properties = list("resistance" = 1, "stealth" = 1, "stage_rate" = 1, "transmittable" = 1, "severity" = 1)
191-
192191
for(var/datum/symptom/S in symptoms)
193192

194193
properties["resistance"] += S.resistance
@@ -197,8 +196,6 @@ var/list/advance_cures = list(
197196
properties["transmittable"] += S.transmittable
198197
properties["severity"] = max(properties["severity"], S.level) // severity is based on the highest level symptom
199198

200-
return properties
201-
202199
// Assign the properties that are in the list.
203200
/datum/disease/advance/proc/AssignProperties(var/list/properties = list())
204201

@@ -413,6 +410,18 @@ var/list/advance_cures = list(
413410
name_symptoms += S.name
414411
message_admins("[key_name_admin(user)] has triggered a custom virus outbreak of [D.name]! It has these symptoms: [english_list(name_symptoms)]")
415412

413+
/datum/disease/advance/proc/totalStageSpeed()
414+
return properties["stage_rate"]
415+
416+
/datum/disease/advance/proc/totalStealth()
417+
return properties["stealth"]
418+
419+
/datum/disease/advance/proc/totalResistance()
420+
return properties["resistance"]
421+
422+
/datum/disease/advance/proc/totalTransmittable()
423+
return properties["transmittable"]
424+
416425
/*
417426
/mob/verb/test()
418427

0 commit comments

Comments
 (0)