Skip to content

Commit

Permalink
Merge branch 'TauCetiStation:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
BasiaBelov authored Aug 30, 2024
2 parents bf2f261 + c415a1f commit 8d252fd
Show file tree
Hide file tree
Showing 393 changed files with 47,315 additions and 28,818 deletions.
11 changes: 7 additions & 4 deletions SQL/ss13.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ CREATE TABLE `erro_ban` (
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `erro_connection_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`datetime` datetime DEFAULT NULL,
`datetime` datetime NOT NULL,
`serverip` varchar(32) NOT NULL,
`ckey` varchar(45) DEFAULT NULL,
`ckey` varchar(45) NOT NULL,
`ip` varchar(32) NOT NULL,
`computerid` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
`computerid` varchar(45) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_uniq_history` (`ckey`,`datetime`,`computerid`,`ip`),
KEY `idx_history_cid` (`computerid`,`ckey`),
KEY `idx_history_ip` (`ip`,`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/_translation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,6 @@

#define PLUR_SECONDS_LEFT(seconds) pluralize_russian(seconds, "секунда", "секунды", "секунд") // "Осталась 1 секунда". Не путайте с нижним.
#define PLUR_SECONDS_IN(seconds) pluralize_russian(seconds, "секунду", "секунды", "секунд") // "Через 1 секунду". Не путайте с верхним.

#define PLUR_MINUTES_LEFT(minutes) pluralize_russian(minutes, "минута", "минуты", "минут") // "Осталась 1 минута". Не путайте с нижним.
#define PLUR_MINUTES_IN(minutes) pluralize_russian(minutes, "минуту", "минуты", "минут") // "Через 1 минуту". Не путайте с верхним.
68 changes: 41 additions & 27 deletions code/__DEFINES/admin.dm
Original file line number Diff line number Diff line change
@@ -1,38 +1,52 @@
//A set of constants used to determine which type of mute an admin wishes to apply:
//Please read and understand the muting/automuting stuff before changing these. MUTE_IC_AUTO etc = (MUTE_IC << 1)
//Therefore there needs to be a gap between the flags for the automute flags
#define MUTE_IC 1
#define MUTE_OOC 2
#define MUTE_PRAY 4
#define MUTE_ADMINHELP 8
#define MUTE_DEADCHAT 16
#define MUTE_MENTORHELP 32
#define MUTE_ALL 63

//Number of identical messages required to get the spam-prevention automute thing to trigger warnings and automutes
// ban types
#define BANTYPE_PERMA "PERMABAN"
#define BANTYPE_TEMP "TEMPBAN"
#define BANTYPE_JOB_PERMA "JOB_PERMABAN"
#define BANTYPE_JOB_TEMP "JOB_TEMPBAN"
#define BANTYPE_CHAT_PERMA "CHAT_PERMABAN"
#define BANTYPE_CHAT_TEMP "CHAT_TEMPBAN"

var/global/list/valid_ban_types = list(BANTYPE_PERMA, BANTYPE_TEMP, BANTYPE_JOB_PERMA, BANTYPE_JOB_TEMP, BANTYPE_CHAT_PERMA, BANTYPE_CHAT_TEMP)

// bitflags for client chat bans
#define MUTE_NONE 0
#define MUTE_IC (1<<0) // say/me
#define MUTE_OOC (1<<1) // ooc/looc/ghostchat
#define MUTE_PRAY (1<<2) // pray
#define MUTE_PM (1<<3) // mentorhelp/adminhelp

// text representation for ban database
var/global/list/mute_ban_bitfield = list(
"IC" = MUTE_IC,
"OOC" = MUTE_OOC,
"PRAY" = MUTE_PRAY,
"PM" = MUTE_PM,
)

// number of identical messages required to get the spam-prevention automute thing to trigger warnings and automutes
#define SPAM_TRIGGER_WARNING 5
#define SPAM_TRIGGER_AUTOMUTE 10

//Some constants for DB_Ban
#define BANTYPE_PERMA 1
#define BANTYPE_TEMP 2
#define BANTYPE_JOB_PERMA 3
#define BANTYPE_JOB_TEMP 4
#define BANTYPE_ANY_FULLBAN 5 //used to locate stuff to unban.
#define BANTYPE_ANY_JOB 9 //used to remove jobbans

#define BANTYPE_PERMA_STR "PERMABAN"
#define BANTYPE_TEMP_STR "TEMPBAN"
#define BANTYPE_JOB_PERMA_STR "JOB_PERMABAN"
#define BANTYPE_JOB_TEMP_STR "JOB_TEMPBAN"
#define BANTYPE_ANY_FULLBAN_STR "ANY"
#define BANTYPE_ANY_JOB_STR "ANYJOB"

#define STICKYBAN_TABLENAME "erro_stickyban"
#define STICKYBAN_CKEY_MATCHED_TABLENAME "erro_stickyban_matched_ckey"
#define STICKYBAN_CID_MATCHED_TABLENAME "erro_stickyban_matched_cid"
#define STICKYBAN_IP_MATCHED_TABLENAME "erro_stickyban_matched_ip"

// admin cooldowns
#define ADMIN_CD_IC "IC"
#define ADMIN_CD_OOC "OOC"
#define ADMIN_CD_PRAY "PRAY"
#define ADMIN_CD_PM "PM"

var/global/list/admin_cooldowns_list = list(
ADMIN_CD_IC,
ADMIN_CD_OOC,
ADMIN_CD_PRAY,
ADMIN_CD_PM,
)

#define IS_ON_ADMIN_CD(client, type) (LAZYACCESS(client.prefs.admin_cooldowns, type) > world.time)

//Please don't edit these values without speaking to Errorage first ~Carn
//Admin Permissions
#define R_BUILDMODE 1
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@
/// from base /atom/movable/proc/Moved() and /atom/proc/set_dir() return dir
#define COMSIG_ATOM_CHANGE_DIR "change_dir"

/// from base of atom/throw_impact, sent by the target hit by a thrown object. (thrown_atom, hit_atom, datum/thrownthing/throwingdatum)
#define COMSIG_ATOM_PREHITBY "atom_pre_hitby"
#define COMSIG_HIT_PREVENTED (1<<0)

// /atom/movable signals
/// from base of atom/movable/Move(): (/atom/newLoc)
#define COMSIG_MOVABLE_PRE_MOVE "movable_pre_move"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ var/global/list/bitflags = list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define NO_GENDERS "no_genders"
#define NO_SLIP "no_slip"
#define NO_MED_HEALTH_SCAN "no_med_health_scan"
#define NO_WILLPOWER "no_willpower"

//Species Diet Flags
#define DIET_MEAT 1 // Meat.
Expand Down
7 changes: 7 additions & 0 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@
// port smooth groups from tg/other sane server
#define CAN_SMOOTH_WITH_WALLS list( \
/turf/unsimulated/wall, \
/turf/unsimulated/wall/like_a_normal, \
/turf/unsimulated/wall/like_a_normal/yellow, \
/turf/unsimulated/wall/like_a_normal/red, \
/turf/unsimulated/wall/like_a_normal/purple, \
/turf/unsimulated/wall/like_a_normal/green, \
/turf/unsimulated/wall/like_a_normal/beige, \
/turf/simulated/wall, \
/turf/simulated/wall/yellow, \
/turf/simulated/wall/red, \
Expand Down Expand Up @@ -402,6 +408,7 @@
/turf/simulated/wall = "wall", \
/obj/structure/falsewall = "wall", \
/obj/machinery/door/airlock = "wall", \
/turf/unsimulated/wall/like_a_normal = "wall", \
)

// wall don't need adapter with another wall
Expand Down
12 changes: 6 additions & 6 deletions code/__DEFINES/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@
#define TK_MANA_PER_W_CLASS(cl) (2**cl)

//Nutrition levels for humans.
#define NUTRITION_LEVEL_FAT 600
#define NUTRITION_LEVEL_FAT 660
#define NUTRITION_LEVEL_FULL 550
#define NUTRITION_LEVEL_WELL_FED 450
#define NUTRITION_LEVEL_NORMAL 400
#define NUTRITION_LEVEL_FED 350
#define NUTRITION_LEVEL_HUNGRY 250
#define NUTRITION_LEVEL_STARVING 150
#define NUTRITION_LEVEL_WELL_FED 440
#define NUTRITION_LEVEL_NORMAL 330
#define NUTRITION_LEVEL_FED 220
#define NUTRITION_LEVEL_HUNGRY 110
#define NUTRITION_LEVEL_STARVING 50

#define NUTRITION_PERCENT_MAX 120
#define NUTRITION_PERCENT_ZERO 0
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

#define STATUS_EFFECT_SWARMS_GIFT /datum/status_effect/swarm_gift

#define STATUS_EFFECT_ALERTNESS /datum/status_effect/alertness

/////////////
// DEBUFFS //
/////////////
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@
#define TRAIT_FAST_WALKER "fast_walker"
#define TRAIT_BORK_SKILLCHIP "bork_skillchip"
#define TRAIT_MIMING "miming"
#define TRAIT_WILLPOWER_IMPLANT "willpower_implant"
#define TRAIT_CAN_LEAP "can_leap"

/*
* Used for movables that need to be updated, via COMSIG_ENTER_AREA and COMSIG_EXIT_AREA, when transitioning areas.
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/varedit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

/* hidden variables */
#define VE_HIDDEN_LOG \
list("address", "computer_id", "guard", "related_accounts_ip", "related_accounts_cid", "lastKnownIP", "telemetry_connections")
list("address", "computer_id", "guard", "related_accounts_ip", "related_accounts_cid", "admin_cid_request_cache", "admin_ip_request_cache", "lastKnownIP", "telemetry_connections")

var/global/list/duplicate_forbidden_vars = list(
"tag", "area", "type", "loc", "locs", "vars", "verbs", "contents",
Expand Down
8 changes: 8 additions & 0 deletions code/__HELPERS/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@

return "[output][and_text][input[index]]"

/proc/list2text(list/input, separator = ", ")
. = ""

for(var/line in input)
if(length(.))
. += separator
. += line

//Returns list element or null. Should prevent "index out of bounds" error.
/proc/listgetindex(list/list,index)
if(istype(list) && list.len)
Expand Down
26 changes: 26 additions & 0 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,32 @@
for(var/datum/ringtone/Ring as anything in subtypesof(/datum/ringtone))
global.ringtones_by_names["[initial(Ring.name)]"] = new Ring

init_washing_items_list()

/proc/init_washing_items_list()
var/list/path_list = list(/obj/item/clothing/mask,
/obj/item/clothing/head,
/obj/item/clothing/gloves,
/obj/item/clothing/shoes,
/obj/item/clothing/suit,
/obj/item/weapon/bedsheet,
/obj/item/clothing/under)

global.washing_items_list = typecacheof(path_list, ignore_root_path = TRUE)

global.washing_items_list[/obj/item/stack/sheet/hairlesshide] = TRUE

global.washing_items_list -= /obj/item/clothing/suit/space
global.washing_items_list -= /obj/item/clothing/suit/syndicatefake
global.washing_items_list -= /obj/item/clothing/suit/cyborg_suit
global.washing_items_list -= /obj/item/clothing/suit/bomb_suit
global.washing_items_list -= /obj/item/clothing/suit/armor
global.washing_items_list -= /obj/item/clothing/mask/gas
global.washing_items_list -= /obj/item/clothing/mask/cigarette
global.washing_items_list -= /obj/item/clothing/head/syndicatefake
global.washing_items_list -= /obj/item/clothing/head/helmet
global.washing_items_list -= /obj/item/clothing/gloves/pipboy

/proc/init_joblist() // Moved here because we need to load map config to edit jobs, called from SSjobs
//List of job. I can't believe this was calculated multiple times per tick!
for(var/T in (subtypesof(/datum/job) - list(/datum/job/ai,/datum/job/cyborg)))
Expand Down
5 changes: 5 additions & 0 deletions code/__HELPERS/matrices.dm
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@
0, 1, 0,
0, 0, 1,
0, 0, 0)
if("yellow")
matrix = list(1.2, 0.1, 0,
0, 1, 0,
0, 0, 1,
-0.05, -0.05, -0.05)
if("nvg")
matrix = list(1,0,0,
0,1.1,0,
Expand Down
126 changes: 126 additions & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,132 @@
if(gender==FEMALE) return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names))
else return capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))

/proc/random_eye_color()
var/red
var/green
var/blue

var/col = pick ("black", "grey", "brown", "chestnut", "blue", "lightblue", "green", "albino")
switch(col)
if("black")
red = 0
green = 0
blue = 0
if("grey")
red = rand (100, 200)
green = red
blue = red
if("brown")
red = 102
green = 51
blue = 0
if("chestnut")
red = 153
green = 102
blue = 0
if("blue")
red = 51
green = 102
blue = 204
if("lightblue")
red = 102
green = 204
blue = 255
if("green")
red = 0
green = 102
blue = 0
if("albino")
red = rand (200, 255)
green = rand (0, 150)
blue = rand (0, 150)

return list(red, green, blue)

/proc/random_hair_color()
var/red
var/green
var/blue

var/col = pick ("blonde", "black", "chestnut", "copper", "brown", "wheat", "old", "punk")
switch(col)
if("blonde")
red = 255
green = 255
blue = 0
if("black")
red = 0
green = 0
blue = 0
if("chestnut")
red = 153
green = 102
blue = 51
if("copper")
red = 255
green = 153
blue = 0
if("brown")
red = 102
green = 51
blue = 0
if("wheat")
red = 255
green = 255
blue = 153
if("old")
red = rand (100, 255)
green = red
blue = red
if("punk")
red = rand (0, 255)
green = rand (0, 255)
blue = rand (0, 255)

return list(red, green, blue)

/proc/random_skin_color() // for species who has skin_color flag
var/red
var/green
var/blue

var/col = pick ("black", "grey", "brown", "chestnut", "blue", "lightblue", "green", "albino")
switch(col)
if("black")
red = 0
green = 0
blue = 0
if("grey")
red = rand (100, 200)
green = red
blue = red
if("brown")
red = 102
green = 51
blue = 0
if("chestnut")
red = 153
green = 102
blue = 0
if("blue")
red = 51
green = 102
blue = 204
if("lightblue")
red = 102
green = 204
blue = 255
if("green")
red = 0
green = 102
blue = 0
if("albino")
red = rand (200, 255)
green = rand (0, 150)
blue = rand (0, 150)

return list(red, green, blue)

/proc/random_skin_tone()
switch(pick(60;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino"))
if("caucasian") . = -10
Expand Down
Loading

0 comments on commit 8d252fd

Please sign in to comment.