Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Doors rework #640

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
9 changes: 9 additions & 0 deletions modular_RUtgmc/code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/proc/supports_adjacent(turf/T)
var/supports = 0
for(var/diraction in GLOB.cardinals)
homexp13 marked this conversation as resolved.
Show resolved Hide resolved
var/turf/TS = get_step(T,diraction)
if(!TS)
continue
if(TS.density || locate(/obj/structure/mineral_door/resin) in TS)
supports++
return supports
1 change: 1 addition & 0 deletions modular_RUtgmc/code/game/objects/structures/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//Resin Doors
/obj/structure/mineral_door/resin
icon = 'modular_RUtgmc/icons/obj/smooth_objects/resin-door.dmi'
soft_armor = list(MELEE = 15, BULLET = 50, LASER = 40, ENERGY = 0, BOMB = 15, BIO = 0, FIRE = 0, ACID = 0)

/obj/structure/mineral_door/resin/attack_alien(mob/living/carbon/xenomorph/X, damage_amount = X.xeno_caste.melee_damage, damage_type = BRUTE, damage_flag = "", effects = TRUE, armor_penetration = 0, isrightclick = FALSE)
var/turf/cur_loc = X.loc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,22 @@
for(var/obj/structure/bed/nest/xeno_nest in range (2,T))
owner.balloon_alert(owner, span_notice("Another nest is too close!"))
return

if(X.selected_resin == /obj/structure/mineral_door/resin)
if(supports_adjacent(T) > 2)
owner.balloon_alert(owner, span_notice("Too many adjacent supports!"))
return
var/turf/TS
homexp13 marked this conversation as resolved.
Show resolved Hide resolved
for(var/diraction in GLOB.cardinals)
TS = get_step(T, diraction)
if(!istype(TS))
continue
var/obj/structure/mineral_door/resin/door = locate(/obj/structure/mineral_door/resin) in TS
if(door && supports_adjacent(get_turf(door)) > 1)
owner.balloon_alert(owner, span_notice("Too many adjaecent supports for door!"))
homexp13 marked this conversation as resolved.
Show resolved Hide resolved
return
return ..()


/// A version of build_resin with the plasma drain and distance checks removed.
/datum/action/ability/activable/xeno/secrete_resin/proc/preshutter_build_resin(turf/T)
if(!SSresinshaping.active)
Expand Down Expand Up @@ -112,6 +125,20 @@
owner.balloon_alert(owner, span_notice("Another nest is too close!"))
return

if(X.selected_resin == /obj/structure/mineral_door/resin)
if(supports_adjacent(T) > 2)
owner.balloon_alert(owner, span_notice("Too many adjacent supports!"))
return
var/turf/TS
for(var/diraction in GLOB.cardinals)
TS = get_step(T, diraction)
if(!istype(TS))
continue
var/obj/structure/mineral_door/resin/door = locate(/obj/structure/mineral_door/resin) in TS
if(door && supports_adjacent(get_turf(door)) > 1)
owner.balloon_alert(owner, span_notice("Too many adjaecent supports for door!"))
homexp13 marked this conversation as resolved.
Show resolved Hide resolved
return

var/atom/new_resin
if(ispath(X.selected_resin, /turf)) // We should change turfs, not spawn them in directly
var/list/baseturfs = islist(T.baseturfs) ? T.baseturfs : list(T.baseturfs)
Expand Down
1 change: 1 addition & 0 deletions modular_RUtgmc/includes.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "code\__HELPERS\text.dm"
#include "code\__HELPERS\unsorted.dm"
#include "code\__HELPERS\game.dm"
#include "code\_globalvars\lists\flavor_misc.dm"
#include "code\_globalvars\lists\mapping.dm"
#include "code\_globalvars\lists\mobs.dm"
Expand Down
Loading