Skip to content

Commit

Permalink
Merge branch 'master' into working-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Bierkraan committed Jun 8, 2024
2 parents ae8d819 + aa406df commit 46dc282
Show file tree
Hide file tree
Showing 118 changed files with 1,705 additions and 788 deletions.
16 changes: 8 additions & 8 deletions code/__defines/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

#define CHEM_SYNTH_ENERGY 500 // How much energy does it take to synthesize 1 unit of chemical, in Joules.

#define CE_STABLE "stable" // adrenaline
#define CE_ANTIBIOTIC "antibiotic" // Spaceacilin
#define CE_BLOODRESTORE "bloodrestore" // Iron/nutriment
#define CE_STABLE "stable" // I.E 'inaprovaline', if we had it.
#define CE_ANTIBIOTIC "antibiotic" // I.E; increasing/decreasing immunity system[?].
#define CE_BLOODRESTORE "bloodrestore" // Gives off an iron/nutriment blood restoration effect.
#define CE_PAINKILLER "painkiller"
#define CE_ALCOHOL "alcohol" // Liver filtering
#define CE_ALCOHOL_TOXIC "alcotoxic" // Liver damage
#define CE_SPEEDBOOST "gofast" // Hyperzine
#define CE_PULSE "xcardic" // increases or decreases heart rate
#define CE_NOPULSE "heartstop" // stops heartbeat
#define CE_ALCOHOL "alcohol" // Used for filtering by the liver; can be checked and incremented until value 'x' is toxic.
#define CE_ALCOHOL_TOXIC "alcotoxic" // Used for dealing damage to the liver; when 'x' is a checked value, E.G; if(filter_effect < 3) CE_ALCOHOL... else take_damage(user.chem_effects[CE_ALCOHOL_TOXIC])
#define CE_SPEEDBOOST "gofast" // I.E; Pervitin, Hyperzine.
#define CE_PULSE "xcardic" // Manages heart-rate (increase/decrease)
#define CE_NOPULSE "heartstop" // Registers no pulse for the heartbeat.
2 changes: 1 addition & 1 deletion code/__defines/math_physics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define RADIATOR_EXPOSED_SURFACE_AREA_RATIO 0.04 // (3 cm + 100 cm * sin(3deg))/(2*(3+100 cm)). Unitless ratio.
#define HUMAN_EXPOSED_SURFACE_AREA 5.2 //m^2, surface area of 1.7m (H) x 0.46m (D) cylinder

#define Clamp(x, y, z) (x <= y ? y : (x >= z ? z : x))
#define Clamp(x, y, z) (x <= y ? y : (x >= z ? z : x)) // Ensures that a value (x) is within a specified range (y to z). If x is less than y, it returns y; if x is greater than z, it returns z; otherwise, it returns x. This effectively clamps the value of x within the range specified by y and z.
#define CLAMP01(x) max(0, min(1, x))
#define CLAMP0100(x) max(0, min(100, x))

Expand Down
91 changes: 44 additions & 47 deletions code/_helpers/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -417,65 +417,62 @@ proc/random_afrikaans_name(gender, species = "Human")
return current_species.get_random_afrikaans_name(gender)

proc/random_skin_tone()

var/skin_tone = "caucasian"
if (prob(60))
pass()
else if (prob(15))
skin_tone = "mulatto"
else if (prob(10))
skin_tone = "african"
else if (prob(10))
skin_tone = "latino"

switch(skin_tone)
if ("caucasian") . = -10
if ("mulatto") . = -115
if ("african") . = -165
if ("latino") . = -55
else . = rand(-185,34)
return min(max( .+rand(-25, 25), -185),34)
switch(pick(60;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino"))
if("caucasian") . = -10
if("afroamerican") . = -115
if("african") . = -165
if("latino") . = -55
if("albino") . = 34
return clamp(. + rand(-25, 25), -185, 34) // Clamp() keeps the rand(-25, 25) variation of skin tone between -185 to 34.

proc/skintone2racedescription(tone)
switch (tone)
if(!isnum(tone))
CRASH("skintone2racedescription; proc called without correct tone (integer) argument.")

switch(tone)
if (30 to INFINITY) return "albino"
if (20 to 30) return "pale"
if (5 to 15) return "light skinned"
if (-10 to 5) return "white"
if (-25 to -10) return "tan"
if (-45 to -25) return "darker skinned"
if (-65 to -45) return "brown"
if (-INFINITY to -65) return "black"
else return "unknown"
if (20 to 29) return "pale"
if (5 to 19) return "light skinned"
if (-10 to 4) return "white"
if (-25 to -9) return "tan"
if (-45 to -24) return "darker skinned"
if (-65 to -44) return "brown"
if (-INFINITY to -64) return "black"
else return "unknown"

proc/age2agedescription(age)
if(!isnum(age))
CRASH("age2agedescription; proc called without correct age (integer) argument.")

switch(age)
if (0 to 1) return "infant"
if (1 to 3) return "toddler"
if (3 to 13) return "child"
if (13 to 19) return "teenager"
if (19 to 30) return "young adult"
if (30 to 45) return "adult"
if (45 to 60) return "middle-aged"
if (60 to 70) return "aging"
if (70 to INFINITY) return "elderly"
if (2 to 3) return "toddler"
if (4 to 12) return "child"
if (13 to 17) return "teenager"
if (18 to 29) return "young adult"
if (30 to 44) return "adult"
if (45 to 59) return "middle-aged"
if (60 to 69) return "aging"
if (70 to INFINITY) return "elderly"
else return "unknown"

proc/ageAndGender2Desc(age, gender)//Used for the radio
if (gender == FEMALE)
proc/ageAndGender2Desc(age, gender) // Radio name getters.
if (!gender || !isnum(age))
CRASH("ageAndGender2Desc; proc called without age/gender argument.")

if (gender == MALE)
switch(age)
if (0 to 15) return "Girl"
if (15 to 25) return "Young Woman"
if (25 to 60) return "Woman"
if (60 to INFINITY) return "Old Woman"
else return "Unknown"
if (0 to 15) return "Boy"
if (16 to 25) return "Young Man"
if (26 to 60) return "Man"
if (61 to INFINITY) return "Old Man"
else
switch(age)
if (0 to 15) return "Boy"
if (15 to 25) return "Young Man"
if (25 to 60) return "Man"
if (60 to INFINITY) return "Old Man"
else return "Unknown"
if (0 to 15) return "Girl"
if (16 to 25) return "Young Woman"
if (26 to 60) return "Woman"
if (61 to INFINITY) return "Old Woman"
return "Unknown"

proc/get_body_build(gender, body_build = "Default")
if (gender == MALE)
Expand Down
17 changes: 15 additions & 2 deletions code/_helpers/qdel.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
// When you want to qdel something after some time.
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE)

// When you want to qdel something after some time but based on how clients see time, not how the server sees time.
#define QDEL_IN_CLIENT_TIME(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)

// When you want to qdel something and then null the reference.
#define QDEL_NULL(item) qdel(item); item = null

// When you want to qdel everything in a list.
#define QDEL_LIST(L) if(L) { for(var/I in L) qdel(I); L.Cut(); }

// Combination of QDEL_IN and QDEL_LIST_ASSOC
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/______qdel_list_wrapper, L), time, TIMER_STOPPABLE)

// QDEL_LIST but it deletes everything on both sides of the list.
#define QDEL_LIST_ASSOC(L) if(L) { for(var/I in L) { qdel(L[I]); qdel(I); } L.Cut(); }

// QDEL_LIST_ASSOC but it deletes everything on the value side of the list.
#define QDEL_LIST_ASSOC_VAL(L) if(L) { for(var/I in L) qdel(L[I]); L.Cut(); }

/proc/______qdel_list_wrapper(list/L) //the underscores are to encourage people not to use this directly.
QDEL_LIST(L)
/proc/______qdel_list_wrapper(list/L) // The underscores are to encourage people not to use this directly. Should never be directly used.
QDEL_LIST(L)
10 changes: 5 additions & 5 deletions code/datums/browser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
var/filename
for (key in stylesheets)
filename = "[ckey(key)].css"
to_chat(user, browse_rsc(stylesheets[key], filename))
user << browse_rsc(stylesheets[key], filename)
head_content += "<link rel='stylesheet' type='text/css' href='[filename]'>"

for (key in scripts)
filename = "[ckey(key)].js"
to_chat(user, browse_rsc(scripts[key], filename))
user << browse_rsc(scripts[key], filename)
head_content += "<script type='text/javascript' src='[filename]'></script>"

var/title_attributes = "class='uiTitle'"
Expand Down Expand Up @@ -104,12 +104,12 @@
var/window_size = ""
if (width && height)
window_size = "size=[width]x[height];"
to_chat(user, browse(get_content(), "window=[window_id];[window_size][window_options]"))
user << browse(get_content(), "window=[window_id];[window_size][window_options]")
if (use_onclose)
onclose(user, window_id, ref)

/datum/browser/proc/close()
to_chat(user, browse(null, "window=[window_id]"))
user << browse(null, "window=[window_id]")

// This will allow you to show an icon in the browse window
// This is added to mob so that it can be used without a reference to the browser object
Expand All @@ -136,7 +136,7 @@
// e.g. canisters, timers, etc.
//
// windowid should be the specified window name
// e.g. code is : to_chat(user, browse(text, "window=fred")
// e.g. code is : user << browse(text, "window=fred")
// then use : onclose(user, "fred")
//
// Optionally, specify the "ref" parameter as the controlled atom (usually src)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
out += "<hr>"
out += "</table><hr>"

to_chat(usr, browse(out, "window=edit_memory[src]"))
usr << browse(out, "window=edit_memory[src]")

/datum/mind/Topic(href, href_list)
if (!check_rights(R_ADMIN)) return
Expand Down
6 changes: 3 additions & 3 deletions code/datums/vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var/global/list/round_voters = list() //Keeps track of the individuals voting fo
// No more change mode votes after the game has started.
// 3 is GAME_STATE_PLAYING, but that #define is undefined for some reason
if ((mode == "gamemode" || mode == "ship selection") && ticker.current_state >= 2)
world << "<b>Voting aborted due to game start.</b>"
to_chat(world, "<b>Voting aborted due to game start.</b>")
reset()
return

Expand Down Expand Up @@ -434,11 +434,11 @@ var/global/list/round_voters = list() //Keeps track of the individuals voting fo
if ("restart")
if (config.allow_vote_restart || usr.client.holder)
if (config.vote_no_dead && usr.stat == DEAD && !usr.client.holder)
usr << "You can't start restart votes if you are not playing."
to_chat(usr, "You can't start restart votes if you are not playing.")
return FALSE
if (!config.allowedgamemodes == "TDM")
if ((map.nomads || map.is_RP) && clients.len < 5 && ((world.time-round_start_time)>108000) && !usr.client.holder)
usr << "You can't start restart votes if the server population is lower than 5 and the round has been going for over 3 hour."
to_chat(usr, "You can't start restart votes if the server population is lower than <b>five</b> and the round has been going for over <b>three</b> hours.")
return FALSE
initiate_vote("restart",usr.key)
if ("custom")
Expand Down
6 changes: 5 additions & 1 deletion code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,14 @@
f_name += "<span class='danger'>blood-stained</span> [name][infix]!"
else
f_name += "oil-stained [name][infix]."

if (!isobserver(user))
user.visible_message("<font size=1>[user.name] looks at \the [src].</font>", "<font size =1>You look at \the [src].</font>")

to_chat(user, "\icon[src] That's [f_name] [suffix]")
to_chat(user, desc)

if(desc) // If the description is not null.
to_chat(user, desc)

return distance == -1 || (get_dist(src, user) <= distance)

Expand Down
2 changes: 1 addition & 1 deletion code/game/mob/groups/factions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,6 @@
</body></html>
"}

to_chat(usr, browse(body,"window=artillery_window;border=1;can_close=1;can_resize=1;can_minimize=0;titlebar=1;size=250x450"))
usr << browse(body,"window=artillery_window;border=1;can_close=1;can_resize=1;can_minimize=0;titlebar=1;size=250x450")
else
return
2 changes: 1 addition & 1 deletion code/game/mob/groups/religions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,6 @@ obj/structure/altar/iron
</body></html>
"}

to_chat(usr, browse(body,"window=artillery_window;border=1;can_close=1;can_resize=1;can_minimize=0;titlebar=1;size=250x450"))
usr << browse(body,"window=artillery_window;border=1;can_close=1;can_resize=1;can_minimize=0;titlebar=1;size=250x450")
else
return
86 changes: 83 additions & 3 deletions code/game/mob/language/language.dm
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,96 @@
var/full_name = "Hyung Do Seong"
return full_name

/datum/language/proc/get_random_iroquois_name(var/gender, name_count=2, syllable_count=4, syllable_divisor=2)
/datum/language/proc/get_random_iroquois_name(var/gender, name_count=1, syllable_count=4, syllable_divisor=2)
if (!syllables || !syllables.len)
if (gender==FEMALE)
return capitalize(pick(first_names_female_iroquois)) + " " + capitalize(pick(last_names_iroquois))
return capitalize(pick(first_names_female_iroquois))
else
return capitalize(pick(first_names_male_iroquois)) + " " + capitalize(pick(last_names_iroquois))
return capitalize(pick(first_names_male_iroquois))

var/full_name = "At'tawig"
return full_name

/datum/language/proc/get_random_sioux_name(var/gender, name_count=1, syllable_count=4, syllable_divisor=2)
if (!syllables || !syllables.len)
if (gender == FEMALE)
return capitalize(pick(first_names_female_sioux))
else
return capitalize(pick(first_names_male_sioux))

var/full_name = "Tatanka"
return full_name

/datum/language/proc/get_random_apache_name(var/gender, name_count=1, syllable_count=4, syllable_divisor=2)
if (!syllables || !syllables.len)
if (gender == FEMALE)
return capitalize(pick(first_names_female_apache))
else
return capitalize(pick(first_names_male_apache))

var/full_name = "Cochise"
return full_name

/datum/language/proc/get_random_navajo_name(var/gender, name_count=1, syllable_count=4, syllable_divisor=2)
if (!syllables || !syllables.len)
if (gender == FEMALE)
return capitalize(pick(first_names_female_navajo))
else
return capitalize(pick(first_names_male_navajo))

var/full_name = "Ashkii"
return full_name

/datum/language/proc/get_random_chinook_name(var/gender, name_count=1, syllable_count=4, syllable_divisor=2)
if (!syllables || !syllables.len)
if (gender == FEMALE)
return capitalize(pick(first_names_female_chinook))
else
return capitalize(pick(first_names_male_chinook))

var/full_name = "Chikamin"
return full_name

/datum/language/proc/get_random_comanche_name(var/gender, name_count=1, syllable_count=4, syllable_divisor=2)
if (!syllables || !syllables.len)
if (gender == FEMALE)
return capitalize(pick(first_names_female_comanche))
else
return capitalize(pick(first_names_male_comanche))

var/full_name = "Quanah"
return full_name

/datum/language/proc/get_random_mayan_name(var/gender, name_count=1, syllable_count=4, syllable_divisor=2)
if (!syllables || !syllables.len)
if (gender == FEMALE)
return capitalize(pick(first_names_female_mayan))
else
return capitalize(pick(first_names_male_mayan))

var/full_name = "Balam"
return full_name

/datum/language/proc/get_random_aztec_name(var/gender, name_count=1, syllable_count=4, syllable_divisor=2)
if (!syllables || !syllables.len)
if (gender == FEMALE)
return capitalize(pick(first_names_female_aztec))
else
return capitalize(pick(first_names_male_aztec))

var/full_name = "Cuauhtemoc"
return full_name

/datum/language/proc/get_random_hawaiian_name(var/gender, name_count=1, syllable_count=4, syllable_divisor=2)
if (!syllables || !syllables.len)
if (gender == FEMALE)
return capitalize(pick(first_names_female_hawaiian))
else
return capitalize(pick(first_names_male_hawaiian))

var/full_name = "Kamehameha"
return full_name

/datum/language/proc/get_random_filipino_name(var/gender, name_count=2, syllable_count=4, syllable_divisor=2)
if (!syllables || !syllables.len)
if (gender==FEMALE)
Expand Down
2 changes: 1 addition & 1 deletion code/game/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
<BR><A href='?src=\ref[user];refresh=1'>Refresh</A>
<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>
<BR>"}
to_chat(user, browse(dat, text("window=mob[];size=325x500", name)))
user << browse(dat, text("window=mob[];size=325x500", name))
onclose(user, "mob[name]")
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ var/list/coefflist = list()
dat += "<BR><A href='?src=\ref[user];refresh=1'>Refresh</A>"
dat += "<BR><A href='?src=\ref[user];mach_close=mob[name]'>Close</A>"

to_chat(user, browse(dat, text("window=mob[name];size=340x540")))
user << browse(dat, text("window=mob[name];size=340x540"))
onclose(user, "mob[name]")
return

Expand Down
Loading

0 comments on commit 46dc282

Please sign in to comment.