Skip to content

Commit f757149

Browse files
Adding trained birds.
1 parent effafdc commit f757149

File tree

11 files changed

+178
-0
lines changed

11 files changed

+178
-0
lines changed

mods/pyrelight/_pyrelight.dme

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include "datum\factions.dm"
1313
#include "datum\locations.dm"
1414
#include "datum\religions.dm"
15+
#include "mobs\birds\_bird.dm"
16+
#include "mobs\birds\crow.dm"
17+
#include "mobs\birds\hawk.dm"
18+
#include "mobs\birds\pigeon.dm"
1519
#include "plants\_plants.dm"
1620
#include "plants\_plot.dm"
1721
#include "plants\_subsystem.dm"
@@ -20,6 +24,7 @@
2024
#include "plants\plants_fruit_template.dm"
2125
#include "plants\fruit_subtypes\nightweave.dm"
2226
#include "plants\plant_subtypes\nightweave.dm"
27+
#include "structures\hutch.dm"
2328
#include "undead\undead.dm"
2429
#include "undead\undead_skeleton.dm"
2530
#include "undead\undead_zombie.dm"

mods/pyrelight/icons/mobs/crow.dmi

2.71 KB
Binary file not shown.

mods/pyrelight/icons/mobs/hawk.dmi

6.1 KB
Binary file not shown.
3.02 KB
Binary file not shown.
718 Bytes
Binary file not shown.
641 Bytes
Binary file not shown.

mods/pyrelight/mobs/birds/_bird.dm

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/mob/living/simple_animal/trained_bird
2+
mob_size = MOB_SIZE_SMALL
3+
abstract_type = /mob/living/simple_animal/trained_bird
4+
holder_type = /obj/item/holder/bird
5+
6+
/obj/item/holder/bird
7+
w_class = MOB_SIZE_SMALL
8+
9+
/obj/item/holder/bird/attack_self(mob/user)
10+
var/mob/living/bird = locate() in contents
11+
if(istype(bird?.ai) && bird.ai.process_holder_interaction(user))
12+
return TRUE
13+
return ..()
14+
15+
/obj/item/holder/bird/end_throw(datum/thrownthing/TT)
16+
var/mob/living/bird = locate() in contents
17+
. = ..()
18+
if(!TT.thrower || !bird || QDELETED(src) || bird.loc != src)
19+
return
20+
bird.dropInto(loc)
21+
qdel(src) // This will happen shortly regardless, but might as well skip the 1ds delay.
22+
if(isturf(TT.target))
23+
bird.visible_message(SPAN_NOTICE("\The [TT.thrower] releases \a [bird]!"))
24+
else
25+
bird.visible_message(SPAN_NOTICE("\The [TT.thrower] indicates \the [TT.target] and releases \a [bird]!"))
26+
27+
if(istype(bird.ai))
28+
bird.ai.process_handler_target(TT.thrower, TT.target, TT.thrower.get_intent()?.intent_flags)

mods/pyrelight/mobs/birds/crow.dm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/datum/mob_controller/passive/crow
2+
emote_speech = list("Caw.","Caw!","Caw...")
3+
emote_hear = list("croaks", "caws")
4+
emote_see = list("preens its feathers", "hops around")
5+
6+
/mob/living/simple_animal/trained_bird/crow
7+
name = "crow"
8+
icon = 'mods/pyrelight/icons/mobs/crow.dmi'
9+
ai = /datum/mob_controller/passive/crow

mods/pyrelight/mobs/birds/hawk.dm

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/mob/living/simple_animal/trained_bird/hawk
2+
name = "hawk"
3+
icon = 'mods/pyrelight/icons/mobs/hawk.dmi'
4+
ai = /datum/mob_controller/passive/hunter/hawk
5+
6+
/datum/mob_controller/passive/hunter/hawk
7+
emote_speech = list("Skree!","SKREE!","Skree!?")
8+
emote_hear = list("screeches", "screams")
9+
emote_see = list("preens its feathers", "flicks its wings", "looks sharply around")
10+
11+
/datum/mob_controller/passive/hunter/hawk/process_handler_target(mob/handler, atom/target)
12+
if((. = ..()))
13+
set_target(target)
14+
15+
/datum/mob_controller/passive/hunter/hawk/process_handler_failure(mob/handler, atom/target)
16+
body?.visible_message("\The [body] ignores \the [target] in favour of attacking \the [handler]!")
17+
return ..()
18+
19+
/datum/mob_controller/passive/hunter/hawk/handle_friend_hunting(mob/friend)
20+
..()
21+
set_target(null)
22+
if(!body)
23+
return
24+
if(body.get_scooped(friend, body, silent = TRUE))
25+
body.visible_message(SPAN_NOTICE("\The [body] alights on \the [friend]."))
26+
else
27+
body.visible_message(SPAN_NOTICE("\The [body] lands beside \the [friend]."))
28+
29+
for(var/obj/item/thing in body)
30+
thing.dropInto(body.loc)
31+
friend.put_in_hands(thing)
32+
33+
// drop any item into their hand or on the ground
34+
// scoop_check(user) ? get_scooped(user, user)
35+
return TRUE
36+
37+
// Placeholder for husbandry check
38+
/datum/mob_controller/passive/hunter/hawk/process_holder_interaction(mob/handler)
39+
. = ..()
40+
// TODO: check animal husbandry skill
41+
if(is_friend(handler))
42+
to_chat(handler, SPAN_WARNING("You have already befriended \the [body]."))
43+
else
44+
add_friend(handler)
45+
to_chat(handler, SPAN_NOTICE("You preen \the [body], and [body.get_pronouns().he] nibbles your fingers affectionately."))
46+
47+
/datum/mob_controller/passive/hunter/hawk/process_hunting(atom/target)
48+
// Handles pathing to the target, and attacking the target if it's a mob.
49+
if(!(. = ..()))
50+
return
51+
// Maybe consider handling structures at some point?
52+
if(isitem(target) && body.Adjacent(target))
53+
var/obj/item/item = target
54+
item.forceMove(body)
55+
// Return to handler.
56+
set_target(last_handler?.resolve())
57+
return FALSE
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/mob/living/simple_animal/trained_bird/pigeon
2+
name = "pigeon"
3+
icon = 'mods/pyrelight/icons/mobs/pigeon.dmi'
4+
ai = /datum/mob_controller/passive/pigeon
5+
6+
/datum/mob_controller/passive/pigeon
7+
emote_speech = list("Oo-ooo.","Oo-ooo?","Oo-ooo...")
8+
emote_hear = list("coos")
9+
emote_see = list("preens its feathers", "puffs out its neck", "ruffles its wings")

0 commit comments

Comments
 (0)