Skip to content
Draft
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
6 changes: 6 additions & 0 deletions code/__DEFINES/_globals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
/// Create a typed list global that is initialized as an empty list
#define GLOBAL_LIST_EMPTY_TYPED(X, Typepath) GLOBAL_LIST_INIT_TYPED(X, Typepath, list())

/// Create an alist global with an initializer expression
#define GLOBAL_ALIST_INIT(X, InitValue) GLOBAL_RAW(/alist/##X); GLOBAL_MANAGED(X, InitValue)

// Create an alist global that is initialized as an empty list
#define GLOBAL_ALIST_EMPTY(X) GLOBAL_ALIST_INIT(X, alist())

/// Create a typed global with an initializer expression
#define GLOBAL_DATUM_INIT(X, Typepath, InitValue) GLOBAL_RAW(Typepath/##X); GLOBAL_MANAGED(X, InitValue)

Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/components.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// /datum signals
/// when a component is added to a datum: (/datum/component)
#define COMSIG_COMPONENT_ADDED "component_added"
/// before a component is removed from a datum because of RemoveComponent: (/datum/component)
/// before a component is removed from a datum because of ClearFromParent: (/datum/component)
#define COMSIG_COMPONENT_REMOVING "component_removing"
/// before a datum's Destroy() is called: (force), returning a nonzero value will cancel the qdel operation
#define COMSIG_PARENT_PREQDELETED "parent_preqdeleted"
Expand Down
13 changes: 11 additions & 2 deletions code/__DEFINES/dcs/flags.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Return this from `/datum/component/Initialize` or `datum/component/OnTransfer` to have the component be deleted if it's applied to an incorrect type.
/// Return this from `/datum/component/Initialize` or `/datum/component/OnTransfer` or `/datum/component/on_source_add` to have the component be deleted if it's applied to an incorrect type.
/// `parent` must not be modified if this is to be returned.
/// This will be noted in the runtime logs
#define COMPONENT_INCOMPATIBLE 1
Expand All @@ -16,7 +16,7 @@
/// You would need it if you are doing something like removing the target from a processing list.
#define ELEMENT_DETACH (1 << 0)
/**
* Only elements created with the same arguments given after `id_arg_index` share an element instance
* Only elements created with the same arguments given after `argument_hash_start_idx` share an element instance
* The arguments are the same when the text and number values are the same and all other values have the same ref
*/
#define ELEMENT_BESPOKE (1 << 1)
Expand All @@ -31,8 +31,17 @@
#define COMPONENT_DUPE_ALLOWED 1
/// new component is deleted
#define COMPONENT_DUPE_UNIQUE 2
/**
* Component uses source tracking to manage adding and removal logic.
* Add a source/spawn to/the component by using AddComponentFrom(source, component_type, args...)
* Removing the last source will automatically remove the component from the parent.
* Arguments will be passed to on_source_add(source, args...); ensure that Initialize and on_source_add have the same signature.
*/
#define COMPONENT_DUPE_SOURCES 3
/// old component is given the initialization args of the new
#define COMPONENT_DUPE_UNIQUE_PASSARGS 4
/// each component of the same type is consulted as to whether the duplicate should be allowed
#define COMPONENT_DUPE_SELECTIVE 5

// Update flags for [/atom/proc/update_appearance]
/// Update the atom's name
Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/dcs/helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#define SEND_GLOBAL_SIGNAL(sigtype, arguments...) ( SEND_SIGNAL(SSdcs, sigtype, ##arguments) )

/// Signifies that this proc is used to handle signals.
/// Every proc you pass to RegisterSignal must have this.
#define SIGNAL_HANDLER SHOULD_NOT_SLEEP(TRUE)

/// A wrapper for _AddElement that allows us to pretend we're using normal named arguments
Expand All @@ -15,3 +17,10 @@

/// A wrapper for _AddComponent that allows us to pretend we're using normal named arguments
#define AddComponent(arguments...) _AddComponent(list(##arguments))

/// A wrapper for _AddComonent that passes in a source.
/// Necessary if dupe_mode is set to COMPONENT_DUPE_SOURCES.
#define AddComponentFrom(source, arguments...) _AddComponent(list(##arguments), source)

/// A wrapper for _LoadComponent that allows us to pretend we're using normal named arguments
#define LoadComponent(arguments...) _LoadComponent(list(##arguments))
21 changes: 21 additions & 0 deletions code/__DEFINES/dcs/signals/signals_reagents.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

///from base of [/datum/reagent/proc/expose_atom]: (/mob/living, reac_volume, methods, show_message, touch_protection, /mob/eye/blob) // ovemind arg is only used by blob reagents.
#define COMSIG_REAGENT_EXPOSE_MOB "reagent_expose_mob"

///from base of [/datum/reagents/proc/add_reagent]: (/datum/reagent, amount, reagtemp, data, no_react)
#define COMSIG_REAGENTS_NEW_REAGENT "reagents_new_reagent"
///from base of [/datum/reagents/proc/add_reagent]: (/datum/reagent, amount, reagtemp, data, no_react)
#define COMSIG_REAGENTS_ADD_REAGENT "reagents_add_reagent"
///from base of [/datum/reagents/proc/del_reagent]: (/datum/reagent)
#define COMSIG_REAGENTS_DEL_REAGENT "reagents_del_reagent"
///from base of [/datum/reagents/proc/remove_reagent]: (/datum/reagent, amount)
#define COMSIG_REAGENTS_REM_REAGENT "reagents_rem_reagent"
///from base of [/datum/reagents/proc/clear_reagents]: ()
#define COMSIG_REAGENTS_CLEAR_REAGENTS "reagents_clear_reagents"
///from base of [/datum/reagents/proc/handle_reactions]: (num_reactions)
#define COMSIG_REAGENTS_REACTED "reagents_reacted"

///from base of [/datum/reagents/proc/update_total()]
#define COMSIG_REAGENTS_HOLDER_UPDATED "reagents_update_total"
///from base of [/datum/reagents/proc/set_temperature]: (new_temp, old_temp)
#define COMSIG_REAGENTS_TEMP_CHANGE "reagents_temp_change"
4 changes: 0 additions & 4 deletions code/__DEFINES/liquids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,3 @@

GLOBAL_LIST_INIT(liquid_blacklist, list(
))

///from base of [/datum/reagents/proc/del_reagent]: (/datum/reagent)
#define COMSIG_REAGENTS_DEL_REAGENT "reagents_del_reagent"
#define COMSIG_REAGENTS_EXPOSE_TEMPERATURE "reagents_expose_temperature"
1 change: 0 additions & 1 deletion code/__DEFINES/movespeed_modification.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

#define MOVESPEED_ID_SEPIA "SEPIA"

#define MOVESPEED_ID_MONKEY_REAGENT_SPEEDMOD "MONKEY_REAGENT_SPEEDMOD"
#define MOVESPEED_ID_MONKEY_TEMPERATURE_SPEEDMOD "MONKEY_TEMPERATURE_SPEEDMOD"
#define MOVESPEED_ID_MONKEY_HEALTH_SPEEDMOD "MONKEY_HEALTH_SPEEDMOD"

Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/obj_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#define BLOCK_Z_IN_DOWN (1<<10) // Should this object block z falling from above?
#define BLOCK_Z_IN_UP (1<<11) // Should this object block z uprise from below?
#define IGNORE_SINK (1<<12)
#define BLOCKS_CONSTRUCTION (1<<13) //! Does this object prevent things from being built on it? For things that might change density.
#define BLOCKS_CONSTRUCTION_DIR (1<<14) //! Does this object prevent same-direction things from being built on it?
#define IGNORE_DENSITY (1<<15) //! Can we ignore density when building on this object? (for example, directional windows and grilles)

// If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support

Expand Down Expand Up @@ -56,3 +59,8 @@

/// use on color subtypes for clothes, so the unit test for crafting doesn't scream at you.
#define CRAFTING_TEST_EXCLUDE (1<<0)

/// Flags for specifically what kind of items to get in get_equipped_items
#define INCLUDE_POCKETS (1<<0)
#define INCLUDE_ACCESSORIES (1<<1)
#define INCLUDE_HELD (1<<2)
40 changes: 40 additions & 0 deletions code/__DEFINES/qualities.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// For recipe and crafting quality defines

#define BLACKSMITH_QUALITY_SPOILED -8 // Spoil bars and crude smithing skill
#define BLACKSMITH_QUALITY_AWFUL -5 // Shit bars and crude skill
#define BLACKSMITH_QUALITY_CRUDE -2
#define BLACKSMITH_QUALITY_ROUGH -1
#define BLACKSMITH_QUALITY_COMPETENT 0
#define BLACKSMITH_QUALITY_FINE 2
#define BLACKSMITH_QUALITY_FLAWLESS 5
#define BLACKSMITH_QUALITY_LEGENDARY 8

//Smelting quality results
#define SMELTERY_QUALITY_SPOIL 1
#define SMELTERY_QUALITY_POOR 2
#define SMELTERY_QUALITY_NORMAL 3
#define SMELTERY_QUALITY_GOOD 4
#define SMELTERY_QUALITY_GREAT 5
#define SMELTERY_QUALITY_EXCELLENT 6

#define SMELTING_DENOMINATOR 21

//Food and reagent qualities for cooking
#define COOK_QUALITY_NORMAL 1
#define COOK_QUALITY_NICE 2
#define COOK_QUALITY_GOOD 3
#define COOK_QUALITY_VERYGOOD 4

/// Labels for food quality
GLOBAL_ALIST_INIT(food_quality_description, alist(
COOK_QUALITY_NORMAL = "okay",
COOK_QUALITY_NICE = "nice",
COOK_QUALITY_GOOD = "good",
COOK_QUALITY_VERYGOOD = "very good",
))

// Stardew Valley-style qualities
#define CROP_QUALITY_REGULAR 1
#define CROP_QUALITY_SILVER 2
#define CROP_QUALITY_GOLD 3
#define CROP_QUALITY_DIAMOND 4
11 changes: 4 additions & 7 deletions code/__DEFINES/reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,10 @@
/// Used for direct snorting of reagents
#define SNORT (1<<5)


//defines passed through to the on_reagent_change proc
#define DEL_REAGENT 1 // reagent deleted (fully cleared)
#define ADD_REAGENT 2 // reagent added
#define REM_REAGENT 3 // reagent removed (may still exist)
#define CLEAR_REAGENTS 4 // all reagents were cleared
#define REACT_REAGENTS 5 // a reaction occured
///The smallest amount of volume allowed - prevents tiny numbers
#define CHEMICAL_VOLUME_MINIMUM 0.001
///The maximum temperature a reagent holder can attain
#define CHEMICAL_MAXIMUM_TEMPERATURE 99999

#define MIMEDRINK_SILENCE_DURATION 30 //ends up being 60 seconds given 1 tick every 2 seconds
//used by chem masters and pill presses
Expand Down
7 changes: 0 additions & 7 deletions code/__DEFINES/roguetown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,6 @@ GLOBAL_LIST_EMPTY(job_respawn_delays)
#define M_SILVER M_IRON*3 // one silver bar
#define M_GOLD M_IRON*5 // one gold bar

// Skill costs - a rarity value add, items requiring a high skill to produce are rarer and has more intrinsic value. So craftsmen can make a profit.
#define SKILL_1 2
#define SKILL_2 4
#define SKILL_3 6
#define SKILL_4 8
#define SKILL_5 10

// Work costs - valued VERY low compared to raw materials, this is a problem but at least its systemic and visible now and can be adjusted. Very rough, time to gather stuff, refine it etc etc as well as crafting time itself.
#define W_MINOR 2 // Less than 10 seconds of work
#define W_MODERATE W_MINOR * 3 // Less than 1 minute of work, high skill required
Expand Down
18 changes: 0 additions & 18 deletions code/__DEFINES/skills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,3 @@

// Gets the reference for the skill type that was given
#define GetSkillRef(A) (SSskills.all_skills[A])

//Blacksmith resultant skills
#define BLACKSMITH_LEVEL_MIN -10
#define BLACKSMITH_LEVEL_SPOIL -2 // Spoil bars and crude smithing skill
#define BLACKSMITH_LEVEL_AWFUL -1 // Shit bars and crude skill
#define BLACKSMITH_LEVEL_CRUDE 0
#define BLACKSMITH_LEVEL_ROUGH 1
#define BLACKSMITH_LEVEL_COMPETENT 2
#define BLACKSMITH_LEVEL_FINE 3
#define BLACKSMITH_LEVEL_FLAWLESS 4
#define BLACKSMITH_LEVEL_LEGENDARY 5
#define BLACKSMITH_LEVEL_MAX 10

//Smelting quality results
#define SMELTERY_LEVEL_SPOIL 0
#define SMELTERY_LEVEL_POOR 1
#define SMELTERY_LEVEL_NORMAL 2 // Average, same as it always was
#define SMELTERY_LEVEL_GOOD 3
1 change: 1 addition & 0 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
#define FIRE_PRIORITY_RESEARCH 10
#define FIRE_PRIORITY_VIS 10
#define FIRE_PRIORITY_AMBIENCE 10
#define FIRE_PRIORITY_PARTICLE_SPEWERS 10
#define FIRE_PRIORITY_GARBAGE 15
#define FIRE_PRIORITY_INCONE 19
#define FIRE_PRIORITY_MOUSECHARGE 20
Expand Down
3 changes: 0 additions & 3 deletions code/__DEFINES/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@
// If delay between the start and the end of tool operation is less than MIN_TOOL_SOUND_DELAY,
// tool sound is only played when op is started. If not, it's played twice.
#define MIN_TOOL_SOUND_DELAY 20


#define TOOL_USAGE_TONGS (1<<0)
6 changes: 6 additions & 0 deletions code/__DEFINES/traits/definitions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,10 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_NOEMBED "noembed"
/// Can't be teleported
#define TRAIT_NO_TELEPORT "no-teleport" //you just can't
/// Item is too hot to pick up by hands, must use tongs.
#define TRAIT_NEEDS_QUENCH "Needs Quenching"
/// Item has been recently smelted and should give XP when retrieved
#define TRAIT_NEWLY_SMELTED "newly_smelted"
/// Properly wielded two handed item
#define TRAIT_WIELDED "wielded"
/// The items needs two hands to be carried
Expand All @@ -530,3 +533,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// This object has sound debugging tools attached to it
#define TRAIT_SOUND_DEBUGGED "sound_debugged"

/// Generic atom traits
/// Stops someone from splashing their reagent_container on an object with this trait
#define TRAIT_DO_NOT_SPLASH "do_not_splash"
1 change: 1 addition & 0 deletions code/__DEFINES/vv.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
#define VV_HK_TRIGGER_EXPLOSION "explode"
#define VV_HK_AUTO_RENAME "auto_rename"
#define VV_HK_ADD_AI "add_ai"
#define VV_HK_ADJUST_ANIMATIONS "adjust_animations"

// /obj
#define VV_HK_OSAY "osay"
Expand Down
23 changes: 23 additions & 0 deletions code/__HELPERS/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,26 @@
LAZYSET(modifiers, ICON_X, "[(click_turf_px - click_turf.pixel_x) + ((click_turf_x - click_turf.x) * 32)]")
LAZYSET(modifiers, ICON_Y, "[(click_turf_py - click_turf.pixel_y) + ((click_turf_y - click_turf.y) * 32)]")
return click_turf

/**
* Checks whether the target turf is in a valid state to accept a directional construction
* such as windows or railings.
*
* Returns FALSE if the target turf cannot accept a directional construction.
* Returns TRUE otherwise.
*
* Arguments:
* * dest_turf - The destination turf to check for existing directional constructions
* * test_dir - The prospective dir of some atom you'd like to put on this turf.
* * is_fulltile - Whether the thing you're attempting to move to this turf takes up the entire tile or whether it supports multiple movable atoms on its tile.
*/
/proc/valid_build_direction(turf/dest_turf, test_dir, is_fulltile = FALSE)
if(!dest_turf)
return FALSE
for(var/obj/turf_content in dest_turf)
if(turf_content.obj_flags & BLOCKS_CONSTRUCTION_DIR)
if(is_fulltile) // for making it so fulltile things can't be built over directional things--a special case
return FALSE
if(turf_content.dir == test_dir)
return FALSE
return TRUE
1 change: 1 addition & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_EMOTEMUTE " = TRAIT_EMOTEMUTE,
"TRAIT_DEAF" = TRAIT_DEAF,
"TRAIT_HUSK" = TRAIT_HUSK,
"TRAIT_DO_NOT_SPLASH" = TRAIT_DO_NOT_SPLASH,
"TRAIT_DUMB" = TRAIT_DUMB,
"TRAIT_MONKEYLIKE" = TRAIT_MONKEYLIKE,
"TRAIT_PACIFISM" = TRAIT_PACIFISM,
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
adf = round(adf * 0.6)
user.changeNext_move(adf)

for(var/obj/item/clothing/worn_thing in get_equipped_items(include_pockets = TRUE))//checks clothing worn by src.
for(var/obj/item/clothing/worn_thing in get_equipped_items(INCLUDE_POCKETS))//checks clothing worn by src.
// Things that are supposed to be worn, being held = cannot block
if(isclothing(worn_thing))
if(worn_thing in held_items)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/dcs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PROCESSING_SUBSYSTEM_DEF(dcs)
var/datum/element/eletype = arguments[1]
var/list/fullid = list("[eletype]")
var/list/named_arguments = list()
for(var/i in initial(eletype.id_arg_index) to length(arguments))
for(var/i in initial(eletype.argument_hash_start_idx) to length(arguments))
var/key = arguments[i]
var/value
if(istext(key))
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/subsystem/merchant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ SUBSYSTEM_DEF(merchant)

if(output)
var/list/all_requirements = list()
if(recipe.req_bar)
all_requirements[recipe.req_bar] = recipe.num_of_materials
if(recipe.required_material)
all_requirements[recipe.required_material] = recipe.num_of_materials

if(length(recipe.additional_items))
for(var/item in recipe.additional_items)
Expand Down
7 changes: 7 additions & 0 deletions code/controllers/subsystem/processing/particle_spewers.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// Processing subsystem used by particle spewers.
/// Low-priority background subsystem bc they're not exactly the most performant thing.
PROCESSING_SUBSYSTEM_DEF(particle_spewers)
name = "Particle Spewer Processing"
wait = 0.1 SECONDS
priority = FIRE_PRIORITY_PARTICLE_SPEWERS
stat_tag = "PSP"
19 changes: 17 additions & 2 deletions code/controllers/subsystem/skills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,23 @@ SUBSYSTEM_DEF(skills)
///Dictionary of skill.type || skill ref
var/list/all_skills = list()
///Static assoc list of levels (ints) - strings
var/list/level_names = list(span_info("Weak"), span_info("Average"), span_biginfo("Skilled"), span_biginfo("Expert"), "<B>Master</B>", span_greentext("Legendary"))//This list is already in the right order, due to indexing

var/list/level_names = list(
span_info("Weak"), \
span_info("Average"), \
span_biginfo("Skilled"), \
span_biginfo("Expert"), \
"<B>Master</B>", \
span_greentext("Legendary"))//This list is already in the right order, due to indexing
/// All level plain names without span
var/static/alist/level_names_plain = alist(
SKILL_LEVEL_NONE = "None",
SKILL_LEVEL_NOVICE = "Weak",
SKILL_LEVEL_APPRENTICE = "Average",
SKILL_LEVEL_JOURNEYMAN = "Skilled",
SKILL_LEVEL_EXPERT = "Expert",
SKILL_LEVEL_MASTER = "Master",
SKILL_LEVEL_LEGENDARY = "Legendary",
)

/datum/controller/subsystem/skills/Initialize(timeofday)
InitializeSkills()
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/storyteller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ SUBSYSTEM_DEF(gamemode)
var/mob/living/carbon/human/human_mob = client.mob
current_valid_humans += human_mob
record_round_statistic(STATS_TOTAL_POPULATION)
for(var/obj/item/clothing/neck/current_item in human_mob.get_equipped_items(TRUE))
for(var/obj/item/clothing/neck/current_item in human_mob.get_equipped_items(INCLUDE_POCKETS))
if(current_item.type in list(/obj/item/clothing/neck/psycross, /obj/item/clothing/neck/psycross/silver, /obj/item/clothing/neck/psycross/gold))
record_round_statistic(STATS_PSYCROSS_USERS)
break
Expand Down
14 changes: 12 additions & 2 deletions code/datums/ai/behaviours/resist.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/datum/ai_behavior/resist/perform(delta_time, datum/ai_controller/controller)
/datum/ai_behavior/resist/perform(seconds_per_tick, datum/ai_controller/controller)
. = ..()
var/mob/living/living_pawn = controller.pawn
living_pawn.resist()
living_pawn.execute_resist()
finish_action(controller, TRUE)

/datum/ai_behavior/resist/finish_action(datum/ai_controller/controller, succeeded, ...)
. = ..()
var/mob/living/living_pawn = controller.pawn
if(QDELETED(living_pawn))
return
if(SHOULD_RESIST(living_pawn))
living_pawn.ai_controller.set_blackboard_key(BB_RESISTING, TRUE)
else
living_pawn.ai_controller.set_blackboard_key(BB_RESISTING, FALSE)
Loading
Loading