Reagent Bees! Bees come from a beebox and pollinate nearby hydroponics plants, improving the health/yield/removing pests from the plants. While pollinating they build up resources to build honeycomb, honeycomb contains honey (a mild healing reagent that is very nutritious) any spare resources (50 bee_resources) are converted into new bees. honeycombs can be ground up to get the honey and other reagent inside them in an All In One Grinder.

Beeboxes have honey_frames which determine the amount of honeycomb+bees they can maintain.
Bees now have a beegent (Bee reagent, geddit?) that they use during their attacks AND that their produced honeycomb contains, this allows you to farm chemicals using bees.
This commit is contained in:
Remie Richards
2016-03-21 04:51:16 +00:00
parent d7f81ba433
commit be0b16a6aa
19 changed files with 566 additions and 21 deletions
+21
View File
@@ -919,6 +919,27 @@
/obj/item/seeds/eggplant/eggy)
crate_name = "exotic seeds crate"
/datum/supply_pack/organic/hydroponics/beekeeping_fullkit
name = "Beekeeping Starter Kit"
cost = 40
contains = list(/obj/structure/beebox,
/obj/item/honey_frame,
/obj/item/honey_frame,
/obj/item/honey_frame,
/obj/item/queen_bee/bought,
/obj/item/clothing/head/beekeeper_head,
/obj/item/clothing/suit/beekeeper_suit)
crate_name = "beekeeping starter kit"
/datum/supply_pack/organic/hydroponics/beekeeping_suits
name = "2 Beekeeper suits"
cost = 10
contains = list(/obj/item/clothing/head/beekeeper_head,
/obj/item/clothing/suit/beekeeper_suit,
/obj/item/clothing/head/beekeeper_head,
/obj/item/clothing/suit/beekeeper_suit)
crate_name = "beekeper suits"
/datum/supply_pack/organic/vending
name = "Bartending Supply Crate"
cost = 20
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

@@ -0,0 +1,235 @@
#define BEEBOX_MAX_FRAMES 3 //Max frames per box
#define BEES_RATIO 0.5 //Multiplied by the max number of honeycombs to find the max number of bees
#define BEE_PROB_NEW_BEE 20 //The chance for spare bee_resources to be turned into new bees
#define BEE_RESOURCE_HONEYCOMB_COST 100 //The amount of bee_resources for a new honeycomb to be produced, percentage cost 1-100
#define BEE_RESOURCE_NEW_BEE_COST 50 //The amount of bee_resources for a new bee to be produced, percentage cost 1-100
/mob/proc/bee_friendly()
return 0
/mob/living/simple_animal/hostile/poison/bees/bee_friendly()
return 1
/mob/living/carbon/human/bee_friendly()
if((wear_suit && (wear_suit.flags & THICKMATERIAL)) && (head && (head.flags & THICKMATERIAL)))
return 1
return 0
/obj/structure/beebox
name = "apiary"
desc = "Dr Miles Manners is just your average Wasp themed super hero by day, but by night he becomes DR BEES!"
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "beebox"
anchored = 1
density = 1
var/mob/living/simple_animal/hostile/poison/bees/queen/queen_bee = null
var/list/bees = list() //bees owned by the box, not those inside it
var/list/honeycombs = list()
var/list/honey_frames = list()
var/bee_resources = 0
/obj/structure/beebox/New()
..()
SSobj.processing += src
/obj/structure/beebox/Destroy()
SSobj.processing -= src
bees.Cut()
bees = null
honeycombs.Cut()
honeycombs = null
queen_bee = null
return ..()
//Premade apiaries can spawn with a random reagent
/obj/structure/beebox/premade
var/random_reagent = FALSE
/obj/structure/beebox/premade/New()
..()
var/datum/reagent/R = null
if(random_reagent)
R = pick(subtypesof(/datum/reagent))
R = chemical_reagents_list[initial(R.id)]
queen_bee = new(src)
queen_bee.beehome = src
bees += queen_bee
queen_bee.assign_reagent(R)
for(var/i in 1 to BEEBOX_MAX_FRAMES)
var/obj/item/honey_frame/HF = new(src)
honey_frames += HF
for(var/i in 1 to get_max_bees())
var/mob/living/simple_animal/hostile/poison/bees/B = new(src)
bees += B
B.beehome = src
B.assign_reagent(R)
/obj/structure/beebox/premade/random
random_reagent = TRUE
/obj/structure/beebox/process()
if(queen_bee)
if(bee_resources >= BEE_RESOURCE_HONEYCOMB_COST)
if(honeycombs.len < get_max_honeycomb())
bee_resources = max(bee_resources-BEE_RESOURCE_HONEYCOMB_COST, 0)
var/obj/item/weapon/reagent_containers/honeycomb/HC = new(src)
if(queen_bee.beegent)
HC.set_reagent(queen_bee.beegent.id)
honeycombs += HC
if(bees.len < get_max_bees())
var/freebee = FALSE //a freebee, geddit?, hahaha HAHAHAHA
if(!bees.len) //there's always one set of worker bees, this isn't colony collapse disorder its 2d spessmen
freebee = TRUE
if((bee_resources >= BEE_RESOURCE_NEW_BEE_COST && prob(BEE_PROB_NEW_BEE)) || freebee)
if(!freebee)
bee_resources = max(bee_resources - BEE_RESOURCE_NEW_BEE_COST, 0)
var/mob/living/simple_animal/hostile/poison/bees/B = new(src)
B.beehome = src
B.assign_reagent(queen_bee.beegent)
bees += B
/obj/structure/beebox/proc/get_max_honeycomb()
. = 0
for(var/hf in honey_frames)
var/obj/item/honey_frame/HF = hf
. += HF.honeycomb_capacity
/obj/structure/beebox/proc/get_max_bees()
. = get_max_honeycomb() * BEES_RATIO
/obj/structure/beebox/examine(mob/user)
..()
if(!queen_bee)
user << "<span class='warning'>There is no queen bee!</span>"
if(bees.len >= get_max_bees()*0.5)
user << "This place is a BUZZ with activity..."
if(bee_resources)
user << "[bee_resources]/100 honey supply."
user << "[bee_resources]% towards a new honeycomb."
user << "[bee_resources*2]% towards a new bee."
if(honeycombs.len >= get_max_honeycomb())
user << "there's no room for more honeycomb!"
/obj/structure/beebox/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/honey_frame))
var/obj/item/honey_frame/HF = I
if(honey_frames.len < BEEBOX_MAX_FRAMES)
visible_message("<span class='notice'>[user] adds a frame to the apiary.</span>")
user.unEquip(HF)
HF.loc = src
honey_frames += HF
else
user << "<span class='warning'>There's no room for anymore frames in the apiary!</span>"
if(istype(I, /obj/item/weapon/wrench))
if(default_unfasten_wrench(user, I, time = 20))
return
if(istype(I, /obj/item/queen_bee))
var/obj/item/queen_bee/qb = I
user.unEquip(qb)
qb.queen.loc = src
bees += qb.queen
queen_bee = qb.queen
qb.queen = null
if(qb.queen)
visible_message("<span class='notice'>[user] sets [qb] down inside the apiary, making it their new home.</span>")
var/relocated = 0
for(var/b in bees)
var/mob/living/simple_animal/hostile/poison/bees/B = b
if(B.reagent_incompatible(queen_bee))
bees -= B
B.beehome = null
if(B.loc == src)
B.loc = get_turf(src)
relocated++
if(relocated)
user << "<span class='warning'>This queen has a different reagent to some of the bees who live here, those bees will not return to this apiary!</span>"
else
user << "<span class='warning'>The queen bee disappeared! bees disappearing has been in the news lately...</span>"
qdel(qb)
/obj/structure/beebox/attack_hand(mob/user)
if(istype(user, /mob/living/carbon/human))
if(!user.bee_friendly())
//Time to get stung!
var/bees = FALSE
for(var/b in bees) //everyone who's ever lived here now instantly hates you, suck it assistant!
var/mob/living/simple_animal/hostile/poison/bees/B = b
if(B.isqueen)
continue
if(B.loc == src)
B.loc = get_turf(src)
B.target = user
bees = TRUE
if(bees)
visible_message("<span class='danger'>[user] disturbs the bees!</span>")
else
var/option = alert(user, "What Action do you wish to perform?","Apiary","Remove a Honey Frame","Remove the Queen Bee")
switch(option)
if("Remove a Honey Frame")
if(!honey_frames.len)
user << "<span class='warning'>There are no honey frames to remove!</span>"
return
var/obj/item/honey_frame/HF = pick_n_take(honey_frames)
if(HF)
if(!user.put_in_active_hand(HF))
HF.loc = get_turf(src)
visible_message("<span class='notice'>[user] removes a frame from the apiary.</span>")
var/amtH = honeycombs.len
var/maxH = get_max_honeycomb()
var/fallen = 0
while(amtH > maxH) //let's pretend you always grab the frame with the most honeycomb on it
var/obj/item/weapon/reagent_containers/honeycomb/HC = pick_n_take(honeycombs)
if(HC)
honeycombs -= HC
HC.loc = get_turf(user)
amtH--
fallen++
if(fallen)
var/multiple = fallen > 1
visible_message("<span class='notice'>[user] scapes [multiple ? "[fallen]" : "a"] honeycomb[multiple ? "s" : ""] off of the frame.</span>")
if("Remove the Queen Bee")
if(!queen_bee)
user << "<span class='warning'>There is no queen bee to remove!</span>"
return
var/obj/item/queen_bee/QB = new()
queen_bee.loc = QB
QB.queen = queen_bee
QB.name = queen_bee.name
if(!user.put_in_active_hand(QB))
QB.loc = get_turf(src)
visible_message("<span class='notice'>[user] removes the queen from the apiary.</span>")
@@ -0,0 +1,16 @@
/obj/item/clothing/head/beekeeper_head
name = "beekeeper hat"
desc = "keeps the lil buzzing buggers out of your eyes"
icon_state = "beekeeper"
item_state = "beekeeper"
flags = THICKMATERIAL
/obj/item/clothing/suit/beekeeper_suit
name = "beekeeper suit"
desc = "keeps the lil buzzing buggers away from your squishy bits"
icon_state = "beekeeper"
item_state = "beekeeper"
flags = THICKMATERIAL
@@ -0,0 +1,12 @@
/obj/item/honey_frame
name = "honey frame"
desc = "a scaffold for bees to build honeycomb on"
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "honey_frame"
var/honeycomb_capacity = 10 //10 Honeycomb per frame by default, researchable frames perhaps?
/obj/item/honey_frame/New()
pixel_x = rand(8,-8)
pixel_y = rand(8,-8)
@@ -0,0 +1,41 @@
/obj/item/weapon/reagent_containers/honeycomb
name = "honeycomb"
desc = "a hexagonal mesh of honeycomb"
icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "honeycomb"
possible_transfer_amounts = null
spillable = 0
disease_amount = 0
volume = 10
amount_per_transfer_from_this = 0
list_reagents = list("honey" = 5)
var/honey_color = ""
/obj/item/weapon/reagent_containers/honeycomb/New()
..()
pixel_x = rand(8,-8)
pixel_y = rand(8,-8)
update_icon()
/obj/item/weapon/reagent_containers/honeycomb/update_icon()
overlays.Cut()
var/image/honey
if(honey_color)
honey = image(icon = 'icons/obj/hydroponics/harvest.dmi', icon_state = "greyscale_honey")
honey.color = honey_color
else
honey = image(icon = 'icons/obj/hydroponics/harvest.dmi', icon_state = "honey")
overlays += honey
/obj/item/weapon/reagent_containers/honeycomb/proc/set_reagent(reagent)
var/datum/reagent/R = chemical_reagents_list[reagent]
if(istype(R))
name = "honeycomb ([R.name])"
honey_color = R.color
reagents.add_reagent(R.id,5)
else
honey_color = ""
update_icon()
+1
View File
@@ -23,6 +23,7 @@
var/obj/item/seeds/myseed = null //The currently planted seed
var/rating = 1
var/unwrenchable = 1
var/recent_bee_visit = FALSE //Have we been visited by a bee recently, so bees dont overpolinate one plant
pixel_y=8
@@ -1,8 +1,18 @@
#define BEE_IDLE_ROAMING 70 //The value of idle at which a bee in a beebox will try to wander
#define BEE_IDLE_GOHOME 0 //The value of idle at which a bee will try to go home
#define BEE_PROB_GOHOME 35 //Probability to go home when idle is below BEE_IDLE_GOHOME
#define BEE_PROB_GOROAM 5 //Probability to go roaming when idle is above BEE_IDLE_ROAMING
#define BEE_TRAY_RECENT_VISIT 200 //How long in deciseconds until a tray can be visited by a bee again
#define BEE_DEFAULT_COLOUR "#e5e500" //the colour we make the stripes of the bee if our reagent has no colour (or we have no reagent)
/mob/living/simple_animal/hostile/poison/bees
name = "space bee swarm"
desc = ""
icon_state = "bee_1"
icon_living = "bee"
name = "bee"
desc = "buzzy buzzy bee, stingy sti- Ouch!"
icon_state = ""
icon_living = ""
icon = 'icons/mob/bees.dmi'
speak_emote = list("buzzes")
emote_hear = list("buzzes")
turns_per_move = 0
@@ -22,33 +32,223 @@
mob_size = MOB_SIZE_SMALL
flying = 1
gold_core_spawnable = 1
search_objects = 1 //have to find those plant trays!
//Spaceborn beings don't get hurt by space
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
minbodytemp = 0
del_on_death = 1
var/datum/reagent/beegent = null //hehe, beegent
var/obj/structure/beebox/beehome = null
var/idle = 0
var/isqueen = FALSE
var/icon_base = "bee"
var/static/list/bee_icons = list()
/mob/living/simple_animal/hostile/poison/bees/Process_Spacemove(movement_dir = 0)
return 1
/mob/living/simple_animal/hostile/poison/bees/New()
..()
update_bees()
generate_bee_visuals()
/mob/living/simple_animal/hostile/poison/bees/Life()
/mob/living/simple_animal/hostile/poison/bees/Destroy()
if(beehome)
beehome.bees -= src
beehome = null
beegent = null
return ..()
/mob/living/simple_animal/hostile/poison/bees/death(gibbed)
if(beehome)
beehome.bees -= src
beehome = null
beegent = null
..()
update_bees()
/mob/living/simple_animal/hostile/poison/bees/proc/update_bees()
while(overlays.len != health-1) //how many bees do we have in the swarm?
var/N = rand(1, 4)
var/image/I = image(icon='icons/mob/animal.dmi',icon_state="bee_[N]", pixel_x = rand(-8, 8), pixel_y = rand(-8, 8))
if(overlays.len < health-1)
overlays.Add(I)
if(overlays.len > health-1)
overlays.Remove(I)
poison_per_bite = health * 0.5 //each bee is half a toxin reagent
if(health > 1)
desc = "A buzzy swarm of [health] poisonous space bees, renowned for their aggressiveness"
/mob/living/simple_animal/hostile/poison/bees/proc/generate_bee_visuals()
overlays.Cut()
var/col = BEE_DEFAULT_COLOUR
if(beegent && beegent.color)
col = beegent.color
var/image/base
if(!bee_icons["[icon_base]_base"])
bee_icons["[icon_base]_base"] = image(icon = 'icons/mob/bees.dmi', icon_state = "[icon_base]_base")
base = bee_icons["[icon_base]_base"]
overlays += base
var/image/greyscale
if(!bee_icons["[icon_base]_grey_[col]"])
bee_icons["[icon_base]_grey_[col]"] = image(icon = 'icons/mob/bees.dmi', icon_state = "[icon_base]_grey")
greyscale = bee_icons["[icon_base]_grey_[col]"]
greyscale.color = col
overlays += greyscale
var/image/wings
if(!bee_icons["[icon_base]_wings"])
bee_icons["[icon_base]_wings"] = image(icon = 'icons/mob/bees.dmi', icon_state = "[icon_base]_wings")
wings = bee_icons["[icon_base]_wings"]
overlays += wings
//We don't attack beekeepers/people dressed as bees//Todo: bee costume
/mob/living/simple_animal/hostile/poison/bees/CanAttack(atom/the_target)
. = ..()
if(!.)
return 0
if(ishuman(the_target))
var/mob/living/carbon/human/H = the_target
return !H.bee_friendly()
/mob/living/simple_animal/hostile/poison/bees/Found(atom/A)
if(istype(A, /obj/machinery/hydroponics))
var/obj/machinery/hydroponics/Hydro = A
if(Hydro.myseed && !Hydro.dead && !Hydro.recent_bee_visit)
wanted_objects |= /obj/machinery/hydroponics //so we only hunt them while they're alive/seeded/not visisted
return 1
if(ishuman(A))
var/mob/living/carbon/human/H = A
return !H.bee_friendly()
return 0
/mob/living/simple_animal/hostile/poison/bees/AttackingTarget()
//Pollinate
if(istype(target, /obj/machinery/hydroponics))
var/obj/machinery/hydroponics/Hydro = target
pollinate(Hydro)
else if(target == beehome)
var/obj/structure/beebox/BB = target
loc = BB
target = null
wanted_objects -= /obj/structure/beebox //so we don't attack beeboxes when not going home
else
desc = "Although now lonely, this single space bee is still poisonous and very angry at you."
if(beegent && isliving(target))
var/mob/living/L = target
beegent.reaction_mob(L, TOUCH)
target.attack_animal(src)
/mob/living/simple_animal/hostile/poison/bees/proc/assign_reagent(datum/reagent/R)
if(istype(R))
beegent = R
name = "[initial(name)] ([R.name])"
generate_bee_visuals()
/mob/living/simple_animal/hostile/poison/bees/proc/pollinate(obj/machinery/hydroponics/Hydro)
if(!istype(Hydro) || !Hydro.myseed || Hydro.dead || Hydro.recent_bee_visit)
target = null
return
target = null //so we pick a new hydro tray next FindTarget(), instead of loving the same plant for eternity
wanted_objects -= /obj/machinery/hydroponics //so we only hunt them while they're alive/seeded/not visisted
Hydro.recent_bee_visit = TRUE
spawn(BEE_TRAY_RECENT_VISIT)
if(Hydro)
Hydro.recent_bee_visit = FALSE
var/growth = health //Health also means how many bees are in the swarm, roughly.
//better healthier plants!
Hydro.health += growth
Hydro.pestlevel = max(0, --Hydro.pestlevel)
Hydro.yieldmod++
if(beehome)
beehome.bee_resources = min(beehome.bee_resources + growth, 100)
/mob/living/simple_animal/hostile/poison/bees/handle_automated_action()
. = ..()
if(!.)
return
if(!isqueen)
if(loc == beehome)
idle = min(100, ++idle)
if(idle >= BEE_IDLE_ROAMING && prob(BEE_PROB_GOROAM))
loc = get_turf(beehome)
else
idle = max(0, --idle)
if(idle <= BEE_IDLE_GOHOME && prob(BEE_PROB_GOHOME))
if(!FindTarget())
wanted_objects += /obj/structure/beebox //so we don't attack beeboxes when not going home
target = beehome
if(!beehome) //add outselves to a beebox (of the same reagent) if we have no home
for(var/obj/structure/beebox/BB in view(vision_range, src))
if(reagent_incompatible(BB.queen_bee) || BB.bees.len >= BB.get_max_bees())
continue
BB.bees |= src
beehome = BB
/mob/living/simple_animal/hostile/poison/bees/queen
name = "queen bee"
desc = "she's the queen of bees, BZZ BZZ"
icon_base = "queen"
isqueen = TRUE
//the Queen doesn't leave the box on her own, and she CERTAINLY doesn't pollinate by herself
/mob/living/simple_animal/hostile/poison/bees/queen/Found(atom/A)
return 0
//leave pollination for the peasent bees
/mob/living/simple_animal/hostile/poison/bees/queen/AttackingTarget()
if(beegent && isliving(target))
var/mob/living/L = target
beegent.reaction_mob(L, TOUCH)
target.attack_animal(src)
//PEASENT BEES
/mob/living/simple_animal/hostile/poison/bees/queen/pollinate()
return
/mob/living/simple_animal/hostile/poison/bees/proc/reagent_incompatible(mob/living/simple_animal/hostile/poison/bees/B)
if(!B)
return 1
if(B.beegent && beegent && B.beegent.id != beegent.id || B.beegent && beegent || !B.beegent && beegent)
return 1
return 0
/obj/item/queen_bee
name = "queen bee"
desc = "she's the queen of bees, BZZ BZZ"
icon_state = "queen_item"
item_state = ""
icon = 'icons/mob/bees.dmi'
var/mob/living/simple_animal/hostile/poison/bees/queen/queen
/obj/item/queen_bee/attackby(obj/item/I, mob/user, params)
if(istype(I,/obj/item/weapon/reagent_containers/syringe))
var/obj/item/weapon/reagent_containers/syringe/S = I
var/datum/reagent/R = chemical_reagents_list[S.reagents.get_master_reagent_id()]
if(R)
queen.assign_reagent(R)
user.visible_message("<span class='warning'>[user] injects [src]'s genome with [R.name], mutating it's DNA!</span>","<span class='warning'>You inject [src]'s genome with [R.name], mutating it's DNA!</span>")
name = queen.name
..()
/obj/item/queen_bee/bought/New()
..()
queen = new(src)
/obj/item/queen_bee/Destroy()
qdel(queen)
return ..()
@@ -159,7 +159,7 @@
return 0
return 1
if(isobj(the_target))
if(the_target.type in wanted_objects)
if(is_type_in_list(the_target, wanted_objects))
return 1
return 0
@@ -56,7 +56,8 @@
//All types that you can put into the grinder to transfer the reagents to the beaker. !Put all recipes above this.!
/obj/item/weapon/reagent_containers/pill = list(),
/obj/item/weapon/reagent_containers/food = list()
/obj/item/weapon/reagent_containers/food = list(),
/obj/item/weapon/reagent_containers/honeycomb = list()
)
var/list/juice_items = list (
@@ -423,3 +423,17 @@
/datum/reagent/consumable/corn_syrup/on_mob_life(mob/living/M)
holder.add_reagent("sugar", 3)
..()
/datum/reagent/consumable/honey
name = "honey"
id = "honey"
description = "Sweet sweet honey, decays into sugar."
color = "#d3a308"
nutriment_factor = 15 * REAGENTS_METABOLISM
/datum/reagent/consumable/honey/on_mob_life(mob/living/M)
M.reagents.add_reagent("sugar",3)
M.reagents.remove_reagent("honey", 1)
if(prob(20))
M.heal_organ_damage(3,1)
..()
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 44 KiB

+4
View File
@@ -1099,6 +1099,10 @@
#include "code\modules\hydroponics\plant_genes.dm"
#include "code\modules\hydroponics\seed_extractor.dm"
#include "code\modules\hydroponics\seeds.dm"
#include "code\modules\hydroponics\beekeeping\beebox.dm"
#include "code\modules\hydroponics\beekeeping\beekeeper_suit.dm"
#include "code\modules\hydroponics\beekeeping\honey_frame.dm"
#include "code\modules\hydroponics\beekeeping\honeycomb.dm"
#include "code\modules\hydroponics\grown\ambrosia.dm"
#include "code\modules\hydroponics\grown\apple.dm"
#include "code\modules\hydroponics\grown\banana.dm"