Skip to content

Commit

Permalink
Merge pull request BoHBranch#1473 from Tennessee116/10sc-floormachines
Browse files Browse the repository at this point in the history
Holopads have better examine() and are now constructable
  • Loading branch information
Cupax3 authored Mar 12, 2022
2 parents 4266453 + 1cbaae8 commit b6cc7cb
Show file tree
Hide file tree
Showing 11 changed files with 134 additions and 29 deletions.
2 changes: 2 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@
#include "code\game\machinery\_machines_base\machine_construction\_construction.dm"
#include "code\game\machinery\_machines_base\machine_construction\computer.dm"
#include "code\game\machinery\_machines_base\machine_construction\default.dm"
#include "code\game\machinery\_machines_base\machine_construction\floor.dm"
#include "code\game\machinery\_machines_base\machine_construction\frame.dm"
#include "code\game\machinery\_machines_base\machine_construction\item_chassis.dm"
#include "code\game\machinery\_machines_base\machine_construction\tcomms.dm"
Expand Down Expand Up @@ -1056,6 +1057,7 @@
#include "code\game\objects\items\weapons\circuitboards\machinery\cloning.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\commsantenna.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\engineering_circuits.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\holopad.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\household.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\mech_recharger.dm"
#include "code\game\objects\items\weapons\circuitboards\machinery\medical.dm"
Expand Down
11 changes: 11 additions & 0 deletions code/game/machinery/_machines_base/machine_construction/floor.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//Same as default but with but with floor boards (get it?)
/decl/machine_construction/default/panel_closed/floor
down_state = /decl/machine_construction/default/panel_open/floor
needs_board = "floor"

/decl/machine_construction/default/panel_closed/floor/no_deconstruct/attackby(obj/item/I, mob/user, obj/machinery/machine)
return FALSE

/decl/machine_construction/default/panel_open/floor
up_state = /decl/machine_construction/default/panel_closed/floor
needs_board = "floor"
33 changes: 27 additions & 6 deletions code/game/machinery/constructable_frame.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31

//Circuit boards are in /code/game/objects/items/weapons/stock_parts/circuitboards/machinery/

/obj/machinery/constructable_frame //Made into a seperate type to make future revisions easier.
//Circuitboards and other stuff are inserted into these frames to make machines
/obj/machinery/constructable_frame
name = "machine frame"
icon = 'icons/obj/stock_parts.dmi'
desc = "A rudimentary, hefty machine frame. Utilitarian!"
icon = 'icons/obj/machines/constructable_frame.dmi'
icon_state = "box_0"
density = TRUE
anchored = FALSE
Expand Down Expand Up @@ -37,5 +35,28 @@
icon_state = "box_0"

/obj/machinery/constructable_frame/machine_frame/deconstruct
anchored = TRUE
construct_state = /decl/machine_construction/frame/awaiting_circuit

//For floors!
/obj/machinery/constructable_frame/machine_frame/floor
name = "floor machine frame"
desc = "A sleek machine frame that mounts to the floor. Innovative!"
icon_state = "floor_0"
density = FALSE
expected_machine_type = "floor"
atom_flags = ATOM_FLAG_NO_TEMP_CHANGE

/obj/machinery/constructable_frame/machine_frame/floor/on_update_icon()
switch(construct_state && construct_state.type)
if(/decl/machine_construction/frame/awaiting_circuit)
icon_state = "floor_1"
if(/decl/machine_construction/frame/awaiting_parts)
icon_state = "floor_2"
else
icon_state = "floor_0"


/obj/machinery/constructable_frame/machine_frame/floor/deconstruct
anchored = TRUE
construct_state = /decl/machine_construction/frame/awaiting_circuit
48 changes: 27 additions & 21 deletions code/game/machinery/hologram.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ var/const/HOLOPAD_MODE = RANGE_BASED

layer = ABOVE_TILE_LAYER

construct_state = /decl/machine_construction/default/panel_closed/floor
frame_type = /obj/machinery/constructable_frame/machine_frame/floor/deconstruct
uncreated_component_parts = null

var/power_per_hologram = 500 //per usage per hologram
idle_power_usage = 5

Expand All @@ -56,9 +60,9 @@ var/const/HOLOPAD_MODE = RANGE_BASED

var/allow_ai = TRUE

/obj/machinery/hologram/holopad/New()
..()
desc = "It's a floor-mounted device for projecting holographic images. Its ID is '[loc.loc]'"
/obj/machinery/hologram/holopad/examine(user)
. = ..()
to_chat(user, SPAN_NOTICE("Its ID is <b>[loc.loc]</b>.")) //God I fucking hate this loc.loc shit ~10sc

/obj/machinery/hologram/holopad/interface_interact(var/mob/living/carbon/human/user) //Carn: Hologram requests.
if(!CanInteract(user, DefaultTopicState()))
Expand Down Expand Up @@ -88,16 +92,16 @@ var/const/HOLOPAD_MODE = RANGE_BASED
if("AI")
if(last_request + 200 < world.time) //don't spam the AI with requests you jerk!
last_request = world.time
to_chat(user, "<span class='notice'>You request an AI's presence.</span>")
to_chat(user, SPAN_NOTICE("You request an AI's presence."))
var/area/area = get_area(src)
for(var/mob/living/silicon/ai/AI in GLOB.living_mob_list_)
if(!AI.client) continue
to_chat(AI, "<span class='info'>Your presence is requested at <a href='?src=\ref[AI];jumptoholopad=\ref[src]'>\the [area]</a>.</span>")
to_chat(AI, SPAN_NOTICE("Your presence is requested at <a href='?src=\ref[AI];jumptoholopad=\ref[src]'>\the [area]</a>."))
else
to_chat(user, "<span class='notice'>A request for AI presence was already sent recently.</span>")
to_chat(user, SPAN_NOTICE("A request for AI presence was already sent recently."))
if("Holocomms")
if(user.loc != src.loc)
to_chat(user, "<span class='info'>Please step onto the holopad.</span>")
to_chat(user, SPAN_NOTICE("Please step onto the holopad."))
return
if(last_request + 200 < world.time) //don't spam other people with requests either, you jerk!
last_request = world.time
Expand All @@ -115,17 +119,17 @@ var/const/HOLOPAD_MODE = RANGE_BASED
var/temppad = input(user, "Which holopad would you like to contact?", "holopad list") as null|anything in holopadlist
targetpad = holopadlist["[temppad]"]
if(targetpad==src)
to_chat(user, "<span class='info'>Using such sophisticated technology, just to talk to yourself seems a bit silly.</span>")
to_chat(user, SPAN_NOTICE("Using such sophisticated technology, just to talk to yourself seems a bit silly."))
targetpad = null //Clean up the mess after an unsuccessful call
return
if(targetpad && targetpad.caller_id)
to_chat(user, "<span class='info'>The pad flashes a busy sign. Maybe you should try again later..</span>")
to_chat(user, SPAN_NOTICE("The pad flashes a busy sign. Maybe you should try again later."))
targetpad = null //Clean up the mess after an unsuccessful call
return
if(targetpad)
make_call(targetpad, user)
else
to_chat(user, "<span class='notice'>A request for holographic communication was already sent recently.</span>")
to_chat(user, SPAN_NOTICE("A request for holographic communication was already sent recently."))


/obj/machinery/hologram/holopad/proc/make_call(var/obj/machinery/hologram/holopad/targetpad, var/mob/living/carbon/user)
Expand All @@ -136,7 +140,7 @@ var/const/HOLOPAD_MODE = RANGE_BASED
playsound(targetpad.loc, 'sound/machines/chime.ogg', 25, 5)
targetpad.icon_state = "[targetpad.base_icon]1"
targetpad.audible_message("<b>\The [src]</b> announces, \"Incoming communications request from [targetpad.sourcepad.loc.loc].\"")
to_chat(user, "<span class='notice'>Trying to establish a connection to the holopad in [targetpad.loc.loc]... Please await confirmation from recipient.</span>")
to_chat(user, SPAN_NOTICE("Trying to establish a connection to the holopad in [targetpad.loc.loc]... Please await confirmation from recipient."))


/obj/machinery/hologram/holopad/proc/take_call(mob/living/carbon/user)
Expand Down Expand Up @@ -231,36 +235,36 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/

/obj/machinery/hologram/holopad/proc/get_hear_message(name_used, text, verb, datum/language/speaking, prefix = "")
if(speaking)
return "<i><span class='game say'>Holopad received, <span class='name'>[name_used]</span>[prefix] [speaking.format_message(text, verb)]</span></i>"
return "<i><span class='game say'>Holopad received, <span class='name'>[name_used]</span>[prefix] [verb], <span class='message'>\"[text]\"</span></span></i>"
return SPAN_ITALIC("<span class='game say'>Holopad received, <span class='name'>[name_used]</span>[prefix] [speaking.format_message(text, verb)]</span>")
return SPAN_ITALIC("<span class='game say'>Holopad received, <span class='name'>[name_used]</span>[prefix] [verb], <span class='message'>\"[text]\"</span></span>")

/obj/machinery/hologram/holopad/see_emote(mob/living/M, text)
if(M)
for(var/mob/living/silicon/ai/master in masters)
//var/name_used = M.GetVoice()
var/rendered = "<i><span class='game say'>Holopad received, <span class='message'>[text]</span></span></i>"
var/rendered = SPAN_ITALIC("<span class='game say'>Holopad received, <span class='message'>[text]</span></span>")
//The lack of name_used is needed, because message already contains a name. This is needed for simple mobs to emote properly.
master.show_message(rendered, 2)
for(var/mob/living/carbon/master in masters)
//var/name_used = M.GetVoice()
var/rendered = "<i><span class='game say'>Holopad received, <span class='message'>[text]</span></span></i>"
var/rendered = SPAN_ITALIC("<span class='game say'>Holopad received, <span class='message'>[text]</span></span>")
//The lack of name_used is needed, because message already contains a name. This is needed for simple mobs to emote properly.
master.show_message(rendered, 2)
if(targetpad)
targetpad.visible_message("<i><span class='message'>[text]</span></i>")
targetpad.visible_message(SPAN_ITALIC("<span class='message'>[text]</span>"))

/obj/machinery/hologram/holopad/show_message(msg, type, alt, alt_type)
for(var/mob/living/silicon/ai/master in masters)
var/rendered = "<i><span class='game say'>The holographic image of <span class='message'>[msg]</span></span></i>"
var/rendered = SPAN_ITALIC("<span class='game say'>The holographic image of <span class='message'>[msg]</span></span>")
master.show_message(rendered, type)
if(findtext(msg, "Holopad received,"))
return
for(var/mob/living/carbon/master in masters)
var/rendered = "<i><span class='game say'>The holographic image of <span class='message'>[msg]</span></span></i>"
var/rendered = SPAN_ITALIC("<span class='game say'>The holographic image of <span class='message'>[msg]</span></span>")
master.show_message(rendered, type)
if(targetpad)
for(var/mob/living/carbon/master in view(targetpad))
var/rendered = "<i><span class='game say'>The holographic image of <span class='message'>[msg]</span></span></i>"
var/rendered = SPAN_ITALIC("<span class='game say'>The holographic image of <span class='message'>[msg]</span></span>")
master.show_message(rendered, type)

/obj/machinery/hologram/holopad/proc/create_holo(mob/living/silicon/ai/A, mob/living/carbon/caller_id, turf/T = loc)
Expand Down Expand Up @@ -324,7 +328,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
use_power_oneoff(power_per_hologram)
if(last_request + 200 < world.time&&incoming_connection==1)
if(sourcepad)
sourcepad.audible_message("<i><span class='game say'>The holopad connection timed out</span></i>")
sourcepad.audible_message(SPAN_ITALIC("<span class='game say'>The holopad connection timed out</span>"))
incoming_connection = 0
end_call()
if (caller_id&&sourcepad)
Expand Down Expand Up @@ -423,14 +427,16 @@ Holographic project of everything else.

/obj/machinery/hologram/holopad/longrange
name = "long range holopad"
desc = "It's a floor-mounted device for projecting holographic images. This one utilizes bluespace transmitter to communicate with far away locations."
desc = "It's a floor-mounted device for projecting holographic images. This one utilizes an advanced bluespace transmitter to communicate with distant holopads."
icon_state = "holopad-Y0"
power_per_hologram = 1000 //per usage per hologram
holopadType = HOLOPAD_LONG_RANGE
base_icon = "holopad-Y"

// Used for overmap capable ships that should have communications, but not be AI accessible
/obj/machinery/hologram/holopad/longrange/remoteship
name = "encrypted long range holopad"
desc = "It's a floor-mounted device for projecting holographic images. This one utilizes an advanced bluespace transmitter to communicate with distant holopads, and it also has end-to-end encryption."
allow_ai = FALSE

#undef RANGE_BASED
Expand Down
32 changes: 32 additions & 0 deletions code/game/objects/items/weapons/circuitboards/machinery/holopad.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//Holopads are now deconstructable and reconstructable and constructable, cry about it
/obj/item/weapon/stock_parts/circuitboard/holopad
name = T_BOARD("holopad")
build_path = /obj/machinery/hologram/holopad
board_type = "floor"

origin_tech = list(
TECH_DATA = 2,
TECH_MAGNET = 2
)

req_components = list(
/obj/item/weapon/stock_parts/micro_laser = 1,
/obj/item/weapon/stock_parts/scanning_module = 1,
/obj/item/weapon/stock_parts/keyboard = 1
)

//Bluespace because why not
/obj/item/weapon/stock_parts/circuitboard/holopad/longrange
name = T_BOARD("long range holopad")
build_path = /obj/machinery/hologram/holopad/longrange

origin_tech = list(
TECH_BLUESPACE = 2,
TECH_DATA = 2,
TECH_MAGNET = 2
)

//For overmap vessels
/obj/item/weapon/stock_parts/circuitboard/holopad/longrange/remoteship
name = T_BOARD("encrypted long range holopad")
build_path = /obj/machinery/hologram/holopad/longrange/remoteship
4 changes: 3 additions & 1 deletion code/modules/ascent/ascent_machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ MANTIDIFY(/obj/machinery/door/airlock/external/bolted, "mantid airlock", "door")
base_type = /obj/machinery/power/apc

/obj/machinery/hologram/holopad/longrange/ascent
req_access = list(access_ascent)
req_access = list(access_ascent) //Who the hell put access on a god damn HOLOPAD? ~10sc
construct_state = /decl/machine_construction/default/panel_closed/floor/no_deconstruct
base_type = /obj/machinery/hologram/holopad/longrange

/obj/effect/catwalk_plated/ascent
color = COLOR_GRAY40
Expand Down
1 change: 1 addition & 0 deletions code/modules/materials/material_recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
. += new/datum/stack_recipe/furniture/computerframe(src)
. += new/datum/stack_recipe/furniture/girder(src)
. += new/datum/stack_recipe/furniture/machine(src)
. += new/datum/stack_recipe/furniture/floor_machine(src)
. += new/datum/stack_recipe/furniture/turret(src)
. += new/datum/stack_recipe_list("airlock assemblies", create_recipe_list(/datum/stack_recipe/furniture/door_assembly))
. += new/datum/stack_recipe/grenade(src)
Expand Down
7 changes: 7 additions & 0 deletions code/modules/materials/recipes_furniture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ ARMCHAIR(yellow)
time = 25
send_material_data = 0

/datum/stack_recipe/furniture/floor_machine
title = "floor machine frame"
result_type = /obj/machinery/constructable_frame/machine_frame/floor
req_amount = 3
time = 30
send_material_data = 0

/datum/stack_recipe/furniture/turret
title = "turret frame"
result_type = /obj/machinery/porta_turret_construct
Expand Down
25 changes: 24 additions & 1 deletion code/modules/research/designs/designs_circuits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -857,4 +857,27 @@
id = "pc_motherboard"
req_tech = list(TECH_POWER = 1, TECH_ENGINEERING = 1)
build_path = /obj/item/weapon/stock_parts/circuitboard/modular_computer
sort_string = "XAAAE"
sort_string = "XAAAE"

/datum/design/circuit/holopad
name = "holopad"
id = "holopad"
req_tech = list(TECH_DATA = 2, TECH_MAGNET = 2)
build_path = /obj/item/weapon/stock_parts/circuitboard/holopad
sort_string = "XAAAF"

/datum/design/circuit/holopad_longrange
name = "long range holopad"
id = "holopad_longrange"
req_tech = list(TECH_DATA = 2, TECH_MAGNET = 2, TECH_BLUESPACE = 2)
build_path = /obj/item/weapon/stock_parts/circuitboard/holopad/longrange
sort_string = "XAAAG"

/datum/design/circuit/holopad_longrange_remoteship
name = "encrypted long range holopad"
id = "holopad_longrange_remote"
req_tech = list(TECH_DATA = 2, TECH_MAGNET = 2, TECH_BLUESPACE = 2, TECH_ESOTERIC = 2)
build_path = /obj/item/weapon/stock_parts/circuitboard/holopad/longrange/remoteship
sort_string = "XAAAH"


Binary file added icons/obj/machines/constructable_frame.dmi
Binary file not shown.
Binary file modified icons/obj/stock_parts.dmi
Binary file not shown.

0 comments on commit b6cc7cb

Please sign in to comment.