Merge branch 'master' into upstream-merge-10136

This commit is contained in:
Nadyr
2021-04-11 22:51:30 -04:00
committed by GitHub
23 changed files with 73 additions and 61 deletions
@@ -23,6 +23,8 @@
var/silk_color = "#FFFFFF"
var/list/traits = list()
//Vars that need to be copied when producing a copy of species.
var/list/copy_vars = list("base_species", "icobase", "deform", "tail", "tail_animation", "icobase_tail", "color_mult", "primitive_form", "appearance_flags", "flesh_color", "base_color", "blood_mask", "damage_mask", "damage_overlays", "move_trail", "has_floating_eyes")
/datum/species/proc/give_numbing_bite() //Holy SHIT this is hacky, but it works. Updating a mob's attacks mid game is insane.
unarmed_attacks = list()
@@ -42,31 +44,19 @@
nif.nifsofts = nifsofts
else
..()
/datum/species/proc/produceCopy(var/list/traits,var/mob/living/carbon/human/H, var/custom_base)
var/datum/species/S
/datum/species/proc/produceCopy(var/list/traits,var/mob/living/carbon/human/H)
//If species allows custom base, and custom base is set, apply it, otherwise use default.
if(selects_bodytype && custom_base)
S = GLOB.all_species[custom_base]
else
S = GLOB.all_species[src.name]
ASSERT(S)
ASSERT(src)
ASSERT(istype(H))
var/datum/species/new_copy = new S.type()
var/datum/species/new_copy = new src.type()
for(var/i in S.vars) //Thorough copy of species.
if(new_copy.vars[i] != S.vars[i])
//Skipping lists because they may contain more lists, copy those manually.
//Also ignoring type var since it's read-only and will runtime.
if(islist(vars[i]))
continue
new_copy.vars[i] = S.vars[i]
if(selects_bodytype) //If race selects a bodytype, copy needed variables.
copy_variables(new_copy, copy_vars)
for(var/organ in S.has_limbs) //Copy important organ data generated by species.
var/list/organ_data = S.has_limbs[organ]
for(var/organ in has_limbs) //Copy important organ data generated by species.
var/list/organ_data = has_limbs[organ]
new_copy.has_limbs[organ] = organ_data.Copy()
new_copy.traits = traits
//If you had traits, apply them
if(new_copy.traits)
for(var/trait in new_copy.traits)
@@ -85,6 +75,15 @@
return new_copy
/datum/species/proc/copy_variables(var/datum/species/S, var/list/whitelist)
//List of variables to ignore, trying to copy type will runtime.
var/list/blacklist = list("type", "loc", "client", "ckey")
//Makes thorough copy of species datum.
for(var/i in vars)
if(S.vars[i] != vars[i] && !islist(vars[i])) //If vars are same, no point in copying.
if(whitelist && !(i in whitelist) && i in blacklist) //If whitelist is provided, only vars in the list will be copied.
continue
S.vars[i] = vars[i]
/datum/species/get_bodytype()
return base_species
@@ -48,25 +48,15 @@
/datum/species/custom/get_race_key()
var/datum/species/real = GLOB.all_species[base_species]
return real.race_key
<<<<<<< HEAD
/datum/species/custom/produceCopy(var/list/traits,var/mob/living/carbon/human/H)
. = ..()
||||||| parent of eabb487497... Merge pull request #10136 from Nyksia/tiny-hotfix
/datum/species/custom/produceCopy(var/list/traits,var/mob/living/carbon/human/H,var/custom_base)
. = ..()
if(selects_bodytype && custom_base)
var/datum/species/S = GLOB.all_species[custom_base]
S.copy_variables(., copy_vars)
=======
/datum/species/custom/produceCopy(var/list/traits,var/mob/living/carbon/human/H,var/custom_base)
. = ..(traits, H)
if(selects_bodytype && custom_base)
var/datum/species/S = GLOB.all_species[custom_base]
S.copy_variables(., copy_vars)
>>>>>>> eabb487497... Merge pull request #10136 from Nyksia/tiny-hotfix
H.maxHealth = H.species.total_health
H.hunger_rate = H.species.hunger_factor
return .
// Stub species overrides for shoving trait abilities into
@@ -148,7 +148,7 @@
/datum/trait/negative/lightweight
name = "Lightweight"
desc = "Your light weight and poor balance make you very susceptible to unhelpful bumping. Think of it like a bowling ball versus a pin."
desc = "Your light weight and poor balance make you very susceptible to unhelpful bumping. Think of it like a bowling ball versus a pin. (STOP TAKING THIS AS SECURITY! We're MRP, so expect to lose your junk immediately, especially in events. - Love, Admins)" //CHOMP Edit btw
cost = -2
var_changes = list("lightweight" = 1)
@@ -34,27 +34,27 @@
/datum/trait/positive/nonconductive
name = "Non-Conductive"
desc = "Decreases your susceptibility to electric shocks by a 10% amount."
cost = 1 //This effects tasers!
var_changes = list("siemens_coefficient" = 0.9)
desc = "Decreases your susceptibility to electric shocks by a 25% amount." //CHOMP Edit
cost = 2 //This effects tasers!
var_changes = list("siemens_coefficient" = 0.75) //CHOMP Edit
/datum/trait/positive/nonconductive_plus
name = "Major Non-Conductive"
desc = "Decreases your susceptibility to electric shocks by a 25% amount."
cost = 2 //Let us not forget this effects tasers!
var_changes = list("siemens_coefficient" = 0.75)
desc = "Decreases your susceptibility to electric shocks by a 50% amount." //CHOMP Edit
cost = 3 //Let us not forget this effects tasers!
var_changes = list("siemens_coefficient" = 0.5) //CHOMP Edit
/datum/trait/positive/darksight
name = "Darksight"
desc = "Allows you to see a short distance in the dark."
desc = "Allows you to see a short distance in the dark and 10% more susceptible to flashes." //CHOMP Edit
cost = 1
var_changes = list("darksight" = 5, "flash_mod" = 1.1)
var_changes = list("darksight" = 3) //CHOMP Edit
/datum/trait/positive/darksight_plus
name = "Darksight (Major)"
desc = "Allows you to see in the dark for almost the whole screen."
desc = "Allows you to see in the dark for almost the whole screen and 20% more susceptible to flashes." //CHOMP Edit
cost = 2
var_changes = list("darksight" = 8, "flash_mod" = 1.2)
var_changes = list("darksight" = 6) //CHOMP Edit
/datum/trait/positive/melee_attack
name = "Sharp Melee"
@@ -76,29 +76,29 @@
/datum/trait/positive/minor_brute_resist
name = "Minor Brute Resist"
desc = "Adds 15% resistance to brute damage sources."
cost = 2
var_changes = list("brute_mod" = 0.85)
desc = "Adds 10% resistance to brute damage sources." //CHOMP Edit
cost = 1 //CHOMP Edit
var_changes = list("brute_mod" = 0.9) //CHOMP Edit
/datum/trait/positive/brute_resist
name = "Brute Resist"
desc = "Adds 25% resistance to brute damage sources."
cost = 3
var_changes = list("brute_mod" = 0.75)
excludes = list(/datum/trait/positive/minor_burn_resist,/datum/trait/positive/burn_resist)
desc = "Adds 20% resistance to brute damage sources." //CHOMP Edit
cost = 2 //CHOMP Edit
var_changes = list("brute_mod" = 0.8) //CHOMP Edit
//excludes = list(/datum/trait/positive/minor_burn_resist,/datum/trait/positive/burn_resist) //CHOMP disable, this is already handled in positive_ch.dm
/datum/trait/positive/minor_burn_resist
name = "Minor Burn Resist"
desc = "Adds 15% resistance to burn damage sources."
cost = 2
var_changes = list("burn_mod" = 0.85)
desc = "Adds 10% resistance to burn damage sources." //CHOMP Edit
cost = 1 //CHOMP Edit
var_changes = list("burn_mod" = 0.9) //CHOMP Edit
/datum/trait/positive/burn_resist
name = "Burn Resist"
desc = "Adds 25% resistance to burn damage sources."
cost = 3
var_changes = list("burn_mod" = 0.75)
excludes = list(/datum/trait/positive/minor_brute_resist,/datum/trait/positive/brute_resist)
desc = "Adds 20% resistance to burn damage sources." //CHOMP Edit
cost = 2 //CHOMP Edit
var_changes = list("burn_mod" = 0.8) //CHOMP Edit
//excludes = list(/datum/trait/positive/minor_brute_resist,/datum/trait/positive/brute_resist) //CHOMP disable, this is already handled in positive_ch.dm
//YW ADDITIONS START
/datum/trait/positive/improved_biocompat
@@ -118,9 +118,9 @@
/datum/trait/positive/photoresistant
name = "Photoresistant"
desc = "Decreases stun duration from flashes and other light-based stuns and disabilities by 20%"
desc = "Decreases stun duration from flashes and other light-based stuns and disabilities by 25%" //CHOMP Edit
cost = 1
var_changes = list("flash_mod" = 0.8)
var_changes = list("flash_mod" = 0.75) //CHOMP Edit
//YW add
/datum/trait/positive/photoresistant_plus
@@ -143,7 +143,7 @@
/datum/trait/positive/hardfeet
name = "Hard Feet"
desc = "Makes your nice clawed, scaled, hooved, armored, or otherwise just awfully calloused feet immune to glass shards."
cost = 0
cost = 1 //CHOMP Edit
var_changes = list("flags" = NO_MINOR_CUT) //Checked the flag is only used by shard stepping.
//CHOMPStation Removal Start