Skip to content

Commit

Permalink
Scratches random things off the TODO list (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMelbert authored Jul 13, 2024
1 parent 5318e2a commit 4d32fa9
Show file tree
Hide file tree
Showing 28 changed files with 252 additions and 103 deletions.
2 changes: 1 addition & 1 deletion _maps/shuttles/emergency_lima.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@
/area/shuttle/escape)
"VZ" = (
/obj/structure/table/reinforced,
/obj/item/clothing/gloves/color/latex,
/obj/item/clothing/gloves/latex,
/obj/item/clothing/mask/surgical,
/obj/item/healthanalyzer,
/turf/open/floor/mineral/titanium/white,
Expand Down
2 changes: 0 additions & 2 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#define COMSIG_ORGAN_BEING_REPLACED "organ_being_replaced"
/// Called when an organ gets surgically removed (mob/living/user, mob/living/carbon/old_owner, target_zone, obj/item/tool)
#define COMSIG_ORGAN_SURGICALLY_REMOVED "organ_surgically_removed"
/// Called when using the *wag emote
#define COMSIG_ORGAN_WAG_TAIL "wag_tail"

///from base of mob/update_transform()
#define COMSIG_LIVING_POST_UPDATE_TRANSFORM "living_post_update_transform"
Expand Down
2 changes: 2 additions & 0 deletions code/__HELPERS/radiation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
return

/obj/item/make_irradiated(can_propogate)
if(anchored)
return
AddElement(/datum/element/simple_rad)

/mob/living/carbon/human/make_irradiated(can_propogate)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/mood_events/generic_negative_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@

/datum/mood_event/table/add_effects()
if(isfelinid(owner)) //Holy snowflake batman!
var/mob/living/carbon/human/H = owner
SEND_SIGNAL(H, COMSIG_ORGAN_WAG_TAIL, TRUE, 3 SECONDS)
var/mob/living/carbon/human/feline = owner
feline.wag_tail(3 SECONDS)
description = "They want to play on the table!"
mood_change = 2

Expand Down
2 changes: 1 addition & 1 deletion code/datums/mutations/hulk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
return COMPONENT_CANCEL_ATTACK_CHAIN

/datum/mutation/human/hulk/proc/scream_attack(mob/living/carbon/human/source)
source.say("WAAAAAAAAAAAAAAGH!", forced="hulk")
source.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ), forced = "hulk")

/**
*Checks damage of a hulk's arm and applies bone wounds as necessary.
Expand Down
14 changes: 7 additions & 7 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1023,21 +1023,21 @@
if(registered_name && registered_name != "Captain")
. += mutable_appearance(icon, assigned_icon_state)

var/trim_icon_file = trim_icon_override ? trim_icon_override : trim?.trim_icon
var/trim_icon_state = trim_state_override ? trim_state_override : trim?.trim_state
var/trim_department_color = department_color_override ? department_color_override : trim?.department_color
var/trim_department_state = department_state_override ? department_state_override : trim?.department_state
var/trim_subdepartment_color = subdepartment_color_override ? subdepartment_color_override : trim?.subdepartment_color
var/trim_icon_file = trim_icon_override || trim?.trim_icon
var/trim_icon_state = trim_state_override || trim?.trim_state
var/trim_department_color = department_color_override || trim?.department_color
var/trim_department_state = department_state_override || trim?.department_state
var/trim_subdepartment_color = subdepartment_color_override || trim?.subdepartment_color

if(!trim_icon_file || !trim_icon_state || !trim_department_color || !trim_subdepartment_color || !trim_department_state)
return

/// We handle department and subdepartment overlays first, so the job icon is always on top.
var/mutable_appearance/department_overlay = mutable_appearance(trim_icon_file, trim_department_state)
var/mutable_appearance/department_overlay = mutable_appearance('icons/obj/card.dmi', trim_department_state)
department_overlay.color = trim_department_color
. += department_overlay

var/mutable_appearance/subdepartment_overlay = mutable_appearance(trim_icon_file, "subdepartment")
var/mutable_appearance/subdepartment_overlay = mutable_appearance('icons/obj/card.dmi', "subdepartment")
subdepartment_overlay.color = trim_subdepartment_color
. += subdepartment_overlay

Expand Down
9 changes: 8 additions & 1 deletion code/game/objects/items/cigs_lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,16 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/cigbutt/equipped(mob/user, slot, initial)
// Lazily initing these components because there's no need to do it for every single cigarette butt
AddComponent(/datum/component/knockoff, 90, list(BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_HEAD, BODY_ZONE_CHEST), slot_flags)
AddComponent(/datum/component/wearertargeting/knockoff_move, 1, list(slot_flags), "falls out of your mouth!")
AddComponent(/datum/component/wearertargeting/knockoff_move, 1, list(slot_flags), CALLBACK(src, PROC_REF(on_fall)))
return ..()

/obj/item/cigbutt/proc/on_fall(mob/living/guy)
guy.visible_message(
span_warning("[src] falls out [guy]'s mouth."),
span_warning("[src] falls out of your mouth."),
visible_message_flags = ALWAYS_SHOW_SELF_MESSAGE,
)

/obj/item/cigbutt/cigarbutt
name = "cigar butt"
desc = "A manky old cigar butt."
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/hand_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@
/obj/item/hand_item/slapper/attack(mob/living/slapped, mob/living/carbon/human/user)
SEND_SIGNAL(user, COMSIG_LIVING_SLAP_MOB, slapped)

if(ishuman(slapped))
var/mob/living/carbon/human/human_slapped = slapped
SEND_SIGNAL(human_slapped, COMSIG_ORGAN_WAG_TAIL, FALSE)
if(iscarbon(slapped))
var/mob/living/carbon/potential_tailed = slapped
potential_tailed.unwag_tail()
user.do_attack_animation(slapped)

var/slap_volume = 50
Expand Down
21 changes: 20 additions & 1 deletion code/game/objects/structures/crates_lockers/closets/bodybag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
QDEL_NULL(foldedbag_instance)
return ..()

/obj/structure/closet/body_bag/attackby(obj/item/interact_tool, mob/user, params)
/obj/structure/closet/body_bag/attackby(obj/item/interact_tool, mob/living/user, params)
if (istype(interact_tool, /obj/item/pen) || istype(interact_tool, /obj/item/toy/crayon))
if(!user.can_write(interact_tool))
return
Expand All @@ -59,11 +59,14 @@
return
handle_tag("[t ? t : initial(name)]")
return
else if(!user.combat_mode && !(interact_tool.item_flags & (ABSTRACT|HAND_ITEM)) && user.transferItemToLoc(interact_tool, loc, silent = FALSE))
return
if(!tag_name)
return
if(interact_tool.tool_behaviour == TOOL_WIRECUTTER || interact_tool.get_sharpness())
to_chat(user, span_notice("You cut the tag off [src]."))
handle_tag()
return

///Handles renaming of the bodybag's examine tag.
/obj/structure/closet/body_bag/proc/handle_tag(new_name)
Expand Down Expand Up @@ -487,6 +490,14 @@

/obj/structure/closet/body_bag/environmental/stasis/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs)
. = ..()
if(isinternalorgan(arrived))
var/obj/item/organ/organ_arrived = arrived
organ_arrived.organ_flags |= ORGAN_FROZEN
return
if(isbodypart(arrived))
for(var/obj/item/organ/internal/organ in arrived)
organ.organ_flags |= ORGAN_FROZEN
return
if(!isliving(arrived))
return
if(seconds_freezing != -1)
Expand All @@ -495,6 +506,14 @@

/obj/structure/closet/body_bag/environmental/stasis/Exited(atom/movable/gone, direction)
. = ..()
if(isinternalorgan(gone))
var/obj/item/organ/organ_gone = gone
organ_gone.organ_flags &= ~ORGAN_FROZEN
return
if(isbodypart(gone))
for(var/obj/item/organ/internal/organ in gone)
organ.organ_flags &= ~ORGAN_FROZEN
return
if(!isliving(gone))
return
seconds_freezing = -1
Expand Down
25 changes: 25 additions & 0 deletions code/game/objects/structures/morgue.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
if(connected)
connected = new connected(src)
connected.connected = src
connected.RegisterSignal(src, COMSIG_CLICK, TYPE_PROC_REF(/obj/structure/tray, redirect_click))
GLOB.bodycontainers += src
register_context()

Expand Down Expand Up @@ -559,6 +560,20 @@ GLOBAL_LIST_EMPTY(crematoriums)
to_chat(user, span_warning("That's not connected to anything!"))
add_fingerprint(user)

// Registered on our connected bodycontainer, so if we click it we redirect to click this
/obj/structure/tray/proc/redirect_click(datum/source, location, control, params, mob/clicker)
SIGNAL_HANDLER
ASSERT(source == connected)
if(!isliving(clicker) \
|| loc == connected \
|| clicker.get_active_held_item() \
|| !clicker.CanReach(src) \
|| clicker.CanReach(connected) \
)
return

INVOKE_ASYNC(clicker, TYPE_PROC_REF(/mob, ClickOn), src, params)

/obj/structure/tray/attackby(obj/P, mob/user, params)
if(!istype(P, /obj/item/riding_offhand))
return ..()
Expand Down Expand Up @@ -618,5 +633,15 @@ GLOBAL_LIST_EMPTY(crematoriums)
if(locate(/obj/structure/table) in get_turf(mover))
return TRUE

/obj/structure/tray/m_tray/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking)
. = ..()
if(. & ITEM_INTERACT_ANY_BLOCKER)
return
if(user.combat_mode)
return
if(tool.item_flags & (ABSTRACT|HAND_ITEM))
return
return user.transferItemToLoc(tool, loc, silent = FALSE) ? ITEM_INTERACT_SUCCESS : ITEM_INTERACT_BLOCKING

#undef BREAKOUT_COOLDOWN
#undef BREAKDOWN_TIME
17 changes: 17 additions & 0 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1446,3 +1446,20 @@
if(item && ((item in organs) || (item in bodyparts))) //let's not do this, aight?
return FALSE
return ..()

/// Helper to cleanly trigger tail wagging
/// Accepts an optional timeout after which we remove the tail wagging
/// Returns true if successful, false otherwise
/mob/living/carbon/proc/wag_tail(timeout = INFINITY)
var/obj/item/organ/external/tail/wagged = get_organ_slot(ORGAN_SLOT_EXTERNAL_TAIL)
if(!wagged)
return FALSE
return wagged.start_wag(src, timeout)

/// Helper to cleanly stop all tail wagging
/// Returns true if successful, false otherwise
/mob/living/carbon/proc/unwag_tail() // can't unwag a tail
var/obj/item/organ/external/tail/unwagged = get_organ_slot(ORGAN_SLOT_EXTERNAL_TAIL)
if(!unwagged)
return FALSE
return unwagged.stop_wag(src)
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
/datum/species/proc/clear_tail_moodlets(mob/living/carbon/human/former_tail_owner)
former_tail_owner.clear_mood_event("tail_lost")
former_tail_owner.clear_mood_event("tail_balance_lost")
former_tail_owner.clear_mood_event("wrong_tail_regained")
former_tail_owner.clear_mood_event("tail_regained")

/// Returns a list of strings representing features this species has.
/// Used by the preferences UI to know what buttons to show.
Expand Down
37 changes: 35 additions & 2 deletions code/modules/mob/living/carbon/human/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@
if(!.)
return
var/obj/item/organ/external/tail/oranges_accessory = user.get_organ_slot(ORGAN_SLOT_EXTERNAL_TAIL)
//I am so sorry my son
//We bypass helpers here cause we already have the tail
if(oranges_accessory.wag_flags & WAG_WAGGING) //We verified the tail exists in can_run_emote()
SEND_SIGNAL(user, COMSIG_ORGAN_WAG_TAIL, FALSE)
oranges_accessory.stop_wag(user)
else
SEND_SIGNAL(user, COMSIG_ORGAN_WAG_TAIL, TRUE)
oranges_accessory.start_wag(user)

/datum/emote/living/carbon/human/wag/select_message_type(mob/user, intentional)
. = ..()
Expand All @@ -141,6 +143,25 @@
return ..()
return FALSE

/datum/emote/living/carbon/human/wag_swish
key = "swish"
key_third_person = "swishes"
message = "swishes their tail."

/datum/emote/living/carbon/human/wag_swish/run_emote(mob/user, params, type_override, intentional)
. = ..()
if(!.)
return
var/obj/item/organ/external/tail/tail = user.get_organ_slot(ORGAN_SLOT_EXTERNAL_TAIL)
if(tail?.wag_flags & WAG_ABLE)
tail.start_wag(user, 1 SECONDS)

/datum/emote/living/carbon/human/wag_swish/can_run_emote(mob/user, status_check, intentional)
var/obj/item/organ/external/tail/tail = user.get_organ_slot(ORGAN_SLOT_EXTERNAL_TAIL)
if(tail?.wag_flags & WAG_ABLE)
return ..()
return FALSE

/datum/emote/living/carbon/human/wing
key = "wing"
key_third_person = "wings"
Expand Down Expand Up @@ -173,6 +194,18 @@
key_third_person = "clears throat"
message = "clears their throat."

/datum/emote/living/carbon/human/hiss
key = "hiss"
key_third_person = "hisses"
message = "hisses."
message_mime = "hisses silently."
emote_type = EMOTE_AUDIBLE

/datum/emote/living/carbon/human/hiss/get_sound(mob/user)
if(islizard(user))
return pick(user.get_speech_sounds())
return null

///Snowflake emotes only for le epic chimp
/datum/emote/living/carbon/human/monkey

Expand Down
Loading

0 comments on commit 4d32fa9

Please sign in to comment.