Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
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
55 changes: 46 additions & 9 deletions code/_onclick/hud/radial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
. = ..()
icon_state = "radial_slice_focus"
if(tooltips)
openToolTip(usr, src, params, title = name)
openToolTip(usr, src, params, title = name, content = desc)

/obj/screen/radial/slice/MouseExited(location, control, params)
. = ..()
Expand Down Expand Up @@ -51,10 +51,16 @@ GLOBAL_LIST_EMPTY(radial_menus)
parent.finished = TRUE

/datum/radial_menu
var/list/choices = list() //List of choice id's
var/list/choices_icons = list() //choice_id -> icon
var/list/choices_values = list() //choice_id -> choice
var/list/page_data = list() //list of choices per page
/// List of choice IDs
var/list/choices = list()
/// choice_id -> icon
var/list/choices_icons = list()
/// choice_id -> choice
var/list/choices_values = list()
/// choice_id -> /datum/radial_menu_choice
var/list/choice_datums = list()
///list of choices per page
var/list/page_data = list()


var/selected_choice
Expand Down Expand Up @@ -164,6 +170,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
E.cut_overlays()
E.alpha = 0
E.name = "None"
E.desc = null
E.maptext = null
E.mouse_opacity = MOUSE_OPACITY_TRANSPARENT
E.choice = null
Expand All @@ -188,21 +195,32 @@ GLOBAL_LIST_EMPTY(radial_menus)
E.alpha = 255
E.mouse_opacity = MOUSE_OPACITY_ICON
E.cut_overlays()
E.vis_contents.Cut()
if(choice_id == NEXT_PAGE_ID)
E.name = "Next Page"
E.desc = null
E.next_page = TRUE
E.add_overlay("radial_next")
else
if(istext(choices_values[choice_id]))
E.name = choices_values[choice_id]
else if(ispath(choices_values[choice_id],/atom))
var/atom/A = choices_values[choice_id]
E.name = initial(A.name)
else
var/atom/movable/AM = choices_values[choice_id] //Movables only
E.name = AM.name

if(choices_icons[choice_id])
E.add_overlay(choices_icons[choice_id])

var/datum/radial_menu_choice/choice_datum = choice_datums[choice_id]
if(choice_datum && istext(choice_datum.info))
E.desc = choice_datum.info

E.choice = choice_id
E.maptext = null
E.next_page = FALSE
if(choices_icons[choice_id])
E.add_overlay(choices_icons[choice_id])

/datum/radial_menu/New()
close_button = new
Expand Down Expand Up @@ -231,11 +249,18 @@ GLOBAL_LIST_EMPTY(radial_menus)
var/I = extract_image(new_choices[E])
if(I)
choices_icons[id] = I

if (istype(new_choices[E], /datum/radial_menu_choice))
choice_datums[id] = new_choices[E]
setup_menu(use_tooltips)


/datum/radial_menu/proc/extract_image(E)
var/mutable_appearance/MA = new /mutable_appearance(E)
/datum/radial_menu/proc/extract_image(to_extract_from)
if (istype(to_extract_from, /datum/radial_menu_choice))
var/datum/radial_menu_choice/choice = to_extract_from
to_extract_from = choice.image

var/mutable_appearance/MA = new /mutable_appearance(to_extract_from)
if(MA)
MA.layer = ABOVE_HUD_LAYER
MA.appearance_flags |= RESET_TRANSFORM
Expand Down Expand Up @@ -315,3 +340,15 @@ GLOBAL_LIST_EMPTY(radial_menus)
if(!menu.custom_check_callback.Invoke())
return
return answer

/// Can be provided to choices in radial menus if you want to provide more information
/datum/radial_menu_choice
/// Required -- what to display for this button
var/image

/// If provided, will display an info button that will put this text in your chat
var/info

/datum/radial_menu_choice/Destroy(force, ...)
. = ..()
QDEL_NULL(image)
4 changes: 3 additions & 1 deletion code/game/objects/items/kitchen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@
AddComponent(/datum/component/butchering, 80 - force, 100, force - 10) //bonus chance increases depending on force

/obj/item/kitchen/knife/attack(mob/living/carbon/M, mob/living/carbon/user)
if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
if(!user.a_intent == INTENT_HARM && attempt_initiate_surgery(src, M, user))
return
else if(user.zone_selected == BODY_ZONE_PRECISE_EYES)
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
M = user
return eyestab(M,user)
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/tools/crowbar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
toolspeed = 1
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 30)

/obj/item/crowbar/attack(mob/living/M, mob/user)
if(user.a_intent == INTENT_HARM || !attempt_initiate_surgery(src, M, user))
..()

/obj/item/crowbar/suicide_act(mob/user)
user.visible_message(span_suicide("[user] is beating [user.p_them()]self to death with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
playsound(loc, 'sound/weapons/genhit.ogg', 50, 1, -1)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/tools/screwdriver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', icon_state)

/obj/item/screwdriver/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!user.a_intent == INTENT_HARM && attempt_initiate_surgery(src, M, user))
return
if(!istype(M))
return ..()
if(user.zone_selected != BODY_ZONE_PRECISE_EYES && user.zone_selected != BODY_ZONE_HEAD)
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/tools/weldingtool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@
dyn_explosion(T, plasmaAmount/5)//20 plasma in a standard welder has a 4 power explosion. no breaches, but enough to kill/dismember holder
qdel(src)

/obj/item/weldingtool/attack(mob/living/M, mob/user)
if(!isOn() || user.a_intent == INTENT_HARM || !attempt_initiate_surgery(src, M, user))
..()

/obj/item/weldingtool/afterattack(atom/O, mob/user, proximity)
. = ..()
if(!proximity)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/tools/wirecutters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
if(do_after(user, 1.5 SECONDS, C))
to_chat(C, span_notice("You succesfuly remove the durathread strand."))
C.remove_status_effect(STATUS_EFFECT_CHOKINGSTRAND)
else if(!user.a_intent == INTENT_HARM && attempt_initiate_surgery(src, C, user))
return
else
..()

Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/items/tools/wrench.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
toolspeed = 1
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 30)

/obj/item/wrench/attack(mob/living/M, mob/user)
if(user.a_intent == INTENT_HARM || !attempt_initiate_surgery(src, M, user))
..()

/obj/item/wrench/suicide_act(mob/user)
user.visible_message(span_suicide("[user] is beating [user.p_them()]self to death with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
playsound(loc, 'sound/weapons/genhit.ogg', 50, 1, -1)
Expand Down
9 changes: 9 additions & 0 deletions code/modules/mob/living/carbon/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@
msg += "[t_He] [t_is] <b>moderately</b> deformed!\n"
else
msg += "<b>[t_He] [t_is] severely deformed!</b>\n"

if(surgeries.len)
var/surgery_text
for(var/datum/surgery/S in surgeries)
if(!surgery_text)
surgery_text = "[t_He] [t_is] being operated on in \the [S.operated_bodypart]"
else
surgery_text += ", [S.operated_bodypart]"
msg += "[surgery_text].\n"

if(HAS_TRAIT(src, TRAIT_DUMB))
msg += "[t_He] seem[p_s()] to be clumsy and unable to think.\n"
Expand Down
10 changes: 9 additions & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,15 @@
msg += "[t_He] [t_has] <b>moderate</b> cellular damage!\n"
else
msg += "<b>[t_He] [t_has] severe cellular damage!</b>\n"


if(surgeries.len)
var/surgery_text
for(var/datum/surgery/S in surgeries)
if(!surgery_text)
surgery_text = "[t_He] [t_is] being operated on in \the [S.operated_bodypart]"
else
surgery_text += ", [S.operated_bodypart]"
msg += "[surgery_text].\n"

if(fire_stacks > 0)
msg += "[t_He] [t_is] covered in something flammable.\n"
Expand Down
1 change: 1 addition & 0 deletions code/modules/surgery/advanced/lobotomy.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/datum/surgery/advanced/lobotomy
name = "Lobotomy"
desc = "An invasive surgical procedure which guarantees removal of almost all brain traumas, but might cause another permanent trauma in return."
icon_state = "lobotomy"
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
Expand Down
1 change: 1 addition & 0 deletions code/modules/surgery/advanced/revival.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/datum/surgery/advanced/revival
name = "Revival"
desc = "An experimental surgical procedure which involves reconstruction and reactivation of the patient's brain even long after death. The body must still be able to sustain life."
icon_state = "revival"
steps = list(/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
/datum/surgery_step/saw,
Expand Down
2 changes: 2 additions & 0 deletions code/modules/surgery/amputation.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

/datum/surgery/amputation
name = "Amputation"
icon_state = "amputation"
desc = "Sever a limb from the torso."
steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/sever_limb)
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG, BODY_ZONE_HEAD)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/surgery/autopsy.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

/datum/surgery/autopsy
name = "Autopsy"
desc = "Tells you what last damaged the patient."
icon = 'icons/obj/surgery.dmi'
icon_state = "scalpel"
steps = list(/datum/surgery_step/incise,
/datum/surgery_step/autopsy)
target_mobtypes = list(/mob/living)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/surgery/brain_surgery.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/datum/surgery/brain_surgery
name = "Brain surgery"
desc = "This procedure cures all severe and basic traumas and reduces brain damage by a large amount. Failing to fix the brain causes hefty brain damage."
icon = 'icons/obj/surgery.dmi'
icon_state = "brain"
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
Expand Down
3 changes: 3 additions & 0 deletions code/modules/surgery/cavity_implant.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/datum/surgery/cavity_implant
name = "Cavity implant"
desc = "Implants or removes an object in the chest. Items up to normal size can be implanted, but tiny and small items won't show what they are in the implanting messages."
icon = 'icons/obj/lighting.dmi'
icon_state = "flashlight"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/retract_skin, /datum/surgery_step/incise, /datum/surgery_step/handle_cavity, /datum/surgery_step/close)
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_CHEST)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/surgery/core_removal.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/datum/surgery/core_removal
name = "Core removal"
desc = "Remove core from slime. Extract core must be repeated for every core if slime has several."
icon = 'icons/mob/slimes.dmi'
icon_state = "grey slime extract"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/extract_core)
target_mobtypes = list(/mob/living/simple_animal/slime)
possible_locs = list(BODY_ZONE_R_ARM,BODY_ZONE_L_ARM,BODY_ZONE_R_LEG,BODY_ZONE_L_LEG,BODY_ZONE_CHEST,BODY_ZONE_HEAD)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/surgery/coronary_bypass.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/datum/surgery/coronary_bypass
name = "Coronary Bypass"
desc = "Restores the heart to a functional state if it is in a non-functional state, making it able to be defibrillated and sustain life. Can only be performed once on an individual heart."
icon = 'icons/obj/surgery.dmi'
icon_state = "heart-off"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders,
/datum/surgery_step/incise_heart, /datum/surgery_step/coronary_bypass, /datum/surgery_step/close)
possible_locs = list(BODY_ZONE_CHEST)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/surgery/dental_implant.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/datum/surgery/dental_implant
name = "Dental implant"
desc = "This allows you to insert pills/patches into a tooth cavity, allowing you to pop it any time to ingest it. This works for both stimulants and suicide pills."
icon = 'icons/obj/implants.dmi'
icon_state = "reagents"
steps = list(/datum/surgery_step/drill, /datum/surgery_step/insert_pill)
possible_locs = list(BODY_ZONE_PRECISE_MOUTH)

Expand Down
2 changes: 2 additions & 0 deletions code/modules/surgery/experimental_dissection.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/datum/surgery/experimental_dissection
name = "Experimental Dissection"
desc = "A surgical procedure which deeply analyzes the biology of a corpse, and automatically adds new findings to the research database."
icon = 'icons/obj/implants.dmi'
icon_state = "scan_mode"
steps = list(/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
/datum/surgery_step/clamp_bleeders,
Expand Down
3 changes: 3 additions & 0 deletions code/modules/surgery/eye_surgery.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/datum/surgery/eye_surgery
name = "Eye surgery"
desc = "Fixes all damage done to eyes, though doesnt fix genetic blindness. Failing to fix the eyes will cause brain damage to the patient."
icon = 'icons/obj/surgery.dmi'
icon_state = "eyeballs"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/fix_eyes, /datum/surgery_step/close)
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_PRECISE_EYES)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/surgery/healing.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/datum/surgery/healing
icon = 'icons/obj/chemical.dmi'
steps = list(/datum/surgery_step/incise,
/datum/surgery_step/heal,
/datum/surgery_step/close)
Expand Down Expand Up @@ -105,6 +106,7 @@
/***************************BRUTE***************************/
/datum/surgery/healing/brute
name = "Tend Wounds (Bruises)"
icon_state = "bandaid_brute"

/datum/surgery/healing/brute/basic
name = "Tend Wounds (Bruises, Basic)"
Expand Down Expand Up @@ -170,6 +172,7 @@
/***************************BURN***************************/
/datum/surgery/healing/burn
name = "Tend Wounds (Burn)"
icon_state = "bandaid_burn"

/datum/surgery/healing/burn/basic
name = "Tend Wounds (Burn, Basic)"
Expand Down Expand Up @@ -236,6 +239,7 @@

/datum/surgery/healing/combo
name = "Tend Wounds (Mixture, Basic)"
icon_state = "bandaid_both"
replaced_by = /datum/surgery/healing/combo/upgraded
requires_tech = TRUE
healing_step_type = /datum/surgery_step/heal/combo
Expand Down
Loading