diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 033221ce5f2..5a34054c871 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -311,7 +311,7 @@ var/hit = H.attacked_by(src, user, def_zone) if(hit && hitsound) playsound(loc, hitsound, 50, 1, -1) - return hit + //return hit else if(attack_verb.len) user.visible_message("[M] has been [pick(attack_verb)] with [src] by [user]!") @@ -331,15 +331,23 @@ M.take_organ_damage(0, force) M.updatehealth() - if(seed && seed.get_trait(TRAIT_STINGS)) + if(seed && seed.get_trait(TRAIT_CARNIVOROUS)) + seed.do_thorns(M, src, def_zone) + + if(ishuman(M) && seed && seed.get_trait(TRAIT_STINGS)) if(!reagents || reagents.total_volume <= 0) return - reagents.remove_any(rand(1,3)) - seed.thrown_at(src,M) + seed.do_sting(M, src, def_zone) + reagents.remove_any(rand(1,3)) //use up some of the reagents at random sleep(-1) if(!src) return - if(prob(35)) + if(reagents && reagents.total_volume <= 0) //used-up fruit will be destroyed + if(user) + user << "\The [src] has dried out and crumbles to dust." + //user.drop_from_inventory(src) + qdel(src) + else if(prob(35)) //fruit that still has reagents has a chance of breaking each time it stings on hit if(user) user << "\The [src] has fallen to bits." //user.drop_from_inventory(src) diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index 774e36bf5c3..00af096d7fc 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -140,19 +140,47 @@ target.updatehealth() // Adds reagents to a target. -/datum/seed/proc/do_sting(var/mob/living/carbon/human/target, var/obj/item/fruit) +/datum/seed/proc/do_sting(var/mob/living/carbon/human/target, var/obj/item/fruit, var/target_limb) if(!get_trait(TRAIT_STINGS)) return + if(!target_limb) //if we weren't given a target_limb, pick a random one to try stinging + target_limb = pick("l_foot","r_foot","l_leg","r_leg","l_hand","r_hand","l_arm", "r_arm","head","chest","groin") if(chems && chems.len) - var/body_coverage = HEAD|HEADCOVERSMOUTH|HEADCOVERSEYES|UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS + if(!target.can_inject(target, 0, target_limb)) //if a syringe can't get through, neither can the sting + return + + var/protection_needed + switch(target_limb) + if("head") + protection_needed = HEAD | HEADCOVERSMOUTH | HEADCOVERSEYES + if("chest") + protection_needed = UPPER_TORSO + if("groin") + protection_needed = LOWER_TORSO + if("l_arm","r_arm") + protection_needed = ARMS + if("l_hand","r_hand") + protection_needed = HANDS + if("l_leg","r_leg") + protection_needed = LEGS + if("l_foot","r_foot") + protection_needed = FEET for(var/obj/item/clothing/clothes in target) + if(target.l_hand == clothes|| target.r_hand == clothes) continue - body_coverage &= ~(clothes.body_parts_covered) + protection_needed &= ~(clothes.body_parts_covered) + if((clothes.slot_flags & SLOT_HEAD) || (clothes.slot_flags & SLOT_MASK)) + if(clothes.flags & HEADCOVERSEYES) + protection_needed &= ~(HEADCOVERSEYES) + if(clothes.flags & HEADCOVERSMOUTH) + protection_needed &= ~(HEADCOVERSMOUTH) + if(!protection_needed) //already got the needed protection, save some time and skip the rest of the loop + break - if(!body_coverage) + if(!protection_needed) //properly protected, good job! return target << "You are stung by \the [fruit]!" diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm index 9edb4436de0..c169711ef83 100644 --- a/code/modules/hydroponics/spreading/spreading.dm +++ b/code/modules/hydroponics/spreading/spreading.dm @@ -125,8 +125,13 @@ max_growth-- //Ensure some variation in final sprite, makes the carpet of crap look less wonky. mature_time = world.time + seed.get_trait(TRAIT_MATURATION) + 15 //prevent vines from maturing until at least a few seconds after they've been created. - spread_chance = seed.get_trait(TRAIT_POTENCY) * 3 - spread_distance = ((growth_type>0) ? round(spread_chance*0.6) : round(spread_chance*0.3)) + spread_chance = seed.get_trait(TRAIT_POTENCY) + if(growth_type == 0) //These don't spread far at all (glowshroom, glowberries, brown mold) + spread_distance = round(spread_chance*0.1) + else if(growth_type == 2 || growth_type == 3) //Vines and biomass can go further than worms and mold + spread_distance = round(spread_chance*0.6) + else //Worms and mold go a moderate distance + spread_distance = round(spread_chance*0.3) update_icon() spawn(1) // Plants will sometimes be spawned in the turf adjacent to the one they need to end up in, for the sake of correct dir/etc being set. diff --git a/code/modules/hydroponics/spreading/spreading_response.dm b/code/modules/hydroponics/spreading/spreading_response.dm index 53abedd3c78..0f991a56bfc 100644 --- a/code/modules/hydroponics/spreading/spreading_response.dm +++ b/code/modules/hydroponics/spreading/spreading_response.dm @@ -17,14 +17,16 @@ // Todo, cause damage. user_unbuckle_mob(user, user) -/obj/effect/plant/proc/trodden_on(var/mob/living/victim) +/obj/effect/plant/Crossed(var/mob/living/victim) if(!is_mature()) return - var/mob/living/carbon/human/H = victim - if(istype(H) && H.shoes) - return - seed.do_thorns(victim,src) - seed.do_sting(victim,src,pick("r_foot","l_foot","r_leg","l_leg")) + var/target_limb = pick("r_foot","l_foot","r_leg","l_leg") + if(ishuman(victim)) + var/mob/living/carbon/human/H = victim + if(H.shoes && prob(50)) //shoes will reduce chances of being stuck/stung by plants, but not always avoid it + return + seed.do_thorns(victim,src,target_limb) + seed.do_sting(victim,src,target_limb) /obj/effect/plant/proc/entangle(var/mob/living/victim)