diff --git a/code/__DEFINES/_flags/item_flags.dm b/code/__DEFINES/_flags/item_flags.dm
index e2f6caecb2a0..9631ea14a1bc 100644
--- a/code/__DEFINES/_flags/item_flags.dm
+++ b/code/__DEFINES/_flags/item_flags.dm
@@ -26,6 +26,8 @@
#define ITEM_CAN_PARRY (1<<12)
/// This item can be used in the directional blocking system. Only a basic check used to determine if we should proceed with directional block handling at all.
#define ITEM_CAN_BLOCK (1<<13)
+/// Является ли данный предмет семейной ценностью (family heirloom)
+#define FAMILY_HEIRLOOM (1<<14) // BLUEMOON ADD - выбор вещей из лодаута как family heirloom
// Flags for the clothing_flags var on /obj/item/clothing
diff --git a/code/__DEFINES/loadout.dm b/code/__DEFINES/loadout.dm
index d8d12f8f1625..c41e3ae3859b 100644
--- a/code/__DEFINES/loadout.dm
+++ b/code/__DEFINES/loadout.dm
@@ -85,6 +85,7 @@
#define LOADOUT_COLOR "loadout_color"
#define LOADOUT_CUSTOM_NAME "loadout_custom_name"
#define LOADOUT_CUSTOM_DESCRIPTION "loadout_custom_description"
+#define LOADOUT_IS_HEIRLOOM "loadout_is_heirloom" // BLUEMOON ADD - выбор вещей из лодаута как family heirloom
//loadout item flags
#define LOADOUT_CAN_NAME (1<<0) //renaming items
diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm
index fb5d2c2fad41..6527526f7968 100644
--- a/code/_globalvars/bitfields.dm
+++ b/code/_globalvars/bitfields.dm
@@ -264,6 +264,7 @@ DEFINE_BITFIELD(item_flags, list(
"NO_MAT_REDEMPTION" = NO_MAT_REDEMPTION,
"NO_PIXEL_RANDOM_DROP" = NO_PIXEL_RANDOM_DROP,
"SLOWS_WHILE_IN_HAND" = SLOWS_WHILE_IN_HAND,
+ "FAMILY_HEIRLOOM" = FAMILY_HEIRLOOM // BLUEMOON ADD - выбор вещей из лодаута как family heirloom
))
DEFINE_BITFIELD(material_flags, list(
diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm
index afa4ac26ab85..494edd186930 100644
--- a/code/controllers/subsystem/job.dm
+++ b/code/controllers/subsystem/job.dm
@@ -722,6 +722,10 @@ SUBSYSTEM_DEF(job)
if(!the_mob)
the_mob = M // cause this doesn't get assigned if player is a latejoiner
var/list/chosen_gear = the_mob.client.prefs.loadout_data["SAVE_[the_mob.client.prefs.loadout_slot]"]
+ var/heirloomer = FALSE
+ var/list/my_quirks = the_mob.client.prefs.all_quirks.Copy()
+ if("Семейная реликвия" in my_quirks)
+ heirloomer = TRUE
if(the_mob.client && the_mob.client.prefs && (chosen_gear && chosen_gear.len))
if(!ishuman(M))//no silicons allowed
return
@@ -740,6 +744,10 @@ SUBSYSTEM_DEF(job)
if(G.handle_post_equip)
permitted = FALSE
if(!permitted)
+ // BLUEMOON ADD START - выбор вещей из лодаута как family heirloom
+ if(i[LOADOUT_IS_HEIRLOOM] && heirloomer)
+ to_chat(M, "Вы не смогли взять с собой свой любимый предмет, [G.name], из-за ограничений вашей профессии или других проблем, но у вас была и другая семейная ценность, поэтому вы прихватили её!")
+ // BLUEMOON END
continue
var/obj/item/I = new G.path
if(I)
@@ -784,6 +792,14 @@ SUBSYSTEM_DEF(job)
I.forceMove(get_turf(M)) // If everything fails, just put it on the floor under the mob.
else
qdel(I)
+ // BLUEMOON ADD START - выбор вещей из лодаута как family heirloom
+ if(i[LOADOUT_IS_HEIRLOOM] && !QDELETED(I) && heirloomer)
+ I.item_flags |= FAMILY_HEIRLOOM
+ if(!i[LOADOUT_CUSTOM_NAME])
+ var/list/family_name = splittext(M.real_name, " ")
+ I.name = "\improper [family_name[family_name.len]] family [I.name]"
+ // BLUEMOON END
+
/datum/controller/subsystem/job/proc/post_equip_loadout(mob/dead/new_player/N, mob/living/M, bypass_prereqs = FALSE, can_drop = TRUE)
var/mob/the_mob = N
@@ -852,7 +868,6 @@ SUBSYSTEM_DEF(job)
I.forceMove(get_turf(M)) // If everything fails, just put it on the floor under the mob.
else
qdel(I)
-
/datum/controller/subsystem/job/proc/FreeRole(rank)
if(!rank)
return
diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm
index d9104e2f5123..6b95710ddd90 100644
--- a/code/datums/traits/negative.dm
+++ b/code/datums/traits/negative.dm
@@ -39,6 +39,7 @@
medical_record_text = "Пациент демонстрирует неестественную привязанность к семейной реликвии."
var/obj/item/heirloom
var/where
+ var/loadout_heirloom = FALSE // BLUEMOON EDIT - выбор вещей из лодаута как family heirloom
processing_quirk = TRUE
GLOBAL_LIST_EMPTY(family_heirlooms)
@@ -47,43 +48,52 @@ GLOBAL_LIST_EMPTY(family_heirlooms)
// Define holder and type
var/mob/living/carbon/human/human_holder = quirk_holder
var/obj/item/heirloom_type
-
- // The quirk holder's species - we have a 50% chance, if we have a species with a set heirloom, to choose a species heirloom.
- var/datum/species/holder_species = human_holder.dna?.species
- if(holder_species && LAZYLEN(holder_species.family_heirlooms) && prob(50))
- heirloom_type = pick(holder_species.family_heirlooms)
- else
- // Our quirk holder's job
- var/datum/job/holder_job = SSjob.GetJob(human_holder.last_mind?.assigned_role)
- if(holder_job && LAZYLEN(holder_job.family_heirlooms))
- heirloom_type = pick(holder_job.family_heirlooms)
-
- // If we didn't find an heirloom somehow, throw them a generic one
- if(!heirloom_type)
- heirloom_type = pick(/obj/item/toy/cards/deck, /obj/item/lighter, /obj/item/dice/d20)
-
- // Create the heirloom item
- heirloom = new heirloom_type(get_turf(quirk_holder))
-
+ // BLUEMOON EDIT START - выбор вещей из лодаута как family heirloom
+ for (var/obj/item/item in quirk_holder.GetAllContents())
+ if(item.item_flags & FAMILY_HEIRLOOM)
+ loadout_heirloom = TRUE
+ heirloom = item
+ if(!loadout_heirloom)
+ // The quirk holder's species - we have a 50% chance, if we have a species with a set heirloom, to choose a species heirloom.
+ var/datum/species/holder_species = human_holder.dna?.species
+ if(holder_species && LAZYLEN(holder_species.family_heirlooms) && prob(50))
+ heirloom_type = pick(holder_species.family_heirlooms)
+ else
+ // Our quirk holder's job
+ var/datum/job/holder_job = SSjob.GetJob(human_holder.last_mind?.assigned_role)
+ if(holder_job && LAZYLEN(holder_job.family_heirlooms))
+ heirloom_type = pick(holder_job.family_heirlooms)
+
+ // If we didn't find an heirloom somehow, throw them a generic one
+ if(!heirloom_type)
+ heirloom_type = pick(/obj/item/toy/cards/deck, /obj/item/lighter, /obj/item/dice/d20)
+ // Create the heirloom item
+ heirloom = new heirloom_type(get_turf(quirk_holder))
+ heirloom.item_flags |= FAMILY_HEIRLOOM
+ // Determine and assign item location
+ var/list/slots = list(
+ "В левом кармане" = ITEM_SLOT_LPOCKET,
+ "В правом кармане" = ITEM_SLOT_RPOCKET,
+ "В рюкзаке" = ITEM_SLOT_BACKPACK
+ )
+ where = human_holder.equip_in_one_of_slots(heirloom, slots, FALSE) || "под ногами"
+ // BLUEMOON EDIT END
// Add to global list
GLOB.family_heirlooms += heirloom
- // Determine and assign item location
- var/list/slots = list(
- "В левом кармане" = ITEM_SLOT_LPOCKET,
- "В правом кармане" = ITEM_SLOT_RPOCKET,
- "В рюкзаке" = ITEM_SLOT_BACKPACK
- )
- where = human_holder.equip_in_one_of_slots(heirloom, slots, FALSE) || "под ногами"
-
/datum/quirk/family_heirloom/post_add()
- if(where == "В рюкзаке")
- var/mob/living/carbon/human/H = quirk_holder
- SEND_SIGNAL(H.back, COMSIG_TRY_STORAGE_SHOW, H)
-
- to_chat(quirk_holder, "[where] находится [heirloom.name], передающаяся из поколения в поколение. Береги её!")
- var/list/family_name = splittext(quirk_holder.real_name, " ")
- heirloom.name = "\improper [family_name[family_name.len]] family [heirloom.name]"
+ // BLUEMOON EDIT START - выбор вещей из лодаута как family heirloom
+ if(!loadout_heirloom)
+ if(where == "В рюкзаке")
+ var/mob/living/carbon/human/H = quirk_holder
+ SEND_SIGNAL(H.back, COMSIG_TRY_STORAGE_SHOW, H)
+
+ to_chat(quirk_holder, "[where] находится [heirloom.name], передающаяся из поколения в поколение. Береги её!")
+ var/list/family_name = splittext(quirk_holder.real_name, " ")
+ heirloom.name = "\improper [family_name[family_name.len]] family [heirloom.name]"
+ else
+ to_chat(quirk_holder, "Ты прихватил с собой свою любимую вещь, [heirloom.name]. Береги её!")
+ // BLUEMOON EDIT END
/datum/quirk/family_heirloom/on_process()
// Ignore for dead holder
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 9be81ee4644f..a6f6a31eef22 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -316,6 +316,22 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
var/datum/block_parry_data/data = return_block_parry_datum(block_parry_data)
. += "[src] has the capacity to be used to block and/or parry. \[Show Stats\]"
+ // BLUEMOON ADD START - выбор вещей из лодаута как family heirloom
+ if(item_flags & FAMILY_HEIRLOOM)
+ var/my_heirloom = FALSE
+ if(istype(user, /mob/living))
+ var/mob/living/examiner = user
+ for(var/datum/quirk/Q in examiner.roundstart_quirks)
+ if(istype(Q, /datum/quirk/family_heirloom))
+ var/datum/quirk/family_heirloom/heirloom_quirk = Q
+ if(src == heirloom_quirk.heirloom)
+ my_heirloom = TRUE // МОЯ ПРЕЛЕСТЬ!
+ if(my_heirloom)
+ . += "[src] - это моя реликвия! Нужно её беречь!"
+ else
+ . += "[src] выглядит очень ухоженно. Видимо, этот предмет кому-то ценен..."
+ // BLUEMOON ADD END
+
if(!user.research_scanner)
return
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 172776985c9b..de00a1ed5a28 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -1340,8 +1340,16 @@ GLOBAL_LIST_EMPTY(preferences_datums)
extra_loadout_data += "
Name [loadout_item[LOADOUT_CUSTOM_NAME] ? loadout_item[LOADOUT_CUSTOM_NAME] : "N/A"]"
if(gear.loadout_flags & LOADOUT_CAN_DESCRIPTION)
extra_loadout_data += "
Description"
+ else
+ extra_loadout_data += "
Select as Heirloom
"
+ // BLUEMOON ADD START - выбор вещей из лодаута как family heirloom
+ if(loadout_item[LOADOUT_IS_HEIRLOOM])
+ extra_loadout_data += "
Select as Heirloom
"
+ else
+ extra_loadout_data += "
Select as Heirloom
"
if(ispath(gear.path, /obj/item/clothing/neck/petcollar)) //"name tag" sounds better for me, but in petcollar code "tagname" is used so let it be.
extra_loadout_data += "
Name tag [loadout_item["loadout_custom_tagname"] ? loadout_item["loadout_custom_tagname"] : "Name tag is visible for everyone looking at wearer."]"
+ // BLUEMOON ADD END
else if((gear_points - gear.cost) < 0)
class_link = "style='white-space:normal;' class='linkOff'"
else if(donoritem)
@@ -1363,8 +1371,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += gear.restricted_roles.Join(";")
dat += ""
if(!istype(gear, /datum/gear/unlockable))
+ var/is_heirloom_string = loadout_item ? (loadout_item[LOADOUT_IS_HEIRLOOM] ? "