Skip to content

Commit

Permalink
Merge branch 'master' into block-conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed May 10, 2024
2 parents e337317 + 1f79350 commit 1b55bef
Show file tree
Hide file tree
Showing 94 changed files with 597 additions and 394 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/_math.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define ROUND_UP(x) ( -round(-(x)))

// round() acts like floor(x, 1) by default but can't handle other values
#define FLOOR(x, y) ( round((x) / (y)) * (y) )
#define FLOOR(x, y) ( floor((x) / (y)) * (y) )

// Real modulus that handles decimals
#define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) )
Expand Down
3 changes: 1 addition & 2 deletions code/__HELPERS/#maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
#define Csc(x) (1 / sin(x))

#define Default(a, b) ((a) ? (a) : (b))
#define Floor(x) (round(x))

// Greatest Common Divisor - Euclid's algorithm
#define Gcd(a, b) ((b) ? Gcd((b), (a) % (b)) : (a))

#define Inverse(x) (1 / (x))
#define IsEven(x) ((x) % 2 == 0)

#define IsInteger(x) (Floor(x) == (x))
#define IsInteger(x) (floor(x) == (x))
#define IsOdd(x) (!IsEven(x))
#define IsMultiple(x, y) ((x) % (y) == 0)

Expand Down
6 changes: 3 additions & 3 deletions code/__HELPERS/_time.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0)
return "right now"
if(second < 60)
return "[second] second[(second != 1)? "s":""]"
var/minute = Floor(second / 60)
var/minute = floor(second / 60)
second = FLOOR(MODULUS(second, 60), round_seconds_to)
var/secondT
if(second)
secondT = " and [second] second[(second != 1)? "s":""]"
if(minute < 60)
return "[minute] minute[(minute != 1)? "s":""][secondT]"
var/hour = Floor(minute / 60)
var/hour = floor(minute / 60)
minute = MODULUS(minute, 60)
var/minuteT
if(minute)
minuteT = " and [minute] minute[(minute != 1)? "s":""]"
if(hour < 24)
return "[hour] hour[(hour != 1)? "s":""][minuteT][secondT]"
var/day = Floor(hour / 24)
var/day = floor(hour / 24)
hour = MODULUS(hour, 24)
var/hourT
if(hour)
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@
if(L.len <= 1)
return L

var/middle = Floor(L.len / 2)
var/middle = floor(L.len / 2)
var/list/left = custom_mergesort(L.Copy(1, middle + 1))
var/list/right = custom_mergesort(L.Copy(middle + 1))
var/list/result = list()
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/subsystem/minimap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ SUBSYSTEM_DEF(minimaps)
else if(yval < smallest_y)
smallest_y = yval

minimaps_by_z["[level]"].x_offset = Floor((SCREEN_PIXEL_SIZE-largest_x-smallest_x) / MINIMAP_SCALE)
minimaps_by_z["[level]"].y_offset = Floor((SCREEN_PIXEL_SIZE-largest_y-smallest_y) / MINIMAP_SCALE)
minimaps_by_z["[level]"].x_offset = floor((SCREEN_PIXEL_SIZE-largest_x-smallest_x) / MINIMAP_SCALE)
minimaps_by_z["[level]"].y_offset = floor((SCREEN_PIXEL_SIZE-largest_y-smallest_y) / MINIMAP_SCALE)

icon_gen.Shift(EAST, minimaps_by_z["[level]"].x_offset)
icon_gen.Shift(NORTH, minimaps_by_z["[level]"].y_offset)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/entities/player_times.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ BSQL_PROTECT_DATUM(/datum/entity/player_time)
return list(
"job" = role_id,
"playtime" = round(total_minutes MINUTES_TO_HOURS, 0.1),
"bgcolor" = "rgb(0, [Floor(128 * playtime_percentage)], [Floor(255 * playtime_percentage)])",
"bgcolor" = "rgb(0, [floor(128 * playtime_percentage)], [floor(255 * playtime_percentage)])",
"textcolor" = "#FFFFFF",
"icondisplay" = icon_display
)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Additional game mode variables.

if(pred_candidate) pred_candidate.moveToNullspace() //Nullspace it for garbage collection later.

#define calculate_pred_max (Floor(length(GLOB.player_list) / pred_per_players) + pred_additional_max + pred_start_count)
#define calculate_pred_max (floor(length(GLOB.player_list) / pred_per_players) + pred_additional_max + pred_start_count)

/datum/game_mode/proc/check_predator_late_join(mob/pred_candidate, show_warning = 1)

Expand Down
7 changes: 6 additions & 1 deletion code/game/machinery/autolathe_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@

/datum/autolathe/recipe/handcuffs
name = "handcuffs"
path = /obj/item/handcuffs
path = /obj/item/restraint/handcuffs
hidden = TRUE
category = AUTOLATHE_CATEGORY_GENERAL

Expand Down Expand Up @@ -331,6 +331,11 @@
path = /obj/item/ammo_magazine/flamer_tank/custom/large
category = AUTOLATHE_CATEGORY_EXPLOSIVES

/datum/autolathe/recipe/armylathe/smoke_tank
name = "Custom M240A1 Smoke Tank"
path = /obj/item/ammo_magazine/flamer_tank/smoke
category = AUTOLATHE_CATEGORY_EXPLOSIVES

//Medilathe recipes
/datum/autolathe/recipe/medilathe
category = AUTOLATHE_CATEGORY_MEDICAL
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
if("purchase_document")
if(!photocopier)
return
var/purchase_tier = Floor(text2num(params["purchase_document"]))
var/purchase_tier = floor(text2num(params["purchase_document"]))
if(purchase_tier <= 0 || purchase_tier > 5)
return
if(purchase_tier > GLOB.chemical_data.clearance_level)
Expand Down
7 changes: 4 additions & 3 deletions code/game/machinery/vending/vending_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,9 @@
icon_deny = "sec-deny"
req_access = list(ACCESS_MARINE_BRIG)
products = list(
/obj/item/handcuffs = 8,
/obj/item/handcuffs/zip = 10,
/obj/item/restraint/handcuffs = 8,
/obj/item/restraint/handcuffs/zip = 10,
/obj/item/restraint/legcuffs = 3,
/obj/item/explosive/grenade/flashbang = 4,
/obj/item/weapon/gun/energy/taser = 4,
/obj/item/reagent_container/spray/pepper = 4,
Expand Down Expand Up @@ -263,7 +264,7 @@
hacking_safety = TRUE
wrenchable = FALSE
products = list(
/obj/item/handcuffs/zip = 40,
/obj/item/restraint/handcuffs/zip = 40,
/obj/item/explosive/grenade/flashbang = 20,
/obj/item/explosive/grenade/custom/teargas = 40,
/obj/item/ammo_magazine/smg/m39/rubber = 40,
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -668,13 +668,13 @@ cases. Override_icon_state should be a list.*/
if(WEAR_HANDCUFFS)
if(human.handcuffed)
return FALSE
if(!istype(src, /obj/item/handcuffs))
if(!istype(src, /obj/item/restraint))
return FALSE
return TRUE
if(WEAR_LEGCUFFS)
if(human.legcuffed)
return FALSE
if(!istype(src, /obj/item/legcuffs))
if(!istype(src, /obj/item/restraint))
return FALSE
return TRUE
if(WEAR_IN_ACCESSORY)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/fulton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ GLOBAL_LIST_EMPTY(deployed_fultons)
reservation = SSmapping.request_turf_block_reservation(3, 3, 1, turf_type_override = /turf/open/space)
var/turf/bottom_left_turf = reservation.bottom_left_turfs[1]
var/turf/top_right_turf = reservation.top_right_turfs[1]
var/middle_x = bottom_left_turf.x + Floor((top_right_turf.x - bottom_left_turf.x) / 2)
var/middle_y = bottom_left_turf.y + Floor((top_right_turf.y - bottom_left_turf.y) / 2)
var/middle_x = bottom_left_turf.x + floor((top_right_turf.x - bottom_left_turf.x) / 2)
var/middle_y = bottom_left_turf.y + floor((top_right_turf.y - bottom_left_turf.y) / 2)
var/turf/space_tile = locate(middle_x, middle_y, bottom_left_turf.z)
if(!space_tile)
visible_message(SPAN_WARNING("[src] begins beeping like crazy. Something is wrong!"))
Expand Down
Loading

0 comments on commit 1b55bef

Please sign in to comment.