Fix TRAIT_CARNIVOROUS doing nothing (#13513)

This commit is contained in:
Wildkins
2022-04-14 23:26:14 -03:00
committed by GitHub
parent f3bc110b81
commit 0385903ea0
3 changed files with 12 additions and 1 deletions
@@ -45,6 +45,7 @@
icon = 'icons/obj/hydroponics_growing.dmi'
icon_state = "bush4-1"
layer = 3
flags = PROXMOVE
pass_flags = PASSTABLE
mouse_opacity = 2
@@ -1,12 +1,16 @@
/obj/effect/plant/HasProximity(var/atom/movable/AM)
if(!is_mature() || seed.get_trait(TRAIT_SPREAD) != 2)
if(!is_mature() || (seed.get_trait(TRAIT_SPREAD) != 2 && seed.get_trait(TRAIT_CARNIVOROUS) == 0))
return
var/mob/living/M = AM
if(!istype(M))
return
if(!issmall(M) && seed.get_trait(TRAIT_SPREAD) != 2 && seed.get_trait(TRAIT_CARNIVOROUS) != 2)
// let TRAIT_CARNIVOROUS = 1 plants eat small creatures without murdering every hydroponicist
return
if(!buckled && !M.buckled_to && !M.anchored && (issmall(M) || prob(round(seed.get_trait(TRAIT_POTENCY)/6))))
//wait a tick for the Entered() proc that called HasProximity() to finish (and thus the moving animation),
//so we don't appear to teleport from two tiles away when moving into a turf adjacent to vines.
+6
View File
@@ -0,0 +1,6 @@
author: JohnWildkins
delete-after: True
changes:
- bugfix: "Carnivorous and weedy plants now properly check for nearby mobs to entangle and stab."