From 6dd2102a06142e9bd522a1e7669959452a511b59 Mon Sep 17 00:00:00 2001 From: Casper3667 Date: Sat, 7 Aug 2021 13:52:42 +0200 Subject: [PATCH] Change NT relation into economic status: Round 3 (#11967) * remakes the economy PR * SQL migration * changelog & final migration change * updates migration * updates migration * fixes a stray nt_relation * updates the database migration Co-authored-by: TheGreyWolf --- SQL/migrate/V070__economic_status.sql | 14 ++ code/__defines/mobs.dm | 14 +- code/game/antagonist/station/traitor.dm | 4 +- code/game/gamemodes/game_mode.dm | 152 +----------------- code/game/gamemodes/meme/meme.dm | 3 - code/game/jobs/job/job.dm | 32 ++-- .../preference_setup/general/05_background.dm | 22 +-- code/modules/client/preferences.dm | 4 +- html/changelogs/Economy.yml | 7 + 9 files changed, 62 insertions(+), 190 deletions(-) create mode 100644 SQL/migrate/V070__economic_status.sql create mode 100644 html/changelogs/Economy.yml diff --git a/SQL/migrate/V070__economic_status.sql b/SQL/migrate/V070__economic_status.sql new file mode 100644 index 00000000000..1cd0e942dfd --- /dev/null +++ b/SQL/migrate/V070__economic_status.sql @@ -0,0 +1,14 @@ +-- +-- Implemented in PR #11967. +-- Renames NanoTrasen Relation into Economic Status. +-- + +ALTER TABLE `ss13_characters` ADD COLUMN `economic_status` ENUM('Wealthy', 'Well-off', 'Average', 'Underpaid', 'Poor') DEFAULT "Average" AFTER `religion`; + +UPDATE `ss13_characters` SET `economic_status` = 'Wealthy' WHERE nt_relation = 'Loyal'; +UPDATE `ss13_characters` SET `economic_status` = 'well-off' WHERE nt_relation = 'Supportive'; +UPDATE `ss13_characters` SET `economic_status` = 'Average' WHERE nt_relation = 'Neutral'; +UPDATE `ss13_characters` SET `economic_status` = 'Underpaid' WHERE nt_relation = 'Skeptical'; +UPDATE `ss13_characters` SET `economic_status` = 'Poor' WHERE nt_relation = 'Opposed'; + +ALTER TABLE `ss13_characters` DROP COLUMN `nt_relation`; \ No newline at end of file diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index 0054b3704bd..d2b538f5777 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -236,14 +236,14 @@ #define IPC_OWNERSHIP_COMPANY "Company Owned" #define IPC_OWNERSHIP_PRIVATE "Privately Owned" -// NT's alignment towards the character -#define COMPANY_LOYAL "Loyal" -#define COMPANY_SUPPORTATIVE "Supportive" -#define COMPANY_NEUTRAL "Neutral" -#define COMPANY_SKEPTICAL "Skeptical" -#define COMPANY_OPPOSED "Opposed" +// How wealthy/poor a character is +#define ECONOMICALLY_WEALTHY "Wealthy" +#define ECONOMICALLY_WELLOFF "Well-off" +#define ECONOMICALLY_AVERAGE "Average" +#define ECONOMICALLY_UNDERPAID "Underpaid" +#define ECONOMICALLY_POOR "Poor" -#define COMPANY_ALIGNMENTS list(COMPANY_LOYAL,COMPANY_SUPPORTATIVE,COMPANY_NEUTRAL,COMPANY_SKEPTICAL,COMPANY_OPPOSED) +#define ECONOMIC_POSITIONS list(ECONOMICALLY_WEALTHY, ECONOMICALLY_WELLOFF, ECONOMICALLY_AVERAGE, ECONOMICALLY_UNDERPAID, ECONOMICALLY_POOR) // Defines the argument used for get_mobs_and_objs_in_view_fast #define GHOSTS_ALL_HEAR 1 diff --git a/code/game/antagonist/station/traitor.dm b/code/game/antagonist/station/traitor.dm index b48639a84f5..7939346a991 100644 --- a/code/game/antagonist/station/traitor.dm +++ b/code/game/antagonist/station/traitor.dm @@ -101,9 +101,9 @@ var/datum/antagonist/traitor/traitors traitor_mob.faction = "syndicate" spawn_uplink(traitor_mob) // Tell them about people they might want to contact. - var/mob/living/carbon/human/M = get_nt_opposed() + var/mob/living/carbon/human/M = get_poor() if(M && M != traitor_mob) - to_chat(traitor_mob, "We have received credible reports that [M.real_name] might be willing to help our cause. If you need assistance, consider contacting them.") + to_chat(traitor_mob, "We have received credible reports that [M.real_name] might be susceptible to bribes. If you need assistance, consider contacting them.") traitor_mob.mind.store_memory("Potential Collaborator: [M.real_name]") //Begin code phrase. diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 7d957306189..0cc3398167f 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -277,9 +277,6 @@ var/global/list/additional_antag_types = list() spawn (ROUNDSTART_LOGOUT_REPORT_TIME) display_logout_report() - spawn (rand(waittime_l, waittime_h)) - send_intercept() - //Assign all antag types for this game mode. Any players spawned as antags earlier should have been removed from the pending list, so no need to worry about those. for(var/datum/antagonist/antag in antag_templates) if(!(antag.flags & ANTAG_OVERRIDE_JOB)) @@ -463,149 +460,6 @@ var/global/list/additional_antag_types = list() /datum/game_mode/proc/check_win() //universal trigger to be called at mob death, nuke explosion, etc. To be called from everywhere. return 0 -/datum/game_mode/proc/send_intercept() - - var/intercepttext = "


Cent. Com. Update
FOR YOUR EYES ONLY:

" - - var/list/disregard_roles = list() - for(var/antag_type in all_antag_types) - var/datum/antagonist/antag = all_antag_types[antag_type] - if(antag.flags & ANTAG_SUSPICIOUS) - disregard_roles |= antag.role_text - - var/list/suspects = list() - var/list/loyalists - var/list/repeat_offenders = list() - var/eng_suspect = 0 - var/eng = 0 - var/sec_suspect = 0 - var/sec = 0 - var/med_suspect = 0 - var/med = 0 - var/sci_suspect = 0 - var/sci = 0 - var/civ_suspect = 0 - var/civ = 0 - var/loyal_crew = 0 - var/total_crew = 0 - var/evil_department - - for(var/mob/living/carbon/human/man in player_list) if(man.client && man.mind) - - // NT relation option - var/special_role = man.mind.special_role - var/datum/antagonist/special_role_data = get_antag_data(special_role) - - total_crew += 1 - if (special_role in disregard_roles) - continue - else if(man.mind.assigned_job) - var/datum/job/job = man.mind.assigned_job - var/evil = 0 - if(man.client.prefs.nanotrasen_relation == COMPANY_OPPOSED || man.client.prefs.nanotrasen_relation == COMPANY_SKEPTICAL) - evil = 1 - if((DEPARTMENT_CIVILIAN in job.departments) || (DEPARTMENT_CARGO in job.departments)) - civ += 1 - if(evil) - civ_suspect += 1 - if(DEPARTMENT_ENGINEERING in job.departments) - eng += 1 - if(evil) - eng_suspect += 1 - if(DEPARTMENT_SECURITY in job.departments) - sec += 1 - if(evil) - sec_suspect += 1 - if(DEPARTMENT_MEDICAL in job.departments) - med +=1 - if(evil) - med_suspect += 1 - if(DEPARTMENT_SCIENCE in job.departments) - sci += 1 - if(evil) - sci_suspect += 1 - - else if(man.client.prefs.nanotrasen_relation == COMPANY_OPPOSED && prob(25)) - suspects += man - else if(man.client.prefs.nanotrasen_relation == COMPANY_LOYAL || man.client.prefs.nanotrasen_relation == COMPANY_SUPPORTATIVE) - loyal_crew += 1 - if(prob(25)) - loyalists += man - // Antags - else if(special_role_data && prob(special_role_data.suspicion_chance)) - suspects += man - if(man.incidents.len >= 3) - repeat_offenders += man - - var/civ_ratio = 0 - if(civ) - civ_ratio = civ_suspect / civ - var/eng_ratio = 0 - if(eng) - eng_ratio = eng_suspect / eng - var/sec_ratio = 0 - if(sec) - sec_ratio = sec_suspect / sec - var/med_ratio = 0 - if(med) - med_ratio = med_suspect / med - var/sci_ratio = 0 - if(sci) - sci_ratio = sci_suspect / sci - - var/most_evil = max(civ_ratio, eng_ratio, sec_ratio, med_ratio, sci_ratio) - if(most_evil >= 0.5) - if(most_evil == civ_ratio) - evil_department = "Civilian & Supply" - else if(most_evil == eng_ratio) - evil_department = "Engineering" - else if(most_evil == sec_ratio) - evil_department = "Security" - else if(most_evil == med_ratio) - evil_department = "Medical" - else if(most_evil == sci_ratio) - evil_department = "Science" - - var/business_jargon = list("Collated incident reports","Assembled peer-reviews","Persistently negative staff reviews","Collected shift logs","Accumulated negative reports","Analyzed shift data") - var/mean_words = list("has expressed consistent disapproval with the network", "is no longer working efficiently","has gone on record against NanoTrasen practices","is spreading minor dissent in response to recent NanoTrasen behavior","has expressed subversive intent","is unhappy with their employment package") - - if(suspects) - intercepttext += "The personnel listed below have been marked at-risk elements that Cent. Com. has deemed priority handling for the current shift:
" - for(var/mob/living/carbon/human/M in suspects) - if(player_is_antag(M.mind, only_offstation_roles = 1)) - continue - intercepttext += "
+ [pick(business_jargon)] indicate that [M.mind.assigned_role] [M.name] [pick(mean_words)].
" - intercepttext += "Cent. Com recommends coordinating with human resources to resolve any issues with employment.
" - - if(repeat_offenders) - intercepttext += "
The personnel listed below possess three or more offenses listed on record:" - for(var/mob/living/carbon/human/M in repeat_offenders) - if(player_is_antag(M.mind, only_offstation_roles = 1)) - continue - intercepttext += "
+ [M.mind.assigned_role] [M.name], [M.incidents.len] offenses.
" - intercepttext += "Cent. Com recommends coordinating with internal security to monitor and rehabilitate these personnel.
" - - if(loyalists) - intercepttext += "
The personnel listed below have been indicated as particularly loyal to NanoTrasen:" - for(var/mob/living/carbon/human/M in loyalists) - if(player_is_antag(M.mind, only_offstation_roles = 1)) - continue - intercepttext += "
+ [M.mind.assigned_role] [M.name].
" - intercepttext += "Cent. Com recommends coordinating with human resources to reward and further motivate these personnel for their loyalty.
" - - if(evil_department) - intercepttext += "
[pick(business_jargon)] indicate that a majority of the [evil_department] department [pick(mean_words)]. This department has been marked at-risk and Cent. Com. recommends immediate action before the situation worsens.
" - if(total_crew) - intercepttext += "
Data collected and analyzed by Bubble indicate that [round((loyal_crew/total_crew)*100)]% of the current crew detail are supportive of NanoTrasen actions. Cent. Com. implores the current Head of Staff detail to increase this percentage.
" - - intercepttext += "
Respectfully,
Quix Repi'Weish, Chief Personnel Director
" - intercepttext += "
" - - //New message handling - post_comm_message("Cent. Com. Status Summary", intercepttext) - - sound_to(world, ('sound/AI/commandreport.ogg')) - /datum/game_mode/proc/get_players_for_role(var/role, var/antag_id) var/list/players = list() var/list/candidates = list() @@ -736,13 +590,13 @@ proc/display_logout_report() return to_chat(src,get_logout_report()) -proc/get_nt_opposed() +proc/get_poor() var/list/dudes = list() for(var/mob/living/carbon/human/man in player_list) if(man.client) - if(man.client.prefs.nanotrasen_relation == COMPANY_OPPOSED) + if(man.client.prefs.economic_status == ECONOMICALLY_POOR) dudes += man - else if(man.client.prefs.nanotrasen_relation == COMPANY_SKEPTICAL && prob(50)) + else if(man.client.prefs.economic_status == ECONOMICALLY_POOR && prob(50)) dudes += man if(dudes.len == 0) return null return pick(dudes) diff --git a/code/game/gamemodes/meme/meme.dm b/code/game/gamemodes/meme/meme.dm index d2f61f08ddd..333a51df0ca 100644 --- a/code/game/gamemodes/meme/meme.dm +++ b/code/game/gamemodes/meme/meme.dm @@ -76,9 +76,6 @@ qdel(original) log_admin("Created [memes.len] memes.") - - spawn (rand(waittime_l, waittime_h)) - send_intercept() ..() return diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 089cc2c8bf1..116d8167906 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -79,14 +79,14 @@ if(!account_allowed || (H.mind && H.mind.initial_account)) return - var/loyalty = 1 + var/econ_status = 1 if(H.client) - switch(H.client.prefs.nanotrasen_relation) - if(COMPANY_LOYAL) loyalty = 1.30 - if(COMPANY_SUPPORTATIVE) loyalty = 1.15 - if(COMPANY_NEUTRAL) loyalty = 1 - if(COMPANY_SKEPTICAL) loyalty = 0.85 - if(COMPANY_OPPOSED) loyalty = 0.70 + switch(H.client.prefs.economic_status) + if(ECONOMICALLY_WEALTHY) econ_status = 1.30 + if(ECONOMICALLY_WELLOFF) econ_status = 1.15 + if(ECONOMICALLY_AVERAGE) econ_status = 1 + if(ECONOMICALLY_UNDERPAID) econ_status = 0.75 + if(ECONOMICALLY_POOR) econ_status = 0.50 //give them an account in the station database var/species_modifier = (H.species ? H.species.economic_modifier : null) @@ -94,7 +94,7 @@ var/datum/species/human_species = global.all_species[SPECIES_HUMAN] species_modifier = human_species.economic_modifier - var/money_amount = initial_funds_override ? initial_funds_override : (rand(5,50) + rand(5, 50)) * loyalty * economic_modifier * species_modifier + var/money_amount = initial_funds_override ? initial_funds_override : (rand(5,50) + rand(5, 50)) * econ_status * economic_modifier * species_modifier var/datum/money_account/M = SSeconomy.create_account(H.real_name, money_amount, null, public_account) if(H.mind) var/remembered_info = "" @@ -161,19 +161,19 @@ H.species.before_equip(H, FALSE, src) - var/loyalty = 1 + var/econ_status = 1 if(H.client) - switch(H.client.prefs.nanotrasen_relation) - if(COMPANY_LOYAL) loyalty = 3 - if(COMPANY_SUPPORTATIVE) loyalty = 2 - if(COMPANY_NEUTRAL) loyalty = 1 - if(COMPANY_SKEPTICAL) loyalty = -2 - if(COMPANY_OPPOSED) loyalty = -3 + switch(H.client.prefs.economic_status) + if(ECONOMICALLY_WEALTHY) econ_status = 3 + if(ECONOMICALLY_WELLOFF) econ_status = 2 + if(ECONOMICALLY_AVERAGE) econ_status = 1 + if(ECONOMICALLY_UNDERPAID) econ_status = -2 + if(ECONOMICALLY_POOR) econ_status = -3 //give them an account in the station database var/species_modifier = min((H.species ? H.species.economic_modifier : 0) - 9, 0) - var/wealth = (loyalty + economic_modifier + species_modifier) + var/wealth = (econ_status + economic_modifier + species_modifier) switch(wealth) if(-INFINITY to 6) diff --git a/code/modules/client/preference_setup/general/05_background.dm b/code/modules/client/preference_setup/general/05_background.dm index d7d2ebbed52..2f7946db2c4 100644 --- a/code/modules/client/preference_setup/general/05_background.dm +++ b/code/modules/client/preference_setup/general/05_background.dm @@ -9,7 +9,7 @@ S["citizenship"] >> pref.citizenship S["religion"] >> pref.religion S["accent"] >> pref.accent - S["nanotrasen_relation"] >> pref.nanotrasen_relation + S["economic_status"] >> pref.economic_status /datum/category_item/player_setup_item/general/background/save_character(var/savefile/S) S["med_record"] << pref.med_record @@ -18,7 +18,7 @@ S["citizenship"] << pref.citizenship S["religion"] << pref.religion S["accent"] << pref.accent - S["nanotrasen_relation"] << pref.nanotrasen_relation + S["economic_status"] << pref.economic_status /datum/category_item/player_setup_item/general/background/gather_load_query() return list( @@ -33,7 +33,7 @@ ), "ss13_characters" = list( "vars" = list( - "nt_relation" = "nanotrasen_relation", + "economic_status", "citizenship", "religion", "accent" @@ -57,7 +57,7 @@ "char_id" = 1 ), "ss13_characters" = list( - "nt_relation", + "economic_status", "citizenship", "religion", "accent", @@ -72,7 +72,7 @@ "records_medical" = pref.med_record, "records_security" = pref.sec_record, "char_id" = pref.current_character, - "nt_relation" = pref.nanotrasen_relation, + "economic_status" = pref.economic_status, "citizenship" = pref.citizenship, "religion" = pref.religion, "accent" = pref.accent, @@ -96,12 +96,12 @@ if(!(pref.accent in S.allowed_accents)) pref.accent = S.default_accent - pref.nanotrasen_relation = sanitize_inlist(pref.nanotrasen_relation, COMPANY_ALIGNMENTS, initial(pref.nanotrasen_relation)) + pref.economic_status = sanitize_inlist(pref.economic_status, ECONOMIC_POSITIONS, initial(pref.economic_status)) /datum/category_item/player_setup_item/general/background/content(var/mob/user) var/list/dat = list( "Background Information
", - "[current_map.company_name] Relation: [pref.nanotrasen_relation]
", + "Economic Status: [pref.economic_status]
", "Citizenship: [pref.citizenship]
", "Religion: [pref.religion]
", "Accent: [pref.accent]
", @@ -122,10 +122,10 @@ /datum/category_item/player_setup_item/general/background/OnTopic(var/href,var/list/href_list, var/mob/user) var/datum/species/S = all_species[pref.species] - if(href_list["nt_relation"]) - var/new_relation = input(user, "Choose your relation to NT. Note that this represents what others can find out about your character by researching your background, not what your character actually thinks.", "Character Preference", pref.nanotrasen_relation) as null|anything in COMPANY_ALIGNMENTS - if(new_relation && CanUseTopic(user)) - pref.nanotrasen_relation = new_relation + if(href_list["economic_status"]) + var/new_status = input(user, "Choose how wealthy your character is. Note that this applies a multiplier to a value that is also affected by your species and job.", "Character Preference", pref.economic_status) as null|anything in ECONOMIC_POSITIONS + if(new_status && CanUseTopic(user)) + pref.economic_status = new_status return TOPIC_REFRESH else if(href_list["citizenship"]) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index e785fa49710..8dd669c08cf 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -142,7 +142,7 @@ datum/preferences var/list/ccia_actions = list() var/list/disabilities = list() - var/nanotrasen_relation = "Neutral" + var/economic_status = ECONOMICALLY_AVERAGE var/uplinklocation = "PDA" @@ -660,7 +660,7 @@ datum/preferences ccia_actions = list() disabilities = list() - nanotrasen_relation = "Neutral" + economic_status = ECONOMICALLY_AVERAGE // Deletes a character from the database /datum/preferences/proc/delete_character_sql(var/client/C) diff --git a/html/changelogs/Economy.yml b/html/changelogs/Economy.yml new file mode 100644 index 00000000000..7ffac389c93 --- /dev/null +++ b/html/changelogs/Economy.yml @@ -0,0 +1,7 @@ +author: TheGreyWolf + +delete-after: True + +changes: + - tweak: "Nanotrasen relations in the char setup has now been changed into economic status." + - rscdel: "The NTCC report spawning in the bridge at roundstart has been removed."