Skip to content

Commit

Permalink
Merge branch 'pr/37' into merge-conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
800maximum123 committed Jun 26, 2024
2 parents d223048 + 31e8f74 commit 050febb
Show file tree
Hide file tree
Showing 231 changed files with 375,540 additions and 15,402 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3333,6 +3333,7 @@
#include "mods\_master_files\code\game\world.dm"
#include "mods\_master_files\code\game\gamemodes\ert.dm"
#include "mods\_master_files\code\game\objects\effects\decals\contraband.dm"
#include "mods\_master_files\code\game\objects\structures\signs.dm"
#include "mods\_master_files\code\game\objects\structures\crates_lockers\closets\_closet_appearance_definitions.dm"
#include "mods\_master_files\code\modules\client\asset_cache.dm"
#include "mods\_master_files\code\modules\client\preferences_persist.dm"
Expand Down
14 changes: 14 additions & 0 deletions code/__defines/health.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,17 @@
#define DAMAGE_FLAG_DISPERSED FLAG(7)
/// Toxin damage that should be mitigated by biological (i.e. sterile) armor
#define DAMAGE_FLAG_BIO FLAG(8)


/// Health Status flags for `/atom/var/health_status`.
/// The atom is currently dead.
#define HEALTH_STATUS_DEAD FLAG(0)
/// The atom is currently broken. An atom is `broken` if `HEALTH_FLAG_BREAKABLE` is set and the atom's health falls below 1/2 of `health_max`. Used for certain atoms that needed an additional damage state.
#define HEALTH_STATUS_BROKEN FLAG(1)


/// Health Flags for `/atom/var/health_flags`.
/// The atom is 'breakable', and considered broken upon reaching 1/2 health.
#define HEALTH_FLAG_BREAKABLE FLAG(0)
/// The atom should be treated as a structure for damage calculations.
#define HEALTH_FLAG_STRUCTURE FLAG(1)
36 changes: 18 additions & 18 deletions code/__defines/items_clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@
#define SLOT_TIE FLAG(14)
#define SLOT_HOLSTER FLAG(15)

#define ACCESSORY_SLOT_UTILITY "Utility"
#define ACCESSORY_SLOT_HOLSTER "Holster"
#define ACCESSORY_SLOT_ARMBAND "Armband"
#define ACCESSORY_SLOT_RANK "Rank"
#define ACCESSORY_SLOT_DEPT "Department"
#define ACCESSORY_SLOT_DECOR "Decor"
#define ACCESSORY_SLOT_MEDAL "Medal"
#define ACCESSORY_SLOT_INSIGNIA "Insignia"
#define ACCESSORY_SLOT_ARMOR_C "Chest armor"
#define ACCESSORY_SLOT_ARMOR_A "Arm armor"
#define ACCESSORY_SLOT_ARMOR_L "Leg armor"
#define ACCESSORY_SLOT_ARMOR_S "Armor storage"
#define ACCESSORY_SLOT_ARMOR_M "Misc armor"
#define ACCESSORY_SLOT_HELM_C "Helmet cover"
#define ACCESSORY_SLOT_HELM_D "Helmet decor"
#define ACCESSORY_SLOT_VISOR "Helmet visor"
#define ACCESSORY_SLOT_VISION "Vision modification"
#define ACCESSORY_SLOT_HUD "HUD modification"
#define ACCESSORY_SLOT_UTILITY "CU"
#define ACCESSORY_SLOT_HOLSTER "CH"
#define ACCESSORY_SLOT_ARMBAND "CA"
#define ACCESSORY_SLOT_RANK "CR"
#define ACCESSORY_SLOT_FLASH "CF"
#define ACCESSORY_SLOT_DECOR "CD"
#define ACCESSORY_SLOT_MEDAL "CM"
#define ACCESSORY_SLOT_INSIGNIA "CI"
#define ACCESSORY_SLOT_ARMOR_CHEST "AC"
#define ACCESSORY_SLOT_ARMOR_ARMS "AA"
#define ACCESSORY_SLOT_ARMOR_LEGS "AL"
#define ACCESSORY_SLOT_ARMOR_STORAGE "AS"
#define ACCESSORY_SLOT_ARMOR_MISC "AM"
#define ACCESSORY_SLOT_HELMET_COVER "HC"
#define ACCESSORY_SLOT_HELMET_DECOR "HD"
#define ACCESSORY_SLOT_HELMET_VISOR "HV"
#define ACCESSORY_SLOT_GLASSES_VISION "GV"
#define ACCESSORY_SLOT_GLASSES_HUD "GH"

#define ACCESSORY_REMOVABLE FLAG(0)
#define ACCESSORY_HIDDEN FLAG(1)
Expand Down
9 changes: 9 additions & 0 deletions code/__defines/~mods/~master_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@

// DON_LOADOUT - End

// GUNS - Start
#define GUN_BULK_PISTOL 1
#define GUN_BULK_REVOLVER 2
#define GUN_BULK_SMG 3
#define GUN_BULK_CARABINE 4
#define GUN_BULK_SNIPER_RIFLE 6
#define GUN_BULK_MACHINEGUN 7
// GUNS - End

// GLIDING - Start
#define DELAY2GLIDESIZE(delay) (world.icon_size / max(ceil(delay / world.tick_lag), 1))
// GLIDING - End
Expand Down
33 changes: 27 additions & 6 deletions code/_onclick/hud/movable_screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,21 @@

/obj/screen/movable/proc/encode_screen_X(X, mob/viewer)
var/view = viewer.client ? viewer.client.view : world.view
if(X > view+1)
. = "EAST-[view*2 + 1-X]"
else if(X < view+1)
// [SIERRA-EDIT]
// if(X > view+1) // SIERA-EDIT - ORIGINAL
// . = "EAST-[view*2 + 1-X]" // SIERA-EDIT - ORIGINAL
// else if(X < view+1) // SIERA-EDIT - ORIGINAL
var/local_view
if(view == "19x15")
local_view = 9
else if(view == "17x15")
local_view = 8
else if(view == "15x15")
local_view = 7
// [/SIERRA-EDIT]
if(X > local_view+1)
. = "EAST-[local_view*2 + 1-X]"
else if(X < local_view+1)
. = "WEST+[X-1]"
else
. = "CENTER"
Expand All @@ -71,9 +83,18 @@

/obj/screen/movable/proc/encode_screen_Y(Y, mob/viewer)
var/view = viewer.client ? viewer.client.view : world.view
if(Y > view+1)
. = "NORTH-[view*2 + 1-Y]"
else if(Y < viewer.client.view+1)
// [SIERRA-EDIT]
// if(Y > view+1) // SIERA-EDIT - ORIGINAL
// . = "NORTH-[view*2 + 1-Y]" // SIERA-EDIT - ORIGINAL
// else if(Y < viewer.client.view+1) // SIERA-EDIT - ORIGINAL
var/local_view
if(view == "19x15" || view == "17x15" || view == "15x15")
local_view = 7
// [/SIERRA-EDIT]
if(Y > local_view+1)

. = "NORTH-[local_view*2 + 1-Y]"
else if(Y < local_view+1)
. = "SOUTH+[Y-1]"
else
. = "CENTER"
Expand Down
24 changes: 12 additions & 12 deletions code/_onclick/hud/radial.dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#define NEXT_PAGE_ID "__next__"
#define DEFAULT_CHECK_DELAY 20

var/global/list/radial_menus = list()

/obj/screen/radial/Destroy()
parent = null
return ..()
GLOBAL_LIST_EMPTY(radial_menus)

/obj/screen/radial
icon = 'icons/screen/radial.dmi'
layer = HUD_ABOVE_ITEM_LAYER
plane = HUD_PLANE
var/datum/radial_menu/parent

/obj/screen/radial/Destroy()
parent = null
return ..()

/obj/screen/radial/slice
icon_state = "radial_slice"
var/choice
Expand Down Expand Up @@ -55,6 +52,9 @@ var/global/list/radial_menus = list()
parent.finished = TRUE

/datum/radial_menu
var/const/NEXT_PAGE_ID = "__next__"
var/const/DEFAULT_CHECK_DELAY = 2 SECONDS

var/list/choices = list() //List of choice id's
var/list/choices_icons = list() //choice_id -> icon
var/list/choices_values = list() //choice_id -> choice
Expand Down Expand Up @@ -316,14 +316,14 @@ var/global/list/radial_menus = list()
for(var/atom/thing in check_locs)
check_locs[thing] = thing.loc

if(global.radial_menus[uniqueid])
if(GLOB.radial_menus[uniqueid])
if(!no_repeat_close)
var/datum/radial_menu/menu = global.radial_menus[uniqueid]
var/datum/radial_menu/menu = GLOB.radial_menus[uniqueid]
menu.finished = TRUE
return

var/datum/radial_menu/menu = new
global.radial_menus[uniqueid] = menu
GLOB.radial_menus[uniqueid] = menu
if(radius)
menu.radius = radius
if(istype(custom_check))
Expand All @@ -335,7 +335,7 @@ var/global/list/radial_menus = list()
menu.wait(user, anchor, require_near, check_locs)
var/answer = menu.selected_choice
qdel(menu)
global.radial_menus -= uniqueid
GLOB.radial_menus -= uniqueid
return answer

#define RADIAL_INPUT(user, choices) show_radial_menu(user, user, choices)
Expand Down
6 changes: 3 additions & 3 deletions code/_onclick/hud/radial_persistent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

/datum/radial_menu/persistent/Destroy()
QDEL_NULL(select_proc_callback)
global.radial_menus -= uniqueid
GLOB.radial_menus -= uniqueid
Reset()
hide()
return ..()
Expand All @@ -55,12 +55,12 @@
if(!uniqueid)
uniqueid = "defmenu_\ref[user]_\ref[anchor]"

if(global.radial_menus[uniqueid])
if(GLOB.radial_menus[uniqueid])
return

var/datum/radial_menu/persistent/menu = new
menu.uniqueid = uniqueid
global.radial_menus[uniqueid] = menu
GLOB.radial_menus[uniqueid] = menu
if(radius)
menu.radius = radius
menu.select_proc_callback = select_proc
Expand Down
8 changes: 8 additions & 0 deletions code/datums/outfits/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,11 @@
id_types = list(/obj/item/card/id/syndicate)
id_pda_assignment = "Scavenger"
flags = OUTFIT_HAS_BACKPACK|OUTFIT_RESET_EQUIPMENT


/singleton/hierarchy/outfit/anomalist
name = "Anomalist"
uniform = /obj/item/clothing/under/color/white
shoes = /obj/item/clothing/shoes/white
suit = /obj/item/clothing/suit/bio_suit/anomaly
head = /obj/item/clothing/head/bio_hood/anomaly
2 changes: 1 addition & 1 deletion code/datums/supplypacks/nonessent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@



// [SIERRA-REMOVE] - MECHS_BY_SHEGAR - (Не нужны, т.к все эти типы камуфляжей есть в новом камуфляторы)
// [SIERRA-REMOVE] - Mechs_by_shegar - (Не нужны, т.к все эти типы камуфляжей есть в новом камуфляторы)
/*
/singleton/hierarchy/supply_pack/nonessent/exosuit_mod
Expand Down
3 changes: 1 addition & 2 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@

if (health_max)
health_current = health_max
health_dead = FALSE

return INITIALIZE_HINT_NORMAL

Expand Down Expand Up @@ -303,7 +302,7 @@
. = 0
if (get_max_health())
var/damage = P.damage
if (istype(src, /obj/structure) || istype(src, /turf/simulated/wall) || istype(src, /obj/machinery)) // TODO Better conditions for non-structures that want to use structure damage
if (GET_FLAGS(health_flags, HEALTH_FLAG_STRUCTURE))
damage = P.get_structure_damage()
if (!can_damage_health(damage, P.damage_type, P.damage_flags))
return
Expand Down
55 changes: 48 additions & 7 deletions code/game/atoms_health.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
/// Maximum health for simple health processing. Use `get_max_health()` or `set_max_health()` to reference/modify.
/atom/var/health_max

/// Boolean. Whether or not the atom is dead. Toggled by death state changes in standardized health and provided as a simple way to check for death without additional proc call overhead from `is_alive()`.
/atom/var/health_dead
/// Bitflag (Any of `HEALTH_STATUS_*`). Various health-related status flags for the atom. See `code\__defines\health.dm` for details.
/atom/var/health_status = EMPTY_BITFIELD

/// Bitflag (Any of `HEALTH_FLAG_*`). Various health-related config flags for the atom. See `code\__defines\health.dm` for details.
/atom/var/health_flags = EMPTY_BITFIELD

/**
* LAZY List of damage type resistance or weakness multipliers, decimal form. Only applied to health reduction. Use `set_damage_resistance()`, `remove_damage_resistance()`, and `get_damage_resistance()` to reference/modify.
Expand Down Expand Up @@ -48,9 +51,20 @@

/**
* Whether or not the atom is currently dead.
*
* Returns boolean.
*/
/atom/proc/health_dead()
return health_dead
return HAS_FLAGS(health_status, HEALTH_STATUS_DEAD)


/**
* Whether or not the atom is currently broken. Does not consider death as broken, to minimize on recursive proc calls.
*
* Returns boolean.
*/
/atom/proc/health_broken()
return HAS_FLAGS(health_status, HEALTH_STATUS_BROKEN)


/**
Expand Down Expand Up @@ -111,15 +125,34 @@
return FALSE
health_mod = round(health_mod)
var/prior_health = get_current_health()
var/death_state = health_dead
var/death_state = health_dead()
var/broken_state = health_broken()

health_current = round(clamp(health_current + health_mod, 0, get_max_health()))
post_health_change(health_mod, prior_health, damage_type)

if (HAS_FLAGS(health_flags, HEALTH_FLAG_BREAKABLE))
var/new_broken_state = health_current > floor(health_max / 2) ? FALSE : TRUE
if (new_broken_state != broken_state)
if (new_broken_state)
SET_FLAGS(health_status, HEALTH_STATUS_BROKEN)
else
CLEAR_FLAGS(health_status, HEALTH_STATUS_BROKEN)
if (!skip_death_state_change)
if (new_broken_state)
on_broken()
else
on_unbroken()

var/new_death_state = health_current > 0 ? FALSE : TRUE
if (death_state == new_death_state)
return FALSE
health_dead = new_death_state
if (new_death_state)
SET_FLAGS(health_status, HEALTH_STATUS_DEAD)
else
CLEAR_FLAGS(health_status, HEALTH_STATUS_DEAD)
if (!skip_death_state_change)
if (health_dead)
if (new_death_state)
on_death()
else
on_revive()
Expand Down Expand Up @@ -192,6 +225,14 @@
/atom/proc/on_revive()
return

/// Proc called when the atom transitions from unbroken to broken. Only used if `HEALTH_FLAG_BREAKABLE` is set.
/atom/proc/on_broken()
return

/// Proc called when the atom transitions from broken to unbroken. Only used if `HEALTH_FLAG_BREAKABLE` is set.
/atom/proc/on_unbroken()
return

/**
* Sets the atoms maximum health to the new value.
* If `set_current_health` is `TRUE`, also sets the current health to the new value.
Expand Down Expand Up @@ -292,4 +333,4 @@
target_atom.health_max = source_atom.health_max
target_atom.health_resistances = source_atom.health_resistances
target_atom.health_min_damage = source_atom.health_min_damage
target_atom.health_dead = source_atom.health_dead
target_atom.health_status = source_atom.health_status
10 changes: 9 additions & 1 deletion code/game/jobs/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,15 @@ var/global/list/priv_region_access
priv_region_access["[A.region]"] += A.id

var/list/region = priv_region_access["[code]"]
return region.Copy()
//[SIERRA-EDIT]
//Позволяет избавиться от рантайма.
//return region.Copy()

if(region)
return region.Copy()
else
return
//[SIERRA-EDIT]

/proc/get_region_accesses_name(code)
switch(code)
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/_machines_base/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
throw_range = 5

health_resistances = DAMAGE_RESIST_ELECTRICAL
health_flags = HEALTH_FLAG_STRUCTURE

/// Boolean. Whether or not the machine has been emagged.
var/emagged = FALSE
Expand Down
11 changes: 11 additions & 0 deletions code/game/machinery/cell_charger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@
power_channel = EQUIP
var/obj/item/cell/charging = null
var/chargelevel = -1
construct_state = /singleton/machine_construction/default/panel_closed
uncreated_component_parts = null
//Sierra add
/obj/machinery/cell_charger/Initialize()
. = ..()
RefreshParts()

/obj/machinery/cell_charger/RefreshParts()
for(var/obj/item/stock_parts/SP in component_parts)
if(istype(SP, /obj/item/stock_parts/capacitor))
active_power_usage *= SP.rating
// Sierra add-end
/obj/machinery/cell_charger/on_update_icon()
icon_state = "ccharger[charging ? 1 : 0]"
if(charging && operable())
Expand Down
Loading

0 comments on commit 050febb

Please sign in to comment.