Skip to content

Commit

Permalink
Everything.
Browse files Browse the repository at this point in the history
  • Loading branch information
AltHit committed Aug 12, 2024
1 parent 840449c commit 6749393
Show file tree
Hide file tree
Showing 22 changed files with 776 additions and 553 deletions.
1 change: 1 addition & 0 deletions cev_eris.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2382,6 +2382,7 @@
#include "code\modules\power\port_gen.dm"
#include "code\modules\power\power.dm"
#include "code\modules\power\powernet.dm"
#include "code\modules\power\shipside_machinery.dm"
#include "code\modules\power\smes.dm"
#include "code\modules\power\smes_construction.dm"
#include "code\modules\power\solar.dm"
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/lrange_scanner.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define ENERGY_UPKEEP_SCANNER (35 KILOWATTS) // Base upkeep
#define ENERGY_PER_SCAN (100 MEGAWATTS) // Energy cost to launch a scan (yes it's in Watt and not in Joules...)
#define ENERGY_UPKEEP_SCANNER (350 KILOWATTS) // Base upkeep
#define ENERGY_PER_SCAN (500 MEGAWATTS) // Energy cost to launch a scan (yes it's in Watt and not in Joules...)

#define SCANNER_OFF 0 // The shield is offline
#define SCANNER_DISCHARGING 1 // The shield is shutting down and discharging.
Expand Down
9 changes: 9 additions & 0 deletions code/__HELPERS/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
return FALSE
return TRUE

//A coppy of a proc above because sometimes you actually need to check if turf is clear no matter if it has wires or pipes
/proc/turf_clear_ignore_cables(turf/T)
if (T.density)
return FALSE
for(var/atom/A in T)
if(A.density)
return FALSE
return TRUE

/proc/clear_interior(var/turf/T)
if (turf_clear(T))
if (!turf_is_external(T))
Expand Down
50 changes: 50 additions & 0 deletions code/controllers/subsystems/staverbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,53 @@ SUBSYSTEM_DEF(statverbs)
user.visible_message(
SPAN_NOTICE("You stop repairing [target_name]."),
)

/datum/statverb/connect_conduit //Connects or disconnects conduits of a shield generator or long range scanner
name = "Connect conduit"
required_stat = STAT_MEC
minimal_stat = STAT_LEVEL_ADEPT

/datum/statverb/connect_conduit/action(mob/user, obj/machinery/power/conduit/conduit)
var/timer = 30 * (1 - user.stats.getStat(STAT_MEC) / 100) SECONDS
if(!conduit.base) //we try to connect it
var/turf/T = get_step(conduit, conduit.dir)
var/obj/machinery/power/shipside/target = locate(/obj/machinery/power/shipside/) in T
if(!target)
user.visible_message(self_message = SPAN_NOTICE("There is nothing to [conduit] to."))
return FALSE
else
if(!target.tendrils_deployed && target.tendrils.len > 0)
if(!target.toggle_tendrils(TRUE)) //fail if conduits are not deployed and can not be deployed
return
if(target.tendrils.len < 1) //no conduits?
target.tendrils_deployed = TRUE
var/datum/repeating_sound/wrenchsound = new(30, timer, 0.15, conduit, 'sound/items/Ratchet.ogg', 80, 1)
user.visible_message(SPAN_NOTICE("[user] starts to connect various pipes and wires between [conduit] and [target]."),
"You start to connect various pipes and wires between [conduit] and [target].")
if(do_mob(user, conduit, timer))
wrenchsound.stop()
qdel(wrenchsound)
conduit.connect(target)
user.visible_message(SPAN_NOTICE("[user] successfully connected [conduit] to the [target]!"),
"You successfully conneced [conduit] to the [target]!")
else
wrenchsound.stop()
qdel(wrenchsound)
user.visible_message(SPAN_NOTICE("[user] stopped connecting [conduit] and [target]."),
"You stopped connecting [conduit] and [target].")
else //disconnection
var/datum/repeating_sound/wrenchsound = new(30, timer, 0.15, conduit, 'sound/items/Ratchet.ogg', 80, 1)
user.visible_message(SPAN_NOTICE("[user] attempts to disconnect [conduit] from the [conduit.base]."),
"You attempt to disconnect [conduit] from the [conduit.base].")
if(do_mob(user, conduit, timer))
wrenchsound.stop()
qdel(wrenchsound)
user.visible_message(SPAN_NOTICE("[user] successfully disconnected [conduit] from the [conduit.base]!"),
"You successfully disconneced [conduit] from the [conduit.base]!")
if(conduit.base.tendrils_deployed == TRUE)
conduit.disconnect()
else
wrenchsound.stop()
qdel(wrenchsound)
user.visible_message(SPAN_NOTICE("[user] stopped connecting [conduit] and [conduit.base]."),
"You stopped connecting [conduit] and [conduit.base].")
6 changes: 3 additions & 3 deletions code/datums/wires/lrange_scanner.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/wires/long_range_scanner
holder_type = /obj/machinery/power/long_range_scanner/
holder_type = /obj/machinery/power/shipside/long_range_scanner/
wire_count = 5
descriptions = list(
new /datum/wire_description(SCANNER_WIRE_POWER, "Power"),
Expand All @@ -14,13 +14,13 @@ var/const/SCANNER_WIRE_AICONTROL = 8 // Cut to disable AI control. Mend to rest
var/const/SCANNER_WIRE_NOTHING = 16 // A blank wire that doesn't have any specific function

/datum/wires/long_range_scanner/CanUse()
var/obj/machinery/power/long_range_scanner/S = holder
var/obj/machinery/power/shipside/long_range_scanner/S = holder
if(S.panel_open)
return 1
return 0

/datum/wires/long_range_scanner/UpdateCut(index, mended)
var/obj/machinery/power/long_range_scanner/S = holder
var/obj/machinery/power/shipside/long_range_scanner/S = holder
switch(index)
if(SCANNER_WIRE_POWER)
S.input_cut = !mended
Expand Down
6 changes: 3 additions & 3 deletions code/datums/wires/shield_generator.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/wires/shield_generator
holder_type = /obj/machinery/power/shield_generator/
holder_type = /obj/machinery/power/shipside/shield_generator/
wire_count = 5
descriptions = list(
new /datum/wire_description(SHIELDGEN_WIRE_POWER, "Main power"),
Expand All @@ -13,13 +13,13 @@ var/const/SHIELDGEN_WIRE_AICONTROL = 8 // Cut to disable AI control. Mend to re
var/const/SHIELDGEN_WIRE_NOTHING = 16 // A blank wire that doesn't have any specific function

/datum/wires/shield_generator/CanUse()
var/obj/machinery/power/shield_generator/S = holder
var/obj/machinery/power/shipside/shield_generator/S = holder
if(S.panel_open)
return 1
return 0

/datum/wires/shield_generator/UpdateCut(index, mended)
var/obj/machinery/power/shield_generator/S = holder
var/obj/machinery/power/shipside/shield_generator/S = holder
switch(index)
if(SHIELDGEN_WIRE_POWER)
S.input_cut = !mended
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/events/space_weather.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
SSevent.change_parallax(GLOB.random_parallax)

/datum/event/harmonic_feedback/tick() //around two seconds
for(var/obj/machinery/power/shield_generator/G in GLOB.machines)
for(var/obj/machinery/power/shipside/shield_generator/G in GLOB.machines)
if(G.running != SHIELD_OFF)
G.take_shield_damage(250, SHIELD_DAMTYPE_SPECIAL, "UNKNOWN") // ALRIGHT LISTEN WEATHER CAN LAST AT MAXIMUM 450 TICKS, AVERAGE AT 375 SHIELD HITS
// BY DEFAULT 1000 DAMAGE EQUALS 1 PERCENT, SO 0.25% * 375 = 93.75%, THIS WILL KNOCK SHIELDS OUT IF THEY'RE NOT AT FULL CAPACITY OR NOT CHARGING WELL
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/scores.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ GLOBAL_VAR_INIT(score_technomancer_faction_item_loss, 0)
if(smes_count == 0)
GLOB.all_smes_powered = FALSE

for(var/obj/machinery/power/shield_generator/S in GLOB.machines)
for(var/obj/machinery/power/shipside/shield_generator/S in GLOB.machines)
if(!isStationLevel(S.z)) continue
smes_count++
if(!S.running) continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,24 @@
/obj/item/electronics/circuitboard/long_range_scanner
name = T_BOARD("long range scanner")
board_type = "machine"
build_path = /obj/machinery/power/long_range_scanner
build_path = /obj/machinery/power/shipside/long_range_scanner
matter = list(MATERIAL_GLASS = 3, MATERIAL_GOLD = 3)
origin_tech = list(TECH_MAGNET = 3, TECH_POWER = 4)
origin_tech = list(TECH_BLUESPACE = 5, TECH_ENGINEERING = 4)
req_components = list(
/obj/item/stock_parts/capacitor = 1,
/obj/item/stock_parts/micro_laser = 1,
/obj/item/stock_parts/smes_coil = 1,
/obj/item/stock_parts/scanning_module = 2,
/obj/item/bluespace_crystal = 1,
/obj/item/stock_parts/subspace/filter = 1,
/obj/item/stock_parts/console_screen = 1)


/obj/item/electronics/circuitboard/scanner_conduit
name = T_BOARD("scanner conduit")
board_type = "machine"
build_path = /obj/machinery/power/conduit/scanner_conduit
matter = list(MATERIAL_GLASS = 3, MATERIAL_GOLD = 3)
origin_tech = list(TECH_BLUESPACE = 3, TECH_POWER = 4)
req_components = list(
/obj/item/stock_parts/subspace/crystal = 1,
/obj/item/stock_parts/subspace/amplifier = 1,
/obj/item/stock_parts/smes_coil = 1,
/obj/item/stock_parts/capacitor = 2)
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,28 @@
/obj/item/electronics/circuitboard/shield_generator
name = T_BOARD("hull shield generator")
board_type = "machine"
build_path = /obj/machinery/power/shield_generator
build_path = /obj/machinery/power/shipside/shield_generator
matter = list(MATERIAL_GLASS = 2, MATERIAL_GOLD = 1)
origin_tech = list(TECH_MAGNET = 3, TECH_POWER = 4)
origin_tech = list(TECH_ENGINEERING = 4, TECH_BLUESPACE = 4)
req_components = list(
/obj/item/stock_parts/capacitor = 1,
/obj/item/stock_parts/micro_laser = 1,
/obj/item/stock_parts/smes_coil = 1,
/obj/item/stock_parts/subspace/crystal = 1, //might be changed to the Catalyst in furure Techno updates
/obj/item/stock_parts/subspace/transmitter = 1,
/obj/item/stock_parts/console_screen = 1)


/obj/item/electronics/circuitboard/shield_conduit
name = T_BOARD("shield conduit")
board_type = "machine"
build_path = /obj/machinery/power/conduit/shield_conduit
matter = list(MATERIAL_GLASS = 2, MATERIAL_GOLD = 1)
origin_tech = list(TECH_MAGNET = 3, TECH_POWER = 4)
req_components = list(
/obj/item/stock_parts/capacitor = 4,
/obj/item/stock_parts/smes_coil = 1,
/obj/item/stack/cable_coil = 10)


/obj/item/electronics/circuitboard/shield_diffuser
name = T_BOARD("shield diffuser")
board_type = "machine"
Expand Down
7 changes: 4 additions & 3 deletions code/modules/long_range_scanner/hull.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//The main hull long range scanner.
/obj/machinery/power/long_range_scanner/hull
/obj/machinery/power/shipside/long_range_scanner/hull
name = "long range scanner core"

//This subtype comes pre-deployed and partially charged
/obj/machinery/power/long_range_scanner/hull/installed/Initialize()
/obj/machinery/power/shipside/long_range_scanner/hull/installed/Initialize()
. = ..()
anchored = toggle_tendrils(TRUE)
anchored = TRUE
spawn_tendrils()
current_energy = max_energy * 0.30
Loading

0 comments on commit 6749393

Please sign in to comment.