forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
236 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//Mining Component | ||
/datum/design/component/mining | ||
name = "Mining Component" | ||
id = "comp_mine" | ||
build_path = /obj/item/circuit_component/mining | ||
|
||
//Item Interact Component | ||
/datum/design/component/item_interact | ||
name = "Item Interact Component" | ||
id = "comp_iinteract" | ||
build_path = /obj/item/circuit_component/item_interact | ||
|
||
/datum/techweb_node/comp_advanced_interacts | ||
id = "comp_advanced_interacts" | ||
display_name = "Advanced Action Components" | ||
description = "Grants access to more advanced action components for the drone shell." | ||
prereq_ids = list("movable_shells") | ||
design_ids = list( | ||
"comp_mine", | ||
"comp_iinteract", | ||
) | ||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000) | ||
|
||
//Target Scanner Component | ||
/datum/design/component/radar_scanner | ||
name = "Target Scanner Component" | ||
id = "comp_tscanner" | ||
build_path = /obj/item/circuit_component/target_scanner | ||
|
||
//Cell Charge Component | ||
/datum/design/component/cell_charge | ||
name = "Cell Charge Component" | ||
id = "comp_ccharge" | ||
build_path = /obj/item/circuit_component/cell_charge | ||
|
||
/datum/techweb_node/comp_advanced_sensors | ||
id = "comp_advanced_sensors" | ||
display_name = "Advanced Sensor Components" | ||
description = "Grants access to advanced sensor components component for shells." | ||
prereq_ids = list("adv_shells") | ||
design_ids = list( | ||
"comp_tscanner", | ||
"comp_ccharge", | ||
) | ||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 500) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* # Cell Charge Component | ||
* | ||
* Allows for reading of the max/current charge of the cell in an integrated circuit. | ||
*/ | ||
/obj/item/circuit_component/cell_charge | ||
display_name = "Cell Charge" | ||
desc = "A component that can read out the max and current charge of the cell." | ||
category = "Sensor" | ||
|
||
/// max and current charge for the cell | ||
var/datum/port/output/max_charge | ||
var/datum/port/output/current_charge | ||
|
||
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL | ||
|
||
/obj/item/circuit_component/cell_charge/populate_ports() | ||
max_charge = add_output_port("Max Charge", PORT_TYPE_NUMBER) | ||
current_charge = add_output_port("Current Charge", PORT_TYPE_NUMBER) | ||
|
||
/obj/item/circuit_component/cell_charge/input_received(datum/port/input/port) | ||
var/obj/item/stock_parts/cell/read_cell = parent.cell | ||
if(!read_cell || !istype(read_cell)) | ||
return | ||
max_charge.set_output(read_cell.maxcharge) | ||
current_charge.set_output(read_cell.charge) |
47 changes: 47 additions & 0 deletions
47
massmeta/features/additional_circuit/code/interact_item.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* # Item Interact Component | ||
* | ||
* Allows for interaction with an item. Drone shell only. | ||
*/ | ||
/obj/item/circuit_component/item_interact | ||
display_name = "Item Interact" | ||
desc = "A component that can force the shell to interact with an item. Only works with drone shells. Only works on items. Must be directly next to the item." | ||
category = "Action" | ||
|
||
/// Whether to use primary attack_self or secondary attack_self | ||
var/datum/port/input/primary_interact | ||
var/datum/port/input/secondary_interact | ||
|
||
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL | ||
|
||
/obj/item/circuit_component/item_interact/populate_ports() | ||
primary_interact = add_input_port("Primary Interact", PORT_TYPE_ATOM) | ||
secondary_interact = add_input_port("Secondary Interact", PORT_TYPE_ATOM) | ||
|
||
/obj/item/circuit_component/item_interact/input_received(datum/port/input/port) | ||
do_primary() | ||
do_secondary() | ||
|
||
/obj/item/circuit_component/item_interact/proc/do_primary() | ||
var/atom/target_atom = primary_interact.value | ||
if(!istype(target_atom, /obj/item)) | ||
return | ||
var/obj/item/target_item = target_atom | ||
|
||
var/mob/shell = parent.shell | ||
if(!istype(shell) || get_dist(shell, target_item) > 1 || shell.z != target_item.z) | ||
return | ||
|
||
target_item.attack_self(shell) | ||
|
||
/obj/item/circuit_component/item_interact/proc/do_secondary() | ||
var/atom/target_atom = secondary_interact.value | ||
if(!istype(target_atom, /obj/item)) | ||
return | ||
var/obj/item/target_item = target_atom | ||
|
||
var/mob/shell = parent.shell | ||
if(!istype(shell) || get_dist(shell, target_item) > 1 || shell.z != target_item.z) | ||
return | ||
|
||
target_item.attack_self_secondary(shell) |
28 changes: 28 additions & 0 deletions
28
massmeta/features/additional_circuit/code/mining_circuit.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* # Mining Component | ||
* | ||
* Allows for mining of mineral walls (walls with ores). Requires a shell. | ||
*/ | ||
/obj/item/circuit_component/mining | ||
display_name = "Mine" | ||
desc = "A component that can force the shell to mine a target. Only works with drone shells. Only works on mining surfaces." | ||
category = "Action" | ||
|
||
/// Frequency input | ||
var/datum/port/input/target | ||
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL | ||
|
||
/obj/item/circuit_component/mining/populate_ports() | ||
target = add_input_port("Target", PORT_TYPE_ATOM) | ||
|
||
/obj/item/circuit_component/mining/input_received(datum/port/input/port) | ||
var/atom/target_atom = target.value | ||
if(!istype(target_atom, /turf/closed/mineral)) | ||
return | ||
var/turf/closed/mineral/target_mineral = target_atom | ||
|
||
var/mob/shell = parent.shell | ||
if(!istype(shell) || get_dist(shell, target_mineral) > 1 || shell.z != target_mineral.z) | ||
return | ||
|
||
target_mineral.gets_drilled(shell, FALSE) |
50 changes: 50 additions & 0 deletions
50
massmeta/features/additional_circuit/code/target_scanner.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* # Target Scanner Component | ||
* | ||
* Allows for creating a list of atoms within a range of 1. | ||
*/ | ||
/obj/item/circuit_component/target_scanner | ||
display_name = "Target Scanner" | ||
desc = "A component that will create a list of the things within a location depending on an offset to the shell." | ||
category = "Action" | ||
|
||
// the offsets required for scanning | ||
var/datum/port/input/x_pos | ||
var/datum/port/input/y_pos | ||
|
||
COOLDOWN_DECLARE(scan_delay) | ||
///the delay between each scan | ||
var/time_delay = 0.5 SECONDS | ||
|
||
/// The table filled of atoms or "entities" | ||
var/datum/port/output/atom_table | ||
|
||
circuit_flags = CIRCUIT_FLAG_INPUT_SIGNAL|CIRCUIT_FLAG_OUTPUT_SIGNAL | ||
|
||
/obj/item/circuit_component/target_scanner/populate_ports() | ||
x_pos = add_input_port("X offset", PORT_TYPE_NUMBER) | ||
y_pos = add_input_port("Y offset", PORT_TYPE_NUMBER) | ||
atom_table = add_output_port("Output", PORT_TYPE_LIST(PORT_TYPE_ATOM)) | ||
|
||
/obj/item/circuit_component/target_scanner/input_received(datum/port/input/port) | ||
//cooldown is important | ||
if(!COOLDOWN_FINISHED(src, scan_delay)) | ||
return | ||
COOLDOWN_START(src, scan_delay, time_delay) | ||
//we need both a x pos and y pos | ||
if(!x_pos || !y_pos) | ||
return | ||
//the turf that will be scanned | ||
var/turf/target_turf = locate(parent.shell.x + x_pos.value, parent.shell.y + y_pos.value, parent.shell.z) | ||
//for sanity | ||
if(!target_turf) | ||
return | ||
//null the create_table | ||
var/create_table = list() | ||
//add the scanned turf to the create_table | ||
create_table += target_turf | ||
//add the contents of the scanned turf to create_table | ||
for(var/iteration in target_turf.contents) | ||
create_table += iteration | ||
//send out the table | ||
atom_table.set_output(create_table) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "code\_designs.dm" | ||
#include "code\cell_reader.dm" | ||
#include "code\interact_item.dm" | ||
#include "code\mining_circuit.dm" | ||
#include "code\target_scanner.dm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Credits | ||
|
||
Jake Park |
Oops, something went wrong.