Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master220' into master220
Browse files Browse the repository at this point in the history
  • Loading branch information
NightDawnFox committed Jun 25, 2024
2 parents 75c51c0 + 121faba commit fdab1a2
Show file tree
Hide file tree
Showing 197 changed files with 31,504 additions and 698 deletions.
2,126 changes: 2,126 additions & 0 deletions _maps/map_files/templates/pirat_markettransit_onlyz2.dmm

Large diffs are not rendered by default.

27,773 changes: 27,773 additions & 0 deletions _maps/map_files/templates/piratbase.dmm

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions code/__DEFINES/_helpers.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Stuff that is relatively "core" and is used in other defines/helpers

//Returns the hex value of a decimal number
//len == length of returned string
#define num2hex(X, len) num2text(X, len, 16)

//Returns an integer given a hex input, supports negative values "-ff"
//skips preceding invalid characters
#define hex2num(X) text2num(X, 16)

2 changes: 2 additions & 0 deletions code/__DEFINES/alerts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#define ALERT_BUCKLED "buckled"
#define ALERT_HANDCUFFED "handcuffed"
#define ALERT_LEGCUFFED "legcuffed"
#define ALERT_EMBEDDED "embedded"
#define ALERT_NUTRITION "nutrition"

/** Silicon related */
#define ALERT_LOCKED "locked"
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/math.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#define PI 3.1415
#define INFINITY 1e31 //closer than enough
#define SQRT_2 1.41421356237
#define SQRT_2 1.4142135623730950488016887242097

#define SHORT_REAL_LIMIT 16777216

Expand Down
3 changes: 0 additions & 3 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,3 @@
/// Possible value of [/atom/movable/buckle_lying]. If set to a different (positive-or-zero) value than this, the buckling thing will force a lying angle on the buckled.
#define NO_BUCKLE_LYING -1

// Return values for [/mob/living/proc/handle_ventcrawl()]
#define VENTCRAWL_IN_SUCCESS 1
#define VENTCRAWL_OUT_SUCCESS 2
8 changes: 8 additions & 0 deletions code/__DEFINES/overlays.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@
} \
}
*/


// Layer offsets for closets
#define CLOSET_OLAY_OFFSET_CONTENTS 0.01
#define CLOSET_OLAY_OFFSET_DOOR 0.02
#define CLOSET_OLAY_OFFSET_LOCK 0.03
#define CLOSET_OLAY_OFFSET_WELDED 0.04

1 change: 1 addition & 0 deletions code/__DEFINES/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#define PREFTOGGLE_2_MC_TABS (1<<11) // 2048
#define PREFTOGGLE_2_DISABLE_TGUI_LISTS (1<<12) // 4096
#define PREFTOGGLE_2_PARALLAX_MULTIZ (1<<13) // 8192
#define PREFTOGGLE_2_DISABLE_VOTE_POPUPS (1<<14) // 16384

#define TOGGLES_2_TOTAL 32767 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.

Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define CHANNEL_BOSS_MUSIC 1011
#define CHANNEL_INTERACTION_SOUNDS 1010 // item pickup/equip/drop sounds

#define USER_VOLUME(M, C) M?.client?.prefs.get_channel_volume(C)
#define USER_VOLUME(M, C) M?.client?.prefs?.get_channel_volume(C)

//THIS SHOULD ALWAYS BE THE LOWEST ONE!
//KEEP IT UPDATED
Expand Down
1 change: 0 additions & 1 deletion code/__DEFINES/span.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
//#define span_phobia(str) ("<span class='phobia'>" + str + "</span>")
#define span_prefix(str) ("<span class='prefix'>" + str + "</span>")
#define span_purple(str) ("<span class='purple'>" + str + "</span>")
#define span_radio(str) ("<span class='radio'>" + str + "</span>")
#define span_reallybig(str) ("<span class='reallybig'>" + str + "</span>")
#define span_red(str) ("<span class='red'>" + str + "</span>")
//#define span_redteamradio(str) ("<span class='redteamradio'>" + str + "</span>")
Expand Down
13 changes: 13 additions & 0 deletions code/__DEFINES/text.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/// Standard maptext
/// Prepares a text to be used for maptext. Use this so it doesn't look hideous.
#define MAPTEXT(text) {"<span class='maptext'>[##text]</span>"}


/// Macro from Lummox used to get height from a MeasureText proc.
/// resolves the MeasureText() return value once, then resolves the height, then sets return_var to that.
#define WXH_TO_HEIGHT(measurement, return_var) \
do { \
var/_measurement = measurement; \
return_var = text2num(copytext(_measurement, findtextEx(_measurement, "x") + 1)); \
} while(FALSE);

3 changes: 2 additions & 1 deletion code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,11 @@
* * extra_checks - Additional checks to perform before the action is executed.
* * interaction_key - The assoc key under which the do_after is capped, with max_interact_count being the cap. Interaction key will default to target if not set.
* * max_interact_count - The maximum amount of interactions allowed.
* * cancel_message - Message shown to the user if they exceeds max interaction count.
* * cancel_message - Message shown to the user if they exceeds max interaction count. Use "" to remove it.
*
* Returns `TRUE` on success, `FALSE` on failure.
*/

/proc/do_after(mob/user, delay, atom/target, timed_action_flags = DEFAULT_DOAFTER_IGNORE, progress = TRUE, datum/callback/extra_checks, interaction_key, max_interact_count = INFINITY, cancel_message = span_warning("Attempt cancelled."))
if(!user)
return FALSE
Expand Down
52 changes: 0 additions & 52 deletions code/__HELPERS/type2type.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Holds procs designed to change one type of value, into another.
* Contains:
* file2list
* hex2num & num2hex
* file2list
* angle2dir
* angle2text
Expand All @@ -16,57 +15,6 @@
return splittext(trim(file2text(filename)),seperator)
return splittext(file2text(filename),seperator)

//Returns an integer given a hex input
/proc/hex2num(hex)
if(!(istext(hex)))
return

var/num = 0
var/power = 0
var/i = null
i = length(hex)
while(i > 0)
var/char = copytext(hex, i, i + 1)
switch(char)
if("0")
//Apparently, switch works with empty statements, yay! If that doesn't work, blame me, though. -- Urist
if("9", "8", "7", "6", "5", "4", "3", "2", "1")
num += text2num(char) * 16 ** power
if("a", "A")
num += 16 ** power * 10
if("b", "B")
num += 16 ** power * 11
if("c", "C")
num += 16 ** power * 12
if("d", "D")
num += 16 ** power * 13
if("e", "E")
num += 16 ** power * 14
if("f", "F")
num += 16 ** power * 15
else
return
power++
i--
return num

//Returns the hex value of a number given a value assumed to be a base-ten value
/proc/num2hex(num, placeholder)
if(!isnum(num)) return
if(placeholder == null) placeholder = 2

var/hex = ""
while(num)
var/val = num % 16
num = round(num / 16)

if(val > 9)
val = ascii2text(55 + val) // 65 - 70 correspond to "A" - "F"
hex = "[val][hex]"
while(length(hex) < placeholder)
hex = "0[hex]"
return hex || "0"

//Returns an integer value for R of R/G/B given a hex color input.
/proc/color2R(hex)
if(!(istext(hex)))
Expand Down
32 changes: 24 additions & 8 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,29 @@ Turf and target are seperate in case you want to teleport some distance from a t
if(GLOB.stealthminID[P] == txt)
return P

// Returns the atom sitting on the turf.
// For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
/proc/get_atom_on_turf(var/atom/movable/M)
var/atom/loc = M
while(loc && loc.loc && !istype(loc.loc, /turf/))
loc = loc.loc
return loc

/**
* Returns the top-most atom sitting on the turf.
* For example, using this on a disk, which is in a bag, on a mob,
* will return the mob because it's on the turf.
*
* Arguments
* * something_in_turf - a movable within the turf, somewhere.
* * stop_type - optional - stops looking if stop_type is found in the turf, returning that type (if found).
**/
/proc/get_atom_on_turf(atom/movable/something_in_turf, stop_type)
if(!istype(something_in_turf))
CRASH("get_atom_on_turf was not passed an /atom/movable! Got [isnull(something_in_turf) ? "null":"type: [something_in_turf.type]"]")

var/atom/movable/topmost_thing = something_in_turf

while(topmost_thing?.loc && !isturf(topmost_thing.loc))
topmost_thing = topmost_thing.loc
if(stop_type && istype(topmost_thing, stop_type))
break

return topmost_thing


/*
Returns 1 if the chain up to the area contains the given typepath
Expand Down Expand Up @@ -1242,7 +1258,7 @@ Standard way to write links -Sayu
colour = pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))
else
for(var/i=1;i<=3;i++)
var/temp_col = "[num2hex(rand(lower,upper))]"
var/temp_col = "[num2hex(rand(lower, upper), 2)]"
if(length(temp_col )<2)
temp_col = "0[temp_col]"
colour += temp_col
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/telekinesis.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
/obj/item/tk_grab/equipped(mob/user, slot, initial = FALSE)
SHOULD_CALL_PARENT(FALSE)
if(slot & ITEM_SLOT_HANDS)
return
return TRUE
qdel(src)


Expand Down
37 changes: 36 additions & 1 deletion code/controllers/configuration/entries/config.dm
Original file line number Diff line number Diff line change
Expand Up @@ -422,15 +422,47 @@
min_val = 0


/datum/config_entry/keyed_list/antag_paradise_main_antags
/datum/config_entry/str_list/antag_paradise_random_antags_whitelist
lowercase = TRUE
default = list(
ROLE_TRAITOR,
ROLE_VAMPIRE,
)


/datum/config_entry/keyed_list/antag_paradise_single_antags_weights
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
default = list(
ROLE_TRAITOR = 60,
ROLE_THIEF = 0,
ROLE_VAMPIRE = 20,
ROLE_CHANGELING = 0,
)


/datum/config_entry/keyed_list/antag_paradise_double_antags_weights
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
default = list(
ROLE_TRAITOR = 60,
ROLE_THIEF = 0,
ROLE_VAMPIRE = 20,
ROLE_CHANGELING = 20,
)


/datum/config_entry/keyed_list/antag_paradise_tripple_antags_weights
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
default = list(
ROLE_TRAITOR = 60,
ROLE_THIEF = 0,
ROLE_VAMPIRE = 20,
ROLE_CHANGELING = 20,
)


/datum/config_entry/keyed_list/antag_paradise_special_antags_weights
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_NUM
Expand Down Expand Up @@ -636,6 +668,9 @@
/datum/config_entry/string/map_rotate
default = "none"

/datum/config_entry/string/map_vote_mode
default = "all"

//Needs proper handling?
/datum/config_entry/string/default_map
default = null
Expand Down
Loading

0 comments on commit fdab1a2

Please sign in to comment.