Skip to content

Commit bc0056f

Browse files
Moving birds into their own modpack.
1 parent 62c031d commit bc0056f

File tree

22 files changed

+106
-75
lines changed

22 files changed

+106
-75
lines changed

code/datums/ai/hunter.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,5 @@
8686
consume_prey(prey)
8787

8888
// Stub for hawks to return to their handler and dock with the mothership.
89-
/datum/mob_controller/passive/hunter/proc/handle_friend_hunting(mob/friend)
89+
/datum/mob_controller/passive/hunter/proc/handle_friend_hunting(mob/user)
9090
return FALSE

code/datums/storage/subtypes_backpack.dm

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,3 @@
2525
max_w_class = ITEM_SIZE_NORMAL
2626
max_storage_space = 15
2727
cant_hold = list(/obj/item/backpack/satchel/flat) //muh recursive backpacks
28-
29-
/datum/storage/backpack/crow
30-
storage_slots = 7
31-
max_w_class = ITEM_SIZE_SMALL

code/modules/mob/living/simple_animal/crow/crow.dm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/datum/storage/backpack/crow
2+
storage_slots = 7
3+
max_w_class = ITEM_SIZE_SMALL
4+
15
/obj/item/backpack/messenger/corvid_couriers
26
name = "corvid messenger bag"
37
desc = "A small green-grey messenger bag with a blue Corvid Couriers logo on it."
@@ -7,6 +11,7 @@
711
storage = /datum/storage/backpack/crow
812
material = /decl/material/solid/organic/cloth
913

14+
// TODO: Merge with /mob/living/simple_animal/passive/bird/crow
1015
/mob/living/simple_animal/crow
1116
name = "crow"
1217
desc = "A large crow. Caw caw."
@@ -15,7 +20,7 @@
1520
mob_size = MOB_SIZE_SMALL
1621
speak_emote = list("caws")
1722
ai = /datum/mob_controller/crow
18-
natural_weapon = /obj/item/natural_weapon/crow_claws
23+
natural_weapon = /obj/item/natural_weapon/bird_claws
1924
universal_speak = TRUE
2025

2126
/datum/mob_controller/crow
@@ -34,7 +39,7 @@
3439
/mob/living/simple_animal/crow/get_bodytype()
3540
return GET_DECL(/decl/bodytype/animal/crow)
3641

37-
/obj/item/natural_weapon/crow_claws
42+
/obj/item/natural_weapon/bird_claws
3843
name = "claws"
3944
gender = PLURAL
4045
attack_verb = "clawed"

code/modules/mob_holder/holder_mobs.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
var/obj/item/holder/H = new holder_type(get_turf(src))
2323
H.w_class = get_object_size()
2424
if(initiator == src)
25-
if(!target.equip_to_slot_if_possible(H, slot_back_str, del_on_fail=0, disable_warning=1))
25+
if(!target.equip_to_slot_if_possible(H, slot_back_str, del_on_fail=0, disable_warning=1) && !target.put_in_hands(H))
2626
if(!silent)
2727
to_chat(initiator, SPAN_WARNING("You can't climb onto [target]!"))
2828
return FALSE

maps/karzerfeste/karzerfeste.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "../../mods/content/mouse_highlights/_mouse_highlight.dme"
66
#include "../../mods/content/scaling_descriptors.dm"
77
#include "../../mods/species/drakes/_drakes.dme" // include before _fantasy.dme so overrides work
8+
#include "../../mods/content/birds/_birds.dme"
89
#include "../../mods/content/fantasy/_fantasy.dme"
910
#include "../../mods/pyrelight/_pyrelight.dme" // include after _fantasy.dme so overrides work
1011

mods/content/birds/_birds.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/decl/modpack/birds
2+
name = "Birds"

mods/content/birds/_birds.dme

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef MODPACK_BIRDS
2+
#define MODPACK_BIRDS
3+
// BEGIN_INCLUDE
4+
#include "_birds.dm"
5+
#include "bird.dm"
6+
#include "bird_crow.dm"
7+
#include "bird_hawk.dm"
8+
#include "bird_pigeon.dm"
9+
#include "hutch.dm"
10+
// END_INCLUDE
11+
#endif

mods/content/birds/bird.dm

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/mob/living/simple_animal/passive/bird
2+
mob_size = MOB_SIZE_SMALL
3+
pass_flags = PASS_FLAG_TABLE
4+
abstract_type = /mob/living/simple_animal/passive/bird
5+
natural_weapon = /obj/item/natural_weapon/bird_claws
6+
holder_type = /obj/item/holder/bird
7+
8+
/obj/item/holder/bird
9+
w_class = MOB_SIZE_SMALL
10+
11+
/obj/item/holder/bird/attack_self(mob/user)
12+
var/mob/living/bird = locate() in contents
13+
if(istype(bird?.ai) && bird.ai.process_holder_interaction(user))
14+
return TRUE
15+
return ..()
16+
17+
/obj/item/holder/bird/afterattack(atom/target, mob/user, proximity)
18+
if(proximity)
19+
return ..()
20+
var/mob/living/bird = locate() in contents
21+
. = ..()
22+
if(!user || !bird || QDELETED(src) || bird.loc != src)
23+
return
24+
bird.dropInto(loc)
25+
qdel(src) // This will happen shortly regardless, but might as well skip the 1ds delay.
26+
if(isturf(target))
27+
bird.visible_message(SPAN_NOTICE("\The [user] releases \a [bird]!"))
28+
else
29+
bird.visible_message(SPAN_NOTICE("\The [user] indicates \the [target] and releases \a [bird]!"))
30+
if(istype(bird.ai))
31+
bird.ai.process_handler_target(user, target, user.get_intent()?.intent_flags)
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
emote_hear = list("croaks", "caws")
44
emote_see = list("preens its feathers", "hops around")
55

6-
/mob/living/simple_animal/trained_bird/crow
6+
/mob/living/simple_animal/passive/bird/crow
77
name = "crow"
8-
icon = 'mods/pyrelight/icons/mobs/crow.dmi'
8+
icon = 'mods/content/birds/icons/crow.dmi'
99
ai = /datum/mob_controller/passive/crow
10+
ability_handlers = list(/datum/ability_handler/predator) // should really be /scavenger
Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
1-
/mob/living/simple_animal/trained_bird/hawk
1+
/mob/living/simple_animal/passive/bird/hawk
22
name = "hawk"
3-
icon = 'mods/pyrelight/icons/mobs/hawk.dmi'
3+
icon = 'mods/content/birds/icons/hawk.dmi'
44
ai = /datum/mob_controller/passive/hunter/hawk
5+
ability_handlers = list(/datum/ability_handler/predator)
56

67
/datum/mob_controller/passive/hunter/hawk
78
emote_speech = list("Skree!","SKREE!","Skree!?")
89
emote_hear = list("screeches", "screams")
910
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
1018

1119
/datum/mob_controller/passive/hunter/hawk/process_handler_target(mob/handler, atom/target)
1220
if((. = ..()))
1321
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 ..()
1431

1532
/datum/mob_controller/passive/hunter/hawk/process_handler_failure(mob/handler, atom/target)
1633
body?.visible_message("\The [body] ignores \the [target] in favour of attacking \the [handler]!")
1734
return ..()
1835

19-
/datum/mob_controller/passive/hunter/hawk/handle_friend_hunting(mob/friend)
36+
/datum/mob_controller/passive/hunter/hawk/handle_friend_hunting(mob/user)
2037
..()
2138
set_target(null)
2239
if(!body)
2340
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]."))
2643
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]."))
2845

2946
for(var/obj/item/thing in body) //.get_equipped_items())
3047
thing.dropInto(body.loc)
31-
friend.put_in_hands(thing)
48+
user.put_in_hands(thing)
3249

3350
return TRUE
3451

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-
4552
/datum/mob_controller/passive/hunter/hawk/process_hunting(atom/target)
4653
// Handles pathing to the target, and attacking the target if it's a mob.
4754
if(!(. = ..()))

0 commit comments

Comments
 (0)