Yeet this shit (#22790)

This commit is contained in:
DGamerL
2023-10-12 18:25:54 +02:00
committed by GitHub
parent dcb9081c74
commit 9bab795342
6 changed files with 10 additions and 186 deletions
-9
View File
@@ -128,15 +128,6 @@
//Slime extract crossing. Controls how many extracts is required to feed to a slime to core-cross.
#define SLIME_EXTRACT_CROSSING_REQUIRED 10
//Slime commands defines
#define SLIME_FRIENDSHIP_FOLLOW 3 //Min friendship to order it to follow
#define SLIME_FRIENDSHIP_STOPEAT 5 //Min friendship to order it to stop eating someone
#define SLIME_FRIENDSHIP_STOPEAT_NOANGRY 7 //Min friendship to order it to stop eating someone without it losing friendship
#define SLIME_FRIENDSHIP_STOPCHASE 4 //Min friendship to order it to stop chasing someone (their target)
#define SLIME_FRIENDSHIP_STOPCHASE_NOANGRY 6 //Min friendship to order it to stop chasing someone (their target) without it losing friendship
#define SLIME_FRIENDSHIP_STAY 3 //Min friendship to order it to stay
#define SLIME_FRIENDSHIP_ATTACK 8 //Min friendship to order it to attack
//If you add a new status, be sure to add a list for it to the simple_animals global in _globalvars/lists/mobs.dm
//Hostile Mob AI Status
#define AI_ON 1
@@ -136,9 +136,7 @@
to_chat(owner, "<span class='warning'>You feel nauseous!</span>")
owner.vomit(20)
var/mob/living/simple_animal/slime/Slime = new(get_turf(owner), "grey")
Slime.Friends = list(owner)
Slime.Leader = owner
new /mob/living/simple_animal/slime(get_turf(owner), "grey")
/obj/item/organ/internal/heart/gland/mindshock
origin_tech = "materials=4;biotech=4;magnets=6;abductor=3"
@@ -173,15 +173,7 @@
Feedstop(silent = TRUE)
if(M.stat == DEAD) // our victim died
if(!client)
if(!rabid && !attacked)
if(M.LAssailant && M.LAssailant != M)
if(prob(50))
if(!(M.LAssailant in Friends))
Friends[M.LAssailant] = 1
else
++Friends[M.LAssailant]
else
if(client)
to_chat(src, "<i>This subject does not have a strong enough life energy anymore...</i>")
if(M.client && ishuman(M))
@@ -309,11 +301,6 @@
else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
hungry = 1
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)
if(will_hunt() && hungry || attacked || rabid) // Only add to the list if we need to
var/list/targets = list()
@@ -323,9 +310,6 @@
if(L.stat == DEAD) // Ignore dead mobs
continue
if(L in Friends) // No eating friends!
continue
var/ally = FALSE
for(var/F in faction)
if(F == "neutral") //slimes are neutral so other mobs not target them, but they can target neutral mobs
@@ -363,26 +347,9 @@
if(is_adult)
target_patience += 3
if(!Target) // If we have no target, we are wandering or following orders
if(Leader)
if(holding_still)
holding_still = max(holding_still - 1, 0)
else if(isturf(loc))
step_to(src, Leader)
else if(hungry)
if (holding_still)
holding_still = max(holding_still - hungry, 0)
else if(isturf(loc) && prob(50))
step(src, pick(GLOB.cardinal))
else
if(holding_still)
holding_still = max(holding_still - 1, 0)
else if (docile && pulledby)
holding_still = 10
else if(isturf(loc) && prob(33))
step(src, pick(GLOB.cardinal))
if(!Target) // If we have no target, we are wandering
if(hungry && isturf(loc) && prob(50))
step(src, pick(GLOB.cardinal))
else if(!AIproc)
INVOKE_ASYNC(src, PROC_REF(AIprocess))
@@ -416,115 +383,17 @@
regenerate_icons()
/mob/living/simple_animal/slime/proc/handle_speech()
//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, "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...", "Follow...")
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] >= SLIME_FRIENDSHIP_FOLLOW)
Leader = who
to_say = "I follow..."
else // Not friendly enough
to_say = pick("No...", "I no follow...")
else if(findtext(phrase, "stop"))
if(buckled) // We are asked to stop feeding
if (Friends[who] >= SLIME_FRIENDSHIP_STOPEAT)
Feedstop()
Target = null
if (Friends[who] < SLIME_FRIENDSHIP_STOPEAT_NOANGRY)
--Friends[who]
to_say = "Grrr..." // I'm angry but I do it
else
to_say = "Fine..."
else if(Target) // We are asked to stop chasing
if(Friends[who] >= SLIME_FRIENDSHIP_STOPCHASE)
Target = null
if(Friends[who] < SLIME_FRIENDSHIP_STOPCHASE_NOANGRY)
--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 stay..."
Leader = null
else
if(Friends[who] > Friends[Leader])
Leader = null
to_say = "Yes... I stop..."
else
to_say = "No... keep follow..."
else if(findtext(phrase, "stay"))
if(Leader)
if (Leader == who)
holding_still = Friends[who] * 10
to_say = "Yes... stay..."
else if(Friends[who] > Friends[Leader])
holding_still = (Friends[who] - Friends[Leader]) * 10
to_say = "Yes... stay..."
else
to_say = "No... keep follow..."
else
if(Friends[who] >= SLIME_FRIENDSHIP_STAY)
holding_still = Friends[who] * 10
to_say = "Yes... stay..."
else
to_say = "No... won't stay..."
else if(findtext(phrase, "attack"))
if(rabid && prob(20))
Target = who
AIprocess() //Wake up the slime's Target AI, needed otherwise this doesn't work
to_say = "ATTACK!?!?"
else if(Friends[who] >= SLIME_FRIENDSHIP_ATTACK)
for(var/mob/living/L in view(7,src)-list(src,who))
if(findtext(phrase, lowertext(L.name)))
if(isslime(L))
to_say = "NO... [L] slime friend..."
--Friends[who] //Don't ask a slime to attack its friend
else if(!Friends[L] || Friends[L] < 1)
Target = L
AIprocess()//Wake up the slime's Target AI, needed otherwise this doesn't work
to_say = "Ok... I attack [Target]..."
else
to_say = "No... like [L]..."
--Friends[who] //Don't ask a slime to attack its friend
break
else
to_say = "No... no listen..."
speech_buffer = list()
//Speech starts here
if(to_say)
say (to_say)
else if(prob(1))
if(prob(1))
emote(pick("bounce", "sway", "light", "vibrate", "jiggle"))
else
var/t = 10
var/slimes_near = 0
var/dead_slimes = 0
var/friends_near = list()
for(var/mob/living/L in view(7,src))
if(isslime(L) && L != src)
++slimes_near
if (L.stat == DEAD)
++dead_slimes
if(L in Friends)
t += 20
friends_near += L
if(nutrition < get_hunger_nutrition())
t += 10
if(nutrition < get_starve_nutrition())
@@ -580,10 +449,6 @@
phrases += "What happened?"
if(!slimes_near)
phrases += "Lonely..."
for(var/M in friends_near)
phrases += "[M]... friend..."
if(nutrition < get_hunger_nutrition())
phrases += "[M]... feed me..."
if(!stat)
say (pick(phrases))
@@ -613,11 +478,7 @@
/mob/living/simple_animal/slime/proc/will_hunt(hunger = -1) // Check for being stopped from feeding and chasing
if(docile)
return 0
return FALSE
if(hunger == 2 || rabid || attacked)
return 1
if(Leader)
return 0
if(holding_still)
return 0
return 1
return TRUE
return TRUE
@@ -43,17 +43,11 @@
var/number = 0 // Used to understand when someone is talking to it
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/rabid = FALSE // 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 friends; they are not considered targets for feeding; passed down after splitting
var/list/speech_buffer = list() // Last phrase said near it and person who said it
var/mood = "" // To show its face
var/mutator_used = FALSE //So you can't shove a dozen mutators into a single slime
var/force_stasis = FALSE
@@ -101,9 +95,6 @@
var/datum/action/AC = A
AC.Remove(src)
Target = null
Leader = null
Friends.Cut()
speech_buffer.Cut()
return ..()
/mob/living/simple_animal/slime/proc/set_colour(new_colour)
@@ -360,14 +351,10 @@
if(S.next_step(user, src))
return 1
if(istype(I, /obj/item/stack/sheet/mineral/plasma) && !stat) //Let's you feed slimes plasma.
if(user in Friends)
++Friends[user]
else
Friends[user] = 1
RegisterSignal(user, COMSIG_PARENT_QDELETING, PROC_REF(clear_friend))
to_chat(user, "<span class='notice'>You feed the slime the plasma. It chirps happily.</span>")
var/obj/item/stack/sheet/mineral/plasma/S = I
S.use(1)
discipline_slime(user)
return
if(I.force > 0)
attacked += 10
@@ -386,10 +373,6 @@
discipline_slime(user)
..()
/mob/living/simple_animal/slime/proc/clear_friend(mob/living/friend)
UnregisterSignal(friend, COMSIG_PARENT_QDELETING)
Friends -= friend
/mob/living/simple_animal/slime/water_act(volume, temperature, source, method = REAGENT_TOUCH)
. = ..()
var/water_damage = rand(10, 15) * volume
@@ -191,7 +191,6 @@
M.powerlevel = new_powerlevel
if(i != 1)
step_away(M, get_turf(src))
M.Friends = Friends.Copy()
babies += M
M.mutation_chance = clamp(mutation_chance+(rand(5,-5)),0,100)
SSblackbox.record_feedback("tally", "slime_babies_born", 1, M.colour)
@@ -8,11 +8,3 @@
verb = "loudly blorbles"
return verb
/mob/living/simple_animal/slime/hear_say(list/message_pieces, verb = "says", italics = 0, mob/speaker = null, sound/speech_sound, sound_vol, sound_frequency, use_voice = TRUE)
if(speaker != src && !stat)
if(speaker in Friends)
speech_buffer = list()
speech_buffer.Add(speaker)
speech_buffer.Add(lowertext(html_decode(multilingual_to_message(message_pieces))))
..()