mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Implements making friends with Runtime
This commit is contained in:
@@ -1436,60 +1436,3 @@
|
||||
icon_dead = "cat3_dead"
|
||||
holder_type = /obj/item/weapon/holder/cat/fluff/bones
|
||||
bff_name = "Erstatz Vryroxes"
|
||||
|
||||
/mob/living/simple_animal/cat/fluff
|
||||
var/bff_name
|
||||
var/mob/living/carbon/human/bff
|
||||
|
||||
/mob/living/simple_animal/cat/fluff/handle_movement_target()
|
||||
if (!bff)
|
||||
for (var/mob/living/carbon/human/M in player_list)
|
||||
if (M.real_name == bff_name)
|
||||
bff = M
|
||||
break
|
||||
|
||||
if (bff)
|
||||
var/follow_dist = 5
|
||||
if (bff.stat >= DEAD || bff.health <= config.health_threshold_softcrit) //danger
|
||||
follow_dist = 1
|
||||
else if (bff.stat || bff.health <= 50) //danger or just sleeping
|
||||
follow_dist = 2
|
||||
var/near_dist = max(follow_dist - 3, 1)
|
||||
var/current_dist = get_dist(src, bff)
|
||||
|
||||
if (movement_target != bff)
|
||||
if (current_dist > follow_dist && !istype(movement_target, /mob/living/simple_animal/mouse) && (bff in oview(src)))
|
||||
//stop existing movement
|
||||
walk_to(src,0)
|
||||
turns_since_scan = 0
|
||||
|
||||
//walk to bff
|
||||
stop_automated_movement = 1
|
||||
movement_target = bff
|
||||
walk_to(src, movement_target, near_dist, 4)
|
||||
|
||||
//already following and close enough, stop
|
||||
else if (current_dist <= near_dist)
|
||||
walk_to(src,0)
|
||||
movement_target = null
|
||||
stop_automated_movement = 0
|
||||
|
||||
if (!(bff && movement_target == bff))
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/cat/fluff/Life()
|
||||
..()
|
||||
if (stat || !bff)
|
||||
return
|
||||
if (get_dist(src, bff) <= 1)
|
||||
if (bff.stat >= DEAD || bff.health <= config.health_threshold_softcrit)
|
||||
if (prob((bff.stat < DEAD)? 50 : 15))
|
||||
audible_emote(pick("meows in distress.", "meows anxiously."))
|
||||
else
|
||||
if (prob(5))
|
||||
visible_emote(pick("nuzzles [bff].",
|
||||
"brushes against [bff].",
|
||||
"rubs against [bff].",
|
||||
"purrs."))
|
||||
else if (bff.health <= 50)
|
||||
if (prob(10)) audible_emote("meows anxiously.")
|
||||
|
||||
Reference in New Issue
Block a user