Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PTBF] Adds a new hallucination, Blind Rushers! #27717

Merged
merged 13 commits into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from 12 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
69 changes: 69 additions & 0 deletions code/modules/hallucinations/effects/blind_rush_hallucination.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* # Hallucination - Blind Rush
*
* Makes target blind and causes them to see semi-transparent humanoids running at them.
*/
/datum/hallucination_manager/blind_rush
initial_hallucination = /obj/effect/hallucination/no_delete/blind_rusher
lewcc marked this conversation as resolved.
Show resolved Hide resolved
trigger_time = 3.4 SECONDS //total length of the hallucination is a little more than ten seconds

Taurtura marked this conversation as resolved.
Show resolved Hide resolved

/datum/hallucination_manager/blind_rush/get_spawn_location()
var/list/turfs = orange(13, owner.loc)
return pick(turfs)

/datum/hallucination_manager/blind_rush/on_spawn()
owner.playsound_local(get_turf(src), 'sound/spookoween/ghost_whisper.ogg', 30, TRUE)
owner.become_blind("hallucination")
to_chat(owner, "<span class='whisper'>Who turned off the light?</span>", MESSAGE_TYPE_INFO)

/datum/hallucination_manager/blind_rush/on_trigger()
var/turf/spawn_location = get_spawn_location() //we need a new spawn location incase the player moved
hallucination_list += new /obj/effect/hallucination/no_delete/blind_rusher(spawn_location, owner)
to_chat(owner, "<span class='danger'>They're here.</span>", MESSAGE_TYPE_INFO)
trigger_timer = addtimer(CALLBACK(src, PROC_REF(on_second_trigger)), trigger_time, TIMER_DELETE_ME)

/datum/hallucination_manager/blind_rush/proc/on_second_trigger()
var/turf/spawn_location = get_spawn_location()
hallucination_list += new /obj/effect/hallucination/no_delete/blind_rusher(spawn_location, owner)
owner.Confused(9 SECONDS)
owner.Jitter(9 SECONDS)
to_chat(owner, "<span class='userdanger'>Run!</span>", MESSAGE_TYPE_INFO)
trigger_timer = addtimer(CALLBACK(src, PROC_REF(on_last_trigger)), trigger_time, TIMER_DELETE_ME)

/datum/hallucination_manager/blind_rush/proc/on_last_trigger()
owner.emote("collapse")
owner.cure_blind("hallucination")
qdel(src)

/obj/effect/hallucination/no_delete/blind_rusher
name = "Unknown"
alpha = 100
hallucination_plane = 25 //to make sure we render the hallucination above the blindness layer.
hallucination_layer = 25
lewcc marked this conversation as resolved.
Show resolved Hide resolved
hallucination_icon = 'icons/mob/simple_human.dmi'
hallucination_icon_state = ("faceless")
hallucination_override = TRUE
var/min_distance = 0
DGamerL marked this conversation as resolved.
Show resolved Hide resolved
var/rush_time = 2 DECISECONDS
var/rush_timer = null

/obj/effect/hallucination/no_delete/blind_rusher/Initialize(mapload, mob/living/carbon/target)
rush_timer = addtimer(CALLBACK(src, PROC_REF(rush)), rush_time, TIMER_LOOP | TIMER_STOPPABLE)
Taurtura marked this conversation as resolved.
Show resolved Hide resolved
if(prob(50))
hallucination_icon = 'icons/mob/simple_human.dmi'
hallucination_icon_state = pick("clown", "skeleton_warden", "skeleton_warden_alt")
return ..()

/obj/effect/hallucination/no_delete/blind_rusher/Destroy()
deltimer(rush_timer)
return ..()
Taurtura marked this conversation as resolved.
Show resolved Hide resolved

/obj/effect/hallucination/no_delete/blind_rusher/proc/rush()
DGamerL marked this conversation as resolved.
Show resolved Hide resolved
if(get_dist(src, target) > min_distance)
var/direction = get_dir(src, target) //making sure the hallucination is facing the player correctly.
forceMove(get_step(src, direction)) //forceMove to go through walls and other dense turfs.
dir = direction
else
target.playsound_local(get_turf(src), 'sound/misc/demon_attack1.ogg', 25, TRUE)
qdel(src)
4 changes: 4 additions & 0 deletions code/modules/hallucinations/hallucinations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ GLOBAL_LIST_INIT(hallucinations, list(
/obj/effect/hallucination/fake_grenade/spawner = 10,
/obj/effect/hallucination/terror_infestation = 10,
/obj/effect/hallucination/loose_energy_ball = 10,
/datum/hallucination_manager/blind_rush = 1,
/datum/hallucination_manager/xeno_pounce = 10,
/datum/hallucination_manager/waves = 2,
/obj/effect/hallucination/blob = 10,
Expand All @@ -56,6 +57,8 @@ GLOBAL_LIST_INIT(hallucinations, list(
var/hallucination_override = FALSE
/// Hallucination layer.
var/hallucination_layer = MOB_LAYER
///Hallucination plane.
var/hallucination_plane = AREA_PLANE
/// The mob that sees this hallucination.
var/mob/living/carbon/target = null
/// Lazy list of images created as part of the hallucination. Cleared on destruction.
Expand All @@ -73,6 +76,7 @@ GLOBAL_LIST_INIT(hallucinations, list(
var/image/I = image(hallucination_icon, hallucination_override ? src : get_turf(src), hallucination_icon_state)
I.override = hallucination_override
I.layer = hallucination_layer
I.plane = hallucination_plane
add_icon(I)
// Lifetime
if(islist(duration))
Expand Down
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1993,6 +1993,7 @@
#include "code\modules\games\unum.dm"
#include "code\modules\hallucinations\hallucination_manager.dm"
#include "code\modules\hallucinations\hallucinations.dm"
#include "code\modules\hallucinations\effects\blind_rush_hallucination.dm"
#include "code\modules\hallucinations\effects\common.dm"
#include "code\modules\hallucinations\effects\grenades.dm"
#include "code\modules\hallucinations\effects\major.dm"
Expand Down
Loading