Skip to content

Commit

Permalink
Merge branch 'cmss13-devs:master' into scatter-spit-a-bit-more-consis…
Browse files Browse the repository at this point in the history
…tent
  • Loading branch information
TheKillfish authored Nov 4, 2024
2 parents 32dd870 + 911e277 commit 21f9029
Show file tree
Hide file tree
Showing 28 changed files with 371 additions and 62 deletions.
20 changes: 20 additions & 0 deletions code/__HELPERS/sanitize_values.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,23 @@
if(65 to 70) . += ascii2text(ascii+32) //letters A to F - translates to lowercase
else return default
return .

/proc/sanitize_gear(list/gear, client/user)
var/list/sanitized_gear = list()
var/running_cost = 0

for(var/gear_option in gear)
if(!GLOB.gear_datums_by_name[gear_option])
continue

var/datum/gear/gear_datum = GLOB.gear_datums_by_name[gear_option]
var/new_total = running_cost + gear_datum.cost

if(new_total > MAX_GEAR_COST)
to_chat(user, SPAN_WARNING("Your [gear_option] was removed from your loadout as it exceeded the point limit."))
continue

running_cost = new_total
sanitized_gear += gear_option

return sanitized_gear
3 changes: 3 additions & 0 deletions code/__pragmas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#pragma DanglingVarType error
#pragma MissingInterpolatedExpression error
#pragma InvalidIndexOperation error
#pragma PointlessPositionalArgument error
#pragma ProcArgumentGlobal error

//3000-3999
#pragma EmptyBlock error
#pragma AmbiguousInOrder error
8 changes: 4 additions & 4 deletions code/controllers/subsystem/objectives_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ SUBSYSTEM_DEF(objectives)
for(var/datum/cm_objective/objective in medium_value)
while(LAZYLEN(objective.required_objectives) < objective.number_of_clues_to_generate && LAZYLEN(low_value))
var/datum/cm_objective/req = pick(low_value)
if(req in objective.required_objectives || (req.objective_flags & OBJECTIVE_DEAD_END))
if((req in objective.required_objectives) || (req.objective_flags & OBJECTIVE_DEAD_END))
continue //don't want to pick the same thing twice OR use a dead-end objective.
link_objectives(req, objective)

Expand All @@ -327,7 +327,7 @@ SUBSYSTEM_DEF(objectives)
for(var/datum/cm_objective/objective in high_value)
while(LAZYLEN(objective.required_objectives) < objective.number_of_clues_to_generate && LAZYLEN(medium_value))
var/datum/cm_objective/req = pick(medium_value)
if(req in objective.required_objectives || (req.objective_flags & OBJECTIVE_DEAD_END))
if((req in objective.required_objectives) || (req.objective_flags & OBJECTIVE_DEAD_END))
continue //don't want to pick the same thing twice OR use a dead-end objective.
link_objectives(req, objective)

Expand All @@ -340,7 +340,7 @@ SUBSYSTEM_DEF(objectives)
for(var/datum/cm_objective/objective in extreme_value)
while(LAZYLEN(objective.required_objectives) < objective.number_of_clues_to_generate && LAZYLEN(high_value))
var/datum/cm_objective/req = pick(high_value)
if(req in objective.required_objectives || (req.objective_flags & OBJECTIVE_DEAD_END))
if((req in objective.required_objectives) || (req.objective_flags & OBJECTIVE_DEAD_END))
continue //don't want to pick the same thing twice OR use a dead-end objective.
link_objectives(req, objective)

Expand All @@ -353,7 +353,7 @@ SUBSYSTEM_DEF(objectives)
for(var/datum/cm_objective/objective in absolute_value)
while(LAZYLEN(objective.required_objectives) < objective.number_of_clues_to_generate && LAZYLEN(extreme_value))
var/datum/cm_objective/req = pick(extreme_value)
if(req in objective.required_objectives || (req.objective_flags & OBJECTIVE_DEAD_END))
if((req in objective.required_objectives) || (req.objective_flags & OBJECTIVE_DEAD_END))
continue //don't want to pick the same thing twice OR use a dead-end objective.
link_objectives(req, objective)

Expand Down
4 changes: 2 additions & 2 deletions code/datums/global_variables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
to_chat(src, "A variable with this name ([param_var_name]) doesn't exist among global variables")
return

if(param_var_name in locked && !check_rights(R_DEBUG))
if((param_var_name in locked) && !check_rights(R_DEBUG))
return

variable = param_var_name
Expand Down Expand Up @@ -270,7 +270,7 @@
if(!variable) return
var_value = global.vars[variable]

if(variable in locked && !check_rights(R_DEBUG))
if((variable in locked) && !check_rights(R_DEBUG))
return

if(!autodetect_class)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cm_process.dm
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ GLOBAL_VAR_INIT(next_admin_bioscan, 30 MINUTES)
for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list)
if(!(current_human.z && (current_human.z in z_levels) && !istype(current_human.loc, /turf/open/space)))
continue
if(current_human.faction in FACTION_LIST_WY || current_human.job == "Corporate Liaison") //The CL is assigned the USCM faction for gameplay purposes
if((current_human.faction in FACTION_LIST_WY) || current_human.job == "Corporate Liaison") //The CL is assigned the USCM faction for gameplay purposes
num_WY++
num_headcount++
continue
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/robot_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Please wait until completion...</TT><BR>
build_cost = 75000

var/building = build_type
if (building in subtypesof(/obj/item/robot_parts) + /obj/item/fake_robot_head)
if (building in (subtypesof(/obj/item/robot_parts) + /obj/item/fake_robot_head))
if (src.metal_amount >= build_cost)
src.operating = 1
src.update_use_power(USE_POWER_ACTIVE)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/buildmode/submodes/variable_edit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
var/list/locked = list("vars", "key", "ckey", "client", "icon")

selected_key = input(usr,"Enter variable name:" ,"Name", "name")
if(selected_key in locked && !check_rights(R_DEBUG,0))
if((selected_key in locked) && !check_rights(R_DEBUG, FALSE))
return TRUE
var/type = tgui_input_list(usr,"Select variable type:", "Type", list(TYPE_TEXT, TYPE_NUMBER, TYPE_MOB_REFERENCE, TYPE_OBJ_REFERENCE, TYPE_TURF_REFERENCE))

Expand Down
74 changes: 74 additions & 0 deletions code/modules/client/color_picker.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/datum/body_picker/ui_static_data(mob/user)
. = ..()

.["icon"] = /datum/species::icobase

.["body_types"] = list()
for(var/key in GLOB.body_type_list)
var/datum/body_type/type = GLOB.body_type_list[key]
.["body_types"] += list(
list("name" = type.name, "icon" = type.icon_name)
)

.["skin_colors"] = list()
for(var/key in GLOB.skin_color_list)
var/datum/skin_color/color = GLOB.skin_color_list[key]
.["skin_colors"] += list(
list("name" = color.name, "icon" = color.icon_name, "color" = color.color)
)

.["body_sizes"] = list()
for(var/key in GLOB.body_size_list)
var/datum/body_size/size = GLOB.body_size_list[key]
.["body_sizes"] += list(
list("name" = size.name, "icon" = size.icon_name)
)

/datum/body_picker/ui_data(mob/user)
. = ..()

.["body_type"] = GLOB.body_type_list[user.client.prefs.body_type].icon_name
.["skin_color"] = GLOB.skin_color_list[user.client.prefs.skin_color].icon_name
.["body_size"] = GLOB.body_size_list[user.client.prefs.body_size].icon_name

/datum/body_picker/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()

var/datum/preferences/prefs = ui.user.client.prefs

switch(action)
if("type")
if(!GLOB.body_type_list[params["name"]])
return

prefs.body_type = params["name"]

if("size")
if(!GLOB.body_size_list[params["name"]])
return

prefs.body_size = params["name"]

if("color")
if(!GLOB.skin_color_list[params["name"]])
return

prefs.skin_color = params["name"]

prefs.ShowChoices(ui.user)
return TRUE

/datum/body_picker/tgui_interact(mob/user, datum/tgui/ui)
. = ..()

ui = SStgui.try_update_ui(user, src, ui)

if(!ui)
ui = new(user, src, "BodyPicker", "Body Picker")
ui.open()
ui.set_autoupdate(FALSE)

winset(user, ui.window.id, "focus=true")

/datum/body_picker/ui_state(mob/user)
return GLOB.always_state
33 changes: 12 additions & 21 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ GLOBAL_LIST_INIT(bgstate_options, list(
var/atom/movable/screen/rotate/alt/rotate_left
var/atom/movable/screen/rotate/rotate_right

var/static/datum/body_picker/picker = new

//doohickeys for savefiles
var/path
var/default_slot = 1 //Holder so it doesn't default to slot 1, rather the last one used
Expand Down Expand Up @@ -340,10 +342,13 @@ GLOBAL_LIST_INIT(bgstate_options, list(
dat += "<h2><b><u>Physical Information:</u></b>"
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>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>Gender:</b> <a href='?_src_=prefs;preference=gender'><b>[gender == MALE ? "Male" : "Female"]</b></a><br><br>"

dat += "<b>Skin Color:</b> [skin_color]<br>"
dat += "<b>Body Size:</b> [body_size]<br>"
dat += "<b>Body Muscularity:</b> [body_type]<br>"
dat += "<b>Edit Body:</b> <a href='?_src_=prefs;preference=body;task=input'><b>Picker</b></a><br><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 @@ -1569,23 +1574,9 @@ GLOBAL_LIST_INIT(bgstate_options, list(
if(new_h_gradient_style)
grad_style = new_h_gradient_style

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_skin_color)
skin_color = new_skin_color

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 ("body_type")
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")
picker.tgui_interact(user)
return

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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@
if(!organ_data)
organ_data = list()

gear = sanitize_list(gear)
gear = sanitize_gear(gear, owner)

traits = sanitize_list(traits)
read_traits = FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/defenses/sentry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
new_projectile.damage *= damage_mult
new_projectile.accuracy *= accuracy_mult
GIVE_BULLET_TRAIT(new_projectile, /datum/element/bullet_trait_iff, faction_group)
new_projectile.fire_at(target, src, owner_mob, new_projectile.ammo.max_range, new_projectile.ammo.shell_speed, null, FALSE)
new_projectile.fire_at(target, owner_mob, src, new_projectile.ammo.max_range, new_projectile.ammo.shell_speed, null, FALSE)
muzzle_flash(Get_Angle(get_turf(src), target))
ammo.current_rounds--
track_shot()
Expand Down
10 changes: 5 additions & 5 deletions code/modules/defenses/sentry_flamer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
accuracy_mult = 0.1
fire_delay = 0.5

/obj/structure/machinery/defenses/sentry/flamer/actual_fire(atom/A)
var/obj/projectile/P = new(create_cause_data(initial(name), owner_mob))
P.generate_bullet(new ammo.default_ammo)
GIVE_BULLET_TRAIT(P, /datum/element/bullet_trait_iff, faction_group)
P.fire_at(A, src, owner_mob, P.ammo.max_range, P.ammo.shell_speed, null)
/obj/structure/machinery/defenses/sentry/flamer/actual_fire(atom/target)
var/obj/projectile/new_projectile = new(src, create_cause_data(initial(name), owner_mob, src))
new_projectile.generate_bullet(new ammo.default_ammo)
GIVE_BULLET_TRAIT(new_projectile, /datum/element/bullet_trait_iff, faction_group)
new_projectile.fire_at(target, owner_mob, src, new_projectile.ammo.max_range, new_projectile.ammo.shell_speed, null, FALSE)
ammo.current_rounds--
track_shot()
if(ammo.current_rounds == 0)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ note dizziness decrements automatically in the mob's Life() proc.
conga_line += S.buckled
while(!end_of_conga)
var/atom/movable/A = S.pulling
if(A in conga_line || A.anchored) //No loops, nor moving anchored things.
if((A in conga_line) || A.anchored) //No loops, nor moving anchored things.
end_of_conga = TRUE
break
conga_line += A
Expand Down
8 changes: 8 additions & 0 deletions code/modules/mob/new_player/skin_color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
var/name
var/icon_name

var/color

/datum/skin_color/New()
. = ..()

var/icon/icon_to_use = icon(/datum/species::icobase, "[icon_name]_torso_[/datum/body_size/thin::icon_name]_[/datum/body_type/twig::icon_name]")
color = icon_to_use.GetPixel(icon_to_use.Width() / 2, icon_to_use.Height() / 2)

/datum/skin_color/cmplayer
name = "Extra Pale"
icon_name = "cmp1"
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,7 @@
#include "code\modules\clans\ship.dm"
#include "code\modules\client\client_defines.dm"
#include "code\modules\client\client_procs.dm"
#include "code\modules\client\color_picker.dm"
#include "code\modules\client\country_flags.dm"
#include "code\modules\client\player_details.dm"
#include "code\modules\client\preferences.dm"
Expand Down
4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-7336.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-7463.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-7470.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-7472.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-7473.yml

This file was deleted.

4 changes: 0 additions & 4 deletions html/changelogs/AutoChangeLog-pr-7474.yml

This file was deleted.

4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-7477.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Nanu, HarryOb"
delete-after: True
changes:
- code_imp: "Adds some code so if you're above the pointcap on your loadout, items will be removed to put you at the point cap limit."
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-7482.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Drathek"
delete-after: True
changes:
- code_imp: "Enabled 3 more OD pragmas for linting and fixed some ambiguous usage of In"
20 changes: 20 additions & 0 deletions html/changelogs/archive/2024-11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,23 @@
6s
- balance: Sentinel paralyzing slash stuns after 3 seconds instead of 4 and lasts
2.5 seconds from 2.
2024-11-04:
Drathek:
- bugfix: Fixes additional projectiles being fired from humans that placed a shotgun
sentry instead of the sentry.
- bugfix: Fixes cause_data for flamer sentries so now kills they make are explained
in the message and attributed to the kill counter for the sentry.
- bugfix: Fix reloading under barrel flamers with any reagent from a flamer tank
- ui: Fixed the ping relay buttons not displaying anything when clicked on the first
time. Now Button.Confirm.confirmContent will only replace children if it is
truthy.
- balance: Buffed SG armor penetration ammo damage falloff from 5 to 3.
VileBeggar:
- qol: You can now use the 'check status' verb and any stethoscope you might have
attached to your uniform directly by examining an adjacent human.
harryob:
- rscadd: a new tgui with better previews for the different skin colors / body types
/ body sizes
- admin: you can add "known alts" to players, now
vero5123:
- bugfix: Special characters are now properly sanitized and removed in bug reports.
Loading

0 comments on commit 21f9029

Please sign in to comment.