From c64b7bc0342326e65aa381ec0d7ddcfcca762c2f Mon Sep 17 00:00:00 2001 From: san7890 Date: Wed, 15 Nov 2023 16:00:39 -0700 Subject: [PATCH] Kobsa Code Review Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> --- code/__DEFINES/ai/pets.dm | 6 ++++++ code/modules/mob/living/basic/pets/parrot/parrot.dm | 5 ++--- .../basic/pets/parrot/parrot_ai/ghost_parrot_controller.dm | 6 ++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/code/__DEFINES/ai/pets.dm b/code/__DEFINES/ai/pets.dm index 3afaedfe0bcc6..e41c9ac0c3ffe 100644 --- a/code/__DEFINES/ai/pets.dm +++ b/code/__DEFINES/ai/pets.dm @@ -38,10 +38,16 @@ #define BB_EXPORTABLE_STRING_BUFFER_LIST "BB_parrot_repeat_string_buffer" /// The types of perches we desire to use #define BB_PARROT_PERCH_TYPES "BB_parrot_perch_types" +/// key that holds our perch target #define BB_PERCH_TARGET "perch_target" +/// key that holds our theft item target #define BB_HOARD_ITEM_TARGET "hoard_item_target" +/// key that holds the mob we will steal from #define BB_THEFT_VICTIM "theft_victim" +/// key that holds the turf we will be hauling stolen items to #define BB_HOARD_LOCATION "hoard_location" +/// key that holds the minimum range we must be from the hoard spot #define BB_HOARD_LOCATION_RANGE "hoard_location_range" +/// key that holds items we arent interested in hoarding #define BB_IGNORE_ITEMS "ignore_items" diff --git a/code/modules/mob/living/basic/pets/parrot/parrot.dm b/code/modules/mob/living/basic/pets/parrot/parrot.dm index 5433ee51cf6df..7fd6eb696aad7 100644 --- a/code/modules/mob/living/basic/pets/parrot/parrot.dm +++ b/code/modules/mob/living/basic/pets/parrot/parrot.dm @@ -197,7 +197,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( if(ishuman(target)) return perch_on_human(target) - if(!is_type_in_list(target, desired_perches)) + if(!is_type_in_typecache(target, desired_perches)) return FALSE forceMove(get_turf(target)) @@ -265,8 +265,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( balloon_alert(src, "too big to pick up!") return FALSE - target.forceMove(src) - held_item = target + pick_up_item(target) visible_message( span_notice("[src] grabs [held_item]!"), span_notice("You grab [held_item]!"), diff --git a/code/modules/mob/living/basic/pets/parrot/parrot_ai/ghost_parrot_controller.dm b/code/modules/mob/living/basic/pets/parrot/parrot_ai/ghost_parrot_controller.dm index add30bbd26ff4..58bdef408a5ee 100644 --- a/code/modules/mob/living/basic/pets/parrot/parrot_ai/ghost_parrot_controller.dm +++ b/code/modules/mob/living/basic/pets/parrot/parrot_ai/ghost_parrot_controller.dm @@ -9,7 +9,7 @@ ///subtree to possess humans /datum/ai_planning_subtree/possess_humans ///chance we go possess humans - var/possess_chance = 80 + var/possess_chance = 2 /datum/ai_planning_subtree/possess_humans/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick) var/mob/living/living_pawn = controller.pawn @@ -34,6 +34,4 @@ /datum/ai_behavior/perch_on_target/haunt /datum/ai_behavior/perch_on_target/haunt/check_human_conditions(mob/living/living_human) - if(living_human.stat == DEAD) - return FALSE - return TRUE + return (living_human.stat != DEAD)