diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index e03e92b466d..9c048e78c54 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -263,7 +263,7 @@ set_stat(UNCONSCIOUS) else set_stat(CONSCIOUS) - return 1 + return TRUE /mob/living/proc/handle_disabilities() handle_impaired_vision() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 0bba5c4a862..9ef157ea076 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -855,7 +855,7 @@ default behaviour is: return nutrition /mob/living/proc/adjust_nutrition(var/amt) - set_nutrition(nutrition + amt) + set_nutrition(get_nutrition() + amt) /mob/living/proc/get_max_hydration() return 500 @@ -867,7 +867,7 @@ default behaviour is: hydration = clamp(amt, 0, get_max_hydration()) /mob/living/proc/adjust_hydration(var/amt) - set_hydration(hydration + amt) + set_hydration(get_hydration() + amt) /mob/living/proc/has_chemical_effect(var/chem, var/threshold_over, var/threshold_under) var/val = GET_CHEMICAL_EFFECT(src, chem) diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 799a45be064..ba19248f19e 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -41,12 +41,13 @@ goat.visible_message(SPAN_NOTICE("\The [goat] calms down.")) var/obj/effect/vine/SV = locate() in goat.loc - if(SV && prob(60)) - goat.visible_message(SPAN_NOTICE("\The [goat] eats the plants.")) - SV.die_off(1) - var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/SP = locate() in goat.loc - if(SP) - qdel(SP) + if(SV) + if(prob(60)) + goat.visible_message(SPAN_NOTICE("\The [goat] eats the plants.")) + SV.die_off(1) + var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/SP = locate() in goat.loc + if(SP) + qdel(SP) else if(prob(20)) goat.visible_message(SPAN_NOTICE("\The [goat] chews on the plants.")) return diff --git a/code/modules/mob/living/simple_animal/friendly/possum.dm b/code/modules/mob/living/simple_animal/friendly/possum.dm index 5c26db52b97..823c15a29da 100644 --- a/code/modules/mob/living/simple_animal/friendly/possum.dm +++ b/code/modules/mob/living/simple_animal/friendly/possum.dm @@ -28,8 +28,6 @@ ai = /datum/ai/opossum var/is_angry = FALSE - var/is_angry = FALSE - /datum/ai/opossum expected_type = /mob/living/simple_animal/opossum /datum/ai/opossum/do_process(time_elapsed) diff --git a/code/modules/mob/living/simple_animal/hostile/commanded/commanded.dm b/code/modules/mob/living/simple_animal/hostile/commanded/commanded.dm index 83f45d2d250..291f398e092 100644 --- a/code/modules/mob/living/simple_animal/hostile/commanded/commanded.dm +++ b/code/modules/mob/living/simple_animal/hostile/commanded/commanded.dm @@ -28,7 +28,7 @@ /datum/ai/commanded/do_process(time_elapsed) ..() var/mob/living/simple_animal/hostile/commanded/com = body - while(com.command_buffer.len > 0) + while(com.command_buffer.len > 1) var/mob/speaker = com.command_buffer[1] var/text = com.command_buffer[2] var/filtered_name = lowertext(html_decode(com.name)) diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm index c0300e22616..4d21397a002 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm @@ -1,12 +1,16 @@ /mob/living/simple_animal/hostile/retaliate/beast ai = /datum/ai/beast - var/list/prey = list() + nutrition = 300 + var/list/prey + +/mob/living/simple_animal/hostile/retaliate/beast/get_max_nutrition() + return 300 /mob/living/simple_animal/hostile/retaliate/beast/ListTargets(var/dist = 7) . = ..() if(!length(.)) - if(length(prey)) + if(LAZYLEN(prey)) . = list() for(var/weakref/W in prey) var/mob/M = W.resolve() @@ -15,7 +19,7 @@ else if(get_nutrition() < get_max_nutrition() * 0.75) //time to look for some food for(var/mob/living/L in view(src, dist)) if(!attack_same && L.faction != faction) - prey |= weakref(L) + LAZYDISTINCTADD(prey, weakref(L)) /datum/ai/beast expected_type = /mob/living/simple_animal/hostile/retaliate/beast @@ -25,7 +29,7 @@ var/nut = beast.get_nutrition() var/max_nut = beast.get_max_nutrition() if(nut > max_nut * 0.75 || beast.incapacitated()) - beast.prey.Cut() + LAZYCLEARLIST(beast.prey) return for(var/mob/living/simple_animal/S in range(beast,1)) if(S == beast)