mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Merge branch 'master' into corporate-comms
This commit is contained in:
@@ -32,3 +32,13 @@
|
||||
|
||||
/obj/item/camera_bug/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_inventory_state)
|
||||
integrated_console.tgui_interact(user, ui_key, ui, force_open, master_ui, state)
|
||||
|
||||
|
||||
/obj/item/camera_bug/ert
|
||||
name = "ERT Camera Monitor"
|
||||
desc = "A small handheld device used by ERT commanders to view camera feeds remotely."
|
||||
|
||||
/obj/item/camera_bug/ert/Initialize(mapload)
|
||||
. = ..()
|
||||
integrated_console.network = list("ERT")
|
||||
|
||||
|
||||
@@ -50,57 +50,65 @@
|
||||
if(!user)
|
||||
return 0
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
tgui_interact(user)
|
||||
return 1
|
||||
|
||||
/obj/item/floor_painter/interact(mob/user as mob)
|
||||
if(!floor_icon)
|
||||
floor_icon = icon('icons/turf/floors.dmi', floor_state, floor_dir)
|
||||
user << browse_rsc(floor_icon, "floor.png")
|
||||
var/dat = {"
|
||||
<center>
|
||||
<a href="?src=[UID()];cycleleft=1"><-</a>
|
||||
<img style="-ms-interpolation-mode: nearest-neighbor;" src="floor.png" width=128 height=128 border=4>
|
||||
<a href="?src=[UID()];cycleright=1">-></a>
|
||||
</center>
|
||||
<a href="?src=[UID()];choose_state=1">Choose Style</a>
|
||||
<div class='statusDisplay'>Style: [floor_state]</div>
|
||||
<a href="?src=[UID()];choose_dir=1">Choose Direction</a>
|
||||
<div class='statusDisplay'>Direction: [dir2text(floor_dir)]</div>
|
||||
"}
|
||||
/obj/item/floor_painter/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null,
|
||||
datum/tgui_state/state = GLOB.tgui_inventory_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "FloorPainter", name, 405, 470, master_ui, state)
|
||||
// Disable automatic updates, because:
|
||||
// 1) we are the only user of the item, and don't expect to observe external changes
|
||||
// 2) generating and sending the icon each tick is a bit expensive, and creates small but noticeable lag
|
||||
ui.set_autoupdate(FALSE)
|
||||
ui.open()
|
||||
|
||||
var/datum/browser/popup = new(user, "floor_painter", name, 225, 300)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
/obj/item/floor_painter/tgui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["availableStyles"] = allowed_states
|
||||
data["selectedStyle"] = floor_state
|
||||
data["selectedDir"] = dir2text(floor_dir)
|
||||
|
||||
/obj/item/floor_painter/Topic(href, href_list)
|
||||
data["directionsPreview"] = list()
|
||||
for(var/dir in GLOB.alldirs)
|
||||
var/icon/floor_icon = icon('icons/turf/floors.dmi', floor_state, dir)
|
||||
data["directionsPreview"][dir2text(dir)] = icon2base64(floor_icon)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
/obj/item/floor_painter/tgui_static_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["allStylesPreview"] = list()
|
||||
for (var/style in allowed_states)
|
||||
var/icon/floor_icon = icon('icons/turf/floors.dmi', style, SOUTH)
|
||||
data["allStylesPreview"][style] = icon2base64(floor_icon)
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/floor_painter/tgui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["choose_state"])
|
||||
var/state = input("Please select a style", "[src]") as null|anything in allowed_states
|
||||
if(state)
|
||||
floor_state = state
|
||||
floor_dir = SOUTH // Reset dir, because some icon_states might not have that dir.
|
||||
if(href_list["choose_dir"])
|
||||
var/seldir = input("Please select a direction", "[src]") as null|anything in list("north", "south", "east", "west", "northeast", "northwest", "southeast", "southwest")
|
||||
if(seldir)
|
||||
floor_dir = text2dir(seldir)
|
||||
if(href_list["cycleleft"])
|
||||
var/index = allowed_states.Find(floor_state)
|
||||
index--
|
||||
if(index < 1)
|
||||
index = allowed_states.len
|
||||
floor_state = allowed_states[index]
|
||||
floor_dir = SOUTH
|
||||
if(href_list["cycleright"])
|
||||
var/index = allowed_states.Find(floor_state)
|
||||
index++
|
||||
if(index > allowed_states.len)
|
||||
index = 1
|
||||
floor_state = allowed_states[index]
|
||||
floor_dir = SOUTH
|
||||
if(action == "select_style")
|
||||
var/new_style = params["style"]
|
||||
if (allowed_states.Find(new_style) != 0)
|
||||
floor_state = new_style
|
||||
|
||||
floor_icon = icon('icons/turf/floors.dmi', floor_state, floor_dir)
|
||||
if(usr)
|
||||
attack_self(usr)
|
||||
if(action == "cycle_style")
|
||||
var/index = allowed_states.Find(floor_state)
|
||||
index += text2num(params["offset"])
|
||||
while(index < 1)
|
||||
index += length(allowed_states)
|
||||
while(index > length(allowed_states))
|
||||
index -= length(allowed_states)
|
||||
floor_state = allowed_states[index]
|
||||
|
||||
if(action == "select_direction")
|
||||
var/dir = text2dir(params["direction"])
|
||||
if (dir != 0)
|
||||
floor_dir = dir
|
||||
|
||||
SStgui.update_uis(src)
|
||||
|
||||
@@ -297,19 +297,27 @@
|
||||
freqlock = TRUE
|
||||
|
||||
/obj/item/radio/headset/ert/alt
|
||||
name = "\proper emergency response team's bowman headset"
|
||||
name = "emergency response team's bowman headset"
|
||||
desc = "The headset of the boss. Protects ears from flashbangs."
|
||||
flags = EARBANGPROTECT
|
||||
icon_state = "com_headset_alt"
|
||||
item_state = "com_headset_alt"
|
||||
|
||||
/obj/item/radio/headset/ert/alt/commander
|
||||
name = "ERT commander's bowman headset"
|
||||
desc = "The headset of the boss. Protects ears from flashbangs. Can transmit even if telecomms are down."
|
||||
requires_tcomms = FALSE
|
||||
instant = TRUE
|
||||
|
||||
/obj/item/radio/headset/centcom
|
||||
name = "\proper centcom officer's bowman headset"
|
||||
desc = "The headset of final authority. Protects ears from flashbangs."
|
||||
desc = "The headset of final authority. Protects ears from flashbangs. Can transmit even if telecomms are down."
|
||||
flags = EARBANGPROTECT
|
||||
icon_state = "com_headset_alt"
|
||||
item_state = "com_headset_alt"
|
||||
ks2type = /obj/item/encryptionkey/centcom
|
||||
requires_tcomms = FALSE
|
||||
instant = TRUE
|
||||
|
||||
/obj/item/radio/headset/heads/ai_integrated //No need to care about icons, it should be hidden inside the AI anyway.
|
||||
name = "\improper AI subspace transceiver"
|
||||
|
||||
@@ -181,6 +181,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
||||
singular_name = "diamond"
|
||||
origin_tech = "materials=6"
|
||||
sheettype = "diamond"
|
||||
merge_type = /obj/item/stack/sheet/mineral/diamond
|
||||
materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT)
|
||||
point_value = 25
|
||||
|
||||
@@ -197,6 +198,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
||||
singular_name = "uranium sheet"
|
||||
origin_tech = "materials=5"
|
||||
sheettype = "uranium"
|
||||
merge_type = /obj/item/stack/sheet/mineral/uranium
|
||||
materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT)
|
||||
point_value = 20
|
||||
|
||||
@@ -210,6 +212,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
||||
singular_name = "plasma sheet"
|
||||
origin_tech = "plasmatech=2;materials=2"
|
||||
sheettype = "plasma"
|
||||
merge_type = /obj/item/stack/sheet/mineral/plasma
|
||||
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT)
|
||||
resistance_flags = FLAMMABLE
|
||||
max_integrity = 100
|
||||
@@ -252,6 +255,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
||||
singular_name = "gold bar"
|
||||
origin_tech = "materials=4"
|
||||
sheettype = "gold"
|
||||
merge_type = /obj/item/stack/sheet/mineral/gold
|
||||
materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT)
|
||||
point_value = 20
|
||||
|
||||
@@ -265,6 +269,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
||||
singular_name = "silver bar"
|
||||
origin_tech = "materials=4"
|
||||
sheettype = "silver"
|
||||
merge_type = /obj/item/stack/sheet/mineral/silver
|
||||
materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT)
|
||||
point_value = 20
|
||||
|
||||
@@ -278,6 +283,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
||||
singular_name = "bananium sheet"
|
||||
origin_tech = "materials=4"
|
||||
sheettype = "bananium"
|
||||
merge_type = /obj/item/stack/sheet/mineral/bananium
|
||||
materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT)
|
||||
point_value = 50
|
||||
|
||||
@@ -294,6 +300,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
||||
singular_name = "beret"
|
||||
origin_tech = "materials=4"
|
||||
sheettype = "tranquillite"
|
||||
merge_type = /obj/item/stack/sheet/mineral/tranquillite
|
||||
materials = list(MAT_TRANQUILLITE=MINERAL_MATERIAL_AMOUNT)
|
||||
wall_allowed = FALSE //no tranquilite walls in code
|
||||
point_value = 50
|
||||
@@ -319,6 +326,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
||||
throw_speed = 1
|
||||
throw_range = 3
|
||||
sheettype = "titanium"
|
||||
merge_type = /obj/item/stack/sheet/mineral/titanium
|
||||
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT)
|
||||
point_value = 20
|
||||
|
||||
@@ -349,6 +357,7 @@ GLOBAL_LIST_INIT(titanium_recipes, list(
|
||||
throw_speed = 1
|
||||
throw_range = 3
|
||||
sheettype = "plastitanium"
|
||||
merge_type = /obj/item/stack/sheet/mineral/plastitanium
|
||||
materials = list(MAT_TITANIUM=2000, MAT_PLASMA=2000)
|
||||
point_value = 45
|
||||
|
||||
|
||||
@@ -1,42 +1,20 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
RCD // no fucking shit sherlock
|
||||
*/
|
||||
#define RCD_PAGE_MAIN 1
|
||||
#define RCD_PAGE_AIRLOCK 2
|
||||
|
||||
#define RCD_MODE_TURF "Turf"
|
||||
#define RCD_MODE_AIRLOCK "Airlock"
|
||||
#define RCD_MODE_DECON "Deconstruct"
|
||||
#define RCD_MODE_WINDOW "Windows"
|
||||
#define MATTER_100 100
|
||||
#define MATTER_500 500
|
||||
|
||||
GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
/obj/machinery/door/airlock = "Standard", /obj/machinery/door/airlock/glass = "Standard (Glass)",
|
||||
/obj/machinery/door/airlock/command = "Command", /obj/machinery/door/airlock/command/glass = "Command (Glass)",
|
||||
/obj/machinery/door/airlock/security = "Security", /obj/machinery/door/airlock/security/glass = "Security (Glass)",
|
||||
/obj/machinery/door/airlock/engineering = "Engineering", /obj/machinery/door/airlock/engineering/glass = "Engineering (Glass)",
|
||||
/obj/machinery/door/airlock/medical = "Medical", /obj/machinery/door/airlock/medical/glass = "Medical (Glass)",
|
||||
/obj/machinery/door/airlock/maintenance = "Maintenance", /obj/machinery/door/airlock/maintenance/glass = "Maintenance (Glass)",
|
||||
/obj/machinery/door/airlock/external = "External", /obj/machinery/door/airlock/external/glass = "External (Glass)",
|
||||
/obj/machinery/door/airlock/maintenance/external = "External Maintenance",
|
||||
/obj/machinery/door/airlock/maintenance/external/glass = "External Maintenance (Glass)",
|
||||
/obj/machinery/door/airlock/freezer = "Freezer",
|
||||
/obj/machinery/door/airlock/mining = "Mining", /obj/machinery/door/airlock/mining/glass = "Mining (Glass)",
|
||||
/obj/machinery/door/airlock/research = "Research", /obj/machinery/door/airlock/research/glass = "Research (Glass)",
|
||||
/obj/machinery/door/airlock/atmos = "Atmospherics", /obj/machinery/door/airlock/atmos/glass = "Atmospherics (Glass)",
|
||||
/obj/machinery/door/airlock/science = "Science", /obj/machinery/door/airlock/science/glass = "Science (Glass)",
|
||||
/obj/machinery/door/airlock/hatch = "Airtight Hatch",
|
||||
/obj/machinery/door/airlock/maintenance_hatch = "Maintenance Hatch"
|
||||
))
|
||||
#define TAB_AIRLOCK_TYPE 1
|
||||
#define TAB_AIRLOCK_ACCESS 2
|
||||
|
||||
#define MODE_TURF "Floors and Walls"
|
||||
#define MODE_AIRLOCK "Airlocks"
|
||||
#define MODE_WINDOW "Windows"
|
||||
#define MODE_DECON "Deconstruction"
|
||||
|
||||
/obj/item/rcd
|
||||
name = "rapid-construction-device (RCD)"
|
||||
desc = "A device used to rapidly build and deconstruct walls, floors and airlocks."
|
||||
icon = 'icons/obj/tools.dmi'
|
||||
icon_state = "rcd"
|
||||
opacity = 0
|
||||
density = 0
|
||||
anchored = 0
|
||||
flags = CONDUCT | NOBLUDGEON
|
||||
force = 0
|
||||
throwforce = 10
|
||||
@@ -51,24 +29,36 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
req_access = list(ACCESS_ENGINE)
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 50)
|
||||
resistance_flags = FIRE_PROOF
|
||||
// Important shit
|
||||
/// The spark system used to create sparks when the user interacts with the RCD.
|
||||
var/datum/effect_system/spark_spread/spark_system
|
||||
var/matter = 0
|
||||
var/max_matter = 100
|
||||
var/mode = RCD_MODE_TURF
|
||||
var/canRwall = 0
|
||||
|
||||
// UI shit
|
||||
var/menu = RCD_PAGE_MAIN
|
||||
/// The current amount of matter stored.
|
||||
var/matter = NONE
|
||||
/// The max amount of matter that can be stored.
|
||||
var/max_matter = MATTER_100
|
||||
/// The RCD's current build mode.
|
||||
var/mode = MODE_TURF
|
||||
/// If the RCD can deconstruct reinforced walls.
|
||||
var/canRwall = FALSE
|
||||
/// Is the RCD's airlock access selection menu locked?
|
||||
var/locked = TRUE
|
||||
/// The current airlock type that will be build.
|
||||
var/door_type = /obj/machinery/door/airlock
|
||||
/// The name that newly build airlocks will receive.
|
||||
var/door_name = "Airlock"
|
||||
var/list/door_accesses = list()
|
||||
var/list/door_accesses_list = list()
|
||||
var/one_access
|
||||
|
||||
// Stupid shit
|
||||
var/static/allowed_targets = list(/turf, /obj/structure/grille, /obj/structure/window, /obj/structure/lattice, /obj/machinery/door/airlock)
|
||||
/// If this is TRUE, any airlocks that gets built will require only ONE of the checked accesses. If FALSE, it will require ALL of them.
|
||||
var/one_access = TRUE
|
||||
/// Which airlock tab the UI is currently set to display.
|
||||
var/ui_tab = TAB_AIRLOCK_TYPE
|
||||
/// A list of access numbers which have been checked off by the user in the UI.
|
||||
var/list/selected_accesses = list()
|
||||
/// A list of valid atoms that RCDs can target. Clicking on an atom with an RCD which is not in this list, will do nothing.
|
||||
var/static/list/allowed_targets = list(/turf, /obj/structure/grille, /obj/structure/window, /obj/structure/lattice, /obj/machinery/door/airlock)
|
||||
/// An associative list of airlock type paths as keys, and their names as values.
|
||||
var/static/list/rcd_door_types = list()
|
||||
/// An associative list containing an airlock's name, type path, and image. For use with the UI.
|
||||
var/static/list/door_types_ui_list = list()
|
||||
/// An associative list containing all station accesses. Includes their name and access number. For use with the UI.
|
||||
var/static/list/door_accesses_list = list()
|
||||
|
||||
/obj/item/rcd/Initialize()
|
||||
. = ..()
|
||||
@@ -77,9 +67,49 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
spark_system.attach(src)
|
||||
GLOB.rcd_list += src
|
||||
|
||||
door_accesses_list = list()
|
||||
for(var/access in get_all_accesses())
|
||||
door_accesses_list[++door_accesses_list.len] = list("name" = get_access_desc(access), "id" = access, "enabled" = (access in door_accesses))
|
||||
if(!length(rcd_door_types))
|
||||
rcd_door_types = list(
|
||||
/obj/machinery/door/airlock = "Standard",
|
||||
/obj/machinery/door/airlock/glass = "Standard (Glass)",
|
||||
/obj/machinery/door/airlock/command = "Command",
|
||||
/obj/machinery/door/airlock/command/glass = "Command (Glass)",
|
||||
/obj/machinery/door/airlock/security = "Security",
|
||||
/obj/machinery/door/airlock/security/glass = "Security (Glass)",
|
||||
/obj/machinery/door/airlock/engineering = "Engineering",
|
||||
/obj/machinery/door/airlock/engineering/glass = "Engineering (Glass)",
|
||||
/obj/machinery/door/airlock/atmos = "Atmospherics",
|
||||
/obj/machinery/door/airlock/atmos/glass = "Atmospherics (Glass)",
|
||||
/obj/machinery/door/airlock/mining = "Mining",
|
||||
/obj/machinery/door/airlock/mining/glass = "Mining (Glass)",
|
||||
/obj/machinery/door/airlock/medical = "Medical",
|
||||
/obj/machinery/door/airlock/medical/glass = "Medical (Glass)",
|
||||
/obj/machinery/door/airlock/research = "Research",
|
||||
/obj/machinery/door/airlock/research/glass = "Research (Glass)",
|
||||
/obj/machinery/door/airlock/science = "Science",
|
||||
/obj/machinery/door/airlock/science/glass = "Science (Glass)",
|
||||
/obj/machinery/door/airlock/maintenance = "Maintenance",
|
||||
/obj/machinery/door/airlock/maintenance/glass = "Maintenance (Glass)",
|
||||
/obj/machinery/door/airlock/maintenance/external = "External Maintenance",
|
||||
/obj/machinery/door/airlock/maintenance/external/glass = "External Maint. (Glass)",
|
||||
/obj/machinery/door/airlock/external = "External",
|
||||
/obj/machinery/door/airlock/external/glass = "External (Glass)",
|
||||
/obj/machinery/door/airlock/hatch = "Airtight Hatch",
|
||||
/obj/machinery/door/airlock/maintenance_hatch = "Maintenance Hatch",
|
||||
/obj/machinery/door/airlock/freezer = "Freezer"
|
||||
)
|
||||
if(!length(door_types_ui_list))
|
||||
for(var/type in rcd_door_types)
|
||||
door_types_ui_list += list(list(
|
||||
"name" = rcd_door_types[type],
|
||||
"type" = type,
|
||||
"image" = get_airlock_image(type)
|
||||
))
|
||||
if(!length(door_accesses_list))
|
||||
for(var/access in get_all_accesses())
|
||||
door_accesses_list += list(list(
|
||||
"name" = get_access_desc(access),
|
||||
"id" = access
|
||||
))
|
||||
|
||||
/obj/item/rcd/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -91,15 +121,29 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
GLOB.rcd_list -= src
|
||||
return ..()
|
||||
|
||||
/**
|
||||
* Creates and returns a base64 icon of the given `airlock_type`.
|
||||
*
|
||||
* This is used for airlock icon previews in the UI.
|
||||
*
|
||||
* Arugments:
|
||||
* * airlock_type - an airlock typepath.
|
||||
*/
|
||||
/obj/item/rcd/proc/get_airlock_image(airlock_type)
|
||||
var/obj/machinery/door/airlock/proto = airlock_type
|
||||
var/ic = initial(proto.icon)
|
||||
var/mutable_appearance/MA = mutable_appearance(ic, "closed")
|
||||
if(!initial(proto.glass))
|
||||
MA.overlays += "fill_closed"
|
||||
// Not scaling these down to button size because they look horrible then, instead just bumping up radius.
|
||||
return MA
|
||||
var/obj/machinery/door/airlock/proto = new airlock_type(null)
|
||||
proto.icon_state = "closed"
|
||||
if(!proto.glass)
|
||||
proto.add_overlay("fill_closed")
|
||||
var/icon/I = getFlatIcon(proto)
|
||||
qdel(proto)
|
||||
return "[icon2base64(I)]"
|
||||
|
||||
/**
|
||||
* Runs a series of pre-checks before opening the radial menu to the user.
|
||||
*
|
||||
* Arguments:
|
||||
* * user - the mob trying to open the radial menu.
|
||||
*/
|
||||
/obj/item/rcd/proc/check_menu(mob/living/user)
|
||||
if(!istype(user))
|
||||
return FALSE
|
||||
@@ -108,33 +152,41 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
return TRUE
|
||||
|
||||
/obj/item/rcd/attackby(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(!istype(W, /obj/item/rcd_ammo))
|
||||
return ..()
|
||||
|
||||
if(istype(W, /obj/item/rcd_ammo))
|
||||
var/obj/item/rcd_ammo/R = W
|
||||
if((matter + R.ammoamt) > max_matter)
|
||||
to_chat(user, "<span class='notice'>The RCD can't hold any more matter-units.</span>")
|
||||
return
|
||||
matter += R.ammoamt
|
||||
if(!user.unEquip(R))
|
||||
to_chat(user, "<span class='warning'>[R] is stuck to your hand!</span>")
|
||||
return
|
||||
qdel(R)
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>The RCD now holds [matter]/[max_matter] matter-units.</span>")
|
||||
SSnanoui.update_uis(src)
|
||||
var/obj/item/rcd_ammo/R = W
|
||||
if((matter + R.ammoamt) > max_matter)
|
||||
to_chat(user, "<span class='notice'>The RCD can't hold any more matter-units.</span>")
|
||||
return
|
||||
|
||||
if(!user.unEquip(R))
|
||||
to_chat(user, "<span class='warning'>[R] is stuck to your hand!</span>")
|
||||
return
|
||||
|
||||
matter += R.ammoamt
|
||||
qdel(R)
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
to_chat(user, "<span class='notice'>The RCD now holds [matter]/[max_matter] matter-units.</span>")
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/**
|
||||
* Creates and displays a radial menu to a user when they trigger the `attack_self` of the RCD.
|
||||
*
|
||||
* Arguments:
|
||||
* * user - the mob trying to open the RCD radial.
|
||||
*/
|
||||
/obj/item/rcd/proc/radial_menu(mob/user)
|
||||
if(!check_menu(user))
|
||||
return
|
||||
var/list/choices = list(
|
||||
RCD_MODE_AIRLOCK = image(icon = 'icons/obj/interface.dmi', icon_state = "airlock"),
|
||||
RCD_MODE_DECON = image(icon = 'icons/obj/interface.dmi', icon_state = "delete"),
|
||||
RCD_MODE_WINDOW = image(icon = 'icons/obj/interface.dmi', icon_state = "grillewindow"),
|
||||
RCD_MODE_TURF = image(icon = 'icons/obj/interface.dmi', icon_state = "wallfloor"),
|
||||
MODE_AIRLOCK = image(icon = 'icons/obj/interface.dmi', icon_state = "airlock"),
|
||||
MODE_DECON = image(icon = 'icons/obj/interface.dmi', icon_state = "delete"),
|
||||
MODE_WINDOW = image(icon = 'icons/obj/interface.dmi', icon_state = "grillewindow"),
|
||||
MODE_TURF = image(icon = 'icons/obj/interface.dmi', icon_state = "wallfloor"),
|
||||
"UI" = image(icon = 'icons/obj/interface.dmi', icon_state = "ui_interact")
|
||||
)
|
||||
if(mode == RCD_MODE_AIRLOCK)
|
||||
if(mode == MODE_AIRLOCK)
|
||||
choices += list(
|
||||
"Change Access" = image(icon = 'icons/obj/interface.dmi', icon_state = "access"),
|
||||
"Change Airlock Type" = image(icon = 'icons/obj/interface.dmi', icon_state = "airlocktype")
|
||||
@@ -144,15 +196,18 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
if(!check_menu(user))
|
||||
return
|
||||
switch(choice)
|
||||
if(RCD_MODE_AIRLOCK, RCD_MODE_DECON, RCD_MODE_WINDOW, RCD_MODE_TURF)
|
||||
if(MODE_AIRLOCK, MODE_DECON, MODE_WINDOW, MODE_TURF)
|
||||
mode = choice
|
||||
if("UI")
|
||||
menu = RCD_PAGE_MAIN
|
||||
ui_interact(user)
|
||||
tgui_interact(user)
|
||||
return
|
||||
if("Change Access", "Change Airlock Type")
|
||||
menu = RCD_PAGE_AIRLOCK
|
||||
ui_interact(user)
|
||||
if("Change Access")
|
||||
ui_tab = TAB_AIRLOCK_ACCESS
|
||||
tgui_interact(user)
|
||||
return
|
||||
if("Change Airlock Type")
|
||||
ui_tab = TAB_AIRLOCK_TYPE
|
||||
tgui_interact(user)
|
||||
return
|
||||
else
|
||||
return
|
||||
@@ -167,87 +222,131 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
/obj/item/rcd/attack_self_tk(mob/user)
|
||||
radial_menu(user)
|
||||
|
||||
/obj/item/rcd/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = GLOB.inventory_state)
|
||||
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
/obj/item/rcd/tgui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/tgui_state/state = GLOB.tgui_inventory_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "rcd.tmpl", "[name]", 450, 400, state = state)
|
||||
ui = new(user, src, ui_key, "RCD", "Rapid Construction Device", 471, 673, master_ui, state)
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
/obj/item/rcd/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.inventory_state)
|
||||
var/data[0]
|
||||
data["mode"] = mode
|
||||
data["door_type"] = door_type
|
||||
data["door_name"] = door_name
|
||||
data["menu"] = menu
|
||||
data["matter"] = matter
|
||||
data["max_matter"] = max_matter
|
||||
data["one_access"] = one_access
|
||||
data["locked"] = locked
|
||||
|
||||
if(menu == RCD_PAGE_AIRLOCK)
|
||||
var/list/door_types_list = list()
|
||||
for(var/type in GLOB.rcd_door_types)
|
||||
door_types_list[++door_types_list.len] = list("name" = GLOB.rcd_door_types[type], "type" = type)
|
||||
data["allowed_door_types"] = door_types_list
|
||||
|
||||
data["door_accesses"] = door_accesses_list
|
||||
|
||||
/obj/item/rcd/tgui_data(mob/user)
|
||||
var/list/data = list(
|
||||
"tab" = ui_tab,
|
||||
"mode" = mode,
|
||||
"locked" = locked,
|
||||
"matter" = matter,
|
||||
"door_type" = door_type,
|
||||
"door_name" = door_name,
|
||||
"one_access" = one_access,
|
||||
"selected_accesses" = selected_accesses,
|
||||
"modal" = tgui_modal_data(src)
|
||||
)
|
||||
return data
|
||||
|
||||
/obj/item/rcd/Topic(href, href_list, nowindow, state)
|
||||
/obj/item/rcd/tgui_static_data(mob/user)
|
||||
var/list/data = list(
|
||||
"max_matter" = max_matter,
|
||||
"regions" = get_accesslist_static_data(REGION_GENERAL, REGION_COMMAND),
|
||||
"door_accesses_list" = door_accesses_list,
|
||||
"door_types_ui_list" = door_types_ui_list
|
||||
)
|
||||
return data
|
||||
|
||||
/obj/item/rcd/tgui_act(action, list/params)
|
||||
if(..())
|
||||
return 1
|
||||
return
|
||||
|
||||
if(prob(20))
|
||||
spark_system.start()
|
||||
|
||||
if(href_list["mode"])
|
||||
mode = href_list["mode"]
|
||||
. = 1
|
||||
if(tgui_act_modal(action, params))
|
||||
return TRUE
|
||||
|
||||
if(href_list["door_type"])
|
||||
var/new_door_type = text2path(href_list["door_type"])
|
||||
if(!(new_door_type in GLOB.rcd_door_types))
|
||||
message_admins("RCD Door HREF exploit attempted by [key_name(usr)]!")
|
||||
return
|
||||
door_type = new_door_type
|
||||
. = 1
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("set_tab")
|
||||
var/tab = text2num(params["tab"])
|
||||
if(!(tab in list(TAB_AIRLOCK_TYPE, TAB_AIRLOCK_ACCESS)))
|
||||
return FALSE
|
||||
ui_tab = tab
|
||||
|
||||
if(href_list["menu"])
|
||||
menu = text2num(href_list["menu"])
|
||||
. = 1
|
||||
if("mode")
|
||||
var/new_mode = params["mode"]
|
||||
if(!(new_mode in list(MODE_TURF, MODE_AIRLOCK, MODE_DECON, MODE_WINDOW)))
|
||||
return FALSE
|
||||
mode = new_mode
|
||||
|
||||
if(href_list["login"])
|
||||
if(allowed(usr))
|
||||
locked = FALSE
|
||||
. = 1
|
||||
if("door_type")
|
||||
var/new_door_type = text2path(params["door_type"])
|
||||
if(!(new_door_type in rcd_door_types))
|
||||
message_admins("RCD Door HREF exploit attempted by [key_name(usr)]!")
|
||||
return FALSE
|
||||
door_type = new_door_type
|
||||
|
||||
if(href_list["logout"])
|
||||
locked = TRUE
|
||||
. = 1
|
||||
if("set_lock")
|
||||
if(!allowed(usr))
|
||||
to_chat(usr, "<span class='warning'>Access denied.</span>")
|
||||
return FALSE
|
||||
locked = params["new_lock"] == "lock" ? TRUE : FALSE
|
||||
|
||||
if(!locked)
|
||||
if(href_list["toggle_one_access"])
|
||||
one_access = !one_access
|
||||
. = 1
|
||||
if("set_one_access")
|
||||
one_access = params["access"] == "one" ? TRUE : FALSE
|
||||
|
||||
if(href_list["toggle_access"])
|
||||
var/href_access = text2num(href_list["toggle_access"])
|
||||
if(href_access in door_accesses)
|
||||
door_accesses -= href_access
|
||||
if("set")
|
||||
var/access = text2num(params["access"])
|
||||
if(isnull(access))
|
||||
return
|
||||
if(access in selected_accesses)
|
||||
selected_accesses -= access
|
||||
else
|
||||
door_accesses += href_access
|
||||
door_accesses_list = list()
|
||||
for(var/access in get_all_accesses())
|
||||
door_accesses_list[++door_accesses_list.len] = list("name" = get_access_desc(access), "id" = access, "enabled" = (access in door_accesses))
|
||||
. = 1
|
||||
selected_accesses |= access
|
||||
|
||||
if(href_list["choice"])
|
||||
var/temp_t = sanitize(copytext(input("Enter a custom Airlock Name.", "Airlock Name"), 1, MAX_MESSAGE_LEN))
|
||||
if(temp_t)
|
||||
door_name = temp_t
|
||||
if("grant_region")
|
||||
var/region = text2num(params["region"])
|
||||
if(isnull(region) || region < REGION_GENERAL || region > REGION_COMMAND)
|
||||
return
|
||||
selected_accesses |= get_region_accesses(region)
|
||||
|
||||
if("deny_region")
|
||||
var/region = text2num(params["region"])
|
||||
if(isnull(region) || region < REGION_GENERAL || region > REGION_COMMAND)
|
||||
return
|
||||
selected_accesses -= get_region_accesses(region)
|
||||
|
||||
if("clear_all")
|
||||
selected_accesses = list()
|
||||
|
||||
if("grant_all")
|
||||
selected_accesses = get_all_accesses()
|
||||
|
||||
/**
|
||||
* Called in tgui_act() to process modal actions
|
||||
*
|
||||
* Arguments:
|
||||
* * action - The action passed by tgui
|
||||
* * params - The params passed by tgui
|
||||
*/
|
||||
/obj/item/rcd/proc/tgui_act_modal(action, list/params)
|
||||
. = TRUE
|
||||
switch(tgui_modal_act(src, action, params))
|
||||
if(TGUI_MODAL_OPEN)
|
||||
tgui_modal_input(src, "renameAirlock", "Enter a new name:", value = door_name, max_length = TGUI_MODAL_INPUT_MAX_LENGTH_NAME)
|
||||
if(TGUI_MODAL_ANSWER)
|
||||
var/answer = params["answer"]
|
||||
if(!answer)
|
||||
return
|
||||
door_name = sanitize(copytext(answer, 1, TGUI_MODAL_INPUT_MAX_LENGTH_NAME))
|
||||
else
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Called in `afterattack()` if `mode` is set to `MODE_TURF`.
|
||||
*
|
||||
* Creates either a plating, or a wall, depending on the turf that already exists at the location.
|
||||
*
|
||||
* Arguments:
|
||||
* * A - the location we're trying to build at.
|
||||
* * user - the mob using the RCD.
|
||||
*/
|
||||
/obj/item/rcd/proc/mode_turf(atom/A, mob/user)
|
||||
if(isspaceturf(A) || istype(A, /obj/structure/lattice))
|
||||
if(useResource(1, user))
|
||||
@@ -279,6 +378,15 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Called in `afterattack()` if `mode` is set to `MODE_AIRLOCK`.
|
||||
*
|
||||
* Creates an `door_type` airlock at the given location `A`, and assigns it accesses from `selected_accesses`.
|
||||
*
|
||||
* Arguments:
|
||||
* * A - the location we're trying to build at.
|
||||
* * user - the mob using the RCD.
|
||||
*/
|
||||
/obj/item/rcd/proc/mode_airlock(atom/A, mob/user)
|
||||
if(isfloorturf(A))
|
||||
if(checkResource(10, user))
|
||||
@@ -294,9 +402,9 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
T.name = door_name
|
||||
T.autoclose = TRUE
|
||||
if(one_access)
|
||||
T.req_one_access = door_accesses.Copy()
|
||||
T.req_one_access = selected_accesses.Copy()
|
||||
else
|
||||
T.req_access = door_accesses.Copy()
|
||||
T.req_access = selected_accesses.Copy()
|
||||
return FALSE
|
||||
return FALSE
|
||||
to_chat(user, "<span class='warning'>ERROR! Not enough matter in unit to construct this airlock!</span>")
|
||||
@@ -306,6 +414,16 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Called in `afterattack()` if `mode` is set to `MODE_DECON`.
|
||||
*
|
||||
* Deconstrcts the target atom `A`.
|
||||
* Valid atoms are: basic walls, reinforced walls (if `canRwall` is `TRUE`), airlocks, and windows.
|
||||
*
|
||||
* Arguments:
|
||||
* * A - the location we're trying to build at.
|
||||
* * user - the mob using the RCD.
|
||||
*/
|
||||
/obj/item/rcd/proc/mode_decon(atom/A, mob/user)
|
||||
if(iswallturf(A))
|
||||
if(istype(A, /turf/simulated/wall/r_wall) && !canRwall)
|
||||
@@ -362,13 +480,13 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
if(!checkResource(2, user))
|
||||
to_chat(user, "<span class='warning'>ERROR! Not enough matter in unit to deconstruct this window!</span>")
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
return 0
|
||||
return FALSE
|
||||
to_chat(user, "Deconstructing window...")
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
if(!do_after(user, 20 * toolspeed, target = A))
|
||||
return 0
|
||||
return FALSE
|
||||
if(!useResource(2, user))
|
||||
return 0
|
||||
return FALSE
|
||||
playsound(loc, usesound, 50, 1)
|
||||
var/turf/T1 = get_turf(A)
|
||||
QDEL_NULL(A)
|
||||
@@ -388,22 +506,31 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Called in `afterattack()` if `mode` is set to `MODE_WINDOW`.
|
||||
*
|
||||
* Constructs a grille and 4 reinforced window panes at the given location `A`.
|
||||
*
|
||||
* Arguments:
|
||||
* * A - the location we're trying to build at.
|
||||
* * user - the mob using the RCD.
|
||||
*/
|
||||
/obj/item/rcd/proc/mode_window(atom/A, mob/user)
|
||||
if(isfloorturf(A))
|
||||
if(locate(/obj/structure/grille) in A)
|
||||
return 0 // We already have window
|
||||
return FALSE // We already have window
|
||||
if(!checkResource(2, user))
|
||||
to_chat(user, "<span class='warning'>ERROR! Not enough matter in unit to construct this window!</span>")
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
return 0
|
||||
return FALSE
|
||||
to_chat(user, "Constructing window...")
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
if(!do_after(user, 20 * toolspeed, target = A))
|
||||
return 0
|
||||
return FALSE
|
||||
if(locate(/obj/structure/grille) in A)
|
||||
return 0 // We already have window
|
||||
return FALSE // We already have window
|
||||
if(!useResource(2, user))
|
||||
return 0
|
||||
return FALSE
|
||||
playsound(loc, usesound, 50, 1)
|
||||
new /obj/structure/grille(A)
|
||||
for(var/obj/structure/window/W in A)
|
||||
@@ -419,10 +546,10 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
W.dir = cdir
|
||||
var/turf/AT = A
|
||||
AT.ChangeTurf(/turf/simulated/floor/plating) // Platings go under windows.
|
||||
return 1
|
||||
return TRUE
|
||||
to_chat(user, "<span class='warning'>ERROR! Location unsuitable for window construction!</span>")
|
||||
playsound(loc, 'sound/machines/click.ogg', 50, 1)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
/obj/item/rcd/afterattack(atom/A, mob/user, proximity)
|
||||
if(!proximity)
|
||||
@@ -433,54 +560,77 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
return FALSE
|
||||
|
||||
switch(mode)
|
||||
if(RCD_MODE_TURF)
|
||||
if(MODE_TURF)
|
||||
. = mode_turf(A, user)
|
||||
if(RCD_MODE_AIRLOCK)
|
||||
if(MODE_AIRLOCK)
|
||||
. = mode_airlock(A, user)
|
||||
if(RCD_MODE_DECON)
|
||||
if(MODE_DECON)
|
||||
. = mode_decon(A, user)
|
||||
if(RCD_MODE_WINDOW)
|
||||
if(MODE_WINDOW)
|
||||
. = mode_window(A, user)
|
||||
else
|
||||
to_chat(user, "ERROR: RCD in MODE: [mode] attempted use by [user]. Send this text #coderbus or an admin.")
|
||||
. = 0
|
||||
|
||||
SSnanoui.update_uis(src)
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/**
|
||||
* Called in each of the four build modes after an object is successfully built.
|
||||
*
|
||||
* Subtracts the amount of matter used from `matter`.
|
||||
*
|
||||
* Arguments:
|
||||
* * amount - the amount of matter that was used.
|
||||
*/
|
||||
/obj/item/rcd/proc/useResource(amount, mob/user)
|
||||
if(matter < amount)
|
||||
return 0
|
||||
return FALSE
|
||||
matter -= amount
|
||||
SSnanoui.update_uis(src)
|
||||
return 1
|
||||
SStgui.update_uis(src)
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Called in each of the four build modes before an object gets build. Makes sure there is enough matter to build the object.
|
||||
*
|
||||
* Arguments:
|
||||
* * amount - an amount of matter to check for
|
||||
*/
|
||||
/obj/item/rcd/proc/checkResource(amount, mob/user)
|
||||
return matter >= amount
|
||||
|
||||
/obj/item/rcd/borg
|
||||
canRwall = 1
|
||||
var/use_multiplier = 160
|
||||
canRwall = TRUE
|
||||
/// A multipler which is applied to matter amount checks. A higher number means more power usage per RCD usage.
|
||||
var/power_use_multiplier = 160
|
||||
|
||||
/obj/item/rcd/borg/syndicate
|
||||
use_multiplier = 80
|
||||
power_use_multiplier = 80
|
||||
|
||||
/obj/item/rcd/borg/useResource(amount, mob/user)
|
||||
if(!isrobot(user))
|
||||
return 0
|
||||
return FALSE
|
||||
var/mob/living/silicon/robot/R = user
|
||||
return R.cell.use(amount * use_multiplier)
|
||||
return R.cell.use(amount * power_use_multiplier)
|
||||
|
||||
/obj/item/rcd/borg/checkResource(amount, mob/user)
|
||||
if(!isrobot(user))
|
||||
return 0
|
||||
return FALSE
|
||||
var/mob/living/silicon/robot/R = user
|
||||
return R.cell.charge >= (amount * use_multiplier)
|
||||
return R.cell.charge >= (amount * power_use_multiplier)
|
||||
|
||||
/**
|
||||
* Called from malf AI's "detonate RCD" ability.
|
||||
*
|
||||
* Creates a delayed explosion centered around the RCD.
|
||||
*/
|
||||
/obj/item/rcd/proc/detonate_pulse()
|
||||
audible_message("<span class='danger'><b>[src] begins to vibrate and buzz loudly!</b></span>", "<span class='danger'><b>[src] begins vibrating violently!</b></span>")
|
||||
// 5 seconds to get rid of it
|
||||
addtimer(CALLBACK(src, .proc/detonate_pulse_explode), 50)
|
||||
|
||||
/**
|
||||
* Called in `/obj/item/rcd/proc/detonate_pulse()` via callback.
|
||||
*/
|
||||
/obj/item/rcd/proc/detonate_pulse_explode()
|
||||
explosion(src, 0, 0, 3, 1, flame_range = 1)
|
||||
qdel(src)
|
||||
@@ -490,9 +640,9 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
|
||||
/obj/item/rcd/combat
|
||||
name = "combat RCD"
|
||||
max_matter = 500
|
||||
matter = 500
|
||||
canRwall = 1
|
||||
max_matter = MATTER_500
|
||||
matter = MATTER_500
|
||||
canRwall = TRUE
|
||||
|
||||
/obj/item/rcd_ammo
|
||||
name = "compressed matter cartridge"
|
||||
@@ -500,12 +650,15 @@ GLOBAL_LIST_INIT(rcd_door_types, list(
|
||||
icon = 'icons/obj/ammo.dmi'
|
||||
icon_state = "rcd"
|
||||
item_state = "rcdammo"
|
||||
opacity = 0
|
||||
density = 0
|
||||
anchored = 0.0
|
||||
opacity = FALSE
|
||||
density = FALSE
|
||||
anchored = FALSE
|
||||
origin_tech = "materials=3"
|
||||
materials = list(MAT_METAL=16000, MAT_GLASS=8000)
|
||||
var/ammoamt = 20
|
||||
|
||||
/obj/item/rcd_ammo/large
|
||||
ammoamt = 100
|
||||
|
||||
#undef MATTER_100
|
||||
#undef MATTER_500
|
||||
|
||||
@@ -30,7 +30,7 @@ RSF
|
||||
configured_items[++configured_items.len] = list("Snack - Newdles", 4000, /obj/item/reagent_containers/food/snacks/chinese/newdles)
|
||||
configured_items[++configured_items.len] = list("Snack - Donut", 4000, /obj/item/reagent_containers/food/snacks/donut)
|
||||
configured_items[++configured_items.len] = list("Snack - Chicken Soup", 4000, /obj/item/reagent_containers/food/drinks/chicken_soup)
|
||||
configured_items[++configured_items.len] = list("Snack - Turkey Burger", 4000, /obj/item/reagent_containers/food/snacks/tofuburger)
|
||||
configured_items[++configured_items.len] = list("Snack - Tofu Burger", 4000, /obj/item/reagent_containers/food/snacks/tofuburger)
|
||||
|
||||
/obj/item/rsf/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
..()
|
||||
|
||||
@@ -837,59 +837,21 @@
|
||||
|
||||
|
||||
/obj/item/book/manual/chef_recipes
|
||||
name = "Chef Recipes"
|
||||
icon_state = "cooked_book"
|
||||
author = "Victoria Ponsonby"
|
||||
title = "Chef Recipes"
|
||||
dat = {"<html>
|
||||
<head>
|
||||
<style>
|
||||
h1 {font-size: 18px; margin: 15px 0px 5px;}
|
||||
h2 {font-size: 15px; margin: 15px 0px 5px;}
|
||||
li {margin: 2px 0px 2px 15px;}
|
||||
ul {list-style: none; margin: 5px; padding: 0px;}
|
||||
ol {margin: 5px; padding: 0px 15px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
name = "Chef Recipes"
|
||||
icon_state = "cooked_book"
|
||||
author = "NanoTrasen"
|
||||
title = "Chef Recipes"
|
||||
dat = {"
|
||||
|
||||
<h1>Food for Dummies</h1>
|
||||
Here is a guide on basic food recipes and also how to not poison your customers accidentally.
|
||||
<html><head>
|
||||
</head>
|
||||
|
||||
<h2>Basics:<h2>
|
||||
Knead an egg and some flour to make dough. Bake that to make a bun or flatten and cut it.
|
||||
<body>
|
||||
<iframe width='100%' height='97%' src="https://www.paradisestation.org/wiki/index.php?title=Guide_to_Food_and_Drinks#Food&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe> </body>
|
||||
|
||||
<h2>Burger:<h2>
|
||||
Put a bun and some meat into the microwave and turn it on. Then wait.
|
||||
</html>
|
||||
|
||||
<h2>Bread:<h2>
|
||||
Put some dough and an egg into the microwave and then wait.
|
||||
|
||||
<h2>Waffles:<h2>
|
||||
Add two lumps of dough and 10u of sugar to the microwave and then wait.
|
||||
|
||||
<h2>Popcorn:<h2>
|
||||
Add 1 corn to the microwave and wait.
|
||||
|
||||
<h2>Meat Steak:<h2>
|
||||
Put a slice of meat, 1 unit of salt and 1 unit of pepper into the microwave and wait.
|
||||
|
||||
<h2>Meat Pie:<h2>
|
||||
Put a flattened piece of dough and some meat into the microwave and wait.
|
||||
|
||||
<h2>Boiled Spaghetti:<h2>
|
||||
Put the spaghetti (processed flour) and 5 units of water into the microwave and wait.
|
||||
|
||||
<h2>Donuts:<h2>
|
||||
Add some dough and 5 units of sugar to the microwave and wait.
|
||||
|
||||
<h2>Fries:<h2>
|
||||
Add one potato to the processor, then bake them in the microwave.
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
"}
|
||||
"}
|
||||
|
||||
/obj/item/book/manual/barman_recipes
|
||||
name = "Barman Recipes"
|
||||
|
||||
@@ -814,3 +814,29 @@
|
||||
icon_state = "ebelt"
|
||||
item_state = "ebelt"
|
||||
storage_slots = 5
|
||||
|
||||
/obj/item/storage/belt/chef
|
||||
name = "culinary tool apron"
|
||||
desc = "An apron with various pockets for holding all your cooking tools and equipment."
|
||||
icon_state = "chefbelt"
|
||||
item_state = "chefbelt"
|
||||
storage_slots = 10
|
||||
max_w_class = WEIGHT_CLASS_NORMAL
|
||||
max_combined_w_class = 25
|
||||
can_hold = list(
|
||||
/obj/item/kitchen/utensil,
|
||||
/obj/item/kitchen/knife,
|
||||
/obj/item/kitchen/rollingpin,
|
||||
/obj/item/kitchen/mould,
|
||||
/obj/item/kitchen/sushimat,
|
||||
/obj/item/kitchen/cutter,
|
||||
/obj/item/assembly/mousetrap,
|
||||
/obj/item/reagent_containers/spray/pestspray,
|
||||
/obj/item/reagent_containers/food/drinks/flask,
|
||||
/obj/item/reagent_containers/food/drinks/drinkingglass,
|
||||
/obj/item/reagent_containers/food/drinks/bottle,
|
||||
/obj/item/reagent_containers/food/drinks/cans,
|
||||
/obj/item/reagent_containers/food/drinks/shaker,
|
||||
/obj/item/reagent_containers/food/snacks,
|
||||
/obj/item/reagent_containers/food/condiment,
|
||||
/obj/item/reagent_containers/glass/beaker)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* Types of tanks!
|
||||
* Contains:
|
||||
* Oxygen
|
||||
* Anesthetic
|
||||
* Air
|
||||
* Nitrogen
|
||||
* Plasma
|
||||
* Emergency Oxygen
|
||||
* Air Mix
|
||||
* Anesthetic
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -14,10 +14,8 @@
|
||||
name = "oxygen tank"
|
||||
desc = "A tank of oxygen."
|
||||
icon_state = "oxygen"
|
||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
|
||||
/obj/item/tank/oxygen/New()
|
||||
..()
|
||||
air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
@@ -41,101 +39,6 @@
|
||||
icon_state = "oxygen_fr"
|
||||
dog_fashion = null
|
||||
|
||||
|
||||
/*
|
||||
* Anesthetic
|
||||
*/
|
||||
/obj/item/tank/anesthetic
|
||||
name = "anesthetic tank"
|
||||
desc = "A tank with an N2O/O2 gas mix."
|
||||
icon_state = "anesthetic"
|
||||
item_state = "an_tank"
|
||||
|
||||
/obj/item/tank/anesthetic/New()
|
||||
..()
|
||||
air_contents.oxygen = (3 * ONE_ATMOSPHERE) * 70 / (R_IDEAL_GAS_EQUATION * T20C) * O2STANDARD
|
||||
air_contents.sleeping_agent = (3 * ONE_ATMOSPHERE) * 70 / (R_IDEAL_GAS_EQUATION * T20C) * N2STANDARD
|
||||
|
||||
/*
|
||||
* Air
|
||||
*/
|
||||
/obj/item/tank/air
|
||||
name = "air tank"
|
||||
desc = "Mixed anyone?"
|
||||
icon_state = "air"
|
||||
item_state = "air"
|
||||
|
||||
/obj/item/tank/air/examine(mob/user)
|
||||
. = ..()
|
||||
if(get_dist(user, src) <= 0 && air_contents.oxygen < 1)
|
||||
. += "<span class='danger'>The meter on [src] indicates you are almost out of air!</span>"
|
||||
playsound(user, 'sound/effects/alert.ogg', 50, 1)
|
||||
|
||||
/obj/item/tank/air/New()
|
||||
..()
|
||||
air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
air_contents.nitrogen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
|
||||
/*
|
||||
* Plasma
|
||||
*/
|
||||
/obj/item/tank/plasma
|
||||
name = "plasma tank"
|
||||
desc = "Contains dangerous plasma. Do not inhale. Warning: extremely flammable."
|
||||
icon_state = "plasma"
|
||||
flags = CONDUCT
|
||||
slot_flags = null //they have no straps!
|
||||
|
||||
/obj/item/tank/plasma/New()
|
||||
..()
|
||||
air_contents.toxins = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
|
||||
/obj/item/tank/plasma/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
..()
|
||||
|
||||
if(istype(W, /obj/item/flamethrower))
|
||||
var/obj/item/flamethrower/F = W
|
||||
if((!F.status)||(F.ptank)) return
|
||||
master = F
|
||||
F.ptank = src
|
||||
user.unEquip(src)
|
||||
loc = F
|
||||
F.update_icon()
|
||||
|
||||
/obj/item/tank/plasma/full/New()
|
||||
..()
|
||||
air_contents.toxins = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
|
||||
/obj/item/tank/plasma/plasmaman
|
||||
name = "plasma internals tank"
|
||||
desc = "A tank of plasma gas designed specifically for use as internals, particularly for plasma-based lifeforms. If you're not a Plasmaman, you probably shouldn't use this."
|
||||
icon_state = "plasmaman_tank"
|
||||
item_state = "plasmaman_tank"
|
||||
force = 10
|
||||
distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
|
||||
|
||||
/obj/item/tank/plasma/plasmaman/examine(mob/user)
|
||||
. = ..()
|
||||
if(get_dist(user, src) <= 0 && air_contents.toxins < 0.2)
|
||||
. += "<span class='danger'>The meter on [src] indicates you are almost out of plasma!</span>"
|
||||
playsound(user, 'sound/effects/alert.ogg', 50, 1)
|
||||
|
||||
|
||||
/obj/item/tank/plasma/plasmaman/belt
|
||||
icon_state = "plasmaman_tank_belt"
|
||||
item_state = "plasmaman_tank_belt"
|
||||
slot_flags = SLOT_BELT
|
||||
force = 5
|
||||
volume = 25
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
|
||||
/obj/item/tank/plasma/plasmaman/belt/full/New()
|
||||
..()
|
||||
air_contents.toxins = (10 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C)
|
||||
|
||||
/*
|
||||
* Emergency Oxygen
|
||||
*/
|
||||
/obj/item/tank/emergency_oxygen
|
||||
name = "emergency oxygen tank"
|
||||
desc = "Used for emergencies. Contains very little oxygen, so try to conserve it until you actually need it."
|
||||
@@ -144,7 +47,6 @@
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
force = 4.0
|
||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||
volume = 3 //Tiny. Real life equivalents only have 21 breaths of oxygen in them. They're EMERGENCY tanks anyway -errorage (dangercon 2011)
|
||||
|
||||
|
||||
@@ -202,11 +104,11 @@
|
||||
/*
|
||||
* Nitrogen
|
||||
*/
|
||||
|
||||
/obj/item/tank/nitrogen
|
||||
name = "nitrogen tank"
|
||||
desc = "A tank of nitrogen."
|
||||
icon_state = "oxygen_fr"
|
||||
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
||||
sprite_sheets = list("Vox Armalis" = 'icons/mob/species/armalis/back.dmi') //Do it for Big Bird.
|
||||
|
||||
/obj/item/tank/nitrogen/New()
|
||||
@@ -241,6 +143,63 @@
|
||||
air_contents.oxygen -= (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.nitrogen = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
|
||||
/*
|
||||
Plasma
|
||||
*/
|
||||
|
||||
/obj/item/tank/plasma
|
||||
name = "plasma tank"
|
||||
desc = "Contains dangerous plasma. Do not inhale. Warning: extremely flammable."
|
||||
icon_state = "plasma"
|
||||
flags = CONDUCT
|
||||
slot_flags = null //they have no straps!
|
||||
|
||||
/obj/item/tank/plasma/New()
|
||||
..()
|
||||
air_contents.toxins = (3*ONE_ATMOSPHERE)*70/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
|
||||
/obj/item/tank/plasma/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
..()
|
||||
|
||||
if(istype(W, /obj/item/flamethrower))
|
||||
var/obj/item/flamethrower/F = W
|
||||
if((!F.status)||(F.ptank)) return
|
||||
master = F
|
||||
F.ptank = src
|
||||
user.unEquip(src)
|
||||
loc = F
|
||||
F.update_icon()
|
||||
|
||||
/obj/item/tank/plasma/full/New()
|
||||
..()
|
||||
air_contents.toxins = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
|
||||
/obj/item/tank/plasma/plasmaman
|
||||
name = "plasma internals tank"
|
||||
desc = "A tank of plasma gas designed specifically for use as internals, particularly for plasma-based lifeforms. If you're not a Plasmaman, you probably shouldn't use this."
|
||||
icon_state = "plasmaman_tank"
|
||||
item_state = "plasmaman_tank"
|
||||
force = 10
|
||||
|
||||
/obj/item/tank/plasma/plasmaman/examine(mob/user)
|
||||
. = ..()
|
||||
if(get_dist(user, src) <= 0 && air_contents.toxins < 0.2)
|
||||
. += "<span class='danger'>The meter on [src] indicates you are almost out of plasma!</span>"
|
||||
playsound(user, 'sound/effects/alert.ogg', 50, 1)
|
||||
|
||||
|
||||
/obj/item/tank/plasma/plasmaman/belt
|
||||
icon_state = "plasmaman_tank_belt"
|
||||
item_state = "plasmaman_tank_belt"
|
||||
slot_flags = SLOT_BELT
|
||||
force = 5
|
||||
volume = 25
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
|
||||
/obj/item/tank/plasma/plasmaman/belt/full/New()
|
||||
..()
|
||||
air_contents.toxins = (10 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C)
|
||||
|
||||
/obj/item/tank/emergency_oxygen/plasma
|
||||
name = "emergency plasma tank"
|
||||
desc = "An emergency tank designed specifically for Plasmamen."
|
||||
@@ -251,3 +210,41 @@
|
||||
..()
|
||||
air_contents.oxygen -= (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
air_contents.toxins = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
|
||||
/*
|
||||
* Air Mix
|
||||
*/
|
||||
/obj/item/tank/air
|
||||
name = "air tank"
|
||||
desc = "Mixed anyone?"
|
||||
icon_state = "air"
|
||||
item_state = "air"
|
||||
distribute_pressure = ONE_ATMOSPHERE
|
||||
|
||||
/obj/item/tank/air/examine(mob/user)
|
||||
. = ..()
|
||||
if(get_dist(user, src) <= 0 && air_contents.oxygen < 1)
|
||||
. += "<span class='danger'>The meter on [src] indicates you are almost out of air!</span>"
|
||||
playsound(user, 'sound/effects/alert.ogg', 50, 1)
|
||||
|
||||
/obj/item/tank/air/New()
|
||||
..()
|
||||
air_contents.oxygen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
air_contents.nitrogen = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
|
||||
|
||||
/*
|
||||
* Anesthetic
|
||||
*/
|
||||
/obj/item/tank/anesthetic
|
||||
name = "anesthetic tank"
|
||||
desc = "A tank with an N2O/O2 gas mix."
|
||||
icon_state = "anesthetic"
|
||||
item_state = "an_tank"
|
||||
distribute_pressure = ONE_ATMOSPHERE
|
||||
|
||||
/obj/item/tank/anesthetic/New()
|
||||
..()
|
||||
air_contents.oxygen = (3 * ONE_ATMOSPHERE) * 70 / (R_IDEAL_GAS_EQUATION * T20C) * O2STANDARD
|
||||
air_contents.sleeping_agent = (3 * ONE_ATMOSPHERE) * 70 / (R_IDEAL_GAS_EQUATION * T20C) * N2STANDARD
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 30)
|
||||
actions_types = list(/datum/action/item_action/set_internals)
|
||||
var/datum/gas_mixture/air_contents = null
|
||||
var/distribute_pressure = ONE_ATMOSPHERE
|
||||
var/distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
|
||||
var/integrity = 3
|
||||
var/volume = 70
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
air_contents = new /datum/gas_mixture()
|
||||
air_contents.volume = volume //liters
|
||||
air_contents.temperature = T20C
|
||||
|
||||
START_PROCESSING(SSobj, src)
|
||||
return
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
return
|
||||
|
||||
if(ishuman(user))
|
||||
var/datum/nano_module/appearance_changer/AC = ui_users[user]
|
||||
var/datum/tgui_module/appearance_changer/AC = ui_users[user]
|
||||
if(!AC)
|
||||
AC = new(src, user)
|
||||
AC.name = "SalonPro Nano-Mirror™"
|
||||
AC.name = "SalonPro Nano-Mirror"
|
||||
AC.flags = APPEARANCE_ALL_BODY
|
||||
ui_users[user] = AC
|
||||
AC.ui_interact(user)
|
||||
AC.tgui_interact(user)
|
||||
|
||||
/obj/structure/mirror/obj_break(damage_flag, mapload)
|
||||
if(!broken && !(flags & NODECONSTRUCT))
|
||||
@@ -121,14 +121,14 @@
|
||||
else
|
||||
race_list += GLOB.whitelisted_species
|
||||
|
||||
var/datum/nano_module/appearance_changer/AC = ui_users[user]
|
||||
var/datum/tgui_module/appearance_changer/AC = ui_users[user]
|
||||
if(!AC)
|
||||
AC = new(src, user)
|
||||
AC.name = "Magic Mirror"
|
||||
AC.flags = APPEARANCE_ALL
|
||||
AC.whitelist = race_list
|
||||
ui_users[user] = AC
|
||||
AC.ui_interact(user)
|
||||
AC.tgui_interact(user)
|
||||
|
||||
if("Voice")
|
||||
var/voice_choice = input(user, "Perhaps...", "Voice effects") as null|anything in list("Comic Sans", "Wingdings", "Swedish", "Chav", "Mute")
|
||||
|
||||
Reference in New Issue
Block a user