Skip to content

Commit

Permalink
Merge branch 'master220' into syndicate_affiliates_2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Anorak2024 authored Oct 20, 2024
2 parents e0d3d8f + 542855f commit 37e3eda
Show file tree
Hide file tree
Showing 23 changed files with 1,642 additions and 1,167 deletions.
2,384 changes: 1,323 additions & 1,061 deletions _maps/map_files/nova/nova.dmm

Large diffs are not rendered by default.

38 changes: 37 additions & 1 deletion code/controllers/subsystem/non-firing/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ SUBSYSTEM_DEF(mapping)
var/list/critical_planes
/// The largest plane offset we've generated so far
var/max_plane_offset = 0
/// Maps played in previous rounds, stores typepaths
var/list/previous_maps


// This has to be here because world/New() uses [station_name()], which looks this datum up
Expand All @@ -57,17 +59,51 @@ SUBSYSTEM_DEF(mapping)
catch
map_datum = fallback_map // Assume delta if non-existent
fdel("data/next_map.txt") // Remove to avoid the same map existing forever

return

map_datum = fallback_map // Assume delta if non-existent

/datum/controller/subsystem/mapping/Shutdown()
if(next_map) // Save map for next round
var/F = file("data/next_map.txt")
F << next_map.type


/datum/controller/subsystem/mapping/proc/convert_map_datums()
var/list/map_subtypes = subtypesof(/datum/map)
var/list/result = list()
for(var/datum/map/subtype as anything in map_subtypes)
result[initial(subtype.name)] = subtype

return result

/datum/controller/subsystem/mapping/proc/find_last_played_maps()
if(CONFIG_GET(flag/sql_enabled))
var/datum/db_query/query = \
SSdbcore.NewQuery("SELECT id, map_name \
FROM [format_table_name("round")] \
WHERE server_port=[world.port] \
AND end_state IS NOT NULL \
ORDER BY id DESC LIMIT 1") //Generally gets the last played map, but can be configured to get any count.

if(!query.warn_execute())
qdel(query)
return

var/list/map_names = convert_map_datums()
var/list/maps = list()
//Query row structure: id, map_name
for(var/map in query.rows)
var/map_path = map_names[map[2]]
if(map_path)
maps += map_path

previous_maps = maps

/datum/controller/subsystem/mapping/Initialize()
setupPlanes()

find_last_played_maps()
var/datum/lavaland_theme/lavaland_theme_type = pick(subtypesof(/datum/lavaland_theme))
ASSERT(lavaland_theme_type)
lavaland_theme = new lavaland_theme_type
Expand Down
5 changes: 3 additions & 2 deletions code/game/objects/structures/statues.dm
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@
desc = "An antique statue of a human angel made of stone."
icon_state = "angel"
anchored = TRUE
oreAmount = 0
obj_flags = NODECONSTRUCT

/obj/structure/statue/russian_mulebot
desc = "Like a MULEbot, but more Russian and less functional.";
Expand Down Expand Up @@ -445,7 +445,8 @@
bound_width = 64
var/lit = 0
layer = EDGED_TURF_LAYER

anchored = TRUE
obj_flags = NODECONSTRUCT

/obj/structure/statue/unknown/update_icon_state()
icon_state = "unknown[lit ? "_lit" : ""]"
Expand Down
50 changes: 40 additions & 10 deletions code/modules/instruments/songs/_song_ui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
return
if(length(newline) > MUSIC_MAXLINECHARS)
newline = copytext(newline, 1, MUSIC_MAXLINECHARS)

if(!legality_check(user, newline))
return

lines.Add(newline)
if("deleteline")
var/num = round(text2num(params["line"]))
Expand All @@ -98,8 +102,13 @@
var/content = tgui_input_text(user, "Enter your line:", parent.name, lines[num], max_length = MUSIC_MAXLINECHARS)
if(!content || !(state.can_use_topic(parent, user) == UI_INTERACTIVE))
return

if(num > length(lines) || num < 1)
return

if(!legality_check(user, content))
return

lines[num] = content
if("stop")
stop_playing()
Expand Down Expand Up @@ -143,32 +152,53 @@
set_dropoff_volume(initial(sustain_dropoff_volume), TRUE)
else
return FALSE

parent.add_fingerprint(user)

/**
* Parses a song the user has input into lines and stores them.
*/
/datum/song/proc/parse_song(text, mob/user)
set waitfor = FALSE
//split into lines
stop_playing()
lines = splittext(text, "\n")
if(length(lines))
//split into lines
var/list/lines_to_add = splittext(text, "\n")
if(length(lines_to_add))
var/bpm_string = "BPM: "
if(findtext(lines[1], bpm_string, 1, length(bpm_string) + 1))
var/divisor = text2num(copytext(lines[1], length(bpm_string) + 1)) || 120 // default
if(findtext(lines_to_add[1], bpm_string, 1, length(bpm_string) + 1))
var/divisor = text2num(copytext(lines_to_add[1], length(bpm_string) + 1)) || 120 // default
tempo = sanitize_tempo(600 / round(divisor, 1))
lines.Cut(1, 2)
lines_to_add.Cut(1, 2)
else
tempo = sanitize_tempo(5) // default 120 BPM
if(length(lines) > MUSIC_MAXLINES)
if(length(lines_to_add) > MUSIC_MAXLINES)
to_chat(user, "Too many lines!")
lines.Cut(MUSIC_MAXLINES + 1)
lines_to_add.Cut(MUSIC_MAXLINES + 1)
var/linenum = 1
for(var/l in lines)
for(var/l in lines_to_add)
if(length_char(l) > MUSIC_MAXLINECHARS)
to_chat(user, "Line [linenum] too long!")
lines.Remove(l)
lines_to_add.Remove(l)
continue
else
linenum++

if(!legality_check(user, l))
break

lines = lines_to_add
SStgui.update_uis(parent)

///Checks string for containing only midi-sequence characters.
/datum/song/proc/legality_check(mob/user, text)
var/static/regex/regex = regex(@"[^A-G0-9n\#\-\,\/\.(\r\n|\r|\n)]")
var/detection = regex.Find(text)
if(detection)
var/position_prev = clamp(detection - 16, 1, length(text))
var/position_next = clamp(detection + 16, 1, length(text))
var/illegal_text = copytext_char(text, position_prev, position_next + 1)
message_admins("[user] ([user.ckey]) tried to put an illegal string into a song. Part of a string: [illegal_text]")
log_admin("[user] ([user.ckey]) tried to put an illegal string into a song. Part of a string: [illegal_text]")
return FALSE

return TRUE
58 changes: 58 additions & 0 deletions code/modules/mob/language.dm
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,64 @@
flags = RESTRICTED
syllables = list("qr","qrr","xuq","qil","quum","xuqm","vol","xrim","zaoo","qu-uu","qix","qoo","zix","*","!")


#define SKRELL_ADDITIONAL_SYLLABLES 2 // Maximum of additional syllables for first and second names

/datum/language/skrell/get_random_name() // Name generator authors: @saichi23 && @cadavrik
// Now I love making list in list in list in list in list
// Two sublists were made by authors so that the names would turn out most consonant for reading (in a way that's possible for skrells)
var/list/ru_name_syllables = list(
list( // list 1
list("заоо", "зао", "зикс", "зо", "йуо", "кью", "кьюм", "кси", "ксу", "квум", "кву", // sublist1
"кви", "квей", "квиш", "куу", "кюан", "киэн", "ку", "кил", "лиа", "люик", "луи",
"рио", "сейу", "тсой", "уль", "улур", "урр", "ур", "цу", "эль", "эо", "эу"),

list(
"аг", "вум", "вул", "вол", "гли", "зи", "заоо", "зао", "зикс", "зуо", "зук", "зуво", // sublist2
"икс", "ил", "ис", "йук", "кву", "квум", "куум", "куо", "куа", "куак", "кул", "квол",
"кью", "кьюа", "кэ", "кин", "кии", "кс", "ки", "киу", "кос", "лоа", "лак", "лум", "лик",
"лии", "ллак", "мзикс", "мвол", "ори", "ору", "орр", "ррум", "ру", "руум", "руа", "рл",
"сэк", "су", "сиа", "тейе", "тейку", "тсу", "туа", "туи", "ту", "тал", "уат", "уок", "урр",
"уоо", "уо", "уик", "уии", "уэк", "эйкс", "эль", "эрр", "эй", "эйс", "о", "у", "а", "з", "э", "м" ,"к", "с", "р"
)
),

list( // list 2
list("заоо", "зао", "зо", "йуо", "лиа", "луи", "рио", "сейу", "эо"), // sublist1

list(
"вум", "вул", "вол", "гли", "зи", "заоо", "зао", "зикс", "зуо", "зук", "зуво", // sublist2
"йук", "кву", "квум", "куум", "куо", "куа", "куак", "кул", "квол", "кью", "кьюа",
"кэ", "кин", "кии", "кс", "ки", "киу", "кос", "лоа", "лак", "лум", "лик", "лии", "ллак",
"мзикс", "мвол", "ррум", "ру", "руум", "руа", "рл", "сэк", "су", "сиа", "тейе", "тейку",
"тсу", "туа", "туи", "ту", "тал", "з", "м", "к", "с", "р"
)
)
)

var/full_name = ""

for(var/i in 1 to 2) // First and second names, making from 2-3 syllables each.
var/apostrophe = "'"
var/new_name = ""
var/using_list = rand(1, LAZYLEN(ru_name_syllables)) // We use only one list for the first name and one list for the second name, without mixing syllables from different lists.

new_name += pick(ru_name_syllables[using_list][1]) // The first syllable is only from the first sublist.

for(var/add_syllables in 1 to rand(1, SKRELL_ADDITIONAL_SYLLABLES)) // Additional 1-2 syllables, taken from sublist2.
if(apostrophe && prob(50))
new_name += apostrophe
apostrophe = null // Adding "'" with chance, but only once for first and second names

new_name += pick(ru_name_syllables[using_list][2])

full_name += " [capitalize(new_name)]"

return "[trim(full_name)]"

#undef SKRELL_ADDITIONAL_SYLLABLES


/datum/language/vox
name = "Vox-pidgin"
desc = "The common tongue of the various Vox ships making up the Shoal. It sounds like chaotic shrieking to everyone else."
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/species/diona.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
return FALSE
if("salglu_solution")
if(prob(33))
H.adjustBruteLoss(-1)
H.adjustFireLoss(-1)
H.adjustBruteLoss(-1, FALSE, affect_robotic = FALSE)
H.adjustFireLoss(-1, affect_robotic = FALSE)
H.reagents.remove_reagent(R.id, R.metabolization_rate * H.get_metabolism() * H.digestion_ratio)
return FALSE

Expand Down
13 changes: 11 additions & 2 deletions code/modules/projectiles/guns/projectile/automatic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
magin_sound = 'sound/weapons/gun_interactions/batrifle_magin.ogg'
magout_sound = 'sound/weapons/gun_interactions/batrifle_magout.ogg'
fire_delay = 2
can_suppress = FALSE
can_suppress = TRUE
can_flashlight = TRUE
burst_size = 2
can_bayonet = TRUE
Expand All @@ -146,6 +146,11 @@
/obj/item/gun/projectile/automatic/wt550/update_icon_state()
icon_state = "wt550[magazine ? "-[CEILING(get_ammo(FALSE)/4, 1)*4]" : ""]"

/obj/item/gun/projectile/automatic/wt550/update_overlays()
. = ..()
if(suppressed)
. += image(icon = icon, icon_state = "wt-sp_supp", pixel_x = 3)


/obj/item/gun/projectile/automatic/wt550/ui_action_click(mob/user, datum/action/action, leftclick)
if(..())
Expand All @@ -165,7 +170,7 @@
magin_sound = 'sound/weapons/gun_interactions/batrifle_magin.ogg'
magout_sound = 'sound/weapons/gun_interactions/batrifle_magout.ogg'
fire_delay = 2
can_suppress = FALSE
can_suppress = TRUE
can_flashlight = TRUE
burst_size = 3
can_bayonet = FALSE
Expand All @@ -176,6 +181,10 @@
icon_state = "SP-91-RC[magazine ? "-[CEILING(get_ammo(FALSE)/5, 1)*5]" : ""]"
item_state = "SP-91-RC[magazine ? "-[get_ammo(FALSE) ? "20" : "0"]" : ""]"

/obj/item/gun/projectile/automatic/sp91rc/update_overlays()
. = ..()
if(suppressed)
. += image(icon = icon, icon_state = "wt-sp_supp", pixel_x = 3)

/obj/item/gun/projectile/automatic/sp91rc/ui_action_click(mob/user, datum/action/action, leftclick)
if(..())
Expand Down
12 changes: 6 additions & 6 deletions code/modules/reagents/chemistry/reagents/alcohol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
/datum/reagent/consumable/ethanol/hooch/on_mob_life(mob/living/carbon/M)
if(M.mind && M.mind.assigned_role == JOB_TITLE_CIVILIAN)
var/update_flags = STATUS_UPDATE_NONE
update_flags |= M.adjustBruteLoss(-1, FALSE)
update_flags |= M.adjustFireLoss(-1, FALSE)
update_flags |= M.adjustBruteLoss(-1, FALSE, affect_robotic = FALSE)
update_flags |= M.adjustFireLoss(-1, FALSE, affect_robotic = FALSE)
return ..() | update_flags

/datum/reagent/consumable/ethanol/rum
Expand Down Expand Up @@ -1468,8 +1468,8 @@

/datum/reagent/consumable/ethanol/rainbow_sky/on_mob_life(mob/living/M)
var/update_flags = STATUS_UPDATE_NONE
update_flags |= M.adjustBruteLoss(-1, FALSE)
update_flags |= M.adjustFireLoss(-1, FALSE)
update_flags |= M.adjustBruteLoss(-1, FALSE, affect_robotic = FALSE)
update_flags |= M.adjustFireLoss(-1, FALSE, affect_robotic = FALSE)
M.Druggy(30 SECONDS)
M.Jitter(10 SECONDS)
M.AdjustHallucinate(10 SECONDS)
Expand Down Expand Up @@ -1711,13 +1711,13 @@

/datum/reagent/consumable/ethanol/alcomender/on_mob_life(mob/living/M)
var/update_flags = STATUS_UPDATE_NONE
update_flags |= M.adjustFireLoss(-0.7, FALSE)
update_flags |= M.adjustFireLoss(-0.7, FALSE, affect_robotic = FALSE)
return ..() | update_flags

/datum/reagent/consumable/ethanol/alcomender/reaction_mob(mob/living/M, method=REAGENT_TOUCH, volume) // It is alcohol after all, so don't try to pour it on someone who's on fire ... please.
if(iscarbon(M))
if(method == REAGENT_TOUCH)
M.adjustFireLoss(-volume * 0.7)
M.adjustFireLoss(-volume * 0.7, affect_robotic = FALSE)
to_chat(M, "<span class='notice'>The diluted silver sulfadiazine soothes your burns.</span>")
return STATUS_UPDATE_NONE

Expand Down
4 changes: 2 additions & 2 deletions code/modules/reagents/chemistry/reagents/drink_cold.dm
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@
/datum/reagent/consumable/drink/cold/zaza/on_mob_life(mob/living/user)
var/update_flags = STATUS_UPDATE_NONE
if(ishuman(user) && prob(40))
update_flags |= user.adjustBruteLoss(-healamount, FALSE)
update_flags |= user.adjustFireLoss(-healamount, FALSE)
update_flags |= user.adjustBruteLoss(-healamount, FALSE, affect_robotic = FALSE)
update_flags |= user.adjustFireLoss(-healamount, FALSE, affect_robotic = FALSE)
return ..() | update_flags


Expand Down
Loading

0 comments on commit 37e3eda

Please sign in to comment.