mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
Converts bees to basic mobs (#30662)
* Converts bees to basic mobs * Undefs * Linters
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
return FALSE
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/bee_friendly()
|
||||
/mob/living/basic/bee/bee_friendly()
|
||||
return TRUE
|
||||
|
||||
/mob/living/simple_animal/bot/bee_friendly()
|
||||
@@ -37,7 +37,7 @@
|
||||
icon_state = "beebox"
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
var/mob/living/simple_animal/hostile/poison/bees/queen/queen_bee = null
|
||||
var/mob/living/basic/bee/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()
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
/obj/structure/beebox/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
for(var/mob/living/simple_animal/hostile/poison/bees/B in bees)
|
||||
for(var/mob/living/basic/bee/B in bees)
|
||||
B.beehome = null
|
||||
bees.Cut()
|
||||
bees = null
|
||||
@@ -82,7 +82,7 @@
|
||||
honey_frames += HF
|
||||
|
||||
for(var/i in 1 to get_max_bees())
|
||||
var/mob/living/simple_animal/hostile/poison/bees/B = new(src)
|
||||
var/mob/living/basic/bee/B = new(src)
|
||||
bees += B
|
||||
B.beehome = src
|
||||
B.assign_reagent(R)
|
||||
@@ -107,7 +107,7 @@
|
||||
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(get_turf(src))
|
||||
var/mob/living/basic/bee/B = new(get_turf(src))
|
||||
B.beehome = src
|
||||
B.assign_reagent(queen_bee.beegent)
|
||||
bees += B
|
||||
@@ -178,7 +178,7 @@
|
||||
visible_message("<span class='notice'>[user] sets [qb] down inside the apiary, making it [qb.p_their()] new home.</span>")
|
||||
var/relocated = 0
|
||||
for(var/b in bees)
|
||||
var/mob/living/simple_animal/hostile/poison/bees/B = b
|
||||
var/mob/living/basic/bee/B = b
|
||||
if(B.reagent_incompatible(queen_bee))
|
||||
bees -= B
|
||||
B.beehome = null
|
||||
@@ -209,7 +209,7 @@
|
||||
default_unfasten_wrench(user, I, time = 20)
|
||||
|
||||
/obj/structure/beebox/attack_animal(mob/living/simple_animal/M)
|
||||
if(!istype(M, /mob/living/simple_animal/hostile/poison/bees))
|
||||
if(!istype(M, /mob/living/basic/bee))
|
||||
return ..()
|
||||
|
||||
M.forceMove(src)
|
||||
@@ -222,15 +222,15 @@
|
||||
/obj/structure/beebox/attack_hand(mob/user)
|
||||
if(ishuman(user))
|
||||
if(!user.bee_friendly())
|
||||
//Time to get stung!
|
||||
// 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)
|
||||
for(var/b in bees) // everyone who's ever lived here now instantly hates you, suck it assistant!
|
||||
var/mob/living/basic/bee/B = b
|
||||
if(B.is_queen)
|
||||
continue
|
||||
if(B.loc == src)
|
||||
B.forceMove(drop_location())
|
||||
B.target = user
|
||||
B.ai_controller.set_blackboard_key(BB_BASIC_MOB_CURRENT_TARGET, user)
|
||||
bees = TRUE
|
||||
if(bees)
|
||||
visible_message("<span class='danger'>[user] disturbs the bees!</span>")
|
||||
@@ -281,7 +281,7 @@
|
||||
if(disassembled)
|
||||
mat_drop = 40
|
||||
new /obj/item/stack/sheet/wood(loc, mat_drop)
|
||||
for(var/mob/living/simple_animal/hostile/poison/bees/B in bees)
|
||||
for(var/mob/living/basic/bee/B in bees)
|
||||
if(B.loc == src)
|
||||
B.forceMove(drop_location())
|
||||
for(var/obj/item/honey_frame/HF in honey_frames)
|
||||
@@ -292,6 +292,14 @@
|
||||
/obj/structure/beebox/unwrenched
|
||||
anchored = FALSE
|
||||
|
||||
/obj/structure/beebox/proc/habitable(mob/living/basic/target)
|
||||
if(!istype(target, /mob/living/basic/bee))
|
||||
return FALSE
|
||||
var/mob/living/basic/bee/citizen = target
|
||||
if(citizen.reagent_incompatible(queen_bee) || bees.len >= get_max_bees())
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
#undef BEEBOX_MAX_FRAMES
|
||||
#undef BEES_RATIO
|
||||
#undef BEE_PROB_NEW_BEE
|
||||
|
||||
@@ -1138,3 +1138,10 @@
|
||||
myseed.mutate(roll / 2, get_mutation_focus())
|
||||
if(top_range > 30 && prob(roll / 10))
|
||||
mut_beamed = TRUE
|
||||
|
||||
/obj/machinery/hydroponics/proc/can_bee_pollinate()
|
||||
if(isnull(myseed))
|
||||
return FALSE
|
||||
if(dead || recent_bee_visit)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user