forked from Skyrat-SS13/Skyrat-tg
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: Singulo and tesla now on NovaRat (#32)
- Loading branch information
Showing
27 changed files
with
1,164 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// CONSTRUCTION STATES | ||
#define PA_CONSTRUCTION_UNSECURED 0 | ||
#define PA_CONSTRUCTION_UNWIRED 1 | ||
#define PA_CONSTRUCTION_PANEL_OPEN 2 | ||
#define PA_CONSTRUCTION_COMPLETE 3 | ||
|
||
// POWER STATES | ||
#define PARTICLE_STRENGTH_WEAK 0 | ||
#define PARTICLE_STRENGTH_NORMAL 1 | ||
#define PARTICLE_STRENGTH_STRONG 2 | ||
#define PARTICLE_STRENGTH_MAX 3 | ||
|
||
#define ENERGY_REQ_SINGULARITY_CREATION 200 | ||
|
||
#define SINGULARITY_EFFECT_ANIM_TIME 62 |
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
4 changes: 4 additions & 0 deletions
4
modular_nova/modules/singularity_engine/code/cargo/large_objects.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,4 @@ | ||
/datum/export/large/collector | ||
cost = CARGO_CRATE_VALUE * 2 | ||
unit_name = "radiation collector" | ||
export_types = list(/obj/machinery/power/energy_accumulator/rad_collector) |
37 changes: 37 additions & 0 deletions
37
modular_nova/modules/singularity_engine/code/cargo/packs.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,37 @@ | ||
/datum/supply_pack/engine/collector | ||
name = "Radiation Collector Crate" | ||
desc = "Contains three radiation collectors. Useful for collecting energy off nearby Supermatter Crystals, Singularities or Teslas!" | ||
cost = CARGO_CRATE_VALUE * 8 | ||
contains = list( | ||
/obj/machinery/power/energy_accumulator/rad_collector, | ||
/obj/machinery/power/energy_accumulator/rad_collector, | ||
/obj/machinery/power/energy_accumulator/rad_collector, | ||
) | ||
crate_name = "collector crate" | ||
|
||
/datum/supply_pack/engine/particle_accelerator | ||
name = "Particle Accelerator Crate" | ||
desc = "A supermassive black hole or hyper-powered teslaball are the perfect way to spice up any party! This \"My First Apocalypse\" kit contains everything you need to build your own Particle Accelerator! Ages 10 and up." | ||
cost = 10000 | ||
contains = list(/obj/structure/particle_accelerator/fuel_chamber, | ||
/obj/machinery/particle_accelerator/control_box, | ||
/obj/structure/particle_accelerator/particle_emitter/center, | ||
/obj/structure/particle_accelerator/particle_emitter/left, | ||
/obj/structure/particle_accelerator/particle_emitter/right, | ||
/obj/structure/particle_accelerator/power_box, | ||
/obj/structure/particle_accelerator/end_cap) | ||
crate_name = "particle accelerator crate" | ||
|
||
/datum/supply_pack/engine/sing_gen | ||
name = "Singularity Generator Crate" | ||
desc = "The key to unlocking the power of Lord Singuloth. Particle Accelerator not included." | ||
cost = 25000 | ||
contains = list(/obj/machinery/singularity_generator) | ||
crate_name = "singularity generator crate" | ||
|
||
/datum/supply_pack/engine/tesla_gen | ||
name = "Tesla Generator Crate" | ||
desc = "The key to unlocking the power of the Tesla energy ball. Particle Accelerator not included." | ||
cost = 25000 // bullshit 25k | ||
contains = list(/obj/machinery/singularity_generator/tesla) | ||
crate_name = "tesla generator crate" |
204 changes: 204 additions & 0 deletions
204
modular_nova/modules/singularity_engine/code/collector.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,204 @@ | ||
//radiation needs to be over this amount to get power | ||
#define RAD_COLLECTOR_THRESHOLD 80 | ||
//amount of joules created for each rad point over RAD_COLLECTOR_THRESHOLD | ||
#define RAD_COLLECTOR_COEFFICIENT 200 | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector | ||
name = "Hawking Radiation Collector Array" | ||
desc = "A device which uses hawking radiation generated from singularities and plasma to produce power." | ||
icon = 'modular_nova/modules/aesthetics/emitter/icons/emitter.dmi' | ||
icon_state = "ca" | ||
req_access = list(ACCESS_ENGINE_EQUIP, ACCESS_ATMOSPHERICS) | ||
max_integrity = 350 | ||
integrity_failure = 0.2 | ||
rad_insulation = RAD_EXTREME_INSULATION | ||
circuit = /obj/item/circuitboard/machine/rad_collector | ||
/// Stores the loaded tank instance | ||
var/obj/item/tank/internals/plasma/loaded_tank = null | ||
/// Is the collector working? | ||
var/active = FALSE | ||
/// Is the collector locked with an id? | ||
var/locked = FALSE | ||
/// Amount of gas removed per tick | ||
var/drain_ratio = 0.5 | ||
/// Multiplier for the amount of gas removed per tick | ||
var/power_production_drain = 0.001 | ||
/// Base efficiency | ||
var/efficiency_multiplier = 1.0 | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/anchored | ||
anchored = TRUE | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/process(delta_time) | ||
if(!loaded_tank) | ||
return | ||
var/datum/gas_mixture/tank_mix = loaded_tank.return_air() | ||
if(!tank_mix.gases[/datum/gas/plasma]) | ||
investigate_log("<font color='red'>out of fuel</font>.", INVESTIGATE_ENGINE) | ||
playsound(src, 'sound/machines/ding.ogg', 50, TRUE) | ||
eject() | ||
return | ||
var/gasdrained = min(power_production_drain * drain_ratio * delta_time, tank_mix.gases[/datum/gas/plasma][MOLES]) | ||
tank_mix.gases[/datum/gas/plasma][MOLES] -= gasdrained | ||
tank_mix.assert_gas(/datum/gas/tritium) | ||
tank_mix.gases[/datum/gas/tritium][MOLES] += gasdrained | ||
tank_mix.garbage_collect() | ||
|
||
. = ..() | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/interact(mob/user) | ||
if(!anchored) | ||
return | ||
if(locked) | ||
to_chat(user, span_warning("The controls are locked!")) | ||
return | ||
toggle_power() | ||
user.visible_message(span_notice("[user.name] turns the [src.name] [active? "on":"off"]."), \ | ||
span_notice("You turn the [src.name] [active? "on":"off"].")) | ||
var/datum/gas_mixture/tank_mix = loaded_tank?.return_air() | ||
var/fuel | ||
if(loaded_tank) | ||
fuel = tank_mix.gases[/datum/gas/plasma] | ||
fuel = fuel ? fuel[MOLES] : 0 | ||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [key_name(user)]. [loaded_tank?"Fuel: [round(fuel/0.29)]%":"<font color='red'>It is empty</font>"].", INVESTIGATE_ENGINE) | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/can_be_unfasten_wrench(mob/user, silent) | ||
if(!loaded_tank) | ||
return ..() | ||
if(!silent) | ||
to_chat(user, span_warning("Remove the plasma tank first!")) | ||
return FAILED_UNFASTEN | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/attackby(obj/item/item, mob/user, params) | ||
if(istype(item, /obj/item/tank/internals/plasma)) | ||
if(!anchored) | ||
to_chat(user, span_warning("[src] needs to be secured to the floor first!")) | ||
return TRUE | ||
if(loaded_tank) | ||
to_chat(user, span_warning("There's already a plasma tank loaded!")) | ||
return TRUE | ||
if(panel_open) | ||
to_chat(user, span_warning("Close the maintenance panel first!")) | ||
return TRUE | ||
if(!user.transferItemToLoc(item, src)) | ||
return | ||
loaded_tank = item | ||
update_appearance() | ||
else if(item.GetID()) | ||
if(!allowed(user)) | ||
to_chat(user, span_danger("Access denied.")) | ||
return TRUE | ||
if(!active) | ||
to_chat(user, span_warning("The controls can only be locked when \the [src] is active!")) | ||
return TRUE | ||
locked = !locked | ||
to_chat(user, span_notice("You [locked ? "lock" : "unlock"] the controls.")) | ||
return TRUE | ||
else | ||
return ..() | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/wrench_act(mob/living/user, obj/item/item) | ||
. = ..() | ||
default_unfasten_wrench(user, item) | ||
return TRUE | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/screwdriver_act(mob/living/user, obj/item/item) | ||
if(..()) | ||
return TRUE | ||
if(!loaded_tank) | ||
default_deconstruction_screwdriver(user, icon_state, icon_state, item) | ||
return TRUE | ||
to_chat(user, span_warning("Remove the plasma tank first!")) | ||
return TRUE | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/crowbar_act(mob/living/user, obj/item/I) | ||
if(loaded_tank) | ||
if(!locked) | ||
eject() | ||
return TRUE | ||
to_chat(user, span_warning("The controls are locked!")) | ||
return TRUE | ||
if(default_deconstruction_crowbar(I)) | ||
return TRUE | ||
to_chat(user, span_warning("There isn't a tank loaded!")) | ||
return TRUE | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/return_analyzable_air() | ||
if(!loaded_tank) | ||
return null | ||
return loaded_tank.return_analyzable_air() | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/examine(mob/user) | ||
. = ..() | ||
if(!active) | ||
. += span_notice("<b>[src]'s display displays the words:</b> \"Power production mode. Please insert <b>Plasma</b>.\"") | ||
. += span_notice("[src]'s display states that it has stored <b>[display_joules(get_stored_joules())]</b>, and is processing <b>[display_power(get_power_output())]</b>.") | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/atom_break(damage_flag) | ||
. = ..() | ||
if(.) | ||
eject() | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/RefreshParts() | ||
. = ..() | ||
|
||
// Reset the upgrades to base values | ||
efficiency_multiplier = 1.0 | ||
|
||
// Calculate efficiency based on micro-laser parts | ||
for(var/datum/stock_part/micro_laser/laser in component_parts) | ||
efficiency_multiplier += (laser.tier - 1) * 0.2 // Each tier above 1 increases efficiency by 20% | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/proc/eject() | ||
locked = FALSE | ||
var/obj/item/tank/internals/plasma/tank = loaded_tank | ||
if (!tank) | ||
return | ||
tank.forceMove(drop_location()) | ||
tank.layer = initial(tank.layer) | ||
tank.plane = initial(tank.plane) | ||
loaded_tank = null | ||
if(active) | ||
toggle_power() | ||
else | ||
update_appearance() | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/proc/hawking_pulse(atom/source, pulse_strength) | ||
if(loaded_tank && active && pulse_strength > RAD_COLLECTOR_THRESHOLD) | ||
// Adjust energy calculation based on efficiency multiplier | ||
stored_energy += joules_to_energy((pulse_strength - RAD_COLLECTOR_THRESHOLD) * RAD_COLLECTOR_COEFFICIENT * efficiency_multiplier) | ||
new /obj/effect/temp_visual/hawking_radiation(get_turf(src)) | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/update_overlays() | ||
. = ..() | ||
if(loaded_tank) | ||
. += "ptank" | ||
if(machine_stat & (NOPOWER|BROKEN)) | ||
return | ||
if(active) | ||
. += "on" // SKYRAT EDIT CHANGE - ORIGINAL. += loaded_tank ? "on" : "error" | ||
|
||
/obj/machinery/power/energy_accumulator/rad_collector/proc/toggle_power() | ||
active = !active | ||
if(active) | ||
icon_state = "ca_on" | ||
flick("ca_active", src) | ||
else | ||
icon_state = "ca" | ||
flick("ca_deactive", src) | ||
update_appearance() | ||
return | ||
|
||
#undef RAD_COLLECTOR_THRESHOLD | ||
#undef RAD_COLLECTOR_COEFFICIENT | ||
|
||
|
||
/obj/item/circuitboard/machine/rad_collector | ||
name = "Radiation Collector(hawking)" | ||
greyscale_colors = CIRCUIT_COLOR_ENGINEERING | ||
build_path = /obj/machinery/power/energy_accumulator/rad_collector | ||
req_components = list( | ||
/datum/stock_part/micro_laser = 1, | ||
/obj/item/stack/cable_coil = 2, | ||
/obj/item/stack/sheet/glass = 2) | ||
needs_anchored = FALSE |
13 changes: 13 additions & 0 deletions
13
modular_nova/modules/singularity_engine/code/emp_proof_door.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,13 @@ | ||
/obj/machinery/door/airlock/external/glass/emp_proof | ||
name = "emp proof airlock" | ||
|
||
/obj/machinery/door/airlock/external/glass/emp_proof/emp_act(severity) | ||
return | ||
|
||
/obj/machinery/power/apc/auto_name/emp_proof | ||
name = "emp proof apc" | ||
|
||
/obj/machinery/power/apc/auto_name/emp_proof/emp_act(severity) | ||
return | ||
|
||
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/power/apc/auto_name/emp_proof, APC_PIXEL_OFFSET) |
Oops, something went wrong.