mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 19:51:59 +00:00
102 lines
3.3 KiB
Plaintext
102 lines
3.3 KiB
Plaintext
/* Polymorph Hallucinations
|
|
*
|
|
* Contains:
|
|
* Nearby mobs are polymorphed into other creatures
|
|
* Polymorphing yourself into other creatures
|
|
*/
|
|
/datum/hallucination/delusion
|
|
var/list/image/delusions = list()
|
|
|
|
/datum/hallucination/delusion/New(mob/living/carbon/C, forced, force_kind = null , duration = 300,skip_nearby = TRUE, custom_icon = null, custom_icon_file = null, custom_name = null)
|
|
set waitfor = FALSE
|
|
. = ..()
|
|
var/image/A = null
|
|
var/kind = force_kind ? force_kind : pick("nothing","monkey","corgi","carp","skeleton","demon","zombie")
|
|
feedback_details += "Type: [kind]"
|
|
var/list/nearby
|
|
if(skip_nearby)
|
|
nearby = get_hearers_in_view(7, target)
|
|
for(var/mob/living/carbon/human/H in GLOB.alive_mob_list)
|
|
if(H == target)
|
|
continue
|
|
if(skip_nearby && (H in nearby))
|
|
continue
|
|
switch(kind)
|
|
if("nothing")
|
|
A = image('icons/effects/effects.dmi',H,"nothing")
|
|
A.name = "..."
|
|
if("monkey")//Monkey
|
|
A = image('icons/mob/human.dmi',H,"monkey")
|
|
A.name = "Monkey ([rand(1,999)])"
|
|
if("carp")//Carp
|
|
A = image('icons/mob/carp.dmi',H,"carp")
|
|
A.name = "Space Carp"
|
|
if("corgi")//Corgi
|
|
A = image('icons/mob/pets.dmi',H,"corgi")
|
|
A.name = "Corgi"
|
|
if("skeleton")//Skeletons
|
|
A = image('icons/mob/human.dmi',H,"skeleton")
|
|
A.name = "Skeleton"
|
|
if("zombie")//Zombies
|
|
A = image('icons/mob/human.dmi',H,"zombie")
|
|
A.name = "Zombie"
|
|
if("demon")//Demon
|
|
A = image('icons/mob/mob.dmi',H,"daemon")
|
|
A.name = "Demon"
|
|
if("custom")
|
|
A = image(custom_icon_file, H, custom_icon)
|
|
A.name = custom_name
|
|
A.override = 1
|
|
if(target.client)
|
|
delusions |= A
|
|
target.client.images |= A
|
|
if(duration)
|
|
QDEL_IN(src, duration)
|
|
|
|
/datum/hallucination/delusion/Destroy()
|
|
for(var/image/I in delusions)
|
|
if(target.client)
|
|
target.client.images.Remove(I)
|
|
return ..()
|
|
|
|
/datum/hallucination/self_delusion
|
|
var/image/delusion
|
|
|
|
/datum/hallucination/self_delusion/New(mob/living/carbon/C, forced, force_kind = null , duration = 300, custom_icon = null, custom_icon_file = null, wabbajack = TRUE) //set wabbajack to false if you want to use another fake source
|
|
set waitfor = FALSE
|
|
..()
|
|
var/image/A = null
|
|
var/kind = force_kind ? force_kind : pick("monkey","corgi","carp","skeleton","demon","zombie","robot")
|
|
feedback_details += "Type: [kind]"
|
|
switch(kind)
|
|
if("monkey")//Monkey
|
|
A = image('icons/mob/human.dmi',target,"monkey")
|
|
if("carp")//Carp
|
|
A = image('icons/mob/animal.dmi',target,"carp")
|
|
if("corgi")//Corgi
|
|
A = image('icons/mob/pets.dmi',target,"corgi")
|
|
if("skeleton")//Skeletons
|
|
A = image('icons/mob/human.dmi',target,"skeleton")
|
|
if("zombie")//Zombies
|
|
A = image('icons/mob/human.dmi',target,"zombie")
|
|
if("demon")//Demon
|
|
A = image('icons/mob/mob.dmi',target,"daemon")
|
|
if("robot")//Cyborg
|
|
A = image('icons/mob/robots.dmi',target,"robot")
|
|
target.playsound_local(target,'sound/voice/liveagain.ogg', 75, 1)
|
|
if("custom")
|
|
A = image(custom_icon_file, target, custom_icon)
|
|
A.override = 1
|
|
if(target.client)
|
|
if(wabbajack)
|
|
to_chat(target, span_hear("...wabbajack...wabbajack..."))
|
|
target.playsound_local(target,'sound/magic/staff_change.ogg', 50, 1)
|
|
delusion = A
|
|
target.client.images |= A
|
|
QDEL_IN(src, duration)
|
|
|
|
/datum/hallucination/self_delusion/Destroy()
|
|
if(target.client)
|
|
target.client.images.Remove(delusion)
|
|
return ..()
|