mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-22 04:37:45 +01:00
Adds atom/movable cloaking framework
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
..() //Creates the plane_holder lazily
|
||||
plane_holder.set_vis(VIS_GHOSTS, ghostvision)
|
||||
plane_holder.set_vis(VIS_FULLBRIGHT, !seedarkness)
|
||||
plane_holder.set_vis(VIS_CLOAKED, TRUE)
|
||||
plane_holder.set_vis(VIS_AI_EYE, TRUE)
|
||||
plane_holder.set_vis(VIS_AUGMENTED, TRUE) //VOREStation Add - GHOST VISION IS AUGMENTED
|
||||
plane = PLANE_GHOSTS
|
||||
|
||||
@@ -47,29 +47,12 @@
|
||||
|
||||
ai_holder_type = /datum/ai_holder/simple_mob/melee/hit_and_run
|
||||
|
||||
var/cloaked = FALSE
|
||||
var/cloaked_alpha = 45 // Lower = Harder to see.
|
||||
var/cloaked_bonus_damage = 30 // This is added on top of the normal melee damage.
|
||||
var/cloaked_weaken_amount = 3 // How long to stun for.
|
||||
var/cloak_cooldown = 10 SECONDS // Amount of time needed to re-cloak after losing it.
|
||||
var/last_uncloak = 0 // world.time
|
||||
|
||||
|
||||
/mob/living/simple_mob/animal/giant_spider/lurker/proc/cloak()
|
||||
if(cloaked)
|
||||
return
|
||||
animate(src, alpha = cloaked_alpha, time = 1 SECOND)
|
||||
cloaked = TRUE
|
||||
|
||||
|
||||
/mob/living/simple_mob/animal/giant_spider/lurker/proc/uncloak()
|
||||
last_uncloak = world.time // This is assigned even if it isn't cloaked already, to 'reset' the timer if the spider is continously getting attacked.
|
||||
if(!cloaked)
|
||||
return
|
||||
animate(src, alpha = initial(alpha), time = 1 SECOND)
|
||||
cloaked = FALSE
|
||||
|
||||
|
||||
// Check if cloaking if possible.
|
||||
/mob/living/simple_mob/animal/giant_spider/lurker/proc/can_cloak()
|
||||
if(stat)
|
||||
@@ -79,7 +62,6 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
// Called by things that break cloaks, like Technomancer wards.
|
||||
/mob/living/simple_mob/animal/giant_spider/lurker/break_cloak()
|
||||
uncloak()
|
||||
|
||||
@@ -74,4 +74,7 @@
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(isturf(T))
|
||||
update_client_z(T.z)
|
||||
update_client_z(T.z)
|
||||
|
||||
if(cloaked && cloaked_selfimage)
|
||||
client.images += cloaked_selfimage
|
||||
@@ -1197,3 +1197,25 @@ mob/proc/yank_out_object()
|
||||
/mob/onTransitZ(old_z, new_z)
|
||||
..()
|
||||
update_client_z(new_z)
|
||||
|
||||
/mob/cloak()
|
||||
. = ..()
|
||||
if(client && cloaked_selfimage)
|
||||
client.images += cloaked_selfimage
|
||||
|
||||
/mob/uncloak()
|
||||
if(client && cloaked_selfimage)
|
||||
client.images -= cloaked_selfimage
|
||||
return ..()
|
||||
|
||||
/mob/get_cloaked_selfimage()
|
||||
var/icon/selficon = getCompoundIcon(src)
|
||||
selficon.MapColors(0,0,0, 0,0,0, 0,0,0, 1,1,1) //White
|
||||
var/image/selfimage = image(selficon)
|
||||
selfimage.color = "#0000FF"
|
||||
selfimage.alpha = 100
|
||||
selfimage.layer = initial(layer)
|
||||
selfimage.plane = initial(plane)
|
||||
selfimage.loc = src
|
||||
|
||||
return selfimage
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
plane_masters[VIS_TURFS] = new /obj/screen/plane_master/main{plane = TURF_PLANE}
|
||||
plane_masters[VIS_OBJS] = new /obj/screen/plane_master/main{plane = OBJ_PLANE}
|
||||
plane_masters[VIS_MOBS] = new /obj/screen/plane_master/main{plane = MOB_PLANE}
|
||||
plane_masters[VIS_CLOAKED] = new /obj/screen/plane_master/cloaked //Cloaked atoms!
|
||||
|
||||
..()
|
||||
|
||||
@@ -178,6 +179,13 @@
|
||||
plane = PLANE_GHOSTS
|
||||
desired_alpha = 127 //When enabled, they're like half-transparent
|
||||
|
||||
/////////////////
|
||||
//Cloaked atoms are visible to ghosts (or for other reasons?)
|
||||
/obj/screen/plane_master/cloaked
|
||||
plane = CLOAKED_PLANE
|
||||
desired_alpha = 80
|
||||
color = "#0000FF"
|
||||
|
||||
/////////////////
|
||||
//The main game planes start normal and visible
|
||||
/obj/screen/plane_master/main
|
||||
|
||||
Reference in New Issue
Block a user