From 6c25f5e0fddb14711f8604931bfe96a76b5ac049 Mon Sep 17 00:00:00 2001 From: Neerti Date: Tue, 9 May 2017 23:16:50 -0400 Subject: [PATCH] Adds Recently Cloned Modifier to Cloners Makes new clones receive a substantial malus on combat ability, which will last between 25 to 40 minutes. This time can be reduced by upgrading the cloner. A fully upgraded cloner can reduce the time to 5 to 8 minutes. Also makes new clones receive a 'cloned' modifier, which doesn't actually do anything besides act as a sort of counter for how many times they've been cloned that only admins can see at the moment. Makes modifiers with the 'genetic' flag get copied to cloned mobs. Adds admin utility/testing/badmin verb to give any modifier to any living mob. --- code/__defines/mobs.dm | 2 +- code/game/dna/dna_modifier.dm | 1 + code/game/machinery/cloning.dm | 47 ++++++++++++++++++++ code/game/machinery/computer/cloning.dm | 3 ++ code/modules/admin/admin_verbs.dm | 23 ++++++++++ code/modules/admin/view_variables/helpers.dm | 1 + code/modules/admin/view_variables/topic.dm | 12 +++++ 7 files changed, 88 insertions(+), 1 deletion(-) diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index ef00eed3341..52e5f623baa 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -152,7 +152,7 @@ #define MODIFIER_STACK_EXTEND 2 // Disallows a second instance, but will extend the first instance if possible. #define MODIFIER_STACK_ALLOWED 3 // Multiple instances are allowed. -#define MODIFIER_GENETIC 0 // Modifiers with this flag will be copied to mobs who get cloned. +#define MODIFIER_GENETIC 1 // Modifiers with this flag will be copied to mobs who get cloned. // Bodyparts and organs. #define O_MOUTH "mouth" diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index a28dd27036e..7a775e79e00 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -18,6 +18,7 @@ var/mind=null var/languages=null var/list/flavor=null + var/list/genetic_modifiers = list() // Modifiers with the MODIFIER_GENETIC flag are saved. Note that only the type is saved, not an instance. /datum/dna2/record/proc/GetData() var/list/ser=list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 1c3d957b989..dacb5e5ffa4 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -139,6 +139,25 @@ H.set_cloned_appearance() update_icon() + // A modifier is added which makes the new clone be unrobust. + var/modifier_lower_bound = 25 MINUTES + var/modifier_upper_bound = 40 MINUTES + + // Upgraded cloners can reduce the time of the modifier, up to 80% + var/clone_sickness_length = abs(((heal_level - 20) / 100 ) - 1) + clone_sickness_length = between(0.2, clone_sickness_length, 1.0) // Caps it off just incase. + modifier_lower_bound = round(modifier_lower_bound * clone_sickness_length, 1) + modifier_upper_bound = round(modifier_upper_bound * clone_sickness_length, 1) + + H.add_modifier(/datum/modifier/recently_cloned, rand(modifier_lower_bound, modifier_upper_bound)) + + // Modifier that doesn't do anything. + H.add_modifier(/datum/modifier/cloned) + + // This is really stupid. + for(var/modifier_type in R.genetic_modifiers) + H.add_modifier(modifier_type) + for(var/datum/language/L in R.languages) H.add_language(L.name) H.flavor_texts = R.flavor.Copy() @@ -497,3 +516,31 @@ if(istype(A, /obj/machinery/clonepod)) A:malfunction() */ + +/* + * Modifier applied to newly cloned people. + */ + +// Gives rather nasty downsides for awhile, making them less robust. +/datum/modifier/recently_cloned + name = "recently cloned" + desc = "You feel rather weak, having been cloned awhile ago." + + on_created_text = "You feel really weak." + on_expired_text = "You feel your strength returning to you." + + max_health_percent = 0.6 // -40% max health. + incoming_damage_percent = 1.1 // 10% more incoming damage. + outgoing_melee_damage_percent = 0.7 // 30% less melee damage. + disable_duration_percent = 1.25 // Stuns last 25% longer. + slowdown = 2 // Slower. + evasion = -1 // 15% easier to hit. + +// Does nothing. +/datum/modifier/cloned + name = "cloned" + desc = "You died and were cloned, and you can never forget that." + + flags = MODIFIER_GENETIC // So it gets copied if they die and get cloned again. + stacks = MODIFIER_STACK_ALLOWED // Two deaths means two instances of this. + diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index db932f8cd08..668520eee58 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -330,6 +330,9 @@ R.types = DNA2_BUF_UI|DNA2_BUF_UE|DNA2_BUF_SE R.languages = subject.languages R.flavor = subject.flavor_texts.Copy() + for(var/datum/modifier/mod in subject.modifiers) + if(mod.flags & MODIFIER_GENETIC) + R.genetic_modifiers.Add(mod.type) //Add an implant if needed var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index a4a21972885..8be74e355dd 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -651,6 +651,29 @@ var/list/admin_verbs_mentor = list( log_admin("[key_name(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].") message_admins("\blue [key_name_admin(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].", 1) +/client/proc/admin_give_modifier(var/mob/living/L) + set category = "Debug" + set name = "Give Modifier" + set desc = "Makes a mob weaker or stronger by adding a specific modifier to them." + + if(!L) + to_chat(usr, "Looks like you didn't select a mob.") + return + + var/list/possible_modifiers = typesof(/datum/modifier) - /datum/modifier + + var/new_modifier_type = input("What modifier should we add to [L]?", "Modifier Type") as null|anything in possible_modifiers + if(!new_modifier_type) + return + var/duration = input("How long should the new modifier last, in seconds. To make it last forever, write '0'.", "Modifier Duration") as num + if(duration == 0) + duration = null + else + duration = duration SECONDS + + L.add_modifier(new_modifier_type, duration) + log_and_message_admins("has given [key_name(L)] the modifer [new_modifier_type], with a duration of [duration ? "[duration / 600] minutes" : "forever"].") + /client/proc/make_sound(var/obj/O in world) // -- TLE set category = "Special Verbs" set name = "Make Sound" diff --git a/code/modules/admin/view_variables/helpers.dm b/code/modules/admin/view_variables/helpers.dm index 67eefc018de..914fc2948f7 100644 --- a/code/modules/admin/view_variables/helpers.dm +++ b/code/modules/admin/view_variables/helpers.dm @@ -41,6 +41,7 @@ return ..() + {" + diff --git a/code/modules/admin/view_variables/topic.dm b/code/modules/admin/view_variables/topic.dm index d68d51ae4a9..ef2ef83ccd1 100644 --- a/code/modules/admin/view_variables/topic.dm +++ b/code/modules/admin/view_variables/topic.dm @@ -74,6 +74,18 @@ src.give_spell(M) href_list["datumrefresh"] = href_list["give_spell"] + else if(href_list["give_modifier"]) + if(!check_rights(R_ADMIN|R_FUN|R_DEBUG)) + return + + var/mob/living/M = locate(href_list["give_modifier"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob/living" + return + + src.admin_give_modifier(M) + href_list["datumrefresh"] = href_list["give_modifier"] + else if(href_list["give_disease2"]) if(!check_rights(R_ADMIN|R_FUN)) return