RCD Improvements + Holofans + fixes (#6738)

This commit is contained in:
BlackMajor
2023-08-07 03:07:59 +12:00
committed by GitHub
parent 70c3599a77
commit 7fd1ff3dc5
22 changed files with 1571 additions and 13 deletions

View File

@@ -0,0 +1,64 @@
/obj/item/weapon/holosign_creator
name = "holographic sign projector"
desc = "A handy-dandy holographic projector that displays a janitorial sign."
icon = 'icons/obj/device.dmi'
icon_state = "signmaker"
item_state = "electronic"
force = 0
w_class = 2
throwforce = 0
throw_speed = 3
throw_range = 7
var/list/signs = list()
var/max_signs = 10
var/creation_time = 0 //time to create a holosign in deciseconds.
var/holosign_type = /obj/structure/holosign/wetsign
var/holocreator_busy = FALSE //to prevent placing multiple holo barriers at once
/obj/item/weapon/holosign_creator/afterattack(atom/target, mob/user, clickchain_flags, list/params)
. = ..()
if(!check_allowed_items(target, 1))
return
var/turf/T = get_turf(target)
var/obj/structure/holosign/H = locate(holosign_type) in T
if(H)
to_chat(user, "<span class='notice'>You use [src] to deactivate [H].</span>")
qdel(H)
else
if(!is_blocked_turf(T, TRUE)) //can't put holograms on a tile that has dense stuff
if(holocreator_busy)
to_chat(user, "<span class='notice'>[src] is busy creating a hologram.</span>")
return
if(signs.len < max_signs)
playsound(src.loc, 'sound/machines/click.ogg', 20, 1)
if(creation_time)
holocreator_busy = TRUE
if(!do_after(user, creation_time, target = target))
holocreator_busy = FALSE
return
holocreator_busy = FALSE
if(signs.len >= max_signs)
return
if(is_blocked_turf(T, TRUE)) //don't try to sneak dense stuff on our tile during the wait.
return
H = new holosign_type(get_turf(target), src)
to_chat(user, "<span class='notice'>You create \a [H] with [src].</span>")
else
to_chat(user, "<span class='notice'>[src] is projecting at max capacity!</span>")
/obj/item/weapon/holosign_creator/attack_self(mob/user)
. = ..()
if(.)
return
if(signs.len)
for(var/H in signs)
qdel(H)
to_chat(user, "<span class='notice'>You clear all active holograms.</span>")
/obj/item/weapon/holosign_creator/combifan
name = "ATMOS holo-combifan projector"
desc = "A holographic projector that creates holographic combi-fans that prevent changes in atmosphere and temperature conditions. Somehow."
icon_state = "signmaker_engi"
holosign_type = /obj/structure/holosign/barrier/combifan
creation_time = 0
max_signs = 3

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,70 @@
/obj/structure/holosign
name = "holo sign"
icon = 'icons/effects/effects_ch.dmi'
anchored = TRUE
var/obj/item/weapon/holosign_creator/projector
var/health = 10
explosion_resistance = 1
/obj/structure/holosign/Initialize(mapload, source_projector)
. = ..()
if(source_projector)
projector = source_projector
projector.signs += src
/* if(overlays) // Fucking god damnit why do we have to have an entire different subsystem for this shit from other codebases.
overlays.add_overlay(src, icon, icon_state, ABOVE_MOB_LAYER, plane, dir, alpha, RESET_ALPHA) //you see mobs under it, but you hit them like they are above it
alpha = 0
*/
/obj/structure/holosign/Destroy()
if(projector)
projector.signs -= src
projector = null
return ..()
/obj/structure/holosign/attack_hand(mob/user, list/params)
. = ..()
if(.)
return
user.setClickCooldown(user.get_attack_speed())
user.do_attack_animation(src)
take_damage(5)
playsound(loc, 'sound/weapons/egloves.ogg', 80, 1)
/obj/structure/holosign/attackby(obj/item/W as obj, mob/user as mob)
user.setClickCooldown(user.get_attack_speed(W))
user.do_attack_animation(src)
playsound(loc, 'sound/weapons/egloves.ogg', 80, 1)
take_damage(W.force)
/obj/structure/holosign/take_damage(var/damage)
health -= damage
spawn(1) healthcheck()
return 1
/obj/structure/holosign/proc/healthcheck()
if(health <= 0)
qdel(src)
/obj/structure/holosign/wetsign
name = "wet floor sign"
desc = "The words flicker as if they mean nothing."
icon_state = "holosign"
/obj/structure/holosign/barrier/combifan
name = "holo combifan"
desc = "A holographic barrier resembling a blue-accented tiny fan. Though it does not prevent solid objects from passing through, gas and temperature changes are kept out."
icon_state = "holo_firelock"
anchored = TRUE
density = FALSE
layer = ABOVE_TURF_LAYER
can_atmos_pass = ATMOS_PASS_NO
alpha = 150
/obj/structure/holosign/barrier/combifan/Destroy()
update_nearby_tiles()
return ..()
/obj/structure/holosign/barrier/combifan/Initialize(mapload)
.=..()
update_nearby_tiles()