The Non-Existent Birds and The Bees (#8465)

This commit is contained in:
Geeves
2020-03-26 19:40:21 +02:00
committed by GitHub
parent cdc2df4620
commit e743e91ae3
9 changed files with 265 additions and 253 deletions

View File

@@ -0,0 +1,26 @@
/obj/item/bee_pack
name = "bee pack"
desc = "A stasis pack for moving bees. 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 = TRUE
/obj/item/bee_pack/Initialize()
. = ..()
add_overlay("beepack-full")
/obj/item/bee_pack/update_icon()
cut_overlays()
add_overlay("beepack-[full ? "full" : "empty"]")
/obj/item/bee_pack/proc/empty()
name = "empty bee pack"
desc = "A stasis pack for moving bees. It's empty."
full = FALSE
update_icon()
/obj/item/bee_pack/proc/fill()
name = initial(name)
desc = initial(desc)
full = TRUE
update_icon()

View File

@@ -2,10 +2,10 @@
name = "beehive"
icon = 'icons/obj/beekeeping.dmi'
icon_state = "beehive"
density = 1
anchored = 1
density = TRUE
anchored = TRUE
var/closed = 0
var/closed = FALSE
var/bee_count = 0 // Percent
var/smoked = 0 // Timer
var/honeycombs = 0 // Percent
@@ -32,113 +32,126 @@
if(81 to 100)
add_overlay("bees3")
/obj/machinery/beehive/examine(var/mob/user)
/obj/machinery/beehive/examine(mob/user)
..()
if(!closed)
to_chat(user, "The lid is open. The bees can't grow and produce honey until it's closed!")
to_chat(user, SPAN_NOTICE("\The [src] is holding <b>[frames]/[maxFrames]</b> frames."))
if(user.Adjacent(src))
if(bee_count)
if(closed)
to_chat(user, FONT_SMALL(SPAN_NOTICE("You can hear buzzing from within \the [src].")))
else
to_chat(user, FONT_SMALL(SPAN_WARNING("The lid is <b>open</b>. The bees can't grow and produce honey until it's <b>closed!</b>")))
to_chat(user, FONT_SMALL(SPAN_NOTICE("You can see bees buzzing around within \the [src].")))
else
if(closed)
to_chat(user, FONT_SMALL(SPAN_NOTICE("\The [src] lies silent.")))
else
to_chat(user, FONT_SMALL(SPAN_NOTICE("You can see bees buzzing around within \the [src].")))
if(honeycombs / 100 > 1)
to_chat(user, SPAN_NOTICE("\The [src] has a frame full of honeycombs which you can harvest."))
/obj/machinery/beehive/attackby(var/obj/item/I, var/mob/user)
/obj/machinery/beehive/attackby(obj/item/I, mob/user)
if(I.iscrowbar())
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>")
user.visible_message(SPAN_NOTICE("\The [user] [closed ? "closes" : "opens"] \the [src]."), SPAN_NOTICE("You [closed ? "close" : "open"] \the [src]."))
update_icon()
return
else if(I.iswrench())
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>")
if (!smoked && !anchored && (bee_count > 10))
visible_message("<span class='danger'>The bees don't like their home being moved!.</span>")
user.visible_message(SPAN_NOTICE("\The [user] [anchored ? "wrenches" : "unwrenches"] \the [src]."), SPAN_NOTICE("You [anchored ? "wrench" : "unwrench"] \the [src]."))
if(!smoked && !anchored && (bee_count > 10))
visible_message(SPAN_WARNING("The bees don't like their home being moved!"))
release_bees(0.1, 5)
return
else if(istype(I, /obj/item/honey_frame))
if(closed)
to_chat(user, "<span class='notice'>You need to open \the [src] with a crowbar before inserting \the [I].</span>")
to_chat(user, SPAN_WARNING("You need to open \the [src] with a crowbar before inserting \the [I]."))
return
if(frames >= maxFrames)
to_chat(user, "<span class='notice'>There is no place for an another frame.</span>")
to_chat(user, SPAN_WARNING("\The [src] cannot fit more frames."))
return
var/obj/item/honey_frame/H = I
if(H.honey)
to_chat(user, "<span class='notice'>\The [I] is full with beeswax and honey, empty it in the extractor first.</span>")
to_chat(user, SPAN_WARNING("\The [I] is full with beeswax and honey, empty it into the extractor first."))
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>")
frames++
user.visible_message(SPAN_NOTICE("\The [user] loads \the [I] into \the [src]."), SPAN_NOTICE("You load \the [I] into \the [src]."))
update_icon()
qdel(I)
return
else if(istype(I, /obj/item/bee_pack))
var/obj/item/bee_pack/B = I
if(B.full && bee_count)
to_chat(user, "<span class='notice'>\The [src] already has bees inside.</span>")
to_chat(user, SPAN_WARNING("\The [B] is already full of bees."))
return
if(!B.full && bee_count < 90)
to_chat(user, "<span class='notice'>\The [src] is not ready to split.</span>")
to_chat(user, SPAN_WARNING("The bees within \the [src] are not ready to split yet."))
return
if(!B.full && !smoked)
to_chat(user, "<span class='notice'>Smoke \the [src] first!</span>")
to_chat(user, SPAN_WARNING("The bees won't enter \the [B] without being smoked!"))
return
if(closed)
to_chat(user, "<span class='notice'>You need to open \the [src] with a crowbar before moving the bees.</span>")
to_chat(user, SPAN_WARNING("You need to open \the [src] with a crowbar before moving the bees."))
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>")
user.visible_message(SPAN_NOTICE("\The [user] puts the queen and the bees from \the [B] into \the [src]."), SPAN_NOTICE("You put the queen and the bees from \the [B] into \the [src]."))
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>")
user.visible_message(SPAN_NOTICE("\The [user] puts bees and larvae from \the [src] into \the [B]."), SPAN_NOTICE("You put puts bees and larvae from \the [src] into \the [B]."))
bee_count /= 2
B.fill()
update_icon()
return
else if(istype(I, /obj/item/device/analyzer/plant_analyzer))
to_chat(user, "<span class='notice'>Scan result of \the [src]...</span>")
to_chat(user, "Beehive is [bee_count ? "[round(bee_count)]% full" : "empty"].[bee_count > 90 ? " Colony is ready to split." : ""]")
to_chat(user, SPAN_NOTICE("Scan result of \the [src]:"))
to_chat(user, SPAN_NOTICE("Beehive is <b>[bee_count ? "[round(bee_count)]% full" : "empty"]</b>.[bee_count > 90 ? " Colony is ready to split." : ""]"))
if(frames)
to_chat(user, "[frames] frames installed, [round(honeycombs / 100)] filled.")
to_chat(user, SPAN_NOTICE("<b>[frames]</b> frames installed, <b>[round(honeycombs / 100)]</b> filled."))
if(honeycombs < frames * 100)
to_chat(user, "Next frame is [round(honeycombs % 100)]% full.")
to_chat(user, SPAN_NOTICE("In-progress frame is <b>[round(honeycombs % 100)]%</b> full."))
else
to_chat(user, "No frames installed.")
to_chat(user, SPAN_NOTICE("No frames installed."))
if(smoked)
to_chat(user, "The hive is smoked.")
return 1
to_chat(user, SPAN_NOTICE("The hive is <b>smoked</b>."))
return
else if(I.isscrewdriver())
if(bee_count)
visible_message("<span class='danger'>The bees are furious you're trying to destroy their home!</span>")
release_bees(1, 30)
to_chat(user, "<span class='notice'>You start dismantling \the [src]. This will take a while...</span>")
playsound(loc, I.usesound, 50, 1)
if(do_after(user, 150/I.toolspeed))
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)
to_chat(user, SPAN_NOTICE("You start dismantling \the [src]. This will take a while..."))
playsound(get_turf(src), I.usesound, 50, TRUE)
if(do_after(user, 150 / I.toolspeed))
user.visible_message(SPAN_NOTICE("\The [user] dismantles \the [src]."), SPAN_NOTICE("You dismantle \the [src]."))
if(bee_count)
visible_message(SPAN_WARNING("The bees are furious over the destruction of their home!"))
release_bees(1, 30)
new /obj/item/beehive_assembly(get_turf(src))
qdel(src)
return
/obj/machinery/beehive/attack_hand(var/mob/user)
/obj/machinery/beehive/attack_hand(mob/user)
if(!closed)
if(honeycombs < 100)
to_chat(user, "<span class='notice'>There are no filled honeycombs.</span>")
to_chat(user, SPAN_WARNING("There are no filled honeycombs."))
return
if(!smoked && (bee_count > 5))
visible_message("<span class='danger'>The bees don't like you taking their honey!</span>")
if(!smoked && bee_count > 5)
visible_message(SPAN_WARNING("The bees don't like their honey being taken!"))
release_bees(0.2, 5)
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>")
user.visible_message(SPAN_NOTICE("\The [user] starts taking the honeycombs out of \the [src]."), SPAN_NOTICE("You start taking the honeycombs out of \the [src]..."))
while(honeycombs >= 100 && do_after(user, 30))
new /obj/item/honey_frame/filled(loc)
new /obj/item/honey_frame/filled(get_turf(src))
honeycombs -= 100
--frames
frames--
update_icon()
if(honeycombs < 100)
to_chat(user, "<span class='notice'>You take all filled honeycombs out.</span>")
to_chat(user, SPAN_NOTICE("You take all filled honeycombs out."))
return
/obj/machinery/beehive/machinery_process()
if(closed && !smoked && bee_count)
pollinate_flowers()
update_icon()
else if (!closed && bee_count && prob(bee_count*0.1))
else if (!closed && bee_count && prob(bee_count * 0.1))
//If the hive is opened, periodically release docile bees
visible_message("<span class='notice'>A few curious bees float out of the open hive to buzz around</span>")
visible_message(SPAN_WARNING("A few curious bees float out of the open beehive to buzz around."))
release_bees(0.1, 0, 3)
smoked = max(0, smoked - 1)
@@ -152,111 +165,42 @@
for(var/obj/machinery/portable_atmospherics/hydroponics/H in view(7, src))
if(H.seed && !H.dead)
H.health += 0.05 * coef
++trays
H.yield_mod = min(10, H.yield_mod + coef)
trays++
honeycombs = min(honeycombs + 0.12 * coef * min(trays, 5), frames * 100)
/obj/machinery/beehive/proc/release_bees(var/severity, var/angry, var/swarmsize = 6)
if (bee_count < 1)
if(bee_count < 1)
return
src.visible_message(span("notice"," [pick("Buzzzz.","Hmmmmm.","Bzzz.")]"))
playsound(src.loc, pick('sound/effects/Buzz1.ogg','sound/effects/Buzz2.ogg'), 45, 1,0)
visible_message(SPAN_NOTICE("[pick("Buzzzz.","Hmmmmm.","Bzzz.")]"))
playsound(get_turf(src), pick('sound/effects/Buzz1.ogg','sound/effects/Buzz2.ogg'), 45, TRUE)
severity = Clamp(severity, 0, 1)
var/beestorelease = bee_count * severity
beestorelease = round(beestorelease,1)
bee_count -= beestorelease
var/bees_to_release = bee_count * severity
bees_to_release = round(bees_to_release, 1)
bee_count -= bees_to_release
var/list/spawn_turfs = list(get_turf(src))
for (var/T in orange(1, src))
if (istype(T, /turf/simulated/floor))
for(var/T in orange(1, src))
if(istype(T, /turf/simulated/floor))
spawn_turfs += T
while(beestorelease > 0)
while(beestorelease > swarmsize)
while(bees_to_release > 0)
while(bees_to_release > swarmsize)
var/mob/living/simple_animal/bee/B = new(pick(spawn_turfs), src)
B.feral = angry
B.strength = swarmsize
B.update_icons()
beestorelease -= swarmsize
bees_to_release -= swarmsize
//what's left over
var/mob/living/simple_animal/bee/B = new(pick(spawn_turfs), src)
B.strength = beestorelease
B.strength = bees_to_release
B.icon_state = "bees[B.strength]"
B.feral = angry
B.update_icons()
beestorelease = 0
/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
anchored = 0
/obj/machinery/honey_extractor/examine(var/mob/user)
..()
to_chat(user, "It contains [honey] units of honey for collection.")
/obj/machinery/honey_extractor/attackby(var/obj/item/I, var/mob/user)
if(processing)
to_chat(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)
to_chat(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(200)
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/reagent_containers/glass))
if(!honey)
to_chat(user, "<span class='notice'>There is no honey in \the [src].</span>")
return
var/obj/item/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
else
..()
/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/Initialize()
. = ..()
add_overlay("honeycomb")
bees_to_release = 0
/obj/item/beehive_assembly
name = "beehive assembly"
@@ -265,49 +209,9 @@
icon_state = "apiary"
/obj/item/beehive_assembly/attack_self(var/mob/user)
to_chat(user, "<span class='notice'>You start assembling \the [src]...</span>")
to_chat(user, SPAN_NOTICE("You start assembling \the [src]..."))
if(do_after(user, 30))
user.visible_message("<span class='notice'>[user] constructs a beehive.</span>", "<span class='notice'>You construct a beehive.</span>")
user.visible_message(SPAN_NOTICE("\The [user] constructs a beehive."), SPAN_NOTICE("You construct a beehive."))
new /obj/machinery/beehive(get_turf(user))
qdel(src)
return
/obj/item/stack/wax
name = "wax"
singular_name = "wax piece"
desc = "Soft substance produced by botany. 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/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/Initialize()
. = ..()
add_overlay("beepack-full")
/obj/item/bee_pack/proc/empty()
full = 0
name = "empty bee pack"
desc = "A stasis pack for moving bees. It's empty."
cut_overlays()
add_overlay("beepack-empty")
/obj/item/bee_pack/proc/fill()
full = initial(full)
name = initial(name)
desc = initial(desc)
cut_overlays()
add_overlay("beepack-full")
return

View File

@@ -0,0 +1,50 @@
/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"
anchored = TRUE
var/obj/item/honey_frame/contained_frame
var/honey = 0
/obj/machinery/honey_extractor/examine(var/mob/user)
..()
if(contained_frame)
to_chat(user, SPAN_NOTICE("It's holding \the <b>[contained_frame]</b>."))
to_chat(user, SPAN_NOTICE("It contains <b>[honey]</b> units of honey for collection."))
/obj/machinery/honey_extractor/attackby(obj/item/I, mob/user)
if(contained_frame)
to_chat(user, SPAN_WARNING("\The [src] is currently spinning, wait until it's finished."))
return
else if(istype(I, /obj/item/honey_frame))
var/obj/item/honey_frame/H = I
if(!H.honey)
to_chat(user, SPAN_NOTICE("\The [H] is empty, put it into a beehive."))
return
user.visible_message(SPAN_NOTICE("\The [user] loads \the [H] into \the [src] and turns it on."), SPAN_NOTICE("You load \the [H] into \the [src] and turn it on."))
user.drop_from_inventory(H, src)
contained_frame = H
icon_state = "centrifuge_moving"
addtimer(CALLBACK(src, .proc/do_process), 100)
else if(istype(I, /obj/item/reagent_containers/glass))
if(!honey)
to_chat(user, SPAN_NOTICE("There is no honey in \the [src]."))
return
var/obj/item/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_NOTICE("\The [user] collects honey from \the [src] into \the [G]."), SPAN_NOTICE("You collect [transferred] units of honey from \the [src] into \the [G]."))
return
else
..()
/obj/machinery/honey_extractor/proc/do_process()
honey += contained_frame.honey
contained_frame.honey = 0
contained_frame.forceMove(get_turf(src))
contained_frame = null
new /obj/item/stack/wax(get_turf(src))
icon_state = "centrifuge"

View File

@@ -0,0 +1,16 @@
/obj/item/honey_frame
name = "beehive frame"
desc = "A frame for the beehive that can store honeycombs."
icon = 'icons/obj/beekeeping.dmi'
icon_state = "honeyframe"
w_class = ITEMSIZE_SMALL
var/honey = 0
/obj/item/honey_frame/filled
name = "filled beehive frame"
desc = "A frame for the beehive that has been filled with honeycombs."
honey = 20
/obj/item/honey_frame/filled/Initialize()
. = ..()
add_overlay("honeycomb")

View File

@@ -1,118 +1,108 @@
/obj/item/bee_net
name = "bee net"
desc = "For catching rogue bees."
desc = "A net for catching rogue bees."
icon = 'icons/obj/apiary_bees_etc.dmi'
icon_state = "bee_net"
item_state = "bee_net"
w_class = 3
var/caught_bees = 0
var/feralbees
/obj/item/bee_net/examine(var/mob/user)
/obj/item/bee_net/examine(mob/user)
..()
if (caught_bees)
to_chat(user, span("notice", "It contains [caught_bees] bees"))
if(caught_bees)
to_chat(user, SPAN_NOTICE("It contains [caught_bees] bees."))
else
to_chat(user, span("notice", "It is empty"))
to_chat(user, SPAN_NOTICE("It is empty."))
/obj/item/bee_net/attack_self(mob/user as mob)
/obj/item/bee_net/attack_self(mob/user)
var/turf/T = get_step(get_turf(user), user.dir)
for(var/mob/living/simple_animal/bee/B in T)
capture_bees(B, user)
break
..()
/obj/item/bee_net/resolve_attackby(atom/A, mob/user, var/click_parameters)
if (istype(A, /turf))
if(istype(A, /turf))
var/turf/T = A
for(var/mob/living/simple_animal/bee/B in T)
capture_bees(B, user)
return 1
return TRUE
else if (istype(A, /mob/living/simple_animal/bee))
capture_bees(A, user)
return 1
return TRUE
else if (istype(A, /obj/machinery/beehive) && caught_bees)
deposit_bees(A, user)
return 1
return TRUE
..(A, user, click_parameters)
/obj/item/bee_net/proc/capture_bees(var/mob/living/simple_animal/bee/target, var/mob/living/user)
if (user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN*2)//make it harder to spamclick bees into submission
if(user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN*2) //make it harder to spamclick bees into submission
user.do_attack_animation(target)
//Instead of a hard limit on bee storage, a chance of critical failure equal to the number of contained bees
if (caught_bees)
if (prob(caught_bees))
user.visible_message(span("danger","[user] fails at capturing bees and spills their overstuffed net."),span("danger","All the bees break free of your overstuffed net!"))
if(caught_bees)
if(prob(caught_bees))
user.visible_message(SPAN_WARNING("\The [user] fails at capturing bees and spills their overstuffed net."), SPAN_WARNING("All the bees break free of your overstuffed net!"))
empty_bees()
return
var/success = 0
if(target.feral <= 0)
success = 1//Caught em all
else if (prob((target.feral*2)+15))
success = 0//Missed and made them mad
success = 1 //Caught em all
else if(prob((target.feral * 2) + 15))
success = 0 //Missed and made them mad
else
success = rand()+0.2//Caught some of them
success = rand()+0.2 //Caught some of them
success = min(success, 1)
switch(success)
if (1)
user.visible_message(span("notice","[user] scoops up the bees."),span("notice","You scoop up [target.strength] of the docile bees."))
if(1)
user.visible_message(SPAN_NOTICE("\The [user] scoops up some bees."), SPAN_NOTICE("You scoop up [target.strength] of the docile bees."))
caught_bees += target.strength
target.strength = 0
qdel(target)
if (0)
user.visible_message(span("danger","[user] swings at some angry bees, they don't seem to like it."),span("danger","You swing at some angry bees, and just manage to make them madder"))
if(0)
user.visible_message(SPAN_WARNING("\The [user] swings at some angry bees, they don't seem to like it."), SPAN_WARNING("You swing at some angry bees, and just manage to make them madder."))
target.feral = 5
target.target_mob = user
else
var/delta = round((target.strength*success), 1)
var/delta = round((target.strength * success), 1)
delta = min(max(delta, 1), target.strength)
if (delta >= target.strength)
user.visible_message(span("warning","[user] scoops up the angry bees."),span("warning","You all [delta] of the angry bees, lucky!"))
if(delta >= target.strength)
user.visible_message(SPAN_WARNING("\The [user] scoops up the angry bees."), SPAN_NOTICE("You scoop up all of the angry bees, lucky!"))
else
user.visible_message(span("warning","[user] nets a couple of bees."),span("warning","You catch [delta] of the angry bees, others slip through your net"))
user.visible_message(SPAN_WARNING("\The [user] nets a couple of bees."), SPAN_WARNING("You catch [delta] of the angry bees, others slip through your net."))
caught_bees += delta
target.strength -= delta
feralbees = 1
feralbees = TRUE
if (target.strength <= 0)
if(target.strength <= 0)
qdel(target)
if (!QDELETED(target))
if(!QDELETED(target))
target.update_icons()
/obj/item/bee_net/proc/deposit_bees(var/obj/machinery/beehive/newhome, var/mob/user)
if (!newhome.closed)
if(!newhome.closed)
var/delta = min(100 - newhome.bee_count, caught_bees)
newhome.bee_count += delta
caught_bees -= delta
if (caught_bees <= 0)
if(caught_bees <= 0)
feralbees = 0
user.visible_message(span("notice","[user] deposits [delta] bees into the hive."),span("notice","You deposit [delta] bees into the hive."))
user.visible_message(SPAN_NOTICE("\The [user] deposits [delta] bees into the hive."), SPAN_NOTICE("You deposit [delta] bees into the hive."))
newhome.update_icon()
else
to_chat(user, span("warning", "You'll have to open the lid before you can place bees inside"))
to_chat(user, SPAN_WARNING("You'll have to open the lid before you can place bees inside."))
/obj/item/bee_net/verb/empty_bees()
set src in usr
set name = "Empty bee net"
set category = "Object"
var/mob/living/carbon/M
if(iscarbon(usr))
M = usr
@@ -122,7 +112,7 @@
while(caught_bees >= 5)
var/mob/living/simple_animal/bee/B = new(get_turf(src), null)
B.feral = 0
if (feralbees)
if(feralbees)
//Theyre only angry when they come out if any of them were angry when they went in
//Anger is contagious though
B.feral = 5
@@ -135,10 +125,10 @@
var/mob/living/simple_animal/bee/B = new(get_turf(src), null)
B.strength = caught_bees
B.feral = 0
if (feralbees)
if(feralbees)
B.feral = 5
B.target_mob = M
B.update_icons()
caught_bees = 0
feralbees = 0
feralbees = FALSE

View File

@@ -1,86 +1,82 @@
//The bee smoker, a device that burns welder fuel to make lots of smoke that obscures vision
//Useful for dealing with angry bees, or for antagonist gardeners to confuse and flee from armed security.
/obj/item/bee_smoker
name = "Bee smoker"
name = "bee smoker"
desc = "An archaic contraption that slowly burns welding fuel to create thick clouds of smoke, and directs it with attached bellows, used to control angry bees and calm them before harvesting honey."
description_antag = "This device can be used to blind people in short range."
icon = 'icons/obj/beekeeping.dmi'
icon_state ="beesmoker"
item_state = "beesmoker"
contained_sprite = 1
w_class = 4//Big clunky thing
contained_sprite = TRUE
w_class = ITEMSIZE_LARGE //Big clunky thing
var/max_fuel = 60
/obj/item/bee_smoker/examine(mob/user)
if(..(user, 0))
to_chat(user, text("\icon[] [] contains []/[] units of fuel!", src, src.name, get_fuel(),src.max_fuel ))
/obj/item/bee_smoker/New()
..()
var/datum/reagents/R = new/datum/reagents(max_fuel)
if(user.Adjacent(src))
to_chat(user, SPAN_NOTICE("It has <b>[get_fuel()]/[max_fuel]</b> welding fuel left."))
/obj/item/bee_smoker/Initialize()
. = ..()
var/datum/reagents/R = new /datum/reagents(max_fuel)
reagents = R
R.my_atom = src
//Bee smoker intentionally spawns empty. Fill it at a weldertank before use
//I would prefer to rename this to attack(), but that would involve touching hundreds of files.
/obj/item/bee_smoker/resolve_attackby(atom/A, mob/user, var/click_parameters)
if (istype(A, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,A) <= 1)
if(istype(A, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,A) <= 1)
A.reagents.trans_to_obj(src, max_fuel)
to_chat(user, "<span class='notice'>Smoker refilled!</span>")
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
else if (istype(A, /obj/machinery/beehive/))
to_chat(user, SPAN_NOTICE("You refuel \the [src]."))
playsound(get_turf(src), 'sound/effects/refill.ogg', 50, TRUE, -6)
else if(istype(A, /obj/machinery/beehive))
var/obj/machinery/beehive/B = A
if(B.closed)
to_chat(user, "<span class='notice'>You need to open \the [B] with a crowbar before smoking the bees.</span>")
return 1
if (!remove_fuel(1,user))
return 1
user.visible_message("<span class='notice'>[user] smokes the bees in \the [B].</span>", "<span class='notice'>You smoke the bees in \the [B].</span>")
to_chat(user, SPAN_WARNING("You need to open \the [B] with a crowbar before smoking the bees."))
return TRUE
if(!remove_fuel(1, user))
return TRUE
user.visible_message(SPAN_NOTICE("\The [user] smokes the bees in \the [B]."), SPAN_NOTICE("You smoke the bees in \the [B], which seems to calm them down."))
B.smoked = 30
B.update_icon()
return 1
return TRUE
else
smoke_at(A)
..(A, user, click_parameters)
return 1
return TRUE
//Afterattack can only be called for longdistance clicks, since those skip the attackby
/obj/item/bee_smoker/afterattack(atom/A, mob/user)
..()
smoke_at(A)
/obj/item/bee_smoker/proc/get_fuel()
return reagents.get_reagent_amount("fuel")
/obj/item/bee_smoker/proc/remove_fuel(var/amount = 1, var/mob/M = null)
if(get_fuel() >= amount)
reagents.remove_reagent("fuel", amount)
return 1
return TRUE
else
if(M)
to_chat(M, "<span class='notice'>You need more welding fuel to complete this task.</span>")
return 0
to_chat(M, SPAN_WARNING("\The [src] doesn't have enough fuel to do this!"))
return FALSE
/obj/item/bee_smoker/proc/smoke_at(var/atom/A)
if (!istype(A, /turf) && !istype(A.loc, /turf) )//Safety to prevent firing smoke at your own backpack
if(!istype(A, /turf) && !istype(A.loc, /turf) ) //Safety to prevent firing smoke at your own backpack
return
var/turf/T
var/mob/owner = get_holding_mob()
if (!remove_fuel(1.5, owner))
if(!remove_fuel(1.5, owner))
return
var/direction = get_dir(get_turf(src), get_turf(A))
if (owner)
if(owner)
T = get_step(owner, direction)
else
T = get_turf(src)
var/datum/effect/effect/system/smoke_spread/smoke = new
smoke.set_up(10, 0, T, direction)
playsound(T, 'sound/effects/smoke.ogg', 20, 1, -3)

View File

@@ -0,0 +1,14 @@
/obj/item/stack/wax
name = "wax"
singular_name = "wax piece"
desc = "Soft substance produced by botany. 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/flame/candle)
)