From e90e96284e701cf04e96c6e8db7b580cd855e4ff Mon Sep 17 00:00:00 2001 From: PhantornRU Date: Sat, 20 Jan 2024 02:16:10 +1000 Subject: [PATCH] =?UTF-8?q?=D0=90=D1=82=D1=82=D0=B0=D1=87=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D1=8B,=20=D0=B0=D0=BA=D1=81=D0=B5=D1=81=D1=81?= =?UTF-8?q?=D1=83=D0=B0=D1=80=D1=8B,=20=D0=BB=D0=BE=D0=B4=D0=B0=D1=83?= =?UTF-8?q?=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/modules/clothing/clothing.dm | 4 +- modular_ss220/modular_ss220.dme | 1 + modular_ss220/ranks/_rank.dme | 14 ---- modular_ss220/ranks/{_rank.dm => _ranks.dm} | 0 modular_ss220/ranks/_ranks.dme | 7 ++ modular_ss220/ranks/code/accessory.dm | 65 +++++++++++------- .../ranks/code/accessory_security.dm | 58 ++++++++++++++-- .../ranks/code/accessory_supervisor.dm | 37 ++++++++++ modular_ss220/ranks/code/job/security_rank.dm | 22 +++--- .../ranks/code/job/supervisor_rank.dm | 4 ++ .../clothing/mob/attachments_overlay.dmi | Bin 933 -> 942 bytes 11 files changed, 157 insertions(+), 55 deletions(-) delete mode 100644 modular_ss220/ranks/_rank.dme rename modular_ss220/ranks/{_rank.dm => _ranks.dm} (100%) create mode 100644 modular_ss220/ranks/_ranks.dme create mode 100644 modular_ss220/ranks/code/accessory_supervisor.dm create mode 100644 modular_ss220/ranks/code/job/supervisor_rank.dm diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 3c3ceea9d347..fc17b34a2c2a 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -731,7 +731,7 @@ var/mob/living/carbon/human/H = user if(H.get_item_by_slot(SLOT_HUD_JUMPSUIT) == src) for(var/obj/item/clothing/accessory/A in accessories) - A.attached_unequip() + A.attached_unequip(user) // SS220 EDIT - FIX /obj/item/clothing/under/equipped(mob/user, slot, initial) ..() @@ -739,7 +739,7 @@ return if(slot == SLOT_HUD_JUMPSUIT) for(var/obj/item/clothing/accessory/A in accessories) - A.attached_equip() + A.attached_equip(user) // SS220 EDIT - FIX /* * # can_attach_accessory diff --git a/modular_ss220/modular_ss220.dme b/modular_ss220/modular_ss220.dme index 53a170e02283..8e0f223a9a41 100644 --- a/modular_ss220/modular_ss220.dme +++ b/modular_ss220/modular_ss220.dme @@ -77,6 +77,7 @@ #include "phrases/_phrases.dme" #include "species_whitelist/_species_whitelist.dme" #include "antagonists/_antagonists.dme" +#include "ranks/_ranks.dme" // --- PRIME --- // // #define MODPACK_MAIN_ONLY diff --git a/modular_ss220/ranks/_rank.dme b/modular_ss220/ranks/_rank.dme deleted file mode 100644 index 78355d28b543..000000000000 --- a/modular_ss220/ranks/_rank.dme +++ /dev/null @@ -1,14 +0,0 @@ -#include "_ranks.dm" - -#include "code/accessory.dm" -#include "code/accessory_security.dm" -#include "code/job/security_rank.dm" -// BEGIN_INTERNALS -// END_INTERNALS -// BEGIN_FILE_DIR -#define FILE_DIR . -// END_FILE_DIR -// BEGIN_PREFERENCES -// END_PREFERENCES -// BEGIN_INCLUDE -// END_INCLUDE diff --git a/modular_ss220/ranks/_rank.dm b/modular_ss220/ranks/_ranks.dm similarity index 100% rename from modular_ss220/ranks/_rank.dm rename to modular_ss220/ranks/_ranks.dm diff --git a/modular_ss220/ranks/_ranks.dme b/modular_ss220/ranks/_ranks.dme new file mode 100644 index 000000000000..31ed897f6107 --- /dev/null +++ b/modular_ss220/ranks/_ranks.dme @@ -0,0 +1,7 @@ +#include "_ranks.dm" + +#include "code/accessory.dm" +#include "code/accessory_security.dm" +#include "code/accessory_supervisor.dm" +#include "code/job/security_rank.dm" +#include "code/job/supervisor_rank.dm" diff --git a/modular_ss220/ranks/code/accessory.dm b/modular_ss220/ranks/code/accessory.dm index 6a7f032847c5..49ace57cd746 100644 --- a/modular_ss220/ranks/code/accessory.dm +++ b/modular_ss220/ranks/code/accessory.dm @@ -6,6 +6,7 @@ name = "голографические погоны" desc = "Погоны выдаваемые при выслуге лет. Наденьте их и каждый увидит ваше звание." icon = 'modular_ss220/ranks/icons/clothing/attachments.dmi' + icon_override = 'modular_ss220/ranks/icons/clothing/mob/attachments_overlay.dmi' icon_state = "holobadge" item_state = "" //no inhands item_color = "holobadge" @@ -23,63 +24,77 @@ . = ..() inv_overlay = image("icon" = 'modular_ss220/ranks/icons/clothing/mob/attachments_overlay.dmi', "icon_state" = "[item_color? "[item_color]" : "[icon_state]"]") if(!length(rank_exp_order_dict) || !(length(exp_types))) - QDEL(src) + qdel(src) + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + owner = H.mind + get_rank_name(H) // ============= Attach&Pick ============= -/obj/item/clothing/accessory/rank/pickup(mob/living/user) + +/obj/item/clothing/under/attach_accessory(obj/item/clothing/accessory/A, mob/user, unequip = FALSE) + if(!istype(A, /obj/item/clothing/accessory/rank)) + return FALSE + var/obj/item/clothing/accessory/rank/attachment = A + if(!attachment.check_allowed_to_attach(user)) + to_chat(user, span_warning("При приближении к цели, [src.name] деактивируется!")) + return FALSE . = ..() - check_allowed_to_attach(user) -/obj/item/clothing/accessory/on_attached(obj/item/clothing/under/S, mob/user as mob) +/obj/item/clothing/accessory/rank/attack(mob/living/carbon/human/H, mob/living/user) + . = TRUE + if(!check_allowed_to_attach(H)) + to_chat(user, span_warning("При приближении к [H], [src.name] деактивируется!")) + return FALSE . = ..() - if(!check_allowed_to_attach(user)) - return +// Clothing equip at human +/obj/item/clothing/accessory/rank/attached_equip(mob/user) saved_real_name = user.real_name - user.rename_character(M.real_name, get_rank_name(user)) + user.rename_character(user.real_name, get_rank_name(user)) -/obj/item/clothing/accessory/on_removed(mob/user) . = ..() - user.rename_character(M.real_name, saved_real_name) -/obj/item/clothing/accessory/rank/attached_equip(mob/user) +// Clothing drop from human +/obj/item/clothing/accessory/rank/attached_unequip(mob/user) + user.rename_character(user.real_name, saved_real_name) + . = ..() - if(!check_allowed_to_attach(user)) - return - saved_real_name = user.real_name - user.rename_character(M.real_name, get_rank_name(user)) +/obj/item/clothing/accessory/rank/on_attached(obj/item/clothing/under/S, mob/user as mob) + attached_equip(user) + . = ..() -/obj/item/clothing/accessory/rank/attached_unequip(mob/user) +/obj/item/clothing/accessory/rank/on_removed(mob/user) + attached_unequip(user) . = ..() - user.rename_character(M.real_name, saved_real_name) /obj/item/clothing/accessory/rank/proc/check_allowed_to_attach(mob/user) - if(user.mind) + if(!user.mind) to_chat(user, span_warning("[src.name] слетели с [user], не зафиксировав в нём отклика разума.")) return FALSE + if(!owner) owner = user.mind - to_chat(user, span_notice("[src.name] привязались к [user].")) + return TRUE + if(user.mind == owner) return TRUE - to_chat(user, span_warning("[src.name] слетели!")) - user.Confused(2 SECONDS) - user.Jitter(1 SECONDS) - if(has_suit) - has_suit.detach_accessory(src, null) - return FALSE + return FALSE // ============= Initial Name ============= /obj/item/clothing/accessory/rank/proc/get_rank_name(mob/user) var/exp_sum = 0 + var/datum/job/job_req + if(add_job_req_exp) + job_req = SSjobs.GetJob(user.job) var/list/play_records = params2list(user.client.prefs.exp) for(var/exp_type in exp_types) if(!(exp_type in play_records)) continue - exp_sum += text2num(play_records[exp_type]) + exp_sum += text2num(play_records[exp_type]) - (job_req ? job_req.exp_map[exp_type] : 0) var/choosen_rank for(var/rank in rank_exp_order_dict) diff --git a/modular_ss220/ranks/code/accessory_security.dm b/modular_ss220/ranks/code/accessory_security.dm index fb27883052e4..f53d52aafd80 100644 --- a/modular_ss220/ranks/code/accessory_security.dm +++ b/modular_ss220/ranks/code/accessory_security.dm @@ -2,9 +2,10 @@ // Воинские и офицерские звания // ================================= -// Officer, Detective +// Officer /obj/item/clothing/accessory/rank/sec icon_state = "holobadge_rank" + item_state = "gold_id" item_color = "holobadge_rank" exp_types = list(EXP_TYPE_SECURITY) rank_exp_order_dict = list( @@ -28,12 +29,59 @@ "Гвардии Прапорщик" = 3000, ) -// HOS, Warden, Blueshield +// Detective +/obj/item/clothing/accessory/rank/sec/detective + add_job_req_exp = TRUE + rank_exp_order_dict = list( + "Рядовой" = 0, + "Рядовой I кл." = 15, + "Ефрейтор" = 30, + "Мл.Сержант" = 50, + "Сержант" = 70, + "Ст.Сержант" = 80, + "Старшина" = 100, + + // Дослужился до дековских и полицейских званий + "Сыщик" = 150, + "Следователь" = 300, + "Ст.Следователь" = 500, + "Специалист Бюро" = 700, + "Инспектор" = 1000, + "Начальник Исследовательского Бюро" = 3000, // большие часы. Большое название. + ) + +// Warden +/obj/item/clothing/accessory/rank/sec/warden + icon_state = "holobadge_rank_officer" + item_color = "holobadge_rank_officer" + add_job_req_exp = TRUE + rank_exp_order_dict = list( + // у Вардена начальный ускоренный курс + "Рядовой" = 0, + "Рядовой I кл." = 2, + "Ефрейтор" = 5, + "Мл.Сержант" = 10, + "Сержант" = 15, + "Ст.Сержант" = 30, + + // Дошел до привычных званий + "Старшина" = 50, + "Прапорщик" = 100, + "Ст.Прапорщик" = 300, + + // Уникальные звания, до которых никто не дойдет. + "Смотритель" = 500, + "Надзиратель" = 1000, + "Тюремный Начальник" = 1500, + "Верховный Надзиратель" = 3000, // нафармил + ) + +// HOS /obj/item/clothing/accessory/rank/sec/officer icon_state = "holobadge_rank_officer" item_color = "holobadge_rank_officer" exp_types = list(EXP_TYPE_SECURITY, EXP_TYPE_COMMAND) - add_required_exp_for_prof = TRUE + add_job_req_exp = TRUE rank_exp_order_dict = list( "Прапорщик" = 0, "Ст.Прапорщик" = 50, @@ -51,14 +99,14 @@ ) // Special for spawns -/obj/item/clothing/accessory/rank/sec/officer/seniour +/obj/item/clothing/accessory/rank/sec/officer/supreme rank_exp_order_dict = list( "Подполковник" = 0, "Полковник" = 50, "Генерал-майор" = 150, "Генерал-лейтенант" = 300, "Генерал-полковник" = 500, - "Генерал" = 800, + "Верховный Генерал" = 800, "Гвардии Полковник" = 1000, "Гвардии Генерал" = 2000, diff --git a/modular_ss220/ranks/code/accessory_supervisor.dm b/modular_ss220/ranks/code/accessory_supervisor.dm new file mode 100644 index 000000000000..8316313eda8f --- /dev/null +++ b/modular_ss220/ranks/code/accessory_supervisor.dm @@ -0,0 +1,37 @@ +// ================================= +// Звания наблюдателей за станцией +// ================================= + +// BlueShield +/obj/item/clothing/accessory/rank/blueshield + icon_state = "holobadge_rank_officer" + item_state = "gold_id" + item_color = "holobadge_rank_officer" + exp_types = list(EXP_TYPE_SECURITY, EXP_TYPE_COMMAND) + rank_exp_order_dict = list( + // Блющилд имеет сумму опытов, от того и начинает с нуля. + "Рядовой" = 0, + "Рядовой I кл." = 5, + "Ефрейтор" = 15, + "Мл.Сержант" = 30, + "Сержант" = 50, + "Ст.Сержант" = 100, + "Старшина" = 150, + "Прапорщик" = 200, + "Ст.Прапорщик" = 300, + "Мл.Лейтенант" = 400, + "Лейтенант" = 500, + "Ст.Лейтенант" = 600, + "Капитан" = 700, + "Майор" = 900, + + // Блющилд дослужился до 1000? Шо ж... А теперь пускай попробует это! + "Гвардии Рядовой" = 1000, + "Гвардии Ефрейтор" = 1250, + "Гвардии Сержант" = 1500, + "Гвардии Старшина" = 1750, + "Гвардии Прапорщик" = 2000, + "Гвардии Лейтенант" = 2250, + "Гвардии Капитан" = 2500, + "Гвардии Майор" = 3000, + ) diff --git a/modular_ss220/ranks/code/job/security_rank.dm b/modular_ss220/ranks/code/job/security_rank.dm index 245f2ba9ce90..328b49c9db19 100644 --- a/modular_ss220/ranks/code/job/security_rank.dm +++ b/modular_ss220/ranks/code/job/security_rank.dm @@ -1,16 +1,20 @@ - -/datum/job/officer/New() +// Security +/datum/job/officer/equip(mob/living/carbon/human/H, visualsOnly, announce) . = ..() - backpack_contents |= /obj/item/clothing/accessory/rank/sec + var/accessory = new /obj/item/clothing/accessory/rank/sec(H) + H.equip_or_collect(accessory, SLOT_HUD_IN_BACKPACK) -/datum/job/detective/New() +/datum/job/detective/equip(mob/living/carbon/human/H, visualsOnly, announce) . = ..() - backpack_contents |= /obj/item/clothing/accessory/rank/sec + var/accessory = new /obj/item/clothing/accessory/rank/sec/detective(H) + H.equip_or_collect(accessory, SLOT_HUD_IN_BACKPACK) -/datum/job/warden/New() +/datum/job/warden/equip(mob/living/carbon/human/H, visualsOnly, announce) . = ..() - backpack_contents |= /obj/item/clothing/accessory/rank/sec/officer + var/accessory = new /obj/item/clothing/accessory/rank/sec/warden(H) + H.equip_or_collect(accessory, SLOT_HUD_IN_BACKPACK) -/datum/job/hos/New() +/datum/job/hos/equip(mob/living/carbon/human/H, visualsOnly, announce) . = ..() - backpack_contents |= /obj/item/clothing/accessory/rank/sec/officer + var/accessory = new /obj/item/clothing/accessory/rank/sec/officer(H) + H.equip_or_collect(accessory, SLOT_HUD_IN_BACKPACK) diff --git a/modular_ss220/ranks/code/job/supervisor_rank.dm b/modular_ss220/ranks/code/job/supervisor_rank.dm new file mode 100644 index 000000000000..35ebc665bbd7 --- /dev/null +++ b/modular_ss220/ranks/code/job/supervisor_rank.dm @@ -0,0 +1,4 @@ +/datum/job/blueshield/equip(mob/living/carbon/human/H, visualsOnly, announce) + . = ..() + var/accessory = new /obj/item/clothing/accessory/rank/blueshield(H) + H.equip_or_collect(accessory, SLOT_HUD_IN_BACKPACK) diff --git a/modular_ss220/ranks/icons/clothing/mob/attachments_overlay.dmi b/modular_ss220/ranks/icons/clothing/mob/attachments_overlay.dmi index f0ad7e0f871af50f16a711fcc56bc0a88c04cf0c..c8305bf791540227b2744ef75298a93de9e06944 100644 GIT binary patch delta 533 zcmV+w0_y#x2d)Q@$6C@!L_t(|obBB|ZW=)tK=BWhZhZU~2gJjv7DIVj0d_$+Ist{MV?G311 zlfeQTVz*ZS%arn=H*%`V%f)?pxya?^;=b*@?4x!7%aroyN4pV}7e^G}&uMT33}>@WGuzVtQab>h7k>+r zu>m8KzyTDKPyz)ui(4u-^_>iY^8}Nz0V9*Z0Th$K0T5(+SN97xGw6@Ms-t?-$fo!8I(t7YVsg9M z8qr>+lt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