mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 15:08:02 +01:00
Makes the dropwall probably viable (#21094)
* Makes the dropwall probably viable * uses existing proc * Update code/game/machinery/deployable.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> * :gatto: Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> * Update deployable.dm --------- Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com> Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
co-authored by
Henri215
Contrabang
Ryan
parent
e4e5d5c84e
commit
038a7abc13
@@ -6,7 +6,9 @@
|
||||
#define WOOD 2
|
||||
#define SAND 3
|
||||
|
||||
#define DROPWALL_UPTIME 12
|
||||
#define DROPWALL_UPTIME 1 MINUTES
|
||||
|
||||
#define AUTO "automatic"
|
||||
|
||||
//Barricades/cover
|
||||
|
||||
@@ -227,6 +229,7 @@
|
||||
desc = "A temporary deployable energy shield powered by a generator. Breaking the generator will destroy all the shields connected to it."
|
||||
icon = 'icons/obj/dropwall.dmi'
|
||||
icon_state = "dropwall_dead" //sprite chosen in init
|
||||
armor = list(MELEE = 0, BULLET = 50, LASER = 50, ENERGY = 50, BOMB = 10, BIO = 100, RAD = 100, FIRE = 10, ACID = 0) // Copied from the security barrier, but no melee armor
|
||||
density = FALSE
|
||||
directional_blockage = TRUE
|
||||
proj_pass_rate = 100 //don't worry about it, covered by directional blockage.
|
||||
@@ -271,11 +274,17 @@
|
||||
icon = 'icons/obj/dropwall.dmi'
|
||||
icon_state = "dropwall"
|
||||
item_state = "grenade"
|
||||
mode = NORTH
|
||||
var/uptime = DROPWALL_UPTIME SECONDS
|
||||
mode = AUTO
|
||||
var/uptime = DROPWALL_UPTIME
|
||||
/// If this is true we do not arm again, due to the sleep
|
||||
var/deployed = FALSE
|
||||
/// Mob who armed it. Needed for the get_dir proc
|
||||
var/armer
|
||||
|
||||
/obj/item/grenade/barrier/dropwall/toggle_mode(mob/user)
|
||||
switch(mode)
|
||||
if(AUTO)
|
||||
mode = NORTH
|
||||
if(NORTH)
|
||||
mode = EAST
|
||||
if(EAST)
|
||||
@@ -283,12 +292,27 @@
|
||||
if(SOUTH)
|
||||
mode = WEST
|
||||
if(WEST)
|
||||
mode = NORTH
|
||||
mode = AUTO
|
||||
|
||||
to_chat(user, "[src] is now in [dir2text(mode)] mode.")
|
||||
to_chat(user, "[src] is now in [mode == AUTO ? mode : dir2text(mode)] mode.")
|
||||
|
||||
/obj/item/grenade/barrier/dropwall/attack_self(mob/user)
|
||||
. = ..()
|
||||
armer = user
|
||||
|
||||
|
||||
/obj/item/grenade/barrier/dropwall/end_throw()
|
||||
if(active)
|
||||
addtimer(CALLBACK(src, PROC_REF(prime)), 1) //Wait for the throw to fully end
|
||||
|
||||
/obj/item/grenade/barrier/dropwall/prime()
|
||||
if(deployed)
|
||||
return
|
||||
if(mode == AUTO)
|
||||
mode = angle2dir_cardinal(get_angle(armer, get_turf(src)))
|
||||
new /obj/structure/dropwall_generator(get_turf(loc), mode, uptime)
|
||||
deployed = TRUE
|
||||
armer = null
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/dropwall_generator
|
||||
@@ -355,6 +379,11 @@
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/dropwall_generator/ex_act(severity)
|
||||
if(protected && severity > 1) //We would throw the explosion at the shield, but it is already getting hit
|
||||
return
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/dropwall_generator/proc/power_out()
|
||||
visible_message("<span class='warning'>[src] runs out of power, causing its shields to fail!</span>")
|
||||
new /obj/item/used_dropwall(get_turf(src))
|
||||
@@ -395,3 +424,5 @@
|
||||
|
||||
|
||||
#undef DROPWALL_UPTIME
|
||||
|
||||
#undef AUTO
|
||||
|
||||
Reference in New Issue
Block a user