Skip to content

Commit

Permalink
Merge pull request #1 from NonQueueingMatt/love_symptom_of_the_cure
Browse files Browse the repository at this point in the history
Bringing the RUST in
  • Loading branch information
shaky-jake authored Sep 26, 2023
2 parents edc37cb + 13d61be commit c9a355a
Show file tree
Hide file tree
Showing 87 changed files with 3,676 additions and 508 deletions.
24 changes: 22 additions & 2 deletions aurorastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@
#include "code\datums\datum.dm"
#include "code\datums\feedback.dm"
#include "code\datums\late_choices.dm"
#include "code\datums\local_network.dm"
#include "code\datums\mind.dm"
#include "code\datums\mixed.dm"
#include "code\datums\modules.dm"
Expand All @@ -351,6 +352,7 @@
#include "code\datums\weakref.dm"
#include "code\datums\components\_component.dm"
#include "code\datums\components\connect_mob_behalf.dm"
#include "code\datums\components\local_network.dm"
#include "code\datums\components\armor\armor.dm"
#include "code\datums\components\base_name\base_name.dm"
#include "code\datums\components\multitool\_multitool.dm"
Expand Down Expand Up @@ -1658,10 +1660,11 @@
#include "code\modules\clothing\tail_accessory.dm"
#include "code\modules\clothing\ears\antennae.dm"
#include "code\modules\clothing\ears\bandanna.dm"
#include "code\modules\clothing\ears\bulwark.dm"
#include "code\modules\clothing\ears\earmuffs.dm"
#include "code\modules\clothing\ears\earrings.dm"
#include "code\modules\clothing\ears\skrell.dm"
#include "code\modules\clothing\ears\xeno\bulwark.dm"
#include "code\modules\clothing\ears\xeno\skrell.dm"
#include "code\modules\clothing\ears\xeno\tajara.dm"
#include "code\modules\clothing\factions\dominia.dm"
#include "code\modules\clothing\factions\einstein.dm"
#include "code\modules\clothing\factions\elyra.dm"
Expand Down Expand Up @@ -1718,6 +1721,7 @@
#include "code\modules\clothing\masks\xeno\unathi.dm"
#include "code\modules\clothing\rings\material.dm"
#include "code\modules\clothing\rings\rings.dm"
#include "code\modules\clothing\rings\xeno\tajara.dm"
#include "code\modules\clothing\sets\acting_captain.dm"
#include "code\modules\clothing\sets\captain.dm"
#include "code\modules\clothing\sets\infiltrator.dm"
Expand Down Expand Up @@ -1819,6 +1823,7 @@
#include "code\modules\clothing\under\xenos\vaurca.dm"
#include "code\modules\clothing\wrists\watches.dm"
#include "code\modules\clothing\wrists\wrists.dm"
#include "code\modules\clothing\wrists\xeno\tajara.dm"
#include "code\modules\clothing\wrists\xeno\unathi.dm"
#include "code\modules\compass\_compass.dm"
#include "code\modules\compass\compass_holder.dm"
Expand Down Expand Up @@ -2845,6 +2850,20 @@
#include "code\modules\power\antimatter\containment_jar.dm"
#include "code\modules\power\antimatter\control.dm"
#include "code\modules\power\antimatter\shielding.dm"
#include "code\modules\power\fusion\fusion_circuits.dm"
#include "code\modules\power\fusion\fusion_particle_catcher.dm"
#include "code\modules\power\fusion\fusion_reactions.dm"
#include "code\modules\power\fusion\kinetic_harvester.dm"
#include "code\modules\power\fusion\consoles\_consoles.dm"
#include "code\modules\power\fusion\consoles\core_control.dm"
#include "code\modules\power\fusion\consoles\gyrotron_control.dm"
#include "code\modules\power\fusion\consoles\injector_control.dm"
#include "code\modules\power\fusion\core\_core.dm"
#include "code\modules\power\fusion\core\core_field.dm"
#include "code\modules\power\fusion\fuel_assembly\fuel_assembly.dm"
#include "code\modules\power\fusion\fuel_assembly\fuel_compressor.dm"
#include "code\modules\power\fusion\fuel_assembly\fuel_injector.dm"
#include "code\modules\power\fusion\gyrotron\gyrotron.dm"
#include "code\modules\power\lights\bulbs.dm"
#include "code\modules\power\lights\construction.dm"
#include "code\modules\power\lights\fixtures.dm"
Expand Down Expand Up @@ -3301,6 +3320,7 @@
#include "code\modules\tgui\status_composers.dm"
#include "code\modules\tgui\tgui.dm"
#include "code\modules\tgui\tgui_window.dm"
#include "code\modules\tgui\modules\flavor_text.dm"
#include "code\modules\tgui\states\admin.dm"
#include "code\modules\tgui\states\always.dm"
#include "code\modules\tgui\states\conscious.dm"
Expand Down
5 changes: 5 additions & 0 deletions code/__defines/atmos.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
#define XGM_GAS_FUEL 1
#define XGM_GAS_OXIDIZER 2
#define XGM_GAS_CONTAMINANT 4
#define XGM_GAS_FUSION_FUEL 8

#define TANK_LEAK_PRESSURE (30.*ONE_ATMOSPHERE) // Tank starts leaking.
#define TANK_RUPTURE_PRESSURE (40.*ONE_ATMOSPHERE) // Tank spills all contents into atmosphere.
Expand Down Expand Up @@ -119,6 +120,10 @@
#define GAS_STEAM "water"
#define GAS_SULFUR "sulfurdioxide"
#define GAS_CHLORINE "chlorine"
#define GAS_HELIUM "helium"
#define GAS_DEUTERIUM "deuterium"
#define GAS_TRITIUM "tritium"
#define GAS_BORON "boron"

#define PIPE_COLOR_GREY "#ffffff" //yes white is grey
#define PIPE_COLOR_RED "#ff0000"
Expand Down
2 changes: 2 additions & 0 deletions code/__defines/materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
#define MATERIAL_RUST "rust"
#define MATERIAL_CARDBOARD "cardboard"
#define MATERIAL_GRAPHITE "graphite"
#define MATERIAL_DEUTERIUM "deuterium"
#define MATERIAL_SUPERMATTER "supermatter"

// Leathers and related.
#define MATERIAL_RESIN "resin"
Expand Down
3 changes: 3 additions & 0 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -523,3 +523,6 @@ Define for getting a bitfield of adjacent turfs that meet a condition.
#define TRANSFER_EMERGENCY "emergency transfer"
#define TRANSFER_JUMP "bluespace jump"
#define TRANSFER_CREW "crew transfer"

/// Gyrotron power usage modifier.
#define GYRO_POWER 1500
6 changes: 6 additions & 0 deletions code/_helpers/sorting/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@

/proc/cmp_ruincost_priority(datum/map_template/ruin/A, datum/map_template/ruin/B)
return initial(A.spawn_cost) - initial(B.spawn_cost)

/proc/cmp_fusion_reaction_asc(singleton/fusion_reaction/A, singleton/fusion_reaction/B)
return A.priority - B.priority

/proc/cmp_fusion_reaction_des(singleton/fusion_reaction/A, singleton/fusion_reaction/B)
return B.priority - A.priority
95 changes: 95 additions & 0 deletions code/datums/components/local_network.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/datum/component/local_network_member
var/id_tag

/datum/component/local_network_member/Destroy()
if(parent)
var/datum/local_network/lan = get_local_network()
if(lan)
lan.remove_device(parent)
. = ..()

/datum/component/local_network_member/Initialize(initial_id_tag)
if(initial_id_tag)
set_tag(null, initial_id_tag)

/datum/component/local_network_member/proc/set_tag(mob/user, new_ident)
if(id_tag == new_ident)
to_chat(user, SPAN_WARNING("\The [parent] is already part of the [new_ident] local network."))
return FALSE

if(id_tag)
var/datum/local_network/old_lan = local_networks[id_tag]
if(old_lan)
if(!old_lan.remove_device(parent))
to_chat(user, SPAN_WARNING("You encounter an error when trying to unregister \the [parent] from the [id_tag] local network."))
return FALSE
to_chat(user, SPAN_NOTICE("You unregister \the [parent] from the [id_tag] local network."))

var/datum/local_network/lan = local_networks[new_ident]
if(!lan)
lan = new(new_ident)
lan.add_device(parent)
to_chat(user, SPAN_NOTICE("You create a new [new_ident] local network and register \the [parent] with it."))
else if(lan.within_radius(parent))
lan.add_device(parent)
to_chat(user, SPAN_NOTICE("You register \the [parent] with the [new_ident] local network."))
else
to_chat(user, SPAN_WARNING("\The [parent] is out of range of the [new_ident] local network."))
return FALSE
id_tag = new_ident
return TRUE

/datum/component/local_network_member/proc/get_local_network()
var/datum/local_network/lan = id_tag ? local_networks[id_tag] : null
if(lan && !lan.within_radius(parent))
lan.remove_device(parent)
id_tag = null
lan = null
return lan

/datum/component/local_network_member/nano_host()
if(parent)
return parent.nano_host()
. = ..()

/datum/component/local_network_member/proc/get_new_tag(mob/user)
var/new_ident = input(user, "Enter a new ident tag.", "[parent]", id_tag) as null|text
if(new_ident && parent && user.Adjacent(parent) && CanInteract(user, physical_state))
return set_tag(user, new_ident)

//

/datum/component/local_network_member/multilevel/set_tag(mob/user, new_ident)
if(id_tag == new_ident)
to_chat(user, SPAN_WARNING("\The [parent] is already part of the [new_ident] local network."))
return FALSE

if(id_tag)
var/datum/local_network/multilevel/old_lan = multilevel_local_networks[id_tag]
if(old_lan)
if(!old_lan.remove_device(parent))
to_chat(user, SPAN_WARNING("You encounter an error when trying to unregister \the [parent] from the [id_tag] local network."))
return FALSE
to_chat(user, SPAN_NOTICE("You unregister \the [parent] from the [id_tag] local network."))

var/datum/local_network/multilevel/lan = multilevel_local_networks[new_ident]
if(!lan)
lan = new(new_ident)
lan.add_device(parent)
to_chat(user, SPAN_NOTICE("You create a new [new_ident] local network and register \the [parent] with it."))
else if(lan.within_radius(parent))
lan.add_device(parent)
to_chat(user, SPAN_NOTICE("You register \the [parent] with the [new_ident] local network."))
else
to_chat(user, SPAN_WARNING("\The [parent] is out of range of the [new_ident] local network."))
return FALSE
id_tag = new_ident
return TRUE

/datum/component/local_network_member/multilevel/get_local_network()
var/datum/local_network/multilevel/lan = id_tag ? multilevel_local_networks[id_tag] : null
if(lan && !lan.within_radius(parent))
lan.remove_device(parent)
id_tag = null
lan = null
return lan
77 changes: 77 additions & 0 deletions code/datums/local_network.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
var/global/list/local_networks = list()

/datum/local_network
var/id_tag
var/list/network_entities = list()
var/const/network_size = 25 // Distance in tiles network objects can be from each other.

/datum/local_network/New(_id)
id_tag = _id
local_networks[id_tag] = src

/datum/local_network/Destroy()
network_entities.Cut()
local_networks -= src
. = ..()

/datum/local_network/proc/within_radius(atom/checking)
for(var/entity_list in network_entities)
for(var/entity in entity_list)
if(get_dist(entity, checking) > network_size)
return FALSE
return TRUE

/datum/local_network/proc/add_device(obj/machinery/device)
var/list/entities = get_devices(device.type)

if(!entities)
entities = list()
network_entities[device.type] = entities

entities[device] = TRUE

return entities[device]

/datum/local_network/proc/remove_device(obj/machinery/device)
var/list/entities = get_devices(device.type)
if(!entities)
return TRUE

entities -= device
if(length(entities) <= 0)
network_entities -= device.type
if(length(network_entities) <= 0)
qdel(src)
return isnull(entities[device])

/datum/local_network/proc/is_connected(obj/machinery/device)
var/list/entities = get_devices(device.type)

if(!entities)
return FALSE
return !isnull(entities[device])

/datum/local_network/proc/get_devices(device_type)
for(var/entity_type in network_entities)
if(ispath(entity_type, device_type))
return network_entities[entity_type]


//Multilevel network
var/global/list/multilevel_local_networks = list()

/datum/local_network/multilevel/New(_id)
id_tag = _id
multilevel_local_networks[id_tag] = src

/datum/local_network/multilevel/Destroy()
network_entities.Cut()
multilevel_local_networks -= src
. = ..()

/datum/local_network/multilevel/within_radius(atom/checking)
for(var/entity_list in network_entities)
for(var/atom/entity in entity_list)
if(!(GET_Z(entity) in GetConnectedZlevels(GET_Z(checking))))
return FALSE
return TRUE
58 changes: 0 additions & 58 deletions code/datums/underwear/undershirt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,64 +302,6 @@
name = "Shirt, EPMC Feminine"
icon_state = "shirt_epmc_fem"

/datum/category_item/underwear/undershirt/polo
name = "Polo"
icon_state = "polo"
has_color = TRUE

/datum/category_item/underwear/undershirt/polo_fem
name = "Polo, Feminine"
icon_state = "polo_fem"
has_color = TRUE

/datum/category_item/underwear/undershirt/polo_blue
name = "Polo, Blue"
icon_state = "polo_blue"

/datum/category_item/underwear/undershirt/polo_blue_fem
name = "Polo, Blue Feminine"
icon_state = "polo_blue_fem"

/datum/category_item/underwear/undershirt/polo_red
name = "Polo, Red"
icon_state = "polo_red"

/datum/category_item/underwear/undershirt/polo_red_fem
name = "Polo, Red Feminine"
icon_state = "polo_red_fem"

/datum/category_item/underwear/undershirt/polo_grayyellow
name = "Polo, Gray Yellow"
icon_state = "polo_grayyellow"

/datum/category_item/underwear/undershirt/polo_grayyellow_fem
name = "Polo, Gray Yellow Feminine"
icon_state = "polo_grayyellow_fem"

/datum/category_item/underwear/undershirt/polo_greenstrip
name = "Polo, Green Strip"
icon_state = "polo_corp"

/datum/category_item/underwear/undershirt/polo_greenstrip_fem
name = "Polo, Green Strip Feminine"
icon_state = "polo_corp_fem"

/datum/category_item/underwear/undershirt/polo_bluestrip
name = "Polo, Blue Strip"
icon_state = "polo_dais"

/datum/category_item/underwear/undershirt/polo_bluestrip_fem
name = "Polo, Blue Strip Feminine"
icon_state = "polo_dais_fem"

/datum/category_item/underwear/undershirt/polo_redstrip
name = "Polo, Red Strip"
icon_state = "polo_nt"

/datum/category_item/underwear/undershirt/polo_redstrip_fem
name = "Polo, Red Strip Feminine"
icon_state = "polo_nt_fem"

/datum/category_item/underwear/undershirt/bowlinga
name = "Bowling Shirt, Aqua"
icon_state = "bowlinga"
Expand Down
Loading

0 comments on commit c9a355a

Please sign in to comment.