mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-23 13:17:03 +01:00
the little construction pr (#9002)
* the little construction pr * construction-related bugfixes (teal carpet corners, arcade construction, airlock screwdriver panel) * Update code/game/objects/items/stacks/tiles/tile_types.dm Co-authored-by: Atermonera <atermonera@gmail.com> * mmmm sweet sweet updates * actually compiles --------- Co-authored-by: Atermonera <atermonera@gmail.com>
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#define MAT_DEUTERIUM "deuterium"
|
||||
#define MAT_CONCRETE "concrete"
|
||||
#define MAT_PLASTEELREBAR "plasteel rebar"
|
||||
#define MAT_GRASS "grass"
|
||||
|
||||
|
||||
#define DEFAULT_TABLE_MATERIAL MAT_PLASTIC
|
||||
|
||||
@@ -78,6 +78,10 @@
|
||||
name = "request console electronics"
|
||||
path =/obj/item/circuitboard/request
|
||||
|
||||
/datum/category_item/autolathe/engineering/electrochromic
|
||||
name = "electrochromic window control electronics"
|
||||
path =/obj/item/circuitboard/electrochromic
|
||||
|
||||
/datum/category_item/autolathe/engineering/pipelayer
|
||||
name = "pipe layer electronics"
|
||||
path =/obj/item/circuitboard/pipelayer
|
||||
|
||||
@@ -1339,3 +1339,5 @@
|
||||
O = T
|
||||
to_chat(user, "<span class='notice'>You turn in 2 tickets to the [src] and claim a prize!</span>")
|
||||
return
|
||||
else
|
||||
..() //You can now actually deconstruct these.
|
||||
@@ -1057,17 +1057,20 @@ About the new airlock wires panel:
|
||||
return
|
||||
else
|
||||
return
|
||||
else if(C.is_screwdriver())
|
||||
else if(C.is_screwdriver()) //we don't want screwdrivers to toggle the door, so...
|
||||
if (src.p_open)
|
||||
if (stat & BROKEN)
|
||||
to_chat(usr, "<span class='warning'>The panel is broken and cannot be closed.</span>")
|
||||
else
|
||||
src.p_open = 0
|
||||
else //close the panel, do the sound, update the icon, but don't toggle the door
|
||||
src.p_open = FALSE
|
||||
playsound(src, C.usesound, 50, 1)
|
||||
else
|
||||
src.p_open = 1
|
||||
src.update_icon()
|
||||
return
|
||||
else //open the panel, do the sound, update the icon, open the wires menu but don't toggle the door
|
||||
src.p_open = TRUE
|
||||
playsound(src, C.usesound, 50, 1)
|
||||
src.update_icon()
|
||||
src.update_icon()
|
||||
return src.attack_hand(user)
|
||||
else if(C.is_wirecutter())
|
||||
return src.attack_hand(user)
|
||||
else if(istype(C, /obj/item/multitool))
|
||||
@@ -1146,7 +1149,7 @@ About the new airlock wires panel:
|
||||
..()
|
||||
|
||||
/obj/machinery/door/airlock/set_broken()
|
||||
src.p_open = 1
|
||||
src.p_open = TRUE
|
||||
stat |= BROKEN
|
||||
if (secured_wires)
|
||||
lock()
|
||||
|
||||
@@ -224,6 +224,15 @@
|
||||
frame_class = FRAME_CLASS_MACHINE
|
||||
frame_size = 3
|
||||
|
||||
/datum/frame/frame_types/electrochromic_button
|
||||
name = "Electrochromic Window Button"
|
||||
frame_class = FRAME_CLASS_ALARM
|
||||
frame_size = 1
|
||||
frame_style = FRAME_STYLE_WALL
|
||||
x_offset = 24
|
||||
y_offset = 24
|
||||
|
||||
|
||||
//////////////////////////////
|
||||
// Frame Object (Structure)
|
||||
//////////////////////////////
|
||||
|
||||
@@ -20,9 +20,50 @@
|
||||
drop_sound = 'sound/items/drop/axe.ogg'
|
||||
pickup_sound = 'sound/items/pickup/axe.ogg'
|
||||
|
||||
//crafting / welding vars
|
||||
var/datum/material/material //*sigh* i guess this is how we're doing this.
|
||||
var/craftable = FALSE //set to TRUE for tiles you can craft stuff from directly, like grass
|
||||
var/can_weld = FALSE //set to TRUE for tiles you can reforge into their components via welding, like metal
|
||||
var/welds_into = /obj/item/stack/material/steel //what you get from the welding. defaults to steel.
|
||||
var/default_type = DEFAULT_WALL_MATERIAL
|
||||
|
||||
|
||||
|
||||
/obj/item/stack/tile/Initialize()
|
||||
. = ..()
|
||||
randpixel_xy()
|
||||
if(craftable)
|
||||
material = get_material_by_name("[default_type]")
|
||||
if(!material)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
if(material) //sanity check
|
||||
recipes = material.get_recipes()
|
||||
stacktype = material.stack_type
|
||||
|
||||
/obj/item/stack/tile/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weldingtool))
|
||||
var/obj/item/weldingtool/WT = W
|
||||
|
||||
if(can_weld == FALSE)
|
||||
to_chat("You can't reform these into their original components.")
|
||||
return
|
||||
|
||||
if(get_amount() < 4)
|
||||
to_chat(user, "<span class='warning'>You need at least four tiles to do this.</span>")
|
||||
return
|
||||
|
||||
if(WT.remove_fuel(0,user))
|
||||
new welds_into(usr.loc)
|
||||
usr.update_icon()
|
||||
visible_message("<span class='notice'>\The [src] is shaped by [user.name] with the welding tool.</span>","You hear welding.")
|
||||
var/obj/item/stack/tile/T = src
|
||||
src = null
|
||||
var/replace = (user.get_inactive_hand()==T)
|
||||
T.use(4)
|
||||
if (!T && replace)
|
||||
user.put_in_hands(welds_into)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/*
|
||||
* Grass
|
||||
@@ -32,6 +73,7 @@
|
||||
singular_name = "grass floor tile"
|
||||
desc = "A patch of grass like they often use on golf courses."
|
||||
icon_state = "tile_grass"
|
||||
default_type = "grass"
|
||||
force = 1.0
|
||||
throwforce = 1.0
|
||||
throw_speed = 5
|
||||
@@ -41,6 +83,7 @@
|
||||
no_variants = FALSE
|
||||
drop_sound = 'sound/items/drop/herb.ogg'
|
||||
pickup_sound = 'sound/items/pickup/herb.ogg'
|
||||
craftable = TRUE
|
||||
|
||||
/obj/item/stack/tile/grass/sif
|
||||
name = "sivian grass tile"
|
||||
@@ -163,6 +206,7 @@
|
||||
throw_speed = 5
|
||||
throw_range = 20
|
||||
no_variants = FALSE
|
||||
can_weld = TRUE
|
||||
|
||||
/obj/item/stack/tile/floor/red
|
||||
name = "red floor tile"
|
||||
@@ -188,6 +232,7 @@
|
||||
singular_name = "steel floor tile"
|
||||
icon_state = "tile_steel"
|
||||
matter = list("plasteel" = SHEET_MATERIAL_AMOUNT / 4)
|
||||
welds_into = /obj/item/stack/material/plasteel
|
||||
no_variants = FALSE
|
||||
|
||||
/obj/item/stack/tile/floor/steel
|
||||
@@ -195,6 +240,7 @@
|
||||
singular_name = "steel floor tile"
|
||||
icon_state = "tile_steel"
|
||||
matter = list("plasteel" = SHEET_MATERIAL_AMOUNT / 4)
|
||||
welds_into = /obj/item/stack/material/plasteel
|
||||
no_variants = FALSE
|
||||
|
||||
/obj/item/stack/tile/floor/white
|
||||
@@ -202,6 +248,7 @@
|
||||
singular_name = "white floor tile"
|
||||
icon_state = "tile_white"
|
||||
matter = list("plastic" = SHEET_MATERIAL_AMOUNT / 4)
|
||||
welds_into = /obj/item/stack/material/plastic
|
||||
no_variants = FALSE
|
||||
|
||||
/obj/item/stack/tile/floor/yellow
|
||||
@@ -216,6 +263,7 @@
|
||||
singular_name = "dark floor tile"
|
||||
icon_state = "tile_steel"
|
||||
matter = list("plasteel" = SHEET_MATERIAL_AMOUNT / 4)
|
||||
welds_into = /obj/item/stack/material/plasteel
|
||||
no_variants = FALSE
|
||||
|
||||
/obj/item/stack/tile/floor/freezer
|
||||
@@ -223,6 +271,7 @@
|
||||
singular_name = "freezer floor tile"
|
||||
icon_state = "tile_freezer"
|
||||
matter = list("plastic" = SHEET_MATERIAL_AMOUNT / 4)
|
||||
welds_into = /obj/item/stack/material/plastic
|
||||
no_variants = FALSE
|
||||
|
||||
/obj/item/stack/tile/floor/cyborg
|
||||
@@ -234,6 +283,7 @@
|
||||
charge_costs = list(250)
|
||||
stacktype = /obj/item/stack/tile/floor
|
||||
build_type = /obj/item/stack/tile/floor
|
||||
can_weld = FALSE //we're not going there
|
||||
|
||||
/obj/item/stack/tile/linoleum
|
||||
name = "linoleum"
|
||||
@@ -246,6 +296,7 @@
|
||||
throw_range = 20
|
||||
atom_flags = EMPTY_BITFIELD
|
||||
no_variants = FALSE
|
||||
can_weld = FALSE
|
||||
|
||||
/obj/item/stack/tile/wmarble
|
||||
name = "light marble tile"
|
||||
@@ -258,6 +309,8 @@
|
||||
throw_range = 20
|
||||
atom_flags = EMPTY_BITFIELD
|
||||
no_variants = FALSE
|
||||
can_weld = TRUE
|
||||
welds_into = /obj/item/stack/material/marble
|
||||
|
||||
/obj/item/stack/tile/bmarble
|
||||
name = "dark marble tile"
|
||||
@@ -270,12 +323,15 @@
|
||||
throw_range = 20
|
||||
atom_flags = EMPTY_BITFIELD
|
||||
no_variants = FALSE
|
||||
can_weld = TRUE
|
||||
welds_into = /obj/item/stack/material/marble
|
||||
|
||||
/obj/item/stack/tile/roofing
|
||||
name = "roofing"
|
||||
singular_name = "roofing"
|
||||
desc = "A section of roofing material. You can use it to repair the ceiling, or expand it."
|
||||
icon_state = "techtile_grid"
|
||||
can_weld = FALSE //roofing can also be made from wood, so let's not open that can of worms today
|
||||
|
||||
/obj/item/stack/tile/roofing/cyborg
|
||||
name = "roofing synthesizer"
|
||||
@@ -284,3 +340,4 @@
|
||||
charge_costs = list(250)
|
||||
stacktype = /obj/item/stack/tile/roofing
|
||||
build_type = /obj/item/stack/tile/roofing
|
||||
can_weld = FALSE
|
||||
|
||||
@@ -74,6 +74,12 @@
|
||||
board_type = new /datum/frame/frame_types/geiger
|
||||
matter = list(MAT_STEEL = 50, "glass" = 50)
|
||||
|
||||
/obj/item/circuitboard/electrochromic
|
||||
name = T_BOARD("electrochromic button")
|
||||
build_path = /obj/machinery/button/windowtint
|
||||
board_type = new /datum/frame/frame_types/electrochromic_button
|
||||
matter = list(MAT_STEEL = 50, "glass" = 50)
|
||||
|
||||
//Computer
|
||||
|
||||
/obj/item/circuitboard/holopad
|
||||
|
||||
@@ -71,9 +71,12 @@
|
||||
return
|
||||
if (istype(C, /obj/item/stack/rods))
|
||||
var/obj/item/stack/rods/R = C
|
||||
if(R.use(2))
|
||||
if(R.get_amount() < 2)
|
||||
to_chat(user, "<span class='notice'>You need at least two rods to form a catwalk here.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You start connecting \the [R.name] to \the [src.name] ...</span>")
|
||||
if(do_after(user, 5 SECONDS))
|
||||
R.use(2) //2023-02-27 bugfix to prevent rods being used without catwalk creation
|
||||
src.alpha = 0 // Note: I don't know why this is set, Eris did it, just trusting for now. ~Leshana
|
||||
new /obj/structure/catwalk(src.loc)
|
||||
qdel(src)
|
||||
|
||||
@@ -611,13 +611,15 @@
|
||||
if(istype(MT.connectable, /obj/machinery/button/windowtint))
|
||||
var/obj/machinery/button/windowtint/buffered_button = MT.connectable
|
||||
src.id = buffered_button.id
|
||||
to_chat(user, "<span class='notice'>\The [src] is linked to \the [buffered_button].</span>")
|
||||
to_chat(user, "<span class='notice'>\The [src] is linked to \the [buffered_button] with ID '[id]'.</span>")
|
||||
return TRUE
|
||||
// Otherwise fall back to asking them
|
||||
var/t = sanitizeSafe(input(user, "Enter the ID for the window.", src.name, null), MAX_NAME_LEN)
|
||||
if (!t && user.get_active_hand() != W && in_range(src, user))
|
||||
// Otherwise fall back to asking them... and remind them what the current ID is.
|
||||
if(id)
|
||||
to_chat(user, "The window's current ID is [id].")
|
||||
var/t = sanitizeSafe(input(user, "Enter the new ID for the window.", src.name, null), MAX_NAME_LEN)
|
||||
if(t && in_range(src, user))
|
||||
src.id = t
|
||||
to_chat(user, "<span class='notice'>The new ID of \the [src] is [id]</span>")
|
||||
to_chat(user, "<span class='notice'>The new ID of \the [src] is '[id]'.</span>")
|
||||
return TRUE
|
||||
. = ..()
|
||||
|
||||
@@ -637,6 +639,7 @@
|
||||
icon_state = "light0"
|
||||
desc = "A remote control switch for polarized windows."
|
||||
var/range = 7
|
||||
circuit = /obj/item/circuitboard/electrochromic
|
||||
|
||||
/obj/machinery/button/windowtint/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
@@ -665,17 +668,21 @@
|
||||
icon_state = "light[active]"
|
||||
|
||||
/obj/machinery/button/windowtint/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/multitool))
|
||||
if(default_deconstruction_screwdriver(user, W))
|
||||
return
|
||||
else if(alarm_deconstruction_wirecutters(user, W))
|
||||
return
|
||||
else if(istype(W, /obj/item/multitool))
|
||||
var/obj/item/multitool/MT = W
|
||||
if(!id)
|
||||
// If no ID is set yet (newly built button?) let them select an ID for first-time use!
|
||||
var/t = sanitizeSafe(input(user, "Enter an ID for \the [src].", src.name, null), MAX_NAME_LEN)
|
||||
if (t && user.get_active_hand() != W && in_range(src, user))
|
||||
if(t && in_range(src, user))
|
||||
src.id = t
|
||||
to_chat(user, "<span class='notice'>The new ID of \the [src] is [id]</span>")
|
||||
to_chat(user, "<span class='notice'>The new ID of \the [src] is '[id]'. To reset this, rebuild the control.</span>")
|
||||
if(id)
|
||||
// It already has an ID (or they just set one), buffer it for copying to windows.
|
||||
to_chat(user, "<span class='notice'>You store \the [src] in \the [MT]'s buffer!</span>")
|
||||
to_chat(user, "<span class='notice'>You store \the [src] ID ('[id]') in \the [MT]'s buffer!</span>")
|
||||
MT.connectable = src
|
||||
MT.update_icon()
|
||||
return TRUE
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/datum/material/grass
|
||||
name = MAT_GRASS
|
||||
display_name = "grass"
|
||||
stack_type = /obj/item/stack/tile/grass
|
||||
ignition_point = T0C+300
|
||||
melting_point = T0C+300
|
||||
protectiveness = 0
|
||||
conductive = 0
|
||||
integrity = 10
|
||||
supply_conversion_value = 1
|
||||
|
||||
/datum/material/grass/generate_recipes()
|
||||
recipes = list(
|
||||
new /datum/stack_recipe_list("bushes and flowers",list(
|
||||
new /datum/stack_recipe("bush", /obj/structure/flora/ausbushes, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("reed bush", /obj/structure/flora/ausbushes/reedbush, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("leafy bush", /obj/structure/flora/ausbushes/leafybush, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("pale bush", /obj/structure/flora/ausbushes/palebush, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("stalky bush", /obj/structure/flora/ausbushes/stalkybush, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("grassy bush", /obj/structure/flora/ausbushes/grassybush, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("ferny bush", /obj/structure/flora/ausbushes/fernybush, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("sunny bush", /obj/structure/flora/ausbushes/sunnybush, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("pointy bush", /obj/structure/flora/ausbushes/pointybush, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("lavender grass", /obj/structure/flora/ausbushes/lavendergrass, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("yellow-and-white flowers", /obj/structure/flora/ausbushes/ywflowers, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("blue-and-red flowers", /obj/structure/flora/ausbushes/brflowers, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("pink-and-purple flowers", /obj/structure/flora/ausbushes/ppflowers, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("sparse grass", /obj/structure/flora/ausbushes/sparsegrass, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("full grass", /obj/structure/flora/ausbushes/fullgrass, 3, one_per_turf = 0, on_floor = 1, recycle_material = "[name]")
|
||||
))
|
||||
)
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
@@ -2174,6 +2174,7 @@
|
||||
#include "code\modules\materials\materials\metals\steel.dm"
|
||||
#include "code\modules\materials\materials\organic\animal_products.dm"
|
||||
#include "code\modules\materials\materials\organic\cloth.dm"
|
||||
#include "code\modules\materials\materials\organic\grass.dm"
|
||||
#include "code\modules\materials\materials\organic\leather.dm"
|
||||
#include "code\modules\materials\materials\organic\resin.dm"
|
||||
#include "code\modules\materials\materials\organic\wood.dm"
|
||||
|
||||
Reference in New Issue
Block a user