Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/cmss13-devs/cmss13 into cade
Browse files Browse the repository at this point in the history
  • Loading branch information
Blundir committed Aug 7, 2024
2 parents c7aff80 + 9fe5213 commit d277c0e
Show file tree
Hide file tree
Showing 196 changed files with 2,538 additions and 1,721 deletions.
7 changes: 7 additions & 0 deletions code/__DEFINES/autowiki.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifdef AUTOWIKI
#define AUTOWIKI_SKIP(skip) autowiki_skip = skip
#define IS_AUTOWIKI_SKIP(datum) datum.autowiki_skip
#else
#define AUTOWIKI_SKIP(skip)
#define IS_AUTOWIKI_SKIP(datum) UNLINT(FALSE)
#endif
4 changes: 3 additions & 1 deletion code/__DEFINES/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
* Chemistry defines
*/

/// Amount of bottle icon variations in total
#define BOTTLE_ICON_CHOICES 4
/// Amount of random icon variations for pills in total
#define PILL_ICON_CHOICES 21
#define PILL_ICON_CHOICES 22
/* Pill icon classes to generate mappings for */
#define PILL_ICON_CLASSES list("bica", "kelo", "dex", "para", "tram", "atox", "tox", "inap", "peri", "spac", "drug", "stim", "alky", "imi", "qc", "tric", "psych", "oxy")

Expand Down
5 changes: 3 additions & 2 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@
#define ORGAN_ROBOT 2

#define ORGAN_HEALTHY 0
#define ORGAN_BRUISED 1
#define ORGAN_BROKEN 2
#define ORGAN_LITTLE_BRUISED 1 //used by stethoscopes and penlights
#define ORGAN_BRUISED 2
#define ORGAN_BROKEN 3

//=================================================

Expand Down
9 changes: 5 additions & 4 deletions code/__DEFINES/skills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@

// engineer skill
#define SKILL_ENGINEER_DEFAULT 0
#define SKILL_ENGINEER_TRAINED 1 //barricade repair && c4 use (mini-engis, specs)
#define SKILL_ENGINEER_ENGI 2 //plasteel barricade deconstruction, hacking&&planet engine fixing&&apc building, Telecomms fixing (Combat Engi, OT, etc.)
#define SKILL_ENGINEER_MASTER 3 //Synths
#define SKILL_ENGINEER_MAX 3
#define SKILL_ENGINEER_NOVICE 1 //barricade repair && c4 use (mini-engis, specs)
#define SKILL_ENGINEER_TRAINED 2 //plasteel barricade deconstruction, hacking&&planet engine fixing&&apc building, Telecomms fixing (OT, etc.)
#define SKILL_ENGINEER_ENGI 3 // Slightly faster at everything (Combat Technicians)
#define SKILL_ENGINEER_MASTER 4 //Synths
#define SKILL_ENGINEER_MAX 4

//medical skill
#define SKILL_MEDICAL_DEFAULT 0
Expand Down
22 changes: 22 additions & 0 deletions code/__DEFINES/sounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@
#define SOUND_CHANNEL_LOBBY 1023
#define SOUND_CHANNEL_Z 1024


//default byond sound echo list index positions.
//ECHO_DIRECT and ECHO_ROOM are the only two that actually appear to do anything, and represent the dry and wet channels of the environment effects, respectively.
#define ECHO_DIRECT 1
#define ECHO_DIRECTHF 2
#define ECHO_ROOM 3
#define ECHO_ROOMHF 4
#define ECHO_OBSTRUCTION 5
#define ECHO_OBSTRUCTIONLFRATIO 6
#define ECHO_OCCLUSION 7
#define ECHO_OCCLUSIONLFRATIO 8
#define ECHO_OCCLUSIONROOMRATIO 9
#define ECHO_OCCLUSIONDIRECTRATIO 10
#define ECHO_EXCLUSION 11
#define ECHO_EXCLUSIONLFRATIO 12
#define ECHO_OUTSIDEVOLUMEHF 13
#define ECHO_DOPPLERFACTOR 14
#define ECHO_ROLLOFFFACTOR 15
#define ECHO_ROOMROLLOFFFACTOR 16
#define ECHO_AIRABSORPTIONFACTOR 17
#define ECHO_FLAGS 18

//default byond sound environments
#define SOUND_ENVIRONMENT_NONE -1
#define SOUND_ENVIRONMENT_GENERIC 0
Expand Down
13 changes: 7 additions & 6 deletions code/__DEFINES/turfs.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#define RANGE_TURFS(RADIUS, CENTER) \
block( \
(CENTER).x-(RADIUS), (CENTER).y-(RADIUS), (CENTER).z, \
(CENTER).x+(RADIUS), (CENTER).y+(RADIUS), (CENTER).z \
)

/// Returns a list of turfs within H_RADIUS tiles horizontally and V_RADIUS tiles vertically of CENTER.
#define RECT_TURFS(H_RADIUS, V_RADIUS, CENTER) \
block( \
(CENTER).x-(H_RADIUS), (CENTER).y-(V_RADIUS), (CENTER).z, \
(CENTER).x+(H_RADIUS), (CENTER).y+(V_RADIUS), (CENTER).z \
)

/// Returns a list of turfs within Dist tiles of Center. When Dist >= 5 faster than a `range()` filtered to `/turf`s.
#define RANGE_TURFS(Dist, Center) RECT_TURFS(Dist, Dist, Center)

/// Returns a list of turfs within Dist tiles of Center, excluding Center. When Dist >= 5 faster than an `orange()` filtered to `/turf`s.
#define ORANGE_TURFS(Dist, Center) (RANGE_TURFS(Dist, Center) - Center)

///Returns all turfs in a zlevel
#define Z_TURFS(ZLEVEL) block(1, 1, (ZLEVEL), world.maxx, world.maxy, (ZLEVEL))

Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
var/list/turfs = new/list()
var/rsq = radius * (radius+0.5)

for(var/turf/T in range(radius, centerturf))
for(var/turf/T as anything in RANGE_TURFS(radius, centerturf))
var/dx = T.x - centerturf.x
var/dy = T.y - centerturf.y
if(dx*dx + dy*dy <= rsq)
Expand Down
38 changes: 24 additions & 14 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1289,10 +1289,7 @@ GLOBAL_LIST_INIT(WALLITEMS, list(
origin = get_turf(origin)
if(!origin)
return
var/list/turfs = list()
for(var/turf/T in orange(origin, outer_range))
if(!inner_range || get_dist(origin, T) >= inner_range)
turfs += T
var/list/turfs = (RANGE_TURFS(outer_range, origin) - RANGE_TURFS(inner_range - 1, origin))
if(length(turfs))
return pick(turfs)

Expand Down Expand Up @@ -1343,29 +1340,35 @@ GLOBAL_LIST_INIT(WALLITEMS, list(
GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)

/// Version of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant).
/proc/dview(range = world.view, center, invis_flags = 0)
/proc/dview(range = world.view, atom/center, invis_flags = 0)
if(!center)
return

GLOB.dview_mob.loc = center

GLOB.dview_mob.loc = isturf(center) ? center : center.loc
GLOB.dview_mob.see_invisible = invis_flags

. = view(range, GLOB.dview_mob)
. = oview(range, GLOB.dview_mob)
GLOB.dview_mob.loc = null

/// Version of oview() which ignores darkness
/proc/doview(range, atom/center, invis_flags)
if(!center)
return

return dview(range, center, invis_flags) - center

/mob/dview
name = "INTERNAL DVIEW MOB"
invisibility = 101
invisibility = INVISIBILITY_ABSTRACT
density = FALSE
see_in_dark = 1e6
see_in_dark = INFINITY
var/ready_to_die = FALSE

/mob/dview/Initialize() //Properly prevents this mob from gaining huds or joining any global lists
SHOULD_CALL_PARENT(FALSE)
if(flags_atom & INITIALIZED)
if(CHECK_BITFIELD(flags_atom, INITIALIZED))
stack_trace("Warning: [src]([type]) initialized multiple times!")
flags_atom |= INITIALIZED
ENABLE_BITFIELD(flags_atom, INITIALIZED)
return INITIALIZE_HINT_NORMAL

/mob/dview/Destroy(force = FALSE)
Expand All @@ -1381,12 +1384,19 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)


#define FOR_DVIEW(type, range, center, invis_flags) \
GLOB.dview_mob.loc = center; \
GLOB.dview_mob.loc = isturf(center) ? (center) : (center).loc; \
GLOB.dview_mob.see_invisible = invis_flags; \
for(type in view(range, GLOB.dview_mob))
for(type in oview(range, GLOB.dview_mob))

#define FOR_DVIEW_END GLOB.dview_mob.loc = null

#define FOR_DOVIEW(type, range, center, invis_flags) \
GLOB.dview_mob.loc = isturf(center) ? (center) : (center).loc; \
GLOB.dview_mob.see_invisible = invis_flags; \
for(type in oview(range, GLOB.dview_mob) - (center))

#define FOR_DOVIEW_END FOR_DVIEW_END

/proc/get_turf_pixel(atom/AM)
if(!istype(AM))
return
Expand Down
17 changes: 17 additions & 0 deletions code/_globalvars/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ GLOBAL_LIST_INIT_TYPED(chemical_gen_classes_list, /list, list("C" = list(),"C1"
//properties generated in chemicals, helps to make sure the same property doesn't show up 10 times
GLOBAL_LIST_INIT_TYPED(generated_properties, /list, list("positive" = list(), "negative" = list(), "neutral" = list()))

GLOBAL_LIST_INIT_TYPED(space_weapons, /datum/space_weapon, setup_ship_weapon())
GLOBAL_LIST_INIT_TYPED(space_weapons_ammo, /datum/space_weapon_ammo, setup_ship_ammo())

GLOBAL_LIST_INIT_TYPED(ammo_list, /datum/ammo, setup_ammo()) //List of all ammo types. Used by guns to tell the projectile how to act.
GLOBAL_REFERENCE_LIST_INDEXED(joblist, /datum/job, title) //List of all jobstypes, minus borg and AI

Expand Down Expand Up @@ -348,6 +351,20 @@ GLOBAL_LIST_INIT(hj_emotes, setup_hazard_joe_emotes())
all_species[S.name] = S
return all_species

/proc/setup_ship_weapon()
var/list/ammo_list = list()
for(var/weapon_type in subtypesof(/datum/space_weapon))
var/datum/space_weapon/new_weapon = new weapon_type
ammo_list[new_weapon.type] = new_weapon
return ammo_list

/proc/setup_ship_ammo()
var/list/ammo_list = list()
for(var/ammo_type in subtypesof(/datum/space_weapon_ammo))
var/datum/space_weapon_ammo/new_ammo = new ammo_type
ammo_list[new_ammo.type] = new_ammo
return ammo_list

/proc/setup_ammo()
var/list/blacklist = list(/datum/ammo/energy, /datum/ammo/energy/yautja, /datum/ammo/energy/yautja/rifle, /datum/ammo/bullet/shotgun, /datum/ammo/xeno)
var/list/ammo_list = list()
Expand Down
Loading

0 comments on commit d277c0e

Please sign in to comment.