Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/HearthOfHestia/Nebula into u…
Browse files Browse the repository at this point in the history
…pdates/devmerge-11-26-2021
  • Loading branch information
MarinaGryphon committed Dec 4, 2021
2 parents 2409f86 + 35611b4 commit 5b0100a
Show file tree
Hide file tree
Showing 62 changed files with 3,534 additions and 1,998 deletions.
2 changes: 1 addition & 1 deletion code/__defines/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The latter will result in a linter warning and will not work correctly.
#define ATOM_FLAG_ADJACENT_EXCEPTION BITFLAG(9) // Skips adjacent checks for atoms that should always be reachable in window tiles
#define ATOM_FLAG_NO_DISSOLVE BITFLAG(10) // Bypasses solvent reactions in the container.
#define ATOM_FLAG_NO_PHASE_CHANGE BITFLAG(11) // Bypasses heating and cooling product reactions in the container.
#define ATOM_FLAG_ALLOW_DIAGONAL_FACING BITFLAG(12) // Atom can face non-cardinal directions.
#define ATOM_FLAG_BLOCK_DIAGONAL_FACING BITFLAG(12) // Atom cannot face non-cardinal directions.

#define ATOM_IS_OPEN_CONTAINER(A) (A.atom_flags & ATOM_FLAG_OPEN_CONTAINER)

Expand Down
5 changes: 5 additions & 0 deletions code/_onclick/hud/radial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var/global/list/radial_menus = list()
closeToolTip(usr)

/obj/screen/radial/slice/Click(location, control, params)
if(QDELETED(src) || QDELETED(parent))
return
if(parent && usr.client == parent.current_user)
if(next_page)
parent.next_page()
Expand All @@ -51,6 +53,8 @@ var/global/list/radial_menus = list()
icon_state = "radial_center"

/obj/screen/radial/center/Click(location, control, params)
if(QDELETED(src) || QDELETED(parent))
return
if(usr.client == parent.current_user)
parent.finished = TRUE

Expand Down Expand Up @@ -274,6 +278,7 @@ var/global/list/radial_menus = list()
/datum/radial_menu/proc/hide()
if(current_user)
current_user.images -= menu_holder
clear_vis_contents(menu_holder)

/datum/radial_menu/proc/wait(atom/user, atom/anchor, require_near = FALSE, list/check_locs)
while (current_user && !finished && !selected_choice)
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ var/global/obj/screen/robot_inventory
else
//Modules display is hidden
//R.client.screen -= robot_inventory //"store" icon
for(var/atom/A in R.module.equipment)
for(var/atom/A in R.module?.equipment)
if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) )
//Module is not currently active
R.client.screen -= A
Expand Down
2 changes: 1 addition & 1 deletion code/datums/observation/dir_set.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/atom/set_dir(ndir)
var/old_dir = dir
// This attempts to mimic BYOND's handling of diagonal directions and cardinal icon states.
if(!(atom_flags & ATOM_FLAG_ALLOW_DIAGONAL_FACING) && !IsPowerOfTwo(ndir))
if((atom_flags & ATOM_FLAG_BLOCK_DIAGONAL_FACING) && !IsPowerOfTwo(ndir))
if(old_dir & ndir)
ndir = old_dir
else
Expand Down
34 changes: 31 additions & 3 deletions code/datums/security_state.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@

comm_console_security_levels = list()
// Setup the list of selectable security levels available in the comm. console
for(var/security_level in all_security_levels)
for(var/decl/security_level/security_level in all_security_levels)
if(security_level == highest_standard_security_level)
break
comm_console_security_levels += security_level
if(security_level.selectable)
comm_console_security_levels += security_level

// Now we ensure the high security level is not above the severe one (but we allow them to be equal)
var/severe_index = all_security_levels.Find(severe_security_level)
Expand Down Expand Up @@ -149,6 +150,8 @@
var/up_description
var/down_description

var/selectable = TRUE

var/datum/alarm_appearance/alarm_appearance

/decl/security_level/Initialize()
Expand Down Expand Up @@ -293,6 +296,21 @@
alarm_icon = "alarm_normal"
alarm_icon_color = PIPE_COLOR_GREEN

/decl/security_level/default/code_yellow
name = "code yellow"
icon = 'icons/misc/security_state.dmi'

light_color_alarm = COLOR_YELLOW_GRAY
light_color_status_display = COLOR_YELLOW_GRAY
overlay_alarm = "alarm_orange"
overlay_status_display = "status_display_orange"
alarm_appearance = /datum/alarm_appearance/yellow

up_description = "Subsector FTL Procedures are now in effect; observe modified Code Orange protocols, secure all stations for superluminal transition. EVA Ban in effect."
down_description = "Subsector FTL Procedures are now in effect; observe modified Code Orange protocols, secure all stations for superluminal transition. EVA Ban in effect."

selectable = FALSE

/datum/alarm_appearance/blue
display_icon = "status_display_lines"
display_icon_color = COLOR_BLUE
Expand Down Expand Up @@ -327,4 +345,14 @@
alarm_icon_color = COLOR_RED

alarm_icon_twotone = "alarm_blinking_twotone2"
alarm_icon_twotone_color = PIPE_COLOR_YELLOW
alarm_icon_twotone_color = PIPE_COLOR_YELLOW

/datum/alarm_appearance/yellow
display_icon = "status_display_lines"
display_icon_color = COLOR_YELLOW_GRAY

display_emblem = "status_display_ftl"
display_emblem_color = COLOR_WHITE

alarm_icon = "alarm_normal"
alarm_icon_color = COLOR_YELLOW_GRAY
13 changes: 7 additions & 6 deletions code/game/machinery/bodyscanner_console.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/obj/machinery/body_scanconsole
var/obj/machinery/bodyscanner/connected
var/obj/machinery/bodyscanner/connected
var/stored_scan_subject
name = "Body Scanner Console"
icon = 'icons/obj/Cryogenic2.dmi'
Expand All @@ -20,7 +20,7 @@

/obj/machinery/body_scanconsole/on_update_icon()
if(stat & (BROKEN | NOPOWER))
icon_state = "body_scannerconsole-p"
icon_state = "body_scannerconsole-p"
else
icon_state = initial(icon_state)

Expand All @@ -31,13 +31,14 @@
break
events_repository.register(/decl/observ/destroyed, connected, src, .proc/unlink_scanner)

/obj/machinery/body_scanconsole/proc/unlink_scanner(var/obj/machinery/bodyscanner/scanner)
/obj/machinery/body_scanconsole/proc/unlink_scanner(var/obj/machinery/bodyscanner/scanner)
events_repository.unregister(/decl/observ/destroyed, scanner, src, .proc/unlink_scanner)
connected = null

/obj/machinery/body_scanconsole/proc/FindDisplays()
for(var/obj/machinery/body_scan_display/D in SSmachines.machinery)
if(D.tag in display_tags)
// TODO: Convert to use networking
if(D.id_tag in display_tags)
connected_displays += D
events_repository.register(/decl/observ/destroyed, D, src, .proc/remove_display)
return !!connected_displays.len
Expand Down Expand Up @@ -97,7 +98,7 @@
data["html_scan_header"] = display_medical_data_header(data["scan"], user.get_skill_value(SKILL_MEDICAL))
data["html_scan_health"] = display_medical_data_health(data["scan"], user.get_skill_value(SKILL_MEDICAL))
data["html_scan_body"] = display_medical_data_body(data["scan"], user.get_skill_value(SKILL_MEDICAL))

stored_scan_subject = connected.occupant
user.visible_message("<span class='notice'>\The [user] performs a scan of \the [connected.occupant] using \the [connected].</span>")
playsound(connected.loc, 'sound/machines/medbayscanner.ogg', 50)
Expand All @@ -111,7 +112,7 @@
new /obj/item/paper/bodyscan(loc, "Printout error.", "Body scan report - [stored_scan_subject]", scan.Copy())
return TOPIC_REFRESH

if(href_list["push"])
if(href_list["push"])
if(!connected_displays.len && !FindDisplays())
to_chat(user, "[html_icon(src)]<span class='warning'>Error: No configured displays detected.</span>")
return TOPIC_REFRESH
Expand Down
22 changes: 13 additions & 9 deletions code/modules/fabrication/_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,19 @@
if(length(installed_designs))
design_cache |= installed_designs

if(!known_tech)
known_tech = get_default_initial_tech_levels()
var/datum/extension/network_device/device = get_extension(src, /datum/extension/network_device)
var/datum/computer_network/network = device.get_network()
if(network)
for(var/obj/machinery/design_database/db in network.get_devices_by_type(/obj/machinery/design_database))
for(var/tech in db.tech_levels)
if(db.tech_levels[tech] > known_tech[tech])
known_tech[tech] = db.tech_levels[tech]
// This is necessary to prevent database consoles from overwriting the default tech levels.
var/list/default_tech = get_default_initial_tech_levels()
LAZYINITLIST(known_tech)
for(var/tech_key in known_tech)
known_tech[tech_key] = max(default_tech[tech_key], known_tech[tech_key])

var/datum/extension/network_device/device = get_extension(src, /datum/extension/network_device)
var/datum/computer_network/network = device.get_network()
if(network)
for(var/obj/machinery/design_database/db in network.get_devices_by_type(/obj/machinery/design_database))
for(var/tech in db.tech_levels)
if(db.tech_levels[tech] > known_tech[tech])
known_tech[tech] = db.tech_levels[tech]

var/list/unlocked_tech = SSfabrication.get_unlocked_recipes(fabricator_class, known_tech)
if(length(unlocked_tech))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/materials/recipes_furniture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
if(.)
for(var/obj/structure/window/check_window in user.loc)
if(check_window.is_fulltile())
to_chat(user, "<span class='warning'>There is already a fll-tile window here!</span>")
to_chat(user, SPAN_WARNING("There is already a full-tile window here!"))
return FALSE

/datum/stack_recipe/furniture/fullwindow/spawn_result(mob/user, location, amount)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mechs/mech.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
status_flags = PASSEMOTES
a_intent = I_HURT
mob_size = MOB_SIZE_LARGE
atom_flags = ATOM_FLAG_SHIELD_CONTENTS | ATOM_FLAG_NO_TEMP_CHANGE
atom_flags = ATOM_FLAG_SHIELD_CONTENTS | ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_BLOCK_DIAGONAL_FACING

meat_type = null
meat_amount = 0
Expand Down
1 change: 1 addition & 0 deletions code/modules/overmap/ftl_shunt/_shunt.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define CHARGE_TIME_PER_TON 0.1 //In deciseconds.
#define JOULES_PER_TON 5000
#define REQUIRED_CHARGE_MULTIPLIER 0.005
#define JUMP_TIME_PER_TILE 20 SECONDS

#define FTL_START_FAILURE_FUEL 1 //Not enough fuel.
#define FTL_START_FAILURE_POWER 2 //Not enough power.
Expand Down
13 changes: 5 additions & 8 deletions code/modules/overmap/ftl_shunt/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
if(!istype(sector))
return INFINITY
var/jump_dist = get_dist(linked, locate(linked_core.shunt_x, linked_core.shunt_y, sector.z))
var/jump_cost = ((linked.vessel_mass * JOULES_PER_TON) / 1000) * jump_dist
return jump_cost
return jump_dist

/obj/machinery/computer/ship/ftl/proc/recalc_cost_power()
if(!linked_core)
Expand All @@ -41,8 +40,7 @@
return INFINITY

var/jump_dist = get_dist(linked, locate(linked_core.shunt_x, linked_core.shunt_y, sector.z))
var/jump_cost = ((linked.vessel_mass * JOULES_PER_TON) / 1000) * jump_dist
var/jump_cost_power = jump_cost * REQUIRED_CHARGE_MULTIPLIER
var/jump_cost_power = ((jump_dist * linked.vessel_mass)* REQUIRED_CHARGE_MULTIPLIER)*1000
return jump_cost_power

/obj/machinery/computer/ship/ftl/proc/get_status()
Expand Down Expand Up @@ -123,13 +121,12 @@
data["shunt_y"] = linked_core.shunt_y
data["to_plot_x"] = to_plot_x
data["to_plot_y"] = to_plot_y
data["fuel_joules"] = (linked_core.get_fuel(linked_core.fuel_ports) / 1000)
data["fuel_conversion"] = linked_core.get_total_fuel_conversion_rate()
data["fuel_joules"] = linked_core.get_charges() || 0
data["jumpcost"] = recalc_cost()
data["powercost"] = recalc_cost_power()
data["powercost"] = recalc_cost_power()/1000
data["chargetime"] = linked_core.get_charge_time()
data["chargepercent"] = linked_core.chargepercent
data["maxfuel"] = linked_core.get_fuel_maximum(linked_core.fuel_ports)
data["maxfuel"] = linked_core.get_max_charges()
data["jump_status"] = get_status()
data["power_input"] = linked_core.allowed_power_usage / 1000
data["max_power"] = linked_core.max_power_usage / 1000
Expand Down
Loading

0 comments on commit 5b0100a

Please sign in to comment.