Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhials committed Nov 8, 2024
2 parents a076e0a + e76ab8d commit 674c3e8
Show file tree
Hide file tree
Showing 70 changed files with 1,528 additions and 1,311 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/fish.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
///This fish can be scanned to complete fish scanning experiments
#define FISH_FLAG_EXPERIMENT_SCANNABLE (1<<3)
///It lets us know that fish/update_size_and_weight() is currently running.
#define FISH_FLAG_UPDATING_SIZE_AND_WEIGHT (1<<3)
#define FISH_FLAG_UPDATING_SIZE_AND_WEIGHT (1<<4)


#define MIN_AQUARIUM_TEMP T0C
Expand Down
3 changes: 2 additions & 1 deletion code/__HELPERS/level_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ GLOBAL_VAR(station_level_z_scratch)
// Called a lot, somewhat slow, so has its own cache
#define is_station_level(z_level) \
( \
(z_level) && \
(z_level) && ( \
( \
/* The right hand side of this guarantees that we'll have the space to fill later on, while also not failing the condition */ \
(GLOB.station_levels_cache.len < (GLOB.station_level_z_scratch = (z_level)) && (GLOB.station_levels_cache.len = GLOB.station_level_z_scratch)) \
|| isnull(GLOB.station_levels_cache[GLOB.station_level_z_scratch]) \
) \
? (GLOB.station_levels_cache[GLOB.station_level_z_scratch] = !!SSmapping.level_trait(GLOB.station_level_z_scratch, ZTRAIT_STATION)) \
: GLOB.station_levels_cache[GLOB.station_level_z_scratch] \
) \
)

#define is_mining_level(z) SSmapping.level_trait(z, ZTRAIT_MINING)
Expand Down
9 changes: 4 additions & 5 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ GLOBAL_LIST_INIT(skin_tone_names, list(
. += borg

//Returns a list of AI's
/proc/active_ais(check_mind=FALSE, z = null, skip_syndicate, only_syndicate)
/proc/active_ais(check_mind = FALSE, z = null, skip_syndicate = FALSE, only_syndicate = FALSE)
. = list()
for(var/mob/living/silicon/ai/ai as anything in GLOB.ai_list)
if(ai.stat == DEAD)
Expand All @@ -501,10 +501,9 @@ GLOBAL_LIST_INIT(skin_tone_names, list(
continue
if(only_syndicate && !syndie_ai)
continue
if(check_mind)
if(!ai.mind)
continue
if(z && !(z == ai.z) && (!is_station_level(z) || !is_station_level(ai.z))) //if a Z level was specified, AND the AI is not on the same level, AND either is off the station...
if(check_mind && !ai.mind)
continue
if(!isnull(z) && z != ai.z && (!is_station_level(z) || !is_station_level(ai.z))) //if a Z level was specified, AND the AI is not on the same level, AND either is off the station...
continue
. += ai

Expand Down
4 changes: 4 additions & 0 deletions code/_globalvars/phobias.dm
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ GLOBAL_LIST_INIT(phobia_objs, list(
/obj/item/toy/plush/abductor/agent,
/obj/machinery/atmospherics/miner,
/obj/machinery/door/airlock/centcom,
/obj/item/clothing/mask/madness_mask,
/obj/item/wallframe/painting/eldritch,
/obj/item/clothing/neck/heretic_focus/moon_amulet,
/obj/item/melee/sickly_blade/moon,
)),
"doctors" = typecacheof(list(
/obj/item/cautery,
Expand Down
6 changes: 3 additions & 3 deletions code/controllers/subsystem/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Used by the AI doomsday and the self-destruct nuke.
loaded_lazy_templates = SSmapping.loaded_lazy_templates

#define INIT_ANNOUNCE(X) to_chat(world, span_boldannounce("[X]")); log_world(X)
/datum/controller/subsystem/mapping/proc/LoadGroup(list/errorList, name, path, files, list/traits, list/default_traits, silent = FALSE)
/datum/controller/subsystem/mapping/proc/LoadGroup(list/errorList, name, path, files, list/traits, list/default_traits, silent = FALSE, height_autosetup = TRUE)
. = list()
var/start_time = REALTIMEOFDAY

Expand Down Expand Up @@ -394,7 +394,7 @@ Used by the AI doomsday and the self-destruct nuke.
while (total_z > traits.len) // fall back to defaults on extra levels
traits += list(default_traits.Copy())

if(total_z > 1) // it's a multi z map
if(total_z > 1 && height_autosetup) // it's a multi z map, and we haven't opted out of trait autosetup
for(var/z in 1 to total_z)
if(z == 1) // bottom z-level
traits[z]["Up"] = TRUE
Expand Down Expand Up @@ -433,7 +433,7 @@ Used by the AI doomsday and the self-destruct nuke.
// load the station
station_start = world.maxz + 1
INIT_ANNOUNCE("Loading [current_map.map_name]...")
LoadGroup(FailedZs, "Station", current_map.map_path, current_map.map_file, current_map.traits, ZTRAITS_STATION)
LoadGroup(FailedZs, "Station", current_map.map_path, current_map.map_file, current_map.traits, ZTRAITS_STATION, height_autosetup = current_map.height_autosetup)

if(SSdbcore.Connect())
var/datum/db_query/query_round_map_name = SSdbcore.NewQuery({"
Expand Down
51 changes: 33 additions & 18 deletions code/datums/components/material/material_container.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
else
allowed_item_typecache = typecacheof(allowed_items)

for(var/mat in init_mats) //Make the assoc list material reference -> amount
//Make the assoc list material reference -> amount
for(var/mat in init_mats)
var/mat_ref = GET_MATERIAL_REF(mat)
if(isnull(mat_ref))
continue
Expand All @@ -66,17 +67,6 @@
for(var/signal in container_signals)
parent.RegisterSignal(src, signal, container_signals[signal])

//drop sheets when the object is deconstructed but not deleted
RegisterSignal(parent, COMSIG_OBJ_DECONSTRUCT, PROC_REF(drop_sheets))

if(_mat_container_flags & MATCONTAINER_NO_INSERT)
return

var/atom/atom_target = parent
atom_target.flags_1 |= HAS_CONTEXTUAL_SCREENTIPS_1

RegisterSignal(atom_target, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, PROC_REF(on_requesting_context_from_item))

/datum/component/material_container/Destroy(force)
materials = null
allowed_materials = null
Expand All @@ -85,10 +75,35 @@
/datum/component/material_container/RegisterWithParent()
. = ..()

var/atom/atom_target = parent

//can we insert into this container
if(!(mat_container_flags & MATCONTAINER_NO_INSERT))
RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(on_attackby))
//to insert stuff into the container
RegisterSignal(atom_target, COMSIG_ATOM_ITEM_INTERACTION, PROC_REF(on_item_insert))

//screen tips for inserting items
atom_target.flags_1 |= HAS_CONTEXTUAL_SCREENTIPS_1
RegisterSignal(atom_target, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, PROC_REF(on_requesting_context_from_item))

//to see available materials
if(mat_container_flags & MATCONTAINER_EXAMINE)
RegisterSignal(atom_target, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))

//drop sheets when the object is deconstructed but not deleted
RegisterSignal(parent, COMSIG_OBJ_DECONSTRUCT, PROC_REF(drop_sheets))

/datum/component/material_container/UnregisterFromParent()
var/list/signals = list()

if(!(mat_container_flags & MATCONTAINER_NO_INSERT))
signals += COMSIG_ATOM_ITEM_INTERACTION
signals += COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM
if(mat_container_flags & MATCONTAINER_EXAMINE)
RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
signals += COMSIG_ATOM_EXAMINE
signals += COMSIG_OBJ_DECONSTRUCT

UnregisterSignal(parent, signals)

/datum/component/material_container/proc/drop_sheets()
SIGNAL_HANDLER
Expand All @@ -114,9 +129,9 @@
UnregisterSignal(parent, COMSIG_ATOM_EXAMINE)

if(old_flags & MATCONTAINER_NO_INSERT && !(mat_container_flags & MATCONTAINER_NO_INSERT))
RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(on_attackby))
RegisterSignal(parent, COMSIG_ATOM_ITEM_INTERACTION, PROC_REF(on_item_insert))
else if(!(old_flags & MATCONTAINER_NO_INSERT) && mat_container_flags & MATCONTAINER_NO_INSERT)
UnregisterSignal(parent, COMSIG_ATOM_ATTACKBY)
UnregisterSignal(parent, COMSIG_ATOM_ITEM_INTERACTION)

/**
* 3 Types of Procs
Expand Down Expand Up @@ -471,7 +486,7 @@
qdel(deleting)

/// Proc that allows players to fill the parent with mats
/datum/component/material_container/proc/on_attackby(datum/source, obj/item/weapon, mob/living/user)
/datum/component/material_container/proc/on_item_insert(datum/source, mob/living/user, obj/item/weapon, list/modifiers)
SIGNAL_HANDLER

//Allows you to attack the machine with iron sheets for e.g.
Expand All @@ -480,7 +495,7 @@

user_insert(weapon, user)

return COMPONENT_NO_AFTERATTACK
return ITEM_INTERACT_SUCCESS
//===============================================================================================


Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/wormborn.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
/mob/living/basic/wizard_worm/has_gravity(turf/gravity_turf)
return TRUE

/mob/living/basic/wizard_worm/can_be_pulled()
/mob/living/basic/wizard_worm/can_be_pulled(user, force)
return FALSE

/mob/living/basic/wizard_worm/Initialize(mapload, spawn_bodyparts = TRUE)
Expand Down
5 changes: 5 additions & 0 deletions code/datums/map_config.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
var/job_changes = list()
/// List of additional areas that count as a part of the library
var/library_areas = list()
/// Boolean - if TRUE, the "Up" and "Down" traits are automatically distributed to the map's z-levels. If FALSE; they're set via JSON.
var/height_autosetup = TRUE

/// List of unit tests that are skipped when running this map
var/list/skipped_tests
Expand Down Expand Up @@ -208,6 +210,9 @@
continue
library_areas += path

if ("height_autosetup" in json)
height_autosetup = json["height_autosetup"]

#ifdef UNIT_TESTS
// Check for unit tests to skip, no reason to check these if we're not running tests
for(var/path_as_text in json["ignored_unit_tests"])
Expand Down
4 changes: 2 additions & 2 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@
/atom/movable/proc/start_pulling(atom/movable/pulled_atom, state, force = move_force, supress_message = FALSE)
if(QDELETED(pulled_atom))
return FALSE
if(!(pulled_atom.can_be_pulled(src, state, force)))
if(!(pulled_atom.can_be_pulled(src, force)))
return FALSE

// If we're pulling something then drop what we're currently pulling and pull this instead.
Expand Down Expand Up @@ -1643,7 +1643,7 @@
/atom/movable/proc/get_cell(atom/movable/interface, mob/user)
return

/atom/movable/proc/can_be_pulled(user, grab_state, force)
/atom/movable/proc/can_be_pulled(user, force)
if(src == user || !isturf(loc))
return FALSE
if(SEND_SIGNAL(src, COMSIG_ATOM_CAN_BE_PULLED, user) & COMSIG_ATOM_CANT_PULL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
lefthand_file = 'icons/mob/inhands/weapons/goliath_hammer_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/goliath_hammer_righthand.dmi'
item_flags = ABSTRACT | DROPDEL
resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
w_class = WEIGHT_CLASS_HUGE
force = 20
throwforce = 0
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,7 @@
if(istype(mover) && (mover.pass_flags & PASSGLASS))
return !opacity

/obj/structure/fluff/airlock_filler/can_be_pulled(user, grab_state, force)
/obj/structure/fluff/airlock_filler/can_be_pulled(user, force)
return FALSE

/obj/structure/fluff/airlock_filler/singularity_act()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/newscaster/newscaster_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/newscaster, 30)
name = "newscaster frame"
desc = "Used to build newscasters, just secure to the wall."
icon_state = "newscaster_assembly"
custom_materials = list(/datum/material/iron= SHEET_MATERIAL_AMOUNT * 7, /datum/material/glass= SHEET_MATERIAL_AMOUNT * 4)
custom_materials = list(/datum/material/iron= SHEET_MATERIAL_AMOUNT * 7)
result_path = /obj/machinery/newscaster
pixel_shift = 30

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/status_display.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ GLOBAL_DATUM_INIT(status_font, /datum/font, new /datum/font/tiny_unicode/size_12
name = "status display frame"
desc = "Used to build status displays, just secure to the wall."
icon_state = "unanchoredstatusdisplay"
custom_materials = list(/datum/material/iron= SHEET_MATERIAL_AMOUNT * 7, /datum/material/glass= SHEET_MATERIAL_AMOUNT * 4)
custom_materials = list(/datum/material/iron= SHEET_MATERIAL_AMOUNT * 7)
result_path = /obj/machinery/status_display/evac
pixel_shift = 32

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/theft_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
/obj/item/nuke_core/supermatter_sliver/attack_tk(mob/user) // no TK dusting memes
return

/obj/item/nuke_core/supermatter_sliver/can_be_pulled(user) // no drag memes
/obj/item/nuke_core/supermatter_sliver/can_be_pulled(user, force) // no drag memes
return FALSE

/obj/item/nuke_core/supermatter_sliver/attackby(obj/item/W, mob/living/user, params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
return
if(IS_HERETIC(viewer))
return
if(viewer.can_block_magic(MAGIC_RESISTANCE))
if(viewer.can_block_magic(MAGIC_RESISTANCE|MAGIC_RESISTANCE_MIND))
return
to_chat(viewer, span_notice(text_to_display))
viewer.gain_trauma(applied_trauma, TRAUMA_RESILIENCE_SURGERY)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/heretic/items/heretic_necks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
user.add_mood_event("Moon Amulet Insanity", /datum/mood_event/amulet_insanity)
user.mob_mood.set_sanity(user.mob_mood.sanity - 50)
return
if(hit.can_block_magic())
if(hit.can_block_magic(MAGIC_RESISTANCE|MAGIC_RESISTANCE_MIND))
return
if(!hit.mob_mood)
return
Expand Down
3 changes: 3 additions & 0 deletions code/modules/antagonists/heretic/items/madness_mask.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
if(IS_HERETIC_OR_MONSTER(human_in_range) || human_in_range.is_blind())
continue

if(human_in_range.can_block_magic(MAGIC_RESISTANCE|MAGIC_RESISTANCE_MIND))
continue

human_in_range.mob_mood.direct_sanity_drain(rand(-2, -20) * seconds_per_tick)

if(SPT_PROB(60, seconds_per_tick))
Expand Down
11 changes: 10 additions & 1 deletion code/modules/antagonists/heretic/knowledge/moon_lore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@

/datum/heretic_knowledge/moon_grasp/proc/on_mansus_grasp(mob/living/source, mob/living/target)
SIGNAL_HANDLER
if(target.can_block_magic(MAGIC_RESISTANCE_MIND))
to_chat(target, span_danger("You hear echoing laughter from above..but it is dull and distant."))
return

source.apply_status_effect(/datum/status_effect/moon_grasp_hide)

if(!iscarbon(target))
Expand Down Expand Up @@ -155,6 +159,9 @@
if(source == target || !isliving(target))
return

if(target.can_block_magic(MAGIC_RESISTANCE_MIND))
return

target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10, 100)
target.cause_hallucination( \
get_random_valid_hallucination_subtype(/datum/hallucination/body), \
Expand Down Expand Up @@ -219,7 +226,7 @@
var/amount_of_lunatics = 0
var/list/lunatic_candidates = list()
for(var/mob/living/carbon/human/crewmate as anything in shuffle(GLOB.human_list))
if(QDELETED(crewmate) || isnull(crewmate.client) || isnull(crewmate.mind) || crewmate.stat != CONSCIOUS)
if(QDELETED(crewmate) || isnull(crewmate.client) || isnull(crewmate.mind) || crewmate.stat != CONSCIOUS || crewmate.can_block_magic(MAGIC_RESISTANCE_MIND))
continue
var/turf/crewmate_turf = get_turf(crewmate)
var/crewmate_z = crewmate_turf?.z
Expand Down Expand Up @@ -274,6 +281,8 @@
continue
if(IS_HERETIC_OR_MONSTER(carbon_view))
continue
if(carbon_view.can_block_magic(MAGIC_RESISTANCE_MIND)) //Somehow a shitty piece of tinfoil is STILL able to hold out against the power of an ascended heretic.
continue
new moon_effect(get_turf(carbon_view))
carbon_view.adjust_confusion(2 SECONDS)
carbon_view.mob_mood.set_sanity(carbon_sanity - 5)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/heretic/magic/moon_parade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
return PROJECTILE_PIERCE_PHASE

// Anti-magic destroys the projectile for consistency and counterplay
if(victim.can_block_magic(MAGIC_RESISTANCE))
if(victim.can_block_magic(MAGIC_RESISTANCE|MAGIC_RESISTANCE_MIND))
visible_message(span_warning("The parade hits [victim] and a sudden wave of clarity comes over you!"))
return PROJECTILE_DELETE_WITHOUT_HITTING

Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/heretic/magic/moon_ringleader.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

school = SCHOOL_FORBIDDEN
cooldown_time = 1 MINUTES

antimagic_flags = MAGIC_RESISTANCE|MAGIC_RESISTANCE_MIND
invocation = "R''S 'E"
invocation_type = INVOCATION_SHOUT
spell_requirements = NONE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/heretic/magic/moon_smile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
sound = 'sound/effects/magic/blind.ogg'
school = SCHOOL_FORBIDDEN
cooldown_time = 20 SECONDS

antimagic_flags = MAGIC_RESISTANCE|MAGIC_RESISTANCE_MIND
invocation = "Mo'N S'M'LE"
invocation_type = INVOCATION_SHOUT
spell_requirements = NONE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@

/datum/status_effect/eldritch/moon/on_apply()
. = ..()
if(owner.can_block_magic(MAGIC_RESISTANCE_MIND))
return FALSE
ADD_TRAIT(owner, TRAIT_PACIFISM, id)
owner.emote(pick("giggle", "laugh"))
owner.balloon_alert(owner, "you feel unable to hurt a soul!")
Expand Down
9 changes: 0 additions & 9 deletions code/modules/cargo/markets/market_items/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,3 @@
stock_min = 3
stock_max = 8
availability_prob = 90

/datum/market_item/misc/giant_wrench_parts
name = "Big Slappy parts"
desc = "Cheap illegal Big Slappy parts. The fastest and statistically most dangerous wrench."
item = /obj/item/weaponcrafting/giant_wrench
price_min = CARGO_CRATE_VALUE * 2
price_max = CARGO_CRATE_VALUE * 5
stock_max = 1
availability_prob = 25
Loading

0 comments on commit 674c3e8

Please sign in to comment.