mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
-tg- smoothing/floor refactor
Squashed: Add plasteel goonplaque turf Builtin_tile nulling Levelupdate() Fix falsewalls, update smoothing.dmm fixes rwall decon
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
name = "wall"
|
||||
desc = "A huge chunk of metal used to seperate rooms."
|
||||
anchored = 1
|
||||
icon = 'icons/turf/walls.dmi'
|
||||
icon = 'icons/turf/walls/wall.dmi'
|
||||
var/mineral = "metal"
|
||||
var/walltype = "metal"
|
||||
var/opening = 0
|
||||
@@ -19,36 +19,12 @@
|
||||
|
||||
canSmoothWith = list(
|
||||
/turf/simulated/wall,
|
||||
/turf/simulated/wall/r_wall,
|
||||
/obj/structure/falsewall,
|
||||
/obj/structure/falsewall/reinforced // WHY DO WE SMOOTH WITH FALSE R-WALLS WHEN WE DON'T SMOOTH WITH REAL R-WALLS.
|
||||
)
|
||||
|
||||
/obj/structure/falsewall/New()
|
||||
..()
|
||||
relativewall_neighbours()
|
||||
|
||||
/obj/structure/falsewall/Destroy()
|
||||
|
||||
var/temploc = loc
|
||||
loc = null
|
||||
|
||||
for(var/turf/simulated/wall/W in range(temploc,1))
|
||||
W.relativewall()
|
||||
|
||||
for(var/obj/structure/falsewall/W in range(temploc,1))
|
||||
W.relativewall()
|
||||
return ..()
|
||||
|
||||
/obj/structure/falsewall/relativewall()
|
||||
|
||||
if(!density)
|
||||
icon_state = "[walltype]fwall_open"
|
||||
return
|
||||
|
||||
var/junction = findSmoothingNeighbors()
|
||||
icon_state = "[walltype][junction]"
|
||||
return
|
||||
|
||||
/obj/structure/falsewall/reinforced, // WHY DO WE SMOOTH WITH FALSE R-WALLS WHEN WE DON'T SMOOTH WITH REAL R-WALLS. //because we do smooth with real r-walls now
|
||||
/turf/simulated/wall/rust,
|
||||
/turf/simulated/wall/r_wall/rust)
|
||||
smooth = SMOOTH_TRUE
|
||||
|
||||
/obj/structure/falsewall/attack_hand(mob/user)
|
||||
if(opening)
|
||||
@@ -75,17 +51,19 @@
|
||||
|
||||
/obj/structure/falsewall/proc/do_the_flick()
|
||||
if(density)
|
||||
flick("[walltype]fwall_opening", src)
|
||||
smooth = SMOOTH_FALSE
|
||||
clear_smooth_overlays()
|
||||
icon_state = "fwall_opening"
|
||||
else
|
||||
flick("[walltype]fwall_closing", src)
|
||||
icon_state = "fwall_closing"
|
||||
|
||||
/obj/structure/falsewall/update_icon(relativewall = 1)//Calling icon_update will refresh the smoothwalls if it's closed, otherwise it will make sure the icon is correct if it's open
|
||||
/obj/structure/falsewall/update_icon()
|
||||
if(density)
|
||||
icon_state = "[walltype]0"
|
||||
if(relativewall)
|
||||
relativewall()
|
||||
smooth = SMOOTH_TRUE
|
||||
smooth_icon(src)
|
||||
icon_state = ""
|
||||
else
|
||||
icon_state = "[walltype]fwall_open"
|
||||
icon_state = "fwall_open"
|
||||
|
||||
/obj/structure/falsewall/proc/ChangeToWall(delete = 1)
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -147,6 +125,7 @@
|
||||
/obj/structure/falsewall/reinforced
|
||||
name = "reinforced wall"
|
||||
desc = "A huge chunk of reinforced metal used to seperate rooms."
|
||||
icon = 'icons/turf/walls/reinforced_wall.dmi'
|
||||
icon_state = "r_wall"
|
||||
walltype = "rwall"
|
||||
|
||||
@@ -164,11 +143,13 @@
|
||||
/obj/structure/falsewall/uranium
|
||||
name = "uranium wall"
|
||||
desc = "A wall with uranium plating. This is probably a bad idea."
|
||||
icon = 'icons/turf/walls/uranium_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "uranium"
|
||||
walltype = "uranium"
|
||||
var/active = null
|
||||
var/last_event = 0
|
||||
canSmoothWith = list(/obj/structure/falsewall/uranium, /turf/simulated/wall/mineral/uranium)
|
||||
|
||||
/obj/structure/falsewall/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
radiate()
|
||||
@@ -197,30 +178,39 @@
|
||||
/obj/structure/falsewall/gold
|
||||
name = "gold wall"
|
||||
desc = "A wall with gold plating. Swag!"
|
||||
icon = 'icons/turf/walls/gold_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "gold"
|
||||
walltype = "gold"
|
||||
canSmoothWith = list(/obj/structure/falsewall/gold, /turf/simulated/wall/mineral/gold)
|
||||
|
||||
/obj/structure/falsewall/silver
|
||||
name = "silver wall"
|
||||
desc = "A wall with silver plating. Shiny."
|
||||
icon = 'icons/turf/walls/silver_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "silver"
|
||||
walltype = "silver"
|
||||
canSmoothWith = list(/obj/structure/falsewall/silver, /turf/simulated/wall/mineral/silver)
|
||||
|
||||
/obj/structure/falsewall/diamond
|
||||
name = "diamond wall"
|
||||
desc = "A wall with diamond plating. You monster."
|
||||
icon = 'icons/turf/walls/diamond_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "diamond"
|
||||
walltype = "diamond"
|
||||
canSmoothWith = list(/obj/structure/falsewall/diamond, /turf/simulated/wall/mineral/diamond)
|
||||
|
||||
|
||||
/obj/structure/falsewall/plasma
|
||||
name = "plasma wall"
|
||||
desc = "A wall with plasma plating. This is definately a bad idea."
|
||||
icon = 'icons/turf/walls/plasma_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "plasma"
|
||||
walltype = "plasma"
|
||||
canSmoothWith = list(/obj/structure/falsewall/plasma, /turf/simulated/wall/mineral/plasma, /turf/simulated/wall/mineral/alien)
|
||||
|
||||
/obj/structure/falsewall/plasma/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(is_hot(W) > 300)
|
||||
@@ -240,13 +230,24 @@
|
||||
if(exposed_temperature > 300)
|
||||
burnbabyburn()
|
||||
|
||||
//-----------wtf?-----------start
|
||||
/obj/structure/falsewall/alien
|
||||
name = "alien wall"
|
||||
desc = "A strange-looking alien wall."
|
||||
icon = 'icons/turf/walls/plasma_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "alien"
|
||||
walltype = "alien"
|
||||
canSmoothWith = list(/obj/structure/falsewall/alien, /turf/simulated/wall/mineral/alien)
|
||||
|
||||
|
||||
/obj/structure/falsewall/clown
|
||||
name = "bananium wall"
|
||||
desc = "A wall with bananium plating. Honk!"
|
||||
icon = 'icons/turf/walls/bananium_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "clown"
|
||||
walltype = "clown"
|
||||
canSmoothWith = list(/obj/structure/falsewall/clown, /turf/simulated/wall/mineral/clown)
|
||||
|
||||
/obj/structure/falsewall/sandstone
|
||||
name = "sandstone wall"
|
||||
@@ -254,4 +255,22 @@
|
||||
icon_state = ""
|
||||
mineral = "sandstone"
|
||||
walltype = "sandstone"
|
||||
//------------wtf?------------end
|
||||
canSmoothWith = list(/obj/structure/falsewall/sandstone, /turf/simulated/wall/mineral/sandstone)
|
||||
|
||||
/obj/structure/falsewall/wood
|
||||
name = "wooden wall"
|
||||
desc = "A wall with wooden plating. Stiff."
|
||||
icon = 'icons/turf/walls/wood_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "wood"
|
||||
walltype = "wood"
|
||||
canSmoothWith = list(/obj/structure/falsewall/wood, /turf/simulated/wall/mineral/wood)
|
||||
|
||||
/obj/structure/falsewall/iron
|
||||
name = "rough metal wall"
|
||||
desc = "A wall with rough metal plating."
|
||||
icon = 'icons/turf/walls/iron_wall.dmi'
|
||||
icon_state = ""
|
||||
mineral = "metal"
|
||||
walltype = "iron"
|
||||
canSmoothWith = list(/obj/structure/falsewall/iron, /turf/simulated/wall/mineral/iron)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/obj/structure/table
|
||||
name = "table"
|
||||
desc = "A square piece of metal standing on four metal legs. It can not move."
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon = 'icons/obj/smooth_structures/table.dmi'
|
||||
icon_state = "table"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
@@ -25,12 +25,8 @@
|
||||
var/flipped = 0
|
||||
var/health = 100
|
||||
var/busy = 0
|
||||
|
||||
/obj/structure/table/proc/update_adjacent()
|
||||
for(var/direction in list(1,2,4,8,5,6,9,10))
|
||||
if(locate(/obj/structure/table,get_step(src,direction)))
|
||||
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
|
||||
T.update_icon()
|
||||
smooth = SMOOTH_TRUE
|
||||
canSmoothWith = list(/obj/structure/table, /obj/structure/table/reinforced)
|
||||
|
||||
/obj/structure/table/New()
|
||||
..()
|
||||
@@ -38,11 +34,6 @@
|
||||
if(T != src)
|
||||
qdel(T)
|
||||
update_icon()
|
||||
update_adjacent()
|
||||
|
||||
/obj/structure/table/Destroy()
|
||||
update_adjacent()
|
||||
return ..()
|
||||
|
||||
/obj/structure/table/proc/destroy()
|
||||
new parts(loc)
|
||||
@@ -50,6 +41,10 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/table/update_icon()
|
||||
if(smooth && !flipped)
|
||||
smooth_icon(src)
|
||||
smooth_icon_neighbors(src)
|
||||
|
||||
if(flipped)
|
||||
var/type = 0
|
||||
var/tabledirs = 0
|
||||
@@ -65,214 +60,9 @@
|
||||
base = "rtable"
|
||||
|
||||
icon_state = "[base]flip[type]"
|
||||
if (type==1)
|
||||
if (tabledirs & turn(dir,90))
|
||||
icon_state = icon_state+"-"
|
||||
if (tabledirs & turn(dir,-90))
|
||||
icon_state = icon_state+"+"
|
||||
|
||||
return 1
|
||||
|
||||
spawn(2) //So it properly updates when deleting
|
||||
var/dir_sum = 0
|
||||
for(var/direction in list(1,2,4,8,5,6,9,10))
|
||||
var/skip_sum = 0
|
||||
for(var/obj/structure/window/W in src.loc)
|
||||
if(W.dir == direction) //So smooth tables don't go smooth through windows
|
||||
skip_sum = 1
|
||||
continue
|
||||
var/inv_direction //inverse direction
|
||||
switch(direction)
|
||||
if(1)
|
||||
inv_direction = 2
|
||||
if(2)
|
||||
inv_direction = 1
|
||||
if(4)
|
||||
inv_direction = 8
|
||||
if(8)
|
||||
inv_direction = 4
|
||||
if(5)
|
||||
inv_direction = 10
|
||||
if(6)
|
||||
inv_direction = 9
|
||||
if(9)
|
||||
inv_direction = 6
|
||||
if(10)
|
||||
inv_direction = 5
|
||||
for(var/obj/structure/window/W in get_step(src,direction))
|
||||
if(W.dir == inv_direction) //So smooth tables don't go smooth through windows when the window is on the other table's tile
|
||||
skip_sum = 1
|
||||
continue
|
||||
if(!skip_sum) //means there is a window between the two tiles in this direction
|
||||
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
|
||||
if(T && !T.flipped)
|
||||
if(direction <5)
|
||||
dir_sum += direction
|
||||
else
|
||||
if(direction == 5) //This permits the use of all table directions. (Set up so clockwise around the central table is a higher value, from north)
|
||||
dir_sum += 16
|
||||
if(direction == 6)
|
||||
dir_sum += 32
|
||||
if(direction == 8) //Aherp and Aderp. Jezes I am stupid. -- SkyMarshal
|
||||
dir_sum += 8
|
||||
if(direction == 10)
|
||||
dir_sum += 64
|
||||
if(direction == 9)
|
||||
dir_sum += 128
|
||||
|
||||
var/table_type = 0 //stand_alone table
|
||||
if(dir_sum%16 in cardinal)
|
||||
table_type = 1 //endtable
|
||||
dir_sum %= 16
|
||||
if(dir_sum%16 in list(3,12))
|
||||
table_type = 2 //1 tile thick, streight table
|
||||
if(dir_sum%16 == 3) //3 doesn't exist as a dir
|
||||
dir_sum = 2
|
||||
if(dir_sum%16 == 12) //12 doesn't exist as a dir.
|
||||
dir_sum = 4
|
||||
if(dir_sum%16 in list(5,6,9,10))
|
||||
if(locate(/obj/structure/table,get_step(src.loc,dir_sum%16)))
|
||||
table_type = 3 //full table (not the 1 tile thick one, but one of the 'tabledir' tables)
|
||||
else
|
||||
table_type = 2 //1 tile thick, corner table (treated the same as streight tables in code later on)
|
||||
dir_sum %= 16
|
||||
if(dir_sum%16 in list(13,14,7,11)) //Three-way intersection
|
||||
table_type = 5 //full table as three-way intersections are not sprited, would require 64 sprites to handle all combinations. TOO BAD -- SkyMarshal
|
||||
switch(dir_sum%16) //Begin computation of the special type tables. --SkyMarshal
|
||||
if(7)
|
||||
if(dir_sum == 23)
|
||||
table_type = 6
|
||||
dir_sum = 8
|
||||
else if(dir_sum == 39)
|
||||
dir_sum = 4
|
||||
table_type = 6
|
||||
else if(dir_sum == 55 || dir_sum == 119 || dir_sum == 247 || dir_sum == 183)
|
||||
dir_sum = 4
|
||||
table_type = 3
|
||||
else
|
||||
dir_sum = 4
|
||||
if(11)
|
||||
if(dir_sum == 75)
|
||||
dir_sum = 5
|
||||
table_type = 6
|
||||
else if(dir_sum == 139)
|
||||
dir_sum = 9
|
||||
table_type = 6
|
||||
else if(dir_sum == 203 || dir_sum == 219 || dir_sum == 251 || dir_sum == 235)
|
||||
dir_sum = 8
|
||||
table_type = 3
|
||||
else
|
||||
dir_sum = 8
|
||||
if(13)
|
||||
if(dir_sum == 29)
|
||||
dir_sum = 10
|
||||
table_type = 6
|
||||
else if(dir_sum == 141)
|
||||
dir_sum = 6
|
||||
table_type = 6
|
||||
else if(dir_sum == 189 || dir_sum == 221 || dir_sum == 253 || dir_sum == 157)
|
||||
dir_sum = 1
|
||||
table_type = 3
|
||||
else
|
||||
dir_sum = 1
|
||||
if(14)
|
||||
if(dir_sum == 46)
|
||||
dir_sum = 1
|
||||
table_type = 6
|
||||
else if(dir_sum == 78)
|
||||
dir_sum = 2
|
||||
table_type = 6
|
||||
else if(dir_sum == 110 || dir_sum == 254 || dir_sum == 238 || dir_sum == 126)
|
||||
dir_sum = 2
|
||||
table_type = 3
|
||||
else
|
||||
dir_sum = 2 //These translate the dir_sum to the correct dirs from the 'tabledir' icon_state.
|
||||
if(dir_sum%16 == 15)
|
||||
table_type = 4 //4-way intersection, the 'middle' table sprites will be used.
|
||||
|
||||
if(istype(src,/obj/structure/table/reinforced))
|
||||
switch(table_type)
|
||||
if(0)
|
||||
icon_state = "reinf_table"
|
||||
if(1)
|
||||
icon_state = "reinf_1tileendtable"
|
||||
if(2)
|
||||
icon_state = "reinf_1tilethick"
|
||||
if(3)
|
||||
icon_state = "reinf_tabledir"
|
||||
if(4)
|
||||
icon_state = "reinf_middle"
|
||||
if(5)
|
||||
icon_state = "reinf_tabledir2"
|
||||
if(6)
|
||||
icon_state = "reinf_tabledir3"
|
||||
else if(istype(src,/obj/structure/table/woodentable/poker))
|
||||
switch(table_type)
|
||||
if(0)
|
||||
icon_state = "pokertable_table"
|
||||
if(1)
|
||||
icon_state = "pokertable_1tileendtable"
|
||||
if(2)
|
||||
icon_state = "pokertable_1tilethick"
|
||||
if(3)
|
||||
icon_state = "pokertable_tabledir"
|
||||
if(4)
|
||||
icon_state = "pokertable_middle"
|
||||
if(5)
|
||||
icon_state = "pokertable_tabledir2"
|
||||
if(6)
|
||||
icon_state = "pokertable_tabledir3"
|
||||
else if(istype(src,/obj/structure/table/woodentable))
|
||||
switch(table_type)
|
||||
if(0)
|
||||
icon_state = "wood_table"
|
||||
if(1)
|
||||
icon_state = "wood_1tileendtable"
|
||||
if(2)
|
||||
icon_state = "wood_1tilethick"
|
||||
if(3)
|
||||
icon_state = "wood_tabledir"
|
||||
if(4)
|
||||
icon_state = "wood_middle"
|
||||
if(5)
|
||||
icon_state = "wood_tabledir2"
|
||||
if(6)
|
||||
icon_state = "wood_tabledir3"
|
||||
else if(istype(src,/obj/structure/table/glass))
|
||||
switch(table_type)
|
||||
if(0)
|
||||
icon_state = "glass_table"
|
||||
if(1)
|
||||
icon_state = "glass_table_1tileendtable"
|
||||
if(2)
|
||||
icon_state = "glass_table_1tilethick"
|
||||
if(3)
|
||||
icon_state = "glass_table_dir"
|
||||
if(4)
|
||||
icon_state = "glass_table_middle"
|
||||
if(5)
|
||||
icon_state = "glass_tabledir2"
|
||||
if(6)
|
||||
icon_state = "glass_tabledir3"
|
||||
else
|
||||
switch(table_type)
|
||||
if(0)
|
||||
icon_state = "table"
|
||||
if(1)
|
||||
icon_state = "table_1tileendtable"
|
||||
if(2)
|
||||
icon_state = "table_1tilethick"
|
||||
if(3)
|
||||
icon_state = "tabledir"
|
||||
if(4)
|
||||
icon_state = "table_middle"
|
||||
if(5)
|
||||
icon_state = "tabledir2"
|
||||
if(6)
|
||||
icon_state = "tabledir3"
|
||||
if (dir_sum in list(1,2,4,8,5,6,9,10))
|
||||
dir = dir_sum
|
||||
else
|
||||
dir = 2
|
||||
|
||||
/obj/structure/table/ex_act(severity)
|
||||
switch(severity)
|
||||
@@ -523,7 +313,6 @@
|
||||
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,D))
|
||||
T.flip(direction)
|
||||
update_icon()
|
||||
update_adjacent()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -549,7 +338,6 @@
|
||||
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,D))
|
||||
T.unflip()
|
||||
update_icon()
|
||||
update_adjacent()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -559,9 +347,11 @@
|
||||
/obj/structure/table/woodentable
|
||||
name = "wooden table"
|
||||
desc = "Do not apply fire to this. Rumour says it burns easily."
|
||||
icon = 'icons/obj/smooth_structures/wood_table.dmi'
|
||||
icon_state = "wood_table"
|
||||
parts = /obj/item/weapon/table_parts/wood
|
||||
health = 50
|
||||
canSmoothWith = list(/obj/structure/table/woodentable, /obj/structure/table/woodentable/poker)
|
||||
|
||||
/obj/structure/table/woodentable/attackby(obj/item/I as obj, mob/user as mob, params)
|
||||
|
||||
@@ -628,7 +418,9 @@
|
||||
/obj/structure/table/woodentable/poker //No specialties, Just a mapping object.
|
||||
name = "gambling table"
|
||||
desc = "A seedy table for seedy dealings in seedy places."
|
||||
icon = 'icons/obj/smooth_structures/poker_table.dmi'
|
||||
icon_state = "pokertable"
|
||||
canSmoothWith = list(/obj/structure/table/woodentable/poker, /obj/structure/table/woodentable)
|
||||
|
||||
|
||||
/obj/structure/table/woodentable/poker/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
|
||||
@@ -721,9 +513,11 @@
|
||||
/obj/structure/table/glass
|
||||
name = "glass table"
|
||||
desc = "Looks fragile. You should totally flip it. It is begging for it."
|
||||
icon = 'icons/obj/smooth_structures/glass_table.dmi'
|
||||
icon_state = "glass_table"
|
||||
parts = /obj/item/weapon/table_parts/glass
|
||||
health = 10
|
||||
canSmoothWith = null
|
||||
|
||||
/obj/structure/table/glass/flip(var/direction)
|
||||
src.collapse()
|
||||
@@ -800,10 +594,12 @@
|
||||
/obj/structure/table/reinforced
|
||||
name = "reinforced table"
|
||||
desc = "A version of the four legged table. It is stronger."
|
||||
icon_state = "reinf_table"
|
||||
icon = 'icons/obj/smooth_structures/reinforced_table.dmi'
|
||||
icon_state = "r_table"
|
||||
health = 200
|
||||
var/status = 2
|
||||
parts = /obj/item/weapon/table_parts/reinforced
|
||||
canSmoothWith = list(/obj/structure/table/reinforced, /obj/structure/table)
|
||||
|
||||
/obj/structure/table/reinforced/flip(var/direction)
|
||||
if (status == 2)
|
||||
|
||||
Reference in New Issue
Block a user