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

Voreupdate [MDB IGNORE] [IDB IGNORE] #1468

Merged
merged 131 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
15728d5
OOC Escape Food
SatinIsle Jul 20, 2024
137d5c3
Merge pull request #16117 from SatinIsle/OOC-escape
Novacat Jul 20, 2024
92da6db
yet another clothing port pr (#16105)
PastelPrinceDan Jul 21, 2024
b93ce56
Second part of the typescript migration (#16109)
Kashargul Jul 21, 2024
3775663
Mega nukies (#16110)
SatinIsle Jul 21, 2024
aa15e64
Monster Bait (#16111)
SatinIsle Jul 21, 2024
1331263
Butterfly net description (#16112)
SatinIsle Jul 21, 2024
185e767
Update new_player.dm (#16115)
KillianKirilenko Jul 21, 2024
85632ad
helmet cams on networks (#16113)
KillianKirilenko Jul 21, 2024
6002d96
smooth lizard tail variant (#16119)
KillianKirilenko Jul 21, 2024
1f839e5
Char Setup Background Switch (#16118)
KillianKirilenko Jul 21, 2024
867a0c2
Map Swap
Very-Soft Jul 21, 2024
b8ad324
Merge pull request #16120 from VOREStation/Map-Swap-1
Very-Soft Jul 21, 2024
5cf4aea
Merge pull request #16121 from VOREStation/master
Very-Soft Jul 21, 2024
18e64c5
small mistake in the UIs, noticed due to conflict (#16122)
Kashargul Jul 21, 2024
33ba08d
Patchless Military Jackets (#16114)
KillianKirilenko Jul 21, 2024
40b5c1c
Whitelist Protean
SatinIsle Jul 21, 2024
275b038
Merge pull request #16123 from SatinIsle/ctrz
Novacat Jul 21, 2024
2f8f17e
queue.length...
Kashargul Jul 22, 2024
f89646b
.
Kashargul Jul 22, 2024
7040ece
bundle
Kashargul Jul 22, 2024
9f996eb
Merge pull request #16125 from Kashargul/processingQueue
Novacat Jul 22, 2024
e9d1868
edits some no_vore usage (#16131)
Kashargul Jul 27, 2024
bf3f098
allows cyborg glass recyclers to refill lightreplacers (#16126)
Kashargul Jul 27, 2024
6e9278c
tgui update (#16128)
Kashargul Jul 27, 2024
bc87e52
Lleill Species - Part 2 (#16127)
SatinIsle Jul 27, 2024
41e7958
Fix for bluespace crackers (#16132)
SatinIsle Jul 28, 2024
cac9f2a
allows to disable sliders again (#16133)
Kashargul Jul 28, 2024
e962521
Map Swap
Very-Soft Jul 28, 2024
50e64da
Merge pull request #16134 from VOREStation/Map-Swap-1
Very-Soft Jul 28, 2024
5e6b86c
Merge pull request #16135 from VOREStation/master
Very-Soft Jul 28, 2024
44bbbc0
do not touch the main ref!
Kashargul Jul 29, 2024
befde06
some more
Kashargul Jul 29, 2024
de0dae4
.
Kashargul Jul 29, 2024
6850f21
input ids
Kashargul Jul 30, 2024
24555b4
fix focus loss
Kashargul Jul 31, 2024
f41b1e6
Merge pull request #16141 from Kashargul/keyForwarding
Novacat Jul 31, 2024
0594086
Merge pull request #16139 from Kashargul/xenoLists
Novacat Jul 31, 2024
501850f
no early return between hooks (#16142)
Kashargul Jul 31, 2024
d3767ec
selectors pass (#16137)
KillianKirilenko Aug 1, 2024
dcbb488
signs and safety (#16136)
KillianKirilenko Aug 1, 2024
a0ddbd6
Update fueldepot.dmm
KillianKirilenko Aug 2, 2024
d44ec9b
Merge pull request #16150 from KillianKirilenko/kk-depot
Novacat Aug 2, 2024
d2e0179
fix thermal regulators not allowing negative temperatures (#16146)
Kashargul Aug 2, 2024
e27e133
ship transponder flip (#16147)
KillianKirilenko Aug 2, 2024
721d276
Late Selectors Pass Addon (#16144)
KillianKirilenko Aug 2, 2024
0b659c8
remove discord-based entries (#16149)
KillianKirilenko Aug 2, 2024
66546dc
NanoMap Auto-Update (Fri Aug 2 21:52:40 UTC 2024) (#16143)
github-actions[bot] Aug 2, 2024
51b7edc
Add speckled leather wings (#16154)
ShadowLarkens Aug 3, 2024
15c0ec0
fix splicer (#16153)
Kashargul Aug 3, 2024
388736f
techmaint tile fixes
KillianKirilenko Aug 3, 2024
7ced0bf
Add a verb to turn on and off the verb panel (#16155)
ShadowLarkens Aug 4, 2024
c604b01
Map Swap
Very-Soft Aug 4, 2024
3808a39
Merge pull request #16158 from VOREStation/Map-Swap-1
Very-Soft Aug 4, 2024
527ea7d
Merge pull request #16159 from VOREStation/master
Very-Soft Aug 4, 2024
4996649
craftable shelves
KillianKirilenko Aug 5, 2024
cc54e4d
disconnect devices on RD console dismanlte
Kashargul Aug 6, 2024
ce48b6a
fix holospeak
Kashargul Aug 7, 2024
0f715e4
Merge pull request #16170 from Kashargul/holoMultiZ
Novacat Aug 10, 2024
efb1454
Merge pull request #16162 from KillianKirilenko/kk-cryogen
Novacat Aug 10, 2024
ca66214
Merge pull request #16167 from Kashargul/rdconsoledisconnect
Novacat Aug 10, 2024
ad00f7a
Merge pull request #16157 from KillianKirilenko/kk-floors
Novacat Aug 10, 2024
9ce3a7f
Fixed vore struggle animation not working (#16182)
SatinIsle Aug 11, 2024
5016701
Emergency Beacon Update (#16152)
KillianKirilenko Aug 11, 2024
ac28845
healthbars now respect selective mode (#16163)
Kashargul Aug 11, 2024
de3ebb5
fix charsetup tail layering (#16166)
KillianKirilenko Aug 11, 2024
88ade83
spacewhale LZs (#16164)
KillianKirilenko Aug 11, 2024
39072cd
talon miner hud icon (#16165)
KillianKirilenko Aug 11, 2024
816b836
add armbands to engineering vendors (#16168)
Detective-Google Aug 11, 2024
4406e22
revert throw notifs (#16169)
KillianKirilenko Aug 11, 2024
7a23e81
martian miner coat adjustments (#16171)
KillianKirilenko Aug 11, 2024
65c3fa8
Fixes species blood color (#16174)
Darlantanis Aug 11, 2024
eb76812
Update electrical_storm.dm (#16175)
KillianKirilenko Aug 11, 2024
90720f8
Various fixes (#16176)
Darlantanis Aug 11, 2024
7dabf57
Away Team/Pilot Supply Crates (#16178)
Novacat Aug 11, 2024
910f1fa
Patchless tan jacket icon fix (#16179)
KillianKirilenko Aug 11, 2024
924d3cc
Adds pudge transfer (#16180)
Screemonster Aug 11, 2024
bd1d79a
Add recipe macro recording to reagent dispenser (#16173)
ShadowLarkens Aug 11, 2024
7a7920f
TGUI Say (#16160)
ShadowLarkens Aug 11, 2024
d42d24f
Map Swap
Very-Soft Aug 11, 2024
a403a7c
Merge pull request #16185 from VOREStation/Map-Swap-1
Very-Soft Aug 11, 2024
2830cb9
Merge pull request #16186 from VOREStation/master
Very-Soft Aug 11, 2024
4837819
some RS ports
Kashargul Aug 14, 2024
44fdda2
allows to delete singular recipes
Kashargul Aug 15, 2024
632e15a
handle speechbubble for robots
Kashargul Aug 15, 2024
431c6f7
match TGUI Say channel list with our channels
Kashargul Aug 15, 2024
0b35c40
sleeper scrollable
Kashargul Aug 15, 2024
a1f9a27
borg beaker improvement
Kashargul Aug 15, 2024
9f16bbd
.
Kashargul Aug 15, 2024
57fc4b8
supply scroll
Kashargul Aug 15, 2024
5dcbb93
Merge pull request #16188 from Kashargul/removeSingleRecipes
Novacat Aug 15, 2024
e255244
Merge pull request #16187 from Kashargul/RSports
Novacat Aug 15, 2024
ebf0a93
Merge pull request #16190 from Kashargul/tguiSayChannels
Novacat Aug 15, 2024
ab2a50c
Remove Lower Case
Lilly-Lira Aug 15, 2024
8684462
Add Upper Case
Lilly-Lira Aug 15, 2024
215d199
Merge pull request #16189 from Kashargul/robotSpeech
Novacat Aug 16, 2024
20bb7bd
Merge pull request #16192 from Kashargul/borgBeaker
Novacat Aug 16, 2024
8f07f30
move history to page up / down keys
Kashargul Aug 16, 2024
f25c022
.
Kashargul Aug 16, 2024
592ae8e
Merge pull request #16195 from Kashargul/TGUi-Say-history
Novacat Aug 16, 2024
8fde8b2
Adjusts stationside first aid spawns (#16194)
Novacat Aug 18, 2024
2c796c4
Adminbus and Shelter Capsule Updates (#16191)
Novacat Aug 18, 2024
9bbf61b
Fix tooltips not working on mobs
ShadowLarkens Aug 18, 2024
fcf75c9
Merge pull request #16197 from ShadowLarkens/tooltip_fix
Novacat Aug 18, 2024
ff2d077
Map swap
Very-Soft Aug 18, 2024
f4aa6e2
Merge pull request #16198 from VOREStation/Map-swap-1
Very-Soft Aug 18, 2024
de5af4a
Merge pull request #16199 from VOREStation/master
Very-Soft Aug 18, 2024
bfd2cc4
Required admin privileges restrictions
SatinIsle Aug 19, 2024
98e542b
Merge pull request #16200 from SatinIsle/LOOC-rights
Novacat Aug 19, 2024
a6627c1
adds cell names to the battery rack
Kashargul Aug 19, 2024
3028ffd
Merge pull request #16201 from Kashargul/cellnames
Novacat Aug 19, 2024
966a26b
Fluff Item Whitelist Addition
Aug 21, 2024
e4dc268
Fix for bait toy
SatinIsle Aug 21, 2024
f08211a
Merge pull request #16203 from SatinIsle/Fix-bait
Novacat Aug 21, 2024
73d6d16
Merge pull request #16193 from Lilly-Lira/FixEGuitar
Novacat Aug 21, 2024
31677e9
Merge pull request #16202 from Lewzharri/fluff-item-whitelist-addition
Novacat Aug 22, 2024
1e49f4b
Supply System Updates (#16161)
KillianKirilenko Aug 22, 2024
da60cb1
move the scrollbar on the supplyconsole
Kashargul Aug 22, 2024
4429900
Merge pull request #16204 from Kashargul/supply
Novacat Aug 23, 2024
5eec723
No rounding
Cameron653 Aug 24, 2024
e06a418
Merge pull request #16207 from Cameron653/Bites_you
Novacat Aug 24, 2024
4ba5f0e
New cheeky vore critter, Meowl (#16208)
SatinIsle Aug 25, 2024
ef06ade
Research Samples (#16039)
KillianKirilenko Aug 25, 2024
692045c
refocusses number input on clicks (#16210)
Kashargul Aug 25, 2024
2c763a1
fix examine of clientless humans
Kashargul Aug 25, 2024
0b3cde3
Merge pull request #16216 from Kashargul/examineFail
Novacat Aug 25, 2024
1b5df1b
Map swap
Very-Soft Aug 25, 2024
7dad05c
Merge pull request #16217 from VOREStation/Map-swap-1
Very-Soft Aug 25, 2024
6b72e62
Merge pull request #16218 from VOREStation/master
Very-Soft Aug 25, 2024
42b345b
Merge branch 'release' of https://github.com/VOREStation/VOREStation …
izac112 Aug 28, 2024
dd5a202
Fixes
izac112 Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@
],
"group": "build",
"label": "tgui: prettybuild"
},
{
"type": "shell",
"command": "bin/tgui --dev",
"windows": {
"command": ".\\bin\\tgui.bat --dev"
},
"problemMatcher": [
"$tsc",
"$eslint-stylish"
],
"options": {
"cwd": ".\\tgui\\",
},
"group": "build",
"label": "tgui: dev server"
}
]
}
13 changes: 13 additions & 0 deletions code/__defines/assert.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#undef ASSERT

/// Override BYOND's native ASSERT to optionally specify a message
#define ASSERT(condition, message...) \
if (!(condition)) { \
CRASH(assertion_message(__FILE__, __LINE__, #condition, ##message)) \
}

/proc/assertion_message(file, line, condition, message)
if (!isnull(message))
message = " - [message]"

return "[file]:[line]:Assertion failed: [condition][message]"
1 change: 1 addition & 0 deletions code/__defines/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#define CE_SLOWDOWN "goslow" // Slowdown
#define CE_ANTACID "nopuke" // Don't puke.
#define CE_ALLERGEN "allergyreaction" // Self explanatory
#define CE_DARKSIGHT "darksight" // Gives perfect vision in dark

#define REAGENTS_PER_SHEET 20

Expand Down
4 changes: 4 additions & 0 deletions code/__defines/color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
#define COLOR_LIGHT_VIOLET "#e7bfff"
#define COLOR_SAN_MARINO_BLUE "#4b75ab"
#define COLOR_HALF_TRANSPARENT_BLACK "#0000007A"
#define COLOR_NUKIES_GREEN "#43fe00"
#define COLOR_NUKIES_YELLOW "#ffe900"
#define COLOR_DESATTI_PRPLOW "#3300cc"
#define COLOR_DESATTI_PRPHI "#6600cc"

#define PIPE_COLOR_GREY "#808080"
#define PIPE_COLOR_RED "#ff0000"
Expand Down
1 change: 1 addition & 0 deletions code/__defines/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define BLOCK_GAS_SMOKE_EFFECT (1<<3) // Blocks the effect that chemical clouds would have on a mob -- glasses, mask and helmets ONLY! (NOTE: flag shared with ONESIZEFITSALL)
#define FLEXIBLEMATERIAL (1<<4) // At the moment, masks with this flag will not prevent eating even if they are covering your face.
#define ALLOW_SURVIVALFOOD (1<<5) // Allows special survival food items to be eaten through it
#define INFINITE_AIR (1<<6) // Provides an infinite air supply.

// Flags for pass_flags. - Used in /atom/var/pass_flags
#define PASSTABLE (1<<0)
Expand Down
2 changes: 2 additions & 0 deletions code/__defines/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
//#define isturf(D) istype(D, /turf) //Built in
#define isopenspace(A) istype(A, /turf/simulated/open)
#define isspace(A) istype(A, /turf/space)
#define isopenturf(A) istype(A, /turf/simulated/open) || istype(A, /turf/space)
#define isnonsolidturf(A) istype(A, /turf/simulated/open) || istype(A, /turf/space) || istype(A, /turf/simulated/floor/water) || istype(A, /turf/simulated/floor/lava)
#define ismineralturf(A) istype(A, /turf/simulated/mineral)

#define istaurtail(A) istype(A, /datum/sprite_accessory/tail/taur)
Expand Down
9 changes: 9 additions & 0 deletions code/__defines/speech_channels.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Used to direct channels to speak into.
#define SAY_CHANNEL "Say"
#define RADIO_CHANNEL "Radio"
#define ME_CHANNEL "Me"
#define OOC_CHANNEL "OOC"
#define ADMIN_CHANNEL "Admin"
#define LOOC_CHANNEL "LOOC"
#define WHIS_CHANNEL "Whis"
#define SUBTLE_CHANNEL "Subtle"
122 changes: 122 additions & 0 deletions code/__defines/traits/_traits.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#define SIGNAL_ADDTRAIT(trait_ref) "addtrait [trait_ref]"
#define SIGNAL_REMOVETRAIT(trait_ref) "removetrait [trait_ref]"

// trait accessor defines
#define ADD_TRAIT(target, trait, source) \
do { \
var/list/_L; \
if (!target._status_traits) { \
target._status_traits = list(); \
_L = target._status_traits; \
_L[trait] = list(source); \
SEND_SIGNAL(target, SIGNAL_ADDTRAIT(trait), trait); \
} else { \
_L = target._status_traits; \
if (_L[trait]) { \
_L[trait] |= list(source); \
} else { \
_L[trait] = list(source); \
SEND_SIGNAL(target, SIGNAL_ADDTRAIT(trait), trait); \
} \
} \
} while (0)
#define REMOVE_TRAIT(target, trait, sources) \
do { \
var/list/_L = target._status_traits; \
var/list/_S; \
if (sources && !islist(sources)) { \
_S = list(sources); \
} else { \
_S = sources\
}; \
if (_L?[trait]) { \
for (var/_T in _L[trait]) { \
if ((!_S && (_T != ROUNDSTART_TRAIT)) || (_T in _S)) { \
_L[trait] -= _T \
} \
};\
if (!length(_L[trait])) { \
_L -= trait; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(trait), trait); \
}; \
if (!length(_L)) { \
target._status_traits = null \
}; \
} \
} while (0)
#define REMOVE_TRAIT_NOT_FROM(target, trait, sources) \
do { \
var/list/_traits_list = target._status_traits; \
var/list/_sources_list; \
if (sources && !islist(sources)) { \
_sources_list = list(sources); \
} else { \
_sources_list = sources\
}; \
if (_traits_list?[trait]) { \
for (var/_trait_source in _traits_list[trait]) { \
if (!(_trait_source in _sources_list)) { \
_traits_list[trait] -= _trait_source \
} \
};\
if (!length(_traits_list[trait])) { \
_traits_list -= trait; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(trait), trait); \
}; \
if (!length(_traits_list)) { \
target._status_traits = null \
}; \
} \
} while (0)
#define REMOVE_TRAITS_NOT_IN(target, sources) \
do { \
var/list/_L = target._status_traits; \
var/list/_S = sources; \
if (_L) { \
for (var/_T in _L) { \
_L[_T] &= _S;\
if (!length(_L[_T])) { \
_L -= _T; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(_T), _T); \
}; \
};\
if (!length(_L)) { \
target._status_traits = null\
};\
}\
} while (0)

#define REMOVE_TRAITS_IN(target, sources) \
do { \
var/list/_L = target._status_traits; \
var/list/_S = sources; \
if (sources && !islist(sources)) { \
_S = list(sources); \
} else { \
_S = sources\
}; \
if (_L) { \
for (var/_T in _L) { \
_L[_T] -= _S;\
if (!length(_L[_T])) { \
_L -= _T; \
SEND_SIGNAL(target, SIGNAL_REMOVETRAIT(_T)); \
}; \
};\
if (!length(_L)) { \
target._status_traits = null\
};\
}\
} while (0)

#define HAS_TRAIT(target, trait) (target._status_traits?[trait] ? TRUE : FALSE)
#define HAS_TRAIT_FROM(target, trait, source) (HAS_TRAIT(target, trait) && (source in target._status_traits[trait]))
#define HAS_TRAIT_FROM_ONLY(target, trait, source) (HAS_TRAIT(target, trait) && (source in target._status_traits[trait]) && (length(target._status_traits[trait]) == 1))
#define HAS_TRAIT_NOT_FROM(target, trait, source) (HAS_TRAIT(target, trait) && (length(target._status_traits[trait] - source) > 0))
/// Returns a list of trait sources for this trait. Only useful for wacko cases and internal futzing
/// You should not be using this
#define GET_TRAIT_SOURCES(target, trait) (target._status_traits?[trait] || list())
/// Returns the amount of sources for a trait. useful if you don't want to have a "thing counter" stuck around all the time
#define COUNT_TRAIT_SOURCES(target, trait) length(GET_TRAIT_SOURCES(target, trait))
/// A simple helper for checking traits in a mob's mind
#define HAS_MIND_TRAIT(target, trait) (HAS_TRAIT(target, trait) || (target.mind ? HAS_TRAIT(target.mind, trait) : FALSE))
11 changes: 11 additions & 0 deletions code/__defines/traits/declarations.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file contains all of the "static" define strings that tie to a trait.
// WARNING: The sections here actually matter in this file as it's tested by CI. Please do not toy with the sections."

// BEGIN TRAIT DEFINES

/*
Remember to update _globalvars/traits.dm if you're adding/removing/renaming traits.
*/

/// Trait given to a mob that is currently thinking (giving off the "thinking" icon), used in an IC context
#define TRAIT_THINKING_IN_CHARACTER "currently_thinking_IC"
7 changes: 7 additions & 0 deletions code/__defines/traits/sources.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// This file contains all of the trait sources, or all of the things that grant traits.
// Several things such as `type` or `REF(src)` may be used in the ADD_TRAIT() macro as the "source", but this file contains all of the defines for immutable static strings.

/// cannot be removed without admin intervention
#define ROUNDSTART_TRAIT "roundstart"
/// This trait comes from when a mob is currently typing.
#define CURRENTLY_TYPING_TRAIT "currently_typing"
12 changes: 12 additions & 0 deletions code/_global_vars/traits/_traits.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// This file should contain every single global trait in the game in a type-based list, as well as any additional trait-related information that's useful to have on a global basis.
// This file is used in linting, so make sure to add everything alphabetically and what-not.
// Do consider adding your trait entry to the similar list in `admin_tooling.dm` if you want it to be accessible to admins (which is probably the case for 75% of traits).

// Please do note that there is absolutely no bearing on what traits are added to what subtype of `/datum`, this is just an easily referenceable list sorted by type.
// The only thing that truly matters about traits is the code that is built to handle the traits, and where that code is located. Nothing else.

GLOBAL_LIST_INIT(traits_by_type, list(
/mob = list(
"TRAIT_THINKING_IN_CHARACTER" = TRAIT_THINKING_IN_CHARACTER,
)
))
45 changes: 45 additions & 0 deletions code/_helpers/traits.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#define TRAIT_CALLBACK_ADD(target, trait, source) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___TraitAdd), ##target, ##trait, ##source)
#define TRAIT_CALLBACK_REMOVE(target, trait, source) CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(___TraitRemove), ##target, ##trait, ##source)

///DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
/proc/___TraitAdd(target, trait, source)
if(!target || !trait || !source)
return

if(islist(target))
for(var/datum/listed_target in target)
ADD_TRAIT(listed_target, trait, source)
return

ASSERT(isdatum(target), "Invalid target used in TRAIT_CALLBACK_ADD! Expected a datum reference, got [target] instead.")

var/datum/datum_target = target
ADD_TRAIT(datum_target, trait, source)

///DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
/proc/___TraitRemove(target, trait, source)
if(!target || !trait || !source)
return

if(islist(target))
for(var/datum/listed_target in target)
REMOVE_TRAIT(listed_target, trait, source)
return

ASSERT(isdatum(target), "Invalid target used in TRAIT_CALLBACK_REMOVE! Expected a datum reference, got [target] instead.")

var/datum/datum_target = target
REMOVE_TRAIT(datum_target, trait, source)


/// Proc that handles adding multiple traits to a target via a list. Must have a common source and target.
/datum/proc/add_traits(list/list_of_traits, source)
ASSERT(islist(list_of_traits), "Invalid arguments passed to add_traits! Invoked on [src] with [list_of_traits], source being [source].")
for(var/trait in list_of_traits)
ADD_TRAIT(src, trait, source)

/// Proc that handles removing multiple traits from a target via a list. Must have a common source and target.
/datum/proc/remove_traits(list/list_of_traits, source)
ASSERT(islist(list_of_traits), "Invalid arguments passed to remove_traits! Invoked on [src] with [list_of_traits], source being [source].")
for(var/trait in list_of_traits)
REMOVE_TRAIT(src, trait, source)
50 changes: 28 additions & 22 deletions code/controllers/subsystems/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SUBSYSTEM_DEF(supply)
var/points_per_slip = 2
var/points_per_money = 0.02 // 1 point for $50
//control
var/ordernum
var/ordernum = 0 // Start at zero, it's per-shift tracking
var/list/shoppinglist = list() // Approved orders
var/list/supply_pack = list() // All supply packs
var/list/exported_crates = list() // Crates sent from the station
Expand All @@ -25,8 +25,6 @@ SUBSYSTEM_DEF(supply)
var/datum/shuttle/autodock/ferry/supply/shuttle

/datum/controller/subsystem/supply/Initialize()
ordernum = rand(1,9000)

// build master supply list
for(var/typepath in subtypesof(/datum/supply_pack))
var/datum/supply_pack/P = new typepath()
Expand Down Expand Up @@ -186,35 +184,38 @@ SUBSYSTEM_DEF(supply)
var/datum/supply_pack/SP = SO.object
shopping_log += "[SP.name];"

var/obj/A = new SP.containertype(pickedloc)
A.name = "[SP.containername] [SO.comment ? "([SO.comment])":"" ]"
var/obj/A
if(SP.containertype)
A = new SP.containertype(pickedloc)
A.name = "[SP.containername] [SO.comment ? "([SO.comment])":"" ]"
if(SP.access)
if(isnum(SP.access))
A.req_access = list(SP.access)
else if(islist(SP.access) && SP.one_access)
var/list/L = SP.access // access var is a plain var, we need a list
A.req_one_access = L.Copy()
LAZYCLEARLIST(A.req_access)
else if(islist(SP.access) && !SP.one_access)
var/list/L = SP.access
A.req_access = L.Copy()
LAZYCLEARLIST(A.req_one_access)
else
log_debug("<span class='danger'>Supply pack with invalid access restriction [SP.access] encountered!</span>")

//supply manifest generation begin
var/obj/item/weapon/paper/manifest/slip
if(!SP.contraband)
slip = new /obj/item/weapon/paper/manifest(A)
if(A)
slip = new /obj/item/weapon/paper/manifest(A)
else
slip = new /obj/item/weapon/paper/manifest(pickedloc)
slip.is_copy = 0
slip.info = "<h3>[command_name()] Shipping Manifest</h3><hr><br>"
slip.info +="Order #[SO.ordernum]<br>"
slip.info +="Destination: [station_name()]<br>"
slip.info +="[orderedamount] PACKAGES IN THIS SHIPMENT<br>"
slip.info +="CONTENTS:<br><ul>"

//spawn the stuff, finish generating the manifest while you're at it
if(SP.access)
if(isnum(SP.access))
A.req_access = list(SP.access)
else if(islist(SP.access) && SP.one_access)
var/list/L = SP.access // access var is a plain var, we need a list
A.req_one_access = L.Copy()
LAZYCLEARLIST(A.req_access)
else if(islist(SP.access) && !SP.one_access)
var/list/L = SP.access
A.req_access = L.Copy()
LAZYCLEARLIST(A.req_one_access)
else
log_debug("<span class='danger'>Supply pack with invalid access restriction [SP.access] encountered!</span>")

var/list/contains
if(istype(SP,/datum/supply_pack/randomised))
var/datum/supply_pack/randomised/SPR = SP
Expand All @@ -231,7 +232,12 @@ SUBSYSTEM_DEF(supply)

var/number_of_items = max(1, contains[typepath])
for(var/j = 1 to number_of_items)
var/atom/B2 = new typepath(A)
var/atom/B2
if(A)
B2 = new typepath(A)
else
B2 = new typepath(pickedloc)

if(slip)
slip.info += "<li>[B2.name]</li>" //add the item to the manifest

Expand Down
2 changes: 2 additions & 0 deletions code/datums/datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

/// Active timers with this datum as the target
var/list/active_timers
/// Status traits attached to this datum. associative list of the form: list(trait name (string) = list(source1, source2, source3,...))
var/list/_status_traits

/**
* Components attached to this datum
Expand Down
Loading
Loading