Skip to content

Commit

Permalink
Merge pull request Monkestation#25 from AcapitalA/engines
Browse files Browse the repository at this point in the history
Re-adds the singulo, tesla and MRSPACMAN
  • Loading branch information
Djiq authored and dwasint committed Mar 18, 2023
1 parent 05a26fb commit e4df4ae
Show file tree
Hide file tree
Showing 24 changed files with 1,328 additions and 77 deletions.
49 changes: 49 additions & 0 deletions code/datums/wires/particle_accelerator.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/datum/wires/particle_accelerator/control_box
holder_type = /obj/machinery/particle_accelerator/control_box
proper_name = "Particle Accelerator"

/datum/wires/particle_accelerator/control_box/New(atom/holder)
wires = list(
WIRE_POWER, WIRE_STRENGTH, WIRE_LIMIT,
WIRE_INTERFACE
)
add_duds(2)
..()

/datum/wires/particle_accelerator/control_box/interactable(mob/user)
. = ..()
var/obj/machinery/particle_accelerator/control_box/C = holder
if(C.construction_state == 2)
return TRUE

/datum/wires/particle_accelerator/control_box/on_pulse(wire)
var/obj/machinery/particle_accelerator/control_box/C = holder
switch(wire)
if(WIRE_POWER)
C.toggle_power()
if(WIRE_STRENGTH)
C.add_strength()
if(WIRE_INTERFACE)
C.interface_control = !C.interface_control
if(WIRE_LIMIT)
C.visible_message("<span class='notice'>[icon2html(C, viewers(holder))]<b>[C]</b> makes a large whirring noise.</span>")

/datum/wires/particle_accelerator/control_box/on_cut(wire, mend)
var/obj/machinery/particle_accelerator/control_box/C = holder
switch(wire)
if(WIRE_POWER)
if(C.active == !mend)
C.toggle_power()
if(WIRE_STRENGTH)
for(var/i = 1; i < 3; i++)
C.remove_strength()
if(WIRE_INTERFACE)
if(!mend)
C.interface_control = FALSE
if(WIRE_LIMIT)
C.strength_upper_limit = (mend ? 2 : 3)
if(C.strength_upper_limit < C.strength)
C.remove_strength()

/datum/wires/particle_accelerator/control_box/emp_pulse() // to prevent singulo from pulsing wires
return
4 changes: 1 addition & 3 deletions code/game/machinery/computer/arcade/orion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ GLOBAL_LIST_INIT(orion_events, generate_orion_events())
/obj/machinery/computer/arcade/orion_trail/kobayashi
name = "Kobayashi Maru control computer"
desc = "A test for cadets."
icon = 'icons/obj/machines/particle_accelerator.dmi'
icon_keyboard = null
icon_screen = null
icon = 'icons/obj/particle_accelerator.dmi'
icon_state = "control_boxp"
//kobatashi has a smaller list of events, so we copy from the global list and cut whatever isn't here
var/list/event_whitelist = list(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@

/obj/item/circuitboard/machine/turbine_compressor
name = "Turbine - Inlet Compressor"
/obj/item/circuitboard/machine/pacman/mrs
name = "MRSPACMAN-type Generator (Machine Board)"
build_path = /obj/machinery/power/port_gen/pacman/mrs

/obj/item/circuitboard/machine/power_compressor
name = "Power Compressor (Machine Board)"
greyscale_colors = CIRCUIT_COLOR_ENGINEERING
build_path = /obj/machinery/power/turbine/inlet_compressor/constructed
req_components = list(
Expand Down
55 changes: 55 additions & 0 deletions code/modules/awaymissions/bluespaceartillery.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@


/obj/machinery/artillerycontrol
var/reload = 120
var/reload_cooldown = 120
var/explosiondev = 3
var/explosionmed = 6
var/explosionlight = 12
name = "bluespace artillery control"
icon_state = "control_boxp1"
icon = 'icons/obj/particle_accelerator.dmi'
density = TRUE

/obj/machinery/artillerycontrol/process(delta_time)
if(reload < reload_cooldown)
reload += delta_time

/obj/structure/artilleryplaceholder
name = "artillery"
icon = 'icons/obj/machines/artillery.dmi'
anchored = TRUE
density = TRUE

/obj/structure/artilleryplaceholder/decorative
density = FALSE

/obj/machinery/artillerycontrol/ui_interact(mob/user)
. = ..()
var/dat = "<B>Bluespace Artillery Control:</B><BR>"
dat += "Locked on<BR>"
dat += "<B>Charge progress: [reload]/[reload_cooldown]:</B><BR>"
dat += "<A href='byond://?src=[REF(src)];fire=1'>Open Fire</A><BR>"
dat += "Deployment of weapon authorized by <br>Nanotrasen Naval Command<br><br>Remember, friendly fire is grounds for termination of your contract and life.<HR>"
user << browse(dat, "window=scroll")
onclose(user, "scroll")

/obj/machinery/artillerycontrol/Topic(href, href_list)
if(..())
return
var/A
A = input("Area to bombard", "Open Fire", A) in GLOB.teleportlocs
var/area/thearea = GLOB.teleportlocs[A]
if(usr.stat != CONSCIOUS || HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED))
return
if(reload < reload_cooldown)
return
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || issilicon(usr))
priority_announce("Bluespace artillery fire detected. Brace for impact.")
message_admins("[ADMIN_LOOKUPFLW(usr)] has launched an artillery strike.")
var/list/L = list()
for(var/turf/T in get_area_turfs(thearea.type))
L+=T
var/loc = pick(L)
explosion(loc, explosiondev, explosionmed, explosionlight)
reload = 0
55 changes: 55 additions & 0 deletions code/modules/cargo/bounties/engineering.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
/datum/bounty/item/engineering/gas
name = "Full Tank of Pluoxium"
description = "CentCom RnD is researching extra compact internals. Ship us a tank full of Pluoxium and you'll be compensated."
reward = CARGO_CRATE_VALUE * 15
wanted_types = list(/obj/item/tank)
var/moles_required = 20 // A full tank is 28 moles, but CentCom ignores that fact.
var/gas_type = /datum/gas/pluoxium

/datum/bounty/item/engineering/gas/applies_to(obj/O)
if(!..())
return FALSE
var/obj/item/tank/T = O
var/datum/gas_mixture/our_mix = T.return_air()
if(!our_mix.gases[gas_type])
return FALSE
return our_mix.gases[gas_type][MOLES] >= moles_required

/datum/bounty/item/engineering/gas/nitryl_tank
name = "Full Tank of Nitryl"
description = "The non-human staff of Station 88 has been volunteered to test performance enhancing drugs. Ship them a tank full of Nitryl so they can get started. (20 Moles)"
gas_type = /datum/gas/nitryl

/datum/bounty/item/engineering/gas/freon_tank
name = "Full Tank of Freon"
description = "The Supermatter of station 33 has started the delamination process. Deliver a tank of Freon gas to help them stop it! (20 Moles)"
gas_type = /datum/gas/freon

/datum/bounty/item/engineering/gas/tritium_tank
name = "Full Tank of Tritium"
description = "Station 49 is looking to kickstart their research program. Ship them a tank full of Tritium. (20 Moles)"
gas_type = /datum/gas/tritium

/datum/bounty/item/engineering/gas/hydrogen_tank
name = "Full Tank of Hydrogen"
description = "Our R&D department is working on the development of more efficient electrical batteries using hydrogen as a catalyst. Ship us a tank full of it. (20 Moles)"
gas_type = /datum/gas/hydrogen

/datum/bounty/item/engineering/gas/zauker_tank
name = "Full Tank of Zauker"
description = "The main planet of \[REDACTED] has been chosen as testing grounds for the new weapon that uses Zauker gas. Ship us a tank full of it. (20 Moles)"
reward = CARGO_CRATE_VALUE * 20
gas_type = /datum/gas/zauker

/datum/bounty/item/engineering/energy_ball
name = "Contained Tesla Ball"
description = "Station 24 is being overrun by hordes of angry Mothpeople. They are requesting the ultimate bug zapper."
reward = CARGO_CRATE_VALUE * 375
wanted_types = list(/obj/singularity/energy_ball)

/datum/bounty/item/engineering/energy_ball/applies_to(obj/O)
if(!..())
return FALSE
var/obj/singularity/energy_ball/T = O
return !T.miniball

/datum/bounty/item/engineering/emitter
name = "Emitter"
description = "We think there may be a defect in your station's emitter designs, based on the sheer number of delaminations your sector seems to see. Ship us one of yours."
Expand Down
21 changes: 21 additions & 0 deletions code/modules/cargo/exports/large_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@
unit_name = "tesla coil"
export_types = list(/obj/machinery/power/energy_accumulator/tesla_coil)

/datum/export/large/pa
cost = CARGO_CRATE_VALUE * 2
unit_name = "particle accelerator part"
export_types = list(/obj/structure/particle_accelerator)

/datum/export/large/pa/controls
cost = CARGO_CRATE_VALUE * 2.5
unit_name = "particle accelerator control console"
export_types = list(/obj/machinery/particle_accelerator/control_box)

/datum/export/large/supermatter
cost = CARGO_CRATE_VALUE * 16
unit_name = "supermatter shard"
Expand All @@ -91,6 +101,17 @@
unit_name = "grounding rod"
export_types = list(/obj/machinery/power/energy_accumulator/grounding_rod)

/datum/export/large/tesla_gen
cost = CARGO_CRATE_VALUE * 16
unit_name = "energy ball generator"
export_types = list(/obj/machinery/the_singularitygen/tesla)

/datum/export/large/singulo_gen
cost = CARGO_CRATE_VALUE * 16
unit_name = "gravitational singularity generator"
export_types = list(/obj/machinery/the_singularitygen)
include_subtypes = FALSE

/datum/export/large/iv
cost = CARGO_CRATE_VALUE * 0.25
unit_name = "iv drip"
Expand Down
20 changes: 20 additions & 0 deletions code/modules/cargo/exports/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,26 @@
unit_name = "rapid pipe dispenser"
export_types = list(/obj/item/pipe_dispenser)

/datum/export/singulo //failsafe in case someone decides to ship a live singularity to CentCom without the corresponding bounty
cost = 1
unit_name = "singularity"
export_types = list(/obj/singularity)
include_subtypes = FALSE

/datum/export/singulo/total_printout(datum/export_report/ex, notes = TRUE)
. = ..()
if(. && notes)
. += " ERROR: Invalid object detected."

/datum/export/singulo/tesla //see above
unit_name = "energy ball"
export_types = list(/obj/singularity/energy_ball)

/datum/export/singulo/tesla/total_printout(datum/export_report/ex, notes = TRUE)
. = ..()
if(. && notes)
. += " ERROR: Unscheduled energy ball delivery detected."

//artisanal exports for the mom and pops
/datum/export/soap
cost = CARGO_CRATE_VALUE * 0.375
Expand Down
15 changes: 15 additions & 0 deletions code/modules/power/port_gen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,5 +277,20 @@
power_gen = 15000
sheet_path = /obj/item/stack/sheet/mineral/uranium

/obj/machinery/power/port_gen/pacman/super/overheat()
explosion(src, devastation_range = 3, heavy_impact_range = 3, light_impact_range = 3, flash_range = -1)

/obj/machinery/power/port_gen/pacman/mrs
name = "\improper M.R.S.P.A.C.M.A.N.-type portable generator"
base_icon = "portgen2"
icon_state = "portgen2_0"
circuit = /obj/item/circuitboard/machine/pacman/mrs
sheet_path = /obj/item/stack/sheet/mineral/diamond
power_gen = 40000
time_per_sheet = 80

/obj/machinery/power/port_gen/pacman/mrs/overheat()
explosion(src.loc, 4, 4, 4, -1)

/obj/machinery/power/port_gen/pacman/pre_loaded
sheets = 15
35 changes: 35 additions & 0 deletions code/modules/power/singularity/generator.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/////SINGULARITY SPAWNER
/obj/machinery/the_singularitygen
name = "Gravitational Singularity Generator"
desc = "An odd device which produces a Gravitational Singularity when set up."
icon = 'icons/obj/singularity.dmi'
icon_state = "TheSingGen"
anchored = FALSE
density = TRUE
use_power = NO_POWER_USE
resistance_flags = FIRE_PROOF

// You can buckle someone to the singularity generator, then start the engine. Fun!
can_buckle = TRUE
buckle_lying = FALSE
buckle_requires_restraints = TRUE

var/energy = 0
var/creation_type = /obj/singularity

/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user, params)
if(W.tool_behaviour == TOOL_WRENCH)
default_unfasten_wrench(user, W, 0)
else
return ..()

/obj/machinery/the_singularitygen/process()
if(energy > 0)
if(energy >= 200)
var/turf/T = get_turf(src)
SSblackbox.record_feedback("tally", "engine_started", 1, type)
var/obj/singularity/S = new creation_type(T, 50)
transfer_fingerprints_to(S)
qdel(src)
else
energy -= 1
63 changes: 63 additions & 0 deletions code/modules/power/singularity/particle_accelerator/particle.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/obj/effect/accelerated_particle
name = "Accelerated Particles"
desc = "Small things moving very fast."
icon = 'icons/obj/particle_accelerator.dmi'
icon_state = "particle"
anchored = TRUE
density = FALSE
var/movement_range = 20
var/energy = 10
var/speed = 1

/obj/effect/accelerated_particle/weak
movement_range = 15
energy = 5

/obj/effect/accelerated_particle/strong
movement_range = 25
energy = 15

/obj/effect/accelerated_particle/powerful
movement_range = 30
energy = 50


/obj/effect/accelerated_particle/New(loc)
..()

addtimer(CALLBACK(src, .proc/move), 1)


/obj/effect/accelerated_particle/Bump(atom/A)
if(A)
if(isliving(A))
toxmob(A)
else if(istype(A, /obj/machinery/the_singularitygen))
var/obj/machinery/the_singularitygen/S = A
S.energy += energy
else if(istype(A, /obj/singularity))
var/obj/singularity/S = A
S.energy += energy
else if(istype(A, /obj/structure/blob))
var/obj/structure/blob/B = A
B.take_damage(energy*0.6)
movement_range = 0

/obj/effect/accelerated_particle/ex_act(severity, target)
qdel(src)

/obj/effect/accelerated_particle/singularity_pull()
return

/obj/effect/accelerated_particle/proc/toxmob(mob/living/M)
M.rad_act(energy*6)

/obj/effect/accelerated_particle/proc/move()
if(!step(src,dir))
forceMove(get_step(src,dir))
movement_range--
if(movement_range == 0)
qdel(src)
else
sleep(speed)
move()
Loading

0 comments on commit e4df4ae

Please sign in to comment.