Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13 int…
Browse files Browse the repository at this point in the history
…o pr/180
  • Loading branch information
AndroBetel committed Jun 11, 2024
2 parents 8ba72de + 51626de commit 54c5105
Show file tree
Hide file tree
Showing 53 changed files with 519 additions and 351 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

//#define AREA_LAYER 1

#define DISPLACEMENT_PLATE_RENDER_LAYER 1
#define DISPLACEMENT_PLATE_RENDER_TARGET "*DISPLACEMENT_PLATE_RENDER_TARGET"

#define UNDER_TURF_LAYER 1.99

#define TURF_LAYER 2
Expand Down
3 changes: 2 additions & 1 deletion code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -920,8 +920,9 @@ world
// From /datum/preferences/proc/copy_appearance_to
body.age = original.age
body.gender = original.gender
body.ethnicity = original.ethnicity
body.skin_color = original.skin_color
body.body_type = original.body_type
body.body_size = original.body_size

body.r_eyes = original.r_eyes
body.g_eyes = original.g_eyes
Expand Down
9 changes: 6 additions & 3 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#define isdeaf(A) (ismob(A) && ((A?:sdisabilities & DISABILITY_DEAF) || A?:ear_deaf))
#define xeno_hivenumber(A) (isxeno(A) ? A?:hivenumber : FALSE)

/proc/random_ethnicity()
return pick(GLOB.ethnicities_list)
/proc/random_skin_color()
return pick(GLOB.skin_color_list)

/proc/random_body_type()
return pick(GLOB.body_types_list)
return pick(GLOB.body_type_list)

/proc/random_body_size()
return pick(GLOB.body_size_list)

/proc/random_hair_style(gender, species = "Human")
var/h_style = "Crewcut"
Expand Down
16 changes: 11 additions & 5 deletions code/__HELPERS/sanitize_values.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,24 @@
else return default
return default

/proc/sanitize_ethnicity(ethnicity, default = "Western")
if (ethnicity in GLOB.ethnicities_list)
return ethnicity
/proc/sanitize_skin_color(skin_color, default = "Pale 2")
if(skin_color in GLOB.skin_color_list)
return skin_color

return default

/proc/sanitize_body_type(body_type, default = "Mesomorphic (Average)")
if (body_type in GLOB.body_types_list)
/proc/sanitize_body_type(body_type, default = "Lean")
if(body_type in GLOB.body_type_list)
return body_type

return default

/proc/sanitize_body_size(body_size, default = "Average")
if(body_size in GLOB.body_size_list)
return body_size

return default

/proc/sanitize_hexcolor(color, default="#000000")
if(!istext(color)) return default
var/len = length(color)
Expand Down
9 changes: 5 additions & 4 deletions code/_globalvars/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,11 @@ GLOBAL_LIST_INIT(custom_event_info_list, setup_custom_event_info())
GLOBAL_LIST_INIT(poster_designs, subtypesof(/datum/poster))

//Preferences stuff
// Ethnicities
GLOBAL_REFERENCE_LIST_INDEXED(ethnicities_list, /datum/ethnicity, name) // Stores /datum/ethnicity indexed by name
// Body Types
GLOBAL_REFERENCE_LIST_INDEXED(body_types_list, /datum/body_type, name) // Stores /datum/body_type indexed by name
// Skin colors
GLOBAL_REFERENCE_LIST_INDEXED(skin_color_list, /datum/skin_color, name) // Stores /datum/skin_color indexed by name
// Body
GLOBAL_REFERENCE_LIST_INDEXED(body_type_list, /datum/body_type, name) // Stores /datum/body_type indexed by name
GLOBAL_REFERENCE_LIST_INDEXED(body_size_list, /datum/body_size, name) // Stores /datum/body_size indexed by name
//Hairstyles
GLOBAL_REFERENCE_LIST_INDEXED(hair_styles_list, /datum/sprite_accessory/hair, name) //stores /datum/sprite_accessory/hair indexed by name
GLOBAL_REFERENCE_LIST_INDEXED(facial_hair_styles_list, /datum/sprite_accessory/facial_hair, name) //stores /datum/sprite_accessory/facial_hair indexed by name
Expand Down
7 changes: 7 additions & 0 deletions code/_onclick/hud/rendering/plane_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,10 @@
plane = ESCAPE_MENU_PLANE
appearance_flags = PLANE_MASTER|NO_CLIENT_COLOR
render_relay_plane = RENDER_PLANE_MASTER

/atom/movable/screen/plane_master/displacement
name = "displacement plane"
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
plane = DISPLACEMENT_PLATE_RENDER_LAYER
render_target = DISPLACEMENT_PLATE_RENDER_TARGET
render_relay_plane = null
4 changes: 4 additions & 0 deletions code/_onclick/hud/rendering/render_plate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
plane = RENDER_PLANE_GAME
render_relay_plane = RENDER_PLANE_MASTER

/atom/movable/screen/plane_master/rendering_plate/game_world/Initialize(mapload, datum/hud/hud_owner)
. = ..()
add_filter("displacer", 1, displacement_map_filter(render_source = DISPLACEMENT_PLATE_RENDER_TARGET, size = 10))

///render plate for OOC stuff like ghosts, hud-screen effects, etc
/atom/movable/screen/plane_master/rendering_plate/non_game
name = "non-game rendering plate"
Expand Down
3 changes: 3 additions & 0 deletions code/datums/autocells/explosion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ as having entered the turf.
if(QDELETED(E))
return

if(power >= 150) //shockwave for anything over 150 power
new /obj/effect/shockwave(epicenter, power/60)

E.power = power
E.power_falloff = falloff
E.falloff_shape = falloff_shape
Expand Down
35 changes: 21 additions & 14 deletions code/datums/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -333,31 +333,38 @@ GLOBAL_DATUM_INIT(data_core, /datum/datacore, new)
var/icon/icobase = H.species.icobase
var/icon/temp

var/datum/ethnicity/ET = GLOB.ethnicities_list[H.ethnicity]
var/datum/body_type/B = GLOB.body_types_list[H.body_type]
var/datum/skin_color/set_skin_color = GLOB.skin_color_list[H.skin_color]
var/datum/body_type/set_body_type = GLOB.body_type_list[H.body_type]
var/datum/body_size/set_body_size = GLOB.body_size_list[H.body_size]

var/e_icon
var/b_icon
var/skin_color_icon
var/body_type_icon
var/body_size_icon

if (!ET)
e_icon = "western"
if(!set_skin_color)
skin_color_icon = "pale2"
else
e_icon = ET.icon_name
skin_color_icon = set_skin_color.icon_name

if (!B)
b_icon = "mesomorphic"
if(!set_body_type)
body_type_icon = "lean"
else
b_icon = B.icon_name
body_type_icon = set_body_type.icon_name

preview_icon = new /icon(icobase, get_limb_icon_name(H.species, b_icon, H.gender, "torso", e_icon))
temp = new /icon(icobase, get_limb_icon_name(H.species, b_icon, H.gender, "groin", e_icon))
if(!set_body_size)
body_size_icon = "avg"
else
body_size_icon = set_body_size.icon_name

preview_icon = new /icon(icobase, get_limb_icon_name(H.species, body_size_icon, body_type_icon, H.gender, "torso", skin_color_icon))
temp = new /icon(icobase, get_limb_icon_name(H.species, body_size_icon, body_type_icon, H.gender, "groin", skin_color_icon))
preview_icon.Blend(temp, ICON_OVERLAY)
temp = new /icon(icobase, get_limb_icon_name(H.species, b_icon, H.gender, "head", e_icon))
temp = new /icon(icobase, get_limb_icon_name(H.species, body_size_icon, body_type_icon, H.gender, "head", skin_color_icon))
preview_icon.Blend(temp, ICON_OVERLAY)

for(var/obj/limb/E in H.limbs)
if(E.status & LIMB_DESTROYED) continue
temp = new /icon(icobase, get_limb_icon_name(H.species, b_icon, H.gender, E.name, e_icon))
temp = new /icon(icobase, get_limb_icon_name(H.species, body_size_icon, body_type_icon, H.gender, E.name, skin_color_icon))
if(E.status & LIMB_ROBOT)
temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
preview_icon.Blend(temp, ICON_OVERLAY)
Expand Down
48 changes: 48 additions & 0 deletions code/defines/procs/records.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/proc/CreateGeneralRecord()

Check failure on line 1 in code/defines/procs/records.dm

View workflow job for this annotation

GitHub Actions / Run Linters

DME Validator

File is not included
var/datum/data/record/G = new /datum/data/record()
G.fields["name"] = "New Record"
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
G.fields["rank"] = "Unassigned"
G.fields["real_rank"] = "Unassigned"
G.fields["sex"] = "Male"
G.fields["age"] = "Unknown"
G.fields["skin_color"] = "Unknown"
G.fields["p_stat"] = "Active"
G.fields["m_stat"] = "Stable"
G.fields["species"] = "Human"
G.fields["origin"] = "Unknown"
G.fields["faction"] = "Unknown"
G.fields["mob_faction"] = "Unknown"
G.fields["religion"] = "Unknown"
GLOB.data_core.general += G
return G

/proc/CreateSecurityRecord(name as text, id as text)
var/datum/data/record/R = new /datum/data/record()
R.fields["name"] = name
R.fields["id"] = id
R.name = text("Security Record #[id]")
R.fields["incidents"] = "None"
GLOB.data_core.security += R
return R

/proc/create_medical_record(mob/living/carbon/human/H)
var/datum/data/record/M = new /datum/data/record()
M.fields["id"] = null
M.fields["name"] = H.real_name
M.fields["b_type"] = H.b_type
M.fields["mi_dis"] = "None"
M.fields["mi_dis_d"] = "No minor disabilities have been declared."
M.fields["ma_dis"] = "None"
M.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
M.fields["alg"] = "None"
M.fields["alg_d"] = "No allergies have been detected in this patient."
M.fields["cdi"] = "None"
M.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
M.fields["last_scan_time"] = null
M.fields["last_scan_result"] = "No scan data on record"
M.fields["autodoc_data"] = list()
M.fields["autodoc_manual"] = list()
M.fields["ref"] = WEAKREF(H)
GLOB.data_core.medical += M
return M
22 changes: 22 additions & 0 deletions code/game/objects/effects/temporary_visuals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,25 @@
splatter_type = "csplatter"
color = BLOOD_COLOR_SYNTHETIC

//------------------------------------------
//Shockwaves
//------------------------------------------

/obj/effect/shockwave
icon = 'icons/effects/light_overlays/shockwave.dmi'
icon_state = "shockwave"
plane = DISPLACEMENT_PLATE_RENDER_LAYER
pixel_x = -496
pixel_y = -496

/obj/effect/shockwave/Initialize(mapload, radius, speed, easing_type = LINEAR_EASING, y_offset, x_offset)
. = ..()
if(!speed)
speed = 1
if(y_offset)
pixel_y += y_offset
if(x_offset)
pixel_x += x_offset
QDEL_IN(src, 0.5 * radius * speed)
transform = matrix().Scale(32 / 1024, 32 / 1024)
animate(src, time = 0.5 * radius * speed, transform=matrix().Scale((32 / 1024) * radius * 1.5, (32 / 1024) * radius * 1.5), easing = easing_type)
2 changes: 1 addition & 1 deletion code/game/objects/items/pamphlets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
to_chat(user, SPAN_WARNING("You know this already!"))
return FALSE

if(user.job != JOB_SQUAD_MARINE)
if(!(user.job in JOB_SQUAD_ROLES_LIST))
to_chat(user, SPAN_WARNING("Only squad riflemen can use this."))
return FALSE

Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/structures/vulture_spotter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@
unscope()
scope_attached = FALSE
desc = initial(desc) + " Though, it doesn't seem to have one attached yet."
new /obj/item/device/vulture_spotter_scope(get_turf(src), bound_rifle)
if(skillless)
new /obj/item/device/vulture_spotter_scope/skillless(get_turf(src), bound_rifle)
else
new /obj/item/device/vulture_spotter_scope(get_turf(src), bound_rifle)

/// Handler for user folding up the tripod, picking it up
/obj/structure/vulture_spotter_tripod/proc/fold_up(mob/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ GLOBAL_VAR_INIT(main_platoon_initial_name, GLOB.main_platoon_name)
if(!new_name || !istext(new_name))
return

if(length(new_name) > 10)
to_chat(src, SPAN_NOTICE("The platoon name should be 10 characters or less."))
if(length(new_name) > 16)
to_chat(src, SPAN_NOTICE("The platoon name should be 16 characters or less."))
return

var/old_name = GLOB.main_platoon_name
Expand Down
41 changes: 27 additions & 14 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ var/const/MAX_SAVE_SLOTS = 10
var/g_eyes = 0 //Eye color
var/b_eyes = 0 //Eye color
var/species = "Human" //Species datum to use.
var/ethnicity = "Western" // Ethnicity
var/body_type = "Mesomorphic (Average)" // Body Type
var/ethnicity = "Western" //Legacy, kept to update save files
var/skin_color = "Pale 2" // Skin color
var/body_size = "Average" // Body Size
var/body_type = "Lean" // Body Type
var/language = "None" //Secondary language
var/list/gear //Custom/fluff item loadout.
var/preferred_squad = "None"
Expand Down Expand Up @@ -331,8 +333,9 @@ var/const/MAX_SAVE_SLOTS = 10
dat += "<a href='?_src_=prefs;preference=all;task=random'>&reg;</A></h2>"
dat += "<b>Age:</b> <a href='?_src_=prefs;preference=age;task=input'><b>[age]</b></a><br>"
dat += "<b>Gender:</b> <a href='?_src_=prefs;preference=gender'><b>[gender == MALE ? "Male" : "Female"]</b></a><br>"
dat += "<b>Ethnicity:</b> <a href='?_src_=prefs;preference=ethnicity;task=input'><b>[ethnicity]</b></a><br>"
dat += "<b>Body Type:</b> <a href='?_src_=prefs;preference=body_type;task=input'><b>[body_type]</b></a><br>"
dat += "<b>Skin Color:</b> <a href='?_src_=prefs;preference=skin_color;task=input'><b>[skin_color]</b></a><br>"
dat += "<b>Body Size:</b> <a href='?_src_=prefs;preference=body_size;task=input'><b>[body_size]</b></a><br>"
dat += "<b>Body Muscularity:</b> <a href='?_src_=prefs;preference=body_type;task=input'><b>[body_type]</b></a><br>"
dat += "<b>Traits:</b> <a href='byond://?src=\ref[user];preference=traits;task=open'><b>Character Traits</b></a>"
dat += "<br>"

Expand Down Expand Up @@ -1201,10 +1204,12 @@ var/const/MAX_SAVE_SLOTS = 10
real_name = character_origin.generate_human_name(gender)
if ("age")
age = rand(AGE_MIN, AGE_MAX)
if ("ethnicity")
ethnicity = random_ethnicity()
if ("skin_color")
skin_color = random_skin_color()
if ("body_type")
body_type = random_body_type()
if ("body_size")
body_size = random_body_size()
if ("hair")
r_hair = rand(0,255)
g_hair = rand(0,255)
Expand Down Expand Up @@ -1563,18 +1568,24 @@ var/const/MAX_SAVE_SLOTS = 10
if(new_h_gradient_style)
grad_style = new_h_gradient_style

if ("ethnicity")
var/new_ethnicity = tgui_input_list(user, "Choose your character's ethnicity:", "Character Preferences", GLOB.ethnicities_list)
if ("skin_color")
var/new_skin_color = tgui_input_list(user, "Choose your character's skin color:", "Character Preferences", GLOB.skin_color_list)

if (new_ethnicity)
ethnicity = new_ethnicity
if (new_skin_color)
skin_color = new_skin_color

if ("body_type")
var/new_body_type = tgui_input_list(user, "Choose your character's body type:", "Character Preferences", GLOB.body_types_list)
var/new_body_type = tgui_input_list(user, "Choose your character's body type:", "Character Preferences", GLOB.body_type_list)

if (new_body_type)
body_type = new_body_type

if ("body_size")
var/new_body_size = tgui_input_list(user, "Choose your character's body size:", "Character Preferences", GLOB.body_size_list)

if (new_body_size)
body_size = new_body_size

if("facial")
var/new_facial = input(user, "Choose your character's facial-hair color:", "Character Preference", rgb(r_facial, g_facial, b_facial)) as color|null
if(new_facial)
Expand Down Expand Up @@ -2063,8 +2074,9 @@ var/const/MAX_SAVE_SLOTS = 10

character.age = age
character.gender = gender
character.ethnicity = ethnicity
character.skin_color = skin_color
character.body_type = body_type
character.body_size = body_size

character.r_eyes = r_eyes
character.g_eyes = g_eyes
Expand Down Expand Up @@ -2135,15 +2147,16 @@ var/const/MAX_SAVE_SLOTS = 10
message_admins("[character] ([character.ckey]) has spawned with their gender as plural or neuter. Please notify coders.")
character.gender = MALE

// Transfers the character's physical characteristics (age, gender, ethnicity, etc) to the mob
// Transfers the character's physical characteristics (age, gender, skin color, etc) to the mob
/datum/preferences/proc/copy_appearance_to(mob/living/carbon/human/character, safety = 0)
if(!istype(character))
return

character.age = age
character.gender = gender
character.ethnicity = ethnicity
character.skin_color = skin_color
character.body_type = body_type
character.body_size = body_size

character.r_eyes = r_eyes
character.g_eyes = g_eyes
Expand Down
Loading

0 comments on commit 54c5105

Please sign in to comment.