Skip to content

Commit 5070903

Browse files
Merge branch 'dev' of github.com:MistakeNot4892/Nebula into pyrelight
2 parents a8b0e0d + c3e2595 commit 5070903

File tree

685 files changed

+9242
-3094
lines changed

Some content is hidden

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

685 files changed

+9242
-3094
lines changed

.gitattributes

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ html/changelog.html merge=union
1212
# Declare files that will always have CRLF line endings on checkout.
1313
*.dm text eol=crlf
1414
*.dmm text eol=crlf
15+
*.dme text eol=crlf
16+
*.py text eol=crlf
1517
*.txt text eol=crlf
1618
*.md text eol=crlf
17-
*.yml text eol=crlf
19+
*.yml text eol=crlf
20+
21+
# Declare files that will always have LF line endings on checkout.
22+
*.sh text eol=lf

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
- name: Run Dreamchecker
3434
run: |
3535
set -o pipefail
36-
~/dreamchecker 2>&1 | tee ${GITHUB_WORKSPACE}/output-annotations.txt
3736
./test/lint-all-modpacks.sh nebula.dme
37+
./test/lint-each-modpack.sh nebula.dme
3838
- name: Annotate Lints
3939
uses: yogstation13/DreamAnnotate@v2
4040
if: always()
@@ -67,7 +67,7 @@ jobs:
6767
fileName: "DMCompiler_linux-x64.tar.gz"
6868
extract: true
6969
- name: Run OpenDream
70-
run: ./DMCompiler_linux-x64/DMCompiler nebula.dme --define=UNIT_TEST --suppress-unimplemented --skip-anything-typecheck --version=${BYOND_MAJOR}.${BYOND_MINOR} | bash test/annotate_od.sh
70+
run: ./test/compile-od-all-modpacks.sh nebula.dme
7171
Code:
7272
runs-on: ubuntu-latest
7373
steps:

code/__defines/armor.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#define ARMOR_RAD_MINOR 10
3434
#define ARMOR_RAD_SMALL 25
3535
#define ARMOR_RAD_RESISTANT 40
36+
#define ARMOR_RAD_LARGE 60
3637
#define ARMOR_RAD_SHIELDED 100
3738

3839
#define ARMOR_BOMB_MINOR 10

code/__defines/items_clothing.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
#define slot_r_store_str "slot_r_store"
8383
#define slot_s_store_str "slot_s_store"
8484
#define slot_in_backpack_str "slot_in_backpack"
85+
#define slot_in_wallet_str "slot_in_wallet"
8586

8687
// Defined here for consistency, not actually used for slots, just for species clothing offsets.
8788
#define slot_undershirt_str "slot_undershirt"

code/__defines/lists.dm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@
3232
// Reads L or an empty list if L is not a list. Note: Does NOT assign, L may be an expression.
3333
#define SANITIZE_LIST(L) ( islist(L) ? L : list() )
3434

35+
// The above but for alists. Prefixed with A_ because inserting "A" randomly in the name just made it confusing
36+
#define A_LAZYINITLIST(AL) if (!AL) { AL = alist(); }
37+
#define A_UNSETEMPTY(AL) if(!length(AL)) { AL = null; }
38+
#define A_LAZYREMOVE(AL, I) if(AL) { AL -= I; A_UNSETEMPTY(AL) }
39+
#define A_LAZYSET(AL, A, I) if(!AL) { AL = alist(); } AL[A] = I;
40+
#define A_LAZYCLEARLIST(AL) if(AL) { AL.Cut(); AL = null; }
41+
#define A_LAZYLEN(AL) length(AL)
42+
3543
/// Passed into BINARY_INSERT to compare keys
3644
#define COMPARE_KEY __BIN_LIST[__BIN_MID]
3745
/// Passed into BINARY_INSERT to compare values

code/__defines/machinery.dm

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,27 @@ var/global/defer_powernet_rebuild = 0 // True if net rebuild will be called
4242

4343
// Camera channels
4444
// Station channels
45-
#define CAMERA_CHANNEL_PUBLIC "Public"
46-
#define CAMERA_CHANNEL_ENGINEERING "Engineering"
47-
#define CAMERA_CHANNEL_MEDICAL "Medical"
48-
#define CAMERA_CHANNEL_RESEARCH "Research"
49-
#define CAMERA_CHANNEL_SECURITY "Security"
50-
51-
#define CAMERA_CHANNEL_ROBOTS "Robots"
52-
#define CAMERA_CHANNEL_MINE "Mining"
53-
#define CAMERA_CHANNEL_SECRET "Secret"
45+
#define CAMERA_CHANNEL_PUBLIC "Public"
46+
#define CAMERA_CHANNEL_ENGINEERING "Engineering"
47+
#define CAMERA_CHANNEL_MEDICAL "Medical"
48+
#define CAMERA_CHANNEL_RESEARCH "Research"
49+
#define CAMERA_CHANNEL_SECURITY "Security"
50+
#define CAMERA_CHANNEL_ROBOTS "Robots"
51+
#define CAMERA_CHANNEL_MINE "Mining"
52+
#define CAMERA_CHANNEL_SECRET "Secret"
5453

5554
// Non-station channels
56-
#define CAMERA_CHANNEL_CRESCENT "Crescent"
57-
#define CAMERA_CHANNEL_ERT "ZeEmergencyResponseTeam"
58-
#define CAMERA_CHANNEL_MERCENARY "MercurialNet"
59-
#define CAMERA_CHANNEL_TELEVISION "Television"
55+
#define CAMERA_CHANNEL_CRESCENT "Crescent"
56+
#define CAMERA_CHANNEL_ERT "Emergency Response Team"
57+
#define CAMERA_CHANNEL_MERCENARY "MercurialNet"
58+
#define CAMERA_CHANNEL_TELEVISION "Television"
6059

6160
// Alarm networks
62-
#define NETWORK_ALARM_ATMOS "Atmosphere Alarms"
61+
#define NETWORK_ALARM_ATMOS "Atmosphere Alarms"
6362
#define NETWORK_ALARM_CAMERA "Camera Alarms"
64-
#define NETWORK_ALARM_FIRE "Fire Alarms"
63+
#define NETWORK_ALARM_FIRE "Fire Alarms"
6564
#define NETWORK_ALARM_MOTION "Motion Alarms"
66-
#define NETWORK_ALARM_POWER "Power Alarms"
65+
#define NETWORK_ALARM_POWER "Power Alarms"
6766

6867
//singularity defines
6968
#define STAGE_ONE 1

code/__defines/misc.dm

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,28 @@
8787
#define EVENT_LEVEL_MAJOR 3
8888

8989
//Area flags, possibly more to come
90-
#define AREA_FLAG_RAD_SHIELDED BITFLAG(1) // Shielded from radiation, clearly.
91-
#define AREA_FLAG_EXTERNAL BITFLAG(2) // External as in exposed to space, not outside in a nice, green, forest.
92-
#define AREA_FLAG_ION_SHIELDED BITFLAG(3) // Shielded from ionospheric anomalies.
93-
#define AREA_FLAG_IS_NOT_PERSISTENT BITFLAG(4) // SSpersistence will not track values from this area.
94-
#define AREA_FLAG_IS_BACKGROUND BITFLAG(5) // Blueprints can create areas on top of these areas. Cannot edit the name of or delete these areas.
95-
#define AREA_FLAG_MAINTENANCE BITFLAG(6) // Area is a maintenance area.
96-
#define AREA_FLAG_SHUTTLE BITFLAG(7) // Area is a shuttle area.
97-
#define AREA_FLAG_HALLWAY BITFLAG(8) // Area is a public hallway suitable for event selection
98-
#define AREA_FLAG_PRISON BITFLAG(9) // Area is a prison for the purposes of brigging objectives.
99-
#define AREA_FLAG_HOLY BITFLAG(10) // Area is holy for the purposes of marking turfs as cult-resistant.
100-
#define AREA_FLAG_SECURITY BITFLAG(11) // Area is security for the purposes of newscaster init.
101-
#define AREA_FLAG_HIDE_FROM_HOLOMAP BITFLAG(12) // if we shouldn't be drawn on station holomaps
90+
#define AREA_FLAG_RAD_SHIELDED BITFLAG(1) // Shielded from radiation, clearly.
91+
#define AREA_FLAG_EXTERNAL BITFLAG(2) // External as in exposed to space, not outside in a nice, green, forest.
92+
#define AREA_FLAG_ION_SHIELDED BITFLAG(3) // Shielded from ionospheric anomalies.
93+
#define AREA_FLAG_NO_LEGACY_PERSISTENCE BITFLAG(4) // SSpersistence will not track values from this area.
94+
#define AREA_FLAG_IS_BACKGROUND BITFLAG(5) // Blueprints can create areas on top of these areas. Cannot edit the name of or delete these areas.
95+
#define AREA_FLAG_MAINTENANCE BITFLAG(6) // Area is a maintenance area.
96+
#define AREA_FLAG_SHUTTLE BITFLAG(7) // Area is a shuttle area.
97+
#define AREA_FLAG_HALLWAY BITFLAG(8) // Area is a public hallway suitable for event selection
98+
#define AREA_FLAG_PRISON BITFLAG(9) // Area is a prison for the purposes of brigging objectives.
99+
#define AREA_FLAG_HOLY BITFLAG(10) // Area is holy for the purposes of marking turfs as cult-resistant.
100+
#define AREA_FLAG_SECURITY BITFLAG(11) // Area is security for the purposes of newscaster init.
101+
#define AREA_FLAG_HIDE_FROM_HOLOMAP BITFLAG(12) // if we shouldn't be drawn on station holomaps
102+
#define AREA_FLAG_ALLOW_LEVEL_PERSISTENCE BITFLAG(13) // Whether or not this area should pass changed turfs to SSpersistence.
102103

103104
//Map template flags
104-
#define TEMPLATE_FLAG_ALLOW_DUPLICATES BITFLAG(0) // Lets multiple copies of the template to be spawned
105-
#define TEMPLATE_FLAG_SPAWN_GUARANTEED BITFLAG(1) // Makes it ignore away site budget and just spawn (only for away sites)
106-
#define TEMPLATE_FLAG_CLEAR_CONTENTS BITFLAG(2) // if it should destroy objects it spawns on top of
107-
#define TEMPLATE_FLAG_NO_RUINS BITFLAG(3) // if it should forbid ruins from spawning on top of it
108-
#define TEMPLATE_FLAG_NO_RADS BITFLAG(4) // Removes all radiation from the template after spawning.
109-
#define TEMPLATE_FLAG_TEST_DUPLICATES BITFLAG(5) // Makes unit testing attempt to spawn mutliple copies of this template. Assumes unit testing is spawning at least one copy.
110-
#define TEMPLATE_FLAG_GENERIC_REPEATABLE BITFLAG(6) // Template can be picked repeatedly for the same level gen run.
105+
#define TEMPLATE_FLAG_ALLOW_DUPLICATES BITFLAG(0) // Lets multiple copies of the template to be spawned
106+
#define TEMPLATE_FLAG_SPAWN_GUARANTEED BITFLAG(1) // Makes it ignore away site budget and just spawn (only for away sites)
107+
#define TEMPLATE_FLAG_CLEAR_CONTENTS BITFLAG(2) // if it should destroy objects it spawns on top of
108+
#define TEMPLATE_FLAG_NO_RUINS BITFLAG(3) // if it should forbid ruins from spawning on top of it
109+
#define TEMPLATE_FLAG_NO_RADS BITFLAG(4) // Removes all radiation from the template after spawning.
110+
#define TEMPLATE_FLAG_TEST_DUPLICATES BITFLAG(5) // Makes unit testing attempt to spawn mutliple copies of this template. Assumes unit testing is spawning at least one copy.
111+
#define TEMPLATE_FLAG_GENERIC_REPEATABLE BITFLAG(6) // Template can be picked repeatedly for the same level gen run.
111112

112113
// Convoluted setup so defines can be supplied by Bay12 main server compile script.
113114
// Should still work fine for people jamming the icons into their repo.

code/__defines/mobs.dm

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,6 @@
160160
// Robo Organs.
161161
#define BP_VOICE "vocal synthesiser"
162162

163-
//Augmetations
164-
#define BP_AUGMENT_R_ARM "right arm augment"
165-
#define BP_AUGMENT_L_ARM "left arm augment"
166-
#define BP_AUGMENT_R_HAND "right hand augment"
167-
#define BP_AUGMENT_L_HAND "left hand augment"
168-
#define BP_AUGMENT_R_LEG "right leg augment"
169-
#define BP_AUGMENT_L_LEG "left leg augment"
170-
#define BP_AUGMENT_CHEST_ARMOUR "chest armor augment"
171-
#define BP_AUGMENT_CHEST_ACTIVE "active chest augment"
172-
#define BP_AUGMENT_HEAD "head augment"
173-
174-
//Augment flags
175-
#define AUGMENTATION_MECHANIC 1
176-
#define AUGMENTATION_ORGANIC 2
177-
178163
// Prosthetic helpers.
179164
#define BP_IS_PROSTHETIC(org) (!QDELETED(org) && (org.organ_properties & ORGAN_PROP_PROSTHETIC))
180165
#define BP_IS_ROBOTIC(org) (!QDELETED(org) && (org.bodytype?.is_robotic))

code/__defines/persistence.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Handled elsewhere, do not let them load like vars.
2+
var/global/list/_forbid_field_load = list(
3+
(nameof(/datum::type)) = TRUE,
4+
(nameof(/atom::loc)) = TRUE
5+
)

code/__defines/serde.dm

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#define SERDE_HINT_FINISHED 1
2+
#define SERDE_HINT_POSTINIT 2
3+
4+
#define SERDE_REAGENT_LIST "_reagent_list"
5+
#define SERDE_REAGENT_VOLUME "_reagent_volume"
6+
7+
#define SERIALIZE_VALUE(V, T, VAL) .[nameof(T::V)] = VAL;
8+
#define SERIALIZE(V, T) SERIALIZE_VALUE(V, T, V)
9+
#define SERIALIZE_IF_MODIFIED(V, T) if(V != initial(V)) { SERIALIZE_VALUE(V, T, V) }
10+
#define SERIALIZE_TYPE_IF_MODIFIED(V, T) if(V != initial(V)) { SERIALIZE_VALUE(V, T, "[V]") }
11+
#define SERIALIZE_DECL_IF_MODIFIED(V, T) if((isnull(V) && !isnull(initial(V))) || ((istext(V) || istype(V, /decl) || ispath(V, /decl)) && !DECLS_ARE_EQUIVALENT(V, initial(V)))) { var/decl/__D = RESOLVE_TO_DECL(V); SERIALIZE_VALUE(V, T, __D?.uid) }
12+
#define SERIALIZE_DECL_LIST(V, T) if(islist(V)) { var/list/__decl_uids = list(); for(var/decl/__decl in V) { __decl_uids += __decl.uid }; SERIALIZE_VALUE(V, T, __decl_uids) }
13+
#define SERIALIZE_REAGENTS(V, T, I) if(istype(V, /datum/reagents)) { \
14+
.[I + SERDE_REAGENT_VOLUME] = UNLINT(V.maximum_volume); \
15+
if(UNLINT(V.total_volume)) { \
16+
var/list/__compiled_reagents = list(); \
17+
for(var/decl/material/R in UNLINT(V.liquid_volumes)) { \
18+
__compiled_reagents[++__compiled_reagents.len] = list(R.uid, UNLINT(V.liquid_volumes[R]), (MAT_PHASE_LIQUID)); \
19+
} \
20+
for(var/decl/material/R in UNLINT(V.solid_volumes)) { \
21+
__compiled_reagents[++__compiled_reagents.len] = list(R.uid, UNLINT(V.solid_volumes[R]), (MAT_PHASE_SOLID)); \
22+
} \
23+
.[I + SERDE_REAGENT_LIST] = __compiled_reagents; \
24+
} else { \
25+
.[I + SERDE_REAGENT_LIST] = list(); \
26+
} \
27+
} else { \
28+
.[I + SERDE_REAGENT_LIST] = list(); \
29+
.[I + SERDE_REAGENT_VOLUME] = 0; \
30+
}
31+
32+
#define DESERIALIZE_REAGENTS(V, I) if(((I + SERDE_REAGENT_LIST) in __deserialization_payload) && ((I + SERDE_REAGENT_VOLUME) in __deserialization_payload)) { \
33+
V = list((SERDE_REAGENT_VOLUME) = __deserialization_payload[I + SERDE_REAGENT_VOLUME], (SERDE_REAGENT_LIST) = __deserialization_payload[I + SERDE_REAGENT_LIST]); \
34+
}
35+
36+
#define DESERIALIZE_DECL_TO_TYPE(V) if(istext(V) || ispath(V, /decl) || istype(V, /decl)) { var/decl/__D = RESOLVE_TO_DECL(V); V = __D?.type; } else { V = null; }
37+
#define DESERIALIZE_TYPE(V) if(istext(V)) { V = text2path(V); } else if(!ispath(V)) { V = null; }
38+
#define DESERIALIZE_DECL(V) if(istext(V) || ispath(V)) { V = RESOLVE_TO_DECL(V); } else { V = null; }
39+
40+
// List cast is to avoid OpenDream complaining about V typically being typed as a reagents datum, but holding a list for serde.
41+
#define FINALIZE_REAGENTS_SERDE_BODY(V) try { \
42+
if((SERDE_REAGENT_LIST in V) && (SERDE_REAGENT_VOLUME in V)) { \
43+
var/list/LV = V; \
44+
var/__serde_volume = LV[SERDE_REAGENT_VOLUME]; \
45+
if(__serde_volume <= 0) { \
46+
V = null; \
47+
} else { \
48+
var/list/__serde_reagents = LV[SERDE_REAGENT_LIST]; \
49+
V = new /datum/reagents(__serde_volume, src); \
50+
for(var/list/entry in __serde_reagents) { \
51+
V.add_reagent(RESOLVE_TO_DECL(entry[1]), entry[2], phase = entry[3], defer_update = TRUE); \
52+
} \
53+
V.handle_update(); \
54+
} \
55+
} else { \
56+
V = null; \
57+
} \
58+
} catch(var/exception/E) { \
59+
log_error("Exception while finalizing reagents load for [type]: [EXCEPTION_TEXT(E)]"); \
60+
V = null; \
61+
}
62+
63+
#define FINALIZE_REAGENTS_SERDE(V) if(islist(V)) { FINALIZE_REAGENTS_SERDE_BODY(V); }
64+
#define FINALIZE_REAGENTS_SERDE_AND_RETURN(V) if(islist(V)) { FINALIZE_REAGENTS_SERDE_BODY(V); return; }

0 commit comments

Comments
 (0)