From 5ef054e6051eb3aa2e8b65be850d72d928bd50f1 Mon Sep 17 00:00:00 2001 From: Kierany9 Date: Tue, 16 Oct 2018 15:14:33 +0200 Subject: [PATCH] Assimilation Update (#40769) * new objectives + qol * beep * oof * one line * prevent kill objectives from having the same target as assimilate objectives * Free objectivev * code review * fix * yes --- code/game/gamemodes/hivemind/hivemind.dm | 6 ++- code/game/gamemodes/hivemind/objectives.dm | 38 ++++++++++++++++++- code/modules/antagonists/hivemind/hivemind.dm | 34 ++++++++++++++--- .../browserassets/css/browserOutput.css | 1 + code/modules/spells/spell_types/hivemind.dm | 12 +++--- config/game_options.txt | 1 + interface/stylesheet.dm | 1 + 7 files changed, 78 insertions(+), 15 deletions(-) diff --git a/code/game/gamemodes/hivemind/hivemind.dm b/code/game/gamemodes/hivemind/hivemind.dm index 1cfe04dd72e..f7a3dc80426 100644 --- a/code/game/gamemodes/hivemind/hivemind.dm +++ b/code/game/gamemodes/hivemind/hivemind.dm @@ -46,7 +46,7 @@ if(CONFIG_GET(flag/protect_assistant_from_antagonist)) restricted_jobs += "Assistant" - var/num_hosts = max( 1 , rand(0,1) + min(5, round(num_players() / 15) ) ) //1 host for every 15 players up to 75, with a 50% chance of an extra + var/num_hosts = max( 1 , rand(0,1) + min(5, round(num_players() / 12) ) ) //1 host for every 12 players up to 60, with a 50% chance of an extra for(var/j = 0, j < num_hosts, j++) if (!antag_candidates.len) @@ -66,6 +66,10 @@ /datum/game_mode/hivemind/post_setup() + if(hosts.len >= 4 && prob(35)) //Create the versus objective here since we want a common target for all the antags + var/datum/antagonist/hivemind/hive + hive.common_assimilation_obj = new /datum/objective/hivemind/assimilate_common + hive.common_assimilation_obj.find_target_by_role(role = ROLE_HIVE, role_type = 1, invert = 1) for(var/datum/mind/i in hosts) i.add_antag_datum(/datum/antagonist/hivemind) return ..() diff --git a/code/game/gamemodes/hivemind/objectives.dm b/code/game/gamemodes/hivemind/objectives.dm index 6a306a9347b..b26ed9c3bdf 100644 --- a/code/game/gamemodes/hivemind/objectives.dm +++ b/code/game/gamemodes/hivemind/objectives.dm @@ -57,4 +57,40 @@ var/datum/mind/M = L.mind if(M == target) return considered_alive(target) - return FALSE \ No newline at end of file + return FALSE + +/datum/objective/hivemind/biggest + explanation_text = "End the round with more vessels than any other hivemind host." + +/datum/objective/hivemind/biggest/check_completion() + var/datum/antagonist/hivemind/host = owner.has_antag_datum(/datum/antagonist/hivemind) + if(!host) + return FALSE + for(var/datum/antagonist/hivemind/H in GLOB.antagonists) + if(H == host) + continue + if(H.hive_size >= host.hive_size) + return FALSE + return TRUE + +/datum/objective/hivemind/assimilate_common + explanation_text = "This is a bug. Error:HIVE3" + +/datum/objective/hivemind/assimilate_common/update_explanation_text() + if(target) + explanation_text = "Ensure that you are the only host assimilating [target.name] at the end of the round." + else + explanation_text = "Free Objective." + +/datum/objective/hivemind/assimilate_common/check_completion() + var/datum/antagonist/hivemind/host = owner.has_antag_datum(/datum/antagonist/hivemind) + if(!target) + return TRUE + if(!host || !target.current || !host.hivemembers.Find(target.current)) + return FALSE + for(var/datum/antagonist/hivemind/H in GLOB.antagonists) + if(H == host) + continue + if(H.hivemembers.Find(target.current)) + return FALSE + return TRUE \ No newline at end of file diff --git a/code/modules/antagonists/hivemind/hivemind.dm b/code/modules/antagonists/hivemind/hivemind.dm index 9e43bd6af82..1508d0751fc 100644 --- a/code/modules/antagonists/hivemind/hivemind.dm +++ b/code/modules/antagonists/hivemind/hivemind.dm @@ -7,6 +7,7 @@ var/special_role = ROLE_HIVE var/list/hivemembers = list() var/hive_size = 0 + var/static/datum/objective/hivemind/assimilate_common/common_assimilation_obj //Make it static since we want a common target for all the antags var/list/upgrade_tiers = list( //Tier 1 @@ -37,7 +38,10 @@ for(var/power in upgrade_tiers) var/level = upgrade_tiers[power] if(hive_size >= level && !(locate(power) in owner.spell_list)) - owner.AddSpell(new power(null)) + var/obj/effect/proc_holder/spell/the_spell = new power(null) + owner.AddSpell(the_spell) + if(hive_size > 0) + to_chat(owner, "We have unlocked [the_spell.name]. [the_spell.desc]") else if(hive_size < level && (locate(power) in owner.spell_list)) owner.RemoveSpell(power) @@ -126,7 +130,8 @@ var/datum/objective/hivemind/hiveescape/hive_escape_objective = new hive_escape_objective.owner = owner objectives += hive_escape_objective - if(prob(50)) + + if(prob(85)) var/datum/objective/hivemind/assimilate/assim_objective = new assim_objective.owner = owner if(prob(25)) //Decently high chance to have to assimilate an implanted crew member @@ -135,11 +140,28 @@ assim_objective.find_target_by_role(role = ROLE_HIVE, role_type = 1, invert = 1) assim_objective.update_explanation_text() objectives += assim_objective + else + var/datum/objective/hivemind/biggest/biggest_objective = new + biggest_objective.owner = owner + objectives += biggest_objective + + if(prob(85) && common_assimilation_obj) //If the mode rolled the versus objective IE common_assimilation_obj is not null, add a very high chance to get this + var/datum/objective/hivemind/assimilate_common/versus_objective = new + versus_objective.owner = owner + versus_objective.target = common_assimilation_obj.target + versus_objective.update_explanation_text() + objectives += versus_objective else if(prob(70)) + var/giveit = TRUE var/datum/objective/assassinate/kill_objective = new kill_objective.owner = owner kill_objective.find_target() - objectives += kill_objective + for(var/datum/objective/hivemind/assimilate/ass_obj in objectives) + if(ass_obj.target == kill_objective.target) + giveit = FALSE + break + if(giveit) + objectives += kill_objective else var/datum/objective/maroon/maroon_objective = new maroon_objective.owner = owner @@ -157,8 +179,8 @@ to_chat(owner.current, "Your psionic powers will grow by assimilating the crew into your hive. Use the Assimilate Vessel spell on a stationary \ target, and after ten seconds he will be one of the hive. This is completely silent and safe to use, and failing will reset the cooldown. As \ you assimilate the crew, you will gain more powers to use. Most are silent and won't help you in a fight, but grant you great power over your \ - vessels. There are other hiveminds onboard the station, collaboration is possible, but a strong enough hivemind can reap many rewards from a \ - well planned betrayal.") + vessels. Hover your mouse over a power's action icon for an extended description on what it does. There are other hiveminds onboard the station, \ + collaboration is possible, but a strong enough hivemind can reap many rewards from a well planned betrayal.") owner.current.playsound_local(get_turf(owner.current), 'sound/ambience/antag/tatoralert.ogg', 100, FALSE, pressure_affected = FALSE) owner.announce_objectives() @@ -184,4 +206,4 @@ return result.Join("
") /datum/antagonist/hivemind/is_gamemode_hero() - return SSticker.mode.name == "hivemind" + return SSticker.mode.name == "Assimilation" diff --git a/code/modules/goonchat/browserassets/css/browserOutput.css b/code/modules/goonchat/browserassets/css/browserOutput.css index 0451c45069a..43460e7aa56 100644 --- a/code/modules/goonchat/browserassets/css/browserOutput.css +++ b/code/modules/goonchat/browserassets/css/browserOutput.css @@ -375,6 +375,7 @@ h1.alert, h2.alert {color: #000000;} .noticealien {color: #00c000;} .alertalien {color: #00c000; font-weight: bold;} .changeling {color: #800080; font-style: italic;} +.assimilator {color: #800080; font-size: 16px ; font-weight: bold;} .spider {color: #4d004d;} diff --git a/code/modules/spells/spell_types/hivemind.dm b/code/modules/spells/spell_types/hivemind.dm index 719dd623c81..1aa560575bd 100644 --- a/code/modules/spells/spell_types/hivemind.dm +++ b/code/modules/spells/spell_types/hivemind.dm @@ -166,7 +166,6 @@ else power *= 3 if(power > 50 && user.z == target.z) - to_chat(target, "You feel a sharp pain, and a foreign presence in your mind!!") to_chat(user, "We have overloaded the vessel for a short time!") target.Jitter(round(power/10)) target.Unconscious(power) @@ -194,7 +193,6 @@ if(!hive) return var/iterations = 0 - var/power = 5 if(!user.getBruteLoss() && !user.getFireLoss() && !user.getCloneLoss() && !user.getBrainLoss()) to_chat(user, "We cannot heal ourselves any more with this power!") @@ -202,17 +200,17 @@ to_chat(user, "We begin siphoning power from our many vessels!") while(iterations < 7) var/mob/living/carbon/human/target = pick(hive.hivemembers) - if(!target) - break if(!do_mob(user,user,15)) to_chat(user, "Our concentration has been broken!") break + if(!target) + to_chat(user, "We have run out of vessels to drain.") + break target.adjustBrainLoss(5) - power = max(5-(round(get_dist(user, target)/40)),2) if(user.getBruteLoss() > user.getFireLoss()) - user.heal_ordered_damage(power, list(CLONE, BRUTE, BURN)) + user.heal_ordered_damage(5, list(CLONE, BRUTE, BURN)) else - user.heal_ordered_damage(power, list(CLONE, BURN, BRUTE)) + user.heal_ordered_damage(5, list(CLONE, BURN, BRUTE)) if(!user.getBruteLoss() && !user.getFireLoss() && !user.getCloneLoss()) //If we don't have any of these, stop looping to_chat(user, "We finish our healing") break diff --git a/config/game_options.txt b/config/game_options.txt index 2bb65e6d825..237cf4d35f5 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -112,6 +112,7 @@ CONTINUOUS CLOCKWORK_CULT CONTINUOUS CHANGELING CONTINUOUS WIZARD #CONTINUOUS MONKEY +CONTINUOUS HIVEMIND ##Note: do not toggle continuous off for these modes, as they have no antagonists and would thus end immediately! diff --git a/interface/stylesheet.dm b/interface/stylesheet.dm index bca391f6539..a47a37dc8d8 100644 --- a/interface/stylesheet.dm +++ b/interface/stylesheet.dm @@ -135,6 +135,7 @@ h1.alert, h2.alert {color: #000000;} .noticealien {color: #00c000;} .alertalien {color: #00c000; font-weight: bold;} .changeling {color: #800080; font-style: italic;} +.assimilator {color: #800080; font-size: 2 ; font-weight: bold;} .spider {color: #4d004d;}