mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #5747 from Neerti/fulltile_window_improvements
Makes fulltile windows seperate from dir
This commit is contained in:
@@ -121,7 +121,7 @@
|
||||
// Special handling of windows, which are dense but block only from some directions
|
||||
if(istype(A, /obj/structure/window))
|
||||
var/obj/structure/window/W = A
|
||||
if (!W.is_full_window() && !(turn(src.last_move, 180) & A.dir))
|
||||
if (!W.is_fulltile() && !(turn(src.last_move, 180) & A.dir))
|
||||
continue
|
||||
// Same thing for (closed) windoors, which have the same problem
|
||||
else if(istype(A, /obj/machinery/door/window) && !(turn(src.last_move, 180) & A.dir))
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
name = "glass"
|
||||
singular_name = "glass sheet"
|
||||
icon_state = "sheet-glass"
|
||||
var/created_window = /obj/structure/window/basic
|
||||
var/is_reinforced = 0
|
||||
var/list/construction_options = list("One Direction", "Full Window")
|
||||
default_type = "glass"
|
||||
|
||||
/obj/item/stack/material/glass/attack_self(mob/user as mob)
|
||||
@@ -52,75 +50,7 @@
|
||||
if (!G && replace)
|
||||
user.put_in_hands(RG)
|
||||
|
||||
/obj/item/stack/material/glass/proc/construct_window(mob/user as mob)
|
||||
if(!user || !src) return 0
|
||||
if(!istype(user.loc,/turf)) return 0
|
||||
if(!user.IsAdvancedToolUser())
|
||||
return 0
|
||||
var/title = "Sheet-[name]"
|
||||
title += " ([src.get_amount()] sheet\s left)"
|
||||
switch(input(title, "What would you like to construct?") as null|anything in construction_options)
|
||||
if("One Direction")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
|
||||
var/list/directions = new/list(cardinal)
|
||||
var/i = 0
|
||||
for (var/obj/structure/window/win in user.loc)
|
||||
i++
|
||||
if(i >= 4)
|
||||
user << "<span class='warning'>There are too many windows in this location.</span>"
|
||||
return 1
|
||||
directions-=win.dir
|
||||
if(!(win.dir in cardinal))
|
||||
user << "<span class='warning'>Can't let you do that.</span>"
|
||||
return 1
|
||||
|
||||
//Determine the direction. It will first check in the direction the person making the window is facing, if it finds an already made window it will try looking at the next cardinal direction, etc.
|
||||
var/dir_to_set = 2
|
||||
for(var/direction in list( user.dir, turn(user.dir,90), turn(user.dir,180), turn(user.dir,270) ))
|
||||
var/found = 0
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if(WT.dir == direction)
|
||||
found = 1
|
||||
if(!found)
|
||||
dir_to_set = direction
|
||||
break
|
||||
new created_window( user.loc, dir_to_set, 1 )
|
||||
src.use(1)
|
||||
if("Full Window")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) return 1
|
||||
if(src.get_amount() < 4)
|
||||
user << "<span class='warning'>You need more glass to do that.</span>"
|
||||
return 1
|
||||
if(locate(/obj/structure/window) in user.loc)
|
||||
user << "<span class='warning'>There is a window in the way.</span>"
|
||||
return 1
|
||||
new created_window( user.loc, SOUTHWEST, 1 )
|
||||
src.use(4)
|
||||
if("Windoor")
|
||||
if(!is_reinforced) return 1
|
||||
|
||||
|
||||
if(!src || src.loc != user) return 1
|
||||
|
||||
if(isturf(user.loc) && locate(/obj/structure/windoor_assembly/, user.loc))
|
||||
user << "<span class='warning'>There is already a windoor assembly in that location.</span>"
|
||||
return 1
|
||||
|
||||
if(isturf(user.loc) && locate(/obj/machinery/door/window/, user.loc))
|
||||
user << "<span class='warning'>There is already a windoor in that location.</span>"
|
||||
return 1
|
||||
|
||||
if(src.get_amount() < 5)
|
||||
user << "<span class='warning'>You need more glass to do that.</span>"
|
||||
return 1
|
||||
|
||||
new /obj/structure/windoor_assembly(user.loc, user.dir, 1)
|
||||
src.use(5)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
/*
|
||||
@@ -131,9 +61,7 @@
|
||||
singular_name = "reinforced glass sheet"
|
||||
icon_state = "sheet-rglass"
|
||||
default_type = "reinforced glass"
|
||||
created_window = /obj/structure/window/reinforced
|
||||
is_reinforced = 1
|
||||
construction_options = list("One Direction", "Full Window", "Windoor")
|
||||
|
||||
/*
|
||||
* Phoron Glass sheets
|
||||
@@ -142,7 +70,6 @@
|
||||
name = "phoron glass"
|
||||
singular_name = "phoron glass sheet"
|
||||
icon_state = "sheet-phoronglass"
|
||||
created_window = /obj/structure/window/phoronbasic
|
||||
default_type = "phoron glass"
|
||||
|
||||
/obj/item/stack/material/glass/phoronglass/attackby(obj/item/W, mob/user)
|
||||
@@ -170,5 +97,4 @@
|
||||
singular_name = "reinforced phoron glass sheet"
|
||||
icon_state = "sheet-phoronrglass"
|
||||
default_type = "reinforced phoron glass"
|
||||
created_window = /obj/structure/window/phoronreinforced
|
||||
is_reinforced = 1
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
var/shardtype = /obj/item/weapon/material/shard
|
||||
var/glasstype = null // Set this in subtypes. Null is assumed strange or otherwise impossible to dismantle, such as for shuttle glass.
|
||||
var/silicate = 0 // number of units of silicate
|
||||
var/fulltile = FALSE // Set to true on full-tile variants.
|
||||
|
||||
/obj/structure/window/examine(mob/user)
|
||||
. = ..(user)
|
||||
@@ -128,16 +129,10 @@
|
||||
/obj/structure/window/blob_act()
|
||||
take_damage(50)
|
||||
|
||||
//TODO: Make full windows a separate type of window.
|
||||
//Once a full window, it will always be a full window, so there's no point
|
||||
//having the same type for both.
|
||||
/obj/structure/window/proc/is_full_window()
|
||||
return (dir == SOUTHWEST || dir == SOUTHEAST || dir == NORTHWEST || dir == NORTHEAST)
|
||||
|
||||
/obj/structure/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return 1
|
||||
if(is_full_window())
|
||||
if(is_fulltile())
|
||||
return 0 //full tile window, you can't move into it!
|
||||
if(get_dir(loc, target) & dir)
|
||||
return !density
|
||||
@@ -388,8 +383,6 @@
|
||||
anchored = 0
|
||||
state = 0
|
||||
update_verbs()
|
||||
if(is_fulltile())
|
||||
maxhealth *= 2
|
||||
|
||||
health = maxhealth
|
||||
|
||||
@@ -416,9 +409,7 @@
|
||||
|
||||
//checks if this window is full-tile one
|
||||
/obj/structure/window/proc/is_fulltile()
|
||||
if(dir & (dir - 1))
|
||||
return 1
|
||||
return 0
|
||||
return fulltile
|
||||
|
||||
//This proc is used to update the icons of nearby windows. It should not be confused with update_nearby_tiles(), which is an atmos proc!
|
||||
/obj/structure/window/proc/update_nearby_icons()
|
||||
@@ -484,6 +475,10 @@
|
||||
maxhealth = 12.0
|
||||
force_threshold = 3
|
||||
|
||||
/obj/structure/window/basic/full
|
||||
maxhealth = 24
|
||||
fulltile = TRUE
|
||||
|
||||
/obj/structure/window/phoronbasic
|
||||
name = "phoron window"
|
||||
desc = "A borosilicate alloy window. It seems to be quite strong."
|
||||
@@ -497,8 +492,8 @@
|
||||
force_threshold = 5
|
||||
|
||||
/obj/structure/window/phoronbasic/full
|
||||
dir = SOUTHWEST
|
||||
maxhealth = 80
|
||||
fulltile = TRUE
|
||||
|
||||
/obj/structure/window/phoronreinforced
|
||||
name = "reinforced borosilicate window"
|
||||
@@ -514,8 +509,8 @@
|
||||
force_threshold = 10
|
||||
|
||||
/obj/structure/window/phoronreinforced/full
|
||||
dir = SOUTHWEST
|
||||
maxhealth = 160
|
||||
fulltile = TRUE
|
||||
|
||||
/obj/structure/window/reinforced
|
||||
name = "reinforced window"
|
||||
@@ -530,9 +525,9 @@
|
||||
force_threshold = 6
|
||||
|
||||
/obj/structure/window/reinforced/full
|
||||
dir = SOUTHWEST
|
||||
icon_state = "fwindow"
|
||||
maxhealth = 80
|
||||
fulltile = TRUE
|
||||
|
||||
/obj/structure/window/reinforced/tinted
|
||||
name = "tinted window"
|
||||
@@ -567,9 +562,9 @@
|
||||
var/id
|
||||
|
||||
/obj/structure/window/reinforced/polarized/full
|
||||
dir = SOUTHWEST
|
||||
icon_state = "fwindow"
|
||||
maxhealth = 80
|
||||
fulltile = TRUE
|
||||
|
||||
/obj/structure/window/reinforced/polarized/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/device/multitool) && !anchored) // Only allow programming if unanchored!
|
||||
|
||||
@@ -113,6 +113,7 @@ var/list/name_to_material
|
||||
|
||||
// Placeholder vars for the time being, todo properly integrate windows/light tiles/rods.
|
||||
var/created_window
|
||||
var/created_fulltile_window
|
||||
var/rod_product
|
||||
var/wire_product
|
||||
var/list/window_options = list()
|
||||
@@ -485,11 +486,12 @@ var/list/name_to_material
|
||||
destruction_desc = "shatters"
|
||||
window_options = list("One Direction" = 1, "Full Window" = 4, "Windoor" = 2)
|
||||
created_window = /obj/structure/window/basic
|
||||
created_fulltile_window = /obj/structure/window/basic/full
|
||||
rod_product = /obj/item/stack/material/glass/reinforced
|
||||
|
||||
/material/glass/build_windows(var/mob/living/user, var/obj/item/stack/used_stack)
|
||||
|
||||
if(!user || !used_stack || !created_window || !window_options.len)
|
||||
if(!user || !used_stack || !created_window || !created_fulltile_window || !window_options.len)
|
||||
return 0
|
||||
|
||||
if(!user.IsAdvancedToolUser())
|
||||
@@ -544,6 +546,8 @@ var/list/name_to_material
|
||||
if(choice == "Windoor")
|
||||
if(is_reinforced())
|
||||
build_path = /obj/structure/windoor_assembly/secure
|
||||
else if(choice == "Full Window")
|
||||
build_path = created_fulltile_window
|
||||
else
|
||||
build_path = created_window
|
||||
|
||||
@@ -575,6 +579,7 @@ var/list/name_to_material
|
||||
composite_material = list(DEFAULT_WALL_MATERIAL = SHEET_MATERIAL_AMOUNT / 2, "glass" = SHEET_MATERIAL_AMOUNT)
|
||||
window_options = list("One Direction" = 1, "Full Window" = 4, "Windoor" = 2)
|
||||
created_window = /obj/structure/window/reinforced
|
||||
created_fulltile_window = /obj/structure/window/reinforced/full
|
||||
wire_product = null
|
||||
rod_product = null
|
||||
|
||||
@@ -588,6 +593,7 @@ var/list/name_to_material
|
||||
stack_origin_tech = list(TECH_MATERIAL = 4)
|
||||
window_options = list("One Direction" = 1, "Full Window" = 4)
|
||||
created_window = /obj/structure/window/phoronbasic
|
||||
created_fulltile_window = /obj/structure/window/phoronbasic/full
|
||||
wire_product = null
|
||||
rod_product = /obj/item/stack/material/glass/phoronrglass
|
||||
|
||||
@@ -599,6 +605,7 @@ var/list/name_to_material
|
||||
composite_material = list() //todo
|
||||
window_options = list("One Direction" = 1, "Full Window" = 4)
|
||||
created_window = /obj/structure/window/phoronreinforced
|
||||
created_fulltile_window = /obj/structure/window/phoronreinforced/full
|
||||
hardness = 40
|
||||
weight = 30
|
||||
stack_origin_tech = list(TECH_MATERIAL = 2)
|
||||
|
||||
@@ -832,7 +832,7 @@ default behaviour is:
|
||||
if (pulling)
|
||||
if (istype(pulling, /obj/structure/window))
|
||||
var/obj/structure/window/W = pulling
|
||||
if(W.is_full_window())
|
||||
if(W.is_fulltile())
|
||||
for(var/obj/structure/window/win in get_step(pulling,get_dir(pulling.loc, T)))
|
||||
stop_pulling()
|
||||
if (pulling)
|
||||
|
||||
Reference in New Issue
Block a user