Skip to content

Commit

Permalink
Merge branch 'upstream-master' into merge-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
larentoun committed Nov 29, 2024
2 parents 11d3580 + 4a1c1c8 commit 25a2530
Show file tree
Hide file tree
Showing 174 changed files with 1,737 additions and 509 deletions.
11 changes: 9 additions & 2 deletions _maps/map_files/NebulaStation/NebulaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -23929,6 +23929,13 @@
/obj/effect/turf_decal/delivery,
/turf/open/floor/iron/dark,
/area/station/command/teleporter)
"dAP" = (
/obj/effect/turf_decal/delivery,
/obj/machinery/mecha_part_fabricator{
drop_direction = 1
},
/turf/open/floor/iron/dark,
/area/station/science/robotics/lab)
"dAT" = (
/obj/effect/spawner/random/entertainment/toy_figure{
pixel_y = 37;
Expand Down Expand Up @@ -141153,7 +141160,7 @@
/area/station/hallway/primary/central)
"uYT" = (
/obj/machinery/mecha_part_fabricator{
dir = 1
drop_direction = 1
},
/obj/effect/turf_decal/delivery,
/turf/open/floor/iron/dark,
Expand Down Expand Up @@ -263701,7 +263708,7 @@ juD
iZk
vqW
jyY
uYT
dAP
xGM
mVH
xGM
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
#define COMSIG_LIVING_SLAM_TABLE "living_slam_table"
///from /obj/item/hand_item/slapper/attack(): (source=mob/living/slapper, mob/living/slapped)
#define COMSIG_LIVING_SLAP_MOB "living_slap_mob"
///from /obj/item/hand_item/slapper/attack(): (source=mob/living/slapper, mob/living/slapped)
#define COMSIG_LIVING_SLAPPED "living_slapped"
/// from /mob/living/*/UnarmedAttack(), before sending [COMSIG_LIVING_UNARMED_ATTACK]: (mob/living/source, atom/target, proximity, modifiers)
/// The only reason this exists is so hulk can fire before Fists of the North Star.
/// Note that this is called before [/mob/living/proc/can_unarmed_attack] is called, so be wary of that.
Expand Down Expand Up @@ -288,6 +290,8 @@

///From mob/living/carbon/proc/throw_mode_on and throw_mode_off
#define COMSIG_LIVING_THROW_MODE_TOGGLE "living_throw_mode_toggle"
/// From mob/living/proc/on_fall
#define COMSIG_LIVING_THUD "living_thud"
///From /datum/component/happiness()
#define COMSIG_MOB_HAPPINESS_CHANGE "happiness_change"
/// From /obj/item/melee/baton/baton_effect(): (datum/source, mob/living/user, /obj/item/melee/baton)
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/dcs/signals/signals_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@
///sent to targets during the process_hit proc of projectiles
#define COMSIG_PROJECTILE_PREHIT "com_proj_prehit"
#define PROJECTILE_INTERRUPT_HIT (1<<0)
#define PROJECTILE_INTERRUPT_HIT_PHASE (1<<1)
///from /obj/projectile/process_movement(): ()
#define COMSIG_PROJECTILE_MOVE_PROCESS_STEP "projectile_move_process_step"
///sent to self during the process_hit proc of projectiles
Expand Down
10 changes: 3 additions & 7 deletions code/__DEFINES/fish.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
///The breeding timeout for newly instantiated fish is multiplied by this.
#define NEW_FISH_BREEDING_TIMEOUT_MULT 2
///The last feeding timestamp of newly instantiated fish is multiplied by this: ergo, they spawn 50% hungry.
#define NEW_FISH_LAST_FEEDING_MULT 0.5
#define NEW_FISH_LAST_FEEDING_MULT 0.33

//IF YOU ADD ANY NEW FLAG, ADD IT TO THE RESPECTIVE BITFIELD in _globalvars/bitfields.dm TOO!

Expand All @@ -187,7 +187,6 @@
///Flag added when in an aquarium with the right fluid type.
#define FISH_FLAG_SAFE_FLUID (1<<7)


#define MIN_AQUARIUM_TEMP T0C
#define MAX_AQUARIUM_TEMP (T0C + 100)
#define DEFAULT_AQUARIUM_TEMP (T0C + 24)
Expand Down Expand Up @@ -260,11 +259,8 @@
#define FISH_SOURCE_FLAG_EXPLOSIVE_MALUS (1<<0)
/// The fish source is not elegible for random rewards from bluespace fishing rods
#define FISH_SOURCE_FLAG_NO_BLUESPACE_ROD (1<<1)
/**
* If present, fish that can be caught from this source won't be included in the 'fish caught' score, unless
* present in other sources without this flag as well.
*/
#define FISH_SOURCE_FLAG_SKIP_CATCHABLES (1<<2)
/// When examined by someone with enough fishing skill, this will also display fish that doesn't have FISH_FLAG_SHOW_IN_CATALOG
#define FISH_SOURCE_FLAG_IGNORE_HIDDEN_ON_CATALOG (1<<2)

/**
* A macro to ensure the wikimedia filenames of fish icons are unique, especially since there're a couple fish that have
Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ DEFINE_BITFIELD(no_equip_flags, list(
/// The sprite works fine for digitigrade legs as-is.
#define CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON (1<<2)
/// Auto-generates the leg portion of the sprite with GAGS
/// Suggested that you set [/obj/item/var/digitigrade_greyscale_config_worn] when using this flag
#define CLOTHING_DIGITIGRADE_MASK (1<<3)

/// All variation flags which render "correctly" on a digitigrade leg setup
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
#define MOB_PLANT (1 << 10)
///The mob is a goopy creature, probably coming from xenobiology.
#define MOB_SLIME (1 << 11)
/// Mob is fish or water-related.
#define MOB_AQUATIC (1 << 12)

//Lung respiration type flags
#define RESPIRATION_OXYGEN (1 << 0)
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
/// Use in status effect "tick_interval" to prevent it from calling tick()
#define STATUS_EFFECT_NO_TICK -1

/// Indicates this status effect is an abstract type, ie not instantiated
/// Doesn't actually do anything in practice, primarily just a marker / used in unit tests,
/// so don't worry if your abstract status effect doesn't actually set this
#define STATUS_EFFECT_ID_ABSTRACT "abstract"

///Processing flags - used to define the speed at which the status will work
///This is fast - 0.2s between ticks (I believe!)
#define STATUS_EFFECT_FAST_PROCESS 0
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_EMOTEMUTE "emotemute"
#define TRAIT_DEAF "deaf"
#define TRAIT_FAT "fat"
/// Always hungry. They can eat as much as they want without eating slowdown.
#define TRAIT_GLUTTON "glutton"
#define TRAIT_HUSK "husk"
///Blacklisted from being revived via defibrillator
#define TRAIT_DEFIB_BLACKLISTED "defib_blacklisted"
Expand Down Expand Up @@ -507,6 +509,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_USER_SCOPED "user_scoped"
/// Mob is unable to feel pain
#define TRAIT_ANALGESIA "analgesia"
/// Mob does not get a damage overlay from brute/burn
#define TRAIT_NO_DAMAGE_OVERLAY "no_damage_overlay"
/// Mob has a scar on their left/right eye
#define TRAIT_RIGHT_EYE_SCAR "right_eye_scar"
#define TRAIT_LEFT_EYE_SCAR "left_eye_scar"
Expand Down
3 changes: 3 additions & 0 deletions code/__HELPERS/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
/proc/cmp_name_dsc(atom/a, atom/b)
return sorttext(a.name, b.name)

/proc/cmp_init_name_asc(atom/a, atom/b)
return sorttext(initial(b.name), initial(a.name))

/proc/cmp_records_asc(datum/record/a, datum/record/b)
return sorttext(b.name, a.name)

Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_FAST_CUFFING" = TRAIT_FAST_CUFFING,
"TRAIT_FAST_TYING" = TRAIT_FAST_TYING,
"TRAIT_FAT" = TRAIT_FAT,
"TRAIT_GLUTTON" = TRAIT_GLUTTON,
"TRAIT_FEARLESS" = TRAIT_FEARLESS,
"TRAIT_FENCE_CLIMBER" = TRAIT_FENCE_CLIMBER,
"TRAIT_FINGERPRINT_PASSTHROUGH" = TRAIT_FINGERPRINT_PASSTHROUGH,
Expand Down Expand Up @@ -380,6 +381,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NOSOFTCRIT" = TRAIT_NOSOFTCRIT,
"TRAIT_NO_AUGMENTS" = TRAIT_NO_AUGMENTS,
"TRAIT_NO_BLOOD_OVERLAY" = TRAIT_NO_BLOOD_OVERLAY,
"TRAIT_NO_DAMAGE_OVERLAY" = TRAIT_NO_DAMAGE_OVERLAY,
"TRAIT_NO_DEBRAIN_OVERLAY" = TRAIT_NO_DEBRAIN_OVERLAY,
"TRAIT_NO_DNA_COPY" = TRAIT_NO_DNA_COPY,
"TRAIT_NO_DNA_SCRAMBLE" = TRAIT_NO_DNA_SCRAMBLE,
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/admin_tooling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list(
"TRAIT_FAST_CUFFING" = TRAIT_FAST_CUFFING,
"TRAIT_FAST_TYING" = TRAIT_FAST_TYING,
"TRAIT_FAT" = TRAIT_FAT,
"TRAIT_GLUTTON" = TRAIT_GLUTTON,
"TRAIT_FEARLESS" = TRAIT_FEARLESS,
"TRAIT_FENCE_CLIMBER" = TRAIT_FENCE_CLIMBER,
"TRAIT_FISH_EATER" = TRAIT_FISH_EATER,
Expand Down
4 changes: 4 additions & 0 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,10 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/splash)
state = HUNGER_STATE_FAT
return

if(HAS_TRAIT(hungry, TRAIT_GLUTTON))
state = HUNGER_STATE_HUNGRY // Can't get enough
return

switch(hungry.nutrition)
if(NUTRITION_LEVEL_FULL to INFINITY)
state = HUNGER_STATE_FULL
Expand Down
45 changes: 24 additions & 21 deletions code/controllers/subsystem/processing/fishing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ PROCESSING_SUBSYSTEM_DEF(fishing)
cached_fish_icons = list()
cached_unknown_fish_icons = list()
fish_properties = list()
catchable_fish = list()

var/icon/questionmark = icon('icons/effects/random_spawners.dmi', "questionmark")
var/list/mark_dimension = get_icon_dimensions(questionmark)
for(var/obj/item/fish/fish_type as anything in subtypesof(/obj/item/fish))
var/list/spawned_fish = list()
var/list/fish_subtypes = sortTim(subtypesof(/obj/item/fish), GLOBAL_PROC_REF(cmp_init_name_asc))
for(var/obj/item/fish/fish_type as anything in fish_subtypes)
var/list/fish_dimensions = get_icon_dimensions(fish_type::icon)
var/icon/fish_icon = icon(fish_type::icon, fish_type::icon_state, frame = 1, moving = FALSE)
cached_fish_icons[fish_type] = icon2base64(fish_icon)
Expand All @@ -35,6 +38,7 @@ PROCESSING_SUBSYSTEM_DEF(fishing)
cached_unknown_fish_icons[fish_type] = icon2base64(unknown_icon)

var/obj/item/fish/fish = new fish_type(null, FALSE)
spawned_fish += fish
var/list/properties = list()
fish_properties[fish_type] = properties
properties[FISH_PROPERTIES_FAV_BAIT] = fish.favorite_bait.Copy()
Expand Down Expand Up @@ -67,36 +71,35 @@ PROCESSING_SUBSYSTEM_DEF(fishing)

properties[FISH_PROPERTIES_BEAUTY_SCORE] = beauty_score

qdel(fish)

catchable_fish = list()
var/list/all_catchables = list()
for(var/source_type as anything in GLOB.preset_fish_sources)
var/datum/fish_source/source = GLOB.preset_fish_sources[source_type]
if(!(source.fish_source_flags & FISH_SOURCE_FLAG_SKIP_CATCHABLES))
all_catchables |= source.fish_table
for(var/thing in all_catchables)
if(!ispath(thing, /obj/item/fish))
continue
var/obj/item/fish/fishie = thing
var/fish_id = initial(fishie.fish_id)
var/fish_id
if(fish.fish_id_redirect_path)
var/obj/item/fish/other_path = fish.fish_id_redirect_path
if(!ispath(other_path, /obj/item/fish))
stack_trace("[fish.type] has a set 'fish_id_redirect_path' variable but it isn't a fish path but [other_path]")
continue
fish_id = initial(other_path.fish_id)
else
fish_id = fish.fish_id
if(!fish_id)
stack_trace("[fishie] doesn't have a set 'fish_id' variable despite being a catchable fish")
stack_trace("[fish.type] doesn't have a set 'fish_id' variable despite being a catchable fish")
continue
if(fish.fish_id_redirect_path)
continue
if(catchable_fish[fish_id])
stack_trace("[fishie] has a 'fish_id' value already assigned to [catchable_fish[fish_id]]. fish_id: [fish_id]")
stack_trace("[fish.type] has a 'fish_id' value already assigned to [catchable_fish[fish_id]]. fish_id: [fish_id]")
continue
catchable_fish[fish_id] = fishie
catchable_fish[fish_id] = fish.type

///init the list of things lures can catch
lure_catchables = list()
var/list/fish_types = subtypesof(/obj/item/fish)
for(var/lure_type in typesof(/obj/item/fishing_lure))
var/obj/item/fishing_lure/lure = new lure_type
lure_catchables[lure_type] = list()
for(var/obj/item/fish/fish_type as anything in fish_types)
if(lure.is_catchable_fish(fish_type, fish_properties[fish_type]))
lure_catchables[lure_type] += fish_type
for(var/obj/item/fish/fish as anything in spawned_fish)
if(lure.is_catchable_fish(fish, fish_properties[fish.type]))
lure_catchables[lure_type] += fish.type
qdel(lure)

QDEL_LIST(spawned_fish)

return SS_INIT_SUCCESS
7 changes: 7 additions & 0 deletions code/controllers/subsystem/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,13 @@ SUBSYSTEM_DEF(shuttle)

return TRUE

/**
* Calls the emergency shuttle.
*
* Arguments:
* * user - The mob that called the shuttle.
* * call_reason - The reason the shuttle was called, which should be non-html-encoded text.
*/
/datum/controller/subsystem/shuttle/proc/requestEvac(mob/user, call_reason)
if (!check_backup_emergency_shuttle())
return
Expand Down
12 changes: 6 additions & 6 deletions code/datums/components/_component.dm
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,13 @@
for(var/component_key in dc)
var/component_or_list = dc[component_key]
if(islist(component_or_list))
for(var/datum/component/I in component_or_list)
if(I.can_transfer)
target.TakeComponent(I)
for(var/datum/component/component in component_or_list)
if(component.can_transfer)
target.TakeComponent(component)
else
var/datum/component/C = component_or_list
if(C.can_transfer)
target.TakeComponent(C)
var/datum/component/component = component_or_list
if(!QDELETED(component) && component.can_transfer)
target.TakeComponent(component)

/**
* Return the object that is the host of any UI's that this component has
Expand Down
41 changes: 37 additions & 4 deletions code/datums/components/aquarium.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@
RegisterSignal(movable, COMSIG_ATOM_UI_INTERACT, PROC_REF(interact))

movable.AddElement(/datum/element/relay_attackers)
movable.AddComponent(/datum/component/fishing_spot, /datum/fish_source/aquarium)


movable.flags_1 |= HAS_CONTEXTUAL_SCREENTIPS_1
RegisterSignal(movable, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, PROC_REF(on_requesting_context_from_item))

for(var/atom/movable/content as anything in movable.contents)
if(content.flags_1 & INITIALIZED_1)
Expand All @@ -143,13 +148,15 @@
COMSIG_ATOM_ATTACK_ROBOT_SECONDARY,
COMSIG_ATOM_ATTACK_HAND_SECONDARY,
COMSIG_ATOM_UI_INTERACT,
COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM,
))
if(movable.reagents)
UnregisterSignal(movable, COMSIG_REAGENTS_NEW_REAGENT)
STOP_PROCESSING(SSobj, src)
beauty_by_content = null
tracked_fish_by_type = null
movable.remove_traits(list(TRAIT_IS_AQUARIUM, TRAIT_AQUARIUM_PANEL_OPEN, TRAIT_STOP_FISH_REPRODUCTION_AND_GROWTH), AQUARIUM_TRAIT)
qdel(movable.GetComponent(/datum/component/fishing_spot))
REMOVE_KEEP_TOGETHER(movable, AQUARIUM_TRAIT)

/datum/component/aquarium/PreTransfer(atom/movable/new_parent)
Expand Down Expand Up @@ -214,7 +221,7 @@
source.balloon_alert(user, "fed the fish")
return ITEM_INTERACT_SUCCESS

if(!HAS_TRAIT(item, TRAIT_AQUARIUM_CONTENT))
if(!HAS_TRAIT(item, TRAIT_AQUARIUM_CONTENT) || (!isitem(parent) && user.combat_mode))
return //proceed with normal interactions

var/broken = source.get_integrity_percentage() <= source.integrity_failure
Expand All @@ -238,6 +245,10 @@

///Feed the fish at defined intervals until the feed storage is empty.
/datum/component/aquarium/process(seconds_per_tick)
//safe mode, no need to feed the fishes
if(HAS_TRAIT_FROM(parent, TRAIT_STOP_FISH_REPRODUCTION_AND_GROWTH, AQUARIUM_TRAIT))
last_feeding += seconds_per_tick SECONDS
return
var/atom/movable/movable = parent
if(!movable.reagents?.total_volume)
if(movable.reagents)
Expand All @@ -253,6 +264,7 @@
/datum/component/aquarium/proc/on_plunger_act(atom/movable/source, obj/item/plunger/plunger, mob/living/user, reinforced)
SIGNAL_HANDLER
if(!HAS_TRAIT(source, TRAIT_AQUARIUM_PANEL_OPEN))
source.balloon_alert(user, "open panel first!")
return
INVOKE_ASYNC(src, PROC_REF(do_plunging), source, user)
return COMPONENT_NO_AFTERATTACK
Expand Down Expand Up @@ -461,7 +473,7 @@
var/atom/movable/aquarium = parent
.["fluidType"] = fluid_type
.["temperature"] = fluid_temp
.["allowBreeding"] = HAS_TRAIT_FROM(aquarium, TRAIT_STOP_FISH_REPRODUCTION_AND_GROWTH, AQUARIUM_TRAIT)
.["safe_mode"] = !HAS_TRAIT_FROM(aquarium, TRAIT_STOP_FISH_REPRODUCTION_AND_GROWTH, AQUARIUM_TRAIT)
.["fishData"] = list()
.["feedingInterval"] = feeding_interval / (1 MINUTES)
.["propData"] = list()
Expand Down Expand Up @@ -510,8 +522,8 @@
if(params["fluid"] != fluid_type && (params["fluid"] in fluid_types))
set_fluid_type(params["fluid"])
. = TRUE
if("allow_breeding")
if(HAS_TRAIT(movable, TRAIT_STOP_FISH_REPRODUCTION_AND_GROWTH))
if("safe_mode")
if(HAS_TRAIT_FROM(movable, TRAIT_STOP_FISH_REPRODUCTION_AND_GROWTH, AQUARIUM_TRAIT))
REMOVE_TRAIT(movable, TRAIT_STOP_FISH_REPRODUCTION_AND_GROWTH, AQUARIUM_TRAIT)
else
ADD_TRAIT(movable, TRAIT_STOP_FISH_REPRODUCTION_AND_GROWTH, AQUARIUM_TRAIT)
Expand Down Expand Up @@ -561,5 +573,26 @@
else if(dead_fish > 0)
user.add_mood_event("aquarium", morb ? /datum/mood_event/morbid_aquarium_good : /datum/mood_event/aquarium_negative)

/datum/component/aquarium/proc/on_requesting_context_from_item(atom/source, list/context, obj/item/held_item, mob/user)
SIGNAL_HANDLER
var/open_panel = HAS_TRAIT(source, TRAIT_AQUARIUM_PANEL_OPEN)
if(!held_item)
var/isitem = isitem(source)
if(!isitem || open_panel)
context[SCREENTIP_CONTEXT_LMB] = open_panel ? "Adjust settings" : "Admire"
if(isitem)
context[SCREENTIP_CONTEXT_RMB] = "Admire"
context[SCREENTIP_CONTEXT_ALT_LMB] = "[open_panel ? "Open" : "Close"] settings panel"
return CONTEXTUAL_SCREENTIP_SET
if(istype(held_item, /obj/item/plunger))
context[SCREENTIP_CONTEXT_LMB] = "Empty feed storage"
return CONTEXTUAL_SCREENTIP_SET
if(istype(held_item, /obj/item/reagent_containers/cup/fish_feed) && (!source.reagents || !open_panel))
context[SCREENTIP_CONTEXT_LMB] = "Feed fishes"
return CONTEXTUAL_SCREENTIP_SET
if(HAS_TRAIT(held_item, TRAIT_AQUARIUM_CONTENT))
context[SCREENTIP_CONTEXT_LMB] = "Insert in aquarium"
return CONTEXTUAL_SCREENTIP_SET

#undef MIN_AQUARIUM_BEAUTY
#undef MAX_AQUARIUM_BEAUTY
Loading

0 comments on commit 25a2530

Please sign in to comment.