mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Migrate holosign projectors to the new attack chain. (#32278)
* Migrate holosign projectors to the new attack chain. * Apply suggestions from CRUNCH review Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Signed-off-by: Alan <alfalfascout@users.noreply.github.com> * Move sign creation (and timer starting) to helper proc. * Allow placing in storage. --------- Signed-off-by: Alan <alfalfascout@users.noreply.github.com> Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
@@ -12,50 +12,73 @@
|
||||
flags = NOBLUDGEON
|
||||
var/list/signs = list()
|
||||
var/max_signs = 6
|
||||
var/creation_time = 0 //time to create a holosign in deciseconds.
|
||||
/// Time to create a holosign in deciseconds.
|
||||
var/creation_time = 0
|
||||
var/holosign_type = null
|
||||
var/holocreator_busy = FALSE //to prevent placing multiple holo barriers at once
|
||||
var/holocreator_busy = FALSE // To prevent placing multiple holo barriers at once.
|
||||
new_attack_chain = TRUE
|
||||
|
||||
/obj/item/holosign_creator/afterattack__legacy__attackchain(atom/target, mob/user, flag)
|
||||
if(flag)
|
||||
if(!check_allowed_items(target, 1))
|
||||
/obj/item/holosign_creator/interact_with_atom(atom/target, mob/living/user, list/modifiers)
|
||||
if(isstorage(target))
|
||||
return ..()
|
||||
|
||||
if(!check_allowed_items(target, 1))
|
||||
to_chat(user, SPAN_WARNING("You can't create a holosign there!"))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
var/turf/target_turf = get_turf(target)
|
||||
var/obj/structure/holosign/existing_sign = locate(holosign_type) in target_turf
|
||||
if(existing_sign)
|
||||
to_chat(user, SPAN_NOTICE("You use [src] to deactivate [existing_sign]."))
|
||||
qdel(existing_sign)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(target_turf.is_blocked_turf(exclude_mobs = TRUE)) // Can't put holograms on a tile that has dense stuff.
|
||||
to_chat(user, SPAN_WARNING("You can't create a holosign there because it's blocked!"))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(holocreator_busy)
|
||||
to_chat(user, SPAN_WARNING("[src] is busy creating a hologram!"))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(length(signs) >= max_signs)
|
||||
to_chat(user, SPAN_WARNING("[src] is projecting at max capacity!"))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
create_sign(target_turf, user)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/holosign_creator/proc/create_sign(turf/target, mob/user)
|
||||
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
|
||||
var/turf/T = get_turf(target)
|
||||
var/obj/structure/holosign/H = locate(holosign_type) in T
|
||||
if(H)
|
||||
to_chat(user, SPAN_NOTICE("You use [src] to deactivate [H]."))
|
||||
qdel(H)
|
||||
else
|
||||
if(!T.is_blocked_turf(exclude_mobs = TRUE)) //can't put holograms on a tile that has dense stuff
|
||||
if(holocreator_busy)
|
||||
to_chat(user, SPAN_NOTICE("[src] is busy creating a hologram."))
|
||||
return
|
||||
if(length(signs) < 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(length(signs) >= max_signs)
|
||||
return
|
||||
if(T.is_blocked_turf(exclude_mobs = 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_NOTICE("You create [H] with [src]."))
|
||||
return H
|
||||
else
|
||||
to_chat(user, SPAN_NOTICE("[src] is projecting at max capacity!"))
|
||||
|
||||
/obj/item/holosign_creator/attack__legacy__attackchain(mob/living/carbon/human/M, mob/user)
|
||||
return
|
||||
holocreator_busy = FALSE
|
||||
if(length(signs) >= max_signs)
|
||||
return
|
||||
|
||||
/obj/item/holosign_creator/attack_self__legacy__attackchain(mob/user)
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
to_chat(user, SPAN_NOTICE("You clear all active holograms."))
|
||||
if(target.is_blocked_turf(exclude_mobs = TRUE)) // Don't try to sneak dense stuff on our tile during the wait.
|
||||
return
|
||||
|
||||
var/obj/structure/holosign/new_sign = new holosign_type(get_turf(target), src)
|
||||
to_chat(user, SPAN_NOTICE("You create [new_sign] with [src]."))
|
||||
|
||||
return new_sign
|
||||
|
||||
/obj/item/holosign_creator/activate_self(mob/user)
|
||||
if(..())
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(!length(signs))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
to_chat(user, SPAN_NOTICE("You clear all active holograms."))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/holosign_creator/janitor
|
||||
name = "janitorial holosign projector"
|
||||
@@ -77,11 +100,11 @@
|
||||
if(ishuman(user))
|
||||
. += SPAN_NOTICE("Alt Click to [wet_enabled ? "deactivate" : "activate"] its built-in wet evaporation timer.")
|
||||
|
||||
|
||||
/obj/item/holosign_creator/janitor/afterattack__legacy__attackchain(atom/target, mob/user, flag)
|
||||
var/obj/structure/holosign/wetsign/WS = ..()
|
||||
if(WS && wet_enabled)
|
||||
WS.wet_timer_start(src)
|
||||
/obj/item/holosign_creator/janitor/create_sign(turf/target, mob/user)
|
||||
var/obj/structure/holosign/wetsign/new_sign = ..()
|
||||
if(istype(new_sign) && wet_enabled)
|
||||
new_sign.wet_timer_start(src)
|
||||
return new_sign
|
||||
|
||||
/obj/item/holosign_creator/security
|
||||
name = "security holobarrier projector"
|
||||
@@ -124,34 +147,32 @@
|
||||
holosign_type = /obj/structure/holosign/barrier/cyborg
|
||||
var/shock = 0
|
||||
|
||||
/obj/item/holosign_creator/cyborg/attack_self__legacy__attackchain(mob/user)
|
||||
if(isrobot(user))
|
||||
var/mob/living/silicon/robot/R = user
|
||||
/obj/item/holosign_creator/cyborg/activate_self(mob/user)
|
||||
var/mob/living/silicon/robot/robot_user = user
|
||||
|
||||
if(shock)
|
||||
to_chat(user, SPAN_NOTICE("You clear all active holograms, and reset your projector to normal."))
|
||||
holosign_type = /obj/structure/holosign/barrier/cyborg
|
||||
creation_time = 5
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
shock = 0
|
||||
return
|
||||
else if(R.emagged && !shock)
|
||||
to_chat(user, SPAN_WARNING("You clear all active holograms, and overload your energy projector!"))
|
||||
holosign_type = /obj/structure/holosign/barrier/cyborg/hacked
|
||||
creation_time = 30
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
shock = 1
|
||||
return
|
||||
else
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
to_chat(user, SPAN_NOTICE("You clear all active holograms."))
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
to_chat(user, SPAN_NOTICE("You clear all active holograms."))
|
||||
if(isrobot(user) && shock)
|
||||
to_chat(user, SPAN_NOTICE("You clear all active holograms, and reset your projector to normal."))
|
||||
holosign_type = /obj/structure/holosign/barrier/cyborg
|
||||
creation_time = 5
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
shock = 0
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(isrobot(user) && robot_user.emagged && !shock)
|
||||
to_chat(user, SPAN_WARNING("You clear all active holograms, and overload your energy projector!"))
|
||||
holosign_type = /obj/structure/holosign/barrier/cyborg/hacked
|
||||
creation_time = 30
|
||||
if(length(signs))
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
shock = 1
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
if(!length(signs))
|
||||
return ..()
|
||||
for(var/H in signs)
|
||||
qdel(H)
|
||||
to_chat(user, SPAN_NOTICE("You clear all active holograms."))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
Reference in New Issue
Block a user