Botany Fixes and Telescopic Scythes

- Ports https://github.com/Baystation12/Baystation12/pull/9184 from
Baystation

- Prevents deconstruction of soil and invisible soil
- Fixes #1011

- Adds a verb to eject tanks from hydroponics trays if one is inserted
- Don't think anyone has actually done this, but it has been possible
for a LONG time and will be more useful once I get the atmos portion of
botany working

- Fixes grown items not leaving behind their trash
- Notably banana peels and corn cobs. Clowns and hillbillies rejoice!

- Adds 15% chance for a watermelon to leave behind a pack of it's seeds
when eaten.
- Slicing watermelon will not produce seeds ever

- Replaces the Janitorial ERT members' plant-b-gone sprays with new
Telescopic Scythes!
- Can be collapsed to fit on a belt or fit in pockets/bags
- While collapsed, it loses a large amount of it's damage, is not
considered sharp or as having an edge, and cannot cut vines like a
normal scythe. Extended ones are functionally identical to normal
scythes
- Extending and collapsing a telescopic scythe has some awesome sounds
from Freesound.org
This commit is contained in:
FalseIncarnate
2015-05-12 23:00:02 -04:00
parent 884fb4e4ca
commit b602e3d5e3
12 changed files with 203 additions and 87 deletions
+15
View File
@@ -54,9 +54,24 @@
rtotal += round(potency/reagent_data[2])
reagents.add_reagent(rid,max(1,rtotal))
update_desc()
update_trash()
if(reagents.total_volume > 0)
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/proc/update_trash()
if(!seed)
return
trash = seed.trash_type
if(seed.kitchen_tag)
if(seed.kitchen_tag == "watermelon") // 15% chance to leave behind a pack of watermelon seeds
if(prob(15))
var/obj/item/seeds/seeds = new()
seeds.seed = seed
seeds.update_seed()
trash = seeds
else
trash = null
/obj/item/weapon/reagent_containers/food/snacks/grown/proc/update_desc()
if(!seed)
+1 -1
View File
@@ -13,7 +13,7 @@
spawn(75)
if(!host.ckey && !host.client)
host.death() // This seems redundant, but a lot of mobs don't
host.stat = 2 // handle death() properly. Better safe than etc.
host.stat = DEAD // handle death() properly. Better safe than etc.
host.visible_message("<span class='danger'>[host] is malformed and unable to survive. It expires pitifully, leaving behind some seeds.</span>")
var/total_yield = rand(1,3)
@@ -1,7 +1,7 @@
#define DEFAULT_SEED "glowshroom"
#define VINE_GROWTH_STAGES 5
/proc/spacevine_infestation()
/proc/spacevine_infestation(var/potency_min=70, var/potency_max=100, var/maturation_min=5, var/maturation_max=15)
spawn() //to stop the secrets panel hanging
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
for(var/areapath in typesof(/area/hallway))
@@ -14,8 +14,15 @@
var/turf/simulated/floor/T = pick(turfs)
var/datum/seed/seed = plant_controller.create_random_seed(1)
seed.set_trait(TRAIT_SPREAD,2) // So it will function properly as vines.
seed.set_trait(TRAIT_POTENCY,rand(70,100)) // Guarantee a wide spread and powerful effects.
new /obj/effect/plant(T,seed)
seed.set_trait(TRAIT_POTENCY,rand(potency_min, potency_max)) // 70-100 potency will help guarantee a wide spread and powerful effects.
seed.set_trait(TRAIT_MATURATION,rand(maturation_min, maturation_max))
//make vine zero start off fully matured
var/obj/effect/plant/vine = new(T,seed)
vine.health = vine.max_health
vine.mature_time = 0
vine.process()
message_admins("<span class='notice'>Event: Spacevines spawned at [T.loc] ([T.x],[T.y],[T.z])</span>")
/obj/effect/dead_plant
@@ -56,6 +63,7 @@
var/spread_chance = 40
var/spread_distance = 3
var/evolve_chance = 2
var/mature_time
var/last_tick = 0
var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/plant
@@ -114,7 +122,8 @@
if(max_growth > 2 && prob(50))
max_growth-- //Ensure some variation in final sprite, makes the carpet of crap look less wonky.
spread_chance = seed.get_trait(TRAIT_POTENCY) * 4
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))
update_icon()
@@ -180,7 +189,8 @@
if(growth>2 && growth == max_growth)
layer = 5
opacity = 1
if(seed.get_trait(TRAIT_SPREAD) == 2)
opacity = 1
if(!isnull(seed.chems["woodpulp"]))
density = 1
else
@@ -257,4 +267,4 @@
die_off()
/obj/effect/plant/proc/is_mature()
return (health >= (max_health/3))
return (health >= (max_health/3) && world.time > mature_time)
@@ -72,7 +72,10 @@
update_neighbors()
if(is_mature() && neighbors.len && prob(spread_chance))
for(var/i=1,i<=seed.get_trait(TRAIT_YIELD),i++)
//spread to 1-3 adjacent turfs depending on yield trait.
var/max_spread = between(1, round(seed.get_trait(TRAIT_YIELD)*3/14), 3)
for(var/i in 1 to max_spread)
if(prob(spread_chance))
sleep(rand(3,5))
if(!neighbors.len)
@@ -7,8 +7,11 @@
if(!istype(M))
return
if(!buckled_mob && !M.buckled && !M.anchored && (M.small || prob(round(seed.get_trait(TRAIT_POTENCY)/2))))
entangle(M)
if(!buckled_mob && !M.buckled && !M.anchored && (M.small || 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.
spawn(1)
entangle(M)
/obj/effect/plant/attack_hand(mob/user as mob)
// Todo, cause damage.
@@ -60,13 +63,11 @@
if(buckled_mob)
return
if(!Adjacent(victim))
if(victim.buckled)
return
victim.buckled = src
victim.update_canmove()
buckled_mob = victim
if(!victim.anchored && !victim.buckled && victim.loc != get_turf(src))
//grabbing people
if(!victim.anchored && Adjacent(victim) && victim.loc != get_turf(src))
var/can_grab = 1
if(istype(victim, /mob/living/carbon/human))
var/mob/living/carbon/human/H = victim
@@ -75,4 +76,10 @@
if(can_grab)
src.visible_message("<span class='danger'>Tendrils lash out from \the [src] and drag \the [victim] in!</span>")
victim.loc = src.loc
victim << "<span class='danger'>Tendrils [pick("wind", "tangle", "tighten")] around you!</span>"
//entangling people
if(victim.loc == src.loc)
victim.buckled = src
victim.update_canmove()
buckled_mob = victim
victim << "<span class='danger'>Tendrils [pick("wind", "tangle", "tighten")] around you!</span>"
+18
View File
@@ -830,3 +830,21 @@
closed_system = !closed_system
user << "You [closed_system ? "close" : "open"] the tray's lid."
update_icon()
/obj/machinery/portable_atmospherics/hydroponics/verb/eject_tank_verb()
set name = "Eject Internal Tank"
set category = "Object"
set src in view(1)
eject_tank(usr)
/obj/machinery/portable_atmospherics/hydroponics/proc/eject_tank(var/mob/living/user)
if(!user || user.stat || user.restrained())
return
if(!holding)
usr << "\red There is no tank loaded into the [src] to eject."
if(istype(holding, /obj/item/weapon/tank))
usr << "\blue You eject the [holding.name] from the [src]."
holding.loc = loc
holding = null
@@ -9,6 +9,8 @@
/obj/machinery/portable_atmospherics/hydroponics/soil/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(istype(O,/obj/item/weapon/tank))
return
else if(istype(O,/obj/item/weapon/crowbar))
return
else
..()
@@ -17,6 +19,7 @@
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/close_lid_verb
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/remove_label
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/setlight
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/eject_tank_verb
/obj/machinery/portable_atmospherics/hydroponics/soil/CanPass()
return 1
+61 -1
View File
@@ -301,6 +301,7 @@
throw_speed = 2
throw_range = 3
w_class = 4.0
var/extend = 1
flags = NOSHIELD
slot_flags = SLOT_BACK
origin_tech = "materials=2;combat=2"
@@ -309,12 +310,71 @@
/obj/item/weapon/scythe/afterattack(atom/A, mob/user as mob, proximity)
if(!proximity) return
if(istype(A, /obj/effect/plant))
if(istype(A, /obj/effect/plant) && extend == 1)
for(var/obj/effect/plant/B in orange(A,1))
if(prob(80))
B.die_off(1)
qdel(A)
/obj/item/weapon/scythe/tele
icon_state = "tscythe0"
name = "telescopic scythe"
desc = "A sharp and curved blade on a collapsable fibremetal handle, this tool is the pinnacle of covert reaping technology."
force = 3.0
sharp = 0
edge = 0
throw_speed = 2
throw_range = 3
w_class = 2.0
extend = 0
flags = NOSHIELD
slot_flags = SLOT_BELT
origin_tech = "materials=3;combat=3"
attack_verb = list("chopped", "sliced", "cut", "reaped")
hitsound = "swing_hit"
/obj/item/weapon/scythe/tele/attack_self(mob/user as mob)
extend = !extend
if(extend)
user << "<span class ='warning'>With a flick of the wrist, you extend the scythe. It's reaping time!</span>"
icon_state = "tscythe1"
item_state = "scythe0"
slot_flags &= ~SLOT_BELT
w_class = 4 //doesnt fit in backpack when its on for balance
force = 13 //normal scythe damage
attack_verb = list("chopped", "sliced", "cut", "reaped")
hitsound = 'sound/weapons/bladeslice.ogg'
//Extend sound (blade unsheath)
playsound(src.loc, 'sound/weapons/blade_unsheath.ogg', 50, 1) //Sound credit to Qat of Freesound.org
else
user << "<span class ='notice'>You collapse the scythe, folding it for easy storage.</span>"
icon_state = "tscythe0"
item_state = "tscythe0" //no sprite in other words
slot_flags |= SLOT_BELT
w_class = 2
force = 3 //not so robust now
attack_verb = list("hit", "poked")
hitsound = "swing_hit"
//Collapse sound (blade sheath)
playsound(src.loc, 'sound/weapons/blade_sheath.ogg', 50, 1) //Sound credit to Q.K. of Freesound.org
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
H.update_inv_l_hand()
H.update_inv_r_hand()
add_fingerprint(user)
if (!blood_DNA) return
if(blood_overlay && (blood_DNA.len >= 1)) //updates blood overlay, if any
overlays.Cut()//this might delete other item overlays as well but eeeeeeeh
var/icon/I = new /icon(src.icon, src.icon_state)
I.Blend(new /icon('icons/effects/blood.dmi', rgb(255,255,255)),ICON_ADD)
I.Blend(new /icon('icons/effects/blood.dmi', "itemblood"),ICON_MULTIPLY)
blood_overlay = I
overlays += blood_overlay
return
/obj/item/weapon/rsp
name = "\improper Rapid-Seed-Producer (RSP)"
desc = "A device used to rapidly deploy seeds."