diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 67c2ea402b5..0a57839a234 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -752,6 +752,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_CUSTOM_TAP_SOUND "no_tap_sound" /// Makes the feedback message when someone else is putting this item on you more noticeable #define TRAIT_DANGEROUS_OBJECT "dangerous_object" +// determines whether or not objects are haunted and teleport/attack randomly +#define TRAIT_HAUNTED "haunted" //quirk traits #define TRAIT_ALCOHOL_TOLERANCE "alcohol_tolerance" @@ -1015,6 +1017,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define HYPNOCHAIR_TRAIT "hypnochair" #define FLASHLIGHT_EYES "flashlight_eyes" #define IMPURE_OCULINE "impure_oculine" +#define HAUNTIUM_REAGENT_TRAIT "hauntium_reagent_trait" #define TRAIT_SANTA "santa" #define SCRYING_ORB "scrying-orb" #define ABDUCTOR_ANTAGONIST "abductor-antagonist" diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index d6e1a6457f5..bb9e00edcd1 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -237,6 +237,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_UNCATCHABLE" = TRAIT_UNCATCHABLE, "TRAIT_DANGEROUS_OBJECT" = TRAIT_DANGEROUS_OBJECT, "TRAIT_GERM_SENSITIVE" = TRAIT_GERM_SENSITIVE, + "TRAIT_HAUNTED" = TRAIT_HAUNTED, ), /atom = list( "TRAIT_KEEP_TOGETHER" = TRAIT_KEEP_TOGETHER, diff --git a/code/datums/elements/haunted.dm b/code/datums/elements/haunted.dm index 1ed7f325294..d678083dd19 100644 --- a/code/datums/elements/haunted.dm +++ b/code/datums/elements/haunted.dm @@ -24,3 +24,13 @@ REMOVE_TRAIT(master, TRAIT_MOVE_FLYING, ELEMENT_TRAIT(type)) master.RemoveElement(/datum/element/movetype_handler) return ..() + +/atom/movable/proc/make_haunted(source, color) //if not haunted, make haunted + if(!HAS_TRAIT(src, TRAIT_HAUNTED)) + AddElement(/datum/element/haunted, color) + ADD_TRAIT(src, TRAIT_HAUNTED, source) + +/atom/movable/proc/remove_haunted(source) //if haunted, make not haunted + REMOVE_TRAIT(src, TRAIT_HAUNTED, source) + if(!HAS_TRAIT(src, TRAIT_HAUNTED)) + RemoveElement(/datum/element/haunted) diff --git a/code/datums/materials/hauntium.dm b/code/datums/materials/hauntium.dm index 9a4e09f9081..79e25441720 100644 --- a/code/datums/materials/hauntium.dm +++ b/code/datums/materials/hauntium.dm @@ -15,10 +15,8 @@ /datum/material/hauntium/on_applied_obj(obj/o, amount, material_flags) . = ..() - if(isitem(o)) - o.AddElement(/datum/element/haunted) + o.make_haunted(INNATE_TRAIT, "#f8f8ff") /datum/material/hauntium/on_removed_obj(obj/o, amount, material_flags) . = ..() - if(isitem(o)) - o.RemoveElement(/datum/element/haunted) + o.remove_haunted(INNATE_TRAIT) diff --git a/code/datums/mood_events/drug_events.dm b/code/datums/mood_events/drug_events.dm index 05d6eabd7d7..c734f2797b4 100644 --- a/code/datums/mood_events/drug_events.dm +++ b/code/datums/mood_events/drug_events.dm @@ -121,3 +121,8 @@ /datum/mood_event/nicotine_withdrawal_severe description = "Head pounding. Cold sweating. Feeling anxious. Need a smoke to calm down!" mood_change = -8 + +/datum/mood_event/hauntium_spirits + description = "I feel my soul degrading!" + mood_change = -8 + timeout = 8 MINUTES diff --git a/code/datums/mood_events/morbid_events.dm b/code/datums/mood_events/morbid_events.dm index ce3ba60738f..b21548c8122 100644 --- a/code/datums/mood_events/morbid_events.dm +++ b/code/datums/mood_events/morbid_events.dm @@ -32,6 +32,11 @@ Intended to push a creepy, mad scientist/doctor vibe, or someone who is downrigh mood_change = 2 timeout = 2 MINUTES +/datum/mood_event/morbid_hauntium + description = "I feel a better connection with the spirits, I love this!" + mood_change = 3 + timeout = 6 MINUTES + // Negative Events - We helped someone stay alive. /datum/mood_event/morbid_tend_wounds diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 0c55f73633f..3720b8a37ae 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -859,6 +859,7 @@ new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperfra merge_type = /obj/item/stack/sheet/hauntium material_type = /datum/material/hauntium material_modifier = 1 //None of that wussy stuff + grind_results = list(/datum/reagent/hauntium = 20) /obj/item/stack/sheet/hauntium/fifty amount = 50 diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 9ce0a4492ef..a80ee924115 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -581,6 +581,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301 gender = PLURAL icon = 'icons/effects/magic.dmi' icon_state = "ectoplasm" + grind_results = list(/datum/reagent/hauntium = 25) //can be ground into hauntium /obj/item/ectoplasm/suicide_act(mob/living/user) user.visible_message(span_suicide("[user] is inhaling [src]! It looks like [user.p_theyre()] trying to visit the astral plane!")) diff --git a/code/modules/antagonists/revenant/haunted_item.dm b/code/modules/antagonists/revenant/haunted_item.dm index 8973139f51e..d035e2694d9 100644 --- a/code/modules/antagonists/revenant/haunted_item.dm +++ b/code/modules/antagonists/revenant/haunted_item.dm @@ -34,7 +34,7 @@ if(istype(haunted_item.ai_controller, /datum/ai_controller/haunted)) // already spooky return COMPONENT_INCOMPATIBLE - haunted_item.AddElement(/datum/element/haunted, haunt_color) + haunted_item.make_haunted(MAGIC_TRAIT, haunt_color) if(isnull(haunted_item.ai_controller)) // failed to make spooky! don't go on return COMPONENT_INCOMPATIBLE @@ -71,7 +71,7 @@ // because we want to make sure they always get dealt with no matter how the component is removed if(!isnull(pre_haunt_throwforce)) haunted_item.throwforce = pre_haunt_throwforce - haunted_item.RemoveElement(/datum/element/haunted) + haunted_item.remove_haunted(MAGIC_TRAIT) return ..() /datum/component/haunted_item/RegisterWithParent() diff --git a/code/modules/antagonists/wizard/equipment/soulstone.dm b/code/modules/antagonists/wizard/equipment/soulstone.dm index 8fa473f50f0..b2bba655050 100644 --- a/code/modules/antagonists/wizard/equipment/soulstone.dm +++ b/code/modules/antagonists/wizard/equipment/soulstone.dm @@ -24,6 +24,7 @@ var/theme = THEME_CULT /// Role check, if any needed var/required_role = /datum/antagonist/cult + grind_results = list(/datum/reagent/hauntium = 25, /datum/reagent/silicon = 10) //can be ground into hauntium /obj/item/soulstone/Initialize(mapload) . = ..() diff --git a/code/modules/photography/photos/photo.dm b/code/modules/photography/photos/photo.dm index 7af4c546cff..9be79a58266 100644 --- a/code/modules/photography/photos/photo.dm +++ b/code/modules/photography/photos/photo.dm @@ -43,6 +43,7 @@ if(!isobserver(seen)) continue set_custom_materials(list(/datum/material/hauntium =SHEET_MATERIAL_AMOUNT)) + grind_results = list(/datum/reagent/hauntium = 20) break /obj/item/photo/update_icon_state() diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index e8391eb5cdc..6cb9ea5d599 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -2891,3 +2891,42 @@ if(SPT_PROB(10, seconds_per_tick)) carbon_metabolizer.set_heartattack(TRUE) + +/datum/reagent/hauntium + name = "Hauntium" + color = "#3B3B3BA3" + description = "An eerie liquid created by purifying the prescence of ghosts. If it happens to get in your body, it starts hurting your soul." //soul as in mood and heart + taste_description = "evil spirits" + metabolization_rate = 0.75 * REAGENTS_METABOLISM + material = /datum/material/hauntium + ph = 10 + chemical_flags = REAGENT_CAN_BE_SYNTHESIZED + +/datum/reagent/hauntium/expose_obj(obj/exposed_obj, volume) //gives 15 seconds of haunting effect for every unit of it that touches an object + . = ..() + if(HAS_TRAIT_FROM(exposed_obj, TRAIT_HAUNTED, HAUNTIUM_REAGENT_TRAIT)) + return + exposed_obj.make_haunted(HAUNTIUM_REAGENT_TRAIT, "#f8f8ff") + addtimer(CALLBACK(exposed_obj, TYPE_PROC_REF(/atom/movable/, remove_haunted), HAUNTIUM_REAGENT_TRAIT), volume * 20 SECONDS) + +/datum/reagent/hauntium/on_mob_metabolize(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + to_chat(affected_mob, span_userdanger("You feel an evil presence inside you!")) + if(affected_mob.mob_biotypes & MOB_UNDEAD || HAS_MIND_TRAIT(affected_mob, TRAIT_MORBID)) + affected_mob.add_mood_event("morbid_hauntium", /datum/mood_event/morbid_hauntium, name) //8 minutes of slight mood buff if undead or morbid + else + affected_mob.add_mood_event("hauntium_spirits", /datum/mood_event/hauntium_spirits, name) //8 minutes of mood debuff + +/datum/reagent/hauntium/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) + if(affected_mob.mob_biotypes & MOB_UNDEAD || HAS_MIND_TRAIT(affected_mob, TRAIT_MORBID)) //if morbid or undead,acts like an addiction-less drug + affected_mob.remove_status_effect(/datum/status_effect/jitter) + affected_mob.AdjustStun(-50 * REM * seconds_per_tick) + affected_mob.AdjustKnockdown(-50 * REM * seconds_per_tick) + affected_mob.AdjustUnconscious(-50 * REM * seconds_per_tick) + affected_mob.AdjustParalyzed(-50 * REM * seconds_per_tick) + affected_mob.AdjustImmobilized(-50 * REM * seconds_per_tick) + ..() + else + affected_mob.adjustOrganLoss(ORGAN_SLOT_HEART, REM * seconds_per_tick) //1 heart damage per tick + if(SPT_PROB(10, seconds_per_tick)) + affected_mob.emote(pick("twitch","choke","shiver","gag")) + ..() diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm index a5739a02d97..0bf7cd4649a 100644 --- a/code/modules/reagents/chemistry/recipes/others.dm +++ b/code/modules/reagents/chemistry/recipes/others.dm @@ -950,3 +950,14 @@ for(var/i in rand(1, created_volume) to created_volume) new /mob/living/basic/ant(location) ..() + +/datum/chemical_reaction/hauntium_solidification + required_reagents = list(/datum/reagent/water/holywater = 10, /datum/reagent/hauntium = 20, /datum/reagent/iron = 1) + mob_react = FALSE + reaction_flags = REACTION_INSTANT + reaction_tags = REACTION_TAG_EASY | REACTION_TAG_UNIQUE | REACTION_TAG_OTHER + +/datum/chemical_reaction/hauntium_solidification/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume) + var/location = get_turf(holder.my_atom) + for(var/i in 1 to created_volume) + new /obj/item/stack/sheet/hauntium(location)