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 doppelganger hallucination #27628

Merged
merged 11 commits into from
Jan 10, 2025
46 changes: 45 additions & 1 deletion code/modules/hallucinations/effects/moderate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@

/obj/effect/hallucination/ventpeek/Initialize(mapload, mob/living/carbon/hallucination_target)
. = ..()

var/list/venttargets = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/vent in oview(world.view, target))
venttargets += vent
Expand All @@ -500,3 +500,47 @@

/obj/effect/hallucination/ventpeek/proc/play_honk()
target.playsound_local(target, 'sound/items/bikehorn.ogg', 10, TRUE)

// Doppelganger hallucination
// Spawns a copy of the player that briefly follows them around
/obj/effect/hallucination/doppelganger
duration = 10 SECONDS
var/obj/effect/hallucination/chaser/you/fake_you

/obj/effect/hallucination/doppelganger/Initialize(mapload, mob/living/carbon/target)
. = ..()

var/list/locs = list()
for(var/turf/T in oview(world.view / 2, target))
if(!is_blocked_turf(T))
locs += T
if(!length(locs))
return INITIALIZE_HINT_QDEL

var/turf/T = pick(locs)
fake_you = new(T, target)

/obj/effect/hallucination/doppelganger/Destroy()
QDEL_NULL(fake_you)
return ..()

/obj/effect/hallucination/chaser/you
duration = 10 SECONDS
min_distance = 2
var/image/I = new

/obj/effect/hallucination/chaser/you/Initialize(mapload, mob/living/carbon/target)
. = ..()
name = "???"
lewcc marked this conversation as resolved.
Show resolved Hide resolved
I.appearance = target.appearance
I.loc = src
I.override = TRUE
add_icon(I)

/obj/effect/hallucination/chaser/you/chase()
..()
I.dir = get_dir(src, target)

/obj/effect/hallucination/chaser/you/Destroy()
QDEL_NULL(I)
return ..()
1 change: 1 addition & 0 deletions code/modules/hallucinations/hallucinations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ GLOBAL_LIST_INIT(hallucinations, list(
/obj/effect/hallucination/gunfire = 10,
/obj/effect/hallucination/plasma_flood = 10,
/obj/effect/hallucination/stunprodding = 10,
/obj/effect/hallucination/doppelganger = 10,
/obj/effect/hallucination/delamination_alarm = 15,
/obj/effect/hallucination/fake_item = 15,
/obj/effect/hallucination/fake_weapon = 15,
Expand Down
Loading