From 7702b5957d87e08b53d3114c4be82cb707aa81d2 Mon Sep 17 00:00:00 2001 From: FalseIncarnate Date: Thu, 26 Nov 2015 01:27:21 -0500 Subject: [PATCH] Weaponized Botany Changes HEAVILY nerfs spreading plants! - Spread chance cut down by 66% - In general, plants will spread slower, meaning they won't outpace a goat wielding a scythe and plant-killer grenades. - Spread distance cut down by AT LEAST 66% - TRAIT_SPREAD 1 plants (glowshrooms) will spread to a maximum distance of (TRAIT_POTENCY * 0.1) - TRAIT_SPREAD 2 plants (kudzu) will spread to a maximum distance of (TRAIT_POTENCY * 0.6) if they are vines or biomass growth_type (most common types) - TRAIT_SPREAD 2 that have the "worms" or "mold" growth_type will spread to a maximum distance of (TRAIT_POTENCY * 0.3) Buffs spreading plants! - Spreading plants with thorns or stinging will now properly attempt to affect anyone who walks over them! - Wearing shoes gives you a 50% chance to avoid being affected by thorns and stings Rewrites stinging plant defenses and logic - Stinging plants now will target a specific limb/body part and check for the appropriate clothing coverage - Spreading plant stings will only target legs and feet - Picking up stinging fruit will only target hands - Being hit with a stinging fruit will target the hit limb - THICKMATERIAL clothing from hardsuits and biosuits will protect from stings that target areas they cover - Clothes will protect their covered areas from stings - Protecting the head requires covering the eyes and mouth with either the helmet or glasses/masks - If you aren't fully protected in the target area, you get stung. Fruit with thorns and/or stinging now properly apply their effects when thrown or used as melee weapons - Still requires HARM intent to use fruit as a melee weapon instead of feeding it to the target - Stinging fruit will check the hit area for protection - Stinging fruit will crumble into dust if it uses up all its reagents. - Stringing fruit still has a chance to break on hit even while it has reagents left. --- code/modules/hydroponics/grown.dm | 18 +++++++--- code/modules/hydroponics/seed.dm | 36 ++++++++++++++++--- .../hydroponics/spreading/spreading.dm | 9 +++-- .../spreading/spreading_response.dm | 14 ++++---- 4 files changed, 60 insertions(+), 17 deletions(-) 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)