Skip to content

Commit

Permalink
FEAT: Add donator jobs (#824)
Browse files Browse the repository at this point in the history
<!-- Пишите **НИЖЕ** заголовков и **ВЫШЕ** комментариев, иначе что то
может пойти не так. -->
<!-- Вы можете прочитать Contributing.MD, если хотите узнать больше. -->

## Что этот PR делает

Добавляет 5 ТИРов профессий по запросам и с одобрения стримеров.

Принцип работы
Заключается в том, что у игроков на каждый ТИР будет выделена отдельная
кнопка, где они могут выбрать 1 специальную должность наподобии
ассистентской в каждом ТИРе и от этого выставить свой приоритет.
Данные должности предназначены для расширения игрового опыта,
минимизации ожидания в очереди ХОП’а, когда ХОП находится в ССД,
отсутствует или его забрал Капитан, а также для создания интересных
ивентовых ситуаций не нацеленных на резню, а только на выполнение
должностных обязанностей и отыгрыша на космической станции за
определенную профессию.
Так как на станции могут присутствовать различные туристы, а Космический
Закон на них по прежнему распространяется, то любая роль подчиняется
текущему КЗ и не дает право нарушать правила, логику персонажей, РП
отыгрыш и сам КЗ.
Каждая профессия получает справку о своей роли, униформу,
профессиональный хлам и необходимые минимальные доступы.

4-5 должности в связи с имением небольших "преимуществ" - не имеют
возможности стать антагонистом.

Данные должности нельзя получить через консоль ГП, только через ЦК.


![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/4e9b1c0d-f79e-41de-94ec-e5934af3e8db)

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

Поощрение донатеров, возможность жития проекта.

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


![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/6d32fe00-d861-48f6-be0a-b4755110682a)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/729bc2c8-37ff-4325-abce-30832ab4a744)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/a09cb831-1ed1-477d-af32-1c5463444474)

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

Долго и муторно

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/3ad60305-28b6-467d-ad9c-b5048a5f2ce9)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/e8f10ad0-7511-4f9d-a142-f2b067d453dd)

![image](https://github.com/ss220club/Paradise-SS220/assets/41479614/0fc4372a-baac-4541-a7c8-e140082a5324)

## Changelog

:cl:
add: Добавлены РП-профессии для донатеров.
tweak: Рефактор кода модульных профессий
/:cl:

---------

Co-authored-by: dj-34 <[email protected]>
Co-authored-by: Legendaxe <[email protected]>
  • Loading branch information
3 people authored Feb 15, 2024
1 parent 7f6d681 commit dc54c29
Show file tree
Hide file tree
Showing 38 changed files with 2,957 additions and 168 deletions.
208 changes: 188 additions & 20 deletions _maps/map_files220/MetaStation/MetaStation.dmm

Large diffs are not rendered by default.

227 changes: 208 additions & 19 deletions _maps/map_files220/cyberiad/cyberiad.dmm

Large diffs are not rendered by default.

294 changes: 269 additions & 25 deletions _maps/map_files220/delta/delta.dmm

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion code/controllers/subsystem/SSjobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ SUBSYSTEM_DEF(jobs)
return FALSE
if(job.barred_by_missing_limbs(player.client))
return FALSE
if(!job.is_donor_allowed(player.client)) // SS220 ADD - Donor Jobs
return FALSE

var/available = latejoin ? job.is_position_available() : job.is_spawn_position_available()

Expand Down Expand Up @@ -519,7 +521,7 @@ SUBSYSTEM_DEF(jobs)
H = new_mob

if(job && H)
job.after_spawn(H)
job.after_spawn(H, joined_late) // SS220 EDIT - jobs - prisoner spawn

//Gives glasses to the vision impaired
if(HAS_TRAIT(H, TRAIT_NEARSIGHT))
Expand Down
3 changes: 1 addition & 2 deletions code/game/jobs/job/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@
var/job_banned_gamemode = FALSE

//Only override this proc
/datum/job/proc/after_spawn(mob/living/carbon/human/H)
/datum/job/proc/after_spawn(mob/living/carbon/human/H, joined_late = FALSE) // SS220 EDIT - jobs - prisoner spawn
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_JOB_AFTER_SPAWN, src, H)


/datum/job/proc/announce(mob/living/carbon/human/H)

/datum/job/proc/equip(mob/living/carbon/human/H, visualsOnly = FALSE, announce = TRUE)
Expand Down
36 changes: 27 additions & 9 deletions code/modules/client/preference/character.dm
Original file line number Diff line number Diff line change
Expand Up @@ -532,15 +532,15 @@
autohiss_mode = sanitize_integer(autohiss_mode, 0, 2, initial(autohiss_mode))

alternate_option = sanitize_integer(alternate_option, 0, 2, initial(alternate_option))
job_support_high = sanitize_integer(job_support_high, 0, 65535, initial(job_support_high))
job_support_med = sanitize_integer(job_support_med, 0, 65535, initial(job_support_med))
job_support_low = sanitize_integer(job_support_low, 0, 65535, initial(job_support_low))
job_medsci_high = sanitize_integer(job_medsci_high, 0, 65535, initial(job_medsci_high))
job_medsci_med = sanitize_integer(job_medsci_med, 0, 65535, initial(job_medsci_med))
job_medsci_low = sanitize_integer(job_medsci_low, 0, 65535, initial(job_medsci_low))
job_engsec_high = sanitize_integer(job_engsec_high, 0, 65535, initial(job_engsec_high))
job_engsec_med = sanitize_integer(job_engsec_med, 0, 65535, initial(job_engsec_med))
job_engsec_low = sanitize_integer(job_engsec_low, 0, 65535, initial(job_engsec_low))
job_support_high = sanitize_integer(job_support_high, 0, get_datum_last_support(), initial(job_support_high)) // SS220 EDIT - EXTRA JOBS
job_support_med = sanitize_integer(job_support_med, 0, get_datum_last_support(), initial(job_support_med)) // SS220 EDIT - EXTRA JOBS
job_support_low = sanitize_integer(job_support_low, 0, get_datum_last_support(), initial(job_support_low)) // SS220 EDIT - EXTRA JOBS
job_medsci_high = sanitize_integer(job_medsci_high, 0, get_datum_last_medsci(), initial(job_medsci_high)) // SS220 EDIT - EXTRA JOBS
job_medsci_med = sanitize_integer(job_medsci_med, 0, get_datum_last_medsci(), initial(job_medsci_med)) // SS220 EDIT - EXTRA JOBS
job_medsci_low = sanitize_integer(job_medsci_low, 0, get_datum_last_medsci(), initial(job_medsci_low)) // SS220 EDIT - EXTRA JOBS
job_engsec_high = sanitize_integer(job_engsec_high, 0, get_datum_last_engsec(), initial(job_engsec_high)) // SS220 EDIT - EXTRA JOBS
job_engsec_med = sanitize_integer(job_engsec_med, 0, get_datum_last_engsec(), initial(job_engsec_med)) // SS220 EDIT - EXTRA JOBS
job_engsec_low = sanitize_integer(job_engsec_low, 0, get_datum_last_engsec(), initial(job_engsec_low)) // SS220 EDIT - EXTRA JOBS
disabilities = sanitize_integer(disabilities, 0, 65535, initial(disabilities))

socks = sanitize_text(socks, initial(socks))
Expand Down Expand Up @@ -1980,6 +1980,15 @@
html += "<tt><center>"
html += "<b>Choose occupation chances</b><br>Unavailable occupations are crossed out.<br><br>"
html += "<center><a href='?_src_=prefs;preference=job;task=close'>Save</a></center><br>" // Easier to press up here.

// ===== SS220 ADD - NEW JOBS ======
// ============= START =============
if(check_available_extra_job_prefs(user.client))
html += "<center><u><b><a href='?_src_=prefs;preference=job;task=extra_job'>Показать [extra_jobs_check ? "основные" : "дополнительные"] работы</a></b></u></center><br>"
if(extra_jobs_check)
splitJobs = get_split_extra_jobs()
// ============== END ==============

html += "<div align='center'>Left-click to raise an occupation preference, right-click to lower it.<br></div>"
html += "<script type='text/javascript'>function setJobPrefRedirect(level, rank) { window.location.href='?_src_=prefs;preference=job;task=setJobLevel;level=' + level + ';text=' + encodeURIComponent(rank); return false; }</script>"
html += "<table width='100%' cellpadding='1' cellspacing='0'><tr><td width='20%'>" // Table within a table for alignment, also allows you to easily add more colomns.
Expand All @@ -1999,6 +2008,15 @@
if(job.hidden_from_job_prefs)
continue

// ===== SS220 ADD - NEW JOBS ======
// ============= START =============
if(!job.is_donor_allowed(user.client))
continue

if(extra_jobs_check != job.is_extra_job)
continue
// ============== END ==============

index += 1
if((index >= limit) || (job.title in splitJobs))
if((index < limit) && (lastJob != null))
Expand Down
2 changes: 1 addition & 1 deletion modular_ss220/_defines220/_defines220.dme
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "code/hud_ss220.dm"
#include "code/layers_ss220.dm"
#include "code/signals_atom.dm"
#include "code/jobs_defines.dm"
#include "code/job_defines.dm"
#include "code/donor.dm"
#include "code/emote.dm"
#include "code/lists_TG.dm"
4 changes: 4 additions & 0 deletions modular_ss220/_defines220/code/donor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
// What TTS level does it give access to?
#define BIG_WORKER_TTS_LEVEL 3
#define LITTLE_WORKER_TTS_LEVEL 1

// General limitation
#define BIG_WORKER_LEVEL 3
#define LITTLE_WORKER_LEVEL 2
141 changes: 141 additions & 0 deletions modular_ss220/_defines220/code/job_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
#define NOVICE_JOB_MINUTES 120
#define NOVICE_CADET_JOB_MINUTES 300

// Если ОФФы добавят новую должность в отдел, то потребуется смещение (╯°□°)╯︵ ┻━┻
// Но так как они больше не планируют и выступают против добавления новых профессий, скорее всего ничего и не изменится.

// JOBCAT_"отдел"_LAST - нужен для корректного вывода из БД, иначе чуда не будет.
// Максимальный сдвиг (1<<22), Последний сдвиг (1<<23)
// Он должен быть всегда как минимум на 1 больше последнего, по дефолту у ОФФов (1<<16)


// ====================================
// JOBCAT_ENGSEC
// Начинаются с JOB_NANO (1<<14)
#define JOB_TRAINEE (1<<15)
#define JOB_CADET (1<<16)
//#define JOB_PILOT (1<<17)

#define JOB_REPRESENTATIVE_TSF (1<<17)
#define JOB_REPRESENTATIVE_USSP (1<<18)
#define JOB_DEALER (1<<19)
#define JOB_VIP_GUEST (1<<20)
#define JOB_BANKER (1<<21)
#define JOB_SECURITY_CLOWN (1<<22)

#define JOBCAT_LAST_ENGSEC (1<<23)


// ====================================
// JOBCAT_MEDSCI
// Начинаются с JOB_CORONER (1<<10)
#define JOB_INTERN (1<<11)
#define JOB_STUDENT (1<<12)
#define JOB_MECHANIC (1<<13)

#define JOB_ADMINISTRATOR (1<<14)
#define JOB_TOURIST_TSF (1<<15)
#define JOB_TOURIST_USSP (1<<16)
#define JOB_MANAGER_JANITOR (1<<17)
#define JOB_ACTOR (1<<18)
//#define JOB_APPRENTICE (1<<18)
#define JOB_GUARD (1<<19)
#define JOB_MIGRANT (1<<20)
#define JOB_UNCERTAIN (1<<21)
#define JOB_ADJUTANT (1<<22)
//#define JOB_MAID (1<<23)
//#define JOB_BUTLER (1<<24)

#define JOBCAT_LAST_MEDSCI (1<<23)


// ====================================
// JOBCAT_SUPPORT
// Начинаются с JOB_EXPLORER (1<<14)
#define JOB_PRISON (1<<15)
#define JOB_BARBER (1<<16)
#define JOB_BATH (1<<17)
#define JOB_CASINO (1<<18)
#define JOB_WAITER (1<<19)
#define JOB_ACOLYTE (1<<20)
//#define JOB_DELIVERER (1<<21)
#define JOB_BOXER (1<<21)
#define JOB_MUSICIAN (1<<22)
//#define JOB_PAINTER (1<<24)

#define JOBCAT_LAST_SUPPORT (1<<23)







// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// В ЭТОМ ФАЙЛЕ МЫ [B]ВРЕМЕННО[/B] ЗАСОВЫВАЕМ
// НАШИ ДЕФАЙНЫ ПОД КАТЕГОРИИ РАЗНЫХ ОТДЕЛОВ!
// ПРАВИЛЬНАЯ РАСФАСОВКА НИЖЕ
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

/*
// ====================================
// JOBCAT_ENGSEC
// Начинаются с JOB_NANO (1<<14)
#define JOB_TRAINEE (1<<15)
#define JOB_CADET (1<<16)
#define JOBCAT_LAST_ENGSEC (1<<17)
// ====================================
// JOBCAT_MEDSCI
// Начинаются с JOB_CORONER (1<<10)
#define JOB_INTERN (1<<11)
#define JOB_STUDENT (1<<12)
#define JOBCAT_LAST_MEDSCI (1<<16)
// ====================================
// JOBCAT_SUPPORT
// Начинаются с JOB_EXPLORER (1<<14)
// TIER 1
#define JOB_PRISON (1<<15)
// TIER 2
#define JOB_BARBER (1<<16)
#define JOB_BATH (1<<17)
#define JOB_CASINO (1<<18)
#define JOB_WAITER (1<<19)
#define JOB_ACOLYTE (1<<20)
#define JOB_DELIVERER (1<<21)
#define JOB_BOXER (1<<22)
#define JOB_PAINTER (1<<23)
#define JOB_MUSICIAN (1<<24)
#define JOB_DONOR (1<<24) // Свободная роль, можно переименовать
#define JOB_ACTOR (1<<26)
// TIER 3
#define JOB_ADMINISTRATOR (1<<27)
#define JOB_TOURIST_TSF (1<<28)
#define JOB_TOURIST_USSP (1<<29)
#define JOB_MANAGER_JANITOR (1<<30)
#define JOB_APPRENTICE (1<<31)
#define JOB_GUARD (1<<32)
#define JOB_MIGRANT (1<<33)
#define JOB_UNCERTAIN (1<<34)
// TIER 4
#define JOB_ADJUTANT (1<<35)
#define JOB_BUTLER (1<<36)
#define JOB_MAID (1<<37)
#define JOB_REPRESENTATIVE_TSF (1<<38)
#define JOB_REPRESENTATIVE_USSP (1<<39)
#define JOB_DEALER (1<<40)
// TIER 5
#define JOB_VIP_GUEST (1<<41)
#define JOB_BANKER (1<<42)
#define JOB_SECURITY_CLOWN (1<<43)
#define JOBCAT_LAST_SUPPORT (1<<44)
*/
11 changes: 0 additions & 11 deletions modular_ss220/_defines220/code/jobs_defines.dm

This file was deleted.

Binary file modified modular_ss220/aesthetics/better_ids/icons/better_ids.dmi
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
vars[param] = params[param]

if(GLOB.configuration.gamemode.prevent_mindshield_antags)
restricted_roles |= protected_roles
restricted_roles |= protected_roles + GLOB.restricted_jobs_ss220


/**
Expand Down
10 changes: 10 additions & 0 deletions modular_ss220/donor/code/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,13 @@
prefs.character_saves.len = prefs.max_save_slots

#undef MAX_SAVE_SLOTS_SS220

/client/proc/is_donor_allowed(required_donator_level)
switch(donator_level)
if(LITTLE_WORKER_TIER)
if(required_donator_level > LITTLE_WORKER_LEVEL)
return FALSE
if(BIG_WORKER_TIER)
if(required_donator_level > BIG_WORKER_LEVEL)
return FALSE
return required_donator_level <= donator_level
8 changes: 6 additions & 2 deletions modular_ss220/jobs/_jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
/datum/modpack/jobs/initialize()
. = ..()

GLOB.security_positions |= GLOB.security_positions_ss220
GLOB.active_security_positions |= GLOB.security_positions_ss220
GLOB.security_positions |= GLOB.security_positions_ss220 + GLOB.security_donor_jobs
GLOB.active_security_positions |= GLOB.security_positions_ss220 + GLOB.security_donor_jobs

GLOB.medical_positions |= GLOB.medical_positions_ss220
GLOB.engineering_positions |= GLOB.engineering_positions_ss220
GLOB.science_positions |= GLOB.science_positions_ss220

GLOB.service_positions |= GLOB.service_donor_jobs
GLOB.supply_positions |= GLOB.supply_donor_jobs
GLOB.assistant_positions |= GLOB.assistant_donor_jobs
7 changes: 7 additions & 0 deletions modular_ss220/jobs/_jobs.dme
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@
#include "code/jobs_character.dm"
#include "code/jobs_gamemodes.dm"
#include "code/jobs.dm"
#include "code/landmarks.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/donor/job/1_tier_jobs.dm"
#include "code/donor/job/2_tier_jobs.dm"
#include "code/donor/job/3_tier_jobs.dm"
#include "code/donor/job/4_tier_jobs.dm"
#include "code/donor/job/5_tier_jobs.dm"
#include "code/donor/donor_jobs.dm"
#include "code/job/engineering_jobs.dm"
#include "code/job/medical_jobs.dm"
#include "code/job/science_jobs.dm"
Expand Down
26 changes: 23 additions & 3 deletions modular_ss220/jobs/code/card_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

if(mode == IDCOMPUTER_SCREEN_TRANSFER) // JOB TRANSFER
if(modify && scan && !target_dept)
data["card_skins"] |= format_card_skins(GLOB.card_skins_ss220)
var/list/list_skins = GLOB.card_skins_ss220 + (is_centcom() ? GLOB.card_skins_donor_ss220 : list())
data["card_skins"] |= format_card_skins(list_skins)
data["jobs_security"] = GLOB.active_security_positions - (is_centcom() ? list() : GLOB.security_donor_jobs)
data["jobs_service"] = GLOB.service_positions - (is_centcom() ? list() : GLOB.service_donor_jobs)
data["jobs_supply"] = GLOB.supply_positions - (is_centcom() ? list() : GLOB.supply_donor_jobs)
data["jobs_assistant"] = GLOB.assistant_positions - (is_centcom() ? list() : GLOB.assistant_donor_jobs)

return data

Expand All @@ -14,8 +19,23 @@
if(!modify)
return FALSE
var/skin = params["skin_target"]
if(!skin || !(skin in GLOB.card_skins_ss220))
var/list/list_skins = GLOB.card_skins_ss220 + (is_centcom() ? GLOB.card_skins_donor_ss220 : list())
if(!skin || !(skin in list_skins))
return FALSE

modify.icon_state = skin//get_card_skins_ss220(skin)
modify.icon_state = skin
return TRUE

/obj/machinery/computer/card/format_job_slots(check_department, is_admin)
var/list/formatted = ..()

// Убираем JOB'ки из консоли ГП, если она не ЦКшная.
for(var/i in formatted)
if(i["title"] in GLOB.jobs_excluded_from_selection)
formatted.Remove(list(i))
if(is_centcom())
continue
if(i["title"] in GLOB.all_donor_jobs)
formatted.Remove(list(i))

return formatted
Loading

0 comments on commit dc54c29

Please sign in to comment.