mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-21 07:32:35 +00:00
Merge branch 'dev' of https://github.com/Baystation12/Baystation12 into dev
Conflicts: .travis.yml code/controllers/configuration.dm code/game/gamemodes/changeling/modularchangling.dm code/game/jobs/job/medical.dm code/game/jobs/job/security.dm code/game/machinery/Sleeper.dm code/game/machinery/computer/communications.dm code/game/machinery/cryopod.dm code/game/objects/items/weapons/RCD.dm code/game/objects/items/weapons/storage/boxes.dm code/game/turfs/simulated/floor.dm code/game/turfs/simulated/floor_types.dm code/global.dm code/modules/materials/materials.dm code/modules/mob/living/silicon/ai/ai.dm code/modules/projectiles/guns/projectile/automatic.dm polaris.dme
This commit is contained in:
274
code/modules/hydroponics/beekeeping/beehive.dm
Normal file
274
code/modules/hydroponics/beekeeping/beehive.dm
Normal file
@@ -0,0 +1,274 @@
|
||||
/obj/machinery/beehive
|
||||
name = "beehive"
|
||||
icon = 'icons/obj/beekeeping.dmi'
|
||||
icon_state = "beehive"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
var/closed = 0
|
||||
var/bee_count = 0 // Percent
|
||||
var/smoked = 0 // Timer
|
||||
var/honeycombs = 0 // Percent
|
||||
var/frames = 0
|
||||
var/maxFrames = 5
|
||||
|
||||
/obj/machinery/beehive/update_icon()
|
||||
overlays.Cut()
|
||||
icon_state = "beehive"
|
||||
if(closed)
|
||||
overlays += "lid"
|
||||
if(frames)
|
||||
overlays += "empty[frames]"
|
||||
if(honeycombs >= 100)
|
||||
overlays += "full[round(honeycombs / 100)]"
|
||||
if(!smoked)
|
||||
switch(bee_count)
|
||||
if(1 to 40)
|
||||
overlays += "bees1"
|
||||
if(41 to 80)
|
||||
overlays += "bees2"
|
||||
if(81 to 100)
|
||||
overlays += "bees3"
|
||||
|
||||
/obj/machinery/beehive/examine(var/mob/user)
|
||||
..()
|
||||
if(!closed)
|
||||
user << "The lid is open."
|
||||
|
||||
/obj/machinery/beehive/attackby(var/obj/item/I, var/mob/user)
|
||||
if(istype(I, /obj/item/weapon/crowbar))
|
||||
closed = !closed
|
||||
user.visible_message("<span class='notice'>[user] [closed ? "closes" : "opens"] \the [src].</span>", "<span class='notice'>You [closed ? "close" : "open"] \the [src].</span>")
|
||||
update_icon()
|
||||
return
|
||||
else if(istype(I, /obj/item/weapon/wrench))
|
||||
anchored = !anchored
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "wrenches" : "unwrenches"] \the [src].</span>", "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
|
||||
return
|
||||
else if(istype(I, /obj/item/bee_smoker))
|
||||
if(closed)
|
||||
user << "<span class='notice'>You need to open \the [src] with a crowbar before smoking the bees.</span>"
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] smokes the bees in \the [src].</span>", "<span class='notice'>You smoke the bees in \the [src].</span>")
|
||||
smoked = 30
|
||||
update_icon()
|
||||
return
|
||||
else if(istype(I, /obj/item/honey_frame))
|
||||
if(closed)
|
||||
user << "<span class='notice'>You need to open \the [src] with a crowbar before inserting \the [I].</span>"
|
||||
return
|
||||
if(frames >= maxFrames)
|
||||
user << "<span class='notice'>There is no place for an another frame.</span>"
|
||||
return
|
||||
var/obj/item/honey_frame/H = I
|
||||
if(H.honey)
|
||||
user << "<span class='notice'>\The [I] is full with beeswax and honey, empty it in the extractor first.</span>"
|
||||
return
|
||||
++frames
|
||||
user.visible_message("<span class='notice'>[user] loads \the [I] into \the [src].</span>", "<span class='notice'>You load \the [I] into \the [src].</span>")
|
||||
update_icon()
|
||||
user.drop_from_inventory(I)
|
||||
qdel(I)
|
||||
return
|
||||
else if(istype(I, /obj/item/bee_pack))
|
||||
var/obj/item/bee_pack/B = I
|
||||
if(B.full && bee_count)
|
||||
user << "<span class='notice'>\The [src] already has bees inside.</span>"
|
||||
return
|
||||
if(!B.full && bee_count < 90)
|
||||
user << "<span class='notice'>\The [src] is not ready to split.</span>"
|
||||
return
|
||||
if(!B.full && !smoked)
|
||||
user << "<span class='notice'>Smoke \the [src] first!</span>"
|
||||
return
|
||||
if(closed)
|
||||
user << "<span class='notice'>You need to open \the [src] with a crowbar before moving the bees.</span>"
|
||||
return
|
||||
if(B.full)
|
||||
user.visible_message("<span class='notice'>[user] puts the queen and the bees from \the [I] into \the [src].</span>", "<span class='notice'>You put the queen and the bees from \the [I] into \the [src].</span>")
|
||||
bee_count = 20
|
||||
B.empty()
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] puts bees and larvae from \the [src] into \the [I].</span>", "<span class='notice'>You put puts bees and larvae from \the [src] into \the [I].</span>")
|
||||
bee_count /= 2
|
||||
B.fill()
|
||||
update_icon()
|
||||
return
|
||||
else if(istype(I, /obj/item/device/analyzer/plant_analyzer))
|
||||
user << "<span class='notice'>Scan result of \the [src]...</span>"
|
||||
user << "Beehive is [bee_count ? "[round(bee_count)]% full" : "empty"].[bee_count > 90 ? " Colony is ready to split." : ""]"
|
||||
if(frames)
|
||||
user << "[frames] frames installed, [round(honeycombs / 100)] filled."
|
||||
if(honeycombs < frames * 100)
|
||||
user << "Next frame is [round(honeycombs % 100)]% full."
|
||||
else
|
||||
user << "No frames installed."
|
||||
if(smoked)
|
||||
user << "The hive is smoked."
|
||||
return 1
|
||||
else if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(bee_count)
|
||||
user << "<span class='notice'>You can't dismantle \the [src] with these bees inside.</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start dismantling \the [src]...</span>"
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 30))
|
||||
user.visible_message("<span class='notice'>[user] dismantles \the [src].</span>", "<span class='notice'>You dismantle \the [src].</span>")
|
||||
new /obj/item/beehive_assembly(loc)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/machinery/beehive/attack_hand(var/mob/user)
|
||||
if(!closed)
|
||||
if(honeycombs < 100)
|
||||
user << "<span class='notice'>There are no filled honeycombs.</span>"
|
||||
return
|
||||
if(!smoked && bee_count)
|
||||
user << "<span class='notice'>The bees won't let you take the honeycombs out like this, smoke them first.</span>"
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] starts taking the honeycombs out of \the [src].</span>", "<span class='notice'>You start taking the honeycombs out of \the [src]...</span>")
|
||||
while(honeycombs >= 100 && do_after(user, 30))
|
||||
new /obj/item/honey_frame/filled(loc)
|
||||
honeycombs -= 100
|
||||
--frames
|
||||
update_icon()
|
||||
if(honeycombs < 100)
|
||||
user << "<span class='notice'>You take all filled honeycombs out.</span>"
|
||||
return
|
||||
|
||||
/obj/machinery/beehive/process()
|
||||
if(closed && !smoked && bee_count)
|
||||
pollinate_flowers()
|
||||
update_icon()
|
||||
smoked = max(0, smoked - 1)
|
||||
if(!smoked && bee_count)
|
||||
bee_count = min(bee_count * 1.005, 100)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/beehive/proc/pollinate_flowers()
|
||||
var/coef = bee_count / 100
|
||||
var/trays = 0
|
||||
for(var/obj/machinery/portable_atmospherics/hydroponics/H in view(7, src))
|
||||
if(H.seed && !H.dead)
|
||||
H.health += 0.05 * coef
|
||||
++trays
|
||||
honeycombs = min(honeycombs + 0.1 * coef * min(trays, 5), frames * 100)
|
||||
|
||||
/obj/machinery/honey_extractor
|
||||
name = "honey extractor"
|
||||
desc = "A machine used to turn honeycombs on the frame into honey and wax."
|
||||
icon = 'icons/obj/virology.dmi'
|
||||
icon_state = "centrifuge"
|
||||
|
||||
var/processing = 0
|
||||
var/honey = 0
|
||||
|
||||
/obj/machinery/honey_extractor/attackby(var/obj/item/I, var/mob/user)
|
||||
if(processing)
|
||||
user << "<span class='notice'>\The [src] is currently spinning, wait until it's finished.</span>"
|
||||
return
|
||||
else if(istype(I, /obj/item/honey_frame))
|
||||
var/obj/item/honey_frame/H = I
|
||||
if(!H.honey)
|
||||
user << "<span class='notice'>\The [H] is empty, put it into a beehive.</span>"
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] loads \the [H] into \the [src] and turns it on.</span>", "<span class='notice'>You load \the [H] into \the [src] and turn it on.</span>")
|
||||
processing = H.honey
|
||||
icon_state = "centrifuge_moving"
|
||||
qdel(H)
|
||||
spawn(50)
|
||||
new /obj/item/honey_frame(loc)
|
||||
new /obj/item/stack/wax(loc)
|
||||
honey += processing
|
||||
processing = 0
|
||||
icon_state = "centrifuge"
|
||||
else if(istype(I, /obj/item/weapon/reagent_containers/glass))
|
||||
if(!honey)
|
||||
user << "<span class='notice'>There is no honey in \the [src].</span>"
|
||||
return
|
||||
var/obj/item/weapon/reagent_containers/glass/G = I
|
||||
var/transferred = min(G.reagents.maximum_volume - G.reagents.total_volume, honey)
|
||||
G.reagents.add_reagent("honey", transferred)
|
||||
honey -= transferred
|
||||
user.visible_message("<span class='notice'>[user] collects honey from \the [src] into \the [G].</span>", "<span class='notice'>You collect [transferred] units of honey from \the [src] into \the [G].</span>")
|
||||
return 1
|
||||
|
||||
/obj/item/bee_smoker
|
||||
name = "bee smoker"
|
||||
desc = "A device used to calm down bees before harvesting honey."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "battererburnt"
|
||||
w_class = 2
|
||||
|
||||
/obj/item/honey_frame
|
||||
name = "beehive frame"
|
||||
desc = "A frame for the beehive that the bees will fill with honeycombs."
|
||||
icon = 'icons/obj/beekeeping.dmi'
|
||||
icon_state = "honeyframe"
|
||||
w_class = 2
|
||||
|
||||
var/honey = 0
|
||||
|
||||
/obj/item/honey_frame/filled
|
||||
name = "filled beehive frame"
|
||||
desc = "A frame for the beehive that the bees have filled with honeycombs."
|
||||
honey = 20
|
||||
|
||||
/obj/item/honey_frame/filled/New()
|
||||
..()
|
||||
overlays += "honeycomb"
|
||||
|
||||
/obj/item/beehive_assembly
|
||||
name = "beehive assembly"
|
||||
desc = "Contains everything you need to build a beehive."
|
||||
icon = 'icons/obj/apiary_bees_etc.dmi'
|
||||
icon_state = "apiary"
|
||||
|
||||
/obj/item/beehive_assembly/attack_self(var/mob/user)
|
||||
user << "<span class='notice'>You start assembling \the [src]...</span>"
|
||||
if(do_after(user, 30))
|
||||
user.visible_message("<span class='notice'>[user] constructs a beehive.</span>", "<span class='notice'>You construct a beehive.</span>")
|
||||
new /obj/machinery/beehive(get_turf(user))
|
||||
user.drop_from_inventory(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/item/stack/wax
|
||||
name = "wax"
|
||||
singular_name = "wax piece"
|
||||
desc = "Soft substance produced by bees. Used to make candles."
|
||||
icon = 'icons/obj/beekeeping.dmi'
|
||||
icon_state = "wax"
|
||||
|
||||
/obj/item/stack/wax/New()
|
||||
..()
|
||||
recipes = wax_recipes
|
||||
|
||||
var/global/list/datum/stack_recipe/wax_recipes = list( \
|
||||
new/datum/stack_recipe("candle", /obj/item/weapon/flame/candle) \
|
||||
)
|
||||
|
||||
/obj/item/bee_pack
|
||||
name = "bee pack"
|
||||
desc = "Contains a queen bee and some worker bees. Everything you'll need to start a hive!"
|
||||
icon = 'icons/obj/beekeeping.dmi'
|
||||
icon_state = "beepack"
|
||||
var/full = 1
|
||||
|
||||
/obj/item/bee_pack/New()
|
||||
..()
|
||||
overlays += "beepack-full"
|
||||
|
||||
/obj/item/bee_pack/proc/empty()
|
||||
full = 0
|
||||
name = "empty bee pack"
|
||||
desc = "A stasis pack for moving bees. It's empty."
|
||||
overlays.Cut()
|
||||
overlays += "beepack-empty"
|
||||
|
||||
/obj/item/bee_pack/proc/fill()
|
||||
full = initial(full)
|
||||
name = initial(name)
|
||||
desc = initial(desc)
|
||||
overlays.Cut()
|
||||
overlays += "beepack-full"
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.shoes && H.shoes.flags & NOSLIP)
|
||||
if(H.shoes && H.shoes.item_flags & NOSLIP)
|
||||
return
|
||||
|
||||
M.stop_pulling()
|
||||
|
||||
@@ -688,10 +688,11 @@
|
||||
else
|
||||
product = new /obj/item/weapon/reagent_containers/food/snacks/grown(get_turf(user),name)
|
||||
if(get_trait(TRAIT_PRODUCT_COLOUR))
|
||||
product.color = get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
if(istype(product,/obj/item/weapon/reagent_containers/food))
|
||||
var/obj/item/weapon/reagent_containers/food/food = product
|
||||
food.filling_color = get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
if(!istype(product, /mob))
|
||||
product.color = get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
if(istype(product,/obj/item/weapon/reagent_containers/food))
|
||||
var/obj/item/weapon/reagent_containers/food/food = product
|
||||
food.filling_color = get_trait(TRAIT_PRODUCT_COLOUR)
|
||||
|
||||
if(mysterious)
|
||||
product.name += "?"
|
||||
|
||||
@@ -234,6 +234,7 @@
|
||||
|
||||
/obj/effect/plant/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
plant_controller.add_plant(src)
|
||||
|
||||
if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/scalpel))
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
var/can_grab = 1
|
||||
if(istype(victim, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = victim
|
||||
if(istype(H.shoes, /obj/item/clothing/shoes/magboots) && (H.shoes.flags & NOSLIP))
|
||||
if(istype(H.shoes, /obj/item/clothing/shoes/magboots) && (H.shoes.item_flags & NOSLIP))
|
||||
can_grab = 0
|
||||
if(can_grab)
|
||||
src.visible_message("<span class='danger'>Tendrils lash out from \the [src] and drag \the [victim] in!</span>")
|
||||
|
||||
@@ -532,20 +532,8 @@
|
||||
anchored = !anchored
|
||||
user << "You [anchored ? "wrench" : "unwrench"] \the [src]."
|
||||
|
||||
else if(istype(O, /obj/item/apiary))
|
||||
|
||||
if(seed)
|
||||
user << "<span class='danger'>[src] is already occupied!</span>"
|
||||
else
|
||||
user.drop_item()
|
||||
qdel(O)
|
||||
|
||||
var/obj/machinery/apiary/A = new(src.loc)
|
||||
A.icon = src.icon
|
||||
A.icon_state = src.icon_state
|
||||
A.hydrotray_type = src.type
|
||||
qdel(src)
|
||||
else if(O.force && seed)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
user.visible_message("<span class='danger'>\The [seed.display_name] has been attacked by [user] with \the [O]!</span>")
|
||||
if(!dead)
|
||||
health -= O.force
|
||||
|
||||
@@ -1,240 +0,0 @@
|
||||
//http://www.youtube.com/watch?v=-1GadTfGFvU
|
||||
//i could have done these as just an ordinary plant, but fuck it - there would have been too much snowflake code
|
||||
|
||||
/obj/machinery/apiary
|
||||
name = "apiary tray"
|
||||
icon = 'icons/obj/hydroponics_machines.dmi'
|
||||
icon_state = "hydrotray3"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/nutrilevel = 0
|
||||
var/yieldmod = 1
|
||||
var/mut = 1
|
||||
var/toxic = 0
|
||||
var/dead = 0
|
||||
var/health = -1
|
||||
var/maxhealth = 100
|
||||
var/lastcycle = 0
|
||||
var/cycledelay = 100
|
||||
var/harvestable_honey = 0
|
||||
var/beezeez = 0
|
||||
var/swarming = 0
|
||||
|
||||
var/bees_in_hive = 0
|
||||
var/list/owned_bee_swarms = list()
|
||||
var/hydrotray_type = /obj/machinery/portable_atmospherics/hydroponics
|
||||
|
||||
//overwrite this after it's created if the apiary needs a custom machinery sprite
|
||||
/obj/machinery/apiary/New()
|
||||
..()
|
||||
overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="apiary")
|
||||
|
||||
/obj/machinery/apiary/bullet_act(var/obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
|
||||
if(istype(Proj ,/obj/item/projectile/energy/floramut))
|
||||
mut++
|
||||
else if(istype(Proj ,/obj/item/projectile/energy/florayield))
|
||||
if(!yieldmod)
|
||||
yieldmod += 1
|
||||
//world << "Yield increased by 1, from 0, to a total of [myseed.yield]"
|
||||
else if (prob(1/(yieldmod * yieldmod) *100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
|
||||
yieldmod += 1
|
||||
//world << "Yield increased by 1, to a total of [myseed.yield]"
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/apiary/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O, /obj/item/queen_bee))
|
||||
if(health > 0)
|
||||
user << "\red There is already a queen in there."
|
||||
else
|
||||
health = 10
|
||||
nutrilevel += 10
|
||||
user.drop_item()
|
||||
qdel(O)
|
||||
user << "\blue You carefully insert the queen into [src], she gets busy making a hive."
|
||||
bees_in_hive = 0
|
||||
else if(istype(O, /obj/item/beezeez))
|
||||
beezeez += 100
|
||||
nutrilevel += 10
|
||||
user.drop_item()
|
||||
if(health > 0)
|
||||
user << "\blue You insert [O] into [src]. A relaxed humming appears to pick up."
|
||||
else
|
||||
user << "\blue You insert [O] into [src]. Now it just needs some bees."
|
||||
qdel(O)
|
||||
else if(istype(O, /obj/item/weapon/material/minihoe))
|
||||
if(health > 0)
|
||||
user << "\red <b>You begin to dislodge the apiary from the tray, the bees don't like that.</b>"
|
||||
angry_swarm(user)
|
||||
else
|
||||
user << "\blue You begin to dislodge the dead apiary from the tray."
|
||||
if(do_after(user, 50))
|
||||
new hydrotray_type(src.loc)
|
||||
new /obj/item/apiary(src.loc)
|
||||
user << "\red You dislodge the apiary from the tray."
|
||||
qdel(src)
|
||||
else if(istype(O, /obj/item/weapon/bee_net))
|
||||
var/obj/item/weapon/bee_net/N = O
|
||||
if(N.caught_bees > 0)
|
||||
user << "\blue You empty the bees into the apiary."
|
||||
bees_in_hive += N.caught_bees
|
||||
N.caught_bees = 0
|
||||
else
|
||||
user << "\blue There are no more bees in the net."
|
||||
else if(istype(O, /obj/item/weapon/reagent_containers/glass))
|
||||
var/obj/item/weapon/reagent_containers/glass/G = O
|
||||
if(harvestable_honey > 0)
|
||||
if(health > 0)
|
||||
user << "\red You begin to harvest the honey. The bees don't seem to like it."
|
||||
angry_swarm(user)
|
||||
else
|
||||
user << "\blue You begin to harvest the honey."
|
||||
if(do_after(user,50))
|
||||
G.reagents.add_reagent("honey",harvestable_honey)
|
||||
harvestable_honey = 0
|
||||
user << "\blue You successfully harvest the honey."
|
||||
else
|
||||
user << "\blue There is no honey left to harvest."
|
||||
else
|
||||
angry_swarm(user)
|
||||
..()
|
||||
|
||||
/obj/machinery/apiary/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(air_group || (height==0)) return 1
|
||||
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/apiary/process()
|
||||
|
||||
if(swarming > 0)
|
||||
swarming -= 1
|
||||
if(swarming <= 0)
|
||||
for(var/mob/living/simple_animal/bee/B in src.loc)
|
||||
bees_in_hive += B.strength
|
||||
qdel(B)
|
||||
else if(bees_in_hive < 10)
|
||||
for(var/mob/living/simple_animal/bee/B in src.loc)
|
||||
bees_in_hive += B.strength
|
||||
qdel(B)
|
||||
|
||||
if(world.time > (lastcycle + cycledelay))
|
||||
lastcycle = world.time
|
||||
if(health < 0)
|
||||
return
|
||||
|
||||
//magical bee formula
|
||||
if(beezeez > 0)
|
||||
beezeez -= 1
|
||||
|
||||
nutrilevel += 2
|
||||
health += 1
|
||||
toxic = max(0, toxic - 1)
|
||||
|
||||
//handle nutrients
|
||||
nutrilevel -= bees_in_hive / 10 + owned_bee_swarms.len / 5
|
||||
if(nutrilevel > 0)
|
||||
bees_in_hive += 1 * yieldmod
|
||||
if(health < maxhealth)
|
||||
health++
|
||||
else
|
||||
//nutrilevel is less than 1, so we're effectively subtracting here
|
||||
health += max(nutrilevel - 1, round(-health / 2))
|
||||
bees_in_hive += max(nutrilevel - 1, round(-bees_in_hive / 2))
|
||||
if(owned_bee_swarms.len)
|
||||
var/mob/living/simple_animal/bee/B = pick(owned_bee_swarms)
|
||||
B.target_turf = get_turf(src)
|
||||
|
||||
//clear out some toxins
|
||||
if(toxic > 0)
|
||||
toxic -= 1
|
||||
health -= 1
|
||||
|
||||
if(health <= 0)
|
||||
return
|
||||
|
||||
//make a bit of honey
|
||||
if(harvestable_honey < 50)
|
||||
harvestable_honey += 0.5
|
||||
|
||||
//make some new bees
|
||||
if(bees_in_hive >= 10 && prob(bees_in_hive * 10))
|
||||
var/mob/living/simple_animal/bee/B = new(get_turf(src), src)
|
||||
owned_bee_swarms.Add(B)
|
||||
B.mut = mut
|
||||
B.toxic = toxic
|
||||
bees_in_hive -= 1
|
||||
|
||||
//find some plants, harvest
|
||||
for(var/obj/machinery/portable_atmospherics/hydroponics/H in view(7, src))
|
||||
if(H.seed && !H.dead && prob(owned_bee_swarms.len * 10))
|
||||
src.nutrilevel++
|
||||
H.nutrilevel++
|
||||
if(mut < H.mutation_mod - 1)
|
||||
mut = H.mutation_mod - 1
|
||||
else if(mut > H.mutation_mod - 1)
|
||||
H.mutation_mod = mut
|
||||
|
||||
//flowers give us pollen (nutrients)
|
||||
/* - All plants should be giving nutrients to the hive.
|
||||
if(H.myseed.type == /obj/item/seeds/harebell || H.myseed.type == /obj/item/seeds/sunflowerseed)
|
||||
src.nutrilevel++
|
||||
H.nutrilevel++
|
||||
*/
|
||||
//have a few beneficial effects on nearby plants
|
||||
if(prob(10))
|
||||
H.lastcycle -= 5
|
||||
if(prob(10))
|
||||
H.seed.set_trait(TRAIT_ENDURANCE,max(H.seed.get_trait(TRAIT_ENDURANCE)*1.5,H.seed.get_trait(TRAIT_ENDURANCE)+1))
|
||||
if(H.toxins && prob(10))
|
||||
H.toxins = min(0, H.toxins - 1)
|
||||
toxic++
|
||||
|
||||
/obj/machinery/apiary/proc/die()
|
||||
if(owned_bee_swarms.len)
|
||||
var/mob/living/simple_animal/bee/B = pick(owned_bee_swarms)
|
||||
B.target_turf = get_turf(src)
|
||||
B.strength -= 1
|
||||
if(B.strength <= 0)
|
||||
qdel(B)
|
||||
else if(B.strength <= 5)
|
||||
B.icon_state = "bees[B.strength]"
|
||||
bees_in_hive = 0
|
||||
health = 0
|
||||
|
||||
/obj/machinery/apiary/proc/angry_swarm(var/mob/M)
|
||||
for(var/mob/living/simple_animal/bee/B in owned_bee_swarms)
|
||||
B.feral = 25
|
||||
B.target_mob = M
|
||||
|
||||
swarming = 25
|
||||
|
||||
while(bees_in_hive > 0)
|
||||
var/spawn_strength = bees_in_hive
|
||||
if(bees_in_hive >= 5)
|
||||
spawn_strength = 6
|
||||
|
||||
var/mob/living/simple_animal/bee/B = new(get_turf(src), src)
|
||||
B.target_mob = M
|
||||
B.strength = spawn_strength
|
||||
B.feral = 25
|
||||
B.mut = mut
|
||||
B.toxic = toxic
|
||||
bees_in_hive -= spawn_strength
|
||||
|
||||
/obj/machinery/apiary/verb/harvest_honeycomb()
|
||||
set src in oview(1)
|
||||
set name = "Harvest honeycomb"
|
||||
set category = "Object"
|
||||
|
||||
while(health > 15)
|
||||
health -= 15
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/honeycomb/H = new(src.loc)
|
||||
if(toxic > 0)
|
||||
H.reagents.add_reagent("toxin", toxic)
|
||||
|
||||
usr << "\blue You harvest the honeycomb from the hive. There is a wild buzzing!"
|
||||
angry_swarm(usr)
|
||||
Reference in New Issue
Block a user