Skip to content

Commit

Permalink
Runtime can live again until the adminbuse
Browse files Browse the repository at this point in the history
  • Loading branch information
Syndicat-Meow committed Oct 6, 2024
1 parent c4750d6 commit dcdbb11
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 59 deletions.
7 changes: 7 additions & 0 deletions code/datums/dog_fashion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,10 @@
speak = list("RAAARGH!", "Grrrrrr!")
emote_see = list("bares his fangs", "practices his warcry")
emote_hear = list("plans the demise of his owner.")

/datum/dog_fashion/head/eyepatch
name = "Punished %REAL_NAME%"
desc = "%REAL_NAME% has really been going through it today."
obj_icon_state = "eyepatch"
emote_hear = list("sighs gruffly.", "groans.")
emote_see = list("considers their own mortality.", "stares bleakly into the middle distance.", "ponders the horrors of warfare.")
1 change: 1 addition & 0 deletions code/modules/clothing/glasses/_glasses.dm
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
base_icon_state = "eyepatch"
inhand_icon_state = null
actions_types = list(/datum/action/item_action/flip)
dog_fashion = /datum/dog_fashion/head/eyepatch

/obj/item/clothing/glasses/eyepatch/attack_self(mob/user, modifiers)
. = ..()
Expand Down
111 changes: 65 additions & 46 deletions code/modules/mob/living/basic/pets/dog/corgi.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@
baby_path = /mob/living/basic/pet/dog/corgi/puppy,\
)

/mob/living/basic/pet/dog/corgi/Exited(atom/movable/gone, direction)
. = ..()
var/dropped_something = FALSE
if(gone == inventory_head)
dropped_something = TRUE
inventory_head = null
if(gone == inventory_back)
dropped_something = TRUE
inventory_back = null
if(dropped_something)
update_corgi_fluff()
update_appearance(UPDATE_OVERLAYS)

/mob/living/basic/pet/dog/corgi/Destroy()
QDEL_NULL(inventory_head)
QDEL_NULL(inventory_back)
Expand All @@ -63,17 +76,17 @@
return ..()

/mob/living/basic/pet/dog/corgi/gib()
if(inventory_head)
inventory_head.forceMove(drop_location())
inventory_head = null
if(inventory_back)
inventory_back.forceMove(drop_location())
inventory_back = null
undress_dog()
if(access_card)
access_card.forceMove(drop_location())
access_card = null
return ..()

/// Removes the hat and shirt (but not ID) of this corgi
/mob/living/basic/pet/dog/corgi/proc/undress_dog()
inventory_head?.forceMove(drop_location())
inventory_back?.forceMove(drop_location())

/mob/living/basic/pet/dog/corgi/examine(mob/user)
. = ..()
if(access_card)
Expand Down Expand Up @@ -201,46 +214,44 @@
* to the name, description, speech etc. Doesn't need the user to complete, and is also used in station traits/events/persistence reading.
*/
/mob/living/basic/pet/dog/corgi/proc/place_on_head(obj/item/item_to_add, mob/living/user)
if(inventory_head)
if(user)
to_chat(user, span_warning("You can't put more than one hat on [src]!"))
return
if(!item_to_add)
user.visible_message(span_notice("[user] pets [src]."), span_notice("You rest your hand on [src]'s head for a moment."))
if(flags_1 & HOLOGRAM_1)
return
user.add_mood_event(REF(src), /datum/mood_event/pet_animal, src)
return

if(user && !user.temporarilyRemoveItemFromInventory(item_to_add))
to_chat(user, span_warning("\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!"))
return

var/valid = FALSE
if(ispath(item_to_add.dog_fashion, /datum/dog_fashion/head))
valid = TRUE

//Various hats and items (worn on his head) change Ian's behaviour. His attributes are reset when a hat is removed.

if(valid)
if(user && (stat == DEAD || HAS_TRAIT(src, TRAIT_FAKEDEATH)))
to_chat(user, span_notice("There is merely a dull, lifeless look in [real_name]'s eyes as you put \the [item_to_add] on [p_them()]."))
else if(user)
user.visible_message(span_notice("[user] puts [item_to_add] on [real_name]'s head. [src] looks at [user] and barks once."),
span_notice("You put [item_to_add] on [real_name]'s head. [src] gives you a peculiar look, then wags [p_their()] tail once and barks."),
span_hear("You hear a friendly-sounding bark."))
item_to_add.forceMove(src)
inventory_head = item_to_add
update_corgi_fluff()
update_appearance(UPDATE_OVERLAYS)
else
to_chat(user, span_warning("You set [item_to_add] on [src]'s head, but it falls off!"))
item_to_add.forceMove(drop_location())
if(prob(25))
step_rand(item_to_add)
dance_rotate(src, set_original_dir = TRUE)

return valid
if(inventory_head)
if(user)
balloon_alert(user, "already wearing a hat!")
return FALSE

if(isnull(item_to_add))
if (!isnull(user))
user.visible_message(span_notice("[user] pets [src]."), span_notice("You rest your hand on [src]'s head for a moment."))
if(flags_1 & HOLOGRAM_1)
return
user.add_mood_event(REF(src), /datum/mood_event/pet_animal, src)
return FALSE

if(user && !user.temporarilyRemoveItemFromInventory(item_to_add))
to_chat(user, span_warning("\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!"))
return FALSE

//Various hats and items (worn on his head) change Ian's behaviour. His attributes are reset when a hat is removed.
if(!ispath(item_to_add.dog_fashion, /datum/dog_fashion/head))
to_chat(user, span_warning("You set [item_to_add] on [src]'s head, but it falls off!"))
item_to_add.forceMove(drop_location())
if(prob(25))
step_rand(item_to_add)
dance_rotate(src, set_original_dir = TRUE)
return FALSE

if (user)
if(stat == DEAD || HAS_TRAIT(src, TRAIT_FAKEDEATH))
to_chat(user, span_notice("There is merely a dull, lifeless look in [real_name]'s eyes as you put \the [item_to_add] on [p_them()]."))
else
user.visible_message(span_notice("[user] puts [item_to_add] on [real_name]'s head. [src] looks at [user] and barks once."),
span_notice("You put [item_to_add] on [real_name]'s head. [src] gives you a peculiar look, then wags [p_their()] tail once and barks."),
span_hear("You hear a friendly-sounding bark."))
item_to_add.forceMove(src)
inventory_head = item_to_add
update_corgi_fluff()
update_appearance(UPDATE_OVERLAYS)
return TRUE

/mob/living/basic/pet/dog/corgi/proc/update_corgi_fluff()
// First, change back to defaults
Expand Down Expand Up @@ -387,6 +398,14 @@
Write_Memory(TRUE)
return ..()

/mob/living/basic/pet/dog/corgi/ian/revive(full_heal_flags, excess_healing, force_grab_ghost)
. = ..()
if (!.)
return
if (!istype(inventory_head, /obj/item/clothing/glasses/eyepatch))
inventory_head?.forceMove(drop_location())
place_on_head(new /obj/item/clothing/glasses/eyepatch/medical)

/mob/living/basic/pet/dog/corgi/ian/narsie_act()
playsound(src, 'sound/magic/demon_dies.ogg', 75, TRUE)
var/mob/living/basic/pet/dog/corgi/narsie/narsIan = new(loc)
Expand Down
55 changes: 42 additions & 13 deletions code/modules/surgery/revival.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
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."
requires_bodypart_type = NONE
possible_locs = list(BODY_ZONE_HEAD)
possible_locs = list(BODY_ZONE_CHEST)
target_mobtypes = list(/mob/living)
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
Expand All @@ -14,15 +15,22 @@
/datum/surgery_step/close,
)

/datum/surgery/revival/can_start(mob/user, mob/living/carbon/target)
/datum/surgery/revival/can_start(mob/user, mob/living/target)
if(!..())
return FALSE
if(target.stat != DEAD)
return FALSE
if(HAS_TRAIT(target, TRAIT_SUICIDED) || HAS_TRAIT(target, TRAIT_HUSK) || HAS_TRAIT(target, TRAIT_DEFIB_BLACKLISTED))
return FALSE
var/obj/item/organ/internal/brain/target_brain = target.get_organ_slot(ORGAN_SLOT_BRAIN)
if(!target_brain)
if(!is_valid_target(target))
return FALSE
return TRUE

/// Extra checks which can be overridden
/datum/surgery/revival/proc/is_valid_target(mob/living/patient)
if (iscarbon(patient))
return FALSE
if (!(patient.mob_biotypes & (MOB_ORGANIC|MOB_HUMANOID)))
return FALSE
return TRUE

Expand Down Expand Up @@ -58,7 +66,7 @@
to_chat(user, span_warning("You need an electrode for this!"))
return FALSE

/datum/surgery_step/revive/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
/datum/surgery_step/revive/preop(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(
user,
target,
Expand Down Expand Up @@ -86,21 +94,42 @@
target.adjustOxyLoss(-50, 0)
target.updatehealth()
if(target.revive())
target.visible_message(span_notice("...[target] wakes up, alive and aware!"))
target.emote("gasp")
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 50, 199) //MAD SCIENCE
on_revived(user, target)
return TRUE
else
target.visible_message(span_warning("...[target.p_they()] convulses, then lies still."))
return FALSE

/datum/surgery_step/revive/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
target.visible_message(span_warning("...[target.p_they()] convulse[target.p_s()], then lie[target.p_s()] still."))
return FALSE

/// Called when you have been successfully raised from the dead
/datum/surgery_step/revive/proc/on_revived(mob/surgeon, mob/living/patient)
patient.visible_message(span_notice("...[patient] wakes up, alive and aware!"))
patient.emote("gasp")

/datum/surgery_step/revive/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(
user,
target,
span_notice("You shock [target]'s brain with [tool], but [target.p_they()] doesn't react."),
span_notice("[user] send a powerful shock to [target]'s brain with [tool], but [target.p_they()] doesn't react."),
span_notice("[user] send a powerful shock to [target]'s brain with [tool], but [target.p_they()] doesn't react."),
)
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 15, 180)
return FALSE

/// Additional revival effects if the target has a brain
/datum/surgery/revival/carbon
possible_locs = list(BODY_ZONE_HEAD)
target_mobtypes = list(/mob/living/carbon)

/datum/surgery/revival/carbon/is_valid_target(mob/living/carbon/patient)
var/obj/item/organ/internal/brain/target_brain = patient.get_organ_slot(ORGAN_SLOT_BRAIN)
return !isnull(target_brain)

/datum/surgery_step/revive/carbon

/datum/surgery_step/revive/carbon/on_revived(mob/surgeon, mob/living/patient)
. = ..()
patient.adjustOrganLoss(ORGAN_SLOT_BRAIN, 50, 199) // MAD SCIENCE

/datum/surgery_step/revive/carbon/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
. = ..()
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 15, 180)
Binary file modified icons/mob/simple/corgi_head.dmi
Binary file not shown.

0 comments on commit dcdbb11

Please sign in to comment.