Adds shed tail and eating bugs to simplemob lizards (#19726)

* Adds shed tail and eating bugs to lizards

* Steel's review

* Steels review part 2

* Steel's and Charlie's review

* Ryan's review

* Early return code improvement

* minor spelling mistake
This commit is contained in:
GDN
2022-11-21 22:33:30 -06:00
committed by GitHub
parent 9003a869f1
commit 0139e03f54
5 changed files with 65 additions and 4 deletions
+1
View File
@@ -194,6 +194,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_FORCE_DOORS "force_doors"
#define TRAIT_AI_UNTRACKABLE "AI_untrackable"
#define TRAIT_REPEATSURGERY "master_surgeon" // Lets you automatically repeat surgeries regardless of tool
#define TRAIT_EDIBLE_BUG "edible_bug" // Lets lizards and other animals that can eat bugs eat ya
#define TRAIT_ELITE_CHALLENGER "elite_challenger"
//***** ITEM TRAITS *****//
+1
View File
@@ -108,6 +108,7 @@
pixel_y = rand(6,-6)
START_PROCESSING(SSobj, src)
AddComponent(/datum/component/swarming)
ADD_TRAIT(src, TRAIT_EDIBLE_BUG, "edible_bug") // Normally this is just used for mobs, but spiderlings are kind of that...
/obj/structure/spider/spiderling/Destroy()
STOP_PROCESSING(SSobj, src)
@@ -17,12 +17,16 @@
density = FALSE
flying = TRUE
pass_flags = PASSTABLE | PASSGRILLE | PASSMOB
ventcrawler = 2
ventcrawler = VENTCRAWLER_ALWAYS
mob_size = MOB_SIZE_TINY
mob_biotypes = MOB_ORGANIC | MOB_BUG
butcher_results = list(/obj/item/reagent_containers/food/snacks/meat = 0)
gold_core_spawnable = FRIENDLY_SPAWN
/mob/living/simple_animal/butterfly/Initialize(mapload) //Not the poor butterfly!
. = ..()
ADD_TRAIT(src, TRAIT_EDIBLE_BUG, "edible_bug")
/mob/living/simple_animal/butterfly/New()
..()
color = rgb(rand(0, 255), rand(0, 255), rand(0, 255))
@@ -25,6 +25,10 @@
/mob/living/simple_animal/cockroach/can_die()
return ..() && !SSticker.cinematic //If the nuke is going off, then cockroaches are invincible. Keeps the nuke from killing them, cause cockroaches are immune to nukes.
/mob/living/simple_animal/cockroach/Initialize(mapload) //Lizards are a great way to deal with cockroaches
. = ..()
ADD_TRAIT(src, TRAIT_EDIBLE_BUG, "edible_bug")
/mob/living/simple_animal/cockroach/Crossed(atom/movable/AM, oldloc)
if(isliving(AM))
var/mob/living/A = AM
@@ -1,5 +1,5 @@
/mob/living/simple_animal/lizard
name = "Lizard"
name = "lizard"
desc = "A cute tiny lizard."
icon = 'icons/mob/critter.dmi'
icon_state = "lizard"
@@ -15,7 +15,7 @@
response_help = "pets"
response_disarm = "shoos"
response_harm = "stomps on"
ventcrawler = 2
ventcrawler = VENTCRAWLER_ALWAYS
density = FALSE
pass_flags = PASSTABLE | PASSMOB
mob_size = MOB_SIZE_SMALL
@@ -24,13 +24,64 @@
can_collar = TRUE
mob_biotypes = MOB_ORGANIC | MOB_BEAST | MOB_REPTILE
gold_core_spawnable = FRIENDLY_SPAWN
var/eating_sound = 'sound/weapons/bite.ogg'
/// Lizards start with a tail
var/has_tail = TRUE
/mob/living/simple_animal/lizard/handle_automated_action()
if(!stat && !buckled)
if(prob(1))
custom_emote(EMOTE_VISIBLE, pick("sticks out its tongue.", "wags its tail.", "lies down."))
if(!isturf(loc))
return
var/list/lizard_view = view(1, src)
for(var/mob/living/M in lizard_view)
if(M.stat == CONSCIOUS && Adjacent(M) && HAS_TRAIT(M, TRAIT_EDIBLE_BUG))
custom_emote(EMOTE_VISIBLE, "eats \the [M]!")
playsound(loc, eating_sound, 20, 1)
M.death()
break
for(var/obj/structure/spider/spiderling/spider in lizard_view)
if(Adjacent(spider) && HAS_TRAIT(spider, TRAIT_EDIBLE_BUG))
if(prob(90)) // Slippery things aren't they?
visible_message("<span class='notice'>The spiderling skitters away from the [src]!</span>")
spider.random_skitter()
return
else
custom_emote(EMOTE_VISIBLE, "eats \the [spider]!")
playsound(loc, eating_sound, 20, 1)
qdel(spider)
break
/mob/living/simple_animal/lizard/verb/lose_tail()
set name = "Lose tail"
set desc = "Allows you to lose your tail and escape a sticky situation. Takes 5 minutes for your tail to grow back."
set category = "Animal"
if(stat != CONSCIOUS)
return
if(!has_tail)
to_chat(usr, "<span class='warning'>You have no tail to shed!</span>")
return
for(var/obj/item/grab/G in usr.grabbed_by)
var/mob/living/carbon/M = G.assailant
usr.visible_message("<span class='warning'>[usr] suddenly sheds their tail and slips out of [M]'s grasp!</span>")
M.KnockDown(3 SECONDS) // FUCK I TRIPPED
playsound(usr.loc, "sound/misc/slip.ogg", 75, 1)
has_tail = FALSE
addtimer(CALLBACK(src, PROC_REF(new_tail)), 5 MINUTES)
/mob/living/simple_animal/lizard/proc/new_tail()
has_tail = TRUE
to_chat(src, "<span class='notice'>You regrow your tail!</span>")
/mob/living/simple_animal/lizard/decompile_act(obj/item/matter_decompiler/C, mob/user)
if(!isdrone(user))
user.visible_message("<span class='notice'>[user] sucks [src] into its decompiler. There's a horrible crunching noise.</span>", \
"<span class='warning'>It's a bit of a struggle, but you manage to suck [src] into your decompiler. It makes a series of visceral crunching noises.</span>")
new/obj/effect/decal/cleanable/blood/splatter(get_turf(src))
C.stored_comms["wood"] += 2
C.stored_comms["wood"] += 2 //TODO make this stuff not wood because borgs don't have a wood module, only drones, and this doesn't work with drones - GDN
C.stored_comms["glass"] += 2
qdel(src)
return TRUE