mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 15:37:36 +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:
@@ -422,7 +422,6 @@
|
||||
item_state = "grenade"
|
||||
materials = list(MAT_METAL = 500, MAT_GLASS = 300) //plasma burned up for power or something, plus not that much to reclaim
|
||||
|
||||
|
||||
/obj/item/storage/box/syndie_kit/dropwall
|
||||
name = "dropwall generator box"
|
||||
|
||||
@@ -474,6 +473,33 @@
|
||||
turret.owner_uid = owner_uid
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/barricade/foam
|
||||
name = "foam blockage"
|
||||
desc = "This foam blocks the airlock from being opened."
|
||||
icon = 'icons/obj/foam_blobs.dmi'
|
||||
icon_state = "foamed_1"
|
||||
layer = DOOR_HELPER_LAYER
|
||||
// The integrity goes up with 25 per level, with an extra 25 when going from 4 to 5
|
||||
obj_integrity = 25
|
||||
max_integrity = 25
|
||||
/// What level is the foam at?
|
||||
var/foam_level = 1
|
||||
|
||||
/obj/structure/barricade/foam/Destroy()
|
||||
for(var/obj/machinery/door/airlock in loc.contents)
|
||||
airlock.foam_level = 0
|
||||
return ..()
|
||||
|
||||
/obj/structure/barricade/foam/examine(mob/user)
|
||||
. = ..()
|
||||
. += "It would need [(5 - foam_level)] more blobs of foam to fully block the airlock."
|
||||
|
||||
/obj/structure/barricade/foam/CanPass(atom/movable/mover, turf/target)
|
||||
return istype(mover, /obj/item/projectile/c_foam) // Only c_foam blobs hit the airlock underneat/pass through the foam. The rest is hitting the barricade
|
||||
|
||||
/obj/structure/barricade/foam/welder_act(mob/user, obj/item/I)
|
||||
return FALSE
|
||||
|
||||
#undef SINGLE
|
||||
#undef VERTICAL
|
||||
#undef HORIZONTAL
|
||||
|
||||
@@ -48,9 +48,13 @@
|
||||
var/polarized_glass = FALSE
|
||||
var/polarized_on
|
||||
|
||||
/// How many levels of foam do we have on us? Capped at 5
|
||||
var/foam_level = 0
|
||||
|
||||
/// How much this door reduces superconductivity to when closed.
|
||||
var/superconductivity = DOOR_HEAT_TRANSFER_COEFFICIENT
|
||||
|
||||
|
||||
/obj/machinery/door/Initialize(mapload)
|
||||
. = ..()
|
||||
set_init_door_layer()
|
||||
@@ -93,7 +97,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/Bumped(atom/AM)
|
||||
if(operating || emagged)
|
||||
if(operating || emagged || foam_level)
|
||||
return
|
||||
if(ismob(AM))
|
||||
var/mob/B = AM
|
||||
@@ -150,6 +154,9 @@
|
||||
return
|
||||
add_fingerprint(user)
|
||||
|
||||
if(foam_level)
|
||||
return
|
||||
|
||||
if(density && !emagged)
|
||||
if(allowed(user))
|
||||
if(HAS_TRAIT(src, TRAIT_CMAGGED))
|
||||
@@ -172,8 +179,12 @@
|
||||
if(isterrorspider(user))
|
||||
return
|
||||
|
||||
if(foam_level)
|
||||
return
|
||||
|
||||
if(!HAS_TRAIT(user, TRAIT_FORCE_DOORS))
|
||||
return FALSE
|
||||
|
||||
var/datum/antagonist/vampire/V = user.mind?.has_antag_datum(/datum/antagonist/vampire)
|
||||
if(V && HAS_TRAIT_FROM(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT))
|
||||
if(!V.bloodusable)
|
||||
@@ -209,7 +220,7 @@
|
||||
|
||||
/obj/machinery/door/proc/try_to_activate_door(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(operating || emagged)
|
||||
if(operating || emagged || foam_level)
|
||||
return
|
||||
if(requiresID() && (allowed(user) || user.can_advanced_admin_interact()))
|
||||
if(density)
|
||||
@@ -574,3 +585,29 @@
|
||||
|
||||
for(var/obj/airlock_filler_object/filler as anything in fillers)
|
||||
filler.set_opacity(opacity)
|
||||
|
||||
#define MAX_FOAM_LEVEL 5
|
||||
// Adds foam to the airlock, which will block it from being opened
|
||||
/obj/machinery/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
|
||||
|
||||
@@ -527,7 +527,7 @@
|
||||
if(!action_checks(target))
|
||||
return
|
||||
if(isobj(target))
|
||||
if(!istype(target, /obj/machinery/door))//early return if we're not trying to open a door
|
||||
if(!isairlock(target))//early return if we're not trying to open a door
|
||||
return
|
||||
var/obj/machinery/door/D = target //the door we want to open
|
||||
D.try_to_crowbar(chassis.occupant, src)//use the door's crowbar function
|
||||
|
||||
@@ -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