Skip to content

Commit

Permalink
add: Capitalism (ss220-space#5958)
Browse files Browse the repository at this point in the history
* Капиталистические свиньи в восторге

* Update capitalism.dm

забыл изменить это перед созданием пулла

* Update Accounts.dm

Забыл отступ сделать

* Update Accounts.dm

Меняю раз

* Update capitalism.dm

распили меня болгаркой

* Update capitalism.dm

пупупу

* Update scoreboard.dm

Финансовая статистка

* Update capitalism.dm

Бобер курва

* Update cargo_quests.dm

пендофицикация

* Update cargo_quests.dm

sdsds

* Update thing_quests.dm

ыфвфвы

* Update Accounts_DB.dm

// TODO done, SScapitalism

* Update capitalism.dm

// TODO done, SScapitalism

* Update card.dm

пробелы апдейт

* Update security.dm

в

* Update support.dm

//QM IS NOT THE HEAD!!

* Update support_chaplain.dm

//God will not give you a salary roflcat

* Update centcomm_departaments.dm

15 percent on the account of the beggars

* Update Accounts.dm

пробел ликвидирован

* Update reagents_quests.dm

ыввы

* Update job.dm

наследие

* Update capitalism.dm

убирал to_chat

* Update utils.dm

For revenue statistics from the vending machine

* Update capitalism.dm

бобр курва

* Update station_goal.dm

пупупу

* Update capitalism.dm

job_titles[account.linked_job.title]

* Update capitalism.dm

jobs_payment

* Update capitalism.dm

jobs_payment[account.linked_job.title]

* Update job.dm

ыввывы

* Update security.dm

money_factor

* Update science.dm

money_factor

* Update code/modules/economy/quests/_base_quests.dm

да

Co-authored-by: Den109G <87372121+Den109G@users.noreply.github.com>

* Update code/controllers/subsystem/capitalism.dm

лд

Co-authored-by: Den109G <87372121+Den109G@users.noreply.github.com>

* Update code/controllers/subsystem/capitalism.dm

yes

Co-authored-by: Den109G <87372121+Den109G@users.noreply.github.com>

* Update centcomm_departaments.dm

linked_deportament

* Update reagents_quests.dm

linked_deportament

* Update thing_quests.dm

linked_deportament

* Update centcomm_departaments.dm

smart_deportament_payment

* Update capitalism.dm

 keys_deportament

* Update capitalism.dm

 keys_deportament

* Update code/controllers/subsystem/capitalism.dm

да

Co-authored-by: NightDawnFox <116907157+NightDawnFox@users.noreply.github.com>

* Update capitalism.dm

пендосия апдейт

* Update cash.dm

A crutch for the vending machine, well, or an ingenious roflcat solution

* Update _base_quests.dm

The department key is specified to take it from the global list, no, I will not upload to new, I'm afraid to break even

* Update quest_console.dm

Abandon hope, everyone who enters here

* Update support.dm

Abandon hope, everyone who enters here

* Update capitalism.dm

What kind of money for each department

* Update capitalism.dm

The counter for the number of defaults, I definitely won't make a joke

* Update security.dm

* Update silicon.dm

* Update centcomm_departaments.dm

If not, it pays to the account of the department

* Update support.dm

* Update supervisor.dm

* Update support.dm

все апруверы выписаны из русских

* Update capitalism.dm

отступы апдейт

* Update capitalism.dm

фикс на упреждение

* Update capitalism.dm

во

* Update Accounts_DB.dm

Охота туду

* Update capitalism.dm

* Update capitalism.dm

Не используется

* Update code/modules/shuttle/supply.dm

Распили меня болгаркой

Co-authored-by: Den109G <87372121+Den109G@users.noreply.github.com>

* Update code/modules/economy/quests/quest_console.dm

Ладно

Co-authored-by: Den109G <87372121+Den109G@users.noreply.github.com>

* Update capitalism.dm

Забыл

* Update capitalism.dm

пробелы апдейт

* Update capitalism.dm

ывывы

* Update capitalism.dm

пробелы апдейт

* Update capitalism.dm

пойду выпью яду

* Update subsystems.dm

Авось поможет

* Update cash.dm

еыыв

* Update cash.dm

ыввы

* Update cash.dm

ыввы

* Update code/game/objects/items/weapons/cash.dm

да

Co-authored-by: Den109G <87372121+Den109G@users.noreply.github.com>

* Update cash.dm

ывывыв

* Update cash.dm

ыввывывы

* Update security.dm

фикс

* Update science.dm

фикс

* Update capitalism.dm

сука

* Update subsystems.dm

сука влад

* Update scoreboard.dm

статистик апдейт

---------

Co-authored-by: Den109G <87372121+Den109G@users.noreply.github.com>
Co-authored-by: NightDawnFox <116907157+NightDawnFox@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 5, 2024
1 parent 51639db commit c44028c
Show file tree
Hide file tree
Showing 27 changed files with 562 additions and 88 deletions.
3 changes: 2 additions & 1 deletion code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
#define INIT_ORDER_OVERLAY -6
#define INIT_ORDER_XKEYSCORE -10
#define INIT_ORDER_TICKETS -11
#define INIT_ORDER_LIGHTING -21
#define INIT_ORDER_LIGHTING -20
#define INIT_ORDER_CAPITALISM -21
#define INIT_ORDER_SHUTTLE -22
#define INIT_ORDER_CARGO_QUESTS -23
#define INIT_ORDER_NIGHTSHIFT -24
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
EQUIPMENT("Luxury Shelter Capsule", /obj/item/survivalcapsule/luxury, 5000),
EQUIPMENT("Luxury Elite Bar Capsule", /obj/item/survivalcapsule/luxuryelite, 10000),
EQUIPMENT("Soap", /obj/item/soap/nanotrasen, 400),
EQUIPMENT("Space Cash", /obj/item/stack/spacecash/c1000, 2500),
EQUIPMENT("Space Cash", /obj/item/stack/spacecash/magic_linked, 2500),
EQUIPMENT("Whiskey", /obj/item/reagent_containers/food/drinks/bottle/whiskey, 500),
EQUIPMENT("HRD-MDE Project Box", /obj/item/storage/box/hardmode_box, 2500),
)
Expand Down
160 changes: 160 additions & 0 deletions code/controllers/subsystem/capitalism.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
#define FREQUENCY_SALARY 5 MINUTES
#define EXTRA_MONEY 10000
SUBSYSTEM_DEF(capitalism)
name = "Capitalism"
ss_id = "capitalism_subsystem"
init_order = INIT_ORDER_CAPITALISM
offline_implications = "Выплаты зарплат приостановлены, по идее выплаты за задания карго не сломаются. Награда за цель не выплачивается. Немедленных действий не требуется."
runlevels = RUNLEVEL_GAME
wait = FREQUENCY_SALARY
flags = SS_BACKGROUND

//This separation is necessary for tests and in general so that it is pleasant
var/datum/money_account/base_account = null //the account that receives money for orders and vending machines
var/datum/money_account/payment_account = null //The account from which the salary is deducted badguy

//Attention. Statistics for greentext
//And why did I make tabs?...
var/total_salary_payment = 0 //How much money was spent on salaries
var/total_station_bounty = 0 //How much money did the money from the cargo bring to the station account
var/total_cargo_bounty = 0 //How much money was credited to the cargo account from the tasks
var/total_personal_bounty = 0 //How much money was distributed to the beggars
var/income_vedromat = 0 //Income from vending machines
var/default_counter = 0 //The counter for the number of defaults, I definitely won't make a joke

var/list/complited_goals = list() //It is necessary not to pay again for the goal, gagaga
var/default_status = FALSE //TRUE if the default is in effect at the station, you can do it in the future, for example, as a cargo modifier

/datum/controller/subsystem/capitalism/Initialize()
accounts_init()
salary_account_init()
return SS_INIT_SUCCESS

/datum/controller/subsystem/capitalism/fire()

//if(default_counter > 300)
// GLOB.priority_announcement.Announce("Станция признана убыточным объектом. Хорошего дня.", "Расторжение контрактов.", 'sound/AI/commandreport.ogg')
// set_security_level(SEC_LEVEL_EPSILON)

//If there is enough money to pay salaries at least twice before the default is lifted
if(default_status && (payment_account.money > (potential_salary_payments() + EXTRA_MONEY)))
default_status = FALSE
default_annonce()
payment_process() //Pay the beggars immediately after the announcement
else if(!payment_process() && !default_status)
default_status = TRUE
default_annonce()

var/total_station_goal_bounty = 0
var/s_ex_personal_bounry = list() //Extended staff rewards
//personal_reward
for(var/datum/station_goal/goal in SSticker.mode.station_goals)
if(!goal)
continue
if(goal.check_completion() && !(goal in complited_goals))
total_station_goal_bounty += goal.station_bounty
for(var/prom in goal.personal_reward)
if(s_ex_personal_bounry?[prom])
s_ex_personal_bounry[prom] += goal.personal_reward[prom]
else
s_ex_personal_bounry[prom] = goal.personal_reward[prom]
complited_goals += goal

if(total_station_goal_bounty)
base_account.credit(total_station_goal_bounty, "Начисление награды за выполнение цели.", "Отдел развития Нанотрейзен", base_account.owner_name)
smart_job_payment(s_ex_personal_bounry)

//status - TRUE/FALSE
/datum/controller/subsystem/capitalism/proc/default_annonce()
if(default_status)
GLOB.priority_announcement.Announce("Внимание на счёте станции зафиксировано отсутствие финансов. Выплаты заработных плат заморожены. Командному составу необходимо немедленно решить возникший кризис", "Дефолт станции", 'sound/AI/commandreport.ogg')
else
GLOB.priority_announcement.Announce("Внимание на счёте станции достаточно средств для выплат. Выплаты заработных плат возобновлены.", "Возобновление выплат", 'sound/AI/commandreport.ogg')

/datum/controller/subsystem/capitalism/proc/potential_salary_payments()
var/total_salary = 0
for(var/datum/money_account/account in GLOB.all_money_accounts)
if(account.salary_payment_active && account.linked_job.salary && !account.suspended)
total_salary += account.linked_job.salary
return total_salary

/datum/controller/subsystem/capitalism/proc/accounts_init()
if(!GLOB.CC_account)
create_CC_account()

if(!GLOB.station_account)
create_station_account()

if(GLOB.department_accounts.len == 0)
for(var/department in GLOB.station_departments)
create_department_account(department)

/datum/controller/subsystem/capitalism/proc/salary_account_init()
base_account = GLOB.station_account //The account that the bounty goes to, the money for the goal and the money from the machines.
payment_account = GLOB.CC_account //GLOB.CC_account //This is the account from which money is debited for salary. Made for catsmile tests

if(!GLOB.vendor_account)
GLOB.vendor_account = base_account //:catsmile:

/datum/controller/subsystem/capitalism/proc/payment_process()
. = TRUE
for(var/datum/money_account/account in GLOB.all_money_accounts)
if(account.salary_payment_active && account.linked_job.salary && !account.suspended)
if(payment_account.charge(account.linked_job.salary, account, "Выплата зарплаты персоналу.", "Nanotrasen personal departament" , "Поступление зарплаты.", "Поступление зарплаты" ,"Biesel TCD Terminal #[rand(111,333)]"))
account.notify_pda_owner("<b>Поступление зарплаты </b>\"На ваш привязанный аккаунт поступило [account.linked_job.salary] кредитов\" (Невозможно Ответить)", FALSE)
total_salary_payment += account.linked_job.salary
else
return FALSE

/datum/controller/subsystem/capitalism/proc/smart_bounty_payment(var/list/jobs_payment, var/money)
. = FALSE //If nothing is paid to anyone
var/list_payment_account = list() //which people should I pay
var/bounty = 0 //What kind of money for each person
total_personal_bounty += money
for(var/datum/money_account/account in GLOB.all_money_accounts)
if(jobs_payment.Find(account.linked_job.title) && account.salary_payment_active && !account.suspended)
list_payment_account += account
. = TRUE

if(money == 0 || length(list_payment_account) == 0)
return FALSE
bounty = round(money / length(list_payment_account))
for(var/datum/money_account/account in list_payment_account)
//It may be worth doing a type from the customer's company... But I'm too lazy
if(account.credit(bounty, "Начисление награды за выполнение заказа.", "Biesel TCD Terminal #[rand(111,333)]", account.owner_name))
account.notify_pda_owner("<b>Поступление награды </b>\"На ваш привязанный аккаунт поступило [bounty] кредитов за помощь в выполнении заказа.\" (Невозможно Ответить)", FALSE)
return

/datum/controller/subsystem/capitalism/proc/smart_job_payment(var/list/jobs_payment)
. = FALSE //If nothing is paid to anyone
for(var/datum/money_account/account in GLOB.all_money_accounts)
if(jobs_payment?[account.linked_job.title] && account.salary_payment_active && !account.suspended)
if(account.credit(jobs_payment[account.linked_job.title], "Начисление награды за выполнение цели.", "Biesel TCD Terminal #[rand(111,333)]", account.owner_name))
total_personal_bounty += jobs_payment[account.linked_job.title]
account.notify_pda_owner("<b>Поступление награды </b>\"На ваш привязанный аккаунт поступило [jobs_payment[account.linked_job.title]] кредитов за помощь в выполнении цель станции.\" (Невозможно Ответить)", FALSE)
. = TRUE
return

// In short, as for beggars, but for departments
/datum/controller/subsystem/capitalism/proc/smart_departament_payment(var/list/keys_departament, var/money)
. = FALSE //If nothing is paid to anyone
var/list_payment_account = list() //which people should I pay
var/bounty = 0 //What kind of money for each department
total_personal_bounty += money
var/datum/money_account/account = base_account

for(var/key_account_departament in keys_departament)
account = GLOB.department_accounts?[key_account_departament]
if(!account)
list_payment_account += account
. = TRUE

if(!length(list_payment_account))
base_account.credit(bounty, "Начисление награды за выполнение заказа.", "Biesel TCD Terminal #[rand(111,333)]", account.owner_name)
return TRUE

bounty = round(money / length(list_payment_account))
//If it did not find that, the payment of the station (well, or what is indicated in the base_account)
for(var/datum/money_account/account_pay in list_payment_account)
account_pay.credit(bounty, "Начисление награды за выполнение заказа.", "Biesel TCD Terminal #[rand(111,333)]", account.owner_name)
return
18 changes: 10 additions & 8 deletions code/controllers/subsystem/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,8 @@ SUBSYSTEM_DEF(jobs)


/datum/controller/subsystem/jobs/proc/CreateMoneyAccount(mob/living/H, rank, datum/job/job)
var/money_amount = job ? rand(500, 1500) * get_job_factor(job, job.random_money_factor) : rand(500, 1500)
var/datum/money_account/M = create_account(H.real_name, money_amount, null)
var/money_amount = rand(job.min_start_money, job.max_start_money)
var/datum/money_account/M = create_account(H.real_name, money_amount, null, job, TRUE)
var/remembered_info = ""

remembered_info += "<b>Номер вашего аккаунта:</b> #[M.account_number]<br>"
Expand Down Expand Up @@ -666,12 +666,6 @@ SUBSYSTEM_DEF(jobs)
spawn(0)
to_chat(H, "<span class='boldnotice'>Номер вашего аккаунта: [M.account_number], ПИН вашего аккаунта: [M.remote_access_pin]</span>")

/datum/controller/subsystem/jobs/proc/get_job_factor(datum/job/job, randomized)
if(randomized)
return job.money_factor*rand(0.25, 4) // for now only used for civillians
else
return job.money_factor

/datum/controller/subsystem/jobs/proc/format_jobs_for_id_computer(obj/item/card/id/tgtcard)
var/list/jobs_to_formats = list()
if(tgtcard)
Expand Down Expand Up @@ -714,6 +708,14 @@ SUBSYSTEM_DEF(jobs)
oldjobdatum.current_positions--
newjobdatum.current_positions++

/datum/controller/subsystem/jobs/proc/account_job_transfer(name_owner, job_title, salary_capcap = TRUE)

var/datum/money_account/account_job = get_account_with_name(name_owner)

if(account_job)
account_job.linked_job = SSjobs.GetJob(job_title)
account_job.salary_payment_active = salary_capcap

/datum/controller/subsystem/jobs/proc/notify_dept_head(jobtitle, antext)
// Used to notify the department head of jobtitle X that their employee was brigged, demoted or terminated
if(!jobtitle || !antext)
Expand Down
25 changes: 24 additions & 1 deletion code/controllers/subsystem/non-firing/cargo_quests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
#define NUMBER_OF_CORP_QUEST 4
#define NUMBER_OF_PLASMA_QUEST 1

//Abandon hope, everyone who enters here

//This place is cursed, don't try to understand it and change it. It will kill you

//Reading the lines more and more, I realize that I shouldn't have come here.

//THERE IS NO GOD BEYOND THAT
SUBSYSTEM_DEF(cargo_quests)
name = "Cargo Quests"
flags = SS_NO_FIRE
Expand Down Expand Up @@ -103,6 +110,7 @@ SUBSYSTEM_DEF(cargo_quests)
/datum/controller/subsystem/cargo_quests/proc/check_delivery(obj/structure/bigDelivery/delivery)
var/max_reward = 0
var/datum/cargo_quests_storage/target_storage
var/list/copmpleted_quests = list()

for(var/order in quest_storages)
var/datum/cargo_quests_storage/storage = order
Expand All @@ -129,6 +137,7 @@ SUBSYSTEM_DEF(cargo_quests)
continue
if(quest.check_required_item(item))
failed_quest_length--
copmpleted_quests += quest
has_extra_item = FALSE
break

Expand All @@ -141,6 +150,7 @@ SUBSYSTEM_DEF(cargo_quests)

for(var/datum/cargo_quest/quest in storage.current_quests)
if(!quest.after_check())
copmpleted_quests -= quest
failed_quest_length++

var/reward = storage.check_quest_completion(delivery, failed_quest_length, extra_items, req_quantity)
Expand All @@ -161,8 +171,14 @@ SUBSYSTEM_DEF(cargo_quests)
max_reward = max_reward * 10

remove_quest(target_storage.UID(), complete = TRUE, modificators = target_storage.modificators, new_reward = max_reward)
if(target_storage.customer.send_reward(max_reward))
if(target_storage.customer.send_reward(max_reward, copmpleted_quests))
return

//Honestly, I don't want to do another procedure for this
if(target_storage.quest_difficulty.bounty_for_difficulty)
SScapitalism.total_station_bounty += target_storage.quest_difficulty.bounty_for_difficulty
SScapitalism.base_account.credit(target_storage.quest_difficulty.bounty_for_difficulty, "Награда за выполнение корпоративного задания.", "Biesel TCD Terminal #[rand(111,333)]", "Отдел развития Нанотрейзен")

return max_reward

/datum/controller/subsystem/cargo_quests/proc/remove_bfl_quests(count)
Expand All @@ -182,6 +198,9 @@ SUBSYSTEM_DEF(cargo_quests)
var/max_quest_time
var/for_easy_mode

//How many shekels will be given for the complexity to the base_account account
var/bounty_for_difficulty = 0

/datum/quest_difficulty/proc/generate_timer(datum/cargo_quests_storage/q_storage)
q_storage.time_start = world.time
q_storage.quest_time = rand(min_quest_time, max_quest_time) MINUTES
Expand All @@ -194,25 +213,29 @@ SUBSYSTEM_DEF(cargo_quests)
min_quest_time = 15
max_quest_time = 25
for_easy_mode = TRUE
bounty_for_difficulty = 150

/datum/quest_difficulty/normal
diff_flag = QUEST_DIFFICULTY_NORMAL
weight = 34
min_quest_time = 20
max_quest_time = 30
for_easy_mode = TRUE
bounty_for_difficulty = 300

/datum/quest_difficulty/hard
diff_flag = QUEST_DIFFICULTY_HARD
weight = 14
min_quest_time = 30
max_quest_time = 40
bounty_for_difficulty = 500

/datum/quest_difficulty/very_hard
diff_flag = QUEST_DIFFICULTY_VERY_HARD
weight = 4
min_quest_time = 30
max_quest_time = 60
bounty_for_difficulty = 1000


#undef NUMBER_OF_CC_QUEST
Expand Down
9 changes: 8 additions & 1 deletion code/game/gamemodes/scoreboard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,14 @@ GLOBAL_VAR(scoreboard) // Variable to save the scoreboard string once it's been

<U>Прочее</U><br>
<b>Съедено еды:</b> [score_food_eaten] [declension_ru(score_food_eaten, "укус", "укуса", "укусов")]/[declension_ru(score_food_eaten, "глоток", "глотка", "глотков")].<br>
<b>Клоуна избили:</b> [score_clown_abuse] [declension_ru(score_clown_abuse, "раз", "раза", "раз")]<br><br>"}
<b>Клоуна избили:</b> [score_clown_abuse] [declension_ru(score_clown_abuse, "раз", "раза", "раз")]<br><br>
<U>Финансовая статистка</U><br>
<b>Выплачено персоналу зарплат на сумму: </b> [SScapitalism.total_salary_payment].<br>
<b>Поступило денег с выполнения заказов карго на счет станции: </b> [SScapitalism.total_station_bounty].<br>
<b>Поступило денег с выполнения заказов карго на счет карго: </b> [SScapitalism.total_cargo_bounty].<br>
<b>Общая сумма наград выплаченная персоналу за помощь в выполнении заказов карго: </b> [SScapitalism.total_personal_bounty].<br>
<b>Доход от автоматов: </b> [SScapitalism.income_vedromat].<br><br>"}

if(score_escapees)
dat += "<b>Самый богатый из эвакуировавшихся:</b> [richest_name], [richest_job]: $[num2text(richest_cash, 50)] ([richest_key])<br>"
Expand Down
9 changes: 7 additions & 2 deletions code/game/jobs/job/civilian.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define SALARY_FOR_NISHEBROD 60

/datum/job/civilian
title = JOB_TITLE_CIVILIAN
flag = JOB_FLAG_CIVILIAN
Expand All @@ -10,9 +12,12 @@
access = list() //See /datum/job/assistant/get_access()
minimal_access = list() //See /datum/job/assistant/get_access()
alt_titles = list("Tourist","Businessman","Trader","Assistant")
random_money_factor = TRUE
outfit = /datum/outfit/job/assistant

salary = SALARY_FOR_NISHEBROD
min_start_money = 10
max_start_money = 200

/datum/job/civilian/get_access()
if(CONFIG_GET(flag/assistant_maint))
return list(ACCESS_MAINT_TUNNELS)
Expand All @@ -27,4 +32,4 @@
l_pocket = /obj/item/paper/deltainfo
shoes = /obj/item/clothing/shoes/black


#undef SALARY_FOR_NISHEBROD
Loading

0 comments on commit c44028c

Please sign in to comment.