Skip to content

Commit

Permalink
[MIRROR] Adds Character Loadout Tab to preferences (with just a small…
Browse files Browse the repository at this point in the history
… handful of items to start) (#28126)

* Adds Character Loadout Tab to preferences (with just a small handful of items to start)

* step one rip out all the old nasties

* fixes, current bugs: donator lock, ckey lock, one item in case

* opps

* sanity checks, fixed, donator implementation, ckey locking. fixes.

* wew

* final fixes

* Update loadout_categories.dm

* Update loadout_items.dm

* Update loadout_items.dm

* Update declarations.dm

---------

Co-authored-by: MrMelbert <[email protected]>
Co-authored-by: Gandalf <[email protected]>
Co-authored-by: SpaceLoveSs13 <[email protected]>
  • Loading branch information
4 people authored and StrangeWeirdKitten committed Jun 30, 2024
1 parent f4826c6 commit d9707a2
Show file tree
Hide file tree
Showing 92 changed files with 2,822 additions and 1,663 deletions.
14 changes: 14 additions & 0 deletions code/__DEFINES/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,17 @@

/// The key used for sprite accessories that should never actually be applied to the player.
#define SPRITE_ACCESSORY_NONE "None"

// Loadout
/// Used to make something not recolorable even if it's capable
#define DONT_GREYSCALE -1
// Loadout item info keys
// Changing these will break existing loadouts
/// Tracks GAGS color information
#define INFO_GREYSCALE "greyscale"
/// Used to set custom names
#define INFO_NAMED "name"
/// Used for specific alt-reskins, like the pride pin
#define INFO_RESKIN "reskin"
/// Handles which layer the item will be on, for accessories
#define INFO_LAYER "layer"
13 changes: 13 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1153,4 +1153,17 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// Does this item bypass ranged armor checks?
#define TRAIT_BYPASS_RANGED_ARMOR "bypass_ranged_armor"

/// Traits given by settler, each with their own specific effects for cases where someone would have that trait, but not the other settler effects

#define TRAIT_EXPERT_FISHER "expert_fisher" // fishing is easier
#define TRAIT_ROUGHRIDER "roughrider" // you can improve speed on mounted animals with a good mood
#define TRAIT_STUBBY_BODY "stubby_body" // you have a stubby body that lessens your agility
#define TRAIT_BEAST_EMPATHY "beast_empathy" // you're good with animals, such as with taming them
#define TRAIT_STURDY_FRAME "sturdy_frame" // you suffer much lesser effects from equipment that slows you down

/// This item cannot be selected for or used by a theft objective (Spies, Traitors, etc.)
#define TRAIT_ITEM_OBJECTIVE_BLOCKED "item_objective_blocked"
/// This trait lets you attach limbs to any player without surgery.
#define TRAIT_EASY_ATTACH "easy_attach"

// END TRAIT DEFINES
9 changes: 9 additions & 0 deletions code/__DEFINES/~skyrat_defines/loadout.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/// Defines for extra info blurbs, for loadout items.
#define TOOLTIP_NO_ARMOR "ARMORLESS"
#define TOOLTIP_NO_DAMAGE "CEREMONIAL"
#define TOOLTIP_RANDOM_COLOR "RANDOM COLOR"
#define TOOLTIP_GREYSCALE "GREYSCALED"

#define LOADOUT_OVERRIDE_JOB "Delete job items"
#define LOADOUT_OVERRIDE_BACKPACK "Move job to backpack"
#define LOADOUT_OVERRIDE_CASE "Place all in case"
33 changes: 0 additions & 33 deletions code/__DEFINES/~skyrat_defines/loadouts.dm

This file was deleted.

1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_HAUNTED" = TRAIT_HAUNTED,
"TRAIT_HONKSPAMMING" = TRAIT_HONKSPAMMING,
"TRAIT_INNATELY_FANTASTICAL_ITEM" = TRAIT_INNATELY_FANTASTICAL_ITEM,
"TRAIT_ITEM_OBJECTIVE_BLOCKED" = TRAIT_ITEM_OBJECTIVE_BLOCKED,
"TRAIT_NEEDS_TWO_HANDS" = TRAIT_NEEDS_TWO_HANDS,
"TRAIT_NO_BARCODES" = TRAIT_NO_BARCODES,
"TRAIT_NO_STORAGE_INSERT" = TRAIT_NO_STORAGE_INSERT,
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ SUBSYSTEM_DEF(job)
SEND_SIGNAL(equipping, COMSIG_JOB_RECEIVED, job)

equipping.mind?.set_assigned_role_with_greeting(job, player_client, alt_title) // SKYRAT EDIT CHANGE - ALTERNATIVE_JOB_TITLES - ORIGINAL: equipping.mind?.set_assigned_role_with_greeting(job, player_client)
equipping.on_job_equipping(job, player_client?.prefs, player_client) // SKYRAT EDIT CHANGE - ALTERNATIVE_JOB_TITLES - ORIGINAL: equipping.on_job_equipping(job)
equipping.on_job_equipping(job, player_client) // SKYRAT EDIT CHANGE - ALTERNATIVE_JOB_TITLES - ORIGINAL: equipping.on_job_equipping(job)
job.announce_job(equipping, alt_title) // SKYRAT EDIT CHANGE - ALTERNATIVE_JOB_TITLES - ORIGINAL: job.announce_job(equipping)

if(player_client?.holder)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/processing/quirks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GLOBAL_LIST_INIT_TYPED(quirk_blacklist, /list/datum/quirk, list(
list(/datum/quirk/no_taste, /datum/quirk/vegetarian, /datum/quirk/deviant_tastes, /datum/quirk/gamer),
list(/datum/quirk/pineapple_liker, /datum/quirk/pineapple_hater, /datum/quirk/gamer),
list(/datum/quirk/alcohol_tolerance, /datum/quirk/light_drinker),
list(/datum/quirk/item_quirk/clown_enjoyer, /datum/quirk/item_quirk/mime_fan, /datum/quirk/item_quirk/pride_pin),
list(/datum/quirk/item_quirk/clown_enjoyer, /datum/quirk/item_quirk/mime_fan),
list(/datum/quirk/bad_touch, /datum/quirk/friendly),
list(/datum/quirk/extrovert, /datum/quirk/introvert),
list(/datum/quirk/prosthetic_limb, /datum/quirk/quadruple_amputee, /datum/quirk/transhumanist, /datum/quirk/body_purist),
Expand Down
7 changes: 0 additions & 7 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -457,13 +457,6 @@ SUBSYSTEM_DEF(ticker)
new_player_mob.client.prefs.hardcore_random_setup(new_player_living)
SSquirks.AssignQuirks(new_player_living, new_player_mob.client)

//SKYRAT EDIT ADDITION
if(ishuman(new_player_living))
for(var/datum/loadout_item/item as anything in loadout_list_to_datums(new_player_mob.client?.prefs?.loadout_list))
if (item.restricted_roles && length(item.restricted_roles) && !(player_assigned_role.title in item.restricted_roles))
continue
item.post_equip_item(new_player_mob.client?.prefs, new_player_living)
//SKYRAT EDIT END
CHECK_TICK

if(captainless)
Expand Down
19 changes: 0 additions & 19 deletions code/datums/quirks/neutral_quirks/pride_pin.dm

This file was deleted.

5 changes: 4 additions & 1 deletion code/game/gamemodes/objective.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GLOBAL_LIST_EMPTY(objectives) //SKYRAT EDIT ADDITION
var/name = "generic objective" //Name for admin prompts
var/explanation_text = "Nothing" //What that person is supposed to do.
///if this objective doesn't print failure or success in the roundend report
var/no_failure = FALSE
var/no_failure = FALSE
///name used in printing this objective (Objective #1)
var/objective_name = "Objective"
var/team_explanation_text //For when there are multiple owners.
Expand Down Expand Up @@ -699,6 +699,9 @@ GLOBAL_LIST_EMPTY(possible_items)
var/list/all_items = M.current.get_all_contents() //this should get things in cheesewheels, books, etc.

for(var/obj/I in all_items) //Check for items
if(HAS_TRAIT(I, TRAIT_ITEM_OBJECTIVE_BLOCKED))
continue

if(istype(I, steal_target))
if(!targetinfo) //If there's no targetinfo, then that means it was a custom objective. At this point, we know you have the item, so return 1.
return TRUE
Expand Down
16 changes: 8 additions & 8 deletions code/game/gamemodes/objective_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//Contains the target item datums for Steal objectives.
/datum/objective_item
/// How the item is described in the objective
var/name = "A silly bike horn! Honk!"
var/name = "a silly bike horn! Honk!"
/// Typepath of item
var/targetitem = /obj/item/bikehorn
/// Valid containers that the target item can be in.
Expand Down Expand Up @@ -570,7 +570,7 @@
// A number of special early-game steal objectives intended to be used with the steal-and-destroy objective.
// They're basically items of utility or emotional value that may be found on many players or lying around the station.
/datum/objective_item/steal/traitor/insuls
name = "insulated gloves"
name = "some insulated gloves"
targetitem = /obj/item/clothing/gloves/color/yellow
excludefromjob = list(JOB_CARGO_TECHNICIAN, JOB_QUARTERMASTER, JOB_ATMOSPHERIC_TECHNICIAN, JOB_STATION_ENGINEER, JOB_CHIEF_ENGINEER)
item_owner = list(JOB_STATION_ENGINEER, JOB_CHIEF_ENGINEER)
Expand All @@ -582,7 +582,7 @@
return add_item_to_steal(src, /obj/item/clothing/gloves/color/yellow)

/datum/objective_item/steal/traitor/moth_plush
name = "cute moth plush toy"
name = "a cute moth plush toy"
targetitem = /obj/item/toy/plush/moth
excludefromjob = list(JOB_PSYCHOLOGIST, JOB_PARAMEDIC, JOB_CHEMIST, JOB_MEDICAL_DOCTOR, JOB_CHIEF_MEDICAL_OFFICER, JOB_CORONER)
exists_on_map = TRUE
Expand All @@ -593,7 +593,7 @@
return add_item_to_steal(src, /obj/item/toy/plush/moth)

/datum/objective_item/steal/traitor/lizard_plush
name = "cute lizard plush toy"
name = "a cute lizard plush toy"
targetitem = /obj/item/toy/plush/lizard_plushie
exists_on_map = TRUE
difficulty = 1
Expand Down Expand Up @@ -637,7 +637,7 @@
return add_item_to_steal(src, /obj/item/book/manual/wiki/security_space_law)

/datum/objective_item/steal/traitor/rpd
name = "rapid pipe dispenser"
name = "a rapid pipe dispenser"
targetitem = /obj/item/pipe_dispenser
excludefromjob = list(
JOB_ATMOSPHERIC_TECHNICIAN,
Expand Down Expand Up @@ -683,7 +683,7 @@
objective_type = OBJECTIVE_ITEM_TYPE_SPY

/datum/objective_item/steal/spy/lamarr
name = "The Research Director's pet headcrab"
name = "the Research Director's pet headcrab"
targetitem = /obj/item/clothing/mask/facehugger/lamarr
excludefromjob = list(JOB_RESEARCH_DIRECTOR)
exists_on_map = TRUE
Expand Down Expand Up @@ -813,7 +813,7 @@
return add_item_to_steal(src, /obj/item/stamp/head)

/datum/objective_item/steal/spy/sunglasses
name = "sunglasses"
name = "some sunglasses"
targetitem = /obj/item/clothing/glasses/sunglasses
excludefromjob = list(
JOB_CAPTAIN,
Expand All @@ -832,7 +832,7 @@
You can also obtain a pair from dissassembling hudglasses."

/datum/objective_item/steal/spy/ce_modsuit
name = "the cheif engineer's advanced MOD control unit"
name = "the chief engineer's advanced MOD control unit"
targetitem = /obj/item/mod/control/pre_equipped/advanced
excludefromjob = list(JOB_CHIEF_ENGINEER)
exists_on_map = TRUE
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/items/plushes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,11 @@
desc = "An adorable stuffed toy that resembles a green lizardperson. This one fills you with nostalgia and soul."
greyscale_colors = "#66ff33#000000"

/obj/item/toy/plush/lizard_plushie/greyscale
desc = "An adorable stuffed toy that resembles a lizardperson. This one has been custom made."
greyscale_colors = "#d3d3d3#000000"
flags_1 = IS_PLAYER_COLORABLE_1

/obj/item/toy/plush/lizard_plushie/space
name = "space lizard plushie"
desc = "An adorable stuffed toy that resembles a very determined spacefaring lizardperson. To infinity and beyond, little guy."
Expand Down
9 changes: 5 additions & 4 deletions code/modules/admin/verbs/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,11 @@ ADMIN_VERB(create_mapping_job_icons, R_DEBUG, "Generate job landmarks icons", "G
for(var/obj/item/I in D)
qdel(I)
randomize_human(D)
// SKYRAT EDIT CHANGE START - ORIGINAL: D.dress_up_as_job(JB, TRUE)
if(JB.outfit)
D.equipOutfit(JB.outfit, TRUE)
// SKYRAT EDIT CHANGE END
D.dress_up_as_job(
equipping = JB,
visual_only = TRUE,
consistent = TRUE,
)
var/icon/I = icon(getFlatIcon(D), frame = 1)
job_key_to_icon[JB.title] = I // SKYRAT EDIT CHANGE - ORIGINAL: final.Insert(I, JB.title)
qdel(D)
Expand Down
14 changes: 7 additions & 7 deletions code/modules/antagonists/spy/spy_bounty.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@
continue
if(!is_station_level(thing_turf.z) && !is_mining_level(thing_turf.z))
continue
if(HAS_TRAIT(existing_thing, TRAIT_ITEM_OBJECTIVE_BLOCKED))
continue
all_valid_existing_things += existing_thing

if(!length(all_valid_existing_things))
Expand Down Expand Up @@ -253,16 +255,14 @@
return FALSE

desired_item = pick(valid_possible_items)
// We need to do some snowflake for items that do exist vs generic items
var/list/obj/item/existing_items = GLOB.steal_item_handler.objectives_by_path[desired_item.targetitem]
var/obj/item/the_item = length(existing_items) ? pick(existing_items) : desired_item.targetitem
var/the_item_name = istype(the_item) ? the_item.name : initial(the_item.name)
name = "[the_item_name] [difficulty == SPY_DIFFICULTY_HARD ? "Grand ":""]Theft"
help = "Steal any [the_item_name][desired_item.steal_hint ? ": [desired_item.steal_hint]" : "."]"
name = "[desired_item.name] [difficulty == SPY_DIFFICULTY_HARD ? "Grand ":""]Theft"
help = "Steal [desired_item.name][desired_item.steal_hint ? ": [desired_item.steal_hint]" : "."]"
return TRUE

/datum/spy_bounty/objective_item/is_stealable(atom/movable/stealing)
return istype(stealing, desired_item.targetitem) && desired_item.check_special_completion(stealing)
return istype(stealing, desired_item.targetitem) \
&& !HAS_TRAIT(stealing, TRAIT_ITEM_OBJECTIVE_BLOCKED) \
&& desired_item.check_special_completion(stealing)

/datum/spy_bounty/objective_item/random_easy
difficulty = SPY_DIFFICULTY_EASY
Expand Down
4 changes: 4 additions & 0 deletions code/modules/antagonists/traitor/objectives/steal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ GLOBAL_DATUM_INIT(steal_item_handler, /datum/objective_item_handler, new())

/datum/objective_item_handler/proc/new_item_created(datum/source, obj/item/item)
SIGNAL_HANDLER
if(HAS_TRAIT(item, TRAIT_ITEM_OBJECTIVE_BLOCKED))
return
if(!generated_items)
item.add_stealing_item_objective()
return
Expand Down Expand Up @@ -224,6 +226,8 @@ GLOBAL_DATUM_INIT(steal_item_handler, /datum/objective_item_handler, new())

/datum/traitor_objective/steal_item/proc/handle_special_case(obj/item/source, obj/item/target)
SIGNAL_HANDLER
if(HAS_TRAIT(target, TRAIT_ITEM_OBJECTIVE_BLOCKED))
return COMPONENT_FORCE_FAIL_PLACEMENT
if(istype(target, target_item.targetitem))
if(!target_item.check_special_completion(target))
return COMPONENT_FORCE_FAIL_PLACEMENT
Expand Down
1 change: 0 additions & 1 deletion code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
QDEL_NULL(view_size)
QDEL_NULL(void)
QDEL_NULL(tooltips)
QDEL_NULL(open_loadout_ui) //SKYRAT EDIT ADDITION
QDEL_NULL(loot_panel)
QDEL_NULL(parallax_rock)
QDEL_LIST(parallax_layers_cached)
Expand Down
20 changes: 5 additions & 15 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character_preview_view.dir = turn(character_preview_view.dir, -90)
*/ // ORIGINAL END - SKYRAT EDIT START:
var/backwards = params["backwards"]
character_preview_view.dir = turn(character_preview_view.dir, backwards ? 90 : -90)
character_preview_view.setDir(turn(character_preview_view.dir, backwards ? 90 : -90))
// SKYRAT EDIT END

return TRUE
Expand Down Expand Up @@ -325,16 +325,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character_preview_view.update_body()
return TRUE

if ("open_loadout")
var/datum/loadout_manager/open_loadout_ui = parent.open_loadout_ui?.resolve()
if(open_loadout_ui)
open_loadout_ui.ui_interact(usr)
else
parent.open_loadout_ui = null
var/datum/loadout_manager/tgui = new(usr)
tgui.ui_interact(usr)
return TRUE

if ("open_food")
GLOB.food_prefs_menu.ui_interact(usr)
return TRUE
Expand Down Expand Up @@ -454,6 +444,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/mob/living/carbon/human/dummy/body
/// The preferences this refers to
var/datum/preferences/preferences
/// Whether we show current job clothes or nude/loadout only
var/show_job_clothes = TRUE

/atom/movable/screen/map_view/char_preview/Initialize(mapload, datum/preferences/preferences)
. = ..()
Expand All @@ -471,16 +463,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
create_body()
else
body.wipe_state()
appearance = preferences.render_new_preview_appearance(body)

appearance = preferences.render_new_preview_appearance(body, show_job_clothes)

/atom/movable/screen/map_view/char_preview/proc/create_body()
QDEL_NULL(body)

body = new

// Without this, it doesn't show up in the menu
body.appearance_flags |= KEEP_TOGETHER // SKYRAT EDIT - Fix pixel scaling - ORIGINAL: body.appearance_flags &= ~KEEP_TOGETHER

/datum/preferences/proc/create_character_profiles()
var/list/profiles = list()

Expand Down
9 changes: 7 additions & 2 deletions code/modules/client/preferences/_preference.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@
/// support the "use gender" option.
#define PREFERENCE_PRIORITY_BODY_TYPE 5

/// Equpping items based on preferences.
/// Should happen after species and body type to make sure it looks right.
/// Mostly redundant, but a safety net for saving/loading.
#define PREFERENCE_PRIORITY_LOADOUT 6

/// The priority at which names are decided, needed for proper randomization.
#define PREFERENCE_PRIORITY_NAMES 6
#define PREFERENCE_PRIORITY_NAMES 7

/// Preferences that aren't names, but change the name changes set by PREFERENCE_PRIORITY_NAMES.
#define PREFERENCE_PRIORITY_NAME_MODIFICATIONS 7
#define PREFERENCE_PRIORITY_NAME_MODIFICATIONS 8

/// The maximum preference priority, keep this updated, but don't use it for `priority`.
#define MAX_PREFERENCE_PRIORITY PREFERENCE_PRIORITY_NAME_MODIFICATIONS
Expand Down
Loading

0 comments on commit d9707a2

Please sign in to comment.