mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
[MIRROR] Buildable mass drivers [MDB IGNORE] (#23776)
* Buildable mass drivers (#78360) ## About The Pull Request Adds the ability to build mass drivers, you activate them by attaching a signaler to their launch wire. They also have a safety wire, that when pulsed, increases the power of it. To reset the power back to normal you cut the safety wire. This is mostly just a port of https://github.com/BeeStation/BeeStation-Hornet/pull/5563 ## Why It's Good For The Game Less weird unique machines, and you can do some interesting stuff with mass drivers, like traps, cannons, and many other interesting things. ## Changelog 🆑 add: mass drivers are now buildable, you activate them by attaching a signaler to their launch wire, and can increase their power by pulsing the safeties wire, and reset it back to normal by cutting the safeties wire. /🆑 * Buildable mass drivers --------- Co-authored-by: Teagarden <124026007+Vincent983@users.noreply.github.com>
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
#define WIRE_ACCEPT "Scan Success"
|
||||
#define WIRE_ACTIVATE "Activate"
|
||||
#define WIRE_LAUNCH "Launch"
|
||||
#define WIRE_SAFETIES "Safeties"
|
||||
#define WIRE_AGELIMIT "Age Limit"
|
||||
#define WIRE_AI "AI Connection"
|
||||
#define WIRE_ALARM "Alarm"
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/datum/wires/mass_driver
|
||||
holder_type = /obj/machinery/mass_driver
|
||||
proper_name = "Mass Driver"
|
||||
|
||||
/datum/wires/mass_driver/New(atom/holder)
|
||||
wires = list(WIRE_LAUNCH, WIRE_SAFETIES)
|
||||
..()
|
||||
|
||||
/datum/wires/mass_driver/on_pulse(wire)
|
||||
var/obj/machinery/mass_driver/the_mass_driver = holder
|
||||
switch(wire)
|
||||
if(WIRE_LAUNCH)
|
||||
the_mass_driver.drive()
|
||||
holder.visible_message(span_notice("The drive mechanism activates."))
|
||||
if(WIRE_SAFETIES)
|
||||
the_mass_driver.power = 3
|
||||
holder.visible_message(span_notice("You hear a worrying whirring noise emitting from the mass driver."))
|
||||
|
||||
/datum/wires/mass_driver/on_cut(wire, mend, source)
|
||||
var/obj/machinery/mass_driver/the_mass_driver = holder
|
||||
switch(wire)
|
||||
if(WIRE_SAFETIES)
|
||||
if(the_mass_driver.power > 1)
|
||||
the_mass_driver.power = 1
|
||||
holder.visible_message(span_notice("The whirring noise emitting from the mass driver stops."))
|
||||
@@ -3,10 +3,20 @@
|
||||
desc = "The finest in spring-loaded piston toy technology, now on a space station near you."
|
||||
icon = 'icons/obj/machines/floor.dmi'
|
||||
icon_state = "mass_driver"
|
||||
circuit = /obj/item/circuitboard/machine/mass_driver
|
||||
var/power = 1
|
||||
var/code = 1
|
||||
var/id = 1
|
||||
var/drive_range = 50 //this is mostly irrelevant since current mass drivers throw into space, but you could make a lower-range mass driver for interstation transport or something I guess.
|
||||
var/drive_range = 10
|
||||
var/power_per_obj = 1000
|
||||
|
||||
/obj/machinery/mass_driver/Initialize(mapload)
|
||||
. = ..()
|
||||
wires = new /datum/wires/mass_driver(src)
|
||||
|
||||
/obj/machinery/mass_driver/Destroy()
|
||||
QDEL_NULL(wires)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/mass_driver/chapelgun
|
||||
name = "holy driver"
|
||||
@@ -31,9 +41,9 @@
|
||||
id = "[port.shuttle_id]_[id]"
|
||||
|
||||
/obj/machinery/mass_driver/proc/drive(amount)
|
||||
if(machine_stat & (BROKEN|NOPOWER))
|
||||
if(machine_stat & (BROKEN|NOPOWER) || panel_open)
|
||||
return
|
||||
use_power(active_power_usage)
|
||||
use_power(power_per_obj)
|
||||
var/O_limit
|
||||
var/atom/target = get_edge_target_turf(src, dir)
|
||||
for(var/atom/movable/O in loc)
|
||||
@@ -44,14 +54,33 @@
|
||||
if(O_limit >= 20)
|
||||
audible_message(span_notice("[src] lets out a screech, it doesn't seem to be able to handle the load."))
|
||||
break
|
||||
use_power(active_power_usage)
|
||||
use_power(power_per_obj)
|
||||
O.throw_at(target, drive_range * power, power)
|
||||
flick("mass_driver1", src)
|
||||
|
||||
/obj/machinery/mass_driver/attackby(obj/item/I, mob/living/user, params)
|
||||
|
||||
if(is_wire_tool(I) && panel_open)
|
||||
wires.interact(user)
|
||||
return
|
||||
if(default_deconstruction_screwdriver(user, "mass_driver_o", "mass_driver", I))
|
||||
return
|
||||
if(default_change_direction_wrench(user, I))
|
||||
return
|
||||
if(default_deconstruction_crowbar(I))
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/mass_driver/RefreshParts()
|
||||
. = ..()
|
||||
for(var/datum/stock_part/servo/new_servo in component_parts)
|
||||
drive_range += new_servo.tier * 10
|
||||
|
||||
/obj/machinery/mass_driver/emp_act(severity)
|
||||
. = ..()
|
||||
if (. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(machine_stat & (BROKEN|NOPOWER))
|
||||
if(machine_stat & (BROKEN|NOPOWER) || panel_open)
|
||||
return
|
||||
drive()
|
||||
|
||||
@@ -56,6 +56,13 @@
|
||||
/datum/stock_part/capacitor = 1,
|
||||
/obj/item/electronics/airlock = 1)
|
||||
|
||||
/obj/item/circuitboard/machine/mass_driver
|
||||
name = "Mass Driver"
|
||||
greyscale_colors = CIRCUIT_COLOR_ENGINEERING
|
||||
build_path = /obj/machinery/mass_driver
|
||||
req_components = list(
|
||||
/datum/stock_part/servo = 1,)
|
||||
|
||||
/obj/item/circuitboard/machine/autolathe
|
||||
name = "Autolathe"
|
||||
greyscale_colors = CIRCUIT_COLOR_ENGINEERING
|
||||
|
||||
@@ -51,6 +51,16 @@
|
||||
)
|
||||
departmental_flags = DEPARTMENT_BITFLAG_ENGINEERING
|
||||
|
||||
/datum/design/board/mass_driver
|
||||
name = "Mass Driver Board"
|
||||
desc = "The circuit board for a mass driver."
|
||||
id = "mass_driver"
|
||||
build_path = /obj/item/circuitboard/machine/mass_driver
|
||||
category = list(
|
||||
RND_CATEGORY_MACHINE + RND_SUBCATEGORY_MACHINE_ENGINEERING
|
||||
)
|
||||
departmental_flags = DEPARTMENT_BITFLAG_ENGINEERING
|
||||
|
||||
/datum/design/board/turbine_compressor
|
||||
name = "Turbine Compressor Board"
|
||||
desc = "The circuit board for a turbine compressor."
|
||||
|
||||
@@ -596,6 +596,7 @@
|
||||
"emergency_oxygen_engi",
|
||||
"emergency_oxygen",
|
||||
"emitter",
|
||||
"mass_driver",
|
||||
"firealarm_electronics",
|
||||
"firelock_board",
|
||||
"generic_tank",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 19 KiB |
@@ -1695,6 +1695,7 @@
|
||||
#include "code\datums\wires\emitter.dm"
|
||||
#include "code\datums\wires\explosive.dm"
|
||||
#include "code\datums\wires\fax.dm"
|
||||
#include "code\datums\wires\mass_driver.dm"
|
||||
#include "code\datums\wires\mecha.dm"
|
||||
#include "code\datums\wires\microwave.dm"
|
||||
#include "code\datums\wires\mod.dm"
|
||||
|
||||
Reference in New Issue
Block a user