diff --git a/code/__DEFINES/achievements.dm b/code/__DEFINES/achievements.dm index 68e033420b1..db0ff4a3501 100644 --- a/code/__DEFINES/achievements.dm +++ b/code/__DEFINES/achievements.dm @@ -63,3 +63,6 @@ #define SWARMER_BEACON_SCORE "Swarmer Beacs Killed" #define KINGGOAT_SCORE "King Goat Killed" #define TENDRIL_CLEAR_SCORE "Tendrils Killed" + +// DB IDs for hardcore random mode +#define HARDCORE_RANDOM_SCORE "Hardcore Random Score" diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index ebc0e0b028e..2c09746e5fb 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -487,6 +487,10 @@ GLOBAL_LIST_INIT(pda_styles, sortList(list(MONO, VT, ORBITRON, SHARE))) #define ALIGNMENT_NEUT "neutral" #define ALIGNMENT_EVIL "evil" + +// Play time / EXP +#define PLAYTIME_HARDCORE_RANDOM 120 + // The alpha we give to stuff under tiles, if they want it #define ALPHA_UNDERTILE 128 @@ -495,3 +499,4 @@ GLOBAL_LIST_INIT(pda_styles, sortList(list(MONO, VT, ORBITRON, SHARE))) #define ANON_DISABLED "" //so it's falsey #define ANON_RANDOMNAMES "Random Default" #define ANON_EMPLOYEENAMES "Employees" + diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index 91b849bd50e..87f761016d2 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -86,6 +86,7 @@ #define JP_HIGH 3 //randomised elements +#define RANDOM_HARDCORE "random_hardcore" #define RANDOM_NAME "random_name" #define RANDOM_NAME_ANTAG "random_name_antag" #define RANDOM_BODY "random_body" diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index e173231ffdf..121acf332ff 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -177,6 +177,29 @@ file_data["wanted"] = list("author" = "[GLOB.news_network.wanted_issue.scannedUser]", "criminal" = "[GLOB.news_network.wanted_issue.criminal]", "description" = "[GLOB.news_network.wanted_issue.body]", "photo file" = "[GLOB.news_network.wanted_issue.photo_file]") WRITE_FILE(json_file, json_encode(file_data)) +///Handles random hardcore point rewarding if it applies. +/datum/controller/subsystem/ticker/proc/HandleRandomHardcoreScore(client/player_client) + if(!ishuman(player_client.mob)) + return FALSE + var/mob/living/carbon/human/human_mob = player_client.mob + if(!human_mob.hardcore_survival_score) ///no score no glory + return FALSE + + if(human_mob.mind && (human_mob.mind.special_role || length(human_mob.mind.antag_datums) > 0)) + var/didthegamerwin = TRUE + for(var/a in human_mob.mind.antag_datums) + var/datum/antagonist/antag_datum = a + for(var/i in antag_datum.objectives) + var/datum/objective/objective_datum = i + if(!objective_datum.check_completion()) + didthegamerwin = FALSE + if(!didthegamerwin) + return FALSE + player_client.give_award(/datum/award/score/hardcore_random, human_mob, round(human_mob.hardcore_survival_score)) + else if(human_mob.onCentCom()) + player_client.give_award(/datum/award/score/hardcore_random, human_mob, round(human_mob.hardcore_survival_score)) + + /datum/controller/subsystem/ticker/proc/declare_completion() set waitfor = FALSE @@ -198,6 +221,7 @@ C.playtitlemusic(40) if(speed_round) C.give_award(/datum/award/achievement/misc/speed_round, C.mob) + HandleRandomHardcoreScore(C) var/popcount = gather_roundend_feedback() display_report(popcount) @@ -280,6 +304,8 @@ //Antagonists parts += antag_report() + parts += hardcore_random_report() + CHECK_TICK //Medals parts += medal_report() @@ -435,6 +461,22 @@ return "
[parts.Join("
")]
" return "" +///Generate a report for all players who made it out alive with a hardcore random character and prints their final score +/datum/controller/subsystem/ticker/proc/hardcore_random_report() + . = list() + . += "The following people made it out as a random hardcore character:" + . += "" + /datum/controller/subsystem/ticker/proc/antag_report() var/list/result = list() var/list/all_teams = list() diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index 365b2320d7e..2b7563c90c9 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -12,7 +12,9 @@ PROCESSING_SUBSYSTEM_DEF(quirks) var/list/quirks = list() //Assoc. list of all roundstart quirk datum types; "name" = /path/ var/list/quirk_points = list() //Assoc. list of quirk names and their "point cost"; positive numbers are good traits, and negative ones are bad var/list/quirk_objects = list() //A list of all quirk objects in the game, since some may process - var/list/quirk_blacklist = list() //A list a list of quirks that can not be used with each other. Format: list(quirk1,quirk2),list(quirk3,quirk4) + var/list/quirk_blacklist = list() //A list of quirks that can not be used with each other. Format: list(quirk1,quirk2),list(quirk3,quirk4) + ///An assoc list of quirks that can be obtained as a hardcore character, and their hardcore value. + var/list/hardcore_quirks = list() /datum/controller/subsystem/processing/quirks/Initialize(timeofday) if(!quirks.len) @@ -30,6 +32,12 @@ PROCESSING_SUBSYSTEM_DEF(quirks) quirks[initial(T.name)] = T quirk_points[initial(T.name)] = initial(T.value) + var/hardcore_value = initial(T.hardcore_value) + + if(!hardcore_value) + continue + hardcore_quirks[T] += hardcore_value + /datum/controller/subsystem/processing/quirks/proc/AssignQuirks(mob/living/user, client/cli, spawn_effects) var/badquirk = FALSE for(var/V in cli.prefs.all_quirks) @@ -43,6 +51,10 @@ PROCESSING_SUBSYSTEM_DEF(quirks) if(badquirk) cli.prefs.save_character() + if(ishuman(user)) + var/mob/living/carbon/human/human = user + human.hardcore_survival_score = cli.prefs.hardcore_survival_score //Only do this if we actually asign quirks, to prevent sillicons etc from getting the points. + // Assign wayfinding pinpointer granting quirk if they're new if(cli.get_exp_living(TRUE) < EXP_ASSIGN_WAYFINDER && !user.has_quirk(/datum/quirk/needswayfinder)) user.add_quirk(/datum/quirk/needswayfinder, TRUE) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 62a5e7ce287..56f89abdcb9 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -322,6 +322,15 @@ SUBSYSTEM_DEF(ticker) else stack_trace("[S] [S.type] found in start landmarks list, which isn't a start landmark!") + for(var/i in GLOB.player_list) + if(!ishuman(i)) + continue + var/mob/living/carbon/human/hardcore_player = i + if(!hardcore_player.hardcore_survival_score) + continue + if(hardcore_player.mind?.special_role) + hardcore_player.hardcore_survival_score *= 2 //Double for antags + to_chat(hardcore_player, "You will gain [round(hardcore_player.hardcore_survival_score)] hardcore random points if you survive this round!") //These callbacks will fire after roundstart key transfer /datum/controller/subsystem/ticker/proc/OnRoundstart(datum/callback/cb) diff --git a/code/datums/achievements/_achievement_data.dm b/code/datums/achievements/_achievement_data.dm index f353ef03614..52b07472982 100644 --- a/code/datums/achievements/_achievement_data.dm +++ b/code/datums/achievements/_achievement_data.dm @@ -59,8 +59,8 @@ data[achievement_type] = A.load(owner_ckey) original_cached_data[achievement_type] = data[achievement_type] -///Unlocks an achievement of a specific type. -/datum/achievement_data/proc/unlock(achievement_type, mob/user) +///Unlocks an achievement of a specific type. achievement type is a typepath to the award, user is the mob getting the award, and value is an optional value to be used for defining a score to add to the leaderboard +/datum/achievement_data/proc/unlock(achievement_type, mob/user, value = 1) if(!SSachievements.achievements_enabled) return var/datum/award/A = SSachievements.awards[achievement_type] @@ -71,7 +71,7 @@ data[achievement_type] = TRUE A.on_unlock(user) //Only on default achievement, as scores keep going up. else if(istype(A, /datum/award/score)) - data[achievement_type] += 1 + data[achievement_type] += value ///Getter for the status/score of an achievement /datum/achievement_data/proc/get_achievement_status(achievement_type) diff --git a/code/datums/achievements/hardcore_random.dm b/code/datums/achievements/hardcore_random.dm new file mode 100644 index 00000000000..c5e2692552f --- /dev/null +++ b/code/datums/achievements/hardcore_random.dm @@ -0,0 +1,4 @@ +/datum/award/score/hardcore_random + name = "Hardcore random points" + desc = "Well, I might be a blind, deaf, crippled guy, but hey, at least I'm alive." + database_id = HARDCORE_RANDOM_SCORE diff --git a/code/datums/traits/_quirk.dm b/code/datums/traits/_quirk.dm index 7f1a203e2d7..c36e1679135 100644 --- a/code/datums/traits/_quirk.dm +++ b/code/datums/traits/_quirk.dm @@ -10,6 +10,8 @@ var/medical_record_text //This text will appear on medical records for the trait. Not yet implemented var/mood_quirk = FALSE //if true, this quirk affects mood and is unavailable if moodlets are disabled var/mob_trait //if applicable, apply and remove this mob trait + ///Amount of points this trait is worth towards the hardcore character mode; minus points implies a positive quirk, positive means its hard. This is used to pick the quirks assigned to a hardcore character. 0 means its not available to hardcore draws. + var/hardcore_value = 0 var/mob/living/quirk_holder /datum/quirk/New(mob/living/quirk_mob, spawn_effects) diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index d38d8f76bcf..1e9e2187ee1 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -8,6 +8,7 @@ gain_text = "Your back REALLY hurts!" lose_text = "Your back feels better." medical_record_text = "Patient scans indicate severe and chronic back pain." + hardcore_value = 4 /datum/quirk/badback/on_process() var/mob/living/carbon/human/H = quirk_holder @@ -23,6 +24,7 @@ gain_text = "You feel your vigor slowly fading away." lose_text = "You feel vigorous again." medical_record_text = "Patient requires regular treatment for blood loss due to low production of blood." + hardcore_value = 8 /datum/quirk/blooddeficiency/on_process() var/mob/living/carbon/human/H = quirk_holder @@ -39,6 +41,7 @@ gain_text = "You can't see anything." lose_text = "You miraculously gain back your vision." medical_record_text = "Patient has permanent blindness." + hardcore_value = 15 /datum/quirk/blindness/add() quirk_holder.become_blind(ROUNDSTART_TRAIT) @@ -57,6 +60,7 @@ gain_text = "You feel smooth." lose_text = "You feel wrinkled again." medical_record_text = "Patient has a tumor in their brain that is slowly driving them to brain death." + hardcore_value = 12 /datum/quirk/brainproblems/on_process() quirk_holder.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2) @@ -69,6 +73,7 @@ gain_text = "You can't hear anything." lose_text = "You're able to hear again!" medical_record_text = "Patient's cochlear nerve is incurably damaged." + hardcore_value = 12 /datum/quirk/depression name = "Depression" @@ -79,6 +84,7 @@ lose_text = "You no longer feel depressed." //if only it were that easy! medical_record_text = "Patient has a mild mood disorder causing them to experience acute episodes of depression." mood_quirk = TRUE + hardcore_value = 1 /datum/quirk/depression/on_process() if(prob(0.05)) @@ -92,6 +98,7 @@ var/obj/item/heirloom var/where medical_record_text = "Patient demonstrates an unnatural attachment to a family heirloom." + hardcore_value = 1 /datum/quirk/family_heirloom/on_spawn() var/mob/living/carbon/human/H = quirk_holder @@ -216,6 +223,7 @@ gain_text = "You feel frail." lose_text = "You feel sturdy again." medical_record_text = "Patient has unusually frail bones, recommend calcium-rich diet." + hardcore_value = 4 /datum/quirk/heavy_sleeper name = "Heavy Sleeper" @@ -225,6 +233,7 @@ gain_text = "You feel sleepy." lose_text = "You feel awake again." medical_record_text = "Patient has abnormal sleep study results and is difficult to wake up." + hardcore_value = 2 /datum/quirk/hypersensitive name = "Hypersensitive" @@ -233,6 +242,7 @@ gain_text = "You seem to make a big deal out of everything." lose_text = "You don't seem to make a big deal out of everything anymore." medical_record_text = "Patient demonstrates a high level of emotional volatility." + hardcore_value = 3 /datum/quirk/hypersensitive/add() var/datum/component/mood/mood = quirk_holder.GetComponent(/datum/component/mood) @@ -253,6 +263,7 @@ gain_text = "Just the thought of drinking alcohol makes your head spin." lose_text = "You're no longer severely affected by alcohol." medical_record_text = "Patient demonstrates a low tolerance for alcohol. (Wimp)" + hardcore_value = 3 /datum/quirk/nearsighted //t. errorage name = "Nearsighted" @@ -261,6 +272,7 @@ gain_text = "Things far away from you start looking blurry." lose_text = "You start seeing faraway things normally again." medical_record_text = "Patient requires prescription glasses in order to counteract nearsightedness." + hardcore_value = 5 /datum/quirk/nearsighted/add() quirk_holder.become_nearsighted(ROUNDSTART_TRAIT) @@ -277,6 +289,7 @@ desc = "As far as you can remember, you've always been afraid of the dark. While in the dark without a light source, you instinctually act careful, and constantly feel a sense of dread." value = -1 medical_record_text = "Patient demonstrates a fear of the dark. (Seriously?)" + hardcore_value = 5 /datum/quirk/nyctophobia/on_process() var/mob/living/carbon/human/H = quirk_holder @@ -300,6 +313,7 @@ gain_text = "You feel repulsed by the thought of violence!" lose_text = "You think you can defend yourself again." medical_record_text = "Patient is unusually pacifistic and cannot bring themselves to cause physical harm." + hardcore_value = 6 /datum/quirk/paraplegic name = "Paraplegic" @@ -309,6 +323,7 @@ gain_text = null // Handled by trauma. lose_text = null medical_record_text = "Patient has an untreatable impairment in motor function in the lower extremities." + hardcore_value = 15 /datum/quirk/paraplegic/add() var/datum/brain_trauma/severe/paralysis/paraplegic/T = new() @@ -322,7 +337,11 @@ var/turf/T = get_turf(quirk_holder) var/obj/structure/chair/spawn_chair = locate() in T - var/obj/vehicle/ridden/wheelchair/wheels = new(T) + var/obj/vehicle/ridden/wheelchair/wheels + if(quirk_holder.client?.get_award_status(HARDCORE_RANDOM_SCORE) >= 5000) //More than 5k score? you unlock the gamer wheelchair. + wheels = new /obj/vehicle/ridden/wheelchair/gold(T) + else + wheels = new(T) if(spawn_chair) // Makes spawning on the arrivals shuttle more consistent looking wheels.setDir(spawn_chair.dir) @@ -341,6 +360,7 @@ value = -1 mob_trait = TRAIT_POOR_AIM medical_record_text = "Patient possesses a strong tremor in both hands." + hardcore_value = 3 /datum/quirk/prosopagnosia name = "Prosopagnosia" @@ -348,6 +368,7 @@ value = -1 mob_trait = TRAIT_PROSOPAGNOSIA medical_record_text = "Patient suffers from prosopagnosia and cannot recognize faces." + hardcore_value = 5 /datum/quirk/prosthetic_limb name = "Prosthetic Limb" @@ -355,6 +376,7 @@ value = -1 var/slot_string = "limb" medical_record_text = "During physical examination, patient was found to have a prosthetic limb." + hardcore_value = 3 /datum/quirk/prosthetic_limb/on_spawn() var/limb_slot = pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) @@ -390,6 +412,7 @@ gain_text = "You feel like a pushover." lose_text = "You feel like standing up for yourself." medical_record_text = "Patient presents a notably unassertive personality and is easy to manipulate." + hardcore_value = 4 /datum/quirk/insanity name = "Reality Dissociation Syndrome" @@ -399,6 +422,7 @@ gain_text = "..." lose_text = "You feel in tune with the world again." medical_record_text = "Patient suffers from acute Reality Dissociation Syndrome and experiences vivid hallucinations." + hardcore_value = 6 /datum/quirk/insanity/on_process() if(quirk_holder.reagents.has_reagent(/datum/reagent/toxin/mindbreaker, needs_metabolizing = TRUE)) @@ -423,6 +447,7 @@ gain_text = "You start worrying about what you're saying." lose_text = "You feel easier about talking again." //if only it were that easy! medical_record_text = "Patient is usually anxious in social encounters and prefers to avoid them." + hardcore_value = 4 var/dumb_thing = TRUE /datum/quirk/social_anxiety/on_process() @@ -449,6 +474,7 @@ gain_text = "You suddenly feel the craving for drugs." lose_text = "You feel like you should kick your drug habit." medical_record_text = "Patient has a history of hard drugs." + hardcore_value = 4 var/drug_list = list(/datum/reagent/drug/crank, /datum/reagent/drug/krokodil, /datum/reagent/medicine/morphine, /datum/reagent/drug/happiness, /datum/reagent/drug/methamphetamine) //List of possible IDs var/datum/reagent/reagent_type //!If this is defined, reagent_id will be unused and the defined reagent type will be instead. var/datum/reagent/reagent_instance //! actual instanced version of the reagent @@ -518,6 +544,7 @@ medical_record_text = "Patient is a current smoker." reagent_type = /datum/reagent/drug/nicotine accessory_type = /obj/item/lighter/greyscale + hardcore_value = 1 /datum/quirk/junkie/smoker/on_spawn() drug_container_type = pick(/obj/item/storage/fancy/cigarettes, @@ -551,3 +578,4 @@ gain_text = "There's a lot on your mind right now." lose_text = "Your mind finally feels calm." medical_record_text = "Patient's mind is in a vulnerable state, and cannot recover from traumatic events." + hardcore_value = 9 diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index b2885c31771..b21a91ff759 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -960,6 +960,10 @@ GLOBAL_LIST_EMPTY(external_rsc_urls) qdel(S) char_render_holders = null +///Redirect proc that makes it easier to call the unlock achievement proc. Achievement type is the typepath to the award, user is the mob getting the award, and value is an optional variable used for leaderboard value increments +/client/proc/give_award(achievement_type, mob/user, value = 1) + return player_details.achievements.unlock(achievement_type, user, value) -/client/proc/give_award(achievement_type, mob/user) - return player_details.achievements.unlock(achievement_type, user) +///Redirect proc that makes it easier to get the status of an achievement. Achievement type is the typepath to the award. +/client/proc/get_award_status(achievement_type, mob/user, value = 1) + return player_details.achievements.get_achievement_status(achievement_type) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 7f80f1d74c2..729dbc46bb5 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -112,6 +112,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/action_buttons_screen_locs = list() + ///This var stores the amount of points the owner will get for making it out alive. + var/hardcore_survival_score = 0 + /datum/preferences/New(client/C) parent = C @@ -197,6 +200,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Random Name " dat += "Always Random Name: [(randomise[RANDOM_NAME]) ? "Yes" : "No"]" dat += "When Antagonist: [(randomise[RANDOM_NAME_ANTAG]) ? "Yes" : "No"]" + if(user.client.get_exp_living(TRUE) >= PLAYTIME_HARDCORE_RANDOM) + dat += "Hardcore Random: [(randomise[RANDOM_HARDCORE]) ? "Yes" : "No"]" dat += "
Name: " dat += "[real_name]
" @@ -1098,8 +1103,10 @@ GLOBAL_LIST_EMPTY(preferences_datums) return for(var/V in SSquirks.quirk_blacklist) //V is a list var/list/L = V + if(!(quirk in L)) + continue for(var/Q in all_quirks) - if((quirk in L) && (Q in L) && !(Q == quirk)) //two quirks have lined up in the list of the list of quirks that conflict with each other, so return (see quirks.dm for more details) + if((Q in L) && !(Q == quirk)) //two quirks have lined up in the list of the list of quirks that conflict with each other, so return (see quirks.dm for more details) to_chat(user, "[quirk] is incompatible with [Q].") return var/value = SSquirks.quirk_points[quirk] @@ -1740,17 +1747,24 @@ GLOBAL_LIST_EMPTY(preferences_datums) /datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = 1, roundstart_checks = TRUE, character_setup = FALSE, antagonist = FALSE) - if(randomise[RANDOM_SPECIES] && !character_setup) + hardcore_survival_score = 0 //Set to 0 to prevent you getting points from last another time. + + if((randomise[RANDOM_SPECIES] || randomise[RANDOM_HARDCORE]) && !character_setup) + random_species() - if((randomise[RANDOM_BODY] || randomise[RANDOM_BODY_ANTAG] && antagonist) && !character_setup) + if((randomise[RANDOM_BODY] || (randomise[RANDOM_BODY_ANTAG] && antagonist) || randomise[RANDOM_HARDCORE]) && !character_setup) slot_randomized = TRUE random_character(gender, antagonist) - if((randomise[RANDOM_NAME] || randomise[RANDOM_NAME_ANTAG] && antagonist) && !character_setup) + if((randomise[RANDOM_NAME] || (randomise[RANDOM_NAME_ANTAG] && antagonist) || randomise[RANDOM_HARDCORE]) && !character_setup) slot_randomized = TRUE real_name = pref_species.random_name(gender) + if(randomise[RANDOM_HARDCORE] && parent.mob.mind && !character_setup) + if(can_be_random_hardcore()) + hardcore_random_setup(character, antagonist) + if(roundstart_checks) if(CONFIG_GET(flag/humans_need_surnames) && (pref_species.id == "human")) var/firstspace = findtext(real_name, " ") @@ -1806,6 +1820,15 @@ GLOBAL_LIST_EMPTY(preferences_datums) character.update_hair() character.update_body_parts() +/datum/preferences/proc/can_be_random_hardcore() + if(parent.mob.mind.assigned_role in GLOB.command_positions) //No command staff + return FALSE + for(var/A in parent.mob.mind.antag_datums) + var/datum/antagonist/antag + if(antag.get_team()) //No team antags + return FALSE + return TRUE + /datum/preferences/proc/get_default_name(name_id) switch(name_id) if("human") diff --git a/code/modules/mob/dead/new_player/preferences_setup.dm b/code/modules/mob/dead/new_player/preferences_setup.dm index 7dd7a596c25..f86527a7776 100644 --- a/code/modules/mob/dead/new_player/preferences_setup.dm +++ b/code/modules/mob/dead/new_player/preferences_setup.dm @@ -46,6 +46,58 @@ if(randomise[RANDOM_NAME]) real_name = pref_species.random_name(gender,1) +///Setup a hardcore random character and calculate their hardcore random score +/datum/preferences/proc/hardcore_random_setup(mob/living/carbon/human/character, antagonist) + random_character(TRUE, antagonist) + select_hardcore_quirks() + hardcore_survival_score = hardcore_survival_score ** 1.2 //30 points would be about 60 score + +///Go through all quirks that can be used in hardcore mode and select some based on a random budget. +/datum/preferences/proc/select_hardcore_quirks() + + var/quirk_budget = rand(8, 35) + + + all_quirks = list() //empty it out + + var/list/available_hardcore_quirks = SSquirks.hardcore_quirks.Copy() + + while(quirk_budget > 0) + for(var/i in available_hardcore_quirks) //Remove from available quirks if its too expensive. + var/datum/quirk/available_quirk = i + if(available_hardcore_quirks[available_quirk] > quirk_budget) + available_hardcore_quirks -= available_quirk + + if(!available_hardcore_quirks.len) + break + + var/datum/quirk/picked_quirk = pick(available_hardcore_quirks) + + var/picked_quirk_blacklisted = FALSE + for(var/bl in SSquirks.quirk_blacklist) //Check if the quirk is blacklisted with our current quirks. quirk_blacklist is a list of lists. + var/list/blacklist = bl + if(!(picked_quirk in blacklist)) + continue + for(var/iterator_quirk in all_quirks) //Go through all the quirks we've already selected to see if theres a blacklist match + if((iterator_quirk in blacklist) && !(iterator_quirk == picked_quirk)) //two quirks have lined up in the list of the list of quirks that conflict with each other, so return (see quirks.dm for more details) + picked_quirk_blacklisted = TRUE + break + if(picked_quirk_blacklisted) + break + + if(picked_quirk_blacklisted) + available_hardcore_quirks -= picked_quirk + continue + + if(initial(picked_quirk.mood_quirk) && CONFIG_GET(flag/disable_human_mood)) //check for moodlet quirks + available_hardcore_quirks -= picked_quirk + continue + + all_quirks += initial(picked_quirk.name) + quirk_budget -= available_hardcore_quirks[picked_quirk] + hardcore_survival_score += available_hardcore_quirks[picked_quirk] + available_hardcore_quirks -= picked_quirk + /datum/preferences/proc/update_preview_icon() // Determine what job is marked as 'High' priority, and dress them up as such. var/datum/job/previewJob diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index fcc10776a69..dce7417d18e 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -61,3 +61,5 @@ var/lastpuke = 0 var/last_fire_update var/account_id + + var/hardcore_survival_score = 0 diff --git a/code/modules/vehicles/wheelchair.dm b/code/modules/vehicles/wheelchair.dm index 2eb1a2ad5df..befd00ccfca 100644 --- a/code/modules/vehicles/wheelchair.dm +++ b/code/modules/vehicles/wheelchair.dm @@ -9,8 +9,10 @@ legs_required = 0 //You'll probably be using this if you don't have legs canmove = TRUE density = FALSE //Thought I couldn't fix this one easily, phew - // Run speed delay is multiplied with this for vehicle move delay. + /// Run speed delay is multiplied with this for vehicle move delay. var/delay_multiplier = 6.7 + /// This variable is used to specify which overlay icon is used for the wheelchair, ensures wheelchair can cover your legs + var/overlay_icon = "wheelchair_overlay" /obj/vehicle/ridden/wheelchair/Initialize() . = ..() @@ -91,7 +93,7 @@ /obj/vehicle/ridden/wheelchair/proc/handle_rotation_overlayed() cut_overlays() - var/image/V = image(icon = icon, icon_state = "wheelchair_overlay", layer = FLY_LAYER, dir = src.dir) + var/image/V = image(icon = icon, icon_state = overlay_icon, layer = FLY_LAYER, dir = src.dir) add_overlay(V) @@ -113,3 +115,13 @@ var/datum/component/riding/D = GetComponent(/datum/component/riding) D.vehicle_move_delay = round(CONFIG_GET(number/movedelay/run_delay) * 6.7) / user.get_num_arms() return ..() + + +/obj/vehicle/ridden/wheelchair/gold + material_flags = MATERIAL_ADD_PREFIX | MATERIAL_AFFECT_STATISTICS + desc = "Damn, he's been through a lot." + icon_state = "gold_wheelchair" + overlay_icon = "gold_wheelchair_overlay" + max_integrity = 200 + armor = list("melee" = 20, "bullet" = 20, "laser" = 20, "energy" = 0, "bomb" = 20, "bio" = 0, "rad" = 0, "fire" = 30, "acid" = 40) + custom_materials = list(/datum/material/gold = 10000) diff --git a/icons/obj/vehicles.dmi b/icons/obj/vehicles.dmi index ff49753f22b..6e5f346cc51 100644 Binary files a/icons/obj/vehicles.dmi and b/icons/obj/vehicles.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 728feead983..962c0c6d118 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -355,6 +355,7 @@ #include "code\datums\achievements\_awards.dm" #include "code\datums\achievements\boss_achievements.dm" #include "code\datums\achievements\boss_scores.dm" +#include "code\datums\achievements\hardcore_random.dm" #include "code\datums\achievements\misc_achievements.dm" #include "code\datums\achievements\skill_achievements.dm" #include "code\datums\actions\beam_rifle.dm"