Skip to content

Commit

Permalink
FEAT: Novice rework (#765)
Browse files Browse the repository at this point in the history
## Что этот PR делает

Перерабатываем новичков делая из них полноценные должности.
Подготавливаем площадку для добавления новых профессий.
Делаем всё модульно что делается модульно.
Добавлено отображение одежды новичков DATACORE на карте (к сожалению не
модульно).

**Дополнительно:**
Теперь должности новичков напрямую связаны с родительскими должностями,
из-за чего их слоты делятся между собой. Если у офицера всего 8 слотов
на должность, то в общей сумме офицеров и кадетов не может быть больше
8.
Добавлена возможность отказывать в появлении излишков новичковых
должностей раундстартом, из-за чего им придется входить уже после начала
игры, отдавая приоритеты людям с нормальным профессиям.
Лендмарки связаны с лендмарками "старших коллег". Увы, частично модульно
ради 1-го условия. Ибо там опять спагетти код.

## Почему это хорошо для игры

Читайте предыдущие ПРы.
Это хорошо для игры, хорошо для кода.

## Изображения изменений


![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/421465f9-b5d1-4a2e-87bd-acf41098525e)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/bc25db06-c271-4c4e-aad3-9211bfc540c1)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/2baad139-c5f0-4f46-9510-119c15ab81a7)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/54106ee9-62db-4cd4-90df-010cad9dbb33)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/c2c767d2-a043-4de7-8952-c6700ae71504)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/4d3abd6e-1442-45a2-9359-954b4074845f)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/eed51d54-b3a8-4b96-aa39-7891f43760e2)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/170f3d41-813b-4adb-87d4-9d01bb00215b)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/4cc14c3e-6bf1-44f3-8a45-50ea194da3b2)


## Тестирование

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/4e48f790-8075-44d7-8b66-5c229870428c)

Да. Обычные джобки не сломались. Новые тоже, старые тоже. Всё что могло
уйти в модуль ушло в модуль. Связь проверил, всё работает и блокируется
когда слотов не остается. Обтестил всё что мог. Консолька всё выдает,
карту, айдишники.

## Changelog

:cl:
tweak: Возвращены переработанные должности новичков (подробности в ПР'е)
tweak: Подготовлен модуль для добавления профессий
fix: Должности новичков теперь корректно отображаются в преференсах и на
карте
tweak: Должность новичка вынесена отдельной профессией с приоритетом.
tweak: Должность новичка зависит от общего числа слотов "старшей"
профессии. Общее число слотов высчитывается по схеме: Кол-во слотов у
новичка + кол-во слотов у "старшего" = число допустимых слотов, которые
могут "взять" одна из профессий.
tweak: Лендмарки (зоны спавна) новичков зависят от "старшей" профессии.
/:cl:

<!-- Оба :cl:'а должны быть на месте, что-бы чейнджлог работал! Вы
можете написать свой ник справа от первого :cl:, если хотите. Иначе
будет использован ваш ник на ГитХабе. -->
<!-- Вы можете использовать несколько записей с одинаковым префиксом
(Они используются только для иконки в игре) и удалить ненужные. Помните,
что чейнджлог должен быть понятен обычным игроком. -->
<!-- Если чейнджлог не влияет на игроков(например, это рефактор), вы
можете исключить всю секцию. -->

---------

Co-authored-by: Volodymir Ohorodnytskyi <[email protected]>
  • Loading branch information
PhantornRU and Legendaxe authored Nov 29, 2023
1 parent cdab978 commit 0c870af
Show file tree
Hide file tree
Showing 36 changed files with 888 additions and 267 deletions.
2 changes: 1 addition & 1 deletion code/controllers/subsystem/SSjobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ SUBSYSTEM_DEF(jobs)
var/turf/T = null
var/obj/S = null
for(var/obj/effect/landmark/start/sloc in GLOB.landmarks_list)
if(sloc.name != rank)
if(sloc.name != rank && sloc.name != job.relate_job) // SS220 EDIT - Novice Jobs - Jobs relate module
continue
if(locate(/mob/living) in sloc.loc)
continue
Expand Down
19 changes: 19 additions & 0 deletions code/datums/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,25 @@ GLOBAL_VAR_INIT(record_id_num, 1001)
clothes_s = new /icon('icons/mob/clothing/under/rnd.dmi', "robotics_s")
clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "black"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/clothing/suit.dmi', "labcoat_open"), ICON_OVERLAY)

// SS220 ADDITION - START
if("Student Scientist")
clothes_s = new /icon('modular_ss220/jobs/icons/clothing/mob/uniform.dmi', "student_s")
clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "white"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/clothing/suit.dmi', "labcoat_tox_open"), ICON_OVERLAY)
if("Intern")
clothes_s = new /icon('modular_ss220/jobs/icons/clothing/mob/uniform.dmi', "intern_s")
clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "white"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/clothing/suit.dmi', "labcoat_open"), ICON_OVERLAY)
if("Security Cadet")
clothes_s = new /icon('modular_ss220/jobs/icons/clothing/mob/uniform.dmi', "cadet_s")
clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "jackboots"), ICON_UNDERLAY)
if("Trainee Engineer")
clothes_s = new /icon('modular_ss220/jobs/icons/clothing/mob/uniform.dmi', "trainee_s")
clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "orange"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/clothing/belt.dmi', "utility"), ICON_OVERLAY)
// SS220 ADDITION - END

if("Syndicate Agent")
clothes_s = new /icon('icons/mob/clothing/under/syndicate.dmi', "syndicate_s")
clothes_s.Blend(new /icon('icons/mob/clothing/feet.dmi', "black"), ICON_UNDERLAY)
Expand Down
2 changes: 1 addition & 1 deletion code/game/jobs/job/engineering_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
dufflebag = /obj/item/storage/backpack/duffel/engineering
box = /obj/item/storage/box/engineer


/datum/job/engineer/trainee // SS220 ADDITION - new jobs

/datum/job/atmos
title = "Life Support Specialist"
Expand Down
2 changes: 2 additions & 0 deletions code/game/jobs/job/medical_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
satchel = /obj/item/storage/backpack/satchel_med
dufflebag = /obj/item/storage/backpack/duffel/medical

/datum/job/doctor/intern // SS220 ADDITION - new jobs

/datum/job/coroner
title = "Coroner"
flag = JOB_CORONER
Expand Down
1 change: 1 addition & 0 deletions code/game/jobs/job/science_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
satchel = /obj/item/storage/backpack/satchel_tox
dufflebag = /obj/item/storage/backpack/duffel/science

/datum/job/scientist/student // SS220 ADDITION - new jobs

/datum/job/roboticist
title = "Roboticist"
Expand Down
1 change: 1 addition & 0 deletions code/game/jobs/job/security_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,4 @@
satchel = /obj/item/storage/backpack/satchel_sec
dufflebag = /obj/item/storage/backpack/duffel/security

/datum/job/officer/cadet // SS220 ADDITION - new jobs
4 changes: 4 additions & 0 deletions config/example/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -418,17 +418,21 @@ job_slot_amounts = [
# Engineering
{name = "Life Support Specialist", lowpop = 3, highpop = 4},
{name = "Station Engineer", lowpop = 5, highpop = 6},
{name = "Trainee Engineer", lowpop = 0, highpop = 0},
# Medical
{name = "Chemist", lowpop = 2, highpop = 2},
{name = "Geneticist", lowpop = 2, highpop = 2},
{name = "Medical Doctor", lowpop = 5, highpop = 6},
{name = "Intern", lowpop = 0, highpop = 0},
{name = "Virologist", lowpop = 1, highpop = 1},
# Science
{name = "Roboticist", lowpop = 2, highpop = 2},
{name = "Scientist", lowpop = 6, highpop = 7},
{name = "Student Scientist", lowpop = 0, highpop = 0},
# Security
{name = "Detective", lowpop = 1, highpop = 1},
{name = "Security Officer", lowpop = 8, highpop = 9},
{name = "Security Cadet", lowpop = 0, highpop = 0},
{name = "Warden", lowpop = 1, highpop = 1},
{name = "Internal Affairs Agent", lowpop = 2, highpop = 2},
# Service
Expand Down
1 change: 1 addition & 0 deletions modular_ss220/_defines220/_defines220.dme
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
#include "code/hud_ss220.dm"
#include "code/layers_ss220.dm"
#include "code/signals_atom.dm"
#include "code/jobs_defines.dm"
#include "code/donor.dm"
11 changes: 11 additions & 0 deletions modular_ss220/_defines220/code/jobs_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#define NOVICE_JOB_MINUTES 120
#define NOVICE_CADET_JOB_MINUTES 300

// JOBCAT_ENGSEC
#define JOB_TRAINEE (1<<15)
#define JOB_CADET (1<<16)

// JOBCAT_MEDSCI
#define JOB_INTERN (1<<11)
#define JOB_STUDENT (1<<12)
// Если ОФФы добавят новую должность в отдел, то потребуется смещение
10 changes: 10 additions & 0 deletions modular_ss220/jobs/_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@
name = "Работы"
desc = "Новые джобки и изменения старых"
author = "furior, PhantomRU"

/datum/modpack/jobs/initialize()
. = ..()

GLOB.security_positions |= GLOB.security_positions_ss220
GLOB.active_security_positions |= GLOB.security_positions_ss220

GLOB.medical_positions |= GLOB.medical_positions_ss220
GLOB.engineering_positions |= GLOB.engineering_positions_ss220
GLOB.science_positions |= GLOB.science_positions_ss220
31 changes: 21 additions & 10 deletions modular_ss220/jobs/_jobs.dme
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
#include "_jobs.dm"

#include "code/access.dm"
// #include "code/cards_ids.dm"
// #include "code/jobs.dm"
// #include "code/clothing/engineering_clothing.dm"
// #include "code/clothing/medical_clothing.dm"
// #include "code/clothing/science_clothing.dm"
// #include "code/clothing/security_clothing.dm"
// #include "code/job/engineering_jobs.dm"
// #include "code/job/medical_jobs.dm"
// #include "code/job/science_jobs.dm"
// #include "code/job/security_jobs.dm"
#include "code/card_computer.dm"
#include "code/card_id.dm"
#include "code/departaments.dm"
#include "code/jobs_global_list.dm"
#include "code/jobs_character.dm"
#include "code/jobs_gamemodes.dm"
#include "code/jobs.dm"
#include "code/clothing/engineering_clothing.dm"
#include "code/clothing/medical_clothing.dm"
#include "code/clothing/science_clothing.dm"
#include "code/clothing/security_clothing.dm"
#include "code/job/engineering_jobs.dm"
#include "code/job/medical_jobs.dm"
#include "code/job/science_jobs.dm"
#include "code/job/security_jobs.dm"
#include "code/objects/job_objects.dm"
#include "code/objects/engineering_job_objects.dm"
#include "code/objects/medical_job_objects.dm"
#include "code/objects/science_job_objects.dm"
#include "code/objects/security_job_objects.dm"
#include "code/objects/wardrobe_vendors.dm"
21 changes: 21 additions & 0 deletions modular_ss220/jobs/code/card_computer.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/obj/machinery/computer/card/ui_data(mob/user)
var/list/data = ..()

if(mode == IDCOMPUTER_SCREEN_TRANSFER) // JOB TRANSFER
if(modify && scan && !target_dept)
data["card_skins"] |= format_card_skins(GLOB.card_skins_ss220)

return data

/obj/machinery/computer/card/ui_act(action, params)
. = ..()
switch(action)
if("skin")
if(!modify)
return FALSE
var/skin = params["skin_target"]
if(!skin || !(skin in GLOB.card_skins_ss220))
return FALSE

modify.icon_state = skin//get_card_skins_ss220(skin)
return TRUE
56 changes: 56 additions & 0 deletions modular_ss220/jobs/code/card_id.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/mob/living/carbon/human/sec_hud_set_ID()
var/image/holder = hud_list[ID_HUD]
holder.icon = 'icons/mob/hud/sechud.dmi'
if(wear_id && (wear_id.get_job_name() in GLOB.jobs_positions_ss220))
holder.icon = 'modular_ss220/jobs/icons/hud.dmi'
. = ..()

/obj/item/get_job_name() //Used in secHUD icon generation
var/assignmentName = get_ID_assignment(if_no_id = "Unknown")
var/rankName = get_ID_rank(if_no_id = "Unknown")

var/list/titles = GLOB.jobs_positions_ss220

if(assignmentName in titles) //Check if the job has a hud icon
return assignmentName
if(rankName in titles)
return rankName

. = ..()

GLOBAL_LIST_INIT(card_skins_ss220, list(
"intern", "student", "trainee", "cadet",
))

/obj/item/card/id/medical/intern
name = "Intern ID"
registered_name = "Intern"
icon = 'modular_ss220/aesthetics/better_ids/icons/better_ids.dmi'
icon_state = "intern"
item_state = "intern-id"
rank = "Intern"

/obj/item/card/id/research/student
name = "Student ID"
registered_name = "Student"
icon = 'modular_ss220/aesthetics/better_ids/icons/better_ids.dmi'
icon_state = "student"
item_state = "student-id"

/obj/item/card/id/engineering/trainee
name = "Trainee ID"
registered_name = "Trainee"
icon = 'modular_ss220/aesthetics/better_ids/icons/better_ids.dmi'
icon_state = "trainee"
item_state = "trainee-id"

/obj/item/card/id/security/cadet
name = "Cadet ID"
registered_name = "Cadet"
icon = 'modular_ss220/aesthetics/better_ids/icons/better_ids.dmi'
icon_state = "cadet"
item_state = "cadet-id"

/obj/item/card/id/syndicate/Initialize()
. = ..()
appearances |= GLOB.card_skins_ss220
101 changes: 0 additions & 101 deletions modular_ss220/jobs/code/cards_ids.dm

This file was deleted.

8 changes: 4 additions & 4 deletions modular_ss220/jobs/code/clothing/engineering_clothing.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/item/clothing/under/rank/engineer/trainee
/obj/item/clothing/under/rank/engineering/engineer/trainee
name = "engineer trainee jumpsuit"
icon = 'modular_ss220/jobs/icons/clothing/uniforms.dmi'
icon_override = 'modular_ss220/jobs/icons/clothing/mob/uniform.dmi'
Expand All @@ -8,18 +8,18 @@
item_color = "trainee"
sprite_sheets = null

/obj/item/clothing/under/rank/engineer/trainee/skirt
/obj/item/clothing/under/rank/engineering/engineer/trainee/skirt
name = "engineer trainee jumpskirt"
icon_state = "traineef_s"
item_color = "traineef"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS

/obj/item/clothing/under/rank/engineer/trainee/assistant
/obj/item/clothing/under/rank/engineering/engineer/trainee/assistant
name = "engineer assistant jumpsuit"
icon_state = "eng_ass_s"
item_color = "eng_ass"

/obj/item/clothing/under/rank/engineer/trainee/assistant/skirt
/obj/item/clothing/under/rank/engineering/engineer/trainee/assistant/skirt
name = "engineer assistant jumpskirt"
icon_state = "eng_ass_f_s"
item_color = "eng_ass_f"
Expand Down
8 changes: 4 additions & 4 deletions modular_ss220/jobs/code/clothing/medical_clothing.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/item/clothing/under/rank/medical/intern
/obj/item/clothing/under/rank/medical/doctor/intern
icon = 'modular_ss220/jobs/icons/clothing/uniforms.dmi'
icon_override = 'modular_ss220/jobs/icons/clothing/mob/uniform.dmi'
//lefthand_file = 'icons/mob/inhands/clothing_lefthand.dmi'
Expand All @@ -9,18 +9,18 @@
icon_state = "intern_s"
item_color = "intern"

/obj/item/clothing/under/rank/medical/intern/skirt
/obj/item/clothing/under/rank/medical/doctor/intern/skirt
name = "intern jumpskirt"
icon_state = "internf_s"
item_color = "internf"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS

/obj/item/clothing/under/rank/medical/intern/assistant
/obj/item/clothing/under/rank/medical/doctor/intern/assistant
name = "medical assistant jumpsuit"
icon_state = "med_ass_s"
item_color = "med_ass"

/obj/item/clothing/under/rank/medical/intern/assistant/skirt
/obj/item/clothing/under/rank/medical/doctor/intern/assistant/skirt
name = "medical assistant jumpskirt"
icon_state = "med_ass_f_s"
item_color = "med_ass_f"
Expand Down
Loading

0 comments on commit 0c870af

Please sign in to comment.