mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 14:31:59 +01:00
Foam Time (#10776)
Added a mounted foam sprayer to the mechfab hardsuit modules tab. It's a hardsuit module that consumes 1500 cell charge to spray a line of metal foam.
Added some effects to metal foam walls that make them a bit more flashy when destroyed, as well as adding a click cooldown so they can't be spammed down.
Aggressively slamming someone through a metal foam wall now does some damage to them.
Clicking on a metal foam wall with building materials will now attempt to turn it into a wall, taking a bit longer than a standard girder would. Clicking on it with a floor tile will now turn it into plating, if the space below is an open space or actual space.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
layer = OBJ_LAYER + 0.9
|
||||
mouse_opacity = 0
|
||||
animate_movement = 0
|
||||
var/solid_time = 120
|
||||
var/amount = 3
|
||||
var/expand = 1
|
||||
var/metal = 0
|
||||
@@ -21,7 +22,7 @@
|
||||
metal = ismetal
|
||||
playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
|
||||
addtimer(CALLBACK(src, .proc/tick), 3 + metal * 3)
|
||||
addtimer(CALLBACK(src, .proc/post), 120)
|
||||
addtimer(CALLBACK(src, .proc/post), solid_time)
|
||||
|
||||
/obj/effect/effect/foam/proc/tick()
|
||||
process()
|
||||
@@ -81,6 +82,13 @@
|
||||
var/mob/living/M = AM
|
||||
M.slip("the foam", 6)
|
||||
|
||||
/obj/effect/effect/foam/spray
|
||||
amount = 1 // only spread a little bit
|
||||
solid_time = 3 SECONDS
|
||||
|
||||
/obj/effect/effect/foam/spray/initial
|
||||
amount = 0 // don't spread
|
||||
|
||||
/datum/effect/effect/system/foam_spread
|
||||
var/amount = 5 // the size of the foam spread.
|
||||
var/list/carried_reagents // the IDs of reagents present when the foam was mixed
|
||||
@@ -157,27 +165,72 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/foamedmetal/attack_hand(var/mob/user)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
user.do_attack_animation(src, FIST_ATTACK_ANIMATION)
|
||||
if ((HULK in user.mutations) || (prob(75 - metal * 25)))
|
||||
user.visible_message("<span class='warning'>[user] smashes through the foamed metal.</span>", "<span class='notice'>You smash through the metal foam wall.</span>")
|
||||
user.visible_message(SPAN_WARNING("[user] smashes through the foamed metal."), SPAN_NOTICE("You smash through the metal foam wall."))
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You hit the metal foam but bounce off it.</span>")
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You hit the metal foam but bounce off it."))
|
||||
animate_shake()
|
||||
|
||||
/obj/structure/foamedmetal/attackby(var/obj/item/I, var/mob/user)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if(istype(I, /obj/item/grab))
|
||||
var/obj/item/grab/G = I
|
||||
if(G.state < GRAB_AGGRESSIVE)
|
||||
to_chat(user, SPAN_WARNING("You need a stronger grip to do that!"))
|
||||
return
|
||||
G.affecting.forceMove(src.loc)
|
||||
visible_message("<span class='warning'>[G.assailant] smashes [G.affecting] through the foamed metal wall.</span>")
|
||||
visible_message(SPAN_WARNING("[G.assailant] smashes [G.affecting] through the foamed metal wall."))
|
||||
G.affecting.take_overall_damage(15)
|
||||
qdel(I)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/stack/material))
|
||||
var/obj/item/stack/material/S = I
|
||||
if(S.get_amount() < 4)
|
||||
to_chat(user, SPAN_NOTICE("There isn't enough material here to construct a wall."))
|
||||
return
|
||||
|
||||
var/material/M = SSmaterials.get_material_by_name(S.default_type)
|
||||
if(!istype(M))
|
||||
return
|
||||
if(M.integrity < 50)
|
||||
to_chat(user, SPAN_NOTICE("This material is too soft for use in wall construction."))
|
||||
return
|
||||
user.visible_message("<b>[user]</b> starts slotting material into \the [src]...", SPAN_NOTICE("You start slotting material into \the [src], forming it into a wall..."))
|
||||
if(!do_after(user, 10 SECONDS) || !S.use(4))
|
||||
return
|
||||
var/turf/Tsrc = get_turf(src)
|
||||
var/original_type = Tsrc.type
|
||||
Tsrc.ChangeTurf(/turf/simulated/wall)
|
||||
var/turf/simulated/wall/T = Tsrc
|
||||
T.under_turf = original_type
|
||||
T.set_material(M)
|
||||
T.add_hiddenprint(usr)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
else if(istype(I, /obj/item/stack/tile/floor))
|
||||
var/turf/T = get_turf(src)
|
||||
if(T.type != /turf/space && !isopenturf(T)) // need to do a hard check here because transit turfs are also space turfs
|
||||
to_chat(user, SPAN_WARNING("The tile below \the [src] isn't an open space, or space itself!"))
|
||||
return
|
||||
var/obj/item/stack/tile/floor/S = I
|
||||
S.use(1)
|
||||
T.ChangeTurf(/turf/simulated/floor/airless)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
user.do_attack_animation(src, I)
|
||||
if(prob(I.force * 20 - metal * 25))
|
||||
user.visible_message("<span class='warning'>[user] smashes through the foamed metal.</span>", "<span class='notice'>You smash through the foamed metal with \the [I].</span>")
|
||||
user.visible_message(SPAN_WARNING("[user] smashes through the foamed metal."), SPAN_NOTICE("You smash through the foamed metal with \the [I]."))
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You hit the metal foam to no effect.</span>")
|
||||
to_chat(user, SPAN_NOTICE("You hit the metal foam to no effect."))
|
||||
animate_shake()
|
||||
|
||||
/obj/structure/foamedmetal/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
if(air_group)
|
||||
|
||||
Reference in New Issue
Block a user