From 06e151c1ad7d765e6039f3bc6afc7de7e4834f42 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Thu, 3 Apr 2014 11:39:04 +0400 Subject: [PATCH 01/14] Making them talk and reply (test version) --- .../modules/mob/living/carbon/metroid/life.dm | 168 ++++++++++++++---- .../mob/living/carbon/metroid/metroid.dm | 8 +- .../mob/living/carbon/metroid/powers.dm | 9 +- code/modules/mob/living/say.dm | 10 ++ 4 files changed, 152 insertions(+), 43 deletions(-) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index aec12755d58..d98348d8eaf 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -370,10 +370,6 @@ if(Victim) return // if it's eating someone already, continue eating! - - if(prob(1)) - emote(pick("bounce","sway","light","vibrate","jiggle")) - if(AIproc && SStun) return @@ -398,28 +394,18 @@ if(starving && !client) // if a slime is starving, it starts losing its friends if(Friends.len > 0 && prob(1)) var/mob/nofriend = pick(Friends) - Friends -= nofriend + --Friends[nofriend] if(!Target) var/list/targets = list() - if(hungry || starving) //Only add to the list if we need to + if((hungry && !Leader) || starving) //Only add to the list if we need to for(var/mob/living/L in view(7,src)) //Ignore other slimes, dead mobs and simple_animals - if(isslime(L) || L.stat != CONSCIOUS || isanimal(L)) + if(isslime(L) || L.stat == DEAD || isanimal(L) || issilicon(L)) continue - if(issilicon(L)) - if(!is_adult) //Non-starving diciplined adult slimes wont eat things - if(!starving && Discipline > 0) - continue - - if(tame) //Tame slimes ignore electronic life - continue - - targets += L //Possible target found! - else if(iscarbon(L)) if(istype(L, /mob/living/carbon/human)) //Ignore slime(wo)men @@ -435,7 +421,7 @@ if(L in Friends) //No eating friends! continue - if(tame && ishuman(L)) //Tame slimes dont eat people. + if(tame && ishuman(L)) //Tame slimes don't eat people. continue if(!L.canmove) //Only one slime can latch on at a time. @@ -449,37 +435,141 @@ targets += L //Possible target found! - - if((hungry || starving) && targets.len > 0) - if(!is_adult) - if(!starving) - for(var/mob/living/carbon/C in targets) - if(!Discipline && prob(5)) - if(ishuman(C)) - Target = C - break - if(isalienadult(C)) - Target = C - break + if(!starving) + for(var/mob/living/carbon/C in targets) + if(!Discipline && prob(5)) + if(ishuman(C)) + Target = C + break + if(isalienadult(C)) + Target = C + break - if(islarva(C)) - Target = C - break - if(ismonkey(C)) - Target = C - break - else - Target = targets[1] + if(islarva(C)) + Target = C + break + if(ismonkey(C)) + Target = C + break else - Target = targets[1] // closest target + Target = targets[1] if(targets.len > 0) if(attacked > 0 || rabid) Target = targets[1] //closest mob probably attacked it, so override Target and attack the nearest! + if (speech_buffer.len > 0) + var/who = speech_buffer[1] // Who said it? + var/phrase = speech_buffer[2] // What did they say? + if ((findtext(phrase, number) || findtext(phrase, "Slimes"))) // Talking to us + if (findtext(phrase, "Friend")) // Debug + ++Friends[who] + if (findtext(phrase, "Hello") || findtext(phrase, "Hi")) + say (pick("Hello...", "Hi...")) + if (findtext(phrase, "Follow")) + if (Leader) + if (Leader == who) // Already following him + say (pick("Yes...", "Lead...")) + else if (Friends[who] > Friends[Leader]) // VIVA + Leader = who + say ("Yes... I follow [who]...") + else + say ("No... I follow [Leader]...") + else + if (Friends[who] > 2) + Leader = who + say ("I follow...") + else // Not friendly enough + say ("No...") + if (findtext(phrase, "Stop")) + if (Victim) // We are asked to stop feeding + if (Friends[who] > 4) + Victim = null + if (Friends[who] < 7) + --Friends[who] + say ("Grrr...") // I'm angry but I do it + else + say ("Fine...") + else if (Leader) // We are asked to stop following + if (Leader == who) + say ("Yes... I'll stay...") + Leader = null + else + if (Friends[who] > Friends[Leader]) + Leader = null + say ("Yes... I'll stop...") + else + say ("No... I'll keep following...") + if (findtext(phrase, "Kill")) // Will remove later + if (Friends[who] > 5) + rabid = 1 + speech_buffer = list() + if(prob(1)) + emote(pick("bounce","sway","light","vibrate","jiggle")) + else + var/t = 10 + var/slimes_near = -1 // Don't count itself + var/friends_near = list() + for (var/mob/living/carbon/M in view(7,src)) + if (isslime(M)) + slimes_near += 1 + if (M in Friends) + t += 20 + friends_near += M + if (hungry) t += 10 + if (starving) t += 20 + if (prob(100) && prob(t)) + var/phrases = list() + if (Target) phrases += "[Target]... looks tasty..." + if (starving) + phrases += "So... hungry..." + phrases += "Very... hungry..." + phrases += "Need... food..." + phrases += "Must... eat..." + if (hungry) + phrases += "Hungry..." + phrases += "Where is the food?" + phrases += "I want to eat..." + //phrases += "Rawr..." + //phrases += "Blop..." + if (rabid) + phrases += "Hrr..." + phrases += "Nhuu..." + phrases += "Unn..." + if (tame) + phrases += "Purr..." + if (attacked) + phrases += "Grrr..." + if (getToxLoss() > 30) + phrases += "Cold..." + if (getToxLoss() > 60) + phrases += "So... cold..." + phrases += "Very... cold..." + if (getToxLoss() > 90) + phrases += "..." + phrases += "C... c..." + if (amount_grown > 8 && !is_adult) phrases += "Soon I'll evolve..." + if (powerlevel > 3) phrases += "Bzzz..." + if (powerlevel > 5) phrases += "Zap..." + if (powerlevel > 8) phrases += "Zap... Bzz..." + if (slimes_near) phrases += "Brother..." + if (slimes_near > 1) phrases += "Brothers..." + if (!slimes_near) + phrases += "Lonely..." + for (var/M in friends_near) + phrases += "[M]... friend... [Friends[M]]..." // Debug info + if (hungry) + phrases += "[M]... I'm hungry..." + if (Friends.len > 0) phrases += "Friends are not food..." + + say (pick(phrases)) if(!Target) + if (Leader) + if(canmove && isturf(loc)) + step_to(src, Leader) + if(hungry || starving) if(canmove && isturf(loc) && prob(50)) step(src, pick(cardinal)) diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index ab479dffe30..4b862e328ce 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -30,16 +30,19 @@ var/amount_grown = 0 // controls how long the slime has been overfed, if 10, grows into an adult // if adult: if 10: reproduces + var/number = 0 // Used to understand when someone is talking to it var/mob/living/Victim = null // the person the slime is currently feeding on var/mob/living/Target = null // AI variable - tells the slime to hunt this down + var/mob/living/Leader = null // AI variable - tells the slime to follow this person var/attacked = 0 // determines if it's been attacked recently. Can be any number, is a cooloff-ish variable var/tame = 0 // if set to 1, the slime will not eat humans ever, or attack them var/rabid = 0 // if set to 1, the slime will attack and eat anything it comes in contact with var/list/Friends = list() // A list of potential friends - var/list/FriendsWeight = list() // A list containing values respective to Friends. This determines how many times a slime "likes" something. If the slime likes it more than 2 times, it becomes a friend + + var/list/speech_buffer = list() // List of phrases said near it // slimes pass on genetic data, so all their offspring have the same "Friends", @@ -52,7 +55,8 @@ /mob/living/carbon/slime/New() create_reagents(100) spawn (0) - name = "[colour] [is_adult ? "adult" : "baby"] slime ([rand(1, 1000)])" + number = rand(1, 1000) + name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])" icon_state = "[colour] [is_adult ? "adult" : "baby"] slime" real_name = name slime_mutation = mutation_table(colour) diff --git a/code/modules/mob/living/carbon/metroid/powers.dm b/code/modules/mob/living/carbon/metroid/powers.dm index 771fc56eae1..b892f5364a2 100644 --- a/code/modules/mob/living/carbon/metroid/powers.dm +++ b/code/modules/mob/living/carbon/metroid/powers.dm @@ -139,7 +139,11 @@ if(Victim.LAssailant && Victim.LAssailant != Victim) if(prob(50)) if(!(Victim.LAssailant in Friends)) - Friends.Add(Victim.LAssailant) // no idea why i was using the |= operator + Friends[Victim.LAssailant] = 1 + //Friends.Add(Victim.LAssailant) // no idea why i was using the |= operator + else + ++Friends[Victim.LAssailant] + if(M.client && istype(src, /mob/living/carbon/human)) if(prob(85)) @@ -211,6 +215,7 @@ if(ckey) M.nutrition = new_nutrition //Player slimes are more robust at spliting. Once an oversight of poor copypasta, now a feature! M.powerlevel = new_powerlevel if(i != 1) step_away(M,src) + M.Friends = Friends.Copy() babies += M feedback_add_details("slime_babies_born","slimebirth_[replacetext(M.colour," ","_")]") @@ -225,4 +230,4 @@ else src << "I am not ready to reproduce yet..." else - src << "I am not old enough to reproduce yet..." + src << "I am not old enough to reproduce yet..." \ No newline at end of file diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 27aaae5e1a0..a43b70ca992 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -287,6 +287,16 @@ var/list/department_radio_keys = list( P.speech_buffer.Remove(pick(P.speech_buffer)) P.speech_buffer.Add(html_decode(message)) + if(isslime(A)) //Slimes answering to people + if (A == src) + continue + + var/mob/living/carbon/slime/S = A + if (src in S.Friends) + S.speech_buffer = list() + S.speech_buffer.Add(src) + S.speech_buffer.Add(html_decode(message)) + if(istype(A, /obj/)) //radio in pocket could work, radio in backpack wouldn't --rastaf0 var/obj/O = A spawn (0) From ae1939167b4e59e1e1d64847c311580e024bb693 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Fri, 4 Apr 2014 19:41:06 +0400 Subject: [PATCH 02/14] Can talk to specific slimes --- code/modules/mob/living/carbon/metroid/life.dm | 16 ++++++++-------- code/modules/mob/living/carbon/metroid/powers.dm | 2 +- code/modules/mob/living/say.dm | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index d98348d8eaf..610a33ee7b3 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -462,12 +462,12 @@ if (speech_buffer.len > 0) var/who = speech_buffer[1] // Who said it? var/phrase = speech_buffer[2] // What did they say? - if ((findtext(phrase, number) || findtext(phrase, "Slimes"))) // Talking to us - if (findtext(phrase, "Friend")) // Debug + if ((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us + if (findtext(phrase, "friend")) // Debug ++Friends[who] - if (findtext(phrase, "Hello") || findtext(phrase, "Hi")) + if (findtext(phrase, "hello") || findtext(phrase, "hi")) say (pick("Hello...", "Hi...")) - if (findtext(phrase, "Follow")) + else if (findtext(phrase, "follow")) if (Leader) if (Leader == who) // Already following him say (pick("Yes...", "Lead...")) @@ -482,7 +482,7 @@ say ("I follow...") else // Not friendly enough say ("No...") - if (findtext(phrase, "Stop")) + else if (findtext(phrase, "stop")) if (Victim) // We are asked to stop feeding if (Friends[who] > 4) Victim = null @@ -501,7 +501,7 @@ say ("Yes... I'll stop...") else say ("No... I'll keep following...") - if (findtext(phrase, "Kill")) // Will remove later + else if (findtext(phrase, "kill")) // Will remove later if (Friends[who] > 5) rabid = 1 speech_buffer = list() @@ -531,8 +531,8 @@ phrases += "Hungry..." phrases += "Where is the food?" phrases += "I want to eat..." - //phrases += "Rawr..." - //phrases += "Blop..." + phrases += "Rawr..." + phrases += "Blop..." if (rabid) phrases += "Hrr..." phrases += "Nhuu..." diff --git a/code/modules/mob/living/carbon/metroid/powers.dm b/code/modules/mob/living/carbon/metroid/powers.dm index b892f5364a2..da6b0bbff2f 100644 --- a/code/modules/mob/living/carbon/metroid/powers.dm +++ b/code/modules/mob/living/carbon/metroid/powers.dm @@ -183,7 +183,7 @@ maxHealth = 200 amount_grown = 0 regenerate_icons() - name = text("[colour] [is_adult ? "adult" : "baby"] slime ([rand(1, 1000)])") + name = text("[colour] [is_adult ? "adult" : "baby"] slime ([number])") else src << "I am not ready to evolve yet..." else diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index a43b70ca992..0357d03574a 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -295,7 +295,7 @@ var/list/department_radio_keys = list( if (src in S.Friends) S.speech_buffer = list() S.speech_buffer.Add(src) - S.speech_buffer.Add(html_decode(message)) + S.speech_buffer.Add(lowertext(html_decode(message))) if(istype(A, /obj/)) //radio in pocket could work, radio in backpack wouldn't --rastaf0 var/obj/O = A From 1be7f9e8d712be1f91ca32f41e36939702ea8b0a Mon Sep 17 00:00:00 2001 From: Kelenius Date: Sat, 5 Apr 2014 20:46:24 +0400 Subject: [PATCH 03/14] Faces and refactoring --- .../modules/mob/living/carbon/metroid/life.dm | 250 ++++++++++-------- .../mob/living/carbon/metroid/metroid.dm | 5 + 2 files changed, 140 insertions(+), 115 deletions(-) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 610a33ee7b3..820493077bc 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -5,8 +5,6 @@ var/Discipline = 0 // if a slime has been hit with a freeze gun, or wrestled/attacked off a human, they become disciplined and don't attack anymore for a while var/SStun = 0 // stun variable - - /mob/living/carbon/slime/Life() set invisibility = 0 set background = BACKGROUND_ENABLED @@ -24,12 +22,13 @@ handle_targets() + if (!ckey) + handle_speech_and_mood() var/datum/gas_mixture/environment if(src.loc) environment = loc.return_air() - //Apparently, the person who wrote this code designed it so that //blinded get reset each cycle and then get activated later in the //code. Very ugly. I dont care. Moving this stuff here so its easy @@ -46,8 +45,6 @@ //Status updates, death etc. handle_regular_status_updates() - - /mob/living/carbon/slime/proc/AIprocess() // the master AI process //world << "AI proc started." @@ -221,7 +218,6 @@ if(reagents) reagents.metabolize(src) - src.updatehealth() return //TODO: DEFERRED @@ -357,7 +353,6 @@ if(prob(10)) Discipline-- - if(!client) if(!canmove) return @@ -372,7 +367,6 @@ if(AIproc && SStun) return - var/hungry = 0 // determines if the slime is hungry var/starving = 0 // determines if the slime is starving-hungry if(is_adult) // 1200 max nutrition @@ -402,7 +396,7 @@ if((hungry && !Leader) || starving) //Only add to the list if we need to for(var/mob/living/L in view(7,src)) - //Ignore other slimes, dead mobs and simple_animals + //Ignore other slimes, dead mobs, simple_animals and silicons if(isslime(L) || L.stat == DEAD || isanimal(L) || issilicon(L)) continue @@ -459,112 +453,6 @@ if(attacked > 0 || rabid) Target = targets[1] //closest mob probably attacked it, so override Target and attack the nearest! - if (speech_buffer.len > 0) - var/who = speech_buffer[1] // Who said it? - var/phrase = speech_buffer[2] // What did they say? - if ((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us - if (findtext(phrase, "friend")) // Debug - ++Friends[who] - if (findtext(phrase, "hello") || findtext(phrase, "hi")) - say (pick("Hello...", "Hi...")) - else if (findtext(phrase, "follow")) - if (Leader) - if (Leader == who) // Already following him - say (pick("Yes...", "Lead...")) - else if (Friends[who] > Friends[Leader]) // VIVA - Leader = who - say ("Yes... I follow [who]...") - else - say ("No... I follow [Leader]...") - else - if (Friends[who] > 2) - Leader = who - say ("I follow...") - else // Not friendly enough - say ("No...") - else if (findtext(phrase, "stop")) - if (Victim) // We are asked to stop feeding - if (Friends[who] > 4) - Victim = null - if (Friends[who] < 7) - --Friends[who] - say ("Grrr...") // I'm angry but I do it - else - say ("Fine...") - else if (Leader) // We are asked to stop following - if (Leader == who) - say ("Yes... I'll stay...") - Leader = null - else - if (Friends[who] > Friends[Leader]) - Leader = null - say ("Yes... I'll stop...") - else - say ("No... I'll keep following...") - else if (findtext(phrase, "kill")) // Will remove later - if (Friends[who] > 5) - rabid = 1 - speech_buffer = list() - if(prob(1)) - emote(pick("bounce","sway","light","vibrate","jiggle")) - else - var/t = 10 - var/slimes_near = -1 // Don't count itself - var/friends_near = list() - for (var/mob/living/carbon/M in view(7,src)) - if (isslime(M)) - slimes_near += 1 - if (M in Friends) - t += 20 - friends_near += M - if (hungry) t += 10 - if (starving) t += 20 - if (prob(100) && prob(t)) - var/phrases = list() - if (Target) phrases += "[Target]... looks tasty..." - if (starving) - phrases += "So... hungry..." - phrases += "Very... hungry..." - phrases += "Need... food..." - phrases += "Must... eat..." - if (hungry) - phrases += "Hungry..." - phrases += "Where is the food?" - phrases += "I want to eat..." - phrases += "Rawr..." - phrases += "Blop..." - if (rabid) - phrases += "Hrr..." - phrases += "Nhuu..." - phrases += "Unn..." - if (tame) - phrases += "Purr..." - if (attacked) - phrases += "Grrr..." - if (getToxLoss() > 30) - phrases += "Cold..." - if (getToxLoss() > 60) - phrases += "So... cold..." - phrases += "Very... cold..." - if (getToxLoss() > 90) - phrases += "..." - phrases += "C... c..." - if (amount_grown > 8 && !is_adult) phrases += "Soon I'll evolve..." - if (powerlevel > 3) phrases += "Bzzz..." - if (powerlevel > 5) phrases += "Zap..." - if (powerlevel > 8) phrases += "Zap... Bzz..." - if (slimes_near) phrases += "Brother..." - if (slimes_near > 1) phrases += "Brothers..." - if (!slimes_near) - phrases += "Lonely..." - for (var/M in friends_near) - phrases += "[M]... friend... [Friends[M]]..." // Debug info - if (hungry) - phrases += "[M]... I'm hungry..." - if (Friends.len > 0) phrases += "Friends are not food..." - - say (pick(phrases)) - if(!Target) if (Leader) if(canmove && isturf(loc)) @@ -580,3 +468,135 @@ else if(!AIproc) spawn() AIprocess() + +/mob/living/carbon/slime/proc/handle_speech_and_mood() + //Mood starts here + var/newmood = "" + if (rabid) newmood = "angry" + else if (Target) newmood = "mischevous" + + if (!newmood) + if (prob(1)) + newmood = pick("sad", ":3", "pout") + + if (mood == "sad" || mood == ":3" || mood == "pout" && !newmood) + if (prob(75)) newmood = mood + + if (newmood != mood) // This is so we don't redraw them every time + mood = newmood + regenerate_icons() + + //Speech understanding starts here + var/to_say + if (speech_buffer.len > 0) + var/who = speech_buffer[1] // Who said it? + var/phrase = speech_buffer[2] // What did they say? + if ((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us + if (findtext(phrase, "friend")) // Debug + ++Friends[who] + if (findtext(phrase, "hello") || findtext(phrase, "hi")) + to_say = pick("Hello...", "Hi...") + else if (findtext(phrase, "follow")) + if (Leader) + if (Leader == who) // Already following him + to_say = pick("Yes...", "Lead...", "Following...") + else if (Friends[who] > Friends[Leader]) // VIVA + Leader = who + to_say = "Yes... I follow [who]..." + else + to_say = "No... I follow [Leader]..." + else + if (Friends[who] > 2) + Leader = who + to_say = "I follow..." + else // Not friendly enough + to_say = pick("No...", "I won't follow...") + else if (findtext(phrase, "stop")) + if (Victim) // We are asked to stop feeding + if (Friends[who] > 4) + Victim = null + if (Friends[who] < 7) + --Friends[who] + to_say = "Grrr..." // I'm angry but I do it + else + to_say = "Fine..." + else if (Leader) // We are asked to stop following + if (Leader == who) + to_say = "Yes... I'll stay..." + Leader = null + else + if (Friends[who] > Friends[Leader]) + Leader = null + to_say = "Yes... I'll stop..." + else + to_say = "No... I'll keep following..." + else if (findtext(phrase, "kill")) // Will remove later + if (Friends[who] > 5) + rabid = 1 + speech_buffer = list() + + //Speech starts here + if (to_say) + say (to_say) + else if(prob(1)) + emote(pick("bounce","sway","light","vibrate","jiggle")) + else + var/t = 10 + var/slimes_near = -1 // Don't count itself + var/friends_near = list() + for (var/mob/living/carbon/M in view(7,src)) + if (isslime(M)) + slimes_near += 1 + if (M in Friends) + t += 20 + friends_near += M + if (nutrition < 800) t += 10 + if (nutrition < 300) t += 20 + if (prob(100) && prob(t)) + var/phrases = list() + if (Target) phrases += "[Target]... looks tasty..." + if (nutrition < 300) + phrases += "So... hungry..." + phrases += "Very... hungry..." + phrases += "Need... food..." + phrases += "Must... eat..." + else if (nutrition < 800) + phrases += "Hungry..." + phrases += "Where is the food?" + phrases += "I want to eat..." + phrases += "Rawr..." + phrases += "Blop..." + if (rabid) + phrases += "Hrr..." + phrases += "Nhuu..." + phrases += "Unn..." + if (tame || mood == ":3") + phrases += "Purr..." + if (attacked) + phrases += "Grrr..." + if (getToxLoss() > 30) + phrases += "Cold..." + if (getToxLoss() > 60) + phrases += "So... cold..." + phrases += "Very... cold..." + if (getToxLoss() > 90) + phrases += "..." + phrases += "C... c..." + if (Victim) + phrases += "Nom..." + phrases += "Tasty..." + if (amount_grown > 8 && !is_adult) phrases += "Soon I'll evolve..." + if (powerlevel > 3) phrases += "Bzzz..." + if (powerlevel > 5) phrases += "Zap..." + if (powerlevel > 8) phrases += "Zap... Bzz..." + if (mood == "sad") phrases += "Bored..." + if (slimes_near) phrases += "Brother..." + if (slimes_near > 1) phrases += "Brothers..." + if (!slimes_near) + phrases += "Lonely..." + for (var/M in friends_near) + phrases += "[M]... friend... [Friends[M]]..." // Debug info + if (nutrition < 750) + phrases += "[M]... I'm hungry..." + if (Friends.len > 0) phrases += "Friends are not food..." + say (pick(phrases)) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 4b862e328ce..72fba526d39 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -44,6 +44,8 @@ var/list/speech_buffer = list() // List of phrases said near it + var/mood = "" // To show its face + // slimes pass on genetic data, so all their offspring have the same "Friends", ///////////TIME FOR SUBSPECIES @@ -66,6 +68,9 @@ /mob/living/carbon/slime/regenerate_icons() icon_state = "[colour] [is_adult ? "adult" : "baby"] slime" + overlays.Cut() + if (mood) + overlays += image('icons/mob/slimes.dmi', icon_state = "aslime-[mood]") ..() /mob/living/carbon/slime/movement_delay() From 3b67f683a80bffb5f5cbd61a9fe97eab44cbe0ba Mon Sep 17 00:00:00 2001 From: Kelenius Date: Mon, 7 Apr 2014 16:15:47 +0400 Subject: [PATCH 04/14] Stay command (untested) --- .../modules/mob/living/carbon/metroid/life.dm | 32 +++++++++++++++++-- .../mob/living/carbon/metroid/metroid.dm | 1 + 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 820493077bc..ad48bb267fd 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -456,15 +456,25 @@ if(!Target) if (Leader) if(canmove && isturf(loc)) - step_to(src, Leader) + if (holding_still) + holding_still = max(holding_still - 1, 0) + else + step_to(src, Leader) if(hungry || starving) if(canmove && isturf(loc) && prob(50)) - step(src, pick(cardinal)) + if (holding_still) + holding_still = max(holding_still - 1, 0) + if (starving) holding_still = max(holding_still - 1, 0) // Getting impatient twice as fast + else + step(src, pick(cardinal)) else if(canmove && isturf(loc) && prob(33)) - step(src, pick(cardinal)) + if (holding_still) + holding_still = max(holding_still - 1, 0) + else + step(src, pick(cardinal)) else if(!AIproc) spawn() AIprocess() @@ -530,6 +540,22 @@ to_say = "Yes... I'll stop..." else to_say = "No... I'll keep following..." + else if (findtext(phrase, "stay")) + if (Leader) + if (Leader == who) + holding_still = Friends[who] * 10 + to_say = "Yes... Staying..." + else if (Friends[who] > Friends[Leader]) + holding_still = (Friends[who] - Friends[Leader]) * 10 + to_say = "Yes... Staying..." + else + to_say = "No... I'll keep following..." + else + if (Friends[who] > 2) + holding_still = Friends[who] * 10 + to_say = "Yes... Staying..." + else + to_say = "No... I won't stay..." else if (findtext(phrase, "kill")) // Will remove later if (Friends[who] > 5) rabid = 1 diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 72fba526d39..1f15086f8b2 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -39,6 +39,7 @@ var/attacked = 0 // determines if it's been attacked recently. Can be any number, is a cooloff-ish variable var/tame = 0 // if set to 1, the slime will not eat humans ever, or attack them var/rabid = 0 // if set to 1, the slime will attack and eat anything it comes in contact with + var/holding_still = 0 // AI variable, cooloff-ish for how long it's going to stay in one place var/list/Friends = list() // A list of potential friends From 3f1574a475671833a35491ae178abe20a66ba72c Mon Sep 17 00:00:00 2001 From: Kelenius Date: Thu, 1 May 2014 14:51:26 +0400 Subject: [PATCH 05/14] Added slime scanner Much less nutrition consumed, but they actually use it to grow Made mutation chance random between 25 and 35 Slime core reactions use 1 unit of reagent Code cleanups --- code/game/objects/items/devices/scanners.dm | 46 ++- .../mob/living/carbon/metroid/death.dm | 3 +- .../modules/mob/living/carbon/metroid/life.dm | 320 +++++++----------- .../mob/living/carbon/metroid/metroid.dm | 117 +++---- .../mob/living/carbon/metroid/powers.dm | 21 +- .../mob/living/carbon/metroid/subtypes.dm | 28 +- code/modules/reagents/Chemistry-Reagents.dm | 2 +- code/modules/reagents/Chemistry-Recipes.dm | 61 ++-- 8 files changed, 283 insertions(+), 315 deletions(-) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index fe774ccf435..7aacee5d394 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -300,4 +300,48 @@ MASS SPECTROMETER name = "advanced mass-spectrometer" icon_state = "adv_spectrometer" details = 1 - origin_tech = "magnets=4;biotech=2" \ No newline at end of file + origin_tech = "magnets=4;biotech=2" + +/obj/item/device/slime_scanner + name = "slime scanner" + icon_state = "adv_spectrometer" + item_state = "analyzer" + origin_tech = "biotech=1" + w_class = 2.0 + flags = CONDUCT + throwforce = 0 + throw_speed = 3 + throw_range = 7 + m_amt = 30 + g_amt = 20 + + attack(mob/living/M as mob, mob/living/user as mob) + if (!isslime(M)) + user << "This device can only scan slimes!" + return + var/mob/living/carbon/slime/T = M + user.show_message("Slime scan results:") + user.show_message(text("[T.colour] [] slime", T.is_adult ? "adult" : "baby")) + user.show_message(text("Nutrition: [T.nutrition]/[]", T.get_max_nutrition())) + if (T.nutrition < T.get_starve_nutrition()) + user.show_message("Warning: slime is starving!") + else if (T.nutrition < T.get_hunger_nutrition()) + user.show_message("Warning: slime is hungry") + user.show_message("Electric change strength: [T.powerlevel]") + user.show_message("Health: [T.health]") + if (T.slime_mutation[4] == T.colour) + user.show_message("This slime does not evolve any further") + else + if (T.slime_mutation[3] == T.slime_mutation[4]) + if (T.slime_mutation[2] == T.slime_mutation[1]) + user.show_message(text("Possible mutation: []", T.slime_mutation[3])) + user.show_message("Genetic destability: [T.mutation_chance/2]% chance of mutation on splitting") + else + user.show_message(text("Possible mutations: [], [], [] (x2)", T.slime_mutation[1], T.slime_mutation[2], T.slime_mutation[3])) + user.show_message("Genetic destability: [T.mutation_chance]% chance of mutation on splitting") + else + user.show_message(text("Possible mutations: [], [], [], []", T.slime_mutation[1], T.slime_mutation[2], T.slime_mutation[3], T.slime_mutation[4])) + user.show_message("Genetic destability: [T.mutation_chance]% chance of mutation on splitting") + if (T.cores > 1) + user.show_message("Anomalious slime core amount detected") + user.show_message("Growth progress: [T.amount_grown]/10") \ No newline at end of file diff --git a/code/modules/mob/living/carbon/metroid/death.dm b/code/modules/mob/living/carbon/metroid/death.dm index fc26fcbf5b7..bd52fc5b3ee 100644 --- a/code/modules/mob/living/carbon/metroid/death.dm +++ b/code/modules/mob/living/carbon/metroid/death.dm @@ -8,7 +8,8 @@ maxHealth = 150 revive() regenerate_icons() - name = "[colour] [is_adult ? "adult" : "baby"] slime ([rand(1, 1000)])" + number = rand(1, 1000) + name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])" return if(stat == DEAD) return diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index ad48bb267fd..3e26f2535fa 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -35,74 +35,56 @@ //to find it. src.blinded = null - // Basically just deletes any screen objects :< - regular_hud_updates() + regular_hud_updates() // Basically just deletes any screen objects :< - //Handle temperature/pressure differences between body and environment if(environment) - handle_environment(environment) + handle_environment(environment) // Handle temperature/pressure differences between body and environment - //Status updates, death etc. - handle_regular_status_updates() + handle_regular_status_updates() // Status updates, death etc. /mob/living/carbon/slime/proc/AIprocess() // the master AI process - //world << "AI proc started." if(AIproc || stat == DEAD || client) return var/hungry = 0 - var/starving = 0 - if(is_adult) - switch(nutrition) - if(400 to 1100) hungry = 1 - if(0 to 399) - starving = 1 - else - switch(nutrition) - if(150 to 900) hungry = 1 - if(0 to 149) starving = 1 + if (nutrition < get_starve_nutrition()) + hungry = 2 + else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition()) + hungry = 1 + AIproc = 1 - //world << "AIproc [AIproc] && stat != 2 [stat] && (attacked > 0 [attacked] || starving [starving] || hungry [hungry] || rabid [rabid] || Victim [Victim] || Target [Target]" - while(AIproc && stat != 2 && (attacked > 0 || starving || hungry || rabid || Victim)) + + while(AIproc && stat != 2 && (attacked || hungry || rabid || Victim)) if(Victim) // can't eat AND have this little process at the same time - //world << "break 1" break if(!Target || client) - //world << "break 2" break - if(Target.health <= -70 || Target.stat == 2) Target = null AIproc = 0 - //world << "break 3" break if(Target) - //world << "[Target] Target Found" for(var/mob/living/carbon/slime/M in view(1,Target)) if(M.Victim == Target) Target = null AIproc = 0 - //world << "break 4" break if(!AIproc) - //world << "break 5" break if(Target in view(1,src)) - if(istype(Target, /mob/living/silicon)) if(!Atkcool) spawn() Atkcool = 1 - sleep(15) + sleep(45) Atkcool = 0 if(Target.Adjacent(src)) Target.attack_slime(src) - //world << "retrun 1" return if(!Target.lying && prob(80)) @@ -110,16 +92,12 @@ if(!Atkcool) spawn() Atkcool = 1 - sleep(25) + sleep(45) Atkcool = 0 if(Target.Adjacent(src)) Target.attack_slime(src) - - if(prob(30)) - step_to(src, Target) - else if(!Atkcool && Target.Adjacent(src)) Feedon(Target) @@ -130,13 +108,12 @@ else if(Target in view(7, src)) - if(Target.Adjacent(src)) + if(!Target.Adjacent(src)) // Bug of the month candidate: slimes were attempting to move to target only if it was directly next to them, which caused them to target things, but not approach them step_to(src, Target) else Target = null AIproc = 0 - //world << "break 6" break var/sleeptime = movement_delay() @@ -145,7 +122,6 @@ sleep(sleeptime + 2) // this is about as fast as a player slime can go AIproc = 0 - //world << "AI proc ended." /mob/living/carbon/slime/proc/handle_environment(datum/gas_mixture/environment) if(!environment) @@ -155,28 +131,11 @@ //var/environment_heat_capacity = environment.heat_capacity() var/loc_temp = get_temperature(environment) - /* - if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10))) - var/transfer_coefficient - - transfer_coefficient = 1 - if(wear_mask && (wear_mask.body_parts_covered & HEAD) && (environment.temperature < wear_mask.protective_temperature)) - transfer_coefficient *= wear_mask.heat_transfer_coefficient - - // handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient) - */ - - if(loc_temp < 310.15) // a cold place bodytemperature += adjust_body_temperature(bodytemperature, loc_temp, 1) else // a hot place bodytemperature += adjust_body_temperature(bodytemperature, loc_temp, 1) - /* - if(stat==2) - bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000) - - */ //Account for massive pressure differences if(bodytemperature < (T0C + 5)) // start calculating temperature damage etc @@ -196,7 +155,6 @@ return //TODO: DEFERRED - /mob/living/carbon/slime/proc/adjust_body_temperature(current, loc_temp, boost) var/temperature = current var/difference = abs(current-loc_temp) //get difference @@ -222,7 +180,6 @@ return //TODO: DEFERRED - /mob/living/carbon/slime/proc/handle_regular_status_updates() if(is_adult) @@ -230,20 +187,15 @@ else health = 150 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss()) - - - if(health < config.health_threshold_dead && stat != 2) death() return else if(src.health < config.health_threshold_crit) - // if(src.health <= 20 && prob(1)) spawn(0) emote("gasp") - //if(!src.rejuv) src.oxyloss++ if(!src.reagents.has_reagent("inaprovaline")) src.adjustOxyLoss(10) - if(src.stat != DEAD) src.stat = UNCONSCIOUS + if(src.stat != DEAD) src.stat = UNCONSCIOUS if(prob(30)) adjustOxyLoss(-1) @@ -252,12 +204,9 @@ adjustCloneLoss(-1) adjustBruteLoss(-1) - if (src.stat == DEAD) - src.lying = 1 src.blinded = 1 - else if (src.paralysis || src.stunned || src.weakened || (status_flags && FAKEDEATH)) //Stunned etc. if (src.stunned > 0) @@ -302,35 +251,25 @@ return 1 - /mob/living/carbon/slime/proc/handle_nutrition() - if(prob(20)) - if(is_adult) nutrition-=rand(4,6) - else nutrition-=rand(2,3) + if (prob(15)) + --nutrition if(nutrition <= 0) nutrition = 0 if(prob(75)) - adjustToxLoss(rand(0,5)) - else + else if (nutrition >= get_grow_nutrition() && amount_grown < 10) + nutrition -= 20 + amount_grown++ + + if(amount_grown >= 10 && !Victim && !Target && !ckey) if(is_adult) - if(nutrition >= 1000) - if(prob(40)) amount_grown++ - + Reproduce() else - if(nutrition >= 800) - if(prob(40)) amount_grown++ - - if(amount_grown >= 10 && !Victim && !Target) - if(!ckey) - if(is_adult) - Reproduce() - - else - Evolve() + Evolve() /mob/living/carbon/slime/proc/handle_targets() if(Tempstun) @@ -342,8 +281,7 @@ if(attacked > 50) attacked = 50 if(attacked > 0) - if(prob(85)) - attacked-- + attacked-- if(Discipline > 0) @@ -354,142 +292,117 @@ Discipline-- if(!client) - if(!canmove) return - // DO AI STUFF HERE + if(Victim) return // if it's eating someone already, continue eating! if(Target) - if(attacked <= 0) + --target_patience + if (target_patience <= 0 || SStun || Discipline || attacked) // Tired of chasing or something draws out attention + target_patience = 0 Target = null - if(Victim) return // if it's eating someone already, continue eating! - if(AIproc && SStun) return var/hungry = 0 // determines if the slime is hungry - var/starving = 0 // determines if the slime is starving-hungry - if(is_adult) // 1200 max nutrition - switch(nutrition) - if(601 to 900) - if(prob(25)) hungry = 1//Ensures they continue eating, but aren't as aggressive at the same time - if(301 to 600) hungry = 1 - if(0 to 300) - starving = 1 - else - switch(nutrition) // 1000 max nutrition - if(501 to 700) - if(prob(25)) hungry = 1 - if(201 to 500) hungry = 1 - if(0 to 200) starving = 1 + if (nutrition < get_starve_nutrition()) + hungry = 2 + else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition()) + hungry = 1 - - if(starving && !client) // if a slime is starving, it starts losing its friends + if(hungry == 2 && !client) // if a slime is starving, it starts losing its friends if(Friends.len > 0 && prob(1)) var/mob/nofriend = pick(Friends) --Friends[nofriend] if(!Target) - var/list/targets = list() + if(will_hunt() && hungry || attacked || rabid) // Only add to the list if we need to + var/list/targets = list() - if((hungry && !Leader) || starving) //Only add to the list if we need to for(var/mob/living/L in view(7,src)) - //Ignore other slimes, dead mobs, simple_animals and silicons - if(isslime(L) || L.stat == DEAD || isanimal(L) || issilicon(L)) + if(isslime(L) || L.stat == DEAD || isanimal(L)) // Ignore other slimes, dead mobs, and simple_animals continue - else if(iscarbon(L)) + if(L in Friends) // No eating friends! + continue - if(istype(L, /mob/living/carbon/human)) //Ignore slime(wo)men - var/mob/living/carbon/human/H = L - if(H.dna) - if(H.dna.mutantrace == "slime") - continue + if(issilicon(L)) // They can't eat silicons, but they can glomp them in defence + if (rabid || attacked) + targets += L // Possible target found! - if(!is_adult) //Non-starving diciplined adult slimes wont eat things - if(!starving && Discipline > 0) + if(!iscarbon(L)) + continue + + if(istype(L, /mob/living/carbon/human)) // Ignore slime(wo)men + var/mob/living/carbon/human/H = L + if(H.dna) + if(H.dna.mutantrace == "slime") continue - if(L in Friends) //No eating friends! + if(!L.canmove) // Only one slime can latch on at a time. + var/notarget = 0 + for(var/mob/living/carbon/slime/M in view(1,L)) + if(M.Victim == L) + notarget = 1 + if(notarget) continue - if(tame && ishuman(L)) //Tame slimes don't eat people. - continue + targets += L // Possible target found! - if(!L.canmove) //Only one slime can latch on at a time. + if(targets.len > 0) + if(attacked || rabid || hungry == 2) + Target = targets[1] // I am attacked and am fighting back or so hungry I don't even care + else + for(var/mob/living/carbon/C in targets) + if(!Discipline && prob(5)) + if(ishuman(C) || isalienadult(C)) + Target = C + break - var/notarget = 0 - for(var/mob/living/carbon/slime/M in view(1,L)) - if(M.Victim == L) - notarget = 1 - if(notarget) - continue - - targets += L //Possible target found! - - if((hungry || starving) && targets.len > 0) - if(!starving) - for(var/mob/living/carbon/C in targets) - if(!Discipline && prob(5)) - if(ishuman(C)) - Target = C - break - if(isalienadult(C)) + if(islarva(C) || ismonkey(C)) Target = C break - if(islarva(C)) - Target = C - break - if(ismonkey(C)) - Target = C - break - else - Target = targets[1] + if (Target) + target_patience = rand(5,7) + if (is_adult) target_patience += 3 - if(targets.len > 0) - if(attacked > 0 || rabid) - Target = targets[1] //closest mob probably attacked it, so override Target and attack the nearest! - - if(!Target) + if(!Target) // If we have no target, we are wandering or following orders if (Leader) - if(canmove && isturf(loc)) - if (holding_still) - holding_still = max(holding_still - 1, 0) - else - step_to(src, Leader) + if (holding_still) + holding_still = max(holding_still - 1, 0) + else if(canmove && isturf(loc)) + step_to(src, Leader) - if(hungry || starving) - if(canmove && isturf(loc) && prob(50)) - if (holding_still) - holding_still = max(holding_still - 1, 0) - if (starving) holding_still = max(holding_still - 1, 0) // Getting impatient twice as fast - else - step(src, pick(cardinal)) + else if(hungry) + if (holding_still) + holding_still = max(holding_still - hungry, 0) + else if(canmove && isturf(loc) && prob(50)) + step(src, pick(cardinal)) else - if(canmove && isturf(loc) && prob(33)) - if (holding_still) - holding_still = max(holding_still - 1, 0) - else - step(src, pick(cardinal)) - else - if(!AIproc) - spawn() AIprocess() + if (holding_still) + holding_still = max(holding_still - 1, 0) + else if(canmove && isturf(loc) && prob(33)) + step(src, pick(cardinal)) + else if(!AIproc) + spawn() AIprocess() /mob/living/carbon/slime/proc/handle_speech_and_mood() //Mood starts here var/newmood = "" - if (rabid) newmood = "angry" + if (rabid || attacked) newmood = "angry" else if (Target) newmood = "mischevous" if (!newmood) - if (prob(1)) + if (Discipline && prob(25)) + newmood = "pout" + else if (prob(1)) newmood = pick("sad", ":3", "pout") - if (mood == "sad" || mood == ":3" || mood == "pout" && !newmood) + if ((mood == "sad" || mood == ":3" || mood == "pout") && !newmood) if (prob(75)) newmood = mood if (newmood != mood) // This is so we don't redraw them every time @@ -502,7 +415,7 @@ var/who = speech_buffer[1] // Who said it? var/phrase = speech_buffer[2] // What did they say? if ((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us - if (findtext(phrase, "friend")) // Debug + if (findtext(phrase, "friend")) // Debug TODO: remove ++Friends[who] if (findtext(phrase, "hello") || findtext(phrase, "hi")) to_say = pick("Hello...", "Hi...") @@ -556,7 +469,7 @@ to_say = "Yes... Staying..." else to_say = "No... I won't stay..." - else if (findtext(phrase, "kill")) // Will remove later + else if (findtext(phrase, "kill")) // TODO: remove, because it's pure cheating if (Friends[who] > 5) rabid = 1 speech_buffer = list() @@ -568,35 +481,38 @@ emote(pick("bounce","sway","light","vibrate","jiggle")) else var/t = 10 - var/slimes_near = -1 // Don't count itself + var/slimes_near = -1 // Don't count myself + var/dead_slimes = 0 var/friends_near = list() for (var/mob/living/carbon/M in view(7,src)) if (isslime(M)) - slimes_near += 1 + ++slimes_near + if (M.stat == DEAD) + ++dead_slimes if (M in Friends) t += 20 friends_near += M - if (nutrition < 800) t += 10 - if (nutrition < 300) t += 20 + if (nutrition < get_hunger_nutrition()) t += 10 + if (nutrition < get_starve_nutrition()) t += 10 if (prob(100) && prob(t)) var/phrases = list() if (Target) phrases += "[Target]... looks tasty..." - if (nutrition < 300) + if (nutrition < get_starve_nutrition()) phrases += "So... hungry..." phrases += "Very... hungry..." phrases += "Need... food..." phrases += "Must... eat..." - else if (nutrition < 800) + else if (nutrition < get_hunger_nutrition()) phrases += "Hungry..." phrases += "Where is the food?" phrases += "I want to eat..." phrases += "Rawr..." phrases += "Blop..." - if (rabid) + if (rabid || attacked) phrases += "Hrr..." phrases += "Nhuu..." phrases += "Unn..." - if (tame || mood == ":3") + if (mood == ":3") phrases += "Purr..." if (attacked) phrases += "Grrr..." @@ -618,11 +534,33 @@ if (mood == "sad") phrases += "Bored..." if (slimes_near) phrases += "Brother..." if (slimes_near > 1) phrases += "Brothers..." + if (dead_slimes) phrases += "What happened?" if (!slimes_near) phrases += "Lonely..." for (var/M in friends_near) - phrases += "[M]... friend... [Friends[M]]..." // Debug info - if (nutrition < 750) - phrases += "[M]... I'm hungry..." - if (Friends.len > 0) phrases += "Friends are not food..." - say (pick(phrases)) \ No newline at end of file + phrases += "[M]... friend... [Friends[M]]..." // Debug info TODO: remove + if (nutrition < get_hunger_nutrition()) + phrases += "[M]... Feed me..." + say (pick(phrases)) + +/mob/living/carbon/slime/proc/get_max_nutrition() // Can't go above it + if (is_adult) return 1200 + else return 1000 + +/mob/living/carbon/slime/proc/get_grow_nutrition() // Above it we grow, below it we can eat + if (is_adult) return 1000 + else return 800 + +/mob/living/carbon/slime/proc/get_hunger_nutrition() // Below it we will always eat + if (is_adult) return 600 + else return 500 + +/mob/living/carbon/slime/proc/get_starve_nutrition() // Below it we will eat before everything else + if (is_adult) return 300 + else return 200 + +/mob/living/carbon/slime/proc/will_hunt(var/hunger = -1) // Check for being stopped from feeding and chasing + if (hunger == 2 || rabid || attacked) return 1 + if (Leader) return 0 + if (holding_still) return 0 + return 1 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index 1f15086f8b2..c790161310d 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -15,7 +15,7 @@ gender = NEUTER update_icon = 0 - nutrition = 700 // 1000 = max + nutrition = 700 see_in_dark = 8 update_slimes = 0 @@ -25,10 +25,10 @@ status_flags = CANPARALYSE|CANPUSH var/cores = 1 // the number of /obj/item/slime_extract's the slime has left inside + var/mutation_chance = 30 // Chance of mutating, should be between 25 and 35 - var/powerlevel = 0 // 1-10 controls how much electricity they are generating - var/amount_grown = 0 // controls how long the slime has been overfed, if 10, grows into an adult - // if adult: if 10: reproduces + var/powerlevel = 0 // 1-10 controls how much electricity they are generating + var/amount_grown = 0 // controls how long the slime has been overfed, if 10, grows or reproduces var/number = 0 // Used to understand when someone is talking to it @@ -36,19 +36,17 @@ var/mob/living/Target = null // AI variable - tells the slime to hunt this down var/mob/living/Leader = null // AI variable - tells the slime to follow this person - var/attacked = 0 // determines if it's been attacked recently. Can be any number, is a cooloff-ish variable - var/tame = 0 // if set to 1, the slime will not eat humans ever, or attack them - var/rabid = 0 // if set to 1, the slime will attack and eat anything it comes in contact with + var/attacked = 0 // Determines if it's been attacked recently. Can be any number, is a cooloff-ish variable + var/rabid = 0 // If set to 1, the slime will attack and eat anything it comes in contact with var/holding_still = 0 // AI variable, cooloff-ish for how long it's going to stay in one place + var/target_patience = 0 // AI variable, cooloff-ish for how long it's going to follow its target - var/list/Friends = list() // A list of potential friends + var/list/Friends = list() // A list of friends; they are not considered targets for feeding; passed down after splitting - var/list/speech_buffer = list() // List of phrases said near it + var/list/speech_buffer = list() // Last phrase said near it and person who said it var/mood = "" // To show its face - // slimes pass on genetic data, so all their offspring have the same "Friends", - ///////////TIME FOR SUBSPECIES var/colour = "grey" @@ -63,6 +61,7 @@ icon_state = "[colour] [is_adult ? "adult" : "baby"] slime" real_name = name slime_mutation = mutation_table(colour) + mutation_chance = rand(25, 35) var/sanitizedcolour = replacetext(colour, " ", "") coretype = text2path("/obj/item/slime_extract/[sanitizedcolour]") ..() @@ -75,6 +74,9 @@ ..() /mob/living/carbon/slime/movement_delay() + if (bodytemperature >= 330.23) // 135 F + return -1 // slimes become supercharged at high temperatures + var/tally = 0 var/health_deficiency = (100 - health) @@ -84,23 +86,19 @@ tally += (283.222 - bodytemperature) / 10 * 1.75 if(reagents) - if(reagents.has_reagent("hyperzine")) // hyperzine slows slimes down - tally *= 2 // moves twice as slow + if(reagents.has_reagent("hyperzine")) // Hyperzine slows slimes down + tally *= 2 - if(reagents.has_reagent("frostoil")) // frostoil also makes them move VEEERRYYYYY slow + if(reagents.has_reagent("frostoil")) // Frostoil also makes them move VEEERRYYYYY slow tally *= 5 if(health <= 0) // if damaged, the slime moves twice as slow tally *= 2 - if (bodytemperature >= 330.23) // 135 F - return -1 // slimes become supercharged at high temperatures - - return tally+config.slime_delay - + return tally + config.slime_delay /mob/living/carbon/slime/Bump(atom/movable/AM as mob|obj, yes) - if ((!( yes ) || now_pushing)) + if ((!(yes) || now_pushing)) return now_pushing = 1 @@ -108,31 +106,21 @@ if(!client && powerlevel > 0) var/probab = 10 switch(powerlevel) - if(1 to 2) probab = 20 - if(3 to 4) probab = 30 - if(5 to 6) probab = 40 - if(7 to 8) probab = 60 - if(9) probab = 70 - if(10) probab = 95 + if(1 to 2) probab = 20 + if(3 to 4) probab = 30 + if(5 to 6) probab = 40 + if(7 to 8) probab = 60 + if(9) probab = 70 + if(10) probab = 95 if(prob(probab)) - - if(istype(AM, /obj/structure/window) || istype(AM, /obj/structure/grille)) - if(is_adult) - if(nutrition <= 600 && !Atkcool) + if(nutrition <= get_hunger_nutrition() && !Atkcool) + if (is_adult || prob(5)) AM.attack_slime(src) spawn() Atkcool = 1 - sleep(15) + sleep(45) Atkcool = 0 - else - if(nutrition <= 500 && !Atkcool) - if(prob(5)) - AM.attack_slime(src) - spawn() - Atkcool = 1 - sleep(15) - Atkcool = 0 if(ismob(AM)) var/mob/tmob = AM @@ -166,7 +154,6 @@ /mob/living/carbon/slime/Process_Spacemove() return 2 - /mob/living/carbon/slime/Stat() ..() @@ -176,20 +163,16 @@ else stat(null, "Health: [round((health / 150) * 100)]%") - if (client.statpanel == "Status") - if(is_adult) - stat(null, "Nutrition: [nutrition]/1200") - if(amount_grown >= 10) + stat(null, "Nutrition: [nutrition]/[get_max_nutrition()]") + if(amount_grown >= 10) + if(is_adult) stat(null, "You can reproduce!") - else - stat(null, "Nutrition: [nutrition]/1000") - if(amount_grown >= 10) + else stat(null, "You can evolve!") stat(null,"Power Level: [powerlevel]") - /mob/living/carbon/slime/adjustFireLoss(amount) ..(-abs(amount)) // Heals them return @@ -199,7 +182,6 @@ ..(Proj) return 0 - /mob/living/carbon/slime/emp_act(severity) powerlevel = 0 // oh no, the power! ..() @@ -254,7 +236,6 @@ /mob/living/carbon/slime/unEquip(obj/item/W as obj) return - /mob/living/carbon/slime/attack_ui(slot) return @@ -269,13 +250,12 @@ updatehealth() return - /mob/living/carbon/slime/attack_slime(mob/living/carbon/slime/M as mob) if (!ticker) M << "You cannot attack people before the game has started." return - if(Victim) return // can't attack while eating! + if (Victim) return // can't attack while eating! if (health > -100) @@ -286,19 +266,16 @@ var/damage = rand(1, 3) attacked += 5 - if(is_adult) + if(M.is_adult) damage = rand(1, 6) else damage = rand(1, 3) adjustBruteLoss(damage) - updatehealth() - return - /mob/living/carbon/slime/attack_animal(mob/living/simple_animal/M as mob) if(M.melee_damage_upper == 0) M.emote("[M.friendly] [src]") @@ -313,7 +290,7 @@ updatehealth() /mob/living/carbon/slime/attack_paw(mob/living/carbon/monkey/M as mob) - if(!(istype(M, /mob/living/carbon/monkey))) return//Fix for aliens receiving double messages when attacking other aliens. + if(!(istype(M, /mob/living/carbon/monkey))) return // Fix for aliens receiving double messages when attacking other aliens. if (!ticker) M << "You cannot attack people before the game has started." @@ -322,6 +299,7 @@ if (istype(loc, /turf) && istype(loc.loc, /area/start)) M << "No attacking people at spawn, you jackass." return + ..() switch(M.a_intent) @@ -422,7 +400,7 @@ if ("grab") if (M == src || anchored) return - var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src ) + var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src) M.put_in_active_hand(G) @@ -443,8 +421,9 @@ if (prob(90)) if (HULK in M.mutations) damage += 5 - if(Victim) + if(Victim || Target) Victim = null + Target = null anchored = 0 if(prob(80) && !client) Discipline++ @@ -534,8 +513,9 @@ if ((O.client && !( O.blinded ))) O.show_message(text(" [] has tackled [name]!", M), 1) - if(Victim) + if(Victim || Target) Victim = null + Target = null anchored = 0 if(prob(80) && !client) Discipline++ @@ -569,16 +549,17 @@ if(prob(25)) user << "\red [W] passes right through [src]!" return - if(Discipline && prob(50)) // wow, buddy, why am I getting attacked?? + if(Discipline && prob(50)) // wow, buddy, why am I getting attacked?? Discipline = 0 if(W.force >= 3) if(is_adult) if(prob(5 + round(W.force/2))) - if(Victim) + if(Victim || Target) if(prob(80) && !client) Discipline++ Victim = null + Target = null anchored = 0 spawn() @@ -598,7 +579,7 @@ else if(prob(10 + W.force*2)) - if(Victim) + if(Victim || Target) if(prob(80) && !client) Discipline++ if(Discipline == 1) @@ -609,6 +590,7 @@ SStun = 0 Victim = null + Target = null anchored = 0 spawn(0) @@ -625,17 +607,22 @@ /mob/living/carbon/slime/restrained() return 0 - mob/living/carbon/slime/var/co2overloadtime = null mob/living/carbon/slime/var/temperature_resistance = T0C+75 - /mob/living/carbon/slime/show_inv(mob/user) return /mob/living/carbon/slime/toggle_throw_mode() return +/mob/living/carbon/slime/proc/apply_water() + adjustToxLoss(rand(15,20)) + if (!client) + if (Target) // Like cats + Target = null + ++Discipline + return /obj/item/slime_extract name = "slime extract" diff --git a/code/modules/mob/living/carbon/metroid/powers.dm b/code/modules/mob/living/carbon/metroid/powers.dm index da6b0bbff2f..3d8e2c14f1a 100644 --- a/code/modules/mob/living/carbon/metroid/powers.dm +++ b/code/modules/mob/living/carbon/metroid/powers.dm @@ -71,7 +71,7 @@ "A sharp, deep pain bathes every inch of your body!")]" if(istype(M, /mob/living/carbon)) - Victim.adjustCloneLoss(rand(1,10)) + Victim.adjustCloneLoss(rand(5,6)) Victim.adjustToxLoss(rand(1,2)) if(Victim.health <= 0) Victim.adjustToxLoss(rand(2,4)) @@ -88,7 +88,7 @@ if(slime.Victim == M && slime != src) slime.Feedstop() - nutrition += rand(10,25) + nutrition += rand(15,30) if(nutrition >= lastnut + 50) if(prob(80)) lastnut = nutrition @@ -96,12 +96,11 @@ if(powerlevel > 10) powerlevel = 10 - if(is_adult) - if(nutrition > 1200) - nutrition = 1200 - else - if(nutrition > 1000) - nutrition = 1000 + if (nutrition > get_max_nutrition()) + if (amount_grown < 10) + nutrition -= 20 + ++amount_grown + nutrition = min(nutrition, get_max_nutrition()) Victim.updatehealth() updatehealth() @@ -208,10 +207,10 @@ var/new_powerlevel = round(powerlevel / 4) for(var/i=1,i<=4,i++) var/mob/living/carbon/slime/M = new /mob/living/carbon/slime/(loc) - if(prob(70)) - M.colour = colour - else + if(prob(mutation_chance)) M.colour = slime_mutation[rand(1,4)] + else + M.colour = colour if(ckey) M.nutrition = new_nutrition //Player slimes are more robust at spliting. Once an oversight of poor copypasta, now a feature! M.powerlevel = new_powerlevel if(i != 1) step_away(M,src) diff --git a/code/modules/mob/living/carbon/metroid/subtypes.dm b/code/modules/mob/living/carbon/metroid/subtypes.dm index e61054fce8d..3b7e0107abb 100644 --- a/code/modules/mob/living/carbon/metroid/subtypes.dm +++ b/code/modules/mob/living/carbon/metroid/subtypes.dm @@ -19,35 +19,35 @@ proc/mutation_table(var/colour) slime_mutation[3] = "gold" slime_mutation[4] = "gold" if("orange") - slime_mutation[1] = "red" - slime_mutation[2] = "red" - slime_mutation[3] = "dark purple" - slime_mutation[4] = "yellow" + slime_mutation[1] = "dark purple" + slime_mutation[2] = "yellow" + slime_mutation[3] = "red" + slime_mutation[4] = "red" if("blue") slime_mutation[1] = "dark blue" - slime_mutation[2] = "pink" + slime_mutation[2] = "silver" slime_mutation[3] = "pink" - slime_mutation[4] = "silver" + slime_mutation[4] = "pink" //Tier 3 if("dark blue") slime_mutation[1] = "purple" - slime_mutation[2] = "cerulean" - slime_mutation[3] = "blue" + slime_mutation[2] = "blue" + slime_mutation[3] = "cerulean" slime_mutation[4] = "cerulean" if("dark purple") slime_mutation[1] = "purple" - slime_mutation[2] = "sepia" - slime_mutation[3] = "orange" + slime_mutation[2] = "orange" + slime_mutation[3] = "sepia" slime_mutation[4] = "sepia" if("yellow") slime_mutation[1] = "metal" - slime_mutation[2] = "bluespace" - slime_mutation[3] = "orange" + slime_mutation[2] = "orange" + slime_mutation[3] = "bluespace" slime_mutation[4] = "bluespace" if("silver") slime_mutation[1] = "metal" - slime_mutation[2] = "pyrite" - slime_mutation[3] = "blue" + slime_mutation[2] = "blue" + slime_mutation[3] = "pyrite" slime_mutation[4] = "pyrite" //Tier 4 if("pink") diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index b92254c9668..42103ddef2e 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -218,7 +218,7 @@ datum T.MakeSlippery() for(var/mob/living/carbon/slime/M in T) - M.adjustToxLoss(rand(15,20)) + M.apply_water() var/hotspot = (locate(/obj/effect/hotspot) in T) if(hotspot && !istype(T, /turf/space)) diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 860334f6cd4..aecd81c02b8 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -935,7 +935,7 @@ datum/chemical_reaction/pestkiller name = "Slime Spawn" id = "m_spawn" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/grey required_other = 1 @@ -951,7 +951,7 @@ datum/chemical_reaction/pestkiller name = "Slime Monkey" id = "m_monkey" result = null - required_reagents = list("blood" = 5) + required_reagents = list("blood" = 1) result_amount = 1 required_container = /obj/item/slime_extract/grey required_other = 1 @@ -966,7 +966,7 @@ datum/chemical_reaction/pestkiller name = "Mutation Toxin" id = "mutationtoxin" result = "mutationtoxin" - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_other = 1 required_container = /obj/item/slime_extract/green @@ -978,7 +978,7 @@ datum/chemical_reaction/pestkiller name = "Slime Metal" id = "m_metal" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/metal required_other = 1 @@ -996,7 +996,7 @@ datum/chemical_reaction/pestkiller name = "Slime Crit" id = "m_tele" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/gold required_other = 1 @@ -1065,7 +1065,7 @@ datum/chemical_reaction/pestkiller name = "Slime Crit Lesser" id = "m_tele3" result = null - required_reagents = list("blood" = 5) + required_reagents = list("blood" = 1) result_amount = 1 required_container = /obj/item/slime_extract/gold required_other = 1 @@ -1117,7 +1117,7 @@ datum/chemical_reaction/pestkiller name = "Slime Bork" id = "m_tele2" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/silver required_other = 1 @@ -1148,7 +1148,7 @@ datum/chemical_reaction/pestkiller name = "Slime Bork 2" id = "m_tele4" result = null - required_reagents = list("water" = 5) + required_reagents = list("water" = 1) result_amount = 1 required_container = /obj/item/slime_extract/silver required_other = 1 @@ -1180,7 +1180,7 @@ datum/chemical_reaction/pestkiller name = "Slime Frost Oil" id = "m_frostoil" result = "frostoil" - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 10 required_container = /obj/item/slime_extract/blue required_other = 1 @@ -1192,7 +1192,7 @@ datum/chemical_reaction/pestkiller name = "Slime Freeze" id = "m_freeze" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/darkblue required_other = 1 @@ -1212,7 +1212,7 @@ datum/chemical_reaction/pestkiller name = "Slime Capsaicin Oil" id = "m_capsaicinoil" result = "capsaicin" - required_reagents = list("blood" = 5) + required_reagents = list("blood" = 1) result_amount = 10 required_container = /obj/item/slime_extract/orange required_other = 1 @@ -1223,7 +1223,7 @@ datum/chemical_reaction/pestkiller name = "Slime fire" id = "m_fire" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/orange required_other = 1 @@ -1243,7 +1243,7 @@ datum/chemical_reaction/pestkiller name = "Slime EMP" id = "m_emp" result = null - required_reagents = list("blood" = 5) + required_reagents = list("blood" = 1) result_amount = 1 required_container = /obj/item/slime_extract/yellow required_other = 1 @@ -1256,7 +1256,7 @@ datum/chemical_reaction/pestkiller name = "Slime Powercell" id = "m_cell" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/yellow required_other = 1 @@ -1269,7 +1269,7 @@ datum/chemical_reaction/pestkiller name = "Slime Glow" id = "m_glow" result = null - required_reagents = list("water" = 5) + required_reagents = list("water" = 1) result_amount = 1 required_container = /obj/item/slime_extract/yellow required_other = 1 @@ -1286,7 +1286,7 @@ datum/chemical_reaction/pestkiller name = "Slime Steroid" id = "m_steroid" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/purple required_other = 1 @@ -1299,7 +1299,7 @@ datum/chemical_reaction/pestkiller name = "Slime Jam" id = "m_jam" result = "slimejelly" - required_reagents = list("sugar" = 5) + required_reagents = list("sugar" = 1) result_amount = 10 required_container = /obj/item/slime_extract/purple required_other = 1 @@ -1312,7 +1312,7 @@ datum/chemical_reaction/pestkiller name = "Slime Plasma" id = "m_plasma" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/darkpurple required_other = 1 @@ -1327,7 +1327,7 @@ datum/chemical_reaction/pestkiller name = "Slime Glycerol" id = "m_glycerol" result = "glycerol" - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 8 required_container = /obj/item/slime_extract/red required_other = 1 @@ -1339,14 +1339,13 @@ datum/chemical_reaction/pestkiller name = "Bloodlust" id = "m_bloodlust" result = null - required_reagents = list("blood" = 5) + required_reagents = list("blood" = 1) result_amount = 1 required_container = /obj/item/slime_extract/red required_other = 1 /datum/chemical_reaction/slimebloodlust/on_reaction(var/datum/reagents/holder) feedback_add_details("slime_cores_used","[replacetext(name," ","_")]") for(var/mob/living/carbon/slime/slime in viewers(get_turf(holder.my_atom), null)) - slime.tame = 0 slime.rabid = 1 for(var/mob/O in viewers(get_turf(holder.my_atom), null)) O.show_message(text("\red The [slime] is driven into a frenzy!."), 1) @@ -1356,7 +1355,7 @@ datum/chemical_reaction/pestkiller name = "Slime Potion" id = "m_potion" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/pink required_other = 1 @@ -1371,7 +1370,7 @@ datum/chemical_reaction/pestkiller name = "Advanced Mutation Toxin" id = "mutationtoxin2" result = "amutationtoxin" - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_other = 1 required_container = /obj/item/slime_extract/black @@ -1383,7 +1382,7 @@ datum/chemical_reaction/pestkiller name = "Slime Explosion" id = "m_explosion" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/oil required_other = 1 @@ -1401,7 +1400,7 @@ datum/chemical_reaction/pestkiller result = null result_amount = 1 required_container = /obj/item/slime_extract/lightpink - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) required_other = 1 /datum/chemical_reaction/slimepotion2/on_reaction(var/datum/reagents/holder) feedback_add_details("slime_cores_used","[replacetext(name," ","_")]") @@ -1412,7 +1411,7 @@ datum/chemical_reaction/pestkiller name = "Slime Golem" id = "m_golem" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/adamantine required_other = 1 @@ -1428,7 +1427,7 @@ datum/chemical_reaction/pestkiller name = "Slime Crystal" id = "m_crystal" result = null - required_reagents = list("blood" = 5) + required_reagents = list("blood" = 1) result_amount = 1 required_container = /obj/item/slime_extract/bluespace required_other = 1 @@ -1444,7 +1443,7 @@ datum/chemical_reaction/pestkiller name = "Slime Steroid 2" id = "m_steroid2" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/cerulean required_other = 1 @@ -1458,7 +1457,7 @@ datum/chemical_reaction/pestkiller name = "Slime Camera" id = "m_camera" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/sepia required_other = 1 @@ -1471,7 +1470,7 @@ datum/chemical_reaction/pestkiller name = "Slime Film" id = "m_film" result = null - required_reagents = list("blood" = 5) + required_reagents = list("blood" = 1) result_amount = 1 required_container = /obj/item/slime_extract/sepia required_other = 1 @@ -1487,7 +1486,7 @@ datum/chemical_reaction/pestkiller name = "Slime Paint" id = "s_paint" result = null - required_reagents = list("plasma" = 5) + required_reagents = list("plasma" = 1) result_amount = 1 required_container = /obj/item/slime_extract/pyrite required_other = 1 From 3e5269d82405ad058b4ce8e0a5da98371647fa1d Mon Sep 17 00:00:00 2001 From: Kelenius Date: Thu, 1 May 2014 14:53:12 +0400 Subject: [PATCH 06/14] Removed debug stuff --- code/modules/mob/living/carbon/metroid/life.dm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 3e26f2535fa..8db2e6dabfd 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -415,8 +415,6 @@ var/who = speech_buffer[1] // Who said it? var/phrase = speech_buffer[2] // What did they say? if ((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us - if (findtext(phrase, "friend")) // Debug TODO: remove - ++Friends[who] if (findtext(phrase, "hello") || findtext(phrase, "hi")) to_say = pick("Hello...", "Hi...") else if (findtext(phrase, "follow")) @@ -469,9 +467,6 @@ to_say = "Yes... Staying..." else to_say = "No... I won't stay..." - else if (findtext(phrase, "kill")) // TODO: remove, because it's pure cheating - if (Friends[who] > 5) - rabid = 1 speech_buffer = list() //Speech starts here @@ -538,7 +533,7 @@ if (!slimes_near) phrases += "Lonely..." for (var/M in friends_near) - phrases += "[M]... friend... [Friends[M]]..." // Debug info TODO: remove + phrases += "[M]... friend..." if (nutrition < get_hunger_nutrition()) phrases += "[M]... Feed me..." say (pick(phrases)) From 0727f8d5d82a98f787e8c39824614b285d621ce8 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Thu, 1 May 2014 15:16:20 +0400 Subject: [PATCH 07/14] Added slime scanner to smartfridge --- code/game/machinery/kitchen/smartfridge.dm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index a2b378ba426..ca637ad9ba7 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -300,8 +300,17 @@ obj/machinery/smartfridge/drying_rack/load() //For updating the filled overlay /obj/machinery/smartfridge/extract/accept_check(var/obj/item/O as obj) if(istype(O,/obj/item/slime_extract)) return 1 + if(istype(O,/obj/item/device/slime_scanner)) + return 1 return 0 +/obj/machinery/smartfridge/extract/New() + ..() + var/obj/item/device/slime_scanner/I = new /obj/item/device/slime_scanner(src) + load(I) + var/obj/item/device/slime_scanner/T = new /obj/item/device/slime_scanner(src) + load(T) + // ----------------------------- // Chemistry Medical Smartfridge // ----------------------------- From 59e19ed3f8ecd8a0ad561a922cd3cfd25e6550e8 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Thu, 1 May 2014 15:25:20 +0400 Subject: [PATCH 08/14] ALMOST FORGOT --- code/modules/mob/living/carbon/metroid/life.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 8db2e6dabfd..246612fbf9a 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -489,7 +489,7 @@ friends_near += M if (nutrition < get_hunger_nutrition()) t += 10 if (nutrition < get_starve_nutrition()) t += 10 - if (prob(100) && prob(t)) + if (prob(2) && prob(t)) var/phrases = list() if (Target) phrases += "[Target]... looks tasty..." if (nutrition < get_starve_nutrition()) From dc70e962f9ac21252a499047c9420d2a6afb9f2e Mon Sep 17 00:00:00 2001 From: Kelenius Date: Thu, 1 May 2014 15:41:27 +0400 Subject: [PATCH 09/14] Fix for them having a frozen face upon death --- code/modules/mob/living/carbon/metroid/death.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/mob/living/carbon/metroid/death.dm b/code/modules/mob/living/carbon/metroid/death.dm index bd52fc5b3ee..ae19372c7e5 100644 --- a/code/modules/mob/living/carbon/metroid/death.dm +++ b/code/modules/mob/living/carbon/metroid/death.dm @@ -15,6 +15,7 @@ if(stat == DEAD) return stat = DEAD icon_state = "[colour] baby slime dead" + overlays.Cut() for(var/mob/O in viewers(src, null)) O.show_message("The [name] seizes up and falls limp...", 1) //ded -- Urist From 45bb6313635753d97d0c63145a5fc07372f65f2c Mon Sep 17 00:00:00 2001 From: Kelenius Date: Thu, 1 May 2014 22:25:41 +0400 Subject: [PATCH 10/14] Two small fixes --- code/modules/mob/living/carbon/metroid/life.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 246612fbf9a..fb8760262eb 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -254,7 +254,7 @@ /mob/living/carbon/slime/proc/handle_nutrition() if (prob(15)) - --nutrition + nutrition -= 1 + is_adult if(nutrition <= 0) nutrition = 0 @@ -535,7 +535,7 @@ for (var/M in friends_near) phrases += "[M]... friend..." if (nutrition < get_hunger_nutrition()) - phrases += "[M]... Feed me..." + phrases += "[M]... feed me..." say (pick(phrases)) /mob/living/carbon/slime/proc/get_max_nutrition() // Can't go above it From d41ee9ee8a2130b1674931b2ae8981390b9f3b84 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Sun, 11 May 2014 00:47:16 +0400 Subject: [PATCH 11/14] Why the hell not --- code/modules/mob/living/carbon/metroid/life.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index fb8760262eb..52d7fa5dc9d 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -503,6 +503,7 @@ phrases += "I want to eat..." phrases += "Rawr..." phrases += "Blop..." + phrases += "Blorble..." if (rabid || attacked) phrases += "Hrr..." phrases += "Nhuu..." From ed5f8a0ee625eaa7907e5ef64dfb3e49f65046f3 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Sun, 18 May 2014 21:27:40 +0400 Subject: [PATCH 12/14] Fixes, part 1 --- code/game/objects/items/devices/scanners.dm | 4 ++-- code/modules/mob/living/carbon/metroid/death.dm | 2 +- code/modules/mob/living/carbon/metroid/life.dm | 13 ++++++++----- code/modules/mob/living/carbon/metroid/metroid.dm | 5 +++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 7aacee5d394..0751f2a890e 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -314,8 +314,8 @@ MASS SPECTROMETER throw_range = 7 m_amt = 30 g_amt = 20 - - attack(mob/living/M as mob, mob/living/user as mob) + +/obj/item/device/slime_scanner/attack(mob/living/M as mob, mob/living/user as mob) if (!isslime(M)) user << "This device can only scan slimes!" return diff --git a/code/modules/mob/living/carbon/metroid/death.dm b/code/modules/mob/living/carbon/metroid/death.dm index ae19372c7e5..5ee5bf3eda0 100644 --- a/code/modules/mob/living/carbon/metroid/death.dm +++ b/code/modules/mob/living/carbon/metroid/death.dm @@ -15,7 +15,7 @@ if(stat == DEAD) return stat = DEAD icon_state = "[colour] baby slime dead" - overlays.Cut() + overlays = 0 for(var/mob/O in viewers(src, null)) O.show_message("The [name] seizes up and falls limp...", 1) //ded -- Urist diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 52d7fa5dc9d..e23f7df22ad 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -193,9 +193,11 @@ else if(src.health < config.health_threshold_crit) - if(!src.reagents.has_reagent("inaprovaline")) src.adjustOxyLoss(10) + if(!src.reagents.has_reagent("inaprovaline")) + src.adjustOxyLoss(10) - if(src.stat != DEAD) src.stat = UNCONSCIOUS + if(src.stat != DEAD) + src.stat = UNCONSCIOUS if(prob(30)) adjustOxyLoss(-1) @@ -367,7 +369,8 @@ if (Target) target_patience = rand(5,7) - if (is_adult) target_patience += 3 + if (is_adult) + target_patience += 3 if(!Target) // If we have no target, we are wandering or following orders if (Leader) @@ -388,7 +391,8 @@ else if(canmove && isturf(loc) && prob(33)) step(src, pick(cardinal)) else if(!AIproc) - spawn() AIprocess() + spawn() + AIprocess() /mob/living/carbon/slime/proc/handle_speech_and_mood() //Mood starts here @@ -523,7 +527,6 @@ if (Victim) phrases += "Nom..." phrases += "Tasty..." - if (amount_grown > 8 && !is_adult) phrases += "Soon I'll evolve..." if (powerlevel > 3) phrases += "Bzzz..." if (powerlevel > 5) phrases += "Zap..." if (powerlevel > 8) phrases += "Zap... Bzz..." diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index c790161310d..59b643474ff 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -68,7 +68,7 @@ /mob/living/carbon/slime/regenerate_icons() icon_state = "[colour] [is_adult ? "adult" : "baby"] slime" - overlays.Cut() + overlays = 0 if (mood) overlays += image('icons/mob/slimes.dmi', icon_state = "aslime-[mood]") ..() @@ -290,7 +290,8 @@ updatehealth() /mob/living/carbon/slime/attack_paw(mob/living/carbon/monkey/M as mob) - if(!(istype(M, /mob/living/carbon/monkey))) return // Fix for aliens receiving double messages when attacking other aliens. + if(!(istype(M, /mob/living/carbon/monkey))) + return // Fix for aliens receiving double messages when attacking other aliens. if (!ticker) M << "You cannot attack people before the game has started." From a576cb7fea8540ab4f5b399bf21f2c6237fba8a7 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Sun, 18 May 2014 21:42:20 +0400 Subject: [PATCH 13/14] Part 2 --- code/game/objects/items/devices/scanners.dm | 54 ++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 0751f2a890e..98680e5ae79 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -316,32 +316,32 @@ MASS SPECTROMETER g_amt = 20 /obj/item/device/slime_scanner/attack(mob/living/M as mob, mob/living/user as mob) - if (!isslime(M)) - user << "This device can only scan slimes!" - return - var/mob/living/carbon/slime/T = M - user.show_message("Slime scan results:") - user.show_message(text("[T.colour] [] slime", T.is_adult ? "adult" : "baby")) - user.show_message(text("Nutrition: [T.nutrition]/[]", T.get_max_nutrition())) - if (T.nutrition < T.get_starve_nutrition()) - user.show_message("Warning: slime is starving!") - else if (T.nutrition < T.get_hunger_nutrition()) - user.show_message("Warning: slime is hungry") - user.show_message("Electric change strength: [T.powerlevel]") - user.show_message("Health: [T.health]") - if (T.slime_mutation[4] == T.colour) - user.show_message("This slime does not evolve any further") - else - if (T.slime_mutation[3] == T.slime_mutation[4]) - if (T.slime_mutation[2] == T.slime_mutation[1]) - user.show_message(text("Possible mutation: []", T.slime_mutation[3])) - user.show_message("Genetic destability: [T.mutation_chance/2]% chance of mutation on splitting") - else - user.show_message(text("Possible mutations: [], [], [] (x2)", T.slime_mutation[1], T.slime_mutation[2], T.slime_mutation[3])) - user.show_message("Genetic destability: [T.mutation_chance]% chance of mutation on splitting") + if (!isslime(M)) + user << "This device can only scan slimes!" + return + var/mob/living/carbon/slime/T = M + user.show_message("Slime scan results:") + user.show_message(text("[T.colour] [] slime", T.is_adult ? "adult" : "baby")) + user.show_message(text("Nutrition: [T.nutrition]/[]", T.get_max_nutrition())) + if (T.nutrition < T.get_starve_nutrition()) + user.show_message("Warning: slime is starving!") + else if (T.nutrition < T.get_hunger_nutrition()) + user.show_message("Warning: slime is hungry") + user.show_message("Electric change strength: [T.powerlevel]") + user.show_message("Health: [T.health]") + if (T.slime_mutation[4] == T.colour) + user.show_message("This slime does not evolve any further") + else + if (T.slime_mutation[3] == T.slime_mutation[4]) + if (T.slime_mutation[2] == T.slime_mutation[1]) + user.show_message(text("Possible mutation: []", T.slime_mutation[3])) + user.show_message("Genetic destability: [T.mutation_chance/2]% chance of mutation on splitting") else - user.show_message(text("Possible mutations: [], [], [], []", T.slime_mutation[1], T.slime_mutation[2], T.slime_mutation[3], T.slime_mutation[4])) + user.show_message(text("Possible mutations: [], [], [] (x2)", T.slime_mutation[1], T.slime_mutation[2], T.slime_mutation[3])) user.show_message("Genetic destability: [T.mutation_chance]% chance of mutation on splitting") - if (T.cores > 1) - user.show_message("Anomalious slime core amount detected") - user.show_message("Growth progress: [T.amount_grown]/10") \ No newline at end of file + else + user.show_message(text("Possible mutations: [], [], [], []", T.slime_mutation[1], T.slime_mutation[2], T.slime_mutation[3], T.slime_mutation[4])) + user.show_message("Genetic destability: [T.mutation_chance]% chance of mutation on splitting") + if (T.cores > 1) + user.show_message("Anomalious slime core amount detected") + user.show_message("Growth progress: [T.amount_grown]/10") \ No newline at end of file From 584a014a12c6883680ff572b3460d4853bbc1ea7 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Sun, 18 May 2014 22:46:32 +0400 Subject: [PATCH 14/14] Hopefully last change --- code/game/objects/items/devices/scanners.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 98680e5ae79..996ce6ff0b1 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -317,7 +317,7 @@ MASS SPECTROMETER /obj/item/device/slime_scanner/attack(mob/living/M as mob, mob/living/user as mob) if (!isslime(M)) - user << "This device can only scan slimes!" + user << "This device can only scan slimes!" return var/mob/living/carbon/slime/T = M user.show_message("Slime scan results:")