diff --git a/code/__DEFINES/__513_compatibility.dm b/code/__DEFINES/__513_compatibility.dm new file mode 100644 index 0000000000..12577fb68b --- /dev/null +++ b/code/__DEFINES/__513_compatibility.dm @@ -0,0 +1,32 @@ + +#if DM_VERSION < 513 + +#define ismovableatom(A) (istype(A, /atom/movable)) + +#define islist(L) (istype(L, /list)) + +#define CLAMP01(x) (CLAMP(x, 0, 1)) + +#define CLAMP(CLVALUE,CLMIN,CLMAX) ( max( (CLMIN), min((CLVALUE), (CLMAX)) ) ) + +#define ATAN2(x, y) ( !(x) && !(y) ? 0 : (y) >= 0 ? arccos((x) / sqrt((x)*(x) + (y)*(y))) : -arccos((x) / sqrt((x)*(x) + (y)*(y))) ) + +#define TAN(x) (sin(x) / cos(x)) + +#define arctan(x) (arcsin(x/sqrt(1+x*x))) + +////////////////////////////////////////////////// + +#else + +#define ismovableatom(A) ismovable(A) + +#define CLAMP01(x) clamp(x, 0, 1) + +#define CLAMP(CLVALUE, CLMIN, CLMAX) clamp(CLVALUE, CLMIN, CLMAX) + +#define TAN(x) tan(x) + +#define ATAN2(x, y) arctan(x, y) + +#endif diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 9f69da0154..0dee8bd1e8 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -1,11 +1,7 @@ // simple is_type and similar inline helpers -#define islist(L) (istype(L, /list)) - #define in_range(source, user) (get_dist(source, user) <= 1 && (get_step(source, 0)?:z) == (get_step(user, 0)?:z)) -#define ismovableatom(A) (istype(A, /atom/movable)) - #define isatom(A) (isloc(A)) #define isweakref(D) (istype(D, /datum/weakref)) @@ -246,4 +242,4 @@ GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list( #define isblobmonster(O) (istype(O, /mob/living/simple_animal/hostile/blob)) -#define isshuttleturf(T) (length(T.baseturfs) && (/turf/baseturf_skipover/shuttle in T.baseturfs)) +#define isshuttleturf(T) (length(T.baseturfs) && (/turf/baseturf_skipover/shuttle in T.baseturfs)) \ No newline at end of file diff --git a/code/__DEFINES/maths.dm b/code/__DEFINES/maths.dm index 5bce51293f..ad93dd2d54 100644 --- a/code/__DEFINES/maths.dm +++ b/code/__DEFINES/maths.dm @@ -16,7 +16,6 @@ #define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(TICK_USAGE_REAL - starting_tickusage)) #define PERCENT(val) (round((val)*100, 0.1)) -#define CLAMP01(x) (CLAMP(x, 0, 1)) //time of day but automatically adjusts to the server going into the next day within the same round. //for when you need a reliable time number that doesn't depend on byond time. @@ -30,17 +29,12 @@ // round() acts like floor(x, 1) by default but can't handle other values #define FLOOR(x, y) ( round((x) / (y)) * (y) ) -#define CLAMP(CLVALUE,CLMIN,CLMAX) ( max( (CLMIN), min((CLVALUE), (CLMAX)) ) ) - // Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive #define WRAP(val, min, max) ( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) ) // Real modulus that handles decimals #define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) ) -// Tangent -#define TAN(x) (sin(x) / cos(x)) - // Cotangent #define COT(x) (1 / TAN(x)) @@ -50,8 +44,6 @@ // Cosecant #define CSC(x) (1 / sin(x)) -#define ATAN2(x, y) ( !(x) && !(y) ? 0 : (y) >= 0 ? arccos((x) / sqrt((x)*(x) + (y)*(y))) : -arccos((x) / sqrt((x)*(x) + (y)*(y))) ) - // Greatest Common Divisor - Euclid's algorithm /proc/Gcd(a, b) return b ? Gcd(b, (a) % (b)) : a @@ -207,4 +199,4 @@ #define LORENTZ_CUMULATIVE_DISTRIBUTION(x, y, s) ( (1/PI)*TORADIANS(arctan((x-y)/s)) + 1/2 ) #define RULE_OF_THREE(a, b, x) ((a*x)/b) -// ) +// ) \ No newline at end of file diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index fed283adcd..38b779427c 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -514,7 +514,7 @@ used_key_list[input_key] = 1 return input_key -#if DM_VERSION > 512 +#if DM_VERSION > 513 #error Remie said that lummox was adding a way to get a lists #error contents via list.values, if that is true remove this #error otherwise, update the version and bug lummox @@ -564,4 +564,4 @@ if(key in L1) L1[key] += other_value else - L1[key] = other_value + L1[key] = other_value \ No newline at end of file diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index ce294f3749..27b70d28c5 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -451,10 +451,6 @@ Turf and target are separate in case you want to teleport some distance from a t var/y = min(world.maxy, max(1, A.y + dy)) return locate(x,y,A.z) -/proc/arctan(x) - var/y=arcsin(x/sqrt(1+x*x)) - return y - /* Gets all contents of contents and returns them all in a list. */ diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index 9f6ca0ffbb..a92ae9e629 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -57,6 +57,10 @@ var/screen_start_x = 4 //These two are where the storage starts being rendered, screen_loc wise. var/screen_start_y = 2 //End + + var/limited_random_access = FALSE //Quick if statement in accessible_items to determine if we care at all about what people can access at once. + var/limited_random_access_stack_position = 0 //If >0, can only access top items + var/limited_random_access_stack_bottom_up = FALSE //If TRUE, above becomes bottom items /datum/component/storage/Initialize(datum/component/storage/concrete/master) if(!isatom(parent)) @@ -146,6 +150,19 @@ var/datum/component/storage/concrete/master = master() return master? master.real_location() : null +//What players can access +//this proc can probably eat a refactor at some point. +/datum/component/storage/proc/accessible_items(random_access = TRUE) + var/list/contents = contents() + if(contents) + if(limited_random_access && random_access) + if(limited_random_access_stack_position && (length(contents) > limited_random_access_stack_position)) + if(limited_random_access_stack_bottom_up) + contents.Cut(1, limited_random_access_stack_position + 1) + else + contents.Cut(1, length(contents) - limited_random_access_stack_position + 1) + return contents + /datum/component/storage/proc/canreach_react(datum/source, list/next) var/datum/component/storage/concrete/master = master() if(!master) @@ -284,8 +301,7 @@ /datum/component/storage/proc/_process_numerical_display() . = list() - var/atom/real_location = real_location() - for(var/obj/item/I in real_location.contents) + for(var/obj/item/I in accessible_items()) if(QDELETED(I)) continue if(!.[I.type]) @@ -296,8 +312,8 @@ //This proc determines the size of the inventory to be displayed. Please touch it only if you know what you're doing. /datum/component/storage/proc/orient2hud(mob/user, maxcolumns) - var/atom/real_location = real_location() - var/adjusted_contents = real_location.contents.len + var/list/accessible_contents = accessible_items() + var/adjusted_contents = length(accessible_contents) //Numbered contents display var/list/datum/numbered_display/numbered_contents @@ -329,8 +345,7 @@ if(cy - screen_start_y >= rows) break else - var/atom/real_location = real_location() - for(var/obj/O in real_location) + for(var/obj/O in accessible_items()) if(QDELETED(O)) continue O.mouse_opacity = MOUSE_OPACITY_OPAQUE //This is here so storage items that spawn with contents correctly have the "click around item to equip" @@ -351,9 +366,8 @@ return FALSE var/list/cview = getviewsize(M.client.view) var/maxallowedscreensize = cview[1]-8 - var/atom/real_location = real_location() if(M.active_storage != src && (M.stat == CONSCIOUS)) - for(var/obj/item/I in real_location) + for(var/obj/item/I in accessible_items()) if(I.on_found(M)) return FALSE if(M.active_storage) @@ -361,7 +375,7 @@ orient2hud(M, (isliving(M) ? maxallowedscreensize : 7)) M.client.screen |= boxes M.client.screen |= closer - M.client.screen |= real_location.contents + M.client.screen |= accessible_items() M.active_storage = src LAZYOR(is_using, M) return TRUE diff --git a/code/game/objects/items/storage/bags.dm b/code/game/objects/items/storage/bags.dm index 13efe72686..eafa79798e 100644 --- a/code/game/objects/items/storage/bags.dm +++ b/code/game/objects/items/storage/bags.dm @@ -49,6 +49,8 @@ STR.max_combined_w_class = 30 STR.max_items = 30 STR.cant_hold = typecacheof(list(/obj/item/disk/nuclear)) + STR.limited_random_access = TRUE + STR.limited_random_access_stack_position = 3 /obj/item/storage/bag/trash/suicide_act(mob/user) user.visible_message("[user] puts [src] over [user.p_their()] head and starts chomping at the insides! Disgusting!") @@ -88,6 +90,7 @@ var/datum/component/storage/STR = GetComponent(/datum/component/storage) STR.max_combined_w_class = 60 STR.max_items = 60 + STR.limited_random_access_stack_position = 5 /obj/item/storage/bag/trash/bluespace/cyborg insertable = FALSE diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index f6a35b88f0..6e21a399ec 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -5,7 +5,6 @@ icon_state = "hardsuit0-engineering" item_state = "eng_helm" max_integrity = 300 - clothing_flags = SNUG_FIT armor = list("melee" = 10, "bullet" = 5, "laser" = 10, "energy" = 5, "bomb" = 10, "bio" = 100, "rad" = 75, "fire" = 50, "acid" = 75) var/basestate = "hardsuit" var/brightness_on = 4 //luminosity when on diff --git a/code/modules/holiday/halloween/bartholomew.dm b/code/modules/holiday/halloween/bartholomew.dm index 4911082049..aa119dca84 100644 --- a/code/modules/holiday/halloween/bartholomew.dm +++ b/code/modules/holiday/halloween/bartholomew.dm @@ -77,7 +77,6 @@ /obj/item/clothing/head/welding = 1, /obj/item/clothing/mask/gas = 10, /obj/item/clothing/suit/hazardvest = 1, - /obj/item/clothing/under/rank/vice = 1, /obj/item/clothing/suit/hooded/flashsuit = 1, /obj/item/assembly/prox_sensor = 4, /obj/item/assembly/timer = 3, @@ -95,22 +94,20 @@ /obj/item/stack/sheet/metal = 1, /obj/item/stack/sheet/mineral/plasma = 1, /obj/item/stack/sheet/rglass = 1, - /obj/item/clothing/head/cone = 1, - /obj/item/coin = 2, - /obj/item/crowbar = 3, - /obj/item/crowbar/red = 1, + /obj/item/coin = 1, + /obj/item/crowbar = 4, /obj/item/extinguisher = 3, /obj/item/hand_labeler = 1, - /obj/item/paper = 4, - /obj/item/pen = 3, + /obj/item/paper = 6, + /obj/item/pen = 5, /obj/item/reagent_containers/spray/pestspray = 1, /obj/item/reagent_containers/rag = 3, /obj/item/stock_parts/cell = 3, /obj/item/storage/belt/utility = 2, /obj/item/storage/box = 4, - /obj/item/storage/box/cups = 1, + /obj/item/reagent_containers/food/drinks/sillycup = 1, /obj/item/storage/box/donkpockets = 1, - /obj/item/storage/box/lights/mixed = 3, + /obj/item/storage/box/lights/mixed = 1, /obj/item/storage/box/hug/medical = 1, /obj/item/storage/fancy/cigarettes = 1, /obj/item/storage/toolbox = 1, @@ -121,8 +118,6 @@ /obj/item/wirecutters = 2, /obj/item/wrench = 4, /obj/item/weaponcrafting/receiver = 1, - /obj/item/clothing/head/cone = 2, - /obj/item/grenade/smokebomb = 1, /obj/item/geiger_counter = 3, /obj/item/reagent_containers/food/snacks/grown/citrus/orange = 5, /obj/item/assembly/infra = 1, @@ -131,13 +126,13 @@ /obj/item/assembly/mousetrap = 5, /obj/item/reagent_containers/syringe = 5, /obj/item/clothing/gloves = 8, - /obj/item/clothing/shoes/laceup = 1, - /obj/item/storage/secure/briefcase = 3, - /obj/item/storage/toolbox/artistic = 2, - /obj/item/toy/eightball = 1, + /obj/item/storage/toolbox = 2, /obj/item/reagent_containers/pill = 2, - /obj/item/reagent_containers/food/snacks/cannedpeaches/maint = 1, - /obj/item/clothing/shoes = 8) + /obj/item/clothing/shoes = 8, + /obj/item/clothing/head = 3, + /obj/item/reagent_containers/food/snacks = 3, + /obj/item/reagent_containers/syringe/dart = 2, + /obj/item/reagent_containers/food/drinks/soda_cans = 5) if(length >= 5) return TRUE //var/metalist = pickweight(GLOB.maintenance_loot) diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm index 4cb83baf4b..ed9254c295 100644 --- a/code/modules/holiday/halloween/jacqueen.dm +++ b/code/modules/holiday/halloween/jacqueen.dm @@ -106,20 +106,25 @@ for(var/obj/machinery/holopad/hp in world) hp_list += hp - var/nono_areas = list("AI Chamber", "AI Satellite Antechamber", "AI Satellite Foyer") + var/nono_areas = list("AI ") - for(var/i = 0, i <= 5, i+=1) //Attempts a jump 6 times. + for(var/i = 0, i <= 6, i+=1) //Attempts a jump 6 times. var/obj/machinery/holopad/hp = pick(hp_list) if(forceMove(pick(hp.loc))) + var/jacq_please_no = FALSE for(var/no_area in nono_areas) var/turf/L1 = hp.loc if(!L1) //Incase the area isn't a turf (i.e. in a locker) continue var/area/L2 = L1.loc if(L2) - if(no_area == L2.name) - continue + if(findtext(L2.name, no_area)) + jacq_please_no = TRUE + + if(jacq_please_no) + i-=1 + continue //Try to go to populated areas var/list/seen = viewers(8, get_turf(src)) @@ -128,9 +133,6 @@ if(z == cached_z) return TRUE - if(z == cached_z)//same z level please, if no humans - return TRUE - return FALSE diff --git a/html/changelogs/AutoChangeLog-pr-9636.yml b/html/changelogs/AutoChangeLog-pr-9636.yml new file mode 100644 index 0000000000..986ece65bb --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-9636.yml @@ -0,0 +1,4 @@ +author: "Ghommie" +delete-after: True +changes: + - imageadd: "Updated gang dominator sprites." diff --git a/html/changelogs/AutoChangeLog-pr-9637.yml b/html/changelogs/AutoChangeLog-pr-9637.yml new file mode 100644 index 0000000000..29832a5d4b --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-9637.yml @@ -0,0 +1,4 @@ +author: "kevinz000" +delete-after: True +changes: + - code_imp: "BYOND 513 preliminary support added." diff --git a/html/changelogs/AutoChangeLog-pr-9641.yml b/html/changelogs/AutoChangeLog-pr-9641.yml new file mode 100644 index 0000000000..61a4521580 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-9641.yml @@ -0,0 +1,5 @@ +author: "kevinz000" +delete-after: True +changes: + - balance: "Trashbags now only allow accessing the first 3 items. 5 for bluespace ones. +experimental: Storage now allows for limiting of random access" diff --git a/html/changelogs/AutoChangeLog-pr-9649.yml b/html/changelogs/AutoChangeLog-pr-9649.yml new file mode 100644 index 0000000000..23bcf3e005 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-9649.yml @@ -0,0 +1,4 @@ +author: "Fermis" +delete-after: True +changes: + - bugfix: "fixed Jacq's fondness for the AI" diff --git a/icons/obj/machines/dominator.dmi b/icons/obj/machines/dominator.dmi index 42337dc1c8..3718fc4f83 100644 Binary files a/icons/obj/machines/dominator.dmi and b/icons/obj/machines/dominator.dmi differ diff --git a/modular_citadel/code/game/gamemodes/gangs/dominator.dm b/modular_citadel/code/game/gamemodes/gangs/dominator.dm index 4946cad510..c590baf62e 100644 --- a/modular_citadel/code/game/gamemodes/gangs/dominator.dm +++ b/modular_citadel/code/game/gamemodes/gangs/dominator.dm @@ -53,19 +53,17 @@ /obj/machinery/dominator/update_icon() cut_overlays() - if(!(stat & BROKEN)) - icon_state = "dominator-active" - if(operating) - var/mutable_appearance/dominator_overlay = mutable_appearance('icons/obj/machines/dominator.dmi', "dominator-overlay") - if(gang) - dominator_overlay.color = gang.color - add_overlay(dominator_overlay) - else - icon_state = "dominator" - if(obj_integrity/max_integrity < 0.66) - add_overlay("damage") - else + if(stat & BROKEN) icon_state = "dominator-broken" + return + icon_state = "dominator" + if(operating) + var/mutable_appearance/dominator_overlay = mutable_appearance('icons/obj/machines/dominator.dmi', "dominator-overlay") + if(gang) + dominator_overlay.color = gang.color + add_overlay(dominator_overlay) + if(obj_integrity/max_integrity < 0.66) + add_overlay("damage") /obj/machinery/dominator/examine(mob/user) ..() @@ -168,7 +166,7 @@ examine(user) return - if(tempgang.domination_time != NOT_DOMINATING) + if(tempgang.domination_time != NOT_DOMINATING) to_chat(user, "Error: Hostile Takeover is already in progress.") return diff --git a/tgstation.dme b/tgstation.dme index 31db79ce1f..a18113d9c9 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -16,6 +16,7 @@ #include "_maps\_basemap.dm" #include "code\_compile_options.dm" #include "code\world.dm" +#include "code\__DEFINES\__513_compatibility.dm" #include "code\__DEFINES\_globals.dm" #include "code\__DEFINES\_protect.dm" #include "code\__DEFINES\_tick.dm"