Completely refactors hallucinations, and also adds a few (#69706)

* Refactors hallucinations slightly, organizes them

* Refactors hallucination into a status effect

* Further hallucination proper refactoring

* Refactors battle hallucinations

* Refactors "fake item other" hallucination

* Gets it a bit closer to working state

* Refactors screwydoll and fake alerts

* Refactors fake inhand items

* Refactors a few more.
- Fake death
- Fake messages
- Fake sounds
- Projectiles

* Refactoring delusions, hallucination effects

* Furthering the hallucination status effect
- removes copypaste of hallucination pulses

* Almost finalizes the changeover to status effect

* Last staus effect stuff

* Delusion business

* Airlocks, fire, and more delusion stuff

* Finishes screwyhud. It compiles now!

* Swaps screwyhud over to a grouped status effect

* Removes hal_screwyhud

* Comment

* Bugfixing

* image cleaning

* Get rid of this it came back

* What if I finished this branch?

* Oops

* Messing with the randomness

* Mass hallucination tweaks

* +

* Some more mass tweaks

* Review

* Updates

* Unit tests hallucination icons

* More tweaks

* Move folder

* Another re-name

* Minor tweaks

* Anomaly unity

* Mass hallucination buffs

* t

* Sig

* Merge

* Lints

* Unit test already coming in clutch

* Another failure

* Use named args for cause_hallucination via some define trickery

* Some cleanup

* This is better

* adds some hallucinations

* Oops

* More sounds

* Tweaks

* Some additional documentation

* Flash

* Fixes mass hallucination

* Json changes

* Updates documentation

* Json conflicts

* Makes it work

* Missed that one too

* Helpers

* More signalization (WIP)

* Fixes bump

* Missed a helper use

* Dumb
This commit is contained in:
MrMelbert
2022-09-21 01:30:04 -04:00
committed by GitHub
parent 1ce23e0b57
commit 6baebf47a1
124 changed files with 4040 additions and 2418 deletions
@@ -145,9 +145,16 @@
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "PortableChemMixer", name)
if(user.hallucinating())
var/is_hallucinating = FALSE
if(isliving(user))
var/mob/living/living_user = user
is_hallucinating = !!living_user.has_status_effect(/datum/status_effect/hallucination)
if(is_hallucinating)
// to not ruin the immersion by constantly changing the fake chemicals
ui.set_autoupdate(FALSE)
ui.open()
/obj/item/storage/portable_chem_mixer/ui_data(mob/user)
@@ -159,9 +166,11 @@
data["beakerTransferAmounts"] = beaker ? list(1,5,10,30,50,100) : null
data["showpH"] = show_ph
var/chemicals[0]
var/is_hallucinating = user.hallucinating()
if(user.hallucinating())
is_hallucinating = TRUE
var/is_hallucinating = FALSE
if(isliving(user))
var/mob/living/living_user = user
is_hallucinating = !!living_user.has_status_effect(/datum/status_effect/hallucination)
for(var/re in dispensable_reagents)
var/value = dispensable_reagents[re]
var/datum/reagent/temp = GLOB.chemical_reagents_list[re]
@@ -188,9 +188,6 @@
if (HAS_TRAIT(target, TRAIT_IRRADIATED))
render_list += "<span class='alert ml-1'>Subject is irradiated. Supply toxin healing.</span>\n"
if(advanced && target.hallucinating())
render_list += "<span class='info ml-1'>Subject is hallucinating.</span>\n"
//Eyes and ears
if(advanced && iscarbon(target))
var/mob/living/carbon/carbontarget = target
+3 -6
View File
@@ -442,8 +442,6 @@
food_reagents = list(/datum/reagent/blood = 15)
tastes = list("hell" = 1, "people" = 1)
metabolization_amount = REAGENTS_METABOLISM
/// What the player hears from the bubblegum hallucination, and also says one of these when suiciding
var/static/list/hallucination_lines = list("I AM IMMORTAL.", "I SHALL TAKE YOUR WORLD.", "I SEE YOU.", "YOU CANNOT ESCAPE ME FOREVER.", "NOTHING CAN HOLD ME.")
/obj/item/food/bubblegum/bubblegum/process()
. = ..()
@@ -470,16 +468,15 @@
///This proc has a 5% chance to have a bubblegum line appear, with an 85% chance for just text and 15% for a bubblegum hallucination and scarier text.
/obj/item/food/bubblegum/bubblegum/proc/hallucinate(mob/living/carbon/victim)
if(!prob(5)) //cursed by bubblegum
if(prob(95)) //cursed by bubblegum
return
if(prob(15))
new /datum/hallucination/oh_yeah(victim)
to_chat(victim, span_colossus("<b>[pick(hallucination_lines)]</b>"))
victim.cause_hallucination(/datum/hallucination/oh_yeah, "bubblegum bubblegum", haunt_them = TRUE)
else
to_chat(victim, span_warning("[pick("You hear faint whispers.", "You smell ash.", "You feel hot.", "You hear a roar in the distance.")]"))
/obj/item/food/bubblegum/bubblegum/suicide_act(mob/user)
user.say(";[pick(hallucination_lines)]")
user.say(";[pick(BUBBLEGUM_HALLUCINATION_LINES)]")
return ..()
/obj/item/food/gumball
+3 -2
View File
@@ -46,14 +46,15 @@
living_mob.Paralyze(10)
living_mob.Knockdown(100)
to_chat(living_mob, span_hypnophrase("The sound echoes in your brain..."))
living_mob.hallucination += 50
living_mob.adjust_hallucinations(100 SECONDS)
else
if(distance <= 1)
living_mob.Paralyze(5)
living_mob.Knockdown(30)
if(hypno_sound)
to_chat(living_mob, span_hypnophrase("The sound echoes in your brain..."))
living_mob.hallucination += 50
living_mob.adjust_hallucinations(100 SECONDS)
//Flash
if(living_mob.flash_act(affect_silicon = 1))