Merge pull request #3438 from Neerti/5/9/2017_reopening_the_salt_mines

Adds Recently Cloned Modifier to Cloners
This commit is contained in:
Anewbe
2017-09-26 19:09:12 -05:00
committed by GitHub
7 changed files with 88 additions and 1 deletions

View File

@@ -152,7 +152,7 @@
#define MODIFIER_STACK_EXTEND 2 // Disallows a second instance, but will extend the first instance if possible. #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_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. // Bodyparts and organs.
#define O_MOUTH "mouth" #define O_MOUTH "mouth"

View File

@@ -18,6 +18,7 @@
var/mind=null var/mind=null
var/languages=null var/languages=null
var/list/flavor=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() /datum/dna2/record/proc/GetData()
var/list/ser=list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0) var/list/ser=list("data" = null, "owner" = null, "label" = null, "type" = null, "ue" = 0)

View File

@@ -139,6 +139,25 @@
H.set_cloned_appearance() H.set_cloned_appearance()
update_icon() 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) for(var/datum/language/L in R.languages)
H.add_language(L.name) H.add_language(L.name)
H.flavor_texts = R.flavor.Copy() H.flavor_texts = R.flavor.Copy()
@@ -498,3 +517,31 @@
if(istype(A, /obj/machinery/clonepod)) if(istype(A, /obj/machinery/clonepod))
A:malfunction() 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 = "<span class='warning'><font size='3'>You feel really weak.</font></span>"
on_expired_text = "<span class='notice'><font size='3'>You feel your strength returning to you.</font></span>"
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 = 1 // 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.

View File

@@ -330,6 +330,9 @@
R.types = DNA2_BUF_UI|DNA2_BUF_UE|DNA2_BUF_SE R.types = DNA2_BUF_UI|DNA2_BUF_UE|DNA2_BUF_SE
R.languages = subject.languages R.languages = subject.languages
R.flavor = subject.flavor_texts.Copy() 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 //Add an implant if needed
var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject) var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject)

View File

@@ -658,6 +658,29 @@ var/list/admin_verbs_mentor = list(
log_admin("[key_name(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].") log_admin("[key_name(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].")
message_admins("<font color='blue'>[key_name_admin(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].</font>", 1) message_admins("<font color='blue'>[key_name_admin(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].</font>", 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, "<span class='warning'>Looks like you didn't select a mob.</span>")
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 /client/proc/make_sound(var/obj/O in world) // -- TLE
set category = "Special Verbs" set category = "Special Verbs"
set name = "Make Sound" set name = "Make Sound"

View File

@@ -34,6 +34,7 @@
return ..() + {" return ..() + {"
<option value='?_src_=vars;mob_player_panel=\ref[src]'>Show player panel</option> <option value='?_src_=vars;mob_player_panel=\ref[src]'>Show player panel</option>
<option>---</option> <option>---</option>
<option value='?_src_=vars;give_modifier=\ref[src]'>Give Modifier</option>
<option value='?_src_=vars;give_spell=\ref[src]'>Give Spell</option> <option value='?_src_=vars;give_spell=\ref[src]'>Give Spell</option>
<option value='?_src_=vars;give_disease2=\ref[src]'>Give Disease</option> <option value='?_src_=vars;give_disease2=\ref[src]'>Give Disease</option>
<option value='?_src_=vars;give_disease=\ref[src]'>Give TG-style Disease</option> <option value='?_src_=vars;give_disease=\ref[src]'>Give TG-style Disease</option>

View File

@@ -74,6 +74,18 @@
src.give_spell(M) src.give_spell(M)
href_list["datumrefresh"] = href_list["give_spell"] 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"]) else if(href_list["give_disease2"])
if(!check_rights(R_ADMIN|R_FUN)) return if(!check_rights(R_ADMIN|R_FUN)) return