Fixes being able to ride dead space carp (#66530)

Removes the ridable element on death, and unbuckles all the mobs
This commit is contained in:
Seth Scherer
2022-05-01 23:11:26 -05:00
committed by GitHub
parent d1163aa68e
commit 03314d16c4
2 changed files with 24 additions and 1 deletions
@@ -66,6 +66,8 @@
var/static/list/carp_colors_rare = list(
"silver" = "#fdfbf3"
)
/// Is the carp tamed?
var/tamed = FALSE
/mob/living/simple_animal/hostile/carp/Initialize(mapload, mob/tamer)
AddElement(/datum/element/simple_flying)
@@ -83,10 +85,24 @@
else
make_tameable()
/mob/living/simple_animal/hostile/carp/revive(full_heal, admin_revive)
if (tamed)
var/datum/weakref/friendref = ai_controller.blackboard[BB_HOSTILE_FRIEND]
var/mob/living/friend = friendref?.resolve()
if(friend)
tamed(friend)
return ..()
/mob/living/simple_animal/hostile/carp/death(gibbed)
if (tamed)
can_buckle = FALSE
return ..()
/mob/living/simple_animal/hostile/carp/proc/make_tameable()
AddComponent(/datum/component/tameable, food_types = list(/obj/item/food/meat), tame_chance = 10, bonus_tame_chance = 5, after_tame = CALLBACK(src, .proc/tamed))
/mob/living/simple_animal/hostile/carp/proc/tamed(mob/living/tamer)
tamed = TRUE
can_buckle = TRUE
buckle_lying = 0
AddElement(/datum/element/ridable, /datum/component/riding/creature/carp)