mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-17 10:03:50 +01:00
Adds: The C-Foam launcher (#25738)
* The start * Getting a bit further * Slight ammo casing update * Istype helper and foam blockage * Adds status effect * Foam blockage and status effect fixes * Autolathe ammo + stun * aaaaaaaa * Adds uplink item * Actual slowdown * Makes attacking a bit faster again * Ammo increase to 12 * Sirryan review * Adds sprites - almost working * Lots of fixes + mineral doors * Mineral doors don't open with foam
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* The C-Foam launcher from GTFO
|
||||
* Shoots a blob of goo. If it hits an airlock, it will get closed shut, and you will have to either destroy the goo by force, or weld it off. The RnD foam is instant, and the traitor version has a `do_after`
|
||||
* RnD printed needs canisters, while the traitor variant will slowly regenerate foam.
|
||||
* The traitor variant also slows down mobs if they are hit by the foam.
|
||||
* Overall, a good support tool designed to
|
||||
*/
|
||||
|
||||
/obj/item/gun/projectile/c_foam_launcher
|
||||
name = "\improper C-Foam launcher"
|
||||
desc = "The C-Foam launcher. Shoots blobs of quickly hardening and growing foam. Can be used to slow down humanoids or block airlocks"
|
||||
icon_state = "c_foam_launcher"
|
||||
item_state = "c_foam_launcher"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
origin_tech = "combat=4;syndicate=1;materials=3"
|
||||
needs_permit = FALSE
|
||||
|
||||
fire_sound = 'sound/effects/bamf.ogg'
|
||||
fire_sound_text = "thunk"
|
||||
mag_type = /obj/item/ammo_box/magazine/c_foam
|
||||
|
||||
/obj/item/gun/projectile/c_foam_launcher/update_icon_state()
|
||||
icon_state = "c_foam_launcher[magazine ? "_loaded" : ""]"
|
||||
|
||||
/obj/item/projectile/c_foam
|
||||
name = "blob of foam"
|
||||
icon_state = "foam_blob"
|
||||
damage = 0
|
||||
|
||||
/obj/item/projectile/c_foam/on_hit(atom/target, blocked, hit_zone)
|
||||
. = ..()
|
||||
if(isairlock(target))
|
||||
var/obj/machinery/door/airlock = target
|
||||
airlock.foam_up()
|
||||
return
|
||||
|
||||
if(istype(target, /obj/structure/mineral_door))
|
||||
var/obj/structure/mineral_door/door = target
|
||||
door.foam_up()
|
||||
return
|
||||
|
||||
if(iscarbon(target)) // For that funny xeno foam action
|
||||
var/mob/living/carbon/sticky = target
|
||||
sticky.foam_up()
|
||||
return
|
||||
@@ -54,7 +54,7 @@
|
||||
origin_tech = "magnets=2"
|
||||
|
||||
/obj/item/card/emag/magic_key/afterattack(atom/target, mob/user, proximity)
|
||||
if(!istype(target, /obj/machinery/door))
|
||||
if(!isairlock(target))
|
||||
return
|
||||
var/obj/machinery/door/D = target
|
||||
D.locked = FALSE
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
log_game("[key_name(user)] planted [name] on [target.name] at ([target.x],[target.y],[target.z]) with [det_time] second fuse")
|
||||
|
||||
plastic_overlay.layer = HIGH_OBJ_LAYER
|
||||
if(isturf(target) || istype(target, /obj/machinery/door))
|
||||
if(isturf(target) || isairlock(target))
|
||||
plastic_overlay_target = new /obj/effect/plastic(get_turf(user))
|
||||
else
|
||||
plastic_overlay_target = target
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/obj/item/pai_cable/proc/plugin(obj/machinery/M as obj, mob/user as mob)
|
||||
if(istype(M, /obj/machinery/door) || istype(M, /obj/machinery/camera))
|
||||
if(isairlock(M) || istype(M, /obj/machinery/camera))
|
||||
user.visible_message("[user] inserts [src] into a data port on [M].", "You insert [src] into a data port on [M].", "You hear the satisfying click of a wire jack fastening into place.")
|
||||
user.drop_item()
|
||||
src.loc = M
|
||||
|
||||
@@ -446,7 +446,7 @@
|
||||
if(T.density)
|
||||
return
|
||||
for(var/atom/A in T.contents)
|
||||
if(A.density && istype(A, /obj/machinery/door))
|
||||
if(A.density && isairlock(A))
|
||||
return
|
||||
UpdateTransparency(src, NewLoc)
|
||||
forceMove(NewLoc)
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
var/open_sound = 'sound/effects/stonedoor_openclose.ogg'
|
||||
var/close_sound = 'sound/effects/stonedoor_openclose.ogg'
|
||||
var/damageSound = null
|
||||
/// How much foam is on the door. Max 5 levels.
|
||||
var/foam_level = 0
|
||||
|
||||
/obj/structure/mineral_door/Initialize()
|
||||
. = ..()
|
||||
@@ -68,6 +70,8 @@
|
||||
/obj/structure/mineral_door/proc/try_to_operate(atom/user)
|
||||
if(is_operating)
|
||||
return
|
||||
if(foam_level)
|
||||
return
|
||||
if(isliving(user))
|
||||
var/mob/living/M = user
|
||||
if(M.client)
|
||||
@@ -216,3 +220,29 @@
|
||||
/obj/structure/mineral_door/wood/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/debris, DEBRIS_WOOD, -20, 10)
|
||||
|
||||
#define MAX_FOAM_LEVEL 5
|
||||
// Adds foam to the airlock, which will block it from being opened
|
||||
/obj/structure/mineral_door/proc/foam_up()
|
||||
if(!foam_level)
|
||||
new /obj/structure/barricade/foam(get_turf(src))
|
||||
foam_level++
|
||||
return
|
||||
|
||||
if(foam_level == MAX_FOAM_LEVEL)
|
||||
return
|
||||
|
||||
for(var/obj/structure/barricade/foam/blockage in loc.contents)
|
||||
blockage.foam_level = min(++blockage.foam_level, 5)
|
||||
// The last level will increase the integrity by 50 instead of 25
|
||||
if(foam_level == 4)
|
||||
blockage.obj_integrity += 50
|
||||
blockage.max_integrity += 50
|
||||
else
|
||||
blockage.obj_integrity += 25
|
||||
blockage.max_integrity += 25
|
||||
foam_level++
|
||||
blockage.icon_state = "foamed_[foam_level]"
|
||||
blockage.update_icon_state()
|
||||
|
||||
#undef MAX_FOAM_LEVEL
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
if(!has_buckled_mobs())
|
||||
return
|
||||
var/mob/living/buckled_mob = buckled_mobs[1]
|
||||
if(istype(A, /obj/machinery/door))
|
||||
if(isairlock(A))
|
||||
A.Bumped(buckled_mob)
|
||||
|
||||
if(propelled)
|
||||
|
||||
Reference in New Issue
Block a user