Skip to content

Commit

Permalink
Shield generator and Long range scanner refactor + Bioreactor fixes (#…
Browse files Browse the repository at this point in the history
…8514)

* Bioreactor updates

Now multistructures don't break until rebuild when screwed
Bioreactor will now properly check for any breaches in the chamber and it will properly shut down if it spots any breaches
Swapped placeholder power consumption for the real one
Fixed bioreactor window opacity being inverted
Cahors now has a slight anti-toxin effect as it should
Bioreactor chamber ritual now updates breached status of bioreactor to restore it

* Fix sensors/sheildgen and revert bioreactor fixes

Fixed ability to extend shieldgen's and sensor's capacitors while they are unanchored

* Everything.

* Update food-Drinks.dm

Changed effects of Cahors wine

* Clearing up proc augments

Suggested by SirRichardFrancis
And yes, I tested affected procs.
  • Loading branch information
AltHit authored Sep 23, 2024
1 parent 3611fa6 commit 954370b
Show file tree
Hide file tree
Showing 29 changed files with 805 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
7 changes: 7 additions & 0 deletions code/game/machinery/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
var/list/component_parts //list of all the parts used to build it, if made from certain kinds of frames.
var/uid
var/panel_open = 0
//0 - panel closed
//1 - panel opened
//-1 - panel never should be opened (used for NT buildings)
var/global/gl_uid = 1
var/interact_offline = 0 // Can the machine be interacted with while de-powered.
var/obj/item/electronics/circuitboard/circuit
Expand Down Expand Up @@ -304,6 +307,10 @@
//Tool qualities are stored in \code\__defines\tools_and_qualities.dm
/obj/machinery/proc/default_deconstruction(obj/item/I, mob/user)

if(panel_open == -1)
to_chat(user, SPAN_NOTICE("There are no panels to open on \the [src]."))
return FALSE

var/qualities = list(QUALITY_SCREW_DRIVING)

if(panel_open && circuit)
Expand Down
6 changes: 4 additions & 2 deletions code/game/machinery/multistructure.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,16 @@
/obj/machinery/multistructure/attackby(obj/item/I, mob/user)
check_MS()
if(default_deconstruction(I, user))
if(MS)
MS.Destroy()
return

if(default_part_replacement(I, user))
return
return

/obj/machinery/multistructure/on_deconstruction() //destroy multistructure if element is deconstructed with crowbar or in a simular way
if(MS)
MS.Destroy()


// This proc will check and attpemt to create MS
// first it tries to find any element mentioned in MS structure and if finds any it will pass coords of where top-left element of a structure matrix should be to createMultistructure()
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
8 changes: 5 additions & 3 deletions code/modules/biomatter_manipulation/bioreactor/bioreactor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@
chamber_closed = !chamber_closed


/datum/multistructure/bioreactor/proc/pump_solution()
if(!chamber_closed || !is_operational())
return
/datum/multistructure/bioreactor/proc/pump_solution(forced)
if(!forced)
if(!chamber_closed || !is_operational())
return
if(chamber_solution)
solution.icon_state = ""
flick("solution_pump_out", solution)
Expand All @@ -128,6 +129,7 @@
icon_state = "biomassconsole1"
anchored = TRUE
density = TRUE
panel_open = -1
MS_type = /datum/multistructure/bioreactor
var/datum/multistructure/bioreactor/MS_bioreactor

Expand Down
11 changes: 5 additions & 6 deletions code/modules/biomatter_manipulation/bioreactor/platform.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
//if our target has hazard protection, apply damage based on the protection percentage.
var/hazard_protection = victim.getarmor(null, ARMOR_BIO)
var/damage = BIOREACTOR_DAMAGE_PER_TICK - (BIOREACTOR_DAMAGE_PER_TICK * (hazard_protection/100))
victim.apply_damage(damage, BRUTE, used_weapon = "Biological")
victim.apply_damage(damage, BURN, used_weapon = "Biological") // Before ErisMed 4 damage type was CLONE until some CLOWN changed it to simply BRUTE for no reason. TODO: change to better damage type when possible
victim.adjustOxyLoss(BIOREACTOR_DAMAGE_PER_TICK / 2) // Snowflake shit, but we need the mob to die within a reasonable time frame

if(prob(10))
Expand Down Expand Up @@ -79,7 +79,7 @@
//if our machine is non operational, let's go idle powermode and pump out solution
use_power(idle_power_usage)
if(MS_bioreactor.chamber_solution)
MS_bioreactor.pump_solution()
MS_bioreactor.pump_solution(forced = 1)


/obj/machinery/multistructure/bioreactor_part/platform/attackby(var/obj/item/I, var/mob/user)
Expand Down Expand Up @@ -169,13 +169,12 @@
//Here we go through our windows and check it for breach. If somewhere glass will be missing, we return TRUE and turn our bioreactor var
/obj/machinery/multistructure/bioreactor_part/platform/proc/is_breached()
var/list/glass_dirs = get_opened_dirs()
for(var/obj/structure/window/reinforced/glass in loc)
for(var/obj/structure/window/reinforced/bioreactor/glass in loc)
if(glass.dir in glass_dirs)
glass_dirs -= glass.dir
if(glass_dirs.len)
MS_bioreactor.chamber_breached = TRUE
return TRUE
MS_bioreactor.chamber_breached = FALSE
return FALSE


Expand Down Expand Up @@ -223,10 +222,10 @@
contamination_level += amount
if(contamination_level >= max_contamination_lvl)
contamination_level = max_contamination_lvl
opacity = FALSE
opacity = TRUE
if(contamination_level <= 0)
contamination_level = 0
opacity = TRUE
opacity = FALSE
update_icon()


Expand Down
1 change: 1 addition & 0 deletions code/modules/biomatter_manipulation/solidifier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
idle_power_usage = 5
active_power_usage = 300
reagent_flags = TRANSPARENT
panel_open = -1

var/active = FALSE
var/port_dir = SOUTH
Expand Down
7 changes: 6 additions & 1 deletion code/modules/core_implant/cruciform/rituals/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,15 @@
/datum/ritual/cruciform/machines/bioreactor/chamber_doors
name = "Bioreactor chamber's words"
phrase = "Constituit quoque ianitores in portis domus Domini ut non ingrederetur eam inmundus in omni."
desc = "This ritual opens or closes the bioreactor chamber. You should stay nearby its screen."
desc = "This ritual opens, closes and checks if the bioreactor chamber is sealed properly. You should stay nearby its screen."


/datum/ritual/cruciform/machines/bioreactor/chamber_doors/perform_command(datum/multistructure/bioreactor/bioreactor)
if(bioreactor.chamber_breached)
for(var/obj/machinery/multistructure/bioreactor_part/platform/platform in bioreactor.elements)
if(platform.is_breached())
return FALSE
bioreactor.chamber_breached = FALSE
if(bioreactor.chamber_solution)
return FALSE
bioreactor.toggle_platform_door()
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 954370b

Please sign in to comment.