Skip to content

Commit

Permalink
Merge branch 'cmss13-devs:master' into the-hunt-grounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Joelampost authored Nov 3, 2024
2 parents cc5b491 + 34e901b commit f38bc26
Show file tree
Hide file tree
Showing 44 changed files with 655 additions and 174 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/weapon_stats.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ It DOES NOT control where your bullets go, that's scatter and projectile varianc
////SCATTER////
*/

#define SCATTER_AMOUNT_NEURO 60
#define SCATTER_AMOUNT_NEURO 45
#define SCATTER_AMOUNT_TIER_1 15
#define SCATTER_AMOUNT_TIER_2 10
#define SCATTER_AMOUNT_TIER_3 8
Expand Down
1 change: 1 addition & 0 deletions code/datums/ammo/bullet/special_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
name = "armor-piercing smartgun bullet"
icon_state = "bullet"

damage_falloff = DAMAGE_FALLOFF_TIER_8
accurate_range = 12
accuracy = HIT_ACCURACY_TIER_2
damage = 20
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ammo/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
return

if(ishuman(M))
M.apply_effect(2.5, SUPERSLOW)
M.apply_effect(4, SUPERSLOW)
M.visible_message(SPAN_DANGER("[M]'s movements are slowed."))

var/no_clothes_neuro = FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/datums/bug_report.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

/datum/tgui_bug_report_form/proc/sanitize_payload(list/params)
for(var/param in params)
params[param] = sanitize(params[param], list("\t"=" ",""=" "))
params[param] = sanitize(params[param], list("\t"=" ",""=" ","<"=" ",">"=" ","&"=" "))

return params

Expand Down
124 changes: 124 additions & 0 deletions code/datums/entities/player_sticky_ban.dm
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,127 @@ BSQL_PROTECT_DATUM(/datum/entity/stickyban)
"ip",
"linked_stickyban",
)

/// Returns either a list containing the primary CKEYs this alt is connected to,
/// or FALSE.
/proc/get_player_is_alt(ckey)
var/list/datum/view_record/known_alt/alts = DB_VIEW(/datum/view_record/known_alt, DB_COMP("ckey", DB_EQUALS, ckey))
if(!length(alts))
return FALSE

var/ckeys = list()
for(var/datum/view_record/known_alt/alt as anything in alts)
ckeys += alt.player_ckey

return ckeys

/client/proc/add_known_alt()
set name = "Add Known Alt"
set category = "Admin.Alt"

var/player_ckey = ckey(tgui_input_text(src, "What is the player's primary Ckey?", "Player Ckey"))
if(!player_ckey)
return

var/datum/entity/player/player = get_player_from_key(player_ckey)
if(!istype(player))
return

var/existing_alts = get_player_is_alt(player_ckey)
if(existing_alts)
var/confirm = tgui_alert(src, "Primary Ckey [player_ckey] is already an alt for [english_list(existing_alts)].", "Primary Ckey", list("Confirm", "Cancel"))

if(confirm != "Confirm")
return

var/whitelist_to_add = ckey(tgui_input_text(src, "What is the Ckey that should be added to known alts?", "Alt Ckey"))
if(!whitelist_to_add)
return

var/alts_existing_primaries = get_player_is_alt(whitelist_to_add)
if(alts_existing_primaries)
if(player_ckey in alts_existing_primaries)
to_chat(src, SPAN_WARNING("The alt '[whitelist_to_add]' is already set as an alt Ckey for '[player_ckey]'."))
return

var/confirm = tgui_alert(src, "Alt is already an alt for [english_list(alts_existing_primaries)].", "Alt Ckey", list("Confirm", "Cancel"))

if(confirm != "Confirm")
return

var/datum/entity/known_alt/alt = DB_ENTITY(/datum/entity/known_alt)
alt.player_id = player.id
alt.player_ckey = player.ckey
alt.ckey = whitelist_to_add

alt.save()

to_chat(src, SPAN_NOTICE("[alt.ckey] added to the known alts of [player.ckey]."))

/client/proc/remove_known_alt()
set name = "Remove Known Alt"
set category = "Admin.Alt"

var/player_ckey = ckey(tgui_input_text(src, "What is the player's primary Ckey?", "Player Ckey"))
if(!player_ckey)
return

var/datum/entity/player/player = get_player_from_key(player_ckey)
if(!istype(player))
return

var/existing_alts = get_player_is_alt(player_ckey)
if(existing_alts)
var/confirm = tgui_alert(src, "Primary Ckey [player_ckey] is already an alt for [english_list(existing_alts)].", "Primary Ckey", list("Confirm", "Cancel"))

if(confirm != "Confirm")
return

var/list/datum/view_record/known_alt/alts = DB_VIEW(/datum/view_record/known_alt, DB_COMP("player_id", DB_EQUALS, player.id))
if(!length(alts))
to_chat(src, SPAN_WARNING("User has no alts on record."))
return

var/options = list()
for(var/datum/view_record/known_alt/alt in alts)
options[alt.ckey] = alt.id

var/picked = tgui_input_list(src, "Which known alt should be removed?", "Alt Removal", options)
if(!picked)
return

var/picked_id = options[picked]
var/datum/entity/known_alt/to_delete = DB_ENTITY(/datum/entity/known_alt, picked_id)
to_delete.delete()

to_chat(src, SPAN_NOTICE("[picked] removed from the known alts of [player.ckey]."))

/datum/entity/known_alt
var/player_id
var/player_ckey
var/ckey

/datum/entity_meta/known_alt
entity_type = /datum/entity/known_alt
table_name = "known_alts"
field_types = list(
"player_id" = DB_FIELDTYPE_BIGINT,
"player_ckey" = DB_FIELDTYPE_STRING_LARGE,
"ckey" = DB_FIELDTYPE_STRING_LARGE,
)

/datum/view_record/known_alt
var/id
var/player_id
var/player_ckey
var/ckey

/datum/entity_view_meta/known_alt
root_record_type = /datum/entity/known_alt
destination_entity = /datum/view_record/known_alt
fields = list(
"id",
"player_id",
"player_ckey",
"ckey",
)
9 changes: 6 additions & 3 deletions code/game/objects/items/storage/smartpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@
update_icon(user)

/obj/item/storage/backpack/marine/smartpack/proc/protective_form(mob/living/carbon/human/user)
if(!istype(user) || activated_form || immobile_form)
if(!istype(user) || activated_form || immobile_form || user.stat == DEAD)
to_chat(user, SPAN_WARNING("You cannot use the S-V42 prototype smartpack right now."))
return

if(battery_charge < PROTECTIVE_COST)
Expand Down Expand Up @@ -224,7 +225,8 @@


/obj/item/storage/backpack/marine/smartpack/proc/immobile_form(mob/living/user)
if(activated_form)
if(activated_form || user.stat == DEAD)
to_chat(user, SPAN_WARNING("You cannot use the S-V42 prototype smartpack right now."))
return

if(battery_charge < IMMOBILE_COST && !immobile_form)
Expand Down Expand Up @@ -263,7 +265,8 @@


/obj/item/storage/backpack/marine/smartpack/proc/repair_form(mob/user)
if(!ishuman(user) || activated_form || repairing)
if(!ishuman(user) || activated_form || repairing || user.stat == DEAD)
to_chat(user, SPAN_WARNING("You cannot use the S-V42 prototype smartpack right now."))
return

if(battery_charge < REPAIR_COST)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ GLOBAL_LIST_INIT(admin_verbs_default, list(
/client/proc/cmd_admin_tacmaps_panel,
/client/proc/other_records,
/client/proc/toggle_admin_afk_safety,
/client/proc/add_known_alt,
/client/proc/remove_known_alt,
/client/proc/toogle_door_control,
))

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 @@ -341,10 +343,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 @@ -1579,23 +1584,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
Loading

0 comments on commit f38bc26

Please sign in to comment.