|
1 | | -/mob/living/simple_animal/trained_bird/hawk |
| 1 | +/mob/living/simple_animal/passive/bird/hawk |
2 | 2 | name = "hawk" |
3 | | - icon = 'mods/pyrelight/icons/mobs/hawk.dmi' |
| 3 | + icon = 'mods/content/birds/icons/hawk.dmi' |
4 | 4 | ai = /datum/mob_controller/passive/hunter/hawk |
| 5 | + ability_handlers = list(/datum/ability_handler/predator) |
5 | 6 |
|
6 | 7 | /datum/mob_controller/passive/hunter/hawk |
7 | 8 | emote_speech = list("Skree!","SKREE!","Skree!?") |
8 | 9 | emote_hear = list("screeches", "screams") |
9 | 10 | emote_see = list("preens its feathers", "flicks its wings", "looks sharply around") |
| 11 | + var/handler_set_target = FALSE |
| 12 | + var/handling_skill = SKILL_BOTANY |
| 13 | + var/handling_difficulty = SKILL_ADEPT |
| 14 | + |
| 15 | +/datum/mob_controller/passive/hunter/hawk/set_target(atom/new_target) |
| 16 | + . = ..() |
| 17 | + handler_set_target = FALSE |
10 | 18 |
|
11 | 19 | /datum/mob_controller/passive/hunter/hawk/process_handler_target(mob/handler, atom/target) |
12 | 20 | if((. = ..())) |
13 | 21 | set_target(target) |
| 22 | + handler_set_target = TRUE |
| 23 | + |
| 24 | +/datum/mob_controller/passive/hunter/hawk/can_hunt(mob/living/victim) |
| 25 | + return handler_set_target || ..() |
| 26 | + |
| 27 | +/datum/mob_controller/passive/hunter/hawk/check_handler_can_order(mob/handler, atom/target, intent_flags) |
| 28 | + if(!(. = ..()) && handler.skill_check(handling_skill, handling_difficulty)) |
| 29 | + add_friend(handler) |
| 30 | + return ..() |
14 | 31 |
|
15 | 32 | /datum/mob_controller/passive/hunter/hawk/process_handler_failure(mob/handler, atom/target) |
16 | 33 | body?.visible_message("\The [body] ignores \the [target] in favour of attacking \the [handler]!") |
17 | 34 | return ..() |
18 | 35 |
|
19 | | -/datum/mob_controller/passive/hunter/hawk/handle_friend_hunting(mob/friend) |
| 36 | +/datum/mob_controller/passive/hunter/hawk/handle_friend_hunting(mob/user) |
20 | 37 | ..() |
21 | 38 | set_target(null) |
22 | 39 | if(!body) |
23 | 40 | return |
24 | | - if(body.scoop_check(friend) && body.get_scooped(friend, body))//, silent = TRUE)) |
25 | | - body.visible_message(SPAN_NOTICE("\The [body] alights on \the [friend].")) |
| 41 | + if(body.scoop_check(user) && body.get_scooped(user, body, silent = TRUE)) |
| 42 | + body.visible_message(SPAN_NOTICE("\The [body] alights on \the [user].")) |
26 | 43 | else |
27 | | - body.visible_message(SPAN_NOTICE("\The [body] lands beside \the [friend].")) |
| 44 | + body.visible_message(SPAN_NOTICE("\The [body] lands beside \the [user].")) |
28 | 45 |
|
29 | 46 | for(var/obj/item/thing in body) //.get_equipped_items()) |
30 | 47 | thing.dropInto(body.loc) |
31 | | - friend.put_in_hands(thing) |
| 48 | + user.put_in_hands(thing) |
32 | 49 |
|
33 | 50 | return TRUE |
34 | 51 |
|
35 | | -// Placeholder for husbandry check |
36 | | -/datum/mob_controller/passive/hunter/hawk/process_holder_interaction(mob/handler) |
37 | | - . = ..() |
38 | | - // TODO: check animal husbandry skill |
39 | | - if(is_friend(handler)) |
40 | | - to_chat(handler, SPAN_WARNING("You have already befriended \the [body].")) |
41 | | - else |
42 | | - add_friend(handler) |
43 | | - to_chat(handler, SPAN_NOTICE("You preen \the [body], and [body.get_pronouns().he] nibbles your fingers affectionately.")) |
44 | | - |
45 | 52 | /datum/mob_controller/passive/hunter/hawk/process_hunting(atom/target) |
46 | 53 | // Handles pathing to the target, and attacking the target if it's a mob. |
47 | 54 | if(!(. = ..())) |
|
0 commit comments