232 lines
6.5 KiB
Plaintext
232 lines
6.5 KiB
Plaintext
// A mob which only moves when it isn't being watched by living beings.
|
|
|
|
/mob/living/simple_animal/hostile/statue
|
|
name = "statue" // matches the name of the statue with the flesh-to-stone spell
|
|
desc = "An incredibly lifelike marble carving. Its eyes seems to follow you.." // same as an ordinary statue with the added "eye following you" description
|
|
icon = 'icons/obj/statue.dmi'
|
|
icon_state = "human_male"
|
|
icon_living = "human_male"
|
|
icon_dead = "human_male"
|
|
gender = NEUTER
|
|
a_intent = INTENT_HARM
|
|
|
|
response_help = "touches"
|
|
response_disarm = "pushes"
|
|
|
|
speed = -1
|
|
maxHealth = 50000
|
|
health = 50000
|
|
healable = 0
|
|
|
|
harm_intent_damage = 10
|
|
obj_damage = 100
|
|
melee_damage_lower = 68
|
|
melee_damage_upper = 83
|
|
attacktext = "claws"
|
|
attack_sound = 'sound/hallucinations/growl1.ogg'
|
|
|
|
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
|
|
minbodytemp = 0
|
|
|
|
faction = list("statue")
|
|
move_to_delay = 0 // Very fast
|
|
|
|
animate_movement = NO_STEPS // Do not animate movement, you jump around as you're a scary statue.
|
|
hud_possible = list(ANTAG_HUD)
|
|
|
|
see_in_dark = 13
|
|
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
|
|
vision_range = 12
|
|
aggro_vision_range = 12
|
|
idle_vision_range = 12
|
|
|
|
search_objects = 1 // So that it can see through walls
|
|
|
|
sight = SEE_SELF|SEE_MOBS|SEE_OBJS|SEE_TURFS
|
|
anchored = TRUE
|
|
|
|
gold_core_spawnable = 1
|
|
|
|
var/cannot_be_seen = 1
|
|
var/mob/living/creator = null
|
|
|
|
|
|
|
|
// No movement while seen code.
|
|
|
|
/mob/living/simple_animal/hostile/statue/Initialize(mapload, var/mob/living/creator)
|
|
..()
|
|
// Give spells
|
|
mob_spell_list += new /obj/effect/proc_holder/spell/aoe_turf/flicker_lights(src)
|
|
mob_spell_list += new /obj/effect/proc_holder/spell/aoe_turf/blindness(src)
|
|
mob_spell_list += new /obj/effect/proc_holder/spell/targeted/night_vision(src)
|
|
|
|
// Set creator
|
|
if(creator)
|
|
src.creator = creator
|
|
|
|
/mob/living/simple_animal/hostile/statue/med_hud_set_health()
|
|
return //we're a statue we're invincible
|
|
|
|
/mob/living/simple_animal/hostile/statue/med_hud_set_status()
|
|
return //we're a statue we're invincible
|
|
|
|
/mob/living/simple_animal/hostile/statue/Move(turf/NewLoc)
|
|
if(can_be_seen(NewLoc))
|
|
if(client)
|
|
to_chat(src, "<span class='warning'>You cannot move, there are eyes on you!</span>")
|
|
return 0
|
|
return ..()
|
|
|
|
/mob/living/simple_animal/hostile/statue/Life()
|
|
..()
|
|
if(!client && target) // If we have a target and we're AI controlled
|
|
var/mob/watching = can_be_seen()
|
|
// If they're not our target
|
|
if(watching && watching != target)
|
|
// This one is closer.
|
|
if(get_dist(watching, src) > get_dist(target, src))
|
|
LoseTarget()
|
|
GiveTarget(watching)
|
|
|
|
/mob/living/simple_animal/hostile/statue/AttackingTarget()
|
|
if(can_be_seen(get_turf(loc)))
|
|
if(client)
|
|
to_chat(src, "<span class='warning'>You cannot attack, there are eyes on you!</span>")
|
|
return FALSE
|
|
else
|
|
return ..()
|
|
|
|
/mob/living/simple_animal/hostile/statue/DestroySurroundings()
|
|
if(!can_be_seen(get_turf(loc)))
|
|
..()
|
|
|
|
/mob/living/simple_animal/hostile/statue/face_atom()
|
|
if(!can_be_seen(get_turf(loc)))
|
|
..()
|
|
|
|
/mob/living/simple_animal/hostile/statue/proc/can_be_seen(turf/destination)
|
|
if(!cannot_be_seen)
|
|
return null
|
|
// Check for darkness
|
|
var/turf/T = get_turf(loc)
|
|
if(T && destination && T.lighting_object)
|
|
if(T.get_lumcount()<0.1 && destination.get_lumcount()<0.1) // No one can see us in the darkness, right?
|
|
return null
|
|
if(T == destination)
|
|
destination = null
|
|
|
|
// We aren't in darkness, loop for viewers.
|
|
var/list/check_list = list(src)
|
|
if(destination)
|
|
check_list += destination
|
|
|
|
// This loop will, at most, loop twice.
|
|
for(var/atom/check in check_list)
|
|
for(var/mob/living/M in viewers(world.view + 1, check) - src)
|
|
if(M.client && CanAttack(M) && !M.has_unlimited_silicon_privilege)
|
|
if(!M.eye_blind)
|
|
return M
|
|
for(var/obj/mecha/M in view(world.view + 1, check)) //assuming if you can see them they can see you
|
|
if(M.occupant && M.occupant.client)
|
|
if(!M.occupant.eye_blind)
|
|
return M.occupant
|
|
return null
|
|
|
|
// Cannot talk
|
|
|
|
/mob/living/simple_animal/hostile/statue/say()
|
|
return 0
|
|
|
|
// Turn to dust when gibbed
|
|
|
|
/mob/living/simple_animal/hostile/statue/gib()
|
|
dust()
|
|
|
|
|
|
// Stop attacking clientless mobs
|
|
|
|
/mob/living/simple_animal/hostile/statue/CanAttack(atom/the_target)
|
|
if(isliving(the_target))
|
|
var/mob/living/L = the_target
|
|
if(!L.client && !L.ckey)
|
|
return 0
|
|
return ..()
|
|
|
|
// Don't attack your creator if there is one
|
|
|
|
/mob/living/simple_animal/hostile/statue/ListTargets()
|
|
. = ..()
|
|
return . - creator
|
|
|
|
// Statue powers
|
|
|
|
// Flicker lights
|
|
/obj/effect/proc_holder/spell/aoe_turf/flicker_lights
|
|
name = "Flicker Lights"
|
|
desc = "You will trigger a large amount of lights around you to flicker."
|
|
|
|
charge_max = 300
|
|
clothes_req = 0
|
|
range = 14
|
|
|
|
/obj/effect/proc_holder/spell/aoe_turf/flicker_lights/cast(list/targets,mob/user = usr)
|
|
for(var/turf/T in targets)
|
|
for(var/obj/machinery/light/L in T)
|
|
L.flicker()
|
|
return
|
|
|
|
//Blind AOE
|
|
/obj/effect/proc_holder/spell/aoe_turf/blindness
|
|
name = "Blindness"
|
|
desc = "Your prey will be momentarily blind for you to advance on them."
|
|
|
|
message = "<span class='notice'>You glare your eyes.</span>"
|
|
charge_max = 600
|
|
clothes_req = 0
|
|
range = 10
|
|
|
|
/obj/effect/proc_holder/spell/aoe_turf/blindness/cast(list/targets,mob/user = usr)
|
|
for(var/mob/living/L in GLOB.living_mob_list)
|
|
var/turf/T = get_turf(L.loc)
|
|
if(T && T in targets)
|
|
L.blind_eyes(4)
|
|
return
|
|
|
|
//Toggle Night Vision
|
|
/obj/effect/proc_holder/spell/targeted/night_vision
|
|
name = "Toggle Nightvision \[ON\]"
|
|
desc = "Toggle your nightvision mode."
|
|
|
|
charge_max = 10
|
|
clothes_req = 0
|
|
|
|
message = "<span class='notice'>You toggle your night vision!</span>"
|
|
range = -1
|
|
include_user = 1
|
|
|
|
/obj/effect/proc_holder/spell/targeted/night_vision/cast(list/targets, mob/user = usr)
|
|
for(var/mob/living/target in targets)
|
|
switch(target.lighting_alpha)
|
|
if (LIGHTING_PLANE_ALPHA_VISIBLE)
|
|
target.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
|
|
name = "Toggle Nightvision \[More]"
|
|
if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE)
|
|
target.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
|
|
name = "Toggle Nightvision \[Full]"
|
|
if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE)
|
|
target.lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
|
|
name = "Toggle Nightvision \[OFF]"
|
|
else
|
|
target.lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
|
|
name = "Toggle Nightvision \[ON]"
|
|
target.update_sight()
|
|
|
|
/mob/living/simple_animal/hostile/statue/sentience_act()
|
|
faction -= "neutral"
|
|
|
|
/mob/living/simple_animal/hostile/statue/restrained(ignore_grab)
|
|
. = ..()
|
|
if(can_be_seen(loc))
|
|
return 1
|