RCD Rework.

RCDs now work on a system of schematics, with an RPD style UI.

RPD, RCD, RSF and tile painters all implemented into this new system.
This commit is contained in:
PJB3005
2015-08-15 18:18:51 +02:00
parent 929f182a68
commit ccb9ceb811
45 changed files with 2293 additions and 1604 deletions

231
code/modules/RCD/RCD.dm Normal file
View File

@@ -0,0 +1,231 @@
//Main class for the modular RCD system.
/obj/item/device/rcd
name = "\improper Rapid-Construction-Device (RCD)"
desc = "Used to rapidly construct things, or deconstruct them, for that matter."
icon = 'icons/obj/RCD.dmi'
icon_state = "rcd"
flags = FPRINT
siemens_coefficient = 1
w_class = 3
siemens_coefficient = 1
force = 10
throwforce = 10
throw_speed = 1
throw_range = 5
starting_materials = list(MAT_IRON = 50000)
w_type = RECYK_ELECTRONIC
melt_temperature = MELTPOINT_STEEL // Lots of metal
origin_tech = "engineering=4;materials=2"
var/datum/rcd_schematic/selected
var/list/schematics = list(/datum/rcd_schematic/test) //list of schematics, in definitions of RCD subtypes, no organization is needed, in New() these get organized.
var/sparky = 1 //Make sparks. LOTS OF SPARKS.
var/busy = 0
var/datum/html_interface/rcd/interface
var/datum/effect/effect/system/spark_spread/spark_system
/obj/item/device/rcd/New()
. = ..()
interface = new(src, sanitize(name)) //interface gets created BEFORE the schematics get created, so they can modify the HEAD content (RPD pipe colour picker).
init_schematics()
rebuild_ui()
spark_system = new
spark_system.set_up(5, 0, src)
spark_system.attach(src)
//create and organize the schematics
/obj/item/device/rcd/proc/init_schematics()
var/list/old_schematics = schematics
schematics = list()
for(var/path in old_schematics)
var/datum/rcd_schematic/C = new path(src)
if(!schematics[C.category])
schematics[C.category] = list()
schematics[C.category] += C
/obj/item/device/rcd/Destroy()
for(var/cat in schematics)
for(var/datum/rcd_schematic/C in schematics[cat])
C.master = null
schematics = null
del(interface)
del(spark_system)
. = ..()
/obj/item/device/rcd/attack_self(var/mob/user)
interface.show(user)
/obj/item/device/rcd/proc/rebuild_ui()
var/dat = ""
dat += {"
<b>Selected:</b> <span id="selectedname"></span>
<h2>Options</h2>
<div id="schematic_options">
</div>
<h2>Available schematics</h2>
"}
for(var/cat in schematics)
dat += "<b>[cat]:</b><ul style='list-style-type:disc'>"
var/list/L = schematics[cat]
for(var/i = 1 to L.len) //So we have the indexes.
var/datum/rcd_schematic/C = L[i]
dat += "<li><a href='?src=\ref[interface];cat=[cat];index=[i]'>[C.name]</a></li>"
dat += "</ul>"
interface.updateLayout(dat)
if(selected)
interface.updateContent("schematic_options", selected.get_HTML())
interface.updateContent("selectedname", selected.name)
/obj/item/device/rcd/Topic(var/href, var/list/href_list)
. = ..()
if(.)
return
if(href_list["cat"] && href_list["index"] && !busy) //Change selected schematic.
var/list/L = schematics[href_list["cat"]]
if(!L)
return 1
var/datum/rcd_schematic/C = L[Clamp(text2num(href_list["index"]), 1, L.len)]
if(!istype(C))
return 1
if(!(selected ? selected.deselect(usr, C) : 1 && C.select(usr, selected)))
return 1
spark()
selected = C
update_options_menu()
interface.updateContent("selectedname", selected.name)
return 1
else if(selected) //The href didn't get handled by us so we pass it down to the selected schematic.
return selected.Topic(href, href_list)
/obj/item/device/rcd/afterattack(var/atom/A, var/mob/user)
if(!selected)
return 1
if(selected.flags ^ (RCD_SELF_SANE | RCD_RANGE) && !(user.Adjacent(A) && A.Adjacent(user))) //If RCD_SELF_SANE and RCD_RANGE are disabled we use adjacency.
return 1
if(selected.flags & RCD_RANGE && selected.flags ^ RCD_SELF_SANE && get_dist(A, user) > 1) //RCD_RANGE is used AND we're NOT SELF_SANE, use range(1)
return 1
if(selected.flags & RCD_GET_TURF) //Get the turf because RCD_GET_TURF is on.
A = get_turf(A)
if(selected.flags ^ RCD_SELF_SANE && get_energy() < selected.energy_cost) //Handle energy amounts, but only if not SELF_SANE.
return 1
busy = 1 //Busy to prevent switching schematic while it's in use.
var/t = selected.attack(A, user)
if(!t) //No errors
if(selected.flags ^ RCD_SELF_COST) //Handle energy costs unless the schematic does it itself.
use_energy(selected.energy_cost, user)
else
if(istext(t))
user << "<span class='warning'>\the [src]'s error light flickers: [t]</span>"
else
user << "<span class='warning'>\the [src]'s error light flickers.</span>"
busy = 0
return 1
/obj/item/device/rcd/proc/spark()
if(sparky)
spark_system.start()
/obj/item/device/rcd/proc/get_energy()
return INFINITY
/obj/item/device/rcd/proc/use_energy(var/amount, var/mob/user)
return
/obj/item/device/rcd/proc/update_options_menu()
if(selected)
interface.updateContent("schematic_options", selected.get_HTML())
else
interface.updateContent("schematic_options", " ")
/obj/item/device/rcd/borg
var/cell_power_per_energy = 30
/obj/item/device/rcd/borg/use_energy(var/amount, var/mob/user)
if(!isrobot(user))
return
var/mob/living/silicon/robot/R = user
if(!R.cell)
return
R.cell.use(amount * cell_power_per_energy)
/obj/item/device/rcd/borg/get_energy(var/amount, var/mob/user)
if(!isrobot(user))
return 0
var/mob/living/silicon/robot/R = user
if(!R.cell)
return
return R.cell.charge * cell_power_per_energy
//Matter based RCDs.
/obj/item/device/rcd/matter
var/matter = 0
var/max_matter = 30
/obj/item/device/rcd/matter/examine(var/mob/user)
..()
user << "It currently holds [matter]/[max_matter] matter-units."
/obj/item/device/rcd/matter/attackby(var/obj/item/weapon/W, var/mob/user)
..()
if(istype(W, /obj/item/weapon/rcd_ammo))
if((matter + 10) > max_matter)
user << "<span class='notice'>\the [src] can't hold any more matter-units.</span>"
return 1
qdel(W)
matter += 10
playsound(get_turf(src), 'sound/machines/click.ogg', 20, 1)
user << "<span class='notice'>\the [src] now holds [matter]/[max_matter] matter-units.</span>"
return 1
if(isscrewdriver(W))
user << "<span class='notice'>You unscrew the access panel and release the cartridge chamber.</span>"
while(matter >= 10)
new /obj/item/weapon/rcd_ammo(user.loc)
matter -= 10
return 1
/obj/item/device/rcd/matter/use_energy(var/amount, var/mob/user)
matter -= amount
user << "<span class='notice'>\the [src] currently holds [matter]/[max_matter] matter-units."
/obj/item/device/rcd/matter/get_energy()
return matter

64
code/modules/RCD/RPD.dm Normal file
View File

@@ -0,0 +1,64 @@
/obj/item/device/rcd/rpd
name = "Rapid Piping Device (RPD)"
desc = "A device used to rapidly pipe things."
icon_state = "rpd"
starting_materials = list(MAT_IRON = 75000, MAT_GLASS = 37500)
schematics = list(
/* Utilities */
/datum/rcd_schematic/decon_pipes,
/datum/rcd_schematic/paint_pipes,
/* Regular pipes */
/datum/rcd_schematic/pipe,
/datum/rcd_schematic/pipe/bent,
/datum/rcd_schematic/pipe/manifold,
/datum/rcd_schematic/pipe/valve,
/datum/rcd_schematic/pipe/dvalve,
/datum/rcd_schematic/pipe/cap,
/datum/rcd_schematic/pipe/manifold_4w,
/datum/rcd_schematic/pipe/mtvalve,
/datum/rcd_schematic/pipe/dtvalve,
/* Devices */
/datum/rcd_schematic/pipe/connector,
/datum/rcd_schematic/pipe/unary_vent,
/datum/rcd_schematic/pipe/passive_vent,
/datum/rcd_schematic/pipe/pump,
/datum/rcd_schematic/pipe/passive_gate,
/datum/rcd_schematic/pipe/volume_pump,
/datum/rcd_schematic/pipe/scrubber,
/datum/rcd_schematic/pmeter,
/datum/rcd_schematic/gsensor,
/datum/rcd_schematic/pipe/filter,
/datum/rcd_schematic/pipe/mixer,
/datum/rcd_schematic/pipe/thermal_plate,
/datum/rcd_schematic/pipe/injector,
/datum/rcd_schematic/pipe/dp_vent,
/* H/E Pipes */
/datum/rcd_schematic/pipe/he,
/datum/rcd_schematic/pipe/he_bent,
/datum/rcd_schematic/pipe/juntion,
/datum/rcd_schematic/pipe/heat_exchanger,
/* Insulated Pipes */
/datum/rcd_schematic/pipe/insulated,
/datum/rcd_schematic/pipe/insulated_bent,
/datum/rcd_schematic/pipe/insulated_manifold,
/datum/rcd_schematic/pipe/insulated_4w_manifold,
/* Disposal Pipes */
/datum/rcd_schematic/pipe/disposal,
/datum/rcd_schematic/pipe/disposal/bent,
/datum/rcd_schematic/pipe/disposal/junction,
/datum/rcd_schematic/pipe/disposal/y_junction,
/datum/rcd_schematic/pipe/disposal/trunk,
/datum/rcd_schematic/pipe/disposal/bin,
/datum/rcd_schematic/pipe/disposal/outlet,
/datum/rcd_schematic/pipe/disposal/chute,
/datum/rcd_schematic/pipe/disposal/sort,
/datum/rcd_schematic/pipe/disposal/sort_wrap
)

39
code/modules/RCD/RSF.dm Normal file
View File

@@ -0,0 +1,39 @@
//Yes, subtype of engineering. (compressed matter handling.)
/obj/item/device/rcd/matter/rsf
name = "\improper Rapid-Service-Fabricator"
desc = "A device used to rapidly deploy service items."
icon_state = "rsf"
starting_materials = list(MAT_IRON = 40000)
max_matter = 40
schematics = list(
/datum/rcd_schematic/rsf/glass,
/datum/rcd_schematic/rsf/flask,
/datum/rcd_schematic/rsf/paper,
/datum/rcd_schematic/rsf/candle,
/datum/rcd_schematic/rsf/dice,
/datum/rcd_schematic/rsf/cards,
/datum/rcd_schematic/rsf/cardboard
)
/obj/item/device/rcd/borg/rsf
name = "\improper Rapid-Service-Fabricator"
desc = "A device used to rapidly deploy service items."
icon_state = "rsf"
cell_power_per_energy = 50
schematics = list(
/datum/rcd_schematic/rsf/dosh,
/datum/rcd_schematic/rsf/glass,
/datum/rcd_schematic/rsf/flask,
/datum/rcd_schematic/rsf/paper,
/datum/rcd_schematic/rsf/candle,
/datum/rcd_schematic/rsf/dice,
/datum/rcd_schematic/rsf/cards,
/datum/rcd_schematic/rsf/cardboard
)

45
code/modules/RCD/engie.dm Normal file
View File

@@ -0,0 +1,45 @@
/obj/item/device/rcd/matter/engineering
schematics = list(
/datum/rcd_schematic/decon,
/datum/rcd_schematic/con_floors,
/datum/rcd_schematic/con_walls,
/datum/rcd_schematic/con_airlock
)
var/disabled = 0
/obj/item/device/rcd/matter/engineering/afterattack(var/atom/A, var/mob/user)
if(disabled)
return
return ..()
/obj/item/device/rcd/matter/engineering/suicide_act(var/mob/user)
visible_message("<span class='danger'>[user] is using the deconstruct function on \the [src] on \himself! It looks like \he's trying to commit suicide!</span>")
return (user.death(1))
/obj/item/device/rcd/borg/engineering
schematics = list(
/datum/rcd_schematic/decon,
/datum/rcd_schematic/con_floors,
/datum/rcd_schematic/con_walls,
/datum/rcd_schematic/con_airlock/no_access
)
/obj/item/weapon/rcd_ammo
name = "compressed matter cartridge"
desc = "Highly compressed matter in a cartridge form, used in various fabricators."
icon = 'icons/obj/ammo.dmi'
icon_state = "rcd"
item_state = "rcdammo"
opacity = 0
density = 0
anchored = 0.0
origin_tech = "materials=2"
w_class = 2.0
starting_materials = list(MAT_IRON = 30000, MAT_GLASS = 15000)
w_type = RECYK_ELECTRONIC
/obj/item/weapon/rcd_ammo/attackby(var/obj/O, mob/user)
if(is_type_in_list(O, list(/obj/item/device/rcd/matter/engineering, /obj/item/device/rcd/matter/rsf)) || (istype(O, /obj/item/device/material_synth) && !istype(O, /obj/item/device/material_synth/robot)))
return O.attackby(src, user)

View File

@@ -0,0 +1,83 @@
/datum/rcd_schematic
var/name = "whomp" //Obvious.
var/category = "" //More obvious. Yes you need a category.
var/energy_cost = 0 //Energy cost of this schematic.
var/flags = 0 //Bitflags.
var/obj/item/device/rcd/master //Okay all of the vars here are obvious...
/datum/rcd_schematic/New(var/obj/item/device/rcd/n_master)
master = n_master
. = ..()
/*
Called when the RCD this thing belongs to attacks an atom.
params:
- var/atom/A: The atom being attacked.
- var/mob/user: The mob using the RCD.
return value:
- !0: Non-descriptive error.
- string: Error with reason.
- 0: No errors.
*/
/datum/rcd_schematic/proc/attack(var/atom/A, var/mob/user)
return 0
/*
Called when the RCD's schematic changes away from this one.
params:
- var/mob/user: The user, duh...
- var/datum/rcd_schematic/old_schematic: The new schematic.
return value:
- !0: Switch allowed.
- 0: Switch not allowed
*/
/datum/rcd_schematic/proc/deselect(var/mob/user, var/datum/rcd_schematic/new_schematic)
return 1
/*
Called when the RCD's schematic changes to this one
Note: this is called AFTER deselect().
params:
- var/mob/user: The user, duh...
- var/datum/rcd_schematic/old_schematic: The schematic before this one.
return value:
- !0: Switch allowed.
- 0: Switch not allowed
*/
/datum/rcd_schematic/proc/select(var/mob/user, var/datum/rcd_schematic/old_schematic)
return 1
/*
Called to get the HTML for things like the direction menu on an RPD.
Note:
- Do not do hrefs to the src, any hrefs should direct at the HTML interface, Topic() calls are passed down if not used by the RCD itself.
- Always return something here ("" is not enough), else there will be a Jscript error for clients.
params:
- I don't need to explain this.
*/
/datum/rcd_schematic/proc/get_HTML()
return " "
/*
Called when a client logs in and the required resources need to be sent to the cache.
Use client << browse_rsc() to sent the files.
params:
- var/client/client: client to send to.
*/
/datum/rcd_schematic/proc/send_icons(var/client/client)
return

View File

@@ -0,0 +1,394 @@
/datum/rcd_schematic/decon
name = "Deconstruct"
category = "Construction"
energy_cost = 5
var/can_r_wall = 0
/datum/rcd_schematic/decon/attack(var/atom/A, var/mob/user)
if(istype(A, /turf/simulated/wall))
var/turf/simulated/wall/T = A
if(istype(T, /turf/simulated/wall/r_wall) && !can_r_wall)
return "it cannot deconstruct reinforced walls!"
user << "Deconstructing \the [T]..."
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
if(do_after(user, T, 40))
if(master.get_energy() < energy_cost)
return 1
playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1)
T.ChangeTurf(/turf/simulated/floor/plating)
return 0
else if(istype(A, /turf/simulated/floor))
var/turf/simulated/floor/T = A
user << "Deconstructing \the [T]..."
if(do_after(user, T, 50))
if(master.get_energy() < energy_cost)
return 1
playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1)
T.ChangeTurf(get_base_turf(T.z))
return 0
else if(istype(A, /obj/machinery/door/airlock))
var/obj/machinery/door/airlock/D = A
user << "Deconstructing \the [D]..."
if(do_after(user, D, 50))
if(master.get_energy() < energy_cost)
return 1
playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1)
qdel(D)
return 0
return 1
/datum/rcd_schematic/con_floors
name = "Build floors"
category = "Construction"
energy_cost = 1
/datum/rcd_schematic/con_floors/attack(var/atom/A, var/mob/user)
if(!(istype(A, /turf/space) && !istype(A, /turf/space/transit)))
return "it can only create floors on space!"
var/turf/space/S = A
user << "Building floor..."
playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1)
S.ChangeTurf(/turf/simulated/floor/plating/airless)
return 0
/datum/rcd_schematic/con_walls
name = "Build walls"
category = "Construction"
energy_cost = 3
/datum/rcd_schematic/con_walls/attack(var/atom/A, var/mob/user)
if(!istype(A, /turf/simulated/floor))
return 1
var/turf/simulated/floor/T = A
user << "Building wall"
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
if(do_after(user, A, 20))
if(master.get_energy() < energy_cost)
return 1
playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1)
T.ChangeTurf(/turf/simulated/wall)
return 0
return 1
/datum/rcd_schematic/con_airlock
name = "Build airlock"
category = "Construction"
energy_cost = 3
var/allow_access = 1
var/selected_name = "Airlock"
var/list/selected_access = list() //Selected access levels.
var/one_access = 0
var/list/schematics = list()
var/datum/airlock_schematic/selected
/datum/rcd_schematic/con_airlock/no_access
allow_access = 0
/datum/rcd_schematic/con_airlock/New()
. = ..()
for(var/path in typesof(/datum/airlock_schematic))
schematics += new path
selected = schematics[1]
/datum/rcd_schematic/con_airlock/deselect()
. = ..()
selected = schematics[1] //Reset the selection.
/datum/rcd_schematic/con_airlock/send_icons(var/client/client)
for(var/datum/airlock_schematic/C in schematics)
C.send_icon(client)
/datum/rcd_schematic/con_airlock/get_HTML()
. = "<p>"
for(var/i = 1 to schematics.len)
var/datum/airlock_schematic/C = schematics[i]
var/selected_text = ""
if(selected == C)
selected_text = " class='selected'"
. += "<a href='?src=\ref[master.interface];set_selected=[i]' title='[sanitize(C.name)]'[selected_text]><img src='[C.img]'/></a>"
if(!(i % 5))
. += "<br/>"
. += {"
<!-- Name form -->
<form action="?src=\ref[master.interface]" method="get">
<input type="hidden" name="src" value="\ref[master.interface]"/> <!-- Here so the SRC href gets passed down -->
<input type="text" name="new_name" value="[selected_name]"/>
<input type="submit" name="act" value="Save Name"/>
</form><br/>
"}
if(allow_access)
. += {"
<!-- Access list visibility toggler -->
<script>
$("#accessListShowButton").click(
function toggleAccessList()
{
if($("#accessList").is(":hidden"))
{
$("#accessList").slideDown("fast");
$("#accessListShowButton").html("Hide access controls");
}
else
{
$("#accessList").slideUp("fast");
$("#accessListShowButton").html("Show access controls");
}
}
);
</script>
<a id="accessListShowButton">Show access controls</a><br/>
<!-- Access levels form. -->
<form action="?src=\ref[master.interface]" method="get" id="accessList" style="display: none;">
<input type="hidden" name="src" value="\ref[master.interface]"/> <!-- Here so the SRC href gets passed down -->
<input type="submit" value="Save Access Settings"/><br/><br/>
<!-- One access radio buttons -->
Access requirement is set to: <br/>
"}
if(one_access) //So we check the correct button by default
. += {"
<input type="radio" name="oneAccess" value="0"/>ALL
<br/>
<input type="radio" name="oneAccess" value="1" checked/>ONE
"}
else
. += {"
<input type="radio" name="oneAccess" value="0" checked/>ALL
<br/>
<input type="radio" name="oneAccess" value="1"/>ONE
"}
. += {"<br/>
Access levels: <br/>
"}
//Access level selection comes here.
for(var/access in get_all_accesses())
var/access_name = get_access_desc(access)
if(!access_name) //I noticed in testing there's a broken access level that shows up, this should filter it out.
continue
var/checked = ""
if(access in selected_access)
checked = " checked"
. += {"
<input type="checkbox" name="[access]"[checked]/> [access_name] <br/>
"}
. += "</form>"
. += "</p>"
/datum/rcd_schematic/con_airlock/Topic(var/href, var/href_list)
if(href_list["set_selected"])
var/idx = Clamp(text2num(href_list["set_selected"]), 1, schematics.len)
var/datum/airlock_schematic/C = schematics[idx]
selected = C
selected_name = C.name //Reset the name.
master.update_options_menu()
return 1
if(href_list["new_name"])
selected_name = copytext(sanitize(href_list["new_name"]), 1, MAX_NAME_LEN)
master.update_options_menu()
return 1
if(href_list["oneAccess"] && allow_access)
one_access = text2num(href_list["oneAccess"])
//Along with oneAccess, the hrefs for access levels get called, as such we process them here before we return 1
selected_access.Cut()
var/list/access_levels = get_all_accesses()
for(var/href_key in href_list - list("oneAccess", "src")) //This should loop through all the access levels that are on.
var/access = text2num(href_key)
if(!(access in access_levels)) //Only check valid access levels.
continue
selected_access |= access
master.update_options_menu()
return 1
/datum/rcd_schematic/con_airlock/attack(var/atom/A, var/mob/user)
if(!istype(A, /turf))
return 1
if(locate(/obj/machinery/door/airlock) in A)
return "there is already an airlock on this spot!"
user << "Building airlock..."
if(!do_after(user, A, 50))
return 1
if(master.get_energy() < energy_cost)
return 1
if(locate(/obj/machinery/door/airlock) in A)
return "there is already an airlock on this spot!"
playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1)
var/obj/machinery/door/airlock/D = new selected.airlock_type(A)
if(capitalize(selected_name) == selected_name) //The name inputted is capitalized, so we add \improper.
D.name = "\improper [selected_name]"
else
D.name = selected_name
if(allow_access)
if(one_access)
D.req_one_access = selected_access.Copy()
else
D.req_access = selected_access.Copy()
D.autoclose = 1
//Schematics for schematics, I know, but it's OOP!
/datum/airlock_schematic
var/name = "airlock" //Name of the airlock for the tooltip.
var/airlock_type = /obj/machinery/door/airlock //Type of the airlock.
var/img = "rcd_airlock.png" //Icon to send to the client AND to use for the preview.
var/icon = 'icons/obj/doors/Doorint.dmi' //Icon file to pull the icon from to send to the client.
/datum/airlock_schematic/proc/send_icon(var/client/client)
client << browse_rsc(new /icon(icon, "door_closed"), img)
//ALL THE AIRLOCK TYPES.
/datum/airlock_schematic/engie
name = "\improper Engineering Airlock"
airlock_type = /obj/machinery/door/airlock/engineering
img = "rcd_airlock_eng.png"
icon = 'icons/obj/doors/Dooreng.dmi'
/datum/airlock_schematic/atmos
name = "\improper Atmospherics Airlock"
airlock_type = /obj/machinery/door/airlock/atmos
img = "rcd_airlock_atmos.png"
icon = 'icons/obj/doors/Dooratmo.dmi'
/datum/airlock_schematic/sec
name = "\improper Security Airlock"
airlock_type = /obj/machinery/door/airlock/security
img = "rcd_airlock_sec.png"
icon = 'icons/obj/doors/Doorsec.dmi'
/datum/airlock_schematic/command
name = "\improper Command Airlock"
airlock_type = /obj/machinery/door/airlock/command
img = "rcd_airlock_command.png"
icon = 'icons/obj/doors/Doorcom.dmi'
/datum/airlock_schematic/med
name = "\improper Medical Airlock"
airlock_type = /obj/machinery/door/airlock/medical
img = "rcd_airlock_med.png"
icon = 'icons/obj/doors/Doormed.dmi'
/datum/airlock_schematic/sci
name = "\improper Research Airlock"
airlock_type = /obj/machinery/door/airlock/research
img = "rcd_airlock_sci.png"
icon = 'icons/obj/doors/doorresearch.dmi'
/datum/airlock_schematic/mining
name = "\improper Mining Airlock"
airlock_type = /obj/machinery/door/airlock/mining
img = "rcd_airlock_mining.png"
icon = 'icons/obj/doors/Doormining.dmi'
/datum/airlock_schematic/maint
name = "\improper Maintenance Access"
airlock_type = /obj/machinery/door/airlock/maintenance
img = "rcd_airlock_maint.png"
icon = 'icons/obj/doors/Doormaint.dmi'
/datum/airlock_schematic/ext
name = "\improper External Airlock"
airlock_type = /obj/machinery/door/airlock/external
img = "rcd_airlock_ext.png"
icon = 'icons/obj/doors/Doorext.dmi'
/datum/airlock_schematic/high_sec
name = "\improper High-Tech Security Airlock"
airlock_type = /obj/machinery/door/airlock/highsecurity
img = "rcd_airlock_high-sec.png"
icon = 'icons/obj/doors/hightechsecurity.dmi'
/datum/airlock_schematic/glass
name = "\improper Glass Airlock"
airlock_type = /obj/machinery/door/airlock/glass
img = "rcd_airlock_glass.png"
icon = 'icons/obj/doors/Doorglass.dmi'
/datum/airlock_schematic/glass_eng
name = "\improper Glass Engineering Airlock"
airlock_type = /obj/machinery/door/airlock/glass_engineering
img = "rcd_airlock_glass_eng.png"
icon = 'icons/obj/doors/Doorengglass.dmi'
/datum/airlock_schematic/glass_atmos
name = "\improper Glass Atmospherics Airlock"
airlock_type = /obj/machinery/door/airlock/glass_atmos
img = "rcd_airlock_glass_atmos.png"
icon = 'icons/obj/doors/Dooratmoglass.dmi'
/datum/airlock_schematic/glass_sec
name = "\improper Glass Security Airlock"
airlock_type = /obj/machinery/door/airlock/glass_security
img = "rcd_airlock_glass_sec.png"
icon = 'icons/obj/doors/Doorsecglass.dmi'
/datum/airlock_schematic/glass_command
name = "\improper Glass Command Airlock"
airlock_type = /obj/machinery/door/airlock/glass_command
img = "rcd_airlock_glass_com.png"
icon = 'icons/obj/doors/Doorcomglass.dmi'
/datum/airlock_schematic/glass_med
name = "\improper Glass Medical Airlock"
airlock_type = /obj/machinery/door/airlock/glass_medical
img = "rcd_airlock_glass_med.png"
icon = 'icons/obj/doors/doormedglass.dmi'
/datum/airlock_schematic/glass_sci
name = "\improper Glass Research Airlock"
airlock_type = /obj/machinery/door/airlock/glass_research
img = "rcd_airlock_glass_sci.png"
icon = 'icons/obj/doors/doorresearchglass.dmi'
/datum/airlock_schematic/glass_mining
name = "\improper Glass Mining Airlock"
airlock_type = /obj/machinery/door/airlock/glass_mining
img = "rcd_airlock_glass_mining.png"
icon = 'icons/obj/doors/Doorminingglass.dmi'

View File

@@ -0,0 +1,572 @@
#define PIPE_BINARY 0
#define PIPE_BENT 1
#define PIPE_TRINARY 2
#define PIPE_TRIN_M 3
#define PIPE_UNARY 4
//UTILITIES.
/datum/rcd_schematic/decon_pipes
name = "Eat pipes"
category = "Utilities"
flags = RCD_RANGE
/datum/rcd_schematic/decon_pipes/attack(var/atom/A, var/mob/user)
if(!istype(A, /atom/movable))
return 1
var/atom/movable/AM = A
if(!is_type_in_list(AM, list(/obj/item/pipe, /obj/item/pipe_meter, /obj/item/pipe_gsensor, /obj/structure/disposalconstruct)))
return 1
user << "Destroying Pipe..."
playsound(get_turf(master), 'sound/machines/click.ogg', 50, 1)
if(!do_after(user, AM, 5))
return 1
if(!AM)
return 1
playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1)
if(istype(AM, /obj/item/pipe))
returnToPool(A)
else
qdel(AM)
/datum/rcd_schematic/paint_pipes
name = "Paint pipes"
category = "Utilities"
flags = RCD_RANGE
var/list/available_colors = list(
"grey" = "#CCCCCC",
"red" = "#800000",
"blue" = "#000080",
"cyan" = "#1C94C4",
"green" = "#00CC00",
"yellow" = "#FFCC00",
"purple" = "purple"
)
var/selected_color = "grey"
/datum/rcd_schematic/paint_pipes/New(var/obj/item/device/rcd/n_master)
. = ..()
if(!master || !master.interface)
return
//Add the colour CSS defines to the master's interface's HEAD.
var/color_css
for(var/color_name in available_colors)
var/color = available_colors[color_name]
color_css += {"
a.color.[color_name] {
color: [color];
}
a.color.[color_name]:hover {
border:1px solid [color];
}
a.color.[color_name].selected {
background-color: [color];
}
"}
master.interface.head += "<style type='text/css'>[color_css]</style>"
/datum/rcd_schematic/paint_pipes/deselect(var/mob/user, var/datum/rcd_schematic/new_schematic)
. = ..()
selected_color = available_colors[1]
/datum/rcd_schematic/paint_pipes/get_HTML()
for(var/color_name in available_colors)
var/selected = ""
if(color_name == selected_color)
selected = " selected"
. += "<a class='color [color_name][selected]' href='?src=\ref[master.interface];set_color=[color_name]'>&bull;</a>"
/datum/rcd_schematic/paint_pipes/attack(var/atom/A, var/mob/user)
if(!istype(A, /obj/machinery/atmospherics))
return 1
var/obj/machinery/atmospherics/O = A
if(!O.available_colors || !O.available_colors.len)
return "you cannot paint this!"
if(!(selected_color in O.available_colors))
return "the color '[selected_color]' is not available for \a [O]"
playsound(get_turf(master), 'sound/machines/click.ogg', 50, 1)
O._color = selected_color
user.visible_message("<span class='notice'>[user] paints \the [O] [selected_color].</span>","<span class='notice'>You paint \the [O] [selected_color].</span>")
O.update_icon()
/datum/rcd_schematic/paint_pipes/Topic(var/href, var/list/href_list)
if(href_list["set_color"])
if(href_list["set_color"] in available_colors)
selected_color = href_list["set_color"]
master.update_options_menu()
return 1
//METERS AND SENSORS.
/datum/rcd_schematic/gsensor
name = "Gas sensor"
category = "Devices"
flags = RCD_RANGE | RCD_GET_TURF
/datum/rcd_schematic/gsensor/attack(var/atom/A, var/mob/user)
if(!isturf(A))
return
user << "Building gas sensor..."
playsound(get_turf(master), 'sound/machines/click.ogg', 50, 1)
if(!do_after(user, A, 20))
return 1
playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1)
new /obj/item/pipe_gsensor(A)
/datum/rcd_schematic/pmeter
name = "Pipe meter"
category = "Devices"
flags = RCD_RANGE | RCD_GET_TURF
/datum/rcd_schematic/pmeter/attack(var/atom/A, var/mob/user)
if(!isturf(A))
return
user << "Building pipe meter..."
playsound(get_turf(master), 'sound/machines/click.ogg', 50, 1)
if(!do_after(user, A, 20))
return 1
playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1)
new /obj/item/pipe_meter(A)
//ACTUAL PIPES.
/datum/rcd_schematic/pipe
name = "Pipe"
category = "Regular pipes"
flags = RCD_RANGE | RCD_GET_TURF
var/pipe_id = PIPE_SIMPLE_STRAIGHT
var/pipe_type = PIPE_BINARY
var/selected_dir = NORTH
/datum/rcd_schematic/pipe/send_icons(var/client/client)
var/list/dir_list //We get the dirs to loop through and send images to the client for.
switch(pipe_type)
if(PIPE_UNARY, PIPE_TRINARY)
dir_list = cardinal
if(PIPE_BINARY)
dir_list = list(NORTH, EAST)
if(PIPE_BENT)
dir_list = diagonal
if(PIPE_TRIN_M)
dir_list = alldirs
else
dir_list = list()
for(var/dir in dir_list)
send_icon(client, dir)
/datum/rcd_schematic/pipe/proc/send_icon(var/client/client, var/dir)
client << browse_rsc(new/icon('icons/obj/pipe-item.dmi', pipeID2State[pipe_id + 1], dir), "RPD_[pipe_id]_[dir].png")
/datum/rcd_schematic/pipe/get_HTML()
. += "<p>"
switch(pipe_type)
if(PIPE_BINARY)
. += render_dir_image(NORTH, "Vertical")
. += render_dir_image(EAST, "Horizontal")
if(PIPE_UNARY)
. += render_dir_image(NORTH, "North")
. += render_dir_image(EAST, "East")
. += render_dir_image(SOUTH, "South")
. += render_dir_image(WEST, "West")
if(PIPE_BENT)
. += render_dir_image(9, "West to North")
. += render_dir_image(5, "North to East")
. += "<br/>"
. += render_dir_image(10, "South to West")
. += render_dir_image(6, "East to South")
if(PIPE_TRINARY)
. += render_dir_image(NORTH, "West South East")
. += render_dir_image(EAST, "North West South")
. += "<br/>"
. += render_dir_image(SOUTH, "East North West")
. += render_dir_image(WEST, "South East North")
if(PIPE_TRIN_M)
. += render_dir_image(NORTH, "West South East")
. += render_dir_image(EAST, "North West South")
. += "<br/>"
. += render_dir_image(SOUTH, "East North West")
. += render_dir_image(WEST, "South East North")
. += "<br/>"
. += render_dir_image(6, "West South East")
. += render_dir_image(5, "North West South")
. += "<br/>"
. += render_dir_image(9, "East North West")
. += render_dir_image(10, "South East North")
. += "</p>"
/datum/rcd_schematic/pipe/proc/render_dir_image(var/dir, var/title)
var/selected = ""
if(selected_dir == dir)
selected = " class='selected'"
return "<a href='?src=\ref[master.interface];set_dir=[dir]'[selected] title='[title]'><img src='RPD_[pipe_id]_[dir].png'/></a>"
/datum/rcd_schematic/pipe/Topic(var/href, var/href_list)
if(href_list["set_dir"])
var/dir = text2num(href_list["set_dir"])
if(!(dir in alldirs) || selected_dir == dir)
return 1
selected_dir = dir
master.update_options_menu()
return 1
/datum/rcd_schematic/pipe/attack(var/atom/A, var/mob/user)
user << "Building Pipes ..."
playsound(get_turf(user), 'sound/machines/click.ogg', 50, 1)
if(!do_after(user, A, 20))
return 1
playsound(get_turf(user), 'sound/items/Deconstruct.ogg', 50, 1)
var/obj/item/pipe/P = getFromPool(/obj/item/pipe, A, pipe_id, selected_dir)
P.update()
P.add_fingerprint(user)
//Disposal piping.
/datum/rcd_schematic/pipe/disposal
category = "Disposal Pipes"
pipe_id = DISP_PIPE_STRAIGHT
var/actual_id = 0 //This is needed because disposals construction code is a shit.
/datum/rcd_schematic/pipe/disposal/send_icon(var/client/client, var/dir)
client << browse_rsc(new/icon('icons/obj/pipes/disposal.dmi', disposalpipeID2State[pipe_id + 1], dir), "RPD_D_[pipe_id]_[dir].png")
/datum/rcd_schematic/pipe/disposal/render_dir_image(var/dir, var/title)
var/selected = ""
if(selected_dir == dir)
selected = " class='selected'"
return "<a href='?src=\ref[master.interface];set_dir=[dir]'[selected] title='[title]'><img src='RPD_D_[pipe_id]_[dir].png'/></a>"
/datum/rcd_schematic/pipe/disposal/attack(var/atom/A, var/mob/user)
user << "Building Pipes ..."
playsound(get_turf(user), 'sound/machines/click.ogg', 50, 1)
if(!do_after(user, A, 20))
return 1
playsound(get_turf(user), 'sound/items/Deconstruct.ogg', 50, 1)
var/obj/structure/disposalconstruct/C = new/obj/structure/disposalconstruct(A)
C.dir = selected_dir
C.ptype = actual_id
C.update()
C.add_fingerprint(user)
var/global/list/disposalpipeID2State=list(
"pipe-s",
"pipe-c",
"pipe-j1",
"pipe-y",
"pipe-t",
"disposal",
"outlet",
"intake",
"pipe-j1s",
"pipe-j1s",
)
//PIPE DEFINES START HERE.
//REGULAR PIPES.
//Straight is the base class, so not included.
/datum/rcd_schematic/pipe/bent
name = "Bent Pipe"
pipe_id = PIPE_SIMPLE_BENT
pipe_type = PIPE_BENT
/datum/rcd_schematic/pipe/manifold
name = "Manifold"
pipe_id = PIPE_MANIFOLD
pipe_type = PIPE_TRINARY
/datum/rcd_schematic/pipe/valve
name = "Manual Valve"
pipe_id = PIPE_MVALVE
pipe_type = PIPE_BINARY
/datum/rcd_schematic/pipe/dvalve
name = "Digital Valve"
pipe_id = PIPE_DVALVE
pipe_type = PIPE_BINARY
/datum/rcd_schematic/pipe/cap
name = "Pipe Cap"
pipe_id = PIPE_CAP
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/manifold_4w
name = "4-Way Manifold"
pipe_id = PIPE_MANIFOLD4W
pipe_type = PIPE_BINARY
/datum/rcd_schematic/pipe/mtvalve
name = "Manual T-Valve"
pipe_id = PIPE_MTVALVE
pipe_type = PIPE_TRIN_M
/datum/rcd_schematic/pipe/dtvalve
name = "Digital T-Valve"
pipe_id = PIPE_DTVALVE
pipe_type = PIPE_TRIN_M
//DEVICES.
/datum/rcd_schematic/pipe/connector
name = "Connecter"
category = "Devices"
pipe_id = PIPE_CONNECTOR
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/unary_vent
name = "Unary Vent"
category = "Devices"
pipe_id = PIPE_UVENT
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/passive_vent
name = "Passive Vent"
category = "Devices"
pipe_id = PIPE_PASV_VENT
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/pump
name = "Gas Pump"
category = "Devices"
pipe_id = PIPE_PUMP
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/passive_gate
name = "Passive gate"
category = "Devices"
pipe_id = PIPE_PASSIVE_GATE
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/volume_pump
name = "Volume Pump"
category = "Devices"
pipe_id = PIPE_VOLUME_PUMP
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/scrubber
name = "Scrubber"
category = "Devices"
pipe_id = PIPE_SCRUBBER
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/filter
name = "Gas Filter"
category = "Devices"
pipe_id = PIPE_GAS_FILTER
pipe_type = PIPE_TRIN_M
/datum/rcd_schematic/pipe/mixer
name = "Gas Mixer"
category = "Devices"
pipe_id = PIPE_GAS_MIXER
pipe_type = PIPE_TRIN_M
/datum/rcd_schematic/pipe/thermal_plate
name = "Thermal Plate"
category = "Devices"
pipe_id = PIPE_THERMAL_PLATE
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/injector
name = "Injector"
category = "Devices"
pipe_id = PIPE_INJECTOR
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/dp_vent
name = "Dual-Port Vent"
category = "Devices"
pipe_id = PIPE_DP_VENT
pipe_type = PIPE_UNARY
//H/E Pipes.
/datum/rcd_schematic/pipe/he
name = "Pipe"
category = "Heat Exchange"
pipe_id = PIPE_HE_STRAIGHT
pipe_type = PIPE_BINARY
/datum/rcd_schematic/pipe/he_bent
name = "Bent Pipe"
category = "Heat Exchange"
pipe_id = PIPE_HE_BENT
pipe_type = PIPE_BENT
/datum/rcd_schematic/pipe/juntion
name = "Junction"
category = "Heat Exchange"
pipe_id = PIPE_JUNCTION
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/heat_exchanger
name = "Heat Exchanger"
category = "Heat Exchange"
pipe_id = PIPE_HEAT_EXCHANGE
pipe_type = PIPE_UNARY
//INSULATED PIPES.
/datum/rcd_schematic/pipe/insulated
name = "Pipe"
category = "Insulated Pipes"
pipe_id = PIPE_INSULATED_STRAIGHT
pipe_type = PIPE_BINARY
/datum/rcd_schematic/pipe/insulated_bent
name = "Bent Pipe"
category = "Insulated Pipes"
pipe_id = PIPE_INSULATED_BENT
pipe_type = PIPE_BENT
/datum/rcd_schematic/pipe/insulated_manifold
name = "Manifold"
category = "Insulated Pipes"
pipe_id = PIPE_INSUL_MANIFOLD
pipe_type = PIPE_TRINARY
/datum/rcd_schematic/pipe/insulated_4w_manifold
name = "4-Way Manifold"
category = "Insulated Pipes"
pipe_id = PIPE_INSUL_MANIFOLD4W
pipe_type = PIPE_BINARY
//DISPOSAL PIPES
//Again basic straight is handled in the parent.
/datum/rcd_schematic/pipe/disposal/bent
name = "Bent Pipe"
pipe_id = DISP_PIPE_BENT
actual_id = 1
pipe_type = PIPE_UNARY //Yes this makes no sense but BLAME FUCKING DISPOSALS CODE.
/datum/rcd_schematic/pipe/disposal/junction
name = "Junction"
pipe_id = DISP_JUNCTION
actual_id = 2
pipe_type = PIPE_TRINARY
/datum/rcd_schematic/pipe/disposal/y_junction
name = "Y-Junction"
pipe_id = DISP_YJUNCTION
actual_id = 4
pipe_type = PIPE_TRINARY
/datum/rcd_schematic/pipe/disposal/trunk
name = "Trunk"
pipe_id = DISP_END_TRUNK
actual_id = 5
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/disposal/bin
name = "Bin"
pipe_id = DISP_END_BIN
actual_id = 6
pipe_type = -1 //Will disable the icon.
/datum/rcd_schematic/pipe/disposal/outlet
name = "Outlet"
pipe_id = DISP_END_OUTLET
actual_id = 7
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/disposal/chute
name = "Chute"
pipe_id = DISP_END_CHUTE
actual_id = 8
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/disposal/sort
name = "Sorting Junction"
pipe_id = DISP_SORT_JUNCTION
actual_id = 9
pipe_type = PIPE_TRINARY
/datum/rcd_schematic/pipe/disposal/sort_wrap
name = "Wrapped Sorting Junction"
pipe_id = DISP_SORT_WRAP_JUNCTION
actual_id = 11
pipe_type = PIPE_TRINARY

View File

@@ -0,0 +1,46 @@
//RSF schematics.
/datum/rcd_schematic/rsf
energy_cost = 1
var/spawn_type
category = "Service"
/datum/rcd_schematic/rsf/attack(var/atom/A, var/mob/user)
if(!is_type_in_list(A, list(/obj/structure/table, /turf/simulated/floor)))
return 1
user << "Dispensing [lowertext(name)]"
playsound(get_turf(src), 'sound/machines/click.ogg', 10, 1)
new spawn_type(get_turf(A))
/datum/rcd_schematic/rsf/dosh
name = "Dosh"
spawn_type = /obj/item/weapon/spacecash/c10
energy_cost = 4
/datum/rcd_schematic/rsf/glass
name = "Glass"
spawn_type = /obj/item/weapon/reagent_containers/food/drinks/drinkingglass
/datum/rcd_schematic/rsf/flask
name = "Flask"
spawn_type = /obj/item/weapon/reagent_containers/food/drinks/flask/barflask
/datum/rcd_schematic/rsf/paper
name = "Paper"
spawn_type = /obj/item/weapon/paper
/datum/rcd_schematic/rsf/candle
name = "Candle"
spawn_type = /obj/item/candle
/datum/rcd_schematic/rsf/dice
name = "Dice"
spawn_type = /obj/item/weapon/storage/pill_bottle/dice
/datum/rcd_schematic/rsf/cards
name = "Deck of cards"
spawn_type = /obj/item/toy/cards
/datum/rcd_schematic/rsf/cardboard
name = "Cardboard Sheet..."
spawn_type = /obj/item/stack/sheet/cardboard

View File

@@ -0,0 +1,6 @@
/datum/rcd_schematic/test
category = "test"
/datum/rcd_schematic/test/attack(var/atom/A, var/mob/user)
user << "WHOMP"
A.color = "#FFFF00"

View File

@@ -0,0 +1,609 @@
#define PAINT_ALL 0
#define PAINT_FLOOR 1
#define PAINT_PLATING 2
#define PAINT_REINFORCED 3
#define DIR_ONE 1 //For those tiles with only one direction.
#define DIR_ORTHO 2 //Orthogonal (south, west, north, east).
#define DIR_ALL 3 //All the directions.
#define PAINT_ASK_DESC = 1
s
/datum/rcd_schematic/tile
name = "Decals"
category = "Painting"
flags = RCD_GET_TURF
var/datum/paint_info/selected
var/selected_dir = 2
/datum/rcd_schematic/tile/send_icons(var/client/client)
var/list/our_list = get_our_list()
if(!our_list)
return
for(var/datum/paint_info/P in our_list)
for(var/ndir in get_dir_list_by_dir_type(P.adirs))
client << browse_rsc(new/icon(P.icon, P.icon_state, ndir), "[P.file_name][P.icon_state]_[ndir].png")
/datum/rcd_schematic/tile/proc/get_dir_list_by_dir_type(var/adir)
switch(adir)
if(DIR_ONE)
return list(SOUTH)
if(DIR_ORTHO)
return cardinal
if(DIR_ALL)
return alldirs
/datum/rcd_schematic/tile/get_HTML()
. += "<p>"
var/list/our_list = get_our_list()
for(var/datum/paint_info/P in our_list)
for(var/dir in get_dir_list_by_dir_type(P.adirs))
var/selected = ""
if(selected == P && dir == selected_dir)
selected = " class='selected'"
. += "<a href='?src=\ref[master.interface];select_paint=[our_list.Find(P)];set_dir=[dir]'[selected]><img src='[P.file_name][P.icon_state]_[dir].png'/></a>"
. += "</p>"
/datum/rcd_schematic/tile/Topic(var/href, var/href_list)
if(href_list["select_paint"])
var/list/our_list = get_our_list()
var/idx = Clamp(round(text2num(href_list["select_paint"])), 1, our_list.len)
selected = our_list[idx]
if(!(selected_dir in get_dir_list_by_dir_type(selected.adirs)))
selected_dir = 2
master.update_options_menu()
. = 1
if(href_list["set_dir"])
var/dir = text2num(href_list["set_dir"])
if(!(dir in get_dir_list_by_dir_type(selected.adirs)))
return 1
selected_dir = dir
/datum/rcd_schematic/tile/attack(var/atom/A, var/mob/user)
if(!selected)
return 1
if(!selected.validate(A))
return "maybe you're using it on the wrong floor type?"
var/nname = ""
switch(selected.ftype)
if(PAINT_FLOOR) nname = "floor" //restoring the name of our new tile, usually if you place a floor tile on a plating it's still called "plating" for now
if(PAINT_REINFORCED) nname = "reinforced floor" //also getting rid of the plaque if it's there
if(PAINT_PLATING) nname = "plating"
user << "Painting floor..."
playsound(get_turf(master), 'sound/machines/click.ogg', 50, 1)
if(!do_after(user, A, 20))
return 1
playsound(get_turf(master), 'sound/effects/extinguish.ogg', 25, 1)
selected.apply(A, nname, dir = selected_dir)
//Gets the list of paint info datums.
/datum/rcd_schematic/tile/proc/get_our_list()
return paint_variants[name]
/datum/paint_info
var/icon/icon = 'icons/turf/floors.dmi'
var/icon_state = "floor"
var/ftype = PAINT_FLOOR //The floor type required for this paint job.
var/adirs = DIR_ONE //Available dirs for this floor type.
var/file_name = "tile_painter_" //The file data gets added after this, used to seperate the decals and floor types.
var/flags = 0
/datum/paint_info/New(var/padir, var/picon, var/ptype, var/nflags = 0)
if(ptype)
ftype = ptype
if(padir)
adirs = padir
if(picon)
icon_state = picon
flags = nflags
//This is used to give the user a hint that he's a massive retard for using a floor painter on the carpet
/datum/paint_info/proc/validate(var/turf/simulated/floor/test)
switch(ftype)
if(PAINT_FLOOR) //why is it named plasteel anyway?
if(!(istype(test.floor_tile,/obj/item/stack/tile/plasteel)))
return 0 //if it's carpet, wood or some other stuff, we aren't going to paint that
if(istype(test, /turf/simulated/floor/engine))
return 0 //reinforced floor has plasteel in floor_tile too
//but that isn't a regular floor
if(PAINT_PLATING)
if(!istype(test,/turf/simulated/floor/plating))
return 0
if(PAINT_REINFORCED)
if(!istype(test,/turf/simulated/floor/engine))
return 0
return 1
/datum/paint_info/proc/apply(var/turf/simulated/floor/T, var/pname, var/pdesc, var/dir)
T.icon_state = icon_state
T.icon_regular_floor = icon_state //required to 'save' the new floor type so if someone crowbars it and puts it back it won't revert to the original state
T.dir = dir
T.desc = pdesc //so if you paint over a plaque with a floor the tile loses its description
if(pname)
T.name = pname
T.ClearDecals()
/datum/paint_info/decal
icon = 'icons/effects/warning_stripes.dmi'
ftype = PAINT_ALL
file_name = "tile_painter_d_"
/datum/paint_info/decal/apply(var/turf/simulated/floor/T, var/pname, var/pdesc, var/dir)
T.AddDecal(image(icon, icon_state = icon_state, dir = dir))
//The list of all available floor design groups.
/datum/rcd_schematic/tile/gray
name = "Gray"
/datum/rcd_schematic/tile/neutral
name = "Neutral"
/datum/rcd_schematic/tile/white
name = "White"
/datum/rcd_schematic/tile/red
name = "Red"
/datum/rcd_schematic/tile/green
name = "Green"
/datum/rcd_schematic/tile/blue
name = "Blue"
/datum/rcd_schematic/tile/yellow
name = "Yellow"
/datum/rcd_schematic/tile/purple
name = "Purple"
/datum/rcd_schematic/tile/orange
name = "Orange"
/datum/rcd_schematic/tile/brown
name = "Brown"
/datum/rcd_schematic/tile/red_yellow
name = "Red and yellow"
/datum/rcd_schematic/tile/red_blue
name = "Red and blue"
/datum/rcd_schematic/tile/red_green
name = "Red and green"
/datum/rcd_schematic/tile/green_yellow
name = "Green and yellow"
/datum/rcd_schematic/tile/green_blue
name = "Green and blue"
/datum/rcd_schematic/tile/blue_yellow
name = "Blue and yellow"
/datum/rcd_schematic/tile/white_red
name = "White red"
/datum/rcd_schematic/tile/white_green
name = "White green"
/datum/rcd_schematic/tile/white_blue
name = "White blue"
/datum/rcd_schematic/tile/white_yellow
name = "White yellow"
/datum/rcd_schematic/tile/white_purple
name = "White purple"
/datum/rcd_schematic/tile/arrival
name = "Arrival"
/datum/rcd_schematic/tile/escape
name = "Escape"
/datum/rcd_schematic/tile/dark
name = "Dark"
/datum/rcd_schematic/tile/dark_red
name = "Dark red"
/datum/rcd_schematic/tile/dark_blue
name = "Dark blue"
/datum/rcd_schematic/tile/dark_green
name = "Dark green"
/datum/rcd_schematic/tile/dark_purple
name = "Dark purple"
/datum/rcd_schematic/tile/dark_yellow
name = "Dark yellow"
/datum/rcd_schematic/tile/dark_orange
name = "Dark orange"
/datum/rcd_schematic/tile/dark_vault
name = "Dark vault"
/datum/rcd_schematic/tile/markings
name = "Markings"
/datum/rcd_schematic/tile/loading
name = "Loading area"
/datum/rcd_schematic/tile/warning
name = "Warning"
/datum/rcd_schematic/tile/warning_white
name = "White warning"
/datum/rcd_schematic/tile/warning_reinforced
name = "Reinforced warning"
/datum/rcd_schematic/tile/warning_plating
name = "Plating warning"
/datum/rcd_schematic/tile/chapel
name = "Chapel"
/datum/rcd_schematic/tile/ss13_logo
name = "SS13 logo"
/datum/rcd_schematic/tile/derelict_logo
name = "Derelict logo"
/datum/rcd_schematic/tile/other
name = "Other"
//Ririchiyo's potatobox grid.
/datum/rcd_schematic/tile/all
name = "All"
//We override this so we DON'T send files twice, sending is handled in the specific ones.
/datum/rcd_schematic/tile/all/send_icons(var/client/client)
return
//We get EVERY paint info datum.
/datum/rcd_schematic/tile/all/get_our_list()
. = list()
for(var/key in paint_variants)
for(var/datum/paint_info/P in paint_variants[key])
. += P
var/global/list/paint_variants = list(
"Decals" = list(
// Stripes
new /datum/paint_info/decal(DIR_ALL, "warning"),
new /datum/paint_info/decal(DIR_ONE, "all"),
// Loading areas (TODO: colourable)
new /datum/paint_info/decal(DIR_ORTHO, "warning_corner"),
new /datum/paint_info/decal(DIR_ONE, "unloading"),
new /datum/paint_info/decal(DIR_ONE, "bot"),
new /datum/paint_info/decal(DIR_ORTHO, "loading_area"),
new /datum/paint_info/decal(DIR_ONE, "no"),
// Atmos lettering
new /datum/paint_info/decal(DIR_ORTHO, "oxygen"),
new /datum/paint_info/decal(DIR_ORTHO, "nitrogen"),
new /datum/paint_info/decal(DIR_ORTHO, "carbon_dioxide"),
new /datum/paint_info/decal(DIR_ORTHO, "nitrous_oxide"),
new /datum/paint_info/decal(DIR_ORTHO, "air"),
new /datum/paint_info/decal(DIR_ORTHO, "plasma"),
new /datum/paint_info/decal(DIR_ORTHO, "zoo"),
// Numbers
new /datum/paint_info/decal(DIR_ORTHO, "1"),
new /datum/paint_info/decal(DIR_ORTHO, "2"),
new /datum/paint_info/decal(DIR_ORTHO, "3"),
new /datum/paint_info/decal(DIR_ORTHO, "4"),
new /datum/paint_info/decal(DIR_ORTHO, "5"),
new /datum/paint_info/decal(DIR_ORTHO, "6"),
new /datum/paint_info/decal(DIR_ORTHO, "7"),
new /datum/paint_info/decal(DIR_ORTHO, "8"),
new /datum/paint_info/decal(DIR_ORTHO, "9"),
new /datum/paint_info/decal(DIR_ORTHO, "0"),
// Path markers
new /datum/paint_info/decal(DIR_ORTHO, "1"),
new /datum/paint_info/decal(DIR_ORTHO, "1"),
new /datum/paint_info/decal(DIR_ORTHO, "1"),
new /datum/paint_info/decal(DIR_ORTHO, "1"),
),
"Gray" = list(
new /datum/paint_info(DIR_ONE, "floor"),
new /datum/paint_info(DIR_ALL, "black"),
new /datum/paint_info(DIR_ORTHO, "blackcorner")
),
"Neutral" = list(
new /datum/paint_info(DIR_ALL, "neutral"),
new /datum/paint_info(DIR_ORTHO, "neutralcorner"),
new /datum/paint_info(DIR_ONE, "neutralfull")
),
"White" = list(
new /datum/paint_info(DIR_ONE, "white"),
new /datum/paint_info(DIR_ALL, "whitehall"),
new /datum/paint_info(DIR_ORTHO, "whitecorner")
),
"Red" = list(
new /datum/paint_info(DIR_ONE, "redfull"),
new /datum/paint_info(DIR_ALL, "red"),
new /datum/paint_info(DIR_ORTHO, "redcorner")
),
"Green" = list(
new /datum/paint_info(DIR_ONE, "greenfull"),
new /datum/paint_info(DIR_ALL, "green"),
new /datum/paint_info(DIR_ORTHO, "greencorner")
),
"Blue" = list(
new /datum/paint_info(DIR_ONE, "bluefull"),
new /datum/paint_info(DIR_ALL, "blue"),
new /datum/paint_info(DIR_ORTHO, "bluecorner")
),
"Yellow" = list(
new /datum/paint_info(DIR_ONE, "yellowfull"),
new /datum/paint_info(DIR_ALL, "yellow"),
new /datum/paint_info(DIR_ORTHO, "yellowcorner")
),
"Purple" = list(
new /datum/paint_info(DIR_ONE, "purplefull"),
new /datum/paint_info(DIR_ALL, "purple"),
new /datum/paint_info(DIR_ORTHO, "purplecorner")
),
"Orange" = list(
new /datum/paint_info(DIR_ONE, "orangefull"),
new /datum/paint_info(DIR_ALL, "orange"),
new /datum/paint_info(DIR_ORTHO, "orangecorner")
),
"Brown" = list(
new /datum/paint_info(DIR_ONE, "dark brown full"),
new /datum/paint_info(DIR_ALL, "brown"),
new /datum/paint_info(DIR_ORTHO, "browncorner")
),
"Red and yellow" = list(
new /datum/paint_info(DIR_ONE, "redyellowfull"),
new /datum/paint_info(DIR_ALL, "redyellow")
),
"Red and blue" = list(
new /datum/paint_info(DIR_ONE, "redbluefull"),
new /datum/paint_info(DIR_ALL, "redblue")
),
"Red and green" = list(
new /datum/paint_info(DIR_ONE, "redgreenfull"),
new /datum/paint_info(DIR_ALL, "redgreen")
),
"Green and yellow" = list(
new /datum/paint_info(DIR_ONE, "greenyellowfull"),
new /datum/paint_info(DIR_ALL, "greenyellow")
),
"Green and blue" = list(
new /datum/paint_info(DIR_ONE, "greenbluefull"),
new /datum/paint_info(DIR_ALL, "greenblue")
),
"Blue and yellow" = list(
new /datum/paint_info(DIR_ONE, "blueyellowfull"),
new /datum/paint_info(DIR_ALL, "blueyellow")
),
"White red" = list(
new /datum/paint_info(DIR_ONE, "whiteredfull"),
new /datum/paint_info(DIR_ALL, "whitered"),
new /datum/paint_info(DIR_ORTHO, "whiteredcorner")
),
"White green" = list(
new /datum/paint_info(DIR_ONE, "whitegreenfull"),
new /datum/paint_info(DIR_ALL, "whitegreen"),
new /datum/paint_info(DIR_ORTHO, "whitegreencorner")
),
"White blue" = list(
new /datum/paint_info(DIR_ONE, "whitebluefull"),
new /datum/paint_info(DIR_ALL, "whiteblue"),
new /datum/paint_info(DIR_ORTHO, "whitebluecorner"),
new /datum/paint_info(DIR_ONE, "cmo")
),
"White yellow" = list(
new /datum/paint_info(DIR_ONE, "whiteyellowfull"),
new /datum/paint_info(DIR_ALL, "whiteyellow"),
new /datum/paint_info(DIR_ORTHO, "whiteyellowcorner")
),
"White purple" = list(
new /datum/paint_info(DIR_ONE, "whitepurplefull"),
new /datum/paint_info(DIR_ALL, "whitepurple"),
new /datum/paint_info(DIR_ORTHO, "whitepurplecorner")
),
"Arrival" = list(
new /datum/paint_info(DIR_ALL, "arrival")
),
"Escape" = list(
new /datum/paint_info(DIR_ALL, "escape")
),
"Dark" = list(
new /datum/paint_info(DIR_ONE, "dark"),
new /datum/paint_info(DIR_ALL, "dark floor stripe"),
new /datum/paint_info(DIR_ORTHO, "dark floor corner")
),
"Dark red" = list(
new /datum/paint_info(DIR_ONE, "dark red full"),
new /datum/paint_info(DIR_ALL, "dark red stripe"),
new /datum/paint_info(DIR_ORTHO, "dark red corner")
),
"Dark blue" = list(
new /datum/paint_info(DIR_ONE, "dark blue full"),
new /datum/paint_info(DIR_ALL, "dark blue stripe"),
new /datum/paint_info(DIR_ORTHO, "dark blue corner")
),
"Dark green" = list(
new /datum/paint_info(DIR_ONE, "dark green full"),
new /datum/paint_info(DIR_ALL, "dark green stripe"),
new /datum/paint_info(DIR_ORTHO, "dark green corner")
),
"Dark purple" = list(
new /datum/paint_info(DIR_ONE, "dark purple full"),
new /datum/paint_info(DIR_ALL, "dark purple stripe"),
new /datum/paint_info(DIR_ORTHO, "dark purple corner")
),
"Dark yellow" = list(
new /datum/paint_info(DIR_ONE, "dark yellow full"),
new /datum/paint_info(DIR_ALL, "dark yellow stripe"),
new /datum/paint_info(DIR_ORTHO, "dark yellow corner")
),
"Dark orange" = list(
new /datum/paint_info(DIR_ONE, "dark orange full"),
new /datum/paint_info(DIR_ALL, "dark orange stripe"),
new /datum/paint_info(DIR_ORTHO, "dark orange corner")
),
"Dark vault" = list(
new /datum/paint_info(DIR_ONE, "dark vault full"),
new /datum/paint_info(DIR_ALL, "dark vault stripe"),
new /datum/paint_info(DIR_ORTHO, "dark vault corner"),
new /datum/paint_info(DIR_ORTHO, "dark-markings")
),
"Markings" = list(
new /datum/paint_info(DIR_ONE, "delivery"),
new /datum/paint_info(DIR_ONE, "bot"),
new /datum/paint_info(DIR_ONE, "whitedelivery"),
new /datum/paint_info(DIR_ONE, "whitebot"),
new /datum/paint_info(DIR_ONE, "enginedelivery", PAINT_REINFORCED),
new /datum/paint_info(DIR_ONE, "enginebot", PAINT_REINFORCED),
new /datum/paint_info(DIR_ONE, "plaque")
),
"Loading area" = list(
new /datum/paint_info(DIR_ORTHO, "loadingarea"),
new /datum/paint_info(DIR_ORTHO, "engineloadingarea", PAINT_REINFORCED),
new /datum/paint_info(DIR_ORTHO, "dark loading")
),
"Warning" = list(
new /datum/paint_info(DIR_ALL, "warning"),
new /datum/paint_info(DIR_ORTHO, "warningcorner")
),
"White warning" = list(
new /datum/paint_info(DIR_ALL, "warnwhite"),
new /datum/paint_info(DIR_ORTHO, "warnwhitecorner")
),
"Reinforced warning" = list(
new /datum/paint_info(DIR_ALL, "enginewarn", PAINT_REINFORCED),
new /datum/paint_info(DIR_ORTHO, "enginewarncorner", PAINT_REINFORCED)
),
"Plating warning" = list(
new /datum/paint_info(DIR_ALL, "warnplate", PAINT_PLATING),
new /datum/paint_info(DIR_ORTHO, "warnplatecorner", PAINT_PLATING)
),
"Chapel" = list(
new /datum/paint_info(DIR_ALL, "chapel")
),
"SS13 logo" = list(
new /datum/paint_info(DIR_ONE, "L1"),
new /datum/paint_info(DIR_ONE, "L3"),
new /datum/paint_info(DIR_ONE, "L5"),
new /datum/paint_info(DIR_ONE, "L7"),
new /datum/paint_info(DIR_ONE, "L9"),
new /datum/paint_info(DIR_ONE, "L11"),
new /datum/paint_info(DIR_ONE, "L13"),
new /datum/paint_info(DIR_ONE, "L15"),
new /datum/paint_info(DIR_ONE, "L2"),
new /datum/paint_info(DIR_ONE, "L4"),
new /datum/paint_info(DIR_ONE, "L6"),
new /datum/paint_info(DIR_ONE, "L8"),
new /datum/paint_info(DIR_ONE, "L10"),
new /datum/paint_info(DIR_ONE, "L12"),
new /datum/paint_info(DIR_ONE, "L14"),
new /datum/paint_info(DIR_ONE, "L16")
),
"Derelict logo" = list(
new /datum/paint_info(DIR_ONE, "derelict9"),
new /datum/paint_info(DIR_ONE, "derelict10"),
new /datum/paint_info(DIR_ONE, "derelict11"),
new /datum/paint_info(DIR_ONE, "derelict12"),
new /datum/paint_info(DIR_ONE, "derelict13"),
new /datum/paint_info(DIR_ONE, "derelict14"),
new /datum/paint_info(DIR_ONE, "derelict15"),
new /datum/paint_info(DIR_ONE, "derelict16"),
new /datum/paint_info(DIR_ONE, "derelict1"),
new /datum/paint_info(DIR_ONE, "derelict2"),
new /datum/paint_info(DIR_ONE, "derelict3"),
new /datum/paint_info(DIR_ONE, "derelict4"),
new /datum/paint_info(DIR_ONE, "derelict5"),
new /datum/paint_info(DIR_ONE, "derelict6"),
new /datum/paint_info(DIR_ONE, "derelict7"),
new /datum/paint_info(DIR_ONE, "derelict8")
),
"Other" = list(
new /datum/paint_info(DIR_ONE, "dark"),
new /datum/paint_info(DIR_ONE, "bar"),
new /datum/paint_info(DIR_ONE, "cafeteria"),
new /datum/paint_info(DIR_ONE, "checker"),
new /datum/paint_info(DIR_ONE, "barber"),
new /datum/paint_info(DIR_ONE, "grimy"),
new /datum/paint_info(DIR_ONE, "hydrofloor"),
new /datum/paint_info(DIR_ONE, "showroomfloor"),
new /datum/paint_info(DIR_ONE, "freezerfloor"),
new /datum/paint_info(DIR_ONE, "bcircuit"),
new /datum/paint_info(DIR_ONE, "gcircuit"),
new /datum/paint_info(DIR_ONE, "solarpanel")
)
)

View File

@@ -0,0 +1,15 @@
/obj/item/device/rcd/tile_painter
name = "tile painter"
desc = "A device used to paint floors in various colours and fashions."
icon_state = "rpd" //placeholder art, someone please sprite it
starting_materials = list(MAT_IRON = 75000, MAT_GLASS = 37500)
origin_tech = "engineering=2;materials=1"
sparky = 0
/obj/item/device/rcd/tile_painter/New()
schematics = typesof(/datum/rcd_schematic/tile) //For some stupid reason typesof() isn't constant.
. = ..()