Skip to content

Commit

Permalink
Merge branch 'master' into letgreenthingsgrow
Browse files Browse the repository at this point in the history
  • Loading branch information
RustingWithYou committed Jan 9, 2025
2 parents 019bed0 + 29c7d7f commit 3bf334c
Show file tree
Hide file tree
Showing 410 changed files with 6,910 additions and 5,933 deletions.
7 changes: 6 additions & 1 deletion aurorastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
#include "code\__DEFINES\icon_layering.dm"
#include "code\__DEFINES\icon_smoothing.dm"
#include "code\__DEFINES\important_recursive_contents.dm"
#include "code\__DEFINES\interaction_flags.dm"
#include "code\__DEFINES\inventory.dm"
#include "code\__DEFINES\is_helpers.dm"
#include "code\__DEFINES\items_clothing.dm"
Expand Down Expand Up @@ -170,8 +171,10 @@
#include "code\__DEFINES\dcs\signals\signals_spatial_grid.dm"
#include "code\__DEFINES\dcs\signals\signals_subsystem.dm"
#include "code\__DEFINES\dcs\signals\signals_turf.dm"
#include "code\__DEFINES\dcs\signals\signals_weather.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_attack.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_main.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_mouse.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movable.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_x_act.dm"
Expand Down Expand Up @@ -209,6 +212,7 @@
#include "code\__HELPERS\qdel.dm"
#include "code\__HELPERS\ref.dm"
#include "code\__HELPERS\sanitize_values.dm"
#include "code\__HELPERS\screen_objs.dm"
#include "code\__HELPERS\shell.dm"
#include "code\__HELPERS\smart_token_bucket.dm"
#include "code\__HELPERS\spatial_info.dm"
Expand Down Expand Up @@ -1790,6 +1794,7 @@
#include "code\modules\cargo\bounties\slime.dm"
#include "code\modules\cargo\bounties\special.dm"
#include "code\modules\cargo\bounties\weapon_prototype.dm"
#include "code\modules\cargo\delivery\_helpers.dm"
#include "code\modules\cargo\delivery\backpack.dm"
#include "code\modules\cargo\delivery\package.dm"
#include "code\modules\cargo\delivery\receptacle.dm"
Expand Down Expand Up @@ -2442,7 +2447,6 @@
#include "code\modules\mapping\map_template.dm"
#include "code\modules\mapping\reader.dm"
#include "code\modules\mapping\ruins.dm"
#include "code\modules\mapping\swapmaps.dm"
#include "code\modules\mapping\planet_types\asteroid.dm"
#include "code\modules\mapping\planet_types\barren.dm"
#include "code\modules\mapping\planet_types\crystal.dm"
Expand Down Expand Up @@ -3182,6 +3186,7 @@
#include "code\modules\power\solar.dm"
#include "code\modules\power\terminal.dm"
#include "code\modules\power\tracker.dm"
#include "code\modules\power\turbine.dm"
#include "code\modules\power\antimatter\containment_jar.dm"
#include "code\modules\power\antimatter\control.dm"
#include "code\modules\power\antimatter\shielding.dm"
Expand Down
7 changes: 6 additions & 1 deletion code/ZAS/Airflow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ Contains helper procs for airflow, handled in /connection_group.
SPAN_DANGER("You hear a loud slam!"),2)

playsound(src.loc, 'sound/weapons/smash.ogg', 25, 1, -1)
var/weak_amt = istype(A,/obj/item) ? A:w_class : rand(1,5) //Heheheh
var/weak_amt
if(istype(A, /obj/item))
var/obj/item/I = A
weak_amt = I.w_class
else
weak_amt = rand(1, 5)
Weaken(weak_amt)
. = ..()

Expand Down
5 changes: 3 additions & 2 deletions code/ZAS/ConnectionGroup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ Class Procs:

//Check for knocking people over
if(ismob(M) && differential > vsc.airflow_stun_pressure)
if(M:status_flags & GODMODE)
var/mob/mob = M
if(mob.status_flags & GODMODE)
continue
M:airflow_stun()
mob.airflow_stun()

if(M.check_airflow_movable(differential))
//Check for things that are in range of the midpoint turfs.
Expand Down
10 changes: 9 additions & 1 deletion code/__DEFINES/accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@
#define ACCESSORY_SLOT_ARM_GUARDS "arm guards"
#define ACCESSORY_SLOT_ARMOR_PIN "armor pin"
#define ACCESSORY_SLOT_ARMOR_POCKETS "armor pockets"
#define ACCESSORY_SLOT_HEAD "head"
#define ACCESSORY_SLOT_HEAD "head"

// Accessory Layering

#define ACCESSORY_LOWEST_LAYER 0
#define ACCESSORY_LAYER_LOWER 0
#define ACCESSORY_LAYER_MIDDLE 1
#define ACCESSORY_LAYER_UPPER 2
#define ACCESSORY_HIGHEST_LAYER 2
6 changes: 6 additions & 0 deletions code/__DEFINES/damage_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,9 @@
// (e.g. 0.6 == 60% lost if 200 burn damage is taken).
#define FLUIDLOSS_WIDE_BURN 0.3 //for burns from heat applied over a wider area, like from fire
#define FLUIDLOSS_CONC_BURN 0.2 //for concentrated burns, like from lasers

// The bandage levels a limb can have, basically how badly bandaged up their are
#define BANDAGE_LEVEL_NONE 0
#define BANDAGE_LEVEL_LIGHT 1
#define BANDAGE_LEVEL_MEDIUM 2
#define BANDAGE_LEVEL_HEAVY 3
11 changes: 11 additions & 0 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_mouse.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// mouse signals. Format:
// When the signal is called: (signal arguments)
// All signals send the source datum of the signal as the first argument


///from base of atom/MouseDrop(): (/atom/over, /mob/user)
#define COMSIG_MOUSEDROP_ONTO "mousedrop_onto"
#define COMPONENT_CANCEL_MOUSEDROP_ONTO (1<<0)
///from base of atom/handle_mouse_drop_receive: (/atom/from, /mob/user)
#define COMSIG_MOUSEDROPPED_ONTO "mousedropped_onto"
#define COMPONENT_CANCEL_MOUSEDROPPED_ONTO (1<<0)
6 changes: 6 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
/// The arugment of move_args which dictates our movement direction
#define MOVE_ARG_DIRECTION 2

//from base of client/MouseDown(): (/client, object, location, control, params)
#define COMSIG_CLIENT_MOUSEDOWN "client_mousedown"
//from base of client/MouseUp(): (/client, object, location, control, params)
#define COMSIG_CLIENT_MOUSEUP "client_mouseup"
#define COMPONENT_CLIENT_MOUSEUP_INTERCEPT (1<<0)

///from base of /obj/item/attack(): (mob/M, mob/user)
#define COMSIG_MOB_ITEM_ATTACK "mob_item_attack"

Expand Down
12 changes: 12 additions & 0 deletions code/__DEFINES/dcs/signals/signals_weather.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Signals related to weather and weather transitions
// Sent primarily from weather_fsm.dm

// global (weather) signals
// These are signals which can be listened to by any component on any parent
// start global signals with "!", this used to be necessary but now it's just a formatting choice

/// Called by weather_fsm.dm whenever a weather transition begins
#define COMSIG_GLOB_Z_WEATHER_CHANGE "!z_weather_change"

/// Called by survey_probe.dm whenever a survey probe broadcasts a weather change
#define COMSIG_GLOB_Z_WEATHER_BROADCAST "!z_weather_broadcast"
2 changes: 0 additions & 2 deletions code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
var/global/list/bitflags = list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768)

#define TURF_IS_MIMICING(T) (isturf(T) && (T:z_flags & ZM_MIMIC_BELOW))
#define CHECK_OO_EXISTENCE(OO) if (OO && !TURF_IS_MIMICING(OO.loc)) { qdel(OO); }
#define UPDATE_OO_IF_PRESENT CHECK_OO_EXISTENCE(bound_overlay); if (bound_overlay) { update_above(); }
Expand Down
10 changes: 10 additions & 0 deletions code/__DEFINES/interaction_flags.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
AURORA NOTE: INTERACT_ATOM_MOUSEDROP_IGNORE_USABILITY is not implemented at the moment, it's kept only to keep the INTERACT_ATOM_MOUSEDROP_IGNORE_CHECKS the same
*/

/// Bypass all adjacency checks for mouse drop
#define INTERACT_ATOM_MOUSEDROP_IGNORE_ADJACENT (1<<11)
/// Bypass all can_perform_action checks for mouse drop
#define INTERACT_ATOM_MOUSEDROP_IGNORE_USABILITY (1<<12)
/// Bypass all adjacency and other checks for mouse drop
#define INTERACT_ATOM_MOUSEDROP_IGNORE_CHECKS (INTERACT_ATOM_MOUSEDROP_IGNORE_ADJACENT | INTERACT_ATOM_MOUSEDROP_IGNORE_USABILITY)
6 changes: 4 additions & 2 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,10 @@ lighting determines lighting capturing (optional), suppress_errors suppreses err
if(A)
var/icon/img = getFlatIcon(A)
if(istype(img, /icon))
if(istype(A, /mob/living) && A:lying)
img.BecomeLying()
if(istype(A, /mob/living))
var/mob/living/L = A
if(L.lying)
img.BecomeLying()
var/xoff = (A.x - tx) * 32
var/yoff = (A.y - ty) * 32
cap.Blend(img, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff)
Expand Down
115 changes: 115 additions & 0 deletions code/__HELPERS/screen_objs.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/// Takes a screen loc string in the format
/// "+-left-offset:+-pixel,+-bottom-offset:+-pixel"
/// Where the :pixel is optional, and returns
/// A list in the format (x_offset, y_offset)
/// We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc
/proc/screen_loc_to_offset(screen_loc, view)
if(!screen_loc)
return list(64, 64)
var/list/view_size = view_to_pixels(view)
var/x = 0
var/y = 0
// Time to parse for directional relative offsets
if(findtext(screen_loc, "EAST")) // If you're starting from the east, we start from the east too
x += view_size[1]
if(findtext(screen_loc, "WEST")) // HHHHHHHHHHHHHHHHHHHHHH WEST is technically a 1 tile offset from the start. Shoot me please
x += ICON_SIZE_X
if(findtext(screen_loc, "NORTH"))
y += view_size[2]
if(findtext(screen_loc, "SOUTH"))
y += ICON_SIZE_Y

var/list/x_and_y = splittext(screen_loc, ",")

var/list/x_pack = splittext(x_and_y[1], ":")
var/list/y_pack = splittext(x_and_y[2], ":")

var/x_coord = x_pack[1]
var/y_coord = y_pack[1]

if (findtext(x_coord, "CENTER"))
x += view_size[1] / 2

if (findtext(y_coord, "CENTER"))
y += view_size[2] / 2

x_coord = text2num(cut_relative_direction(x_coord))
y_coord = text2num(cut_relative_direction(y_coord))

x += x_coord * ICON_SIZE_X
y += y_coord * ICON_SIZE_Y

if(length(x_pack) > 1)
x += text2num(x_pack[2])
if(length(y_pack) > 1)
y += text2num(y_pack[2])
return list(x, y)

/// Takes a list in the form (x_offset, y_offset)
/// And converts it to a screen loc string
/// Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope
/proc/offset_to_screen_loc(x_offset, y_offset, view = null)
if(view)
var/list/view_bounds = view_to_pixels(view)
x_offset = clamp(x_offset, ICON_SIZE_X, view_bounds[1])
y_offset = clamp(y_offset, ICON_SIZE_Y, view_bounds[2])

// Round with no argument is floor, so we get the non pixel offset here
var/x = round(x_offset / ICON_SIZE_X)
var/pixel_x = x_offset % ICON_SIZE_X
var/y = round(y_offset / ICON_SIZE_Y)
var/pixel_y = y_offset % ICON_SIZE_Y

var/list/generated_loc = list()
generated_loc += "[x]"
if(pixel_x)
generated_loc += ":[pixel_x]"
generated_loc += ",[y]"
if(pixel_y)
generated_loc += ":[pixel_y]"
return jointext(generated_loc, "")

/**
* Returns a valid location to place a screen object without overflowing the viewport
*
* * target: The target location as a purely number based screen_loc string "+-left-offset:+-pixel,+-bottom-offset:+-pixel"
* * target_offset: The amount we want to offset the target location by. We explictly don't care about direction here, we will try all 4
* * view: The view variable of the client we're doing this for. We use this to get the size of the screen
*
* Returns a screen loc representing the valid location
**/
/proc/get_valid_screen_location(target_loc, target_offset, view)
var/list/offsets = screen_loc_to_offset(target_loc)
var/base_x = offsets[1]
var/base_y = offsets[2]

var/list/view_size = view_to_pixels(view)

// Bias to the right, down, left, and then finally up
if(base_x + target_offset < view_size[1])
return offset_to_screen_loc(base_x + target_offset, base_y, view)
if(base_y - target_offset > ICON_SIZE_Y)
return offset_to_screen_loc(base_x, base_y - target_offset, view)
if(base_x - target_offset > ICON_SIZE_X)
return offset_to_screen_loc(base_x - target_offset, base_y, view)
if(base_y + target_offset < view_size[2])
return offset_to_screen_loc(base_x, base_y + target_offset, view)
stack_trace("You passed in a scren location {[target_loc]} and offset {[target_offset]} that can't be fit in the viewport Width {[view_size[1]]}, Height {[view_size[2]]}. what did you do lad")
return null // The fuck did you do lad

/// Takes a screen_loc string and cut out any directions like NORTH or SOUTH
/proc/cut_relative_direction(fragment)
var/static/regex/regex = regex(@"([A-Z])\w+", "g")
return regex.Replace(fragment, "")

/// Returns a screen_loc format for a tiling screen objects from start and end positions. Start should be bottom left corner, and end top right corner.
/proc/spanning_screen_loc(start_px, start_py, end_px, end_py)
var/starting_tile_x = round(start_px / ICON_SIZE_X)
start_px -= starting_tile_x * ICON_SIZE_X
var/starting_tile_y = round(start_py/ ICON_SIZE_Y)
start_py -= starting_tile_y * ICON_SIZE_Y
var/ending_tile_x = round(end_px / ICON_SIZE_X)
end_px -= ending_tile_x * ICON_SIZE_X
var/ending_tile_y = round(end_py / ICON_SIZE_Y)
end_py -= ending_tile_y * ICON_SIZE_Y
return "[starting_tile_x]:[start_px],[starting_tile_y]:[start_py] to [ending_tile_x]:[end_px],[ending_tile_y]:[end_py]"
58 changes: 30 additions & 28 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -913,35 +913,37 @@ var/global/list/common_tools = list(
return 1
return 0

/proc/is_hot(obj/item/W as obj)
switch(W.type)
if(/obj/item/weldingtool)
var/obj/item/weldingtool/WT = W
if(WT.isOn())
return 3800
else
return 0
if(/obj/item/flame/lighter)
if(W:lit)
return 1500
else
return 0
if(/obj/item/flame/match)
if(W:lit)
return 1000
else
return 0
if(/obj/item/clothing/mask/smokable/cigarette)
if(W:lit)
return 1000
else
return 0
if(/obj/item/gun/energy/plasmacutter)
/proc/is_hot(obj/item/W)
SHOULD_NOT_SLEEP(TRUE)
SHOULD_BE_PURE(TRUE)

. = 0

if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
if(WT.isOn())
return 3800
if(/obj/item/melee/energy)
return 3500
else
return 0

if(istype(W, /obj/item/flame/lighter))
var/obj/item/flame/lighter/lighter = W
if(lighter.lit)
return 1500

if(istype(W, /obj/item/flame/match))
var/obj/item/flame/match/match = W
if(match.lit)
return 1000

if(istype(W, /obj/item/clothing/mask/smokable/cigarette))
var/obj/item/clothing/mask/smokable/cigarette/cigarette = W
if(cigarette.lit)
return 1000

if(istype(W, /obj/item/gun/energy/plasmacutter))
return 3800

if(istype(W, /obj/item/melee/energy))
return 3500

//Whether or not the given item counts as sharp in terms of dealing damage
/proc/is_sharp(obj/O)
Expand Down
5 changes: 5 additions & 0 deletions code/___linters/odlint.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#pragma SuspiciousMatrixCall error
#pragma FallbackBuiltinArgument error
#pragma PointlessScopeOperator error
#pragma PointlessPositionalArgument error
#pragma ProcArgumentGlobal error
#pragma MalformedRange error
#pragma InvalidRange error
#pragma InvalidSetStatement error
Expand All @@ -33,5 +35,8 @@
#pragma SuspiciousSwitchCase error
#pragma AssignmentInConditional error
#pragma AmbiguousInOrder error
#pragma ExtraToken error
//We rely on macros for things that require this operator, so for now it's kept disabled
#pragma RuntimeSearchOperator disabled

#endif
Loading

0 comments on commit 3bf334c

Please sign in to comment.