Xenobio2 Update #7 (#1910)

* Ensures cores, slimes cannot be used twice in their machines.

* Fixes xenos appearing friendly, simple_mob death problems.

Simple mobs that were dead and not of the hostile subtype wouldn't call walk(src,0), which prevents corpses from following their target.

* Cleans up trait data when a xeno or xeno product is removed.

* Slimes more likely to have amutationtoxin, consumes virusfood.

* Fixes some issues.

* Adds changelog
This commit is contained in:
Datraen
2016-06-10 14:28:59 -04:00
committed by Yoshax
parent 7972539289
commit 78e63a00a4
9 changed files with 64 additions and 30 deletions

View File

@@ -126,6 +126,7 @@
spawn(30)
icon_state = "scanner_0old"
qdel(occupant)
occupant = null //If qdel's being slow or acting up, let's make sure we can't make more cores from this one.
inuse = 0
eject_contents()
update_light_color()

View File

@@ -73,12 +73,14 @@
icon_state = "restruct_1"
spawn(30)
var/mob/living/simple_animal/xeno/slime/S = new(src)
S.traitdat = core.traits
S.traitdat = new() //New instance, so that if the core is deleted, the slime retains a trait datum.
S.nameVar = core.nameVar
S.name = "[S.nameVar] baby slime"
core.traits.copy_traits(S.traitdat)
S.ProcessTraits()
qdel(core)
spawn(30)
qdel(core)
core = null //If qdel's being a bit slow or acting up, let's just make sure we can't clone the core.
inuse = 0
eject_slime()
icon_state = "restruct_0"

View File

@@ -24,7 +24,23 @@ Slime specific procs go here.
traitdat.traits[TRAIT_XENO_CANLEARN] = prob(68)
traitdat.traits[TRAIT_XENO_SPEED] = round(rand(-10,10))
/mob/living/simple_animal/xeno/slime/RandomChemicals()
..()
if(prob(40))
var/hasMutToxin
for(var/R in traitdat.chems)
if(R == "mutationtoxin")
hasMutToxin = 1
var/chemamount
if(hasMutToxin)
var/list/chemchoices = (xenoChemList - traitdat.chems)
var/chemtype = pick(chemchoices)
chemamount = rand(1,5)
traitdat.chems[chemtype] = chemamount
else
chemamount = rand(1,5)
traitdat.chems["mutationtoxin"] = chemamount
/mob/living/simple_animal/xeno/slime/proc/GrowUp()
GenerateAdult()

View File

@@ -4,6 +4,7 @@ Slime definitions, Life and New live here.
/mob/living/simple_animal/xeno/slime //Adult values are found here
nameVar = "grey" //When mutated, nameVar might change.
desc = "A shifting, mass of goo."
faction = "slime"
speak_emote = list("garbles", "chirps", "blurbles")
colored = 1
color = "#CACACA"
@@ -68,6 +69,7 @@ Slime definitions, Life and New live here.
"toxin" = list("toxic" = 0.5),
"carpotoxin" = list("toxic" = 1, "mut" = 1.5),
"phoron" = list("toxic" = 1.5, "mut" = 0.03),
"virusfood" = list("nutr" = 1.5, "mut" = 0.32),
"cyanide" = list("toxic" = 3.5),
"slimejelly" = list("nutr" = 0.5),
"amutationtoxin" = list("toxic" = 0.1, "heal" = 1.5, "mut" = 3),

View File

@@ -8,6 +8,7 @@ Also includes Life and New
/mob/living/simple_animal/xeno
name = "Xeno"
real_name = "Xeno"
faction = "xeno" //Needs to be set.
desc = "Something's broken, yell at someone."
melee_damage_lower = 0
melee_damage_upper = 0
@@ -46,33 +47,32 @@ Also includes Life and New
//Life additions
/mob/living/simple_animal/xeno/Life()
if(src.stat == DEAD)
return 0
if(stasis)
stasis--
if(stasis < 0)
stasis = 0
return 0
..()
handle_reagents()
if((mut_level >= mut_max) && !(mutable & NOMUT))
Mutate()
mut_level -= mut_max
if(!(stat == DEAD))
handle_reagents()
if((mut_level >= mut_max) && !(mutable & NOMUT))
Mutate()
mut_level -= mut_max
ProcessSpeechBuffer()
ProcessSpeechBuffer()
//Have to feed the xenos somehow.
if(nutrition < 0)
nutrition = 0
if((nutrition > 0 ) && traitdat.traits[TRAIT_XENO_EATS])
if(nutrition >= 300)
nutrition -= hunger_factor
else
if(traitdat.traits[TRAIT_XENO_EATS])
health = starve_damage
//Have to feed the xenos somehow.
if(nutrition < 0)
nutrition = 0
if((nutrition > 0 ) && traitdat.traits[TRAIT_XENO_EATS])
if(nutrition >= 300)
nutrition -= hunger_factor
else
if(traitdat.traits[TRAIT_XENO_EATS])
health = starve_damage
return 1 //Everything worked okay.
return 1 //Everything worked okay.
/mob/living/simple_animal/xeno/New()
@@ -94,4 +94,8 @@ Also includes Life and New
if(!health)
stat = DEAD
/mob/living/simple_animal/xeno/Destroy()
traitdat.Destroy() //Let's clean up after ourselves.
traitdat = null
..()

View File

@@ -10,4 +10,9 @@ Xenobiological product lives here as a basic type.
var/source = "Unknown"
var/product = "mess"
var/nameVar = "blah"
/obj/item/xenoproduct/Destroy()
traits.Destroy() //Let's not leave any traits hanging around.
traits = null
..()