Skip to content

Commit ecfe160

Browse files
Implementing pigeon return logic.
1 parent f757149 commit ecfe160

5 files changed

Lines changed: 70 additions & 21 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/obj/effect/dummy/fadeout/Initialize(mapload, fade_dir = SOUTH, atom/donor)
2+
. = ..()
3+
set_dir(fade_dir)
4+
appearance = donor // grab appearance before ghostizing in case they fall over etc
5+
switch(dir)
6+
if(NORTH)
7+
animate(src, pixel_z = 32, alpha = 0, time = 1 SECOND)
8+
if(SOUTH)
9+
animate(src, pixel_z = -32, alpha = 0, time = 1 SECOND)
10+
if(EAST)
11+
animate(src, pixel_w = 32, alpha = 0, time = 1 SECOND)
12+
if(WEST)
13+
animate(src, pixel_w = -32, alpha = 0, time = 1 SECOND)
14+
else
15+
animate(src, alpha = 0, time = 1 SECOND)
16+
QDEL_IN(src, 1 SECOND)

mods/content/fantasy/props/signpost.dm

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,7 @@
3535
var/choice = alert(user, "Are you sure you wish to depart? This will permanently remove your character from the round.", "Venture Forth?", "No", "Yes")
3636
if(choice != "Yes" || QDELETED(user) || user.incapacitated() || QDELETED(src) || !user.Adjacent(src))
3737
return TRUE
38-
var/obj/effect/dummy/fadeout = new(get_turf(user))
39-
fadeout.set_dir(dir)
40-
fadeout.appearance = user // grab appearance before ghostizing in case they fall over etc
41-
switch(dir)
42-
if(NORTH)
43-
animate(fadeout, pixel_z = 32, alpha = 0, time = 1 SECOND)
44-
if(SOUTH)
45-
animate(fadeout, pixel_z = -32, alpha = 0, time = 1 SECOND)
46-
if(EAST)
47-
animate(fadeout, pixel_w = 32, alpha = 0, time = 1 SECOND)
48-
if(WEST)
49-
animate(fadeout, pixel_w = -32, alpha = 0, time = 1 SECOND)
50-
else
51-
animate(fadeout, alpha = 0, time = 1 SECOND)
52-
QDEL_IN(fadeout, 1 SECOND)
38+
new /obj/effect/dummy/fadeout(get_turf(user), dir, user)
5339
despawn_character(user)
5440
return TRUE
5541

mods/pyrelight/mobs/birds/hawk.dm

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@
2121
set_target(null)
2222
if(!body)
2323
return
24-
if(body.get_scooped(friend, body, silent = TRUE))
24+
if(body.scoop_check(friend) && body.get_scooped(friend, body))//, silent = TRUE))
2525
body.visible_message(SPAN_NOTICE("\The [body] alights on \the [friend]."))
2626
else
2727
body.visible_message(SPAN_NOTICE("\The [body] lands beside \the [friend]."))
2828

29-
for(var/obj/item/thing in body)
29+
for(var/obj/item/thing in body) //.get_equipped_items())
3030
thing.dropInto(body.loc)
3131
friend.put_in_hands(thing)
3232

33-
// drop any item into their hand or on the ground
34-
// scoop_check(user) ? get_scooped(user, user)
3533
return TRUE
3634

3735
// Placeholder for husbandry check
@@ -51,7 +49,7 @@
5149
// Maybe consider handling structures at some point?
5250
if(isitem(target) && body.Adjacent(target))
5351
var/obj/item/item = target
54-
item.forceMove(body)
52+
item.forceMove(body) //body.put_in_hands(item)
5553
// Return to handler.
5654
set_target(last_handler?.resolve())
5755
return FALSE

mods/pyrelight/mobs/birds/pigeon.dm

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,55 @@
11
/mob/living/simple_animal/trained_bird/pigeon
2-
name = "pigeon"
2+
name = "messenger pigeon"
33
icon = 'mods/pyrelight/icons/mobs/pigeon.dmi'
44
ai = /datum/mob_controller/passive/pigeon
5+
holder_type = /obj/item/holder/bird/pigeon
6+
var/weakref/home_hutch
7+
8+
/mob/living/simple_animal/trained_bird/pigeon/Initialize()
9+
. = ..()
10+
update_hutch()
11+
12+
/mob/living/simple_animal/trained_bird/pigeon/proc/go_home(mob/releaser)
13+
dropInto(get_turf(src))
14+
if(!is_outside())
15+
return
16+
var/obj/structure/hutch/hutch = home_hutch?.resolve()
17+
if(!istype(hutch) || QDELETED(hutch))
18+
return // todo: check if the hutch is accessible from the sky
19+
if(releaser)
20+
releaser.visible_message(SPAN_NOTICE("\The [releaser] releases \a [src], which flutters away into the sky."))
21+
else
22+
visible_message(SPAN_NOTICE("\The [src] flutters away into the sky."))
23+
set_dir(SOUTH)
24+
new /obj/effect/dummy/fadeout(loc, NORTH, src)
25+
dropInto(hutch)
26+
hutch.visible_message(SPAN_NOTICE("\A [src] alights on \the [hutch] in a flutter of wings."))
27+
28+
/obj/item/holder/bird/pigeon/attack_self(mob/user)
29+
var/mob/living/simple_animal/trained_bird/pigeon/pigeon = locate() in contents
30+
if(!istype(pigeon))
31+
return ..()
32+
if(!is_outside())
33+
to_chat(user, SPAN_WARNING("You need to be outdoors to release \the [pigeon]."))
34+
return TRUE
35+
if(isnull(pigeon.home_hutch))
36+
var/decl/pronouns/pronouns = pigeon.get_pronouns()
37+
to_chat(user, SPAN_WARNING("\The [pigeon] tilts [pronouns.his] head at you in confusion. [pronouns.He] must not have a hutch to return to."))
38+
else
39+
releaser.drop_from_inventory(src)
40+
pigeon.go_home(user)
41+
qdel(src)
42+
return TRUE
43+
44+
/mob/living/simple_animal/trained_bird/pigeon/proc/update_hutch()
45+
var/obj/structure/hutch/hutch = home_hutch?.resolve()
46+
if(!istype(hutch) || QDELETED(hutch))
47+
hutch = get_recursive_loc_of_type(/obj/structure/hutch)
48+
if(istype(hutch) && !QDELETED(hutch))
49+
home_hutch = weakref(hutch)
50+
events_repository.unregister(/decl/observ/moved, src, src)
51+
else
52+
events_repository.register(/decl/observ/moved, src, src, TYPE_PROC_REF(/mob/living/simple_animal/trained_bird/pigeon, update_hutch))
553

654
/datum/mob_controller/passive/pigeon
755
emote_speech = list("Oo-ooo.","Oo-ooo?","Oo-ooo...")

nebula.dme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@
11801180
#include "code\game\objects\items\devices\cable_painter.dm"
11811181
#include "code\game\objects\items\devices\chameleonproj.dm"
11821182
#include "code\game\objects\items\devices\dociler.dm"
1183+
#include "code\game\objects\items\devices\fadeout.dm"
11831184
#include "code\game\objects\items\devices\flash.dm"
11841185
#include "code\game\objects\items\devices\geiger.dm"
11851186
#include "code\game\objects\items\devices\gps.dm"

0 commit comments

Comments
 (0)