ports tgs regal rats (#12479)

* port regal rats

* fix missing line

* royal rat goes after humans too

* okay dont let them attack people

* let them attack people but at less damage

* remove header
This commit is contained in:
Timothy Teakettle
2020-06-09 03:28:00 -07:00
committed by GitHub
parent d281b963af
commit 14c9ab2ff1
11 changed files with 331 additions and 0 deletions
@@ -29,6 +29,7 @@
var/body_color //brown, gray and white, leave blank for random
gold_core_spawnable = FRIENDLY_SPAWN
var/chew_probability = 1
faction = list("rat")
/mob/living/simple_animal/mouse/Initialize()
. = ..()
@@ -59,11 +60,15 @@
else
..(gibbed)
/mob/living/simple_animal/mouse/Crossed(AM as mob|obj)
if( ishuman(AM) )
if(!stat)
var/mob/M = AM
to_chat(M, "<span class='notice'>[icon2html(src, M)] Squeak!</span>")
if(istype(AM, /obj/item/reagent_containers/food/snacks/royalcheese))
evolve()
qdel(AM)
..()
/mob/living/simple_animal/mouse/handle_automated_action()
@@ -84,6 +89,40 @@
C.deconstruct()
visible_message("<span class='warning'>[src] chews through the [C].</span>")
for(var/obj/item/reagent_containers/food/snacks/cheesewedge/cheese in range(1, src))
if(prob(10))
be_fruitful()
qdel(cheese)
return
for(var/obj/item/reagent_containers/food/snacks/royalcheese/bigcheese in range(1, src))
qdel(bigcheese)
evolve()
return
/**
*Checks the mouse cap, if it's above the cap, doesn't spawn a mouse. If below, spawns a mouse and adds it to cheeserats.
*/
/mob/living/simple_animal/mouse/proc/be_fruitful()
var/cap = CONFIG_GET(number/ratcap)
if(LAZYLEN(SSmobs.cheeserats) >= cap)
visible_message("<span class='warning'>[src] carefully eats the cheese, hiding it from the [cap] mice on the station!</span>")
return
var/mob/living/newmouse = new /mob/living/simple_animal/mouse(loc)
SSmobs.cheeserats += newmouse
visible_message("<span class='notice'>[src] nibbles through the cheese, attracting another mouse!</span>")
/**
*Spawns a new regal rat, says some good jazz, and if sentient, transfers the relivant mind.
*/
/mob/living/simple_animal/mouse/proc/evolve()
var/mob/living/simple_animal/hostile/regalrat = new /mob/living/simple_animal/hostile/regalrat(loc)
visible_message("<span class='warning'>[src] devours the cheese! He morphs into something... greater!</span>")
regalrat.say("RISE, MY SUBJECTS! SCREEEEEEE!")
if(mind)
mind.transfer_to(regalrat)
qdel(src)
/*
* Mouse types
*/
@@ -100,6 +139,10 @@
body_color = "brown"
icon_state = "mouse_brown"
/mob/living/simple_animal/mouse/Destroy()
SSmobs.cheeserats -= src
return ..()
GLOBAL_VAR(tom_existed)
//TOM IS ALIVE! SQUEEEEEEEE~K :)