diff --git a/code/__HELPERS/traits.dm b/code/__HELPERS/traits.dm index 123ce00d45f..ae15819a2f2 100644 --- a/code/__HELPERS/traits.dm +++ b/code/__HELPERS/traits.dm @@ -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 *****// diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index d1ed8d58366..abff1c210af 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -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) diff --git a/code/modules/mob/living/simple_animal/friendly/butterfly.dm b/code/modules/mob/living/simple_animal/friendly/butterfly.dm index cbf6f1b44ee..8c8cce29948 100644 --- a/code/modules/mob/living/simple_animal/friendly/butterfly.dm +++ b/code/modules/mob/living/simple_animal/friendly/butterfly.dm @@ -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)) diff --git a/code/modules/mob/living/simple_animal/friendly/cockroach.dm b/code/modules/mob/living/simple_animal/friendly/cockroach.dm index 62fd5b92dd4..4fafe79ef39 100644 --- a/code/modules/mob/living/simple_animal/friendly/cockroach.dm +++ b/code/modules/mob/living/simple_animal/friendly/cockroach.dm @@ -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 diff --git a/code/modules/mob/living/simple_animal/friendly/lizard.dm b/code/modules/mob/living/simple_animal/friendly/lizard.dm index ead7016dd62..8ffcf66e16d 100644 --- a/code/modules/mob/living/simple_animal/friendly/lizard.dm +++ b/code/modules/mob/living/simple_animal/friendly/lizard.dm @@ -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("The spiderling skitters away from the [src]!") + 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, "You have no tail to shed!") + return + for(var/obj/item/grab/G in usr.grabbed_by) + var/mob/living/carbon/M = G.assailant + usr.visible_message("[usr] suddenly sheds their tail and slips out of [M]'s grasp!") + 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, "You regrow your tail!") /mob/living/simple_animal/lizard/decompile_act(obj/item/matter_decompiler/C, mob/user) if(!isdrone(user)) user.visible_message("[user] sucks [src] into its decompiler. There's a horrible crunching noise.", \ "It's a bit of a struggle, but you manage to suck [src] into your decompiler. It makes a series of visceral crunching noises.") 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