Added a better framework for multi-tile doors, pulling works strangely though.

This commit is contained in:
SkyMarshal
2013-06-24 17:05:15 -07:00
parent 9823537c65
commit aa85e757d4
10 changed files with 86 additions and 44 deletions

View File

@@ -388,6 +388,7 @@
#include "code\game\machinery\doors\checkForMultipleDoors.dm"
#include "code\game\machinery\doors\door.dm"
#include "code\game\machinery\doors\firedoor.dm"
#include "code\game\machinery\doors\multi_tile.dm"
#include "code\game\machinery\doors\poddoor.dm"
#include "code\game\machinery\doors\shutters.dm"
#include "code\game\machinery\doors\unpowered.dm"

View File

@@ -141,30 +141,6 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
opacity = 1
assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity //Until somebody makes better sprites.
/obj/machinery/door/airlock/glass_large
name = "Glass Airlock"
icon = 'icons/obj/doors/Door2x1glassfull.dmi'
opacity = 0
bound_width = 64
glass = 1
update_nearby_tiles(need_rebuild)
. = ..()
if(!.)
return
var/turf/simulated/second_turf = get_step(src, EAST)
var/turf/simulated/north = get_step(second_turf, NORTH)
var/turf/simulated/east = get_step(second_turf, EAST)
var/turf/simulated/south = get_step(second_turf, SOUTH)
update_heat_protection(second_turf)
if(istype(north)) air_master.tiles_to_update |= north
if(istype(south)) air_master.tiles_to_update |= south
if(istype(east)) air_master.tiles_to_update |= east
/obj/machinery/door/airlock/freezer
name = "Freezer Airlock"
icon = 'icons/obj/doors/Doorfreezer.dmi'
@@ -1316,7 +1292,7 @@ About the new airlock wires panel:
var/obj/effect/stop/S
S = new /obj/effect/stop
S.victim = M
S.loc = src.loc
S.loc = M.loc
spawn(20)
del(S)
M.emote("scream")

View File

@@ -20,8 +20,12 @@
var/heat_proof = 0 // For glass airlocks/opacity firedoors
var/air_properties_vary_with_direction = 0
//Multi-tile doors
dir = EAST
var/width = 1
/obj/machinery/door/New()
..()
. = ..()
if(density)
layer = 3.1 //Above most items if closed
explosion_resistance = initial(explosion_resistance)
@@ -29,6 +33,16 @@
else
layer = 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
explosion_resistance = 0
if(width > 1)
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
update_nearby_tiles(need_rebuild=1)
return
@@ -258,6 +272,22 @@
if(istype(south)) air_master.tiles_to_update += south
if(istype(east)) air_master.tiles_to_update += east
if(istype(west)) air_master.tiles_to_update += west
if(width > 1)
var/turf/simulated/next_turf = src
var/step_dir = turn(dir, 180)
for(var/current_step = 2, current_step <= width, current_step++)
next_turf = get_step(src, step_dir)
north = get_step(next_turf, step_dir)
east = get_step(next_turf, turn(step_dir, 90))
south = get_step(next_turf, turn(step_dir, -90))
update_heat_protection(next_turf)
if(istype(north)) air_master.tiles_to_update |= north
if(istype(south)) air_master.tiles_to_update |= south
if(istype(east)) air_master.tiles_to_update |= east
return 1
/obj/machinery/door/proc/update_heat_protection(var/turf/simulated/source)
@@ -273,5 +303,18 @@
close()
return
/obj/machinery/door/Move(new_loc, new_dir)
update_nearby_tiles()
. = ..()
if(width > 1)
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
update_nearby_tiles()
/obj/machinery/door/morgue
icon = 'icons/obj/doors/doormorgue.dmi'

View File

@@ -276,21 +276,4 @@
/obj/machinery/door/firedoor/multi_tile
icon = 'DoorHazard2x1.dmi'
bound_width = 64
update_nearby_tiles(need_rebuild)
if(!.)
return
. = ..()
var/turf/simulated/second_turf = get_step(src, EAST)
var/turf/simulated/north = get_step(second_turf, NORTH)
var/turf/simulated/east = get_step(second_turf, EAST)
var/turf/simulated/south = get_step(second_turf, SOUTH)
update_heat_protection(second_turf)
if(istype(north)) air_master.tiles_to_update |= north
if(istype(south)) air_master.tiles_to_update |= south
if(istype(east)) air_master.tiles_to_update |= east
width = 2

View File

@@ -0,0 +1,9 @@
//Terribly sorry for the code doubling, but things go derpy otherwise.
/obj/machinery/door/airlock/multi_tile
width = 2
/obj/machinery/door/airlock/multi_tile/glass
name = "Glass Airlock"
icon = 'icons/obj/doors/Door2x1glass.dmi'
opacity = 0
glass = 1

View File

@@ -57,6 +57,7 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
new/datum/stack_recipe("airtight hatch assembly", /obj/structure/door_assembly/door_assembly_hatch, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("maintenance hatch assembly", /obj/structure/door_assembly/door_assembly_mhatch, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("high security airlock assembly", /obj/structure/door_assembly/door_assembly_highsecurity, 4, time = 50, one_per_turf = 1, on_floor = 1), \
new/datum/stack_recipe("multi-tile airlock assembly", /obj/structure/door_assembly/multi_tile, 4, time = 50, one_per_turf = 1, on_floor = 1), \
), 4), \
null, \
new/datum/stack_recipe("grenade casing", /obj/item/weapon/grenade/chem_grenade), \

View File

@@ -101,6 +101,35 @@ obj/structure/door_assembly
airlock_type = "/highsecurity"
glass = -1
multi_tile
icon = 'icons/obj/doors/door_assembly2x1.dmi'
dir = EAST
var/width = 1
//Temporary until we get sprites.
// airlock_type = "/multi_tile/maint"
glass = 1
glass_type = "/multi_tile/glass"
New()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
Move()
. = ..()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/pen))
var/t = copytext(stripped_input(user, "Enter the name for the door.", src.name, src.created_name),1,MAX_NAME_LEN)

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB