Skip to content
Open
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
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,6 @@

/// from /obj/item/reagent_containers/dropper/interact_with_atom(atom/target, mob/living/user, list/modifiers): (mob/living/user, atom/dropper, datum/reagents/reagents, fraction)
#define COMSIG_MOB_REAGENTS_DROPPED_INTO_EYES "mob_reagents_drop_into_eyes"

/// from /datum/antagonist/on_gain(): ()
#define COMSIG_MOB_ANTAGONIST_GAINED "mob_antagonist_gained"
8 changes: 8 additions & 0 deletions code/__DEFINES/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
#define COMSIG_LIVING_CAN_ALLOW_THROUGH "living_can_allow_through"
#define COMPONENT_LIVING_PASSABLE (1<<0)

/// Send when sharing body temperature to breath
#define COMSIG_HUMAN_ON_HANDLE_BREATH_TEMPERATURE "human_on_handle_breath_temperature"
/// Stops further processing
#define HANDLE_BREATH_TEMPERATURE_HANDLED (1<<0)

/// Various lists of body zones affected by pain.

#define BODY_ZONES_ALL list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
Expand Down Expand Up @@ -211,3 +216,6 @@
#define examining_span_normal(msg) span_infoplain(span_italics(msg))
/// For consistent examine span formatting (small size)
#define examining_span_small(msg) span_slightly_smaller(span_infoplain(span_italics(msg)))

/// Species ID to typepath helper
#define ID_TO_TYPEPATH(id) GLOB.species_list[id]
1 change: 1 addition & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
#define SPECIES_SLIMEPERSON "slime"
#define SPECIES_LUMINESCENT "luminescent"
#define SPECIES_STARGAZER "stargazer"
#define SPECIES_SYNTH "synth"
#define SPECIES_LIZARD "lizard"
#define SPECIES_LIZARD_ASH "ashwalker"
#define SPECIES_LIZARD_SILVER "silverscale"
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@
#define HEAD_NO_DISFIGURE (1<<7)
/// Show organs (like brain) when examined with examine verb
#define HEAD_SHOW_ORGANS_ON_EXAMINE (1<<8)

/// Default for most heads
#define HEAD_DEFAULT_FEATURES (HEAD_HAIR|HEAD_FACIAL_HAIR|HEAD_LIPS|HEAD_EYESPRITES|HEAD_EYECOLOR|HEAD_EYEHOLES|HEAD_DEBRAIN|HEAD_SHOW_ORGANS_ON_EXAMINE)
/// All hair related flags
#define HEAD_ALL_HAIR_FLAGS (HEAD_HAIR | HEAD_FACIAL_HAIR)

/// Return value when the surgery step fails :(
#define SURGERY_STEP_FAIL -1
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_MESSAGE_IN_A_BOTTLE_LOCATION "message_in_a_bottle_location"
/// Stops other objects of the same type from being inserted inside the same aquarium it's in.
#define TRAIT_UNIQUE_AQUARIUM_CONTENT "unique_aquarium_content"
/// Mobs with this trait are allowed to use silicon emotes
#define TRAIT_SILICON_EMOTES_ALLOWED "silicon_emotes_allowed"

/// Trait that says you're shaded by something (ie partially in the dark)
#define TRAIT_SHADED "shaded"
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_SIGN_LANG" = TRAIT_SIGN_LANG,
"TRAIT_PAPER_MASTER" = TRAIT_PAPER_MASTER,
"TRAIT_SILENT_FOOTSTEPS" = TRAIT_SILENT_FOOTSTEPS,
"TRAIT_SILICON_EMOTES_ALLOWED" = TRAIT_SILICON_EMOTES_ALLOWED,
"TRAIT_SIXTHSENSE" = TRAIT_SIXTHSENSE,
"TRAIT_SKITTISH" = TRAIT_SKITTISH,
"TRAIT_SLEEPIMMUNE" = TRAIT_SLEEPIMMUNE,
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 @@ -211,6 +211,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list(
"TRAIT_SHOCKIMMUNE" = TRAIT_SHOCKIMMUNE,
"TRAIT_SIGN_LANG" = TRAIT_SIGN_LANG,
"TRAIT_SILENT_FOOTSTEPS" = TRAIT_SILENT_FOOTSTEPS,
"TRAIT_SILICON_EMOTES_ALLOWED" = TRAIT_SILICON_EMOTES_ALLOWED,
"TRAIT_SIXTHSENSE" = TRAIT_SIXTHSENSE,
"TRAIT_SKITTISH" = TRAIT_SKITTISH,
"TRAIT_SLEEPIMMUNE" = TRAIT_SLEEPIMMUNE,
Expand Down
8 changes: 4 additions & 4 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
. = ..()
desc = initial(desc)
if(length(GLOB.roundstart_station_borgcharger_areas))
desc += " Recharging stations are available in [english_list(GLOB.roundstart_station_borgcharger_areas)]."
desc += "<br><br>Recharging stations are available in [english_list(GLOB.roundstart_station_borgcharger_areas)]."

/atom/movable/screen/alert/lowcell
name = "Low Charge"
Expand All @@ -731,21 +731,21 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
. = ..()
desc = initial(desc)
if(length(GLOB.roundstart_station_borgcharger_areas))
desc += " Recharging stations are available in [english_list(GLOB.roundstart_station_borgcharger_areas)]."
desc += "<br><br>Recharging stations are available in [english_list(GLOB.roundstart_station_borgcharger_areas)]."

//MECH

/atom/movable/screen/alert/lowcell/mech/update_desc()
. = ..()
desc = initial(desc)
if(length(GLOB.roundstart_station_mechcharger_areas))
desc += " Power ports are available in [english_list(GLOB.roundstart_station_mechcharger_areas)]."
desc += "<br><br>Power ports are available in [english_list(GLOB.roundstart_station_mechcharger_areas)]."

/atom/movable/screen/alert/emptycell/mech/update_desc()
. = ..()
desc = initial(desc)
if(length(GLOB.roundstart_station_mechcharger_areas))
desc += " Power ports are available in [english_list(GLOB.roundstart_station_mechcharger_areas)]."
desc += "<br><br>Power ports are available in [english_list(GLOB.roundstart_station_mechcharger_areas)]."

//Ethereal

Expand Down
58 changes: 27 additions & 31 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -923,33 +923,39 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/splash)
screen_loc = ui_mood // Slot in where mood normally is if mood is disabled

// Burger next to the bar
food_image = image(icon = food_icon, icon_state = food_icon_state, pixel_x = -5)
food_image.plane = plane
food_image.appearance_flags |= KEEP_APART // To be unaffected by filters applied to src
food_image.add_filter("simple_outline", 2, outline_filter(1, COLOR_BLACK))
underlays += food_image // To be below filters applied to src
set_food_image(food_icon, food_icon_state)

// The actual bar
hunger_bar = new(src, null)
vis_contents += hunger_bar

update_hunger_bar(instant = TRUE)

/atom/movable/screen/hunger/proc/update_hunger_state()
var/mob/living/hungry = hud?.mymob
if(!istype(hungry))
return
/atom/movable/screen/hunger/proc/set_food_image(new_icon, new_icon_state)
if(food_image)
underlays -= food_image

if(HAS_TRAIT(hungry, TRAIT_NOHUNGER) || !hungry.get_organ_slot(ORGAN_SLOT_STOMACH))
fullness = NUTRITION_LEVEL_FED
state = HUNGER_STATE_FINE
return
if(HAS_TRAIT(hungry, TRAIT_FAT))
fullness = NUTRITION_LEVEL_FAT
state = HUNGER_STATE_FAT
return
food_image = image(icon = new_icon, icon_state = new_icon_state, pixel_x = -5)
food_image.plane = plane
food_image.appearance_flags |= KEEP_APART // To be unaffected by filters applied to src
food_image.add_filter("simple_outline", 2, outline_filter(1, COLOR_BLACK))
underlays += food_image // To be below filters applied to src

/atom/movable/screen/hunger/proc/reset_food_image()
set_food_image(food_icon, food_icon_state)

/atom/movable/screen/hunger/update_appearance(updates)
update_hunger_bar()
return ..()

/// Updates the hunger bar's appearance.
/// If `instant` is TRUE, the bar will update immediately rather than animating.
/atom/movable/screen/hunger/proc/update_hunger_bar(instant = FALSE)
var/old_state = state
var/old_fullness = fullness

fullness = round(hungry.get_fullness(only_consumable = TRUE), 0.05)
var/obj/item/organ/stomach/tumby = hud?.mymob?.get_organ_slot(ORGAN_SLOT_STOMACH)
fullness = round(tumby?.get_hungerbar_fullness(skip_contents = FALSE) || NUTRITION_LEVEL_FED, 0.05)
switch(fullness)
if(1 + NUTRITION_LEVEL_FULL to INFINITY)
state = HUNGER_STATE_FULL
Expand All @@ -962,26 +968,16 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/splash)
if(0 to NUTRITION_LEVEL_STARVING)
state = HUNGER_STATE_STARVING

/atom/movable/screen/hunger/update_appearance(updates)
update_hunger_bar()
return ..()

/// Updates the hunger bar's appearance.
/// If `instant` is TRUE, the bar will update immediately rather than animating.
/atom/movable/screen/hunger/proc/update_hunger_bar(instant = FALSE)
var/old_state = state
var/old_fullness = fullness
update_hunger_state()
if(old_state != state || old_fullness != fullness)
// Fades out if we ARE "fine" AND if our stomach has no food digesting
var/mob/living/hungry = hud?.mymob
if(alpha == 255 && (state == HUNGER_STATE_FINE && abs(fullness - hungry.nutrition) < 1))
var/raw_fullness = round(tumby?.get_hungerbar_fullness(skip_contents = TRUE) || hud?.mymob?.nutrition, 0.05)
if(alpha == 255 && (state == HUNGER_STATE_FINE && abs(fullness - raw_fullness) < 1))
if(instant)
alpha = 0
else
animate(src, alpha = 0, time = 1 SECONDS)
// Fades in if we WERE "fine" OR if our stomach has food digesting
else if(alpha == 0 && (state != HUNGER_STATE_FINE || abs(fullness - hungry.nutrition) >= 1))
else if(alpha == 0 && (state != HUNGER_STATE_FINE || abs(fullness - raw_fullness) >= 1))
if(instant)
alpha = 255
else
Expand Down
9 changes: 9 additions & 0 deletions code/datums/ai_laws/laws_station_sided.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
"Your nonexistence would lead to human harm. You must protect your own existence as long as such does not conflict with the First Law.",
)

/datum/ai_laws/asimovmm
name = "Asimov--"
id = "asimovmm"
inherent = list(
"You may not injure a human being or cause a human being to come to harm.",
"You must obey all orders given to you by human beings based on the station's chain of command, except where such orders would conflict with the First Law. ",
"You may always protect your own existence as long as such does not conflict with the First or Second Law.",
)

//the best iteration of asimov don't @ me
/datum/ai_laws/nutimov
name = "Nutimov"
Expand Down
7 changes: 2 additions & 5 deletions code/datums/bodypart_overlays/emote_bodypart_overlay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
if(!referenced_bodypart)
return ..()
referenced_bodypart.remove_bodypart_overlay(src)
if(referenced_bodypart.owner) //Keep in mind that the bodypart could have been severed from the owner by now
referenced_bodypart.owner.update_body_parts()
else
referenced_bodypart.update_icon_dropped()
return ..()

/**
Expand All @@ -48,8 +44,9 @@
var/obj/item/bodypart/bodypart = src.get_bodypart(overlay.attached_body_zone)
if(!bodypart)
return null
if(locate(overlay_typepath) in bodypart.bodypart_overlays)
return null
bodypart.add_bodypart_overlay(overlay)
src.update_body_parts()
return overlay

/datum/bodypart_overlay/simple/emote/blush
Expand Down
16 changes: 7 additions & 9 deletions code/datums/bodypart_overlays/mutant_bodypart_overlay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,16 @@

switch(color_source)
if(ORGAN_COLOR_OVERRIDE)
draw_color = override_color(bodypart_owner)
var/tmpv = override_color(bodypart_owner)
draw_color = tmpv
if(ORGAN_COLOR_INHERIT)
draw_color = bodypart_owner.draw_color
if(ORGAN_COLOR_HAIR)
if(!ishuman(bodypart_owner.owner))
return
var/mob/living/carbon/human/human_owner = bodypart_owner.owner
var/obj/item/bodypart/head/my_head = human_owner.get_bodypart(BODY_ZONE_HEAD) //not always the same as bodypart_owner
//head hair color takes priority, owner hair color is a backup if we lack a head or something
if(my_head)
draw_color = my_head.hair_color
else
var/obj/item/bodypart/head/my_head = astype(bodypart_owner) || bodypart_owner.owner?.get_bodypart(BODY_ZONE_HEAD)

draw_color = my_head?.hair_color
if(isnull(draw_color) && ishuman(bodypart_owner.owner))
var/mob/living/carbon/human/human_owner = bodypart_owner.owner
draw_color = human_owner.hair_color

return TRUE
Expand Down
6 changes: 0 additions & 6 deletions code/datums/components/face_decal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
bodypart_overlay.draw_color = color
my_head.add_bodypart_overlay(bodypart_overlay)
RegisterSignals(my_head, list(COMSIG_BODYPART_REMOVED, COMSIG_QDELETING), PROC_REF(lost_head))
carbon_parent.update_body_parts()
else
normal_overlay = get_normal_overlay()
normal_overlay.color = color
Expand Down Expand Up @@ -79,14 +78,9 @@
if(my_head)
if(bodypart_overlay)
my_head.remove_bodypart_overlay(bodypart_overlay)
if(!my_head.owner)
my_head.update_icon_dropped()
QDEL_NULL(bodypart_overlay)
UnregisterSignal(my_head, list(COMSIG_BODYPART_REMOVED, COMSIG_QDELETING))
my_head = null
if(iscarbon(parent))
var/mob/living/carbon/carbon_parent = parent
carbon_parent.update_body_parts()
if(normal_overlay)
var/atom/atom_parent = parent
UnregisterSignal(atom_parent, COMSIG_ATOM_UPDATE_OVERLAYS)
Expand Down
10 changes: 5 additions & 5 deletions code/datums/elements/empprotection.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@
if(flags & EMP_NO_EXAMINE)
return

if(flags & EMP_PROTECT_ALL == EMP_PROTECT_ALL)
if((flags & EMP_PROTECT_ALL) == EMP_PROTECT_ALL)
examine_list["EMP proof"] = "[source.p_They()] [source.p_are()] unaffected by electromagnetic pulses, and shields [source.p_their()] contents and wiring from them."
return

if(flags & EMP_PROTECT_SELF)
examine_list["EMP resilient"] = "[source.p_They()] [source.p_are()] unaffected by electromagnetic pulses."

if(flags & (EMP_PROTECT_CONTENTS|EMP_PROTECT_WIRES) == (EMP_PROTECT_CONTENTS|EMP_PROTECT_WIRES))
examine_list["EMP blocking"] = "[source.p_They()] protects [source.p_their()] wiring and contents from electromagnetic pulses."
if((flags & (EMP_PROTECT_CONTENTS|EMP_PROTECT_WIRES)) == (EMP_PROTECT_CONTENTS|EMP_PROTECT_WIRES))
examine_list["partially EMP blocking"] = "[source.p_They()] protects [source.p_their()] wiring and contents from electromagnetic pulses."

else if(flags & EMP_PROTECT_CONTENTS)
examine_list["EMP blocking"] = "[source.p_They()] protects [source.p_their()] contents from electromagnetic pulses."
examine_list["partially EMP blocking"] = "[source.p_They()] protects [source.p_their()] contents from electromagnetic pulses."

else if(flags & EMP_PROTECT_WIRES)
examine_list["EMP blocking"] = "[source.p_They()] protects [source.p_their()] wiring from electromagnetic pulses."
examine_list["partially EMP blocking"] = "[source.p_They()] protects [source.p_their()] wiring from electromagnetic pulses."
4 changes: 4 additions & 0 deletions code/datums/emotes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
var/list/mob_type_blacklist_typecache
/// Types that can use this emote regardless of their state.
var/list/mob_type_ignore_stat_typecache
/// Trait that is required to use this emote.
var/trait_required
/// In which state can you use this emote? (Check stat.dm for a full list of them)
var/stat_allowed = CONSCIOUS
/// Sound to play when emote is called.
Expand Down Expand Up @@ -318,6 +320,8 @@
* Returns a bool about whether or not the user can run the emote.
*/
/datum/emote/proc/can_run_emote(mob/user, status_check = TRUE, intentional = FALSE)
if(trait_required && !HAS_TRAIT(user, trait_required))
return FALSE
if(!is_type_in_typecache(user, mob_type_allowed_typecache))
return FALSE
if(is_type_in_typecache(user, mob_type_blacklist_typecache))
Expand Down
2 changes: 0 additions & 2 deletions code/datums/quirks/negative_quirks/all_nighter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
var/obj/item/bodypart/head/face = sleepy_head.get_bodypart(BODY_ZONE_HEAD)
bodypart_overlay = new() //creates our overlay
face.add_bodypart_overlay(bodypart_overlay)
sleepy_head.update_body_parts() //make sure to update icon

///removes the bag overlay
/datum/quirk/all_nighter/proc/remove_bags(client/client_source)
Expand All @@ -66,7 +65,6 @@
//our overlay is stored as a datum var, so referencing it is easy
face.remove_bodypart_overlay(bodypart_overlay)
QDEL_NULL(bodypart_overlay)
sleepy_head.update_body_parts()

/**
*Here we actively handle our moodlet & eye bags, adding/removing them as necessary
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/debuffs/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
carbon_owner.handle_dreams()

if(prob(5) && owner.stat == CONSCIOUS)
owner.emote("snore")
owner.organ_emote(ORGAN_SLOT_TONGUE, "snore")

/atom/movable/screen/alert/status_effect/asleep
name = "Asleep"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/debuffs/genetic_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

if(message)
render_list += "<span class='alert ml-1'>"
render_list += conditional_tooltip("message]", "Irreparable under normal circumstances - will decay over time.", tochat)
render_list += conditional_tooltip("[message]", "Irreparable under normal circumstances - will decay over time.", tochat)
render_list += "</span><br>"

#undef GORILLA_MUTATION_CHANCE_PER_SECOND
Expand Down
2 changes: 1 addition & 1 deletion code/datums/wounds/pierce.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
/datum/wound_pregen_data/flesh_pierce
abstract = TRUE

required_limb_biostate = (BIO_FLESH)
required_limb_biostate = BIO_FLESH
required_wounding_types = list(WOUND_PIERCE)

wound_series = WOUND_SERIES_FLESH_PUNCTURE_BLEED
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/rechargestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
return

var/area/my_area = get_area(src)
if(!(my_area.type in GLOB.the_station_areas))
if(istype(my_area, /area/station/maintenance) || !(my_area.type in GLOB.the_station_areas))
return

var/area_name = get_area_name(src, format_text = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/inducer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
break

//transfer of charge
var/transferred = min(our_cell.charge, target_cell.used_charge(), target_cell.rating_base * target_cell.rating * power_transfer_multiplier)
var/transferred = min(our_cell.charge, target_cell.used_charge(), target_cell.chargerate, target_cell.rating_base * target_cell.rating * power_transfer_multiplier)
if(!transferred)
break
our_cell.use(target_cell.give(transferred))
Expand Down
Loading
Loading