Skip to content

Commit

Permalink
Merge branch 'master' into pants
Browse files Browse the repository at this point in the history
  • Loading branch information
alsoandanswer committed Oct 9, 2024
2 parents 5b493ad + 9977de1 commit 8a03ec2
Show file tree
Hide file tree
Showing 362 changed files with 9,776 additions and 141,892 deletions.
4 changes: 3 additions & 1 deletion aurorastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#include "code\__DEFINES\hud.dm"
#include "code\__DEFINES\hydroponics.dm"
#include "code\__DEFINES\icon_layering.dm"
#include "code\__DEFINES\icon_smoothing.dm"
#include "code\__DEFINES\important_recursive_contents.dm"
#include "code\__DEFINES\inventory.dm"
#include "code\__DEFINES\is_helpers.dm"
Expand Down Expand Up @@ -168,6 +169,7 @@
#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_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_movable.dm"
#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm"
Expand Down Expand Up @@ -3151,6 +3153,7 @@
#include "code\modules\power\fractal_reactor.dm"
#include "code\modules\power\generator.dm"
#include "code\modules\power\gravitygenerator.dm"
#include "code\modules\power\outlet.dm"
#include "code\modules\power\portgen.dm"
#include "code\modules\power\power.dm"
#include "code\modules\power\power_usage.dm"
Expand Down Expand Up @@ -3601,7 +3604,6 @@
#include "code\modules\spell_system\spells\spell_list\self\generic\shift.dm"
#include "code\modules\submaps\_submap.dm"
#include "code\modules\submaps\submap_archetype.dm"
#include "code\modules\submaps\submap_landmark.dm"
#include "code\modules\supermatter\setup_supermatter.dm"
#include "code\modules\supermatter\supermatter.dm"
#include "code\modules\surgery\_defines.dm"
Expand Down
3 changes: 1 addition & 2 deletions code/__DEFINES/_macros.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#define Clamp(x, low, high) max(low, min(high, x))
#define CLAMP01(x) (Clamp(x, 0, 1))
#define CLAMP01(x) (clamp(x, 0, 1))
#define JOINTEXT(X) jointext(X, null)
#define list_find(L, needle, LIMITS...) L.Find(needle, LIMITS)

Expand Down
17 changes: 17 additions & 0 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_attack.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Atom attack 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/attackby(): (/obj/item, /mob/living, params)
#define COMSIG_ATOM_ATTACKBY "atom_attackby"

/// From [/item/attack()], sent by an atom which was just attacked by an item: (/obj/item/weapon, /mob/user, proximity_flag, click_parameters)
#define COMSIG_ATOM_AFTER_ATTACKEDBY "atom_after_attackby"

///Return this in response if you don't want afterattack to be called
#define COMPONENT_NO_AFTERATTACK (1<<0)

///Ends the attack chain. If sent early might cause posterior attacks not to happen.
#define COMPONENT_CANCEL_ATTACK_CHAIN (1<<0)
///Skips the specific attack step, continuing for the next one to happen.
#define COMPONENT_SKIP_ATTACK (1<<1)
3 changes: 3 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,5 +12,8 @@
/// The arugment of move_args which dictates our movement direction
#define MOVE_ARG_DIRECTION 2

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

///From base of mob/update_movespeed():area
#define COMSIG_MOB_MOVESPEED_UPDATED "mob_update_movespeed"
6 changes: 6 additions & 0 deletions code/__DEFINES/dcs/signals/signals_object/signals_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
///from base of obj/item/pickup(): (mob/user)
#define COMSIG_ITEM_PICKUP "item_pickup"

///from base of /obj/item/attack(): (mob/living, mob/living, params)
#define COMSIG_ITEM_ATTACK "item_attack"

///from base of [obj/item/attack()]: (atom/target, mob/user, proximity_flag, click_parameters)
#define COMSIG_ITEM_AFTERATTACK "item_afterattack"

// /obj/projectile signals (sent to the firer)

///from base of /obj/projectile/proc/on_hit(), like COMSIG_PROJECTILE_ON_HIT but on the projectile itself and with the hit limb (if any): (atom/movable/firer, atom/target, angle, hit_limb, blocked)
Expand Down
34 changes: 34 additions & 0 deletions code/__DEFINES/icon_smoothing.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* smoothing_flags */
///Do not smooth
#define SMOOTH_FALSE BITFLAG(0)
///Smooths with exact specified types or just itself
#define SMOOTH_TRUE BITFLAG(1)
///Smooths with all subtypes of specified types or just itself (this value can replace SMOOTH_TRUE)
#define SMOOTH_MORE BITFLAG(2)
///If atom should smooth diagonally, this should be present in 'smooth' var
#define SMOOTH_DIAGONAL BITFLAG(3)
///Atom will smooth with the borders of the map
#define SMOOTH_BORDER BITFLAG(4)
///Atom is currently queued to smooth.
#define SMOOTH_QUEUED BITFLAG(5)
///Don't clear the atom's icon_state on smooth.
#define SMOOTH_NO_CLEAR_ICON BITFLAG(6)
///Add underlays, detached from diagonal smoothing.
#define SMOOTH_UNDERLAYS BITFLAG(7)

#define USES_SMOOTHING (SMOOTH_TRUE|SMOOTH_MORE)

//Redefinitions of the diagonal directions so they can be stored in one var without conflicts
#define N_NORTH 2
#define N_SOUTH 4
#define N_EAST 16
#define N_WEST 256
#define N_NORTHEAST 32
#define N_NORTHWEST 512
#define N_SOUTHEAST 64
#define N_SOUTHWEST 1024


#define QUEUE_SMOOTH(thing_to_queue) if(thing_to_queue.smoothing_flags & USES_SMOOTHING){SSicon_smooth.add_to_queue(thing_to_queue)}

#define QUEUE_SMOOTH_NEIGHBORS(thing_to_queue) for(var/atom/atom_neighbor as anything in orange(1, thing_to_queue)) {QUEUE_SMOOTH(atom_neighbor)}
5 changes: 5 additions & 0 deletions code/__DEFINES/maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
// Real modulus that handles decimals
#define MODULUS(x, y) ( (x) - FLOOR(x, y))


// 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) clamp(( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) ),min,max)


#define ATAN2(x, y) ( !(x) && !(y) ? 0 : (y) >= 0 ? arccos((x) / sqrt((x)*(x) + (y)*(y))) : -arccos((x) / sqrt((x)*(x) + (y)*(y))) )

// Will filter out extra rotations and negative rotations
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/files.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
var/static/notch = 0
// its importaint this code can handle md5filepath sleeping instead of hard blocking, if it's converted to use rust_g.
var/filename = "tmp/md5asfile.[world.realtime].[world.timeofday].[world.time].[world.tick_usage].[notch]"
notch = Wrap(notch+1, 0, 2**15)
notch = WRAP(notch+1, 0, 2**15)
fcopy(file, filename)
. = md5filepath(filename)
fdel(filename)
Expand Down
Loading

0 comments on commit 8a03ec2

Please sign in to comment.