diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm
index 7acd3efc961..5d3ffc80c6c 100644
--- a/code/modules/hydroponics/beekeeping/beebox.dm
+++ b/code/modules/hydroponics/beekeeping/beebox.dm
@@ -8,26 +8,26 @@
/mob/proc/bee_friendly()
- return 0
+ return FALSE
/mob/living/simple_animal/hostile/poison/bees/bee_friendly()
- return 1
+ return TRUE
/mob/living/simple_animal/bot/bee_friendly()
if(paicard)
- return 0
- return 1
+ return FALSE
+ return TRUE
/mob/living/simple_animal/diona/bee_friendly()
- return 1
+ return TRUE
/mob/living/carbon/human/bee_friendly()
if(isdiona(src)) //bees pollinate plants, duh.
- return 1
+ return TRUE
if((wear_suit && (wear_suit.flags & THICKMATERIAL)) && (head && (head.flags & THICKMATERIAL)))
- return 1
- return 0
+ return TRUE
+ return FALSE
/obj/structure/beebox
@@ -35,8 +35,9 @@
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
+ anchored = TRUE
+ density = TRUE
+ max_integrity = 300
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()
@@ -44,8 +45,8 @@
var/bee_resources = 0
-/obj/structure/beebox/New()
- ..()
+/obj/structure/beebox/Initialize(mapload)
+ . = ..()
processing_objects.Add(src)
@@ -66,12 +67,11 @@
var/random_reagent = FALSE
-/obj/structure/beebox/premade/New()
- ..()
-
+/obj/structure/beebox/premade/Initialize(mapload)
+ . = ..()
var/datum/reagent/R = null
if(random_reagent)
- R = get_random_reagent_id()
+ R = GLOB.chemical_reagents_list[get_random_reagent_id()]
queen_bee = new(src)
queen_bee.beehome = src
@@ -93,7 +93,7 @@
/obj/structure/beebox/process()
- if(queen_bee && (!queen_bee.beegent || !queen_bee.beegent.can_synth))
+ 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)
@@ -152,14 +152,16 @@
if(istype(I, /obj/item/honey_frame))
var/obj/item/honey_frame/HF = I
if(honey_frames.len < BEEBOX_MAX_FRAMES)
+ if(!user.unEquip(HF))
+ return
visible_message("[user] adds a frame to the apiary.")
- user.unEquip(HF)
HF.forceMove(src)
honey_frames += HF
else
to_chat(user, "There's no room for anymore frames in the apiary!")
+ return
- if(istype(I, /obj/item/wrench))
+ if(iswrench(I))
if(default_unfasten_wrench(user, I, time = 20))
return
@@ -169,14 +171,16 @@
return
var/obj/item/queen_bee/qb = I
- user.unEquip(qb)
if(!qb.queen.beegent || (qb.queen.beegent && qb.queen.beegent.can_synth))
+ if(!user.unEquip(qb))
+ return
qb.queen.forceMove(src)
bees += qb.queen
queen_bee = qb.queen
qb.queen = null
else
visible_message("The [qb] refuses to settle down. Maybe it's something to do with its reagent?")
+ return
if(queen_bee)
visible_message("[user] sets [qb] down inside the apiary, making it [user.p_their()] new home.")
@@ -187,7 +191,7 @@
bees -= B
B.beehome = null
if(B.loc == src)
- B.forceMove(get_turf(src))
+ B.forceMove(drop_location())
relocated++
if(relocated)
to_chat(user, "This queen has a different reagent to some of the bees who live here, those bees will not return to this apiary!")
@@ -196,6 +200,8 @@
to_chat(user, "The queen bee disappeared! bees disappearing has been in the news lately...")
qdel(qb)
+ return
+ return ..()
/obj/structure/beebox/attack_hand(mob/user)
@@ -208,7 +214,7 @@
if(B.isqueen)
continue
if(B.loc == src)
- B.forceMove(get_turf(src))
+ B.forceMove(drop_location())
B.target = user
bees = TRUE
if(bees)
@@ -254,3 +260,13 @@
QB.forceMove(get_turf(src))
visible_message("[user] removes the queen from the apiary.")
queen_bee = null
+
+/obj/structure/beebox/deconstruct(disassembled = TRUE)
+ new /obj/item/stack/sheet/wood(loc, 20)
+ for(var/mob/living/simple_animal/hostile/poison/bees/B in bees)
+ if(B.loc == src)
+ B.forceMove(drop_location())
+ for(var/obj/item/honey_frame/HF in honey_frames)
+ honey_frames -= HF
+ HF.forceMove(drop_location())
+ qdel(src)
\ No newline at end of file
diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm
index 4516a44a935..717d7ef2512 100644
--- a/code/modules/mob/living/simple_animal/hostile/bees.dm
+++ b/code/modules/mob/living/simple_animal/hostile/bees.dm
@@ -263,15 +263,12 @@
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/reagent_containers/syringe))
+ if(istype(I, /obj/item/reagent_containers/syringe))
var/obj/item/reagent_containers/syringe/S = I
if(S.reagents.has_reagent("royal_bee_jelly")) //checked twice, because I really don't want royal bee jelly to be duped
- if(S.reagents.has_reagent("royal_bee_jelly",5))
+ if(S.reagents.has_reagent("royal_bee_jelly", 5))
S.reagents.remove_reagent("royal_bee_jelly", 5)
- if(!queen.beegent.can_synth)
- to_chat(user, "You inject [src] with the royal bee jelly. It's ineffective! Maybe it's something to do with the [src] reagent.")
- return
- var/obj/item/queen_bee/qb = new(get_turf(user))
+ var/obj/item/queen_bee/qb = new(user.drop_location())
qb.queen = new(qb)
if(queen && queen.beegent)
qb.queen.assign_reagent(queen.beegent) //Bees use the global singleton instances of reagents, so we don't need to worry about one bee being deleted and her copies losing their reagents.
@@ -282,16 +279,17 @@
else
var/datum/reagent/R = GLOB.chemical_reagents_list[S.reagents.get_master_reagent_id()]
if(R && S.reagents.has_reagent(R.id, 5))
- S.reagents.remove_reagent(R.id,5)
+ S.reagents.remove_reagent(R.id, 5)
queen.assign_reagent(R)
- user.visible_message("[user] injects [src]'s genome with [R.name], mutating it's DNA!","You inject [src]'s genome with [R.name], mutating it's DNA!")
+ user.visible_message("[user] injects [src]'s genome with [R.name], mutating its DNA!", "You inject [src]'s genome with [R.name], mutating its DNA!")
name = queen.name
else
to_chat(user, "You don't have enough units of that chemical to modify the bee's DNA!")
- ..()
+ else
+ return ..()
-/obj/item/queen_bee/bought/New()
- ..()
+/obj/item/queen_bee/bought/Initialize(mapload)
+ . = ..()
queen = new(src)
/obj/item/queen_bee/Destroy()