Merge pull request #9406 from Poojawa/carpet-colors

More Carpet colors and liquid carpet varients
This commit is contained in:
kevinz000
2019-10-07 23:39:52 -07:00
committed by GitHub
31 changed files with 466 additions and 161 deletions
+26 -98
View File
@@ -22,92 +22,22 @@
var/framestackamount = 2
/obj/structure/table_frame/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 30))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, TRUE)
deconstruct(TRUE)
else if(istype(I, /obj/item/stack/sheet/plasteel))
var/obj/item/stack/sheet/plasteel/P = I
if(P.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one plasteel sheet to do this!</span>")
return
var/obj/item/stack/material = I
if (istype(I, /obj/item/stack) && material?.tableVariant)
if(material.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one [material.name] sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [P] to [src]...</span>")
if(do_after(user, 50, target = src) && P.use(1))
make_new_table(/obj/structure/table/reinforced)
else if(istype(I, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = I
if(M.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one metal sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [M] to [src]...</span>")
if(do_after(user, 20, target = src) && M.use(1))
make_new_table(/obj/structure/table)
else if(istype(I, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/glass/G = I
if(G.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one glass sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [G] to [src]...</span>")
if(do_after(user, 20, target = src) && G.use(1))
make_new_table(/obj/structure/table/glass)
else if(istype(I, /obj/item/stack/sheet/mineral/silver))
var/obj/item/stack/sheet/mineral/silver/S = I
if(S.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one silver sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [S] to [src]...</span>")
if(do_after(user, 20, target = src) && S.use(1))
make_new_table(/obj/structure/table/optable)
else if(istype(I, /obj/item/stack/tile/carpet/black))
var/obj/item/stack/tile/carpet/black/C = I
if(C.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one black carpet sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [C] to [src]...</span>")
if(do_after(user, 20, target = src) && C.use(1))
make_new_table(/obj/structure/table/wood/fancy/black)
else if(istype(I, /obj/item/stack/tile/carpet/blackred))
var/obj/item/stack/tile/carpet/blackred/C = I
if(C.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one red carpet sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [C] to [src]...</span>")
if(do_after(user, 20, target = src) && C.use(1))
make_new_table(/obj/structure/table/wood/fancy/blackred)
else if(istype(I, /obj/item/stack/tile/carpet/monochrome))
var/obj/item/stack/tile/carpet/monochrome/C = I
if(C.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one monochrome carpet sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [C] to [src]...</span>")
if(do_after(user, 20, target = src) && C.use(1))
make_new_table(/obj/structure/table/wood/fancy/monochrome)
else if(istype(I, /obj/item/stack/tile/carpet))
var/obj/item/stack/tile/carpet/C = I
if(C.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one carpet sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [C] to [src]...</span>")
if(do_after(user, 20, target = src) && C.use(1))
make_new_table(/obj/structure/table/wood/fancy)
else if(istype(I, /obj/item/stack/tile/bronze))
var/obj/item/stack/tile/bronze/B = I
if(B.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one bronze sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [B] to [src]...</span>")
if(do_after(user, 20, target = src) && B.use(1))
make_new_table(/obj/structure/table/bronze)
else if(istype(I, /obj/item/stack/sheet/plasmaglass))
var/obj/item/stack/sheet/plasmaglass/G = I
if(G.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one plasmaglass sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [G] to [src]...</span>")
if(do_after(user, 20, target = src) && G.use(1))
make_new_table(/obj/structure/table/plasmaglass)
to_chat(user, "<span class='notice'>You start adding [material] to [src]...</span>")
if(do_after(user, 20, target = src) && material.use(1))
make_new_table(material.tableVariant)
else
return ..()
@@ -143,23 +73,21 @@
resistance_flags = FLAMMABLE
/obj/structure/table_frame/wood/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/stack/sheet/mineral/wood))
var/obj/item/stack/sheet/mineral/wood/W = I
if(W.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one wood sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [W] to [src]...</span>")
if(do_after(user, 20, target = src) && W.use(1))
make_new_table(/obj/structure/table/wood)
return
else if(istype(I, /obj/item/stack/tile/carpet))
var/obj/item/stack/tile/carpet/C = I
if(C.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one carpet sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [C] to [src]...</span>")
if(do_after(user, 20, target = src) && C.use(1))
make_new_table(/obj/structure/table/wood/poker)
if (istype(I, /obj/item/stack))
var/obj/item/stack/material = I
var/toConstruct // stores the table variant
if(istype(I, /obj/item/stack/sheet/mineral/wood))
toConstruct = /obj/structure/table/wood
else if(istype(I, /obj/item/stack/tile/carpet))
toConstruct = /obj/structure/table/wood/poker
if (toConstruct)
if(material.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one [material.name] sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [material] to [src]...</span>")
if(do_after(user, 20, target = src) && material.use(1))
make_new_table(toConstruct)
else
return ..()
+61 -22
View File
@@ -358,44 +358,83 @@
frame = /obj/structure/table_frame
framestack = /obj/item/stack/rods
buildstack = /obj/item/stack/tile/carpet
canSmoothWith = list(/obj/structure/table/wood/fancy, /obj/structure/table/wood/fancy/black, /obj/structure/table/wood/fancy/blackred, /obj/structure/table/wood/fancy/monochrome)
canSmoothWith = list(/obj/structure/table/wood/fancy,
/obj/structure/table/wood/fancy/black,
/obj/structure/table/wood/fancy/blackred,
/obj/structure/table/wood/fancy/monochrome,
/obj/structure/table/wood/fancy/blue,
/obj/structure/table/wood/fancy/cyan,
/obj/structure/table/wood/fancy/green,
/obj/structure/table/wood/fancy/orange,
/obj/structure/table/wood/fancy/purple,
/obj/structure/table/wood/fancy/red,
/obj/structure/table/wood/fancy/royalblack,
/obj/structure/table/wood/fancy/royalblue)
var/smooth_icon = 'icons/obj/smooth_structures/fancy_table.dmi' // see Initialize()
/obj/structure/table/wood/fancy/New()
// New() is used so that the /black subtype can override `icon` easily and
// the correct value will be used by the smoothing subsystem.
/obj/structure/table/wood/fancy/Initialize()
. = ..()
// Needs to be set dynamically because table smooth sprites are 32x34,
// which the editor treats as a two-tile-tall object. The sprites are that
// size so that the north/south corners look nice - examine the detail on
// the sprites in the editor to see why.
icon = 'icons/obj/smooth_structures/fancy_table.dmi'
icon = smooth_icon
/obj/structure/table/wood/fancy/black
icon_state = "fancy_table_black"
buildstack = /obj/item/stack/tile/carpet/black
smooth_icon = 'icons/obj/smooth_structures/fancy_table_black.dmi'
/obj/structure/table/wood/fancy/blackred
icon = 'icons/obj/structures.dmi'
icon_state = "fancy_table_blackred"
buildstack = /obj/item/stack/tile/carpet/blackred
/obj/structure/table/wood/fancy/blackred/New()
. = ..()
icon = 'icons/obj/smooth_structures/fancy_table_blackred.dmi'
icon_state = "fancy_table_blackred"
buildstack = /obj/item/stack/tile/carpet/blackred
smooth_icon = 'icons/obj/smooth_structures/fancy_table_blackred.dmi'
/obj/structure/table/wood/fancy/monochrome
icon = 'icons/obj/structures.dmi'
icon_state = "fancy_table_monochrome"
buildstack = /obj/item/stack/tile/carpet/monochrome
icon_state = "fancy_table_monochrome"
buildstack = /obj/item/stack/tile/carpet/monochrome
smooth_icon = 'icons/obj/smooth_structures/fancy_table_monochrome.dmi'
/obj/structure/table/wood/fancy/monochrome/New()
. = ..()
icon = 'icons/obj/smooth_structures/fancy_table_monochrome.dmi'
/obj/structure/table/wood/fancy/blue
icon_state = "fancy_table_blue"
buildstack = /obj/item/stack/tile/carpet/blue
smooth_icon = 'icons/obj/smooth_structures/fancy_table_blue.dmi'
/obj/structure/table/wood/fancy/cyan
icon_state = "fancy_table_cyan"
buildstack = /obj/item/stack/tile/carpet/cyan
smooth_icon = 'icons/obj/smooth_structures/fancy_table_cyan.dmi'
/obj/structure/table/wood/fancy/green
icon_state = "fancy_table_green"
buildstack = /obj/item/stack/tile/carpet/green
smooth_icon = 'icons/obj/smooth_structures/fancy_table_green.dmi'
/obj/structure/table/wood/fancy/orange
icon_state = "fancy_table_orange"
buildstack = /obj/item/stack/tile/carpet/orange
smooth_icon = 'icons/obj/smooth_structures/fancy_table_orange.dmi'
/obj/structure/table/wood/fancy/purple
icon_state = "fancy_table_purple"
buildstack = /obj/item/stack/tile/carpet/purple
smooth_icon = 'icons/obj/smooth_structures/fancy_table_purple.dmi'
/obj/structure/table/wood/fancy/red
icon_state = "fancy_table_red"
buildstack = /obj/item/stack/tile/carpet/red
smooth_icon = 'icons/obj/smooth_structures/fancy_table_red.dmi'
/obj/structure/table/wood/fancy/royalblack
icon_state = "fancy_table_royalblack"
buildstack = /obj/item/stack/tile/carpet/royalblack
smooth_icon = 'icons/obj/smooth_structures/fancy_table_royalblack.dmi'
/obj/structure/table/wood/fancy/royalblue
icon_state = "fancy_table_royalblue"
buildstack = /obj/item/stack/tile/carpet/royalblue
smooth_icon = 'icons/obj/smooth_structures/fancy_table_royalblue.dmi'
/obj/structure/table/wood/fancy/black/New()
. = ..()
// Ditto above.
icon = 'icons/obj/smooth_structures/fancy_table_black.dmi'
/*
* Reinforced tables
*/