Fixes Bees

This commit is contained in:
Fox McCloud
2019-04-01 03:16:21 -04:00
parent b036271989
commit 3e9e057a1a
2 changed files with 47 additions and 33 deletions
+38 -22
View File
@@ -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("<span class='notice'>[user] adds a frame to the apiary.</span>")
user.unEquip(HF)
HF.forceMove(src)
honey_frames += HF
else
to_chat(user, "<span class='warning'>There's no room for anymore frames in the apiary!</span>")
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("<span class='notice'>The [qb] refuses to settle down. Maybe it's something to do with its reagent?</span>")
return
if(queen_bee)
visible_message("<span class='notice'>[user] sets [qb] down inside the apiary, making it [user.p_their()] new home.</span>")
@@ -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, "<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>")
@@ -196,6 +200,8 @@
to_chat(user, "<span class='warning'>The queen bee disappeared! bees disappearing has been in the news lately...</span>")
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("<span class='notice'>[user] removes the queen from the apiary.</span>")
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)
@@ -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, "<span class='warning'>You inject [src] with the royal bee jelly. It's ineffective! Maybe it's something to do with the [src] reagent.</span>")
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("<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>")
user.visible_message("<span class='warning'>[user] injects [src]'s genome with [R.name], mutating its DNA!</span>", "<span class='warning'>You inject [src]'s genome with [R.name], mutating its DNA!</span>")
name = queen.name
else
to_chat(user, "<span class='warning'>You don't have enough units of that chemical to modify the bee's DNA!</span>")
..()
else
return ..()
/obj/item/queen_bee/bought/New()
..()
/obj/item/queen_bee/bought/Initialize(mapload)
. = ..()
queen = new(src)
/obj/item/queen_bee/Destroy()