From 29e0ac52c43bc5f8ff51506f9f09dfc6abb0470f Mon Sep 17 00:00:00 2001 From: Putnam Date: Fri, 31 Jan 2020 11:52:05 -0800 Subject: [PATCH] fuzzy objectives --- code/__HELPERS/roundend.dm | 9 +++++++- code/game/gamemodes/objective_sabotage.dm | 21 ++++++++++--------- .../modules/antagonists/_common/antag_team.dm | 7 +++++-- code/modules/antagonists/brother/brother.dm | 7 +++++-- .../antagonists/changeling/changeling.dm | 11 +++++++--- code/modules/antagonists/cult/cult.dm | 9 +++++--- .../antagonists/disease/disease_datum.dm | 11 ++++++---- .../antagonists/traitor/datum_traitor.dm | 11 ++++++---- code/modules/antagonists/wizard/wizard.dm | 11 ++++++---- interface/stylesheet.dm | 1 + 10 files changed, 65 insertions(+), 33 deletions(-) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 5102eb4802..906f60d65b 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -111,7 +111,14 @@ if(A.objectives.len) for(var/datum/objective/O in A.objectives) - var/result = O.check_completion() ? "SUCCESS" : "FAIL" + var/result = "UNKNOWN" + var/actual_result = O.check_completion() + if(actual_result >= 1) + result = "SUCCESS" + else if(actual_result <= 0) + result = "FAIL" + else + result = "[actual_result*100]%" antag_info["objectives"] += list(list("objective_type"=O.type,"text"=O.explanation_text,"result"=result)) SSblackbox.record_feedback("associative", "antagonists", 1, antag_info) diff --git a/code/game/gamemodes/objective_sabotage.dm b/code/game/gamemodes/objective_sabotage.dm index 0ede317626..467983a346 100644 --- a/code/game/gamemodes/objective_sabotage.dm +++ b/code/game/gamemodes/objective_sabotage.dm @@ -20,13 +20,16 @@ START_PROCESSING(SSprocessing, src) /datum/sabotage_objective/processing/proc/check_condition_processing() - return TRUE + return 100 /datum/sabotage_objective/processing/process() - won = check_condition_processing() - if(won) + check_condition_processing() + if(won >= 100) STOP_PROCESSING(SSprocessing,src) +/datum/sabotage_objective/processing/check_conditions() + return won + /datum/sabotage_objective/processing/power_sink name = "Drain at least 1 gigajoule of power using a power sink." sabotage_type = "powersink" @@ -41,8 +44,7 @@ for(var/datum/powernet/PN in GLOB.powernets) for(var/obj/item/powersink/sink in PN.nodes) sink_found_this_time = TRUE - if(sink.power_drained>1e9) - return TRUE + won = max(won,sink.power_drained/1e9) sink_found = sink_found_this_time count = 0 return FALSE @@ -59,7 +61,7 @@ " /datum/sabotage_objective/processing/supermatter - name = "Sabotage the supermatter so that it goes under 50% integrity." + name = "Sabotage the supermatter so that it goes under 50% integrity. If it is delaminated, you will fail." sabotage_type = "supermatter" special_equipment = list(/obj/item/paper/guides/antag/supermatter_sabotage) var/list/supermatters = list() @@ -73,9 +75,8 @@ if (!isturf(S.loc) || !(is_station_level(S.z) || is_mining_level(S.z))) continue supermatters.Add(S) - for(var/obj/machinery/power/supermatter_crystal/S in supermatters) - if(S.get_integrity() < 50) - return TRUE + for(var/obj/machinery/power/supermatter_crystal/S in supermatters) // you can win this with a wishgranter... lol. + won = max(1-((S.get_integrity()-50)/50),won) return FALSE /datum/sabotage_objective/station_integrity @@ -83,7 +84,7 @@ sabotage_type = "integrity" /datum/sabotage_objective/station_integrity/check_conditions() - return SSticker.station_integrity < 80 + return 100/(100-max(SSticker.station_integrity,80)) /datum/sabotage_objective/cloner name = "Destroy all Nanotrasen cloning machines." diff --git a/code/modules/antagonists/_common/antag_team.dm b/code/modules/antagonists/_common/antag_team.dm index b376287f7a..027abc7c94 100644 --- a/code/modules/antagonists/_common/antag_team.dm +++ b/code/modules/antagonists/_common/antag_team.dm @@ -37,11 +37,14 @@ var/objective_count = 1 for(var/datum/objective/objective in objectives) if(objective.completable) - if(objective.check_completion()) + var/completion = objective.check_completion() + if(completion >= 1) report += "Objective #[objective_count]: [objective.explanation_text] Success!" - else + else if(completion <= 0) report += "Objective #[objective_count]: [objective.explanation_text] Fail." win = FALSE + else + report += "Objective #[objective_count]: [objective.explanation_text] [completion*100]%" else report += "Objective #[objective_count]: [objective.explanation_text]" objective_count++ diff --git a/code/modules/antagonists/brother/brother.dm b/code/modules/antagonists/brother/brother.dm index 22a343fb5f..2292006da1 100644 --- a/code/modules/antagonists/brother/brother.dm +++ b/code/modules/antagonists/brother/brother.dm @@ -109,11 +109,14 @@ var/objective_count = 1 for(var/datum/objective/objective in objectives) if(objective.completable) - if(objective.check_completion()) + var/completion = objective.check_completion() + if(completion >= 1) parts += "Objective #[objective_count]: [objective.explanation_text] Success!" - else + else if(completion <= 0) parts += "Objective #[objective_count]: [objective.explanation_text] Fail." win = FALSE + else + parts += "Objective #[objective_count]: [objective.explanation_text] [completion*100]%" else parts += "Objective #[objective_count]: [objective.explanation_text]" objective_count++ diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index 7d702ac25d..a81c409233 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -54,8 +54,10 @@ var/honorific if(owner.current.gender == FEMALE) honorific = "Ms." - else + else if(owner.current.gender == MALE) honorific = "Mr." + else + honorific = "Mx." if(GLOB.possible_changeling_IDs.len) changelingID = pick(GLOB.possible_changeling_IDs) GLOB.possible_changeling_IDs -= changelingID @@ -553,11 +555,14 @@ var/count = 1 for(var/datum/objective/objective in objectives) if(objective.completable) - if(objective.check_completion()) + var/completion = objective.check_completion() + if(completion >= 1) parts += "Objective #[count]: [objective.explanation_text] Success!" - else + else if(completion <= 0) parts += "Objective #[count]: [objective.explanation_text] Fail." changelingwin = FALSE + else + parts += "Objective #[count]: [objective.explanation_text] [completion*100]%" else parts += "Objective #[count]: [objective.explanation_text]" count++ diff --git a/code/modules/antagonists/cult/cult.dm b/code/modules/antagonists/cult/cult.dm index df2383f892..6f9cf78514 100644 --- a/code/modules/antagonists/cult/cult.dm +++ b/code/modules/antagonists/cult/cult.dm @@ -425,10 +425,13 @@ parts += "The cultists' objectives were:" var/count = 1 for(var/datum/objective/objective in objectives) - if(objective.check_completion()) - parts += "Objective #[count]: [objective.explanation_text] Success!" + var/completion = objective.check_completion() + if(completion >= 1) + parts += "Objective #[count]: [objective.explanation_text] Success!" + else if(completion <= 0) + parts += "Objective #[count]: [objective.explanation_text] Fail." else - parts += "Objective #[count]: [objective.explanation_text] Fail." + parts += "Objective #[count]: [objective.explanation_text] [completion*100]%" count++ if(members.len) diff --git a/code/modules/antagonists/disease/disease_datum.dm b/code/modules/antagonists/disease/disease_datum.dm index 1aef9ceba6..3d3de3bab2 100644 --- a/code/modules/antagonists/disease/disease_datum.dm +++ b/code/modules/antagonists/disease/disease_datum.dm @@ -44,11 +44,14 @@ var/objectives_text = "" var/count = 1 for(var/datum/objective/objective in objectives) - if(objective.check_completion()) - objectives_text += "
Objective #[count]: [objective.explanation_text] Success!" - else - objectives_text += "
Objective #[count]: [objective.explanation_text] Fail." + var/completion = objective.check_completion() + if(completion >= 1) + result += "Objective #[count]: [objective.explanation_text] Success!" + else if(completion <= 0) + result += "Objective #[count]: [objective.explanation_text] Fail." win = FALSE + else + result += "Objective #[count]: [objective.explanation_text] [completion*100]%" count++ result += objectives_text diff --git a/code/modules/antagonists/traitor/datum_traitor.dm b/code/modules/antagonists/traitor/datum_traitor.dm index 3385991116..01d3dd5694 100644 --- a/code/modules/antagonists/traitor/datum_traitor.dm +++ b/code/modules/antagonists/traitor/datum_traitor.dm @@ -384,11 +384,14 @@ var/count = 1 for(var/datum/objective/objective in objectives) if(objective.completable) - if(objective.check_completion()) - objectives_text += "Objective #[count]: [objective.explanation_text] Success!" - else - objectives_text += "Objective #[count]: [objective.explanation_text] Fail." + var/completion = objective.check_completion() + if(completion >= 1) + result += "Objective #[count]: [objective.explanation_text] Success!" + else if(completion <= 0) + result += "Objective #[count]: [objective.explanation_text] Fail." traitorwin = FALSE + else + result += "Objective #[count]: [objective.explanation_text] [completion*100]%" else objectives_text += "Objective #[count]: [objective.explanation_text]" count++ diff --git a/code/modules/antagonists/wizard/wizard.dm b/code/modules/antagonists/wizard/wizard.dm index cc3cde79e4..3fd0d3263c 100644 --- a/code/modules/antagonists/wizard/wizard.dm +++ b/code/modules/antagonists/wizard/wizard.dm @@ -266,11 +266,14 @@ var/count = 1 var/wizardwin = 1 for(var/datum/objective/objective in objectives) - if(objective.check_completion()) - parts += "Objective #[count]: [objective.explanation_text] Success!" - else + var/completion = objective.check_completion() + if(completion >= 1) + parts += "Objective #[count]: [objective.explanation_text] Success!" + else if(completion <= 0) parts += "Objective #[count]: [objective.explanation_text] Fail." - wizardwin = 0 + wizardwin = FALSE + else + parts += "Objective #[count]: [objective.explanation_text] [completion*100]%" count++ if(wizardwin) diff --git a/interface/stylesheet.dm b/interface/stylesheet.dm index 6ee9e6e824..9f3d8911ec 100644 --- a/interface/stylesheet.dm +++ b/interface/stylesheet.dm @@ -151,6 +151,7 @@ h1.alert, h2.alert {color: #000000;} .extremelybig {font-size: 5;} .greentext {color: #00FF00; font-size: 3;} .redtext {color: #FF0000; font-size: 3;} +.yellowtext {color: #FFCC00; font-size: 3;} .clown {color: #FF69Bf; font-size: 3; font-family: "Comic Sans MS", cursive, sans-serif; font-weight: bold;} .his_grace {color: #15D512; font-family: "Courier New", cursive, sans-serif; font-style: italic;} .spooky {color: #FF9100;}