Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into aneri-test
  • Loading branch information
Absolucy committed May 9, 2024
2 parents 66f42d2 + 33fbd15 commit 3ed0336
Show file tree
Hide file tree
Showing 60 changed files with 426 additions and 897 deletions.
2 changes: 0 additions & 2 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// All signals send the source datum of the signal as the first argument

// /atom signals
///from base of atom/proc/Initialize(): sent any time a new atom is created in this atom
#define COMSIG_ATOM_INITIALIZED_ON "atom_initialized_on"
//from SSatoms InitAtom - Only if the atom was not deleted or failed initialization
#define COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE "atom_init_success"
//from SSatoms InitAtom - Only if the atom was not deleted or failed initialization and has a loc
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@
#define GALOSHES_DONT_HELP (1<<3)
/// Slip works even if you're already on the ground
#define SLIP_WHEN_CRAWLING (1<<4)
/// the mob won't slip if the turf has the TRAIT_TURF_IGNORE_SLIPPERY trait.
#define SLIPPERY_TURF (1<<5)

#define MAX_CHICKENS 50

Expand Down
37 changes: 33 additions & 4 deletions code/__DEFINES/research/anomalies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,20 @@ GLOBAL_LIST_INIT(bioscrambler_parts_blacklist, typecacheof(list(
/obj/item/bodypart/leg/left/monkey,
/obj/item/bodypart/leg/right/monkey,
/obj/item/bodypart/leg/left/tallboy,
/obj/item/bodypart/leg/right/tallboy,
/obj/item/bodypart/leg/right/tallboy
)))

/// Blacklist of limb IDs which should not appear when bioscrambled, mostly because they looks awful and buggy.
GLOBAL_LIST_INIT(bioscrambler_limb_id_blacklist, list(
BODYPART_ID_PSYKER,
SPECIES_SIMIAN,
SPECIES_MONKEY,
SPECIES_GOBLIN
))

/// Blacklist of organs which should not appear when bioscrambled.
/// Either will look terrible outside of intended host, give you magical powers, are irreversible, or kill you
GLOBAL_LIST_INIT(bioscrambler_organs_blacklist, typecacheof(list (
GLOBAL_LIST_INIT(bioscrambler_organs_blacklist, typecacheof(list(
/obj/item/organ/external/pod_hair,
/obj/item/organ/external/spines,
/obj/item/organ/external/wings,
Expand All @@ -38,14 +46,35 @@ GLOBAL_LIST_INIT(bioscrambler_organs_blacklist, typecacheof(list (
/obj/item/organ/internal/brain,
/obj/item/organ/internal/body_egg,
/obj/item/organ/internal/cyberimp,
/obj/item/organ/internal/ears/dullahan,
/obj/item/organ/internal/eyes/dullahan,
/obj/item/organ/internal/heart/cursed,
/obj/item/organ/internal/heart/demon,
/obj/item/organ/internal/lungs,
/obj/item/organ/internal/monster_core,
/obj/item/organ/internal/tongue/dullahan,
/obj/item/organ/internal/vocal_cords/colossus,
/obj/item/organ/internal/zombie_infection,
/obj/item/organ/internal/empowered_borer_egg, // MONKESTATION ADDITION -- CORTICAL_BORERS
)))
// monkestation additions
/obj/item/organ/internal/heart/gland/egg,
/obj/item/organ/internal/heart/gland/electric,
/obj/item/organ/internal/heart/gland/mindshock,
/obj/item/organ/internal/heart/gland/plasma,
/obj/item/organ/internal/heart/gland/quantum,
/obj/item/organ/internal/heart/gland/slime,
/obj/item/organ/internal/heart/gland/trauma,
/obj/item/organ/internal/heart/gland/viral,
/obj/item/organ/external/anime_head,
/obj/item/organ/external/anime_middle,
/obj/item/organ/external/anime_bottom,
/obj/item/organ/internal/tongue/fly,
/obj/item/organ/internal/stomach/fly,
/obj/item/organ/internal/legion_tumour,
/obj/item/organ/internal/liver/gondola,
/obj/item/organ/internal/heart/gondola,
/obj/item/organ/internal/tongue/gondola,
/obj/item/organ/internal/empowered_borer_egg
)) - subtypesof(/obj/item/organ/external/wings/functional) - typesof(/obj/item/organ/external/wings/moth))

/// List of body parts we can apply to people
GLOBAL_LIST_EMPTY(bioscrambler_valid_parts)
Expand Down
12 changes: 12 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,15 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// This movable atom has the explosive block element
#define TRAIT_BLOCKING_EXPLOSIVES "blocking_explosives"

///Lava will be safe to cross while it has this trait.
#define TRAIT_LAVA_STOPPED "lava_stopped"
///Chasms will be safe to cross while they've this trait.
#define TRAIT_CHASM_STOPPED "chasm_stopped"
///Turf slowdown will be ignored when this trait is added to a turf.
#define TRAIT_TURF_IGNORE_SLOWDOWN "turf_ignore_slowdown"
///Mobs won't slip on a wet turf while it has this trait
#define TRAIT_TURF_IGNORE_SLIPPERY "turf_ignore_slippery"

/// Mobs with this trait can't send the mining shuttle console when used outside the station itself
#define TRAIT_FORBID_MINING_SHUTTLE_CONSOLE_OUTSIDE_STATION "forbid_mining_shuttle_console_outside_station"

Expand Down Expand Up @@ -818,6 +827,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
///Trait applied to turfs when an atmos holosign is placed on them. It will stop firedoors from closing.
#define TRAIT_FIREDOOR_STOP "firedoor_stop"

///Trait applied to turf blocked by a containment field
#define TRAIT_CONTAINMENT_FIELD "containment_field"

/// Trait applied when the MMI component is added to an [/obj/item/integrated_circuit]
#define TRAIT_COMPONENT_MMI "component_mmi"

Expand Down
2 changes: 0 additions & 2 deletions code/__DEFINES/~monkestation/span.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@
#define span_ratvar(str) ("<span class='ratvar'>" + str + "</span>")

#define REQUEST_MENTORHELP "request_mentorhelp"

#define span_italics(str) ("<span class='italics'>" + str + "</span>")
3 changes: 0 additions & 3 deletions code/__HELPERS/pronouns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
/datum/proc/p_theyve(capitalized, temp_gender)
. = p_they(capitalized, temp_gender) + "'" + copytext_char(p_have(temp_gender), 3)

/datum/proc/p_Theyve(capitalized, temp_gender)
. = p_They(capitalized, temp_gender) + "'" + copytext_char(p_have(temp_gender), 3)

/datum/proc/p_theyre(capitalized, temp_gender)
. = p_they(capitalized, temp_gender) + "'" + copytext_char(p_are(temp_gender), 2)

Expand Down
130 changes: 76 additions & 54 deletions code/datums/components/chasm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,97 +8,107 @@
/// List of refs to falling objects -> how many levels deep we've fallen
var/static/list/falling_atoms = list()
var/static/list/forbidden_types = typecacheof(list(
/obj/singularity,
/obj/energy_ball,
/obj/narsie,
/obj/docking_port,
/obj/structure/lattice,
/obj/structure/stone_tile,
/obj/projectile,
/obj/effect/projectile,
/obj/effect/portal,
/obj/effect/abstract,
/obj/effect/abstract/liquid_turf, //monkestation edit
/obj/effect/collapse,
/obj/effect/constructing_effect,
/obj/effect/dummy/phased_mob,
/obj/effect/ebeam,
/obj/effect/fishing_lure,
/obj/effect/hotspot,
/obj/effect/landmark,
/obj/effect/temp_visual,
/obj/effect/light_emitter/tendril,
/obj/effect/mapping_helpers,
/obj/effect/collapse,
/obj/effect/particle_effect/ion_trails,
/obj/effect/portal,
/obj/effect/projectile,
/obj/effect/spectre_of_resurrection,
/obj/effect/temp_visual,
/obj/effect/dummy/phased_mob,
/obj/effect/mapping_helpers,
/obj/effect/wisp,
/obj/energy_ball,
/obj/narsie,
/obj/projectile,
/obj/singularity,
/obj/structure/lattice,
/obj/structure/stone_tile,
/obj/effect/ebeam,
/obj/effect/fishing_lure,
))

/datum/component/chasm/Initialize(turf/target, mapload)
if(!isturf(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_ATOM_ENTERED, PROC_REF(Entered))
RegisterSignal(parent, SIGNAL_ADDTRAIT(TRAIT_CHASM_STOPPED), PROC_REF(on_chasm_stopped))
RegisterSignal(parent, SIGNAL_REMOVETRAIT(TRAIT_CHASM_STOPPED), PROC_REF(on_chasm_no_longer_stopped))
target_turf = target
START_PROCESSING(SSobj, src) // process on create, in case stuff is still there
RegisterSignal(parent, COMSIG_ATOM_ABSTRACT_ENTERED, PROC_REF(entered))
RegisterSignal(parent, COMSIG_ATOM_ABSTRACT_EXITED, PROC_REF(exited))
RegisterSignal(parent, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON, PROC_REF(initialized_on))
//allow catwalks to give the turf the CHASM_STOPPED trait before dropping stuff when the turf is changed.
//otherwise don't do anything because turfs and areas are initialized before movables.
if(!mapload)
addtimer(CALLBACK(src, PROC_REF(drop_stuff)), 0)
parent.AddElement(/datum/element/lazy_fishing_spot, /datum/fish_source/chasm)

/datum/component/chasm/UnregisterFromParent()
STOP_PROCESSING(SSobj, src)
storage = null

/datum/component/chasm/proc/Entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs)
/datum/component/chasm/proc/entered(datum/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs)
SIGNAL_HANDLER
drop_stuff()

START_PROCESSING(SSobj, src)
drop_stuff(arrived)

/datum/component/chasm/process()
if (!drop_stuff())
STOP_PROCESSING(SSobj, src)

/datum/component/chasm/proc/is_safe()
//if anything matching this typecache is found in the chasm, we don't drop things
var/static/list/chasm_safeties_typecache = typecacheof(list(/obj/structure/lattice, /obj/structure/lattice/catwalk, /obj/structure/stone_tile))
/datum/component/chasm/proc/exited(datum/source, atom/movable/exited)
SIGNAL_HANDLER
UnregisterSignal(exited, list(COMSIG_MOVETYPE_FLAG_DISABLED, COMSIG_LIVING_SET_BUCKLED, COMSIG_MOVABLE_THROW_LANDED))

var/atom/parent = src.parent
var/list/found_safeties = typecache_filter_list(parent.contents, chasm_safeties_typecache)
for(var/obj/structure/stone_tile/S in found_safeties)
if(S.fallen)
LAZYREMOVE(found_safeties, S)
return LAZYLEN(found_safeties)
/datum/component/chasm/proc/initialized_on(datum/source, atom/movable/movable, mapload)
SIGNAL_HANDLER
drop_stuff(movable)

/datum/component/chasm/proc/drop_stuff(dropped_thing)
if (is_safe())
return FALSE
/datum/component/chasm/proc/on_chasm_stopped(datum/source)
SIGNAL_HANDLER
UnregisterSignal(source, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_EXITED, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON))
for(var/atom/movable/movable as anything in source)
UnregisterSignal(movable, list(COMSIG_MOVETYPE_FLAG_DISABLED, COMSIG_LIVING_SET_BUCKLED, COMSIG_MOVABLE_THROW_LANDED))

var/atom/parent = src.parent
var/to_check = dropped_thing ? list(dropped_thing) : parent.contents
for (var/thing in to_check)
if (droppable(thing))
. = TRUE
INVOKE_ASYNC(src, PROC_REF(drop), thing)
/datum/component/chasm/proc/on_chasm_no_longer_stopped(datum/source)
SIGNAL_HANDLER
RegisterSignal(parent, COMSIG_ATOM_ENTERED, PROC_REF(entered))
RegisterSignal(parent, COMSIG_ATOM_EXITED, PROC_REF(exited))
RegisterSignal(parent, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON, PROC_REF(initialized_on))
drop_stuff()

#define CHASM_NOT_DROPPING 0
#define CHASM_DROPPING 1
///Doesn't drop the movable, but registers a few signals to try again if the conditions change.
#define CHASM_REGISTER_SIGNALS 2

/datum/component/chasm/proc/drop_stuff(atom/movable/dropped_thing)
if(HAS_TRAIT(parent, TRAIT_CHASM_STOPPED))
return
var/atom/atom_parent = parent
var/to_check = dropped_thing ? list(dropped_thing) : atom_parent.contents
for (var/atom/movable/thing as anything in to_check)
var/dropping = droppable(thing)
switch(dropping)
if(CHASM_DROPPING)
INVOKE_ASYNC(src, PROC_REF(drop), thing)
if(CHASM_REGISTER_SIGNALS)
RegisterSignals(thing, list(COMSIG_MOVETYPE_FLAG_DISABLED, COMSIG_LIVING_SET_BUCKLED, COMSIG_MOVABLE_THROW_LANDED), PROC_REF(drop_stuff), TRUE)

/datum/component/chasm/proc/droppable(atom/movable/dropped_thing)
var/datum/weakref/falling_ref = WEAKREF(dropped_thing)
// avoid an infinite loop, but allow falling a large distance
if(falling_atoms[falling_ref] && falling_atoms[falling_ref] > 30)
return FALSE
if(!isliving(dropped_thing) && !isobj(dropped_thing))
return FALSE
if(is_type_in_typecache(dropped_thing, forbidden_types) || dropped_thing.throwing || (dropped_thing.movement_type & (FLOATING|FLYING)))
return FALSE
return CHASM_NOT_DROPPING
if(is_type_in_typecache(dropped_thing, forbidden_types) || (!isliving(dropped_thing) && !isobj(dropped_thing)))
return CHASM_NOT_DROPPING
if(dropped_thing.throwing || (dropped_thing.movement_type & (FLOATING|FLYING)))
return CHASM_REGISTER_SIGNALS

//Flies right over the chasm
if(ismob(dropped_thing))
var/mob/M = dropped_thing
if(M.buckled) //middle statement to prevent infinite loops just in case!
var/mob/buckled_to = M.buckled
if((!ismob(M.buckled) || (buckled_to.buckled != M)) && !droppable(M.buckled))
return FALSE
return CHASM_REGISTER_SIGNALS
if(ishuman(dropped_thing))
var/mob/living/carbon/human/victim = dropped_thing
if(istype(victim.belt, /obj/item/wormhole_jaunter))
Expand All @@ -107,8 +117,12 @@
var/fall_into_chasm = jaunter.chasm_react(victim)
if(!fall_into_chasm)
chasm.visible_message(span_boldwarning("[victim] falls into the [chasm]!")) //To freak out any bystanders
return fall_into_chasm
return TRUE
return fall_into_chasm ? CHASM_DROPPING : CHASM_NOT_DROPPING
return CHASM_DROPPING

#undef CHASM_NOT_DROPPING
#undef CHASM_DROPPING
#undef CHASM_REGISTER_SIGNALS

/datum/component/chasm/proc/drop(atom/movable/dropped_thing)
var/datum/weakref/falling_ref = WEAKREF(dropped_thing)
Expand All @@ -124,6 +138,10 @@
return // We're already handling this

if(below_turf)
if(HAS_TRAIT(dropped_thing, TRAIT_CHASM_DESTROYED))
qdel(dropped_thing)
return

// send to the turf below
dropped_thing.visible_message(span_boldwarning("[dropped_thing] falls into [parent]!"), span_userdanger("[fall_message]"))
below_turf.visible_message(span_boldwarning("[dropped_thing] falls from above!"))
Expand Down Expand Up @@ -159,6 +177,10 @@
if(!dropped_thing || QDELETED(dropped_thing))
return

if(HAS_TRAIT(dropped_thing, TRAIT_CHASM_DESTROYED))
qdel(dropped_thing)
return

if(!storage)
storage = (locate() in parent) || new(parent)

Expand Down
22 changes: 3 additions & 19 deletions code/datums/components/singularity.dm
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,9 @@
target = potentially_closer
//if we lost that target get a new one
if(!target || QDELETED(target))
target = find_new_target()
foreboding_nosebleed(target)
var/mob/living/new_target = find_new_target()
new_target?.ominous_nosebleed()
target = new_target
return ..()

///Searches the living list for the closest target, and begins chasing them down.
Expand All @@ -380,23 +381,6 @@
closest_target = target
return closest_target

/// gives a little fluff warning that someone is being hunted.
/datum/component/singularity/bloodthirsty/proc/foreboding_nosebleed(mob/living/target)
if(!iscarbon(target))
to_chat(target, span_warning("You feel a bit nauseous for just a moment."))
return
var/mob/living/carbon/carbon_target = target
var/obj/item/bodypart/head = carbon_target.get_bodypart(BODY_ZONE_HEAD)
var/has_no_blood = HAS_TRAIT(carbon_target, TRAIT_NOBLOOD)
if(head)
if(has_no_blood)
to_chat(carbon_target, span_notice("You get a headache."))
return
head.adjustBleedStacks(5)
carbon_target.visible_message(span_notice("[carbon_target] gets a nosebleed."), span_warning("You get a nosebleed."))
return
to_chat(target, span_warning("You feel a bit nauseous for just a moment."))

#undef CHANCE_TO_MOVE_TO_TARGET
#undef CHANCE_TO_MOVE_TO_TARGET_BLOODTHIRSTY
#undef CHANCE_TO_CHANGE_TARGET_BLOODTHIRSTY
Expand Down
4 changes: 4 additions & 0 deletions code/datums/components/slippery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@
SIGNAL_HANDLER
if(!isliving(arrived))
return
if(lube_flags & SLIPPERY_TURF)
var/turf/turf = get_turf(source)
if(HAS_TRAIT(turf, TRAIT_TURF_IGNORE_SLIPPERY))
return
var/mob/living/victim = arrived
if(!(victim.movement_type & (FLYING | FLOATING)) && victim.slip(knockdown_time, parent, lube_flags, paralyze_time, force_drop_items) && callback)
callback.Invoke(victim)
Expand Down
12 changes: 6 additions & 6 deletions code/datums/components/wet_floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,23 @@

/datum/component/wet_floor/proc/update_flags()
var/intensity
lube_flags = NONE
lube_flags = SLIPPERY_TURF
switch(highest_strength)
if(TURF_WET_WATER)
intensity = 60
lube_flags = NO_SLIP_WHEN_WALKING
lube_flags |= NO_SLIP_WHEN_WALKING
if(TURF_WET_LUBE)
intensity = 80
lube_flags = SLIDE | GALOSHES_DONT_HELP
lube_flags |= SLIDE | GALOSHES_DONT_HELP
if(TURF_WET_ICE)
intensity = 120
lube_flags = SLIDE | GALOSHES_DONT_HELP
lube_flags |= SLIDE | GALOSHES_DONT_HELP
if(TURF_WET_PERMAFROST)
intensity = 120
lube_flags = SLIDE_ICE | GALOSHES_DONT_HELP
lube_flags |= SLIDE_ICE | GALOSHES_DONT_HELP
if(TURF_WET_SUPERLUBE)
intensity = 120
lube_flags = SLIDE | GALOSHES_DONT_HELP | SLIP_WHEN_CRAWLING
lube_flags |= SLIDE | GALOSHES_DONT_HELP | SLIP_WHEN_CRAWLING
else
qdel(parent.GetComponent(/datum/component/slippery))
return
Expand Down
Loading

0 comments on commit 3ed0336

Please sign in to comment.