Merge pull request #5059 from Heroman3003/slime-behavior-fixes

Fixes and tweaks for slime behavior.
This commit is contained in:
Neerti
2018-03-31 23:35:24 -04:00
committed by GitHub
4 changed files with 62 additions and 16 deletions
@@ -5,9 +5,46 @@
return
..()
/mob/living/simple_animal/slime/Found(mob/living/L)
if(isliving(L))
if(SA_attackable(L))
if(L.faction == faction && !attack_same)
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(istype(H.species, /datum/species/monkey)) // istype() is so they'll eat the alien monkeys too.
return H // Monkeys are always food.
else
return
if(L in friends)
return
if(istype(L, /mob/living/simple_animal/slime))
var/mob/living/simple_animal/slime/buddy = L
if(buddy.slime_color == src.slime_color || discipline || unity || buddy.unity)
return // Don't hurt same colored slimes.
else
return buddy //do hurt others
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(istype(H.species, /datum/species/monkey)) // istype() is so they'll eat the alien monkeys too.
return H // Monkeys are always food.
if(issilicon(L) || isbot(L))
if(discipline && !rabid)
return // We're a good slime. For now at least.
return
return
/mob/living/simple_animal/slime/special_target_check(mob/living/L)
if(L.faction == faction && !attack_same)
return FALSE
if(L.faction == faction && !attack_same && !istype(L, /mob/living/simple_animal/slime))
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(istype(H.species, /datum/species/monkey)) // istype() is so they'll eat the alien monkeys too.
return TRUE // Monkeys are always food.
else
return FALSE
if(L in friends)
return FALSE
@@ -112,6 +112,11 @@
if(!speaker.client)
return
//Are all slimes being referred to?
var/mass_order = 0
if(findtext(message, "slimes"))
mass_order = 1
// Say hello back.
if(findtext(message, "hello") || findtext(message, "hi") || findtext(message, "greetings"))
delayed_say(pick("Hello...", "Hi..."), speaker)
@@ -165,13 +170,14 @@
var/list/valid_names = splittext(L.name, " ") // Should output list("John", "Doe") as an example.
for(var/line in valid_names) // Check each part of someone's name.
if(findtext(message, lowertext(line))) // If part of someone's name is in the command, the slime targets them if allowed to.
if(special_target_check(L))
delayed_say("Okay... I attack \the [L]...", speaker)
LoseFollow()
set_target(L)
return
else
delayed_say("No... I won't attack \the [L].", speaker)
return
// If we're here, it couldn't find anyone with that name.
delayed_say("No... I don't know who to attack...", speaker)
if(!(mass_order && line == "slime")) //don't think random other slimes are target
if(special_target_check(L))
delayed_say("Okay... I attack \the [L]...", speaker)
LoseFollow()
set_target(L, 1)
return
else
delayed_say("No... I won't attack \the [L].", speaker)
return
// If we're here, it couldn't find anyone with that name.
delayed_say("No... I don't know who to attack...", speaker)
@@ -356,10 +356,13 @@
baby.mutation_chance = mutation_chance
baby.power_charge = round(power_charge / 4)
baby.resentment = max(resentment - 1, 0)
baby.discipline = max(discipline - 1, 0)
baby.obedience = max(obedience - 1, 0)
baby.unity = unity
if(!istype(baby, /mob/living/simple_animal/slime/light_pink))
baby.discipline = max(discipline - 1, 0)
baby.obedience = max(obedience - 1, 0)
if(!istype(baby, /mob/living/simple_animal/slime/rainbow))
baby.unity = unity
baby.faction = faction
baby.attack_same = attack_same
baby.friends = friends.Copy()
if(rabid)
baby.enrage()
@@ -120,7 +120,7 @@
/mob/living/simple_animal/slime/dark_purple
desc = "This slime produces ever-coveted phoron. Risky to handle but very much worth it."
color = "#CC23FF"
color = "#660088"
slime_color = "dark purple"
coretype = /obj/item/slime_extract/dark_purple
reagent_injected = "phoron"