This commit is contained in:
DeityLink
2017-07-19 02:12:37 +02:00
parent a7d81c1022
commit 652c517222
15 changed files with 810 additions and 414 deletions

View File

@@ -135,6 +135,7 @@
#define RICE "rice"
#define CHERRYJELLY "cherryjelly"
#define HONEY "honey"
#define ROYALJELLY "royaljelly"
#define DIPPING_SAUCE "dippingsauce"
#define DISCOUNT "discount"
#define IRRADIATEDBEANS "irradiatedbeans"

View File

@@ -674,6 +674,12 @@ SEE_PIXELS 256
#define HOSTILE_STANCE_ATTACKING 4
#define HOSTILE_STANCE_TIRED 5
#define BEE_ROAMING 0
#define BEE_OUT_FOR_PLANTS 1
#define BEE_OUT_FOR_ENEMIES 2
#define BEE_HEADING_HOME 3
#define BEE_SWARM 4
#define ROUNDSTART_LOGOUT_REPORT_TIME 6000 //Amount of time (in deciseconds) after the rounds starts, that the player disconnect report is issued.
//Damage things

View File

@@ -1,5 +1,4 @@
//http://www.youtube.com/watch?v=-1GadTfGFvU
//i could have done these as just an ordinary plant, but fuck it - there would have been too much snowflake code
#define HONEYCOMB_COST 15
@@ -13,39 +12,63 @@
var/yieldmod = 1
var/mut = 1
var/toxic = 0
var/dead = 0
var/health = -1
var/maxhealth = 100
var/lastcycle = 0
var/cycledelay = 100
var/beezeez = 0
var/swarming = 0
var/honey_level = 0
var/list/pollen = list()
var/list/queen_bees_inside = 0
var/list/worker_bees_inside = 0
var/list/bees_outside_hive = list()
var/bees_in_hive = 0
var/list/owned_bee_swarms = list()
var/hydrotray_type = /obj/machinery/portable_atmospherics/hydroponics
var/obj/item/weapon/reagent_containers/glass/consume = null
machine_flags = FIXED2WORK | WRENCHMOVE
//overwrite this after it's created if the apiary needs a custom machinery sprite
/obj/machinery/apiary/New()
..()
overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="apiary0")
overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="apiary")
create_reagents(100)
consume = new()
/obj/machinery/apiary/Destroy()
for (var/datum/bee/B in bees_outside_hive)
B.home = null
..()
/obj/machinery/apiary/update_icon()
overlays.len = 0
overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="apiary")
var/image/I = null
switch(reagents.total_volume)
if(30 to 60)
I = image('icons/obj/apiary_bees_etc.dmi', icon_state="honey_1")
if(60 to 90)
I = image('icons/obj/apiary_bees_etc.dmi', icon_state="honey_2")
if(90 to INFINITY)
I = image('icons/obj/apiary_bees_etc.dmi', icon_state="honey_3")
if(!I)
return
I.color = mix_color_from_reagents(reagents.reagent_list)
overlays += I
/obj/machinery/apiary/examine(mob/user)
..()
if(health > 0)
if(worker_bees_inside || queen_bees_inside)
to_chat(user, "You can hear a loud buzzing coming from the inside.")
else
to_chat(user, "There doesn't seem to be any bees in it.")
switch(honey_level)
if(1)
switch(reagents.total_volume)
if(30 to 60)
to_chat(user, "<span class='info'>Looks like there's a bit of honey in it.</span>")
if(2)
if(60 to 90)
to_chat(user, "<span class='info'>There's a decent amount of honey dripping from it!</span>")
if(3)
if(90 to INFINITY)
to_chat(user, "<span class='info'>It's full of honey!</span>")
/obj/machinery/apiary/bullet_act(var/obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
@@ -54,10 +77,8 @@
else if(istype(Proj ,/obj/item/projectile/energy/florayield))
if(!yieldmod)
yieldmod += 1
// to_chat(world, "Yield increased by 1, from 0, to a total of [myseed.yield]")
else if (prob(1/(yieldmod * yieldmod) *100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
yieldmod += 1
// to_chat(world, "Yield increased by 1, to a total of [myseed.yield]")
else
..()
if(src)
@@ -68,30 +89,30 @@
if(..())
return
if(istype(O, /obj/item/queen_bee))
if(health > 0)
to_chat(user, "<span class='warning'>There is already a queen in there.</span>")
else
if(user.drop_item(O))
health = 10
nutrilevel = min(10,nutrilevel+10)
qdel(O)
to_chat(user, "<span class='notice'>You carefully insert the queen into [src], she gets busy making a hive.</span>")
bees_in_hive = 0
if(user.drop_item(O))
nutrilevel = min(15,nutrilevel+15)
queen_bees_inside++
qdel(O)
to_chat(user, "<span class='notice'>You carefully insert the queen into [src], she gets busy managing the hive.</span>")
else if(istype(O, /obj/item/beezeez))
beezeez += 100
nutrilevel += 10
beezeez += 20
nutrilevel = min(15,nutrilevel+15)
user.drop_item(O)
if(health > 0)
if(queen_bees_inside || worker_bees_inside)
to_chat(user, "<span class='notice'>You insert [O] into [src]. A relaxed humming appears to pick up.</span>")
else
to_chat(user, "<span class='notice'>You insert [O] into [src]. Now it just needs some bees.</span>")
qdel(O)
else if(istype(O, /obj/item/weapon/hatchet))
if(health > 0)
user.visible_message("<span class='danger'>\the [user] begins harvesting the honeycombs, the bees don't like that.</span>","<span class='danger'>You begin harvesting the honeycombs, the bees don't like that.</span>")
angry_swarm(user)
if(reagents.total_volume > 0)
user.visible_message("<span class='notice'>\the [user] begins harvesting the honeycombs.</span>","<span class='danger'>You begin harvesting the honeycombs.</span>")
else
to_chat(user, "<span class='notice'>You begin to dislodge the dead apiary from the tray.</span>")
if(queen_bees_inside || worker_bees_inside)
user.visible_message("<span class='danger'>The bees don't like that.</span>")
angry_swarm(user)
if(do_after(user, src, 50))
var/obj/machinery/created_tray = new hydrotray_type(src.loc)
created_tray.component_parts = list()
@@ -103,30 +124,131 @@
I.forceMove(created_tray)
contents -= I
new /obj/item/apiary(src.loc)
if(health > 0)
while(health > HONEYCOMB_COST)
health -= HONEYCOMB_COST
var/obj/item/weapon/reagent_containers/food/snacks/honeycomb/H = new(src.loc)
if(toxic > 0)
H.reagents.add_reagent(TOXIN, toxic)
if(honey_level >= 3)
new/obj/item/queen_bee(src.loc)
if(harvest_honeycombs())
to_chat(user, "<span class='notice'>You successfully harvest the honeycombs. The empty apiary can be relocated.</span>")
else
to_chat(user, "<span class='notice'>You dislodge the apiary from the tray.</span>")
if (queen_bees_inside || worker_bees_inside)
empty_beehive()
for (var/datum/bee/B in bees_outside_hive)
B.home = null
qdel(src)
else if(istype(O, /obj/item/weapon/bee_net))
var/obj/item/weapon/bee_net/N = O
if(N.caught_bees > 0)
if(N.caught_bees.len)
to_chat(user, "<span class='notice'>You empty the bees into the apiary.</span>")
bees_in_hive += N.caught_bees
N.caught_bees = 0
for (var/datum/bee/B in N.caught_bees)
enterHive(B)
N.caught_bees = list()
else
to_chat(user, "<span class='notice'>There are no more bees in the net.</span>")
else
user.visible_message("<span class='warning'>\the [user] hits \the [src] with \the [O]!</span>","<span class='warning'>You hit \the [src] with \the [O]!</span>")
angry_swarm(user)
/obj/machinery/apiary/proc/enterHive(var/datum/bee/B)
bees_outside_hive.Remove(B)
if (istype(B,/datum/bee/queen_bee))
queen_bees_inside++
var/datum/bee/queen_bee/Q = B
if (Q.colonizing)
nutrilevel = min(15,nutrilevel+15)
else
worker_bees_inside++
B.home = src
B.state = null
B.health = B.maxHealth
for (var/datum/seed/S in B.pollens)
var/potency = round(S.potency)
var/totalreagents = 0
for(var/chem in S.chems)
var/list/reagent_data = list()
if (chem == NUTRIMENT)
if (S.products.len && juice_items.Find(S.products[1]))
reagent_data = S.chems[chem]
else
continue
else
reagent_data = S.chems[chem]
var/rtotal = reagent_data[1]
if(reagent_data.len > 1 && potency > 0)
rtotal += round(potency/reagent_data[2])
totalreagents += rtotal
if(totalreagents)
var/coeff = min(reagents.maximum_volume / totalreagents, 1)
for(var/chem in S.chems)
var/list/reagent_data = list()
var/chemToAdd = null
if (chem == NUTRIMENT)
if (S.products.len && juice_items.Find(S.products[1]))
var/i = juice_items.Find(S.products[1])
chemToAdd = pick(juice_items[juice_items[i]])
reagent_data = S.chems[chem]
else
continue
else
reagent_data = S.chems[chem]
chemToAdd = chem
var/rtotal = reagent_data[1]
if(reagent_data.len > 1 && potency > 0)
rtotal += round(potency/reagent_data[2])
var/amountToAdd = max(1, round(rtotal*coeff, 0.1))
var/difference = amountToAdd + 2.5 + reagents.total_volume - reagents.maximum_volume
if (difference>0)
reagents.trans_to(consume, difference)//This allows bees to bring in new reagents even if the hive is full
reagents.add_reagent(chemToAdd, amountToAdd)
if (!pollen.Find(S))
pollen.Add(S)
if (istype(B,/datum/bee/queen_bee))
reagents.add_reagent(ROYALJELLY,2)
else
reagents.add_reagent(HONEY,2)
reagents.add_reagent(NUTRIMENT, 0.1)
reagents.add_reagent(SUGAR, 0.4)
toxic += B.toxins * 0.1
qdel(B)
update_icon()
/obj/machinery/apiary/proc/harvest_honeycombs()
if (reagents.total_volume < 1)
return 0
var/number_of_honeycombs = min(round(reagents.total_volume / 12.5) + 1 , 8)
var/reagents_per_honeycomb = reagents.total_volume / number_of_honeycombs
var/turf/T = get_turf(src)
var/image/I = image('icons/obj/food.dmi', icon_state="honeycomb-color")
I.color = mix_color_from_reagents(reagents.reagent_list)
for (var/i = 1 to number_of_honeycombs)
var/obj/item/weapon/reagent_containers/food/snacks/honeycomb/H = new(T)
H.reagents.clear_reagents()
H.icon_state = "honeycomb-base"
H.overlays += I
reagents.trans_to(H,reagents_per_honeycomb)
return 1
/obj/machinery/apiary/proc/empty_beehive()
if (!queen_bees_inside && !worker_bees_inside)
return
var/mob/living/simple_animal/bee/lastBees = getFromPool(/mob/living/simple_animal/bee,get_turf(src))
for(var/i = 1 to worker_bees_inside)
worker_bees_inside--
lastBees.addBee(new/datum/bee(src))
for(var/i = 1 to queen_bees_inside)
queen_bees_inside--
lastBees.addBee(new/datum/bee/queen_bee(src))
/obj/machinery/apiary/Cross(atom/movable/mover, turf/target, height=1.5, air_group = 0)
if(air_group || (height==0))
return 1
@@ -137,146 +259,138 @@
return 0
/obj/machinery/apiary/process()
if(swarming > 0)
swarming -= 1
if(swarming <= 0)
for(var/mob/living/simple_animal/bee/B in src.loc)
bees_in_hive += B.strength
returnToPool(B)
else if(bees_in_hive < 10)
for(var/mob/living/simple_animal/bee/B in src.loc)
bees_in_hive += B.strength
returnToPool(B)
if(world.time > (lastcycle + cycledelay))
lastcycle = world.time
if(health < 0)
if(!queen_bees_inside && !worker_bees_inside)
return
//magical bee formula
//handle beezeez
if(beezeez > 0)
beezeez -= 1
nutrilevel += 2
health = min(health+1,maxhealth)
if(prob(10))
if(toxic > 0)
toxic = max(0, toxic - 1)
//handle nutrients
nutrilevel -= bees_in_hive / 10 + owned_bee_swarms.len / 5
if(nutrilevel > 0)
bees_in_hive += 1 * yieldmod
health = min(health+1,maxhealth)
else
//nutrilevel is less than 1, so we're effectively subtracting here
health += max(nutrilevel - 1, round(-health / 2))
bees_in_hive += max(nutrilevel - 1, round(-bees_in_hive / 2))
if(owned_bee_swarms.len)
var/mob/living/simple_animal/bee/B = pick(owned_bee_swarms)
B.target_turf = get_turf(src)
nutrilevel -= worker_bees_inside / 20 + queen_bees_inside /4 + bees_outside_hive.len / 10 //Bees doing work need more nutrients
nutrilevel += 2 * reagents.trans_to(consume, reagents.total_volume * 2 / 100)
for(var/datum/reagent/R in reagents.reagent_list)
if (R.volume < 0.09)
if (R == NUTRIMENT) continue
reagents.del_reagent(R.id,update_totals=0)
// There's currently no queen in the hive, and we've got some spare royal jelly, let's make a new queen
if(reagents.get_reagent_amount(ROYALJELLY) >= 5 && nutrilevel > 10 && queen_bees_inside <= 0 && worker_bees_inside > 1)
queen_bees_inside++
reagents.remove_reagent(ROYALJELLY, 5)
worker_bees_inside--
if(nutrilevel > 10 && queen_bees_inside > 0 && worker_bees_inside < 20)// We got a bunch of nutrients and a queen is here, let's make more bees
worker_bees_inside++
else if (nutrilevel < -5 && worker_bees_inside >= 10)// We're getting in dire need of nutrients, let's starve bees so others can survive
nutrilevel += 3
worker_bees_inside--
else if (nutrilevel <= 0 && bees_outside_hive.len > 1) // We're low on nutrients, let's call back some bees to reduce our costs
for (var/i = 1 to max(1,round(bees_outside_hive.len/3)))
var/datum/bee/B = pick(bees_outside_hive)
B.homeCall()
nutrilevel = min(max(nutrilevel,-10),100)
//handle toxins
var/list/toxic_reagents = list(
TOXIN = 2,
STOXIN = 1,
FLUORINE = 1,
RADIUM = 3,
FUEL = 2,
VOMIT = 1,
BLEACH = 2,
PLANTBGONE = 3,
PLASMA = 2,
SACID = 1,
PACID = 3,
CYANIDE = 4,
AMATOXIN = 2,
AMANATIN = 3,
POISONBERRYJUICE = 2,
CARPOTOXIN = 2,
ZOMBIEPOWDER = 3,
MINDBREAKER = 1,
PLASTICIDE = 2,
)
for(var/datum/reagent/R in consume.reagents.reagent_list)
if (toxic_reagents.Find(R.id))
toxic += R.volume * toxic_reagents[R.id]
//clear out some toxins
if(toxic > 0)
toxic -= 1
health -= 1
toxic = max(0,toxic-0.1)
var/newlevel = 0
if(health >= (HONEYCOMB_COST * 6))
newlevel = 3
else if(health >= (HONEYCOMB_COST * 3))
newlevel = 2
else if(health >= HONEYCOMB_COST)
newlevel = 1
else
newlevel = 0
if(newlevel != honey_level)
overlays -= image('icons/obj/apiary_bees_etc.dmi', icon_state="apiary[honey_level]")
overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="apiary[newlevel]")
honey_level = newlevel
if(health <= 0)
return
to_chat(world,"toxicity = [toxic]")
//making noise
if(prob(2))
playsound(get_turf(src), 'sound/effects/bees.ogg', min(20+(20*honey_level),100), 1)
playsound(get_turf(src), 'sound/effects/bees.ogg', min(20+(reagents.total_volume),100), 1)
//make some new bees
if(bees_in_hive >= 10 && prob(bees_in_hive * 10))
update_icon()
//sending out bees to pollinate
if(worker_bees_inside >= 10 && bees_outside_hive.len < 11)
var/turf/T = get_turf(src)
var/mob/living/simple_animal/bee/B = getFromPool(/mob/living/simple_animal/bee, T, src)
owned_bee_swarms.Add(B)
B.mut = mut
B.toxic = toxic
bees_in_hive -= 1
var/mob/living/simple_animal/bee/B_mob = getFromPool(/mob/living/simple_animal/bee, T, src)
var/datum/bee/B = null
if (queen_bees_inside > 0 && nutrilevel > 0 && worker_bees_inside > 15 && prob(nutrilevel/3))
B = new/datum/bee/queen_bee(src)
queen_bees_inside--
else
B = new(src)
worker_bees_inside--
bees_outside_hive.Add(B)
B_mob.addBee(B)
B.goPollinate()
//find some plants, harvest
for(var/obj/machinery/portable_atmospherics/hydroponics/H in view(7, src))
if(H.seed && !H.dead && prob(owned_bee_swarms.len * 10))
src.nutrilevel++
if(H.nutrilevel < 10)
H.nutrilevel++
if(queen_bees_inside > 1 && worker_bees_inside >= 10)
for(var/obj/machinery/apiary/A in range(src,5))
if (exile_swarm(A))
break
/*if(mut < H.mutation_mod - 1)
mut = H.mutation_mod - 1
else if(mut > H.mutation_mod - 1)
H.mutation_mod = mut*/
consume.reagents.clear_reagents()
//flowers give us pollen (nutrients)
/* - All plants should be giving nutrients to the hive.
if(H.myseed.type == /obj/item/seeds/harebell || H.myseed.type == /obj/item/seeds/sunflowerseed)
src.nutrilevel++
H.nutrilevel++
*/
//have a few beneficial effects on nearby plants
/* - beneficial effects are now applied directly by bees themselves (bees.dm, hydro_tray_process.dm)
if(prob(10))
H.lastcycle -= 5
if(prob(10))
if(!isnull(seed_types[H.seed.name]))
H.seed = H.seed.diverge(-1)
if(H.seed)
H.seed.lifespan = max(initial(H.seed.lifespan) * 1.5, H.seed.lifespan + 1)
if(prob(10))
if(!isnull(seed_types[H.seed.name]))
H.seed = H.seed.diverge(-1)
if(H.seed)
H.seed.endurance = max(initial(H.seed.endurance) * 1.5, H.seed.endurance + 1)
if(H.toxins && prob(10))
H.toxins = min(0, H.toxins - 1)
toxic++
*/
/obj/machinery/apiary/proc/die()
if(owned_bee_swarms.len)
var/mob/living/simple_animal/bee/B = pick(owned_bee_swarms)
B.target_turf = get_turf(src)
B.strength -= 1
if(B.strength <= 0)
returnToPool(B)
else if(B.strength <= 5)
B.icon_state = "bees[B.strength]"
bees_in_hive = 0
health = 0
/obj/machinery/apiary/proc/exile_swarm(var/obj/machinery/apiary/A)
if (A == src)
return 0
if (A.queen_bees_inside > 0 || is_type_in_list(/datum/bee/queen_bee,A.bees_outside_hive))
return 0
var/mob/living/simple_animal/bee/B_mob = getFromPool(/mob/living/simple_animal/bee, get_turf(src), src)
var/datum/bee/queen_bee/new_queen = new(src)
queen_bees_inside--
B_mob.addBee(new_queen)
for (var/i = 1 to 10)
var/datum/bee/B = new(src)
B_mob.addBee(B)
worker_bees_inside--
new_queen.setHome(A)
return 1
/obj/machinery/apiary/proc/angry_swarm(var/mob/M = null)
for(var/mob/living/simple_animal/bee/B in owned_bee_swarms)
B.feral = 25
B.target = M
for(var/datum/bee/B in bees_outside_hive)
B.angerAt(M)
swarming = 25
while(bees_in_hive >= 1)
var/spawn_strength = round(bees_in_hive)
if(bees_in_hive >= 5)
spawn_strength = 6
var/turf/T = get_turf(src)
var/mob/living/simple_animal/bee/B = getFromPool(/mob/living/simple_animal/bee, T, src)
B.target = M
B.strength = spawn_strength
B.feral = 25
B.mut = mut
B.toxic = toxic
bees_in_hive -= spawn_strength
var/mob/living/simple_animal/bee/B_mob = getFromPool(/mob/living/simple_animal/bee, get_turf(src), get_turf(src), src)
for (var/i=1 to worker_bees_inside)
var/datum/bee/B = new(src)
B_mob.addBee(B)
worker_bees_inside--
bees_outside_hive.Add(B)
B.angerAt(M)
B_mob.update_icon()
#undef HONEYCOMB_COST

View File

@@ -13,7 +13,7 @@
item_state = "bee_net"
w_class = W_CLASS_MEDIUM
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/beekeeping.dmi', "right_hand" = 'icons/mob/in-hand/right/beekeeping.dmi')
var/caught_bees = 0
var/list/caught_bees = list()
/obj/item/weapon/bee_net/examine(mob/user)
..()
@@ -31,14 +31,17 @@
var/caught = 0
for(var/mob/living/simple_animal/bee/B in T)
caught = 1
if(B.feral < 0)
caught_bees += B.strength
if(B.calmed > 0 || (B.state != BEE_OUT_FOR_ENEMIES && prob(max(0,100-B.bees.len*4))))
for (var/datum/bee/BEES in B.bees)
caught_bees.Add(BEES)
BEES.home = null
B.home.bees_outside_hive.Remove(BEES)
qdel(B)
B = null
user.visible_message("<span class='notice'>[user] nets some bees.</span>","<span class='notice'>You net up some of the becalmed bees.</span>")
else
user.visible_message("<span class='warning'>[user] swings at some bees, they don't seem to like it.</span>","<span class='warning'>You swing at some bees, they don't seem to like it.</span>")
B.feral = 5
B.state = BEE_OUT_FOR_ENEMIES
B.target = user
if(!caught)
to_chat(user, "<span class='warning'>There are no bees in front of you!</span>")
@@ -48,14 +51,14 @@
var/caught = 0
for(var/mob/living/simple_animal/bee/B in T)
caught = 1
if(B.feral < 0)
caught_bees += B.strength
if(B.calmed > 0)
caught_bees += B.bees.len
qdel(B)
B = null
user.visible_message("<span class='notice'>[user] nets some bees.</span>","<span class='notice'>You net up some of the becalmed bees.</span>")
else
user.visible_message("<span class='warning'>[user] swings at some bees, they don't seem to like it.</span>","<span class='warning'>You swing at some bees, they don't seem to like it.</span>")
B.feral = 5
B.state = BEE_OUT_FOR_ENEMIES
B.target = user
if(!caught)
to_chat(user, "<span class='warning'>There are no bees in front of you!</span>")
@@ -68,21 +71,25 @@
if(iscarbon(usr))
M = usr
while(caught_bees > 0)
while(caught_bees.len > 0)
//release a few super massive swarms
while(caught_bees > 5)
while(caught_bees.len > 5)
var/mob/living/simple_animal/bee/B = new(src.loc)
B.feral = 5
for (var/i = 1 to 5)
var/datum/bee/BEE = pick(caught_bees)
caught_bees -= BEE
BEE.state = BEE_OUT_FOR_ENEMIES
B.addBee(BEE)
B.target = M
B.strength = 6
B.icon_state = "bees_swarm"
caught_bees -= 6
//what's left over
var/mob/living/simple_animal/bee/B = new(src.loc)
B.strength = caught_bees
B.icon_state = "bees[B.strength]"
B.feral = 5
for (var/i = 1 to caught_bees.len)
var/datum/bee/BEE = pick(caught_bees)
caught_bees -= BEE
BEE.state = BEE_OUT_FOR_ENEMIES
B.addBee(BEE)
B.target = M
caught_bees = 0
@@ -125,6 +132,14 @@
alpha = 200
nutriment_factor = 15 * REAGENTS_METABOLISM
/datum/reagent/honey/royal_jelly
name = "Royal Jelly"
id = ROYALJELLY
description = "A pale yellow liquid that is both spicy and acidic, yet also sweet."
color = "#FFDA6A"
alpha = 220
nutriment_factor = 15 * REAGENTS_METABOLISM
/datum/reagent/honey/on_mob_life(var/mob/living/M as mob)
if(ishuman(M))
var/mob/living/carbon/human/H = M

View File

@@ -77,7 +77,7 @@
/obj/item/weapon/grenade/spawnergrenade/beenade
name = "bee-nade"
icon_state = "beenade"
spawner_type = /mob/living/simple_animal/bee
spawner_type = /mob/living/simple_animal/bee/angry
deliveryamt = 15
origin_tech = Tc_MATERIALS + "=3;" + Tc_MAGNETS + "=4;" + Tc_BIOTECH + "=4"
@@ -86,13 +86,4 @@
if(!spawned_atoms || !spawned_atoms.len)
return
playsound(get_turf(src), 'sound/effects/bees.ogg', 100, 1)
for(var/A in spawned_atoms)
var/mob/living/simple_animal/bee/BEE = A
if(!istype(BEE))
continue
BEE.strength = 1
BEE.toxic = 5
BEE.mut = 2
BEE.feral = 25
BEE.icon_state = "bees1-feral"
BEE.newTarget()

View File

@@ -145,16 +145,19 @@
/obj/item/weapon/storage/briefcase/bees/show_to(mob/user as mob)
if(!released)
release()
release(user)
..()
/obj/item/weapon/storage/briefcase/bees/proc/release()
visible_message("<span class='danger'>A swarm of bees pours out of \the [src]!</span>")
var/mob/living/simple_animal/bee/BEE = new(get_turf(src))
BEE.strength = 20
BEE.toxic = 5
BEE.mut = 2
BEE.feral = 25
BEE.icon_state = "bees_swarm-feral"
BEE.newTarget()
/obj/item/weapon/storage/briefcase/proc/hit_effect(var/mob/living/M, var/mob/living/user)
return
/obj/item/weapon/storage/briefcase/bees/hit_effect(var/mob/living/M, var/mob/living/user)
if(!released)
release(M)
/obj/item/weapon/storage/briefcase/bees/proc/release(var/mob/user)
released = TRUE
visible_message("<span class='danger'>A swarm of bees pours out of \the [src]!</span>")
var/mob/living/simple_animal/bee/swarm/BEES = new(get_turf(src))
BEES.forceMove(user.loc)
BEES.target = user

View File

@@ -3001,12 +3001,14 @@
world << sound('sound/effects/bees.ogg')
for(var/mob/living/M in player_list)
var/mob/living/simple_animal/bee/BEE = new(get_turf(M))
BEE.strength = 16
BEE.toxic = 5
BEE.mut = 2
BEE.feral = 25
for (var/i = 1 to 16)
var/datum/bee/B = new()
B.toxic = 5
B.mut = 2
B.state = BEE_OUT_FOR_ENEMIES
BEE.addBee(B)
BEE.updateState = 1
BEE.target = M
BEE.icon_state = "bees_swarm-feral"
if("virus")
feedback_inc("admin_secrets_fun_used",1)

View File

@@ -43,7 +43,8 @@
var/force_update // Set this to bypass the cycle time check.
var/skip_aging = 0 // Don't advance age for the next N cycles.
var/bees = 0 //Are there currently bees above the tray?
var/pollination = 0
var/bees = 0 //Are the trays currently affected by the bees' pollination?
//var/decay_reduction = 0 //How much is mutation decay reduced by?
var/weed_coefficient = 1 //Coefficient to the chance of weeds appearing

View File

@@ -12,11 +12,12 @@
return
lastcycle = world.time
var/mob/living/simple_animal/bee/BEE = locate() in loc
if(BEE && (BEE.feral < 1))
bees = 1
else
if (pollination <= 0)
bees = 0
else
pollination--
bees = 1
// Weeds like water and nutrients, there's a chance the weed population will increase.
// Bonus chance if the tray is unoccupied.
@@ -214,9 +215,6 @@
if(toxins > seed.toxins_tolerance)
health -= toxin_uptake
toxins -= toxin_uptake * (1+bees)
if(BEE && BEE.parent)
var/obj/machinery/apiary/A = BEE.parent
A.toxic = Clamp(A.toxic + toxin_uptake/2, 0, 25) //gotta be careful where you let your bees hang around
if(draw_warnings)
update_icon_after_process = 1

View File

@@ -1,25 +1,124 @@
#define TIME_TO_POLLINATE 4//how long (in seconds) will a bee remain on a plant before moving to the next one
#define DURATION_OF_POLLINATION 8//how long (in seconds) will the plant be enhanced by the bees (starts as soon as the bees begin pollination)
#define FATIGUE_PER_POLLINATIONS 4//how much extra fatigue does the bee receive from performing a successful pollination (if set to 0, the bee won't stop until there are no more flowers in range)
#define FATIGUE_TO_RETURN 20//once reached, the bee will head back to its hive
#define BOREDOM_TO_RETURN 20//once reached, the bee will head back to its hive
//////////////////////BEE DATUMS///////////////////////////////////////
/datum/bee
var/mob/living/simple_animal/bee/mob = null
var/obj/machinery/apiary/home = null
var/mut = 1//the brute damage dealt by a sting. Set when leaving the hive (spawning).
var/toxic = 0//the extra toxic damage dealt by a sting. Set when leaving the hive (spawning).
var/health = 10
var/maxHealth = 10
var/list/pollens = list()//flowers (seed_datums) that were pollinated by that bee
var/state = BEE_ROAMING
var/fatigue = 0//increases after a successful pollination or when searching for flowers in vain
var/bored = 0//increases when searching for enemies in vain
var/corpse = /obj/effect/decal/cleanable/bee
var/toxins = 0
/datum/bee/New(var/obj/machinery/apiary/spawner = null)
..()
if (spawner)
home = spawner
mut = spawner.mut
toxic = spawner.toxic
/datum/bee/proc/goPollinate()
state = BEE_OUT_FOR_PLANTS
mob.updateState = 1
/datum/bee/proc/angerAt(var/mob/M = null)
if (state == BEE_SWARM)
return
state = BEE_OUT_FOR_ENEMIES
mob.target = M
mob.updateState = 1
/datum/bee/proc/homeCall()
state = BEE_HEADING_HOME
mob.updateState = 1
/datum/bee/proc/Die()
if (mob)
new corpse(get_turf(mob))
mob.bees.Remove(src)
mob = null
if (home)
home.bees_outside_hive -= src
home = null
qdel(src)
/datum/bee/queen_bee
health = 15
maxHealth = 15
corpse = /obj/effect/decal/cleanable/bee/queen_bee
var/colonizing = 0
/datum/bee/queen_bee/proc/setHome(var/obj/machinery/apiary/A)
state = BEE_SWARM
colonizing = 1
mob.destination = A
mob.updateState = 1
//////////////////////BEE CORPSES///////////////////////////////////////
/obj/effect/decal/cleanable/bee
name = "dead bee"
desc = "This one stung for the last time."
gender = PLURAL
icon = 'icons/obj/apiary_bees_etc.dmi'
icon_state = "bee_dead"
anchored = 0
mouse_opacity = 1
plane = MOB_PLANE
/obj/effect/decal/cleanable/bee/New()
..()
dir = pick(cardinal)
pixel_x = rand(-10,10)
pixel_y = rand(-4,4)
/obj/effect/decal/cleanable/bee/queen_bee
name = "dead queen bee"
icon_state = "queen_bee_dead"
//////////////////////BEE MOB///////////////////////////////////////
/mob/living/simple_animal/bee
name = "bees"
icon = 'icons/obj/apiary_bees_etc.dmi'
icon_state = "bees1"
icon_dead = "bees1"
icon_dead = "bee_dead"
mob_property_flags = MOB_SWARM
size = SIZE_TINY
can_butcher = 0
var/strength = 1
var/feral = 0
var/mut = 0
var/toxic = 0
var/turf/target_turf
var/mob/target
var/obj/machinery/apiary/parent
var/updateState = 0//if set to 1, the bee mob will check if it should split based on its bee datums' intents
var/state = null
var/atom/destination = null
var/list/bees = list()
var/mob/target = null
var/current_physical_damage = 0
var/current_poison_damage = 0
var/obj/machinery/apiary/home = null
var/calmed = 0
var/pollinating = 0
var/obj/machinery/portable_atmospherics/hydroponics/target_plant = null
var/list/visited_plants = list()
pass_flags = PASSTABLE
turns_per_move = 6
density = 0
var/obj/machinery/portable_atmospherics/hydroponics/my_hydrotray
// Allow final solutions.
min_oxy = 5
@@ -37,17 +136,18 @@
flying = 1
meat_type = 0
var/max_hive_dist=5
held_items = list()
/mob/living/simple_animal/bee/New(loc, var/obj/machinery/apiary/new_parent)
/mob/living/simple_animal/bee/New(loc, var/obj/machinery/apiary/new_home)
..()
parent = new_parent
home = new_home
/mob/living/simple_animal/bee/Destroy()
..()
if(parent)
parent.owned_bee_swarms.Remove(src)
if(home)
for (var/datum/bee/B in bees)
home.bees_outside_hive -= B
/mob/living/simple_animal/bee/Die()
returnToPool(src)
@@ -64,10 +164,15 @@
qdel(src)
/mob/living/simple_animal/bee/Cross(atom/movable/mover, turf/target, height=1.5, air_group = 0)
if(istype(mover, /obj/item/projectile))
if (prob(min(100,bees.len * 4)))//Projectiles are more likely to hit if there are many bees in the swarm
return 0
return 1
//DEALING WITH DAMAGE
/mob/living/simple_animal/bee/attackby(var/obj/item/O as obj, var/mob/user as mob)
user.delayNextAttack(8)
if (istype(O,/obj/item/weapon/bee_net)) return
if(O.force)
var/damage = O.force
if (O.damtype == HALLOSS)
@@ -81,6 +186,15 @@
if(P && P.firer)
panic_attack(P.firer)
/mob/living/simple_animal/bee/ex_act(severity)
switch(severity)
if (1)
qdel(src)
if (2)
adjustBruteLoss(100)
if (3)
adjustBruteLoss(20)
/mob/living/simple_animal/bee/attack_hand(mob/living/carbon/human/M as mob)//punching bees!
..()
if((M.a_intent == I_HURT) || (M.a_intent == I_DISARM))
@@ -98,45 +212,117 @@
panic_attack(H)
/mob/living/simple_animal/bee/adjustBruteLoss(var/amount)
if(status_flags & GODMODE)
return 0 //godmode
while (amount > 0 && bees.len)
var/datum/bee/B = pick(bees)
if (B.health > amount)
B.health -= amount
amount = 0
else
amount -= B.health
B.Die()
if (bees.len <= 0)
qdel(src)
update_icon()
//CUSTOM PROCS
/mob/living/simple_animal/bee/proc/addBee(var/datum/bee/B)
var/total_mut = 0
var/total_toxic = 0
bees.Add(B)
B.mob = src
home = B.home
for (var/datum/bee/BEE in bees)
total_mut += BEE.mut
total_toxic += BEE.toxic
current_physical_damage = max(2,round((bees.len+total_mut)/2))
current_poison_damage = max(1,round((bees.len+total_toxic)/10))
update_icon()
/mob/living/simple_animal/bee/proc/panic_attack(mob/damagesource)
for(var/mob/living/simple_animal/bee/B in range(src,3))
B.feral = 15
if (B.state == BEE_SWARM || calmed > 0)
return
B.state = BEE_OUT_FOR_ENEMIES
B.target = damagesource
/mob/living/simple_animal/bee/wander_move(var/turf/dest)
var/goodmove=0
if(!my_hydrotray || my_hydrotray.loc != src.loc || my_hydrotray.dead || !my_hydrotray.seed)
// Wander the wastes
goodmove=1
else
// Restrict bee to area within distance of tray
var/turf/hiveturf = get_turf(my_hydrotray)
var/current_dist = get_dist(src,hiveturf)
var/new_dist = get_dist(dest,hiveturf)
// If we're beyond hive max range and we're not feral, we can only move towards or parallel to the hive.
if(current_dist > max_hive_dist && !feral)
if(new_dist <= current_dist)
goodmove=1
else
// Otherwise, we can move anywhere we like.
goodmove=1
if(goodmove)
Move(dest)
/mob/living/simple_animal/bee/proc/newTarget()
var/list/neabyMobs = list()
for(var/mob/living/G in view(src,7))
neabyMobs += G
target = pick(neabyMobs)
////////////////////////////////LIFE////////////////////////////////////////
/mob/living/simple_animal/bee/Life()
if(timestopped)
return 0 //under effects of time magick
..()
if(stat != DEAD) //If we're alive, see if we can be calmed down.
//smoke, water and steam calms us down
var/calming = 0
if (bees.len <= 0)
qdel(src)
if(stat != DEAD)
//SPLITTING THE SWARM DEPENDING ON THEIR INTENT
if (updateState)
updateState = 0
var/list/swarmers = list()
var/list/home_goers = list()
var/list/pollinaters = list()
var/list/fighters = list()
var/turf/T = get_turf(src)
for (var/datum/bee/B in bees)
if (B.state == BEE_SWARM)
swarmers.Add(B)
if (B.state == BEE_HEADING_HOME)
home_goers.Add(B)
if (B.state == BEE_OUT_FOR_PLANTS)
pollinaters.Add(B)
if (B.state == BEE_OUT_FOR_ENEMIES)
fighters.Add(B)
if (swarmers.len > 0) // this intent comes from a queen, and thus overrides the intents of every other bee in the swarm
for (var/datum/bee/B in bees)
B.state = BEE_SWARM
B.home = destination
home = destination
state = BEE_SWARM
if (home_goers.len > 0)
if (home_goers.len == bees.len)
state = BEE_HEADING_HOME
else
var/mob/living/simple_animal/bee/B_mob = getFromPool(/mob/living/simple_animal/bee,T)
for (var/datum/bee/B in home_goers)
B_mob.addBee(B)
bees.Remove(B)
B_mob.home = home
B_mob.updateState = 1
if (pollinaters.len > 0)
if (pollinaters.len == bees.len)
state = BEE_OUT_FOR_PLANTS
else
var/mob/living/simple_animal/bee/B_mob = getFromPool(/mob/living/simple_animal/bee,T)
for (var/datum/bee/B in pollinaters)
B_mob.addBee(B)
bees.Remove(B)
B_mob.home = home
B_mob.updateState = 1
if (fighters.len > 0)
state = BEE_OUT_FOR_ENEMIES
///////////////////////////CALMING STUFF/////////////////////////////////////////
var/list/calmers = list(
/obj/effect/decal/chemical_puff,
/obj/effect/effect/smoke/chem,
@@ -146,151 +332,253 @@
/obj/effect/mist,
)
if (calmed > 0)
calmed--
for(var/this_type in calmers)
var/obj/effect/check_effect = locate(this_type) in src.loc
if(check_effect && (check_effect.reagents.has_reagent(WATER) || check_effect.reagents.has_reagent(HOLYWATER)))
calming = 1
calmed = 6
if (state == BEE_OUT_FOR_ENEMIES)
src.visible_message("<span class='notice'>The bees calm down!</span>")
for (var/datum/bee/B)
B.state = BEE_HEADING_HOME
updateState = 1
break
if(calming)
var/oldferal = feral
feral = -10
if(oldferal > 0 && feral <= 0)
src.visible_message("<span class='notice'>The bees calm down!</span>")
target = null
target_turf = null
wander = 1
////////////////ATTACKING STUFF///////////////////////////////////////////
if(stat == CONSCIOUS)
//if we're strong enough, sting some people
var/mob/living/carbon/human/M = target
var/sting_prob = 100 // Bees will always try to sting.
if(M in view(src,1)) // Can I see my target?
if(prob(max(feral * 10, 0))) // Am I mad enough to want to sting? And yes, when I initially appear, I AM mad enough
if(istype(M))
var/obj/item/clothing/worn_suit = M.wear_suit
var/obj/item/clothing/worn_helmet = M.head
if(worn_suit) // Are you wearing clothes?
sting_prob -= min(worn_suit.armor["bio"],70) // Is it sealed? I can't get to 70% of your body.
if(worn_helmet)
sting_prob -= min(worn_helmet.armor["bio"],30) // Is your helmet sealed? I can't get to 30% of your body.
if( prob(sting_prob) && (M.stat == CONSCIOUS || (M.stat == UNCONSCIOUS && prob(25))) ) // Try to sting! If you're not moving, think about stinging.
M.apply_damage(min(strength,2)+mut, BRUTE) // Stinging. The more mutated I am, the harder I sting.
M.apply_damage((round(feral/5,1)*(max((round(strength/10,1)),1)))+toxic, TOX) // Bee venom based on how angry I am and how many there are of me!
to_chat(M, "<span class='warning'>You have been stung!</span>")
M.flash_pain()
//if we're chasing someone, get a little bit angry
if(target && prob(10))
feral++
//calm down a little bit
if(feral > 0)
if(prob(feral * 10))
feral -= 1
else
//if feral is less than 0, we're becalmed by smoke or steam
if(feral < 0)
feral += 1
if(calmed > 0)
if(target)
target = null
target_turf = null
if(strength > 5)
if(bees.len > 5)
//calm down and spread out a little
var/turf/T = get_turf(pick(orange(src,1)))
var/mob/living/simple_animal/bee/B = getFromPool(/mob/living/simple_animal/bee,T)
B.strength = rand(1,5)
src.strength -= B.strength
if(src.strength <= 5)
src.icon_state = "bees[src.strength]"
B.icon_state = "bees[B.strength]"
if(src.parent)
B.parent = src.parent
src.parent.owned_bee_swarms.Add(B)
var/mob/living/simple_animal/bee/B_mob = getFromPool(/mob/living/simple_animal/bee,get_turf(src))
for (var/i = 1 to rand(1,5))
var/datum/bee/B = pick(bees)
B_mob.addBee(B)
bees.Remove(B)
B_mob.calmed = calmed
B_mob.state = state
B_mob.home = home
B_mob.Move(get_turf(pick(orange(src,1))))
//make some noise
else if(state == BEE_OUT_FOR_ENEMIES && M in view(src,1))
var/sting_prob = 100
if(istype(M))
var/obj/item/clothing/worn_suit = M.wear_suit
var/obj/item/clothing/worn_helmet = M.head
if(worn_suit)
sting_prob -= min(worn_suit.armor["bio"],70) // Is it sealed? I can't get to 70% of your body.
if(worn_helmet)
sting_prob -= min(worn_helmet.armor["bio"],30) // Is your helmet sealed? I can't get to 30% of your body.
if( prob(sting_prob) && (M.stat == CONSCIOUS || (M.stat == UNCONSCIOUS && prob(25))) ) // Try to sting! If you're not moving, think about stinging.
M.apply_damage(current_physical_damage, BRUTE) // Stinging. The more mutated I am, the harder I sting.
M.apply_damage(current_poison_damage, TOX) // Bee venom based on how angry I am and how many there are of me!
to_chat(M, "<span class='warning'>You have been stung!</span>")
M.flash_pain()
///////////////////////NOISE STUFF
if(prob(1))
if(prob(50))
src.visible_message("<span class='notice'>[pick("Buzzzz.","Hmmmmm.","Bzzz.")]</span>")
playsound(get_turf(src), 'sound/effects/bees.ogg', min(20*strength,100), 1)
playsound(get_turf(src), 'sound/effects/bees.ogg', min(20*bees.len,100), 1)
for(var/mob/living/simple_animal/bee/B in src.loc)
if(B == src)
////////////////////////GROUPING STUFF
for(var/mob/living/simple_animal/bee/B_mob in src.loc)
if(B_mob == src)
continue
if(B_mob.home != home)
continue
if(state == BEE_OUT_FOR_ENEMIES && B_mob.state != BEE_SWARM)
for (var/datum/bee/B in B_mob.bees)
addBee(B)
B_mob.bees = list()
visited_plants.Add(B_mob.visited_plants)
if(!target)
target = B_mob.target
qdel(B_mob)
else if(pollinating <= 0 && prob(30) && state == B_mob.state)
for (var/datum/bee/B in B_mob.bees)
addBee(B)
B_mob.bees = list()
visited_plants.Add(B_mob.visited_plants)
qdel(B_mob)
if(feral > 0)
src.strength += B.strength
returnToPool(B)
src.icon_state = "bees[src.strength]"
if(strength > 5)
icon_state = "bees_swarm"
else if(prob(10))
//make the other swarm of bees stronger, then move away
var/total_bees = B.strength + src.strength
if(total_bees < 10)
B.strength = min(5, total_bees)
src.strength = total_bees - B.strength
//spreading out a bit
if(bees.len > 1 && pollinating <= 0 && prob(bees.len*2))
var/mob/living/simple_animal/bee/B_mob = getFromPool(/mob/living/simple_animal/bee,get_turf(src))
var/datum/bee/B = pick(bees)
B_mob.addBee(B)
bees.Remove(B)
B_mob.calmed = calmed
B_mob.state = state
B_mob.update_icon()
B_mob.home = home
B_mob.visited_plants.Add(visited_plants)
B_mob.Move(get_turf(pick(orange(src,1))))
B.icon_state = "bees[B.strength]"
if(src.strength <= 0)
returnToPool(B)
return
src.icon_state = "bees[B.strength]"
var/turf/simulated/floor/T = get_turf(get_step(src, pick(1,2,4,8)))
if(T.Enter(src, get_turf(src)))
src.forceMove(T)
break
if(target)
if(target in view(src,7))
///////////////TARGETING PEOPLE
if(state == BEE_OUT_FOR_ENEMIES)
var/turf/target_turf = null
if(target && target in view(src,7))
target_turf = get_turf(target)
wander = 0
else
var/list/nearbyMobs = list()
for(var/mob/living/G in view(src,7))
if (istype(G,/mob/living/simple_animal/bee))
var/mob/living/simple_animal/bee/B = G
if (B.home == home)//we'll allow bees to fight bees from other hives
continue
if (G.flags & INVULNERABLE) continue
if (G.stat != DEAD)
nearbyMobs += G
if (nearbyMobs.len > 0)
target = pick(nearbyMobs)
if (target)
src.visible_message("<span class='warning'>The bees swarm after [target]!</span>")
else
for (var/datum/bee/B in bees)
B.bored++
if (B.fatigue > BOREDOM_TO_RETURN)
B.homeCall()
else // My target's gone! But I might still be pissed! You there. You look like a good stinging target!
newTarget()
if(target_turf)
var/tdir = get_dir(src,target_turf)
var/turf/move_to = get_step(src, tdir)
walk_to(src,move_to)
if(target_turf)
var/tdir=get_dir(src,target_turf) // This was called thrice. Optimize.
var/turf/move_to=get_step(src, tdir) // Called twice.
walk_to(src,move_to)
if (prob(1))
src.visible_message("<span class='notice'>The bees swarm after [target]!</span>")
if(src.loc == target_turf)
target_turf = null
if(src.loc == target_turf)
wander = 1
//////////////TARGETING FLOWERS
if(state == BEE_OUT_FOR_PLANTS && pollinating <= 0)
var/turf/target_turf = null
if(target_plant && target_plant in view(src,7))
target_turf = get_turf(target_plant)
wander = 0
else
var/list/nearbyPlants = list()
for(var/obj/machinery/portable_atmospherics/hydroponics/H in view(src,2))
if (!H.dead && H.seed)
nearbyPlants += H
nearbyPlants.Remove(visited_plants)
if (nearbyPlants.len > 0)
target_plant = pick(nearbyPlants)
else
for (var/datum/bee/B in bees)
B.fatigue++
if (B.fatigue > FATIGUE_TO_RETURN)
B.homeCall()
if(target_turf)
var/tdir = get_dir(src,target_turf)
var/turf/move_to = get_step(src, tdir)
if (calmed <= 0)
walk_to(src,move_to)
if(src.loc == target_turf)
visited_plants.Add(target_plant)
pollinating = TIME_TO_POLLINATE
target_plant.pollination = DURATION_OF_POLLINATION
else if (pollinating > 0)
pollinating--
if (pollinating == 0)
for (var/datum/bee/B in bees)
B.pollens += target_plant.seed
B.toxins += target_plant.toxins
B.fatigue += FATIGUE_PER_POLLINATIONS
target_plant = null
wander = 1
else
//find some flowers, harvest
//angry bee swarms don't hang around
if(feral > 0)
turns_per_move = rand(1,3)
else if(feral < 0)
turns_since_move = 0
else if(!my_hydrotray || my_hydrotray.loc != src.loc || my_hydrotray.dead || !my_hydrotray.seed)
var/obj/machinery/portable_atmospherics/hydroponics/my_hydrotray = locate() in src.loc
if(my_hydrotray)
if(!my_hydrotray.dead && my_hydrotray.seed)
turns_per_move = rand(20,50)
else
my_hydrotray = null
animate(src, pixel_x = rand(-12,12) * PIXEL_MULTIPLIER, pixel_y = rand(-12,12) * PIXEL_MULTIPLIER, time = 10, easing = SINE_EASING)
/*
if(!parent && prob(10))
strength -= 1
if(strength <= 0)
returnToPool(src)
else if(strength <= 5)
icon_state = "bees[strength]"
*/
//////////////TARGETING APIARY
if(feral > 0)
if(strength <= 5)
icon_state = "bees[max(strength,1)]-feral"
else
icon_state = "bees_swarm-feral"
if(state == BEE_HEADING_HOME || state == BEE_SWARM)
wander = 0
var/turf/target_turf = get_turf(home)
if(target_turf)
var/tdir = get_dir(src,target_turf)
var/turf/move_to = get_step(src, tdir)
if (calmed <= 0)
walk_to(src,move_to)
//debugging
/*icon_state = "[strength]"
if(strength > 5)
icon_state = "unknown"*/
if(src.loc == target_turf)
for(var/datum/bee/B in bees)
home.enterHive(B)
qdel(src)
else
wander = 1
update_icon()
/mob/living/simple_animal/bee/update_icon()
overlays.len = 0
var/queen = 0
for (var/D in bees)
if (istype(D,/datum/bee/queen_bee))
queen = 1
if (bees.len >= 15)
icon_state = "bees-swarm"
else
icon_state = "bees[min(bees.len-queen,10)]"
if (state == BEE_OUT_FOR_ENEMIES)
icon_state += "-feral"
if (queen)
overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="queen_bee-feral")
else if (queen)
overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="queen_bee")
animate(src, pixel_x = rand(-12,12) * PIXEL_MULTIPLIER, pixel_y = rand(-12,12) * PIXEL_MULTIPLIER, time = 10, easing = SINE_EASING)
////////////////////////////BEE PRESETS//////////////////////////////////////////////////
/mob/living/simple_animal/bee/adminSpawned/New(loc, var/obj/machinery/apiary/new_home)
..()
var/datum/bee/B = new()
addBee(B)
update_icon()
/mob/living/simple_animal/bee/adminSpawnedQueen/New(loc, var/obj/machinery/apiary/new_home)
..()
var/datum/bee/queen_bee/B = new()
B.colonizing = 1//so it can start a colony if someone places it in an empty hive
addBee(B)
update_icon()
//BEE-NADE & BEE-ULLET
/mob/living/simple_animal/bee/angry/New(loc, var/obj/machinery/apiary/new_home)
..()
var/datum/bee/B = new()
B.toxic = 5
B.mut = 2
B.state = BEE_OUT_FOR_ENEMIES
state = BEE_OUT_FOR_ENEMIES
addBee(B)
update_icon()
//BEE-IEFCASE
/mob/living/simple_animal/bee/swarm/New(loc, var/obj/machinery/apiary/new_home)
..()
for (var/i = 1 to 20)
var/datum/bee/B = new()
B.toxic = 5
B.mut = 2
B.state = BEE_OUT_FOR_ENEMIES
addBee(B)
state = BEE_OUT_FOR_ENEMIES
update_icon()

View File

@@ -383,13 +383,7 @@
bumped = 1
var/turf/T = get_turf(src)
var/mob/living/simple_animal/bee/BEE = new(T)
BEE.strength = 1
BEE.toxic = 5
BEE.mut = 2
BEE.feral = 25
BEE.icon_state = "bees1-feral"
var/mob/living/simple_animal/bee/angry/BEE = new(T)
if(istype(A,/mob/living))
var/mob/living/M = A
visible_message("<span class='warning'>\the [M.name] is hit by \the [src.name] in the [parse_zone(def_zone)]!</span>")
@@ -397,8 +391,6 @@
admin_warn(M)
BEE.forceMove(M.loc)
BEE.target = M
else
BEE.newTarget()
bullet_die()
/obj/item/projectile/bullet/APS //Armor-piercing sabot round. Metal rods become this when fired from a railgun.

View File

@@ -37,20 +37,6 @@
/obj/item/weapon/reagent_containers/food = list("generic",0)
)
var/list/juice_items = list (
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato = list(TOMATOJUICE,0),
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot = list(CARROTJUICE,0),
/obj/item/weapon/reagent_containers/food/snacks/grown/berries = list(BERRYJUICE,0),
/obj/item/weapon/reagent_containers/food/snacks/grown/banana = list(BANANA,0),
/obj/item/weapon/reagent_containers/food/snacks/grown/potato = list(POTATO,0),
/obj/item/weapon/reagent_containers/food/snacks/grown/lemon = list(LEMONJUICE,0),
/obj/item/weapon/reagent_containers/food/snacks/grown/orange = list(ORANGEJUICE,0),
/obj/item/weapon/reagent_containers/food/snacks/grown/lime = list(LIMEJUICE,0),
/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon = list(WATERMELONJUICE,0),
/obj/item/weapon/reagent_containers/food/snacks/watermelonslice = list(WATERMELONJUICE,0),
/obj/item/weapon/reagent_containers/food/snacks/grown/poisonberries = list(POISONBERRYJUICE,0),
)
var/obj/item/crushable = null

View File

@@ -1,5 +1,21 @@
/obj/machinery/reagentgrinder
var/global/list/juice_items = list (
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato = list(TOMATOJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot = list(CARROTJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/berries = list(BERRYJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/banana = list(BANANA = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/potato = list(POTATO = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/apple = list(APPLEJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/lemon = list(LEMONJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/orange = list(ORANGEJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/lime = list(LIMEJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon = list(WATERMELONJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/watermelonslice = list(WATERMELONJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/poisonberries = list(POISONBERRYJUICE = 0),
)
/obj/machinery/reagentgrinder
name = "All-In-One Grinder"
icon = 'icons/obj/kitchen.dmi'
icon_state = "juicer1"
@@ -49,23 +65,6 @@
/obj/item/weapon/reagent_containers/food = list()
)
var/list/juice_items = list (
//Juicer Stuff
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato = list(TOMATOJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot = list(CARROTJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/berries = list(BERRYJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/banana = list(BANANA = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/potato = list(POTATO = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/apple = list(APPLEJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/lemon = list(LEMONJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/orange = list(ORANGEJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/lime = list(LIMEJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/watermelon = list(WATERMELONJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/watermelonslice = list(WATERMELONJUICE = 0),
/obj/item/weapon/reagent_containers/food/snacks/grown/poisonberries = list(POISONBERRYJUICE = 0),
)
var/list/holdingitems = list()
var/targetMoveKey

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 163 KiB