Implements making friends with Runtime

This commit is contained in:
mwerezak
2015-01-25 02:04:01 -05:00
parent 22edc4bc90
commit 58bb2f22cd
4 changed files with 82 additions and 62 deletions

View File

@@ -292,7 +292,7 @@
if("monkey") M.change_mob_type( /mob/living/carbon/monkey , null, null, delmob ) if("monkey") M.change_mob_type( /mob/living/carbon/monkey , null, null, delmob )
if("robot") M.change_mob_type( /mob/living/silicon/robot , null, null, delmob ) if("robot") M.change_mob_type( /mob/living/silicon/robot , null, null, delmob )
if("cat") M.change_mob_type( /mob/living/simple_animal/cat , null, null, delmob ) if("cat") M.change_mob_type( /mob/living/simple_animal/cat , null, null, delmob )
if("runtime") M.change_mob_type( /mob/living/simple_animal/cat/Runtime , null, null, delmob ) if("runtime") M.change_mob_type( /mob/living/simple_animal/cat/fluff/Runtime , null, null, delmob )
if("corgi") M.change_mob_type( /mob/living/simple_animal/corgi , null, null, delmob ) if("corgi") M.change_mob_type( /mob/living/simple_animal/corgi , null, null, delmob )
if("ian") M.change_mob_type( /mob/living/simple_animal/corgi/Ian , null, null, delmob ) if("ian") M.change_mob_type( /mob/living/simple_animal/corgi/Ian , null, null, delmob )
if("crab") M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob ) if("crab") M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob )

View File

@@ -1436,60 +1436,3 @@
icon_dead = "cat3_dead" icon_dead = "cat3_dead"
holder_type = /obj/item/weapon/holder/cat/fluff/bones holder_type = /obj/item/weapon/holder/cat/fluff/bones
bff_name = "Erstatz Vryroxes" 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.")

View File

@@ -1618,7 +1618,7 @@ proc/populate_seed_list()
seed_noun = "data" seed_noun = "data"
display_name = "runtimes" display_name = "runtimes"
packet_icon = "seed-replicapod" packet_icon = "seed-replicapod"
products = list(/mob/living/simple_animal/cat/Runtime) products = list(/mob/living/simple_animal/cat/fluff/Runtime)
plant_icon = "replicapod" plant_icon = "replicapod"
requires_nutrients = 0 requires_nutrients = 0

View File

@@ -81,8 +81,66 @@
return //since the holder icon looks like a living cat return //since the holder icon looks like a living cat
..() ..()
/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.")
//RUNTIME IS ALIVE! SQUEEEEEEEE~ //RUNTIME IS ALIVE! SQUEEEEEEEE~
/mob/living/simple_animal/cat/Runtime /mob/living/simple_animal/cat/fluff/Runtime
name = "Runtime" name = "Runtime"
desc = "Her fur has the look and feel of velvet, and her tail quivers occasionally." desc = "Her fur has the look and feel of velvet, and her tail quivers occasionally."
gender = FEMALE gender = FEMALE
@@ -90,6 +148,25 @@
icon_living = "cat" icon_living = "cat"
icon_dead = "cat_dead" icon_dead = "cat_dead"
/mob/living/simple_animal/cat/fluff/Runtime/verb/friend()
set name = "Become Friends"
set category = "IC"
set src in view(1)
if (bff || !(ishuman(usr) && usr.job == "Chief Medical Officer"))
if (usr == bff)
set_dir(get_dir(src, bff))
say("Meow!")
else
usr << "<span class='notice'>[src] ignores you.</span>"
return
bff = usr
bff_name = usr.real_name
set_dir(get_dir(src, bff))
say("Meow!")
/mob/living/simple_animal/cat/kitten /mob/living/simple_animal/cat/kitten
name = "kitten" name = "kitten"
desc = "D'aaawwww" desc = "D'aaawwww"