mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
bees 2
This commit is contained in:
@@ -680,6 +680,26 @@ SEE_PIXELS 256
|
||||
#define BEE_HEADING_HOME 3
|
||||
#define BEE_SWARM 4
|
||||
|
||||
#define LOC_KITCHEN 0
|
||||
#define LOC_ATMOS 1
|
||||
#define LOC_INCIN 2
|
||||
#define LOC_CHAPEL 3
|
||||
#define LOC_LIBRARY 4
|
||||
#define LOC_HYDRO 5
|
||||
#define LOC_VAULT 6
|
||||
#define LOC_TECH 7
|
||||
|
||||
#define VERM_MICE 0
|
||||
#define VERM_LIZARDS 1
|
||||
#define VERM_SPIDERS 2
|
||||
#define VERM_SLIMES 3
|
||||
#define VERM_BATS 4
|
||||
#define VERM_BORERS 5
|
||||
#define VERM_MIMICS 6
|
||||
#define VERM_ROACHES 7
|
||||
#define VERM_GREMLINS 8
|
||||
#define VERM_BEES 9
|
||||
|
||||
#define ROUNDSTART_LOGOUT_REPORT_TIME 6000 //Amount of time (in deciseconds) after the rounds starts, that the player disconnect report is issued.
|
||||
|
||||
//Damage things
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
//http://www.youtube.com/watch?v=-1GadTfGFvU
|
||||
|
||||
#define HONEYCOMB_COST 15
|
||||
|
||||
/obj/machinery/apiary
|
||||
name = "apiary tray"
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
@@ -10,7 +8,7 @@
|
||||
anchored = 1
|
||||
var/nutrilevel = 0
|
||||
var/yieldmod = 1
|
||||
var/mut = 1
|
||||
var/damage = 1
|
||||
var/toxic = 0
|
||||
|
||||
var/lastcycle = 0
|
||||
@@ -18,15 +16,17 @@
|
||||
var/beezeez = 0
|
||||
var/list/pollen = list()
|
||||
|
||||
var/list/queen_bees_inside = 0
|
||||
var/list/worker_bees_inside = 0
|
||||
var/queen_bees_inside = 0
|
||||
var/worker_bees_inside = 0
|
||||
var/list/bees_outside_hive = list()
|
||||
|
||||
var/hydrotray_type = /obj/machinery/portable_atmospherics/hydroponics
|
||||
|
||||
var/obj/item/weapon/reagent_containers/glass/consume = null
|
||||
|
||||
machine_flags = FIXED2WORK | WRENCHMOVE
|
||||
var/wild = 0
|
||||
|
||||
machine_flags = WRENCHMOVE
|
||||
|
||||
/obj/machinery/apiary/New()
|
||||
..()
|
||||
@@ -71,9 +71,18 @@
|
||||
if(90 to INFINITY)
|
||||
to_chat(user, "<span class='info'>It's full of honey!</span>")
|
||||
|
||||
/obj/machinery/apiary/Cross(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
if(air_group || (height==0))
|
||||
return 1
|
||||
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/apiary/bullet_act(var/obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
|
||||
if(istype(Proj ,/obj/item/projectile/energy/floramut))
|
||||
mut++
|
||||
damage = round(rand(0,3))//0, 1, or 2 brute damage per stings...per bee in a swarm
|
||||
else if(istype(Proj ,/obj/item/projectile/energy/florayield))
|
||||
if(!yieldmod)
|
||||
yieldmod += 1
|
||||
@@ -88,6 +97,8 @@
|
||||
/obj/machinery/apiary/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
if (wild)
|
||||
return
|
||||
if(istype(O, /obj/item/queen_bee))
|
||||
if(user.drop_item(O))
|
||||
nutrilevel = min(15,nutrilevel+15)
|
||||
@@ -249,22 +260,44 @@
|
||||
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
|
||||
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
else
|
||||
/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/datum/bee/B in bees_outside_hive)
|
||||
B.angerAt(M)
|
||||
|
||||
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()
|
||||
|
||||
|
||||
/obj/machinery/apiary/process()
|
||||
if(world.time > (lastcycle + cycledelay))
|
||||
if(world.time > (lastcycle + cycledelay))//about 10 seconds by default
|
||||
lastcycle = world.time
|
||||
if(!queen_bees_inside && !worker_bees_inside)
|
||||
|
||||
if(!queen_bees_inside && !worker_bees_inside)//if the apiary is empty, let's not waste time processing it
|
||||
return
|
||||
|
||||
//handle beezeez
|
||||
//HANDLE BEEZEEZ
|
||||
if(beezeez > 0)
|
||||
beezeez -= 1
|
||||
|
||||
@@ -273,7 +306,7 @@
|
||||
if(toxic > 0)
|
||||
toxic = max(0, toxic - 1)
|
||||
|
||||
//handle nutrients
|
||||
//HANDLE NUTRILEVEL
|
||||
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)
|
||||
@@ -284,14 +317,19 @@
|
||||
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
|
||||
nutrilevel = min(max(nutrilevel,-10),100)
|
||||
|
||||
|
||||
//PRODUCING QUEEN BEES
|
||||
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++
|
||||
|
||||
//PRODUCING WORKER BEES
|
||||
if(nutrilevel > 10 && queen_bees_inside > 0 && worker_bees_inside < 20)
|
||||
worker_bees_inside += queen_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--
|
||||
@@ -300,11 +338,8 @@
|
||||
var/datum/bee/B = pick(bees_outside_hive)
|
||||
B.homeCall()
|
||||
|
||||
nutrilevel = min(max(nutrilevel,-10),100)
|
||||
|
||||
|
||||
//handle toxins
|
||||
|
||||
//HANDLE TOXICITY
|
||||
var/list/toxic_reagents = list(
|
||||
TOXIN = 2,
|
||||
STOXIN = 1,
|
||||
@@ -330,6 +365,8 @@
|
||||
for(var/datum/reagent/R in consume.reagents.reagent_list)
|
||||
if (toxic_reagents.Find(R.id))
|
||||
toxic += R.volume * toxic_reagents[R.id]
|
||||
if (R.id == MUTAGEN)
|
||||
damage = round(rand(0,3))
|
||||
|
||||
if(toxic > 0)
|
||||
toxic = max(0,toxic-0.1)
|
||||
@@ -364,33 +401,98 @@
|
||||
|
||||
consume.reagents.clear_reagents()
|
||||
|
||||
/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
|
||||
///////////////////////////WILD BEEHIVES////////////////////////////
|
||||
|
||||
/obj/machinery/apiary/proc/angry_swarm(var/mob/M = null)
|
||||
for(var/datum/bee/B in bees_outside_hive)
|
||||
B.angerAt(M)
|
||||
/obj/machinery/apiary/wild
|
||||
name = "angry-bee hive"
|
||||
icon = 'icons/obj/apiary_bees_etc.dmi'
|
||||
icon_state = "apiary-wild"
|
||||
density = 1
|
||||
anchored = 1
|
||||
nutrilevel = 100
|
||||
damage = 1.5
|
||||
toxic = 2.5
|
||||
|
||||
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()
|
||||
cycledelay = 50
|
||||
|
||||
#undef HONEYCOMB_COST
|
||||
queen_bees_inside = 1
|
||||
worker_bees_inside = 20
|
||||
wild = 1
|
||||
|
||||
var/health = 100
|
||||
|
||||
/obj/machinery/apiary/wild/New()
|
||||
..()
|
||||
reagents.add_reagent(ROYALJELLY,5)
|
||||
reagents.add_reagent(HONEY,75)
|
||||
reagents.add_reagent(NUTRIMENT, 4)
|
||||
reagents.add_reagent(SUGAR, 16)
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/apiary/wild/bullet_act(var/obj/item/projectile/P)
|
||||
..()
|
||||
if(P.damage && P.damtype != HALLOSS)
|
||||
health -= P.damage
|
||||
updateHealth()
|
||||
|
||||
|
||||
/obj/machinery/apiary/wild/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
if(istype(O, /obj/item/queen_bee))
|
||||
to_chat(user, "<span class='warning'>This type of bee hive isn't fit for domesticated bees.</span>")
|
||||
else if(istype(O, /obj/item/beezeez))
|
||||
to_chat(user, "<span class='warning'>Don't you think they're energetic enough?</span>")
|
||||
else if(O.force)
|
||||
user.delayNextAttack(10)
|
||||
if(queen_bees_inside || worker_bees_inside)
|
||||
to_chat(user,"<span class='warning'>You hit \the [src] with your [O].</span>")
|
||||
angry_swarm(user)
|
||||
|
||||
playsound(get_turf(src), O.hitsound, 50, 1, -1)
|
||||
health -= O.force
|
||||
updateHealth()
|
||||
|
||||
/obj/machinery/apiary/wild/proc/updateHealth()
|
||||
if(health <= 0)
|
||||
visible_message("<span class='notice'>\The [src] falls apart.</span>")
|
||||
|
||||
if (queen_bees_inside || worker_bees_inside)
|
||||
empty_beehive()
|
||||
|
||||
for (var/datum/bee/B in bees_outside_hive)
|
||||
B.home = null
|
||||
|
||||
harvest_honeycombs()
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/apiary/wild/process()
|
||||
if(world.time > (lastcycle + cycledelay))
|
||||
lastcycle = world.time
|
||||
|
||||
if(!queen_bees_inside && !worker_bees_inside)
|
||||
return
|
||||
|
||||
//PRODUCING WORKER BEES
|
||||
if(worker_bees_inside < 20)
|
||||
worker_bees_inside += queen_bees_inside
|
||||
|
||||
//making noise
|
||||
if(prob(10))
|
||||
playsound(get_turf(src), 'sound/effects/bees.ogg', min(20+(reagents.total_volume),100), 1)
|
||||
|
||||
//sending out bees to KILL
|
||||
if(worker_bees_inside >= 10 && bees_outside_hive.len < 15)
|
||||
var/turf/T = get_turf(src)
|
||||
var/mob/living/simple_animal/bee/B_mob = getFromPool(/mob/living/simple_animal/bee, T, src)
|
||||
var/datum/bee/B = new(src)
|
||||
worker_bees_inside--
|
||||
bees_outside_hive.Add(B)
|
||||
B_mob.addBee(B)
|
||||
B.angerAt()
|
||||
|
||||
/obj/machinery/apiary/wild/update_icon()
|
||||
overlays.len = 0
|
||||
return
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
for (var/datum/bee/BEES in B.bees)
|
||||
caught_bees.Add(BEES)
|
||||
BEES.home = null
|
||||
B.home.bees_outside_hive.Remove(BEES)
|
||||
if (B.home)
|
||||
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>")
|
||||
|
||||
@@ -784,6 +784,7 @@ var/global/floorIsLava = 0
|
||||
<A href='?src=\ref[src];secretsfun=aliens'>Trigger an Alien infestation</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=alien_silent'>Spawn an Alien silently</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=spiders'>Trigger a Spider infestation</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=vermin_infestation'>Spawn a vermin infestation</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=hostile_infestation'>Spawn a hostile creature infestation</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=carp'>Trigger a Carp migration</A><BR>
|
||||
<A href='?src=\ref[src];secretsfun=mobswarm'>Trigger mobs of your choice appearing out of thin air</A><BR>
|
||||
|
||||
@@ -3000,14 +3000,7 @@
|
||||
to_chat(world, "<font size='10' color='red'><b>NOT THE BEES!</b></font>")
|
||||
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))
|
||||
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
|
||||
var/mob/living/simple_animal/bee/swarm/BEE = new(get_turf(M))
|
||||
BEE.target = M
|
||||
|
||||
if("virus")
|
||||
@@ -3394,6 +3387,38 @@
|
||||
hardcore_mode = 0
|
||||
to_chat(world, "<h5><span class='danger'>Hardcore mode has been disabled</span></h5>")
|
||||
to_chat(world, "<span class='info'>Starvation will no longer kill player-controlled characters.</span>")
|
||||
if("vermin_infestation")
|
||||
var/list/locations = list(
|
||||
"RANDOM" = null,
|
||||
"kitchen" = LOC_KITCHEN,
|
||||
"atmospherics" = LOC_ATMOS,
|
||||
"incinerator" = LOC_INCIN,
|
||||
"chapel" = LOC_CHAPEL,
|
||||
"library" = LOC_LIBRARY,
|
||||
"vault" = LOC_VAULT,
|
||||
"technical storage" = LOC_TECH,
|
||||
)
|
||||
var/list/vermins = list(
|
||||
"RANDOM" = null,
|
||||
"mice" = VERM_MICE,
|
||||
"lizards" = VERM_LIZARDS,
|
||||
"spiders" = VERM_SPIDERS,
|
||||
"slimes" = VERM_SLIMES,
|
||||
"bats" = VERM_BATS,
|
||||
"borers" = VERM_BORERS,
|
||||
"mimics" = VERM_MIMICS,
|
||||
"roaches" = VERM_ROACHES,
|
||||
"gremlins" = VERM_GREMLINS,
|
||||
"bees" = VERM_BEES,
|
||||
)
|
||||
var/ov = vermins[input("What vermin should infest the station?", "Vermin Infestation") in vermins]
|
||||
var/ol = locations[input("Where should they spawn?", "Vermin Infestation") in locations]
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","VI")
|
||||
message_admins("[key_name_admin(usr)] has triggered an infestation of vermins.", 1)
|
||||
var/datum/event/infestation/infestation_event = new()
|
||||
infestation_event.override_location = ol
|
||||
infestation_event.override_vermin = ov
|
||||
if("hostile_infestation")
|
||||
feedback_inc("admin_secrets_fun_used",1)
|
||||
feedback_add_details("admin_secrets_fun_used","HI")
|
||||
|
||||
@@ -1,21 +1,4 @@
|
||||
#define LOC_KITCHEN 0
|
||||
#define LOC_ATMOS 1
|
||||
#define LOC_INCIN 2
|
||||
#define LOC_CHAPEL 3
|
||||
#define LOC_LIBRARY 4
|
||||
#define LOC_HYDRO 5
|
||||
#define LOC_VAULT 6
|
||||
#define LOC_TECH 7
|
||||
|
||||
#define VERM_MICE 0
|
||||
#define VERM_LIZARDS 1
|
||||
#define VERM_SPIDERS 2
|
||||
#define VERM_SLIMES 3
|
||||
#define VERM_BATS 4
|
||||
#define VERM_BORERS 5
|
||||
#define VERM_MIMICS 6
|
||||
#define VERM_ROACHES 7
|
||||
#define VERM_GREMLINS 8
|
||||
|
||||
/datum/event/infestation
|
||||
announceWhen = 15
|
||||
@@ -23,10 +6,15 @@
|
||||
var/locstring
|
||||
var/vermstring
|
||||
var/vermin = VERM_MICE
|
||||
var/override_location = null
|
||||
var/override_vermin = null
|
||||
|
||||
/datum/event/infestation/start()
|
||||
|
||||
var/location = pick(LOC_KITCHEN, LOC_ATMOS, LOC_INCIN, LOC_CHAPEL, LOC_LIBRARY, LOC_HYDRO, LOC_VAULT, LOC_TECH)
|
||||
if (override_location)
|
||||
location = override_location
|
||||
|
||||
var/spawn_area_type
|
||||
|
||||
//TODO: These locations should be specified by the map datum or by the area. //Area datums, any day now
|
||||
@@ -60,7 +48,10 @@
|
||||
var/list/spawn_types = list()
|
||||
var/max_number = 4
|
||||
|
||||
vermin = pick(VERM_MICE, VERM_LIZARDS, VERM_SPIDERS, VERM_SLIMES, VERM_BATS, VERM_BORERS, VERM_MIMICS, VERM_ROACHES, VERM_GREMLINS)
|
||||
vermin = pick(VERM_MICE, VERM_LIZARDS, VERM_SPIDERS, VERM_SLIMES, VERM_BATS, VERM_BORERS, VERM_MIMICS, VERM_ROACHES, VERM_GREMLINS, VERM_BEES)
|
||||
|
||||
if (override_vermin)
|
||||
vermin = override_vermin
|
||||
|
||||
switch(vermin)
|
||||
if(VERM_MICE)
|
||||
@@ -96,6 +87,10 @@
|
||||
spawn_types = /mob/living/simple_animal/hostile/gremlin
|
||||
vermstring = "gremlins"
|
||||
max_number = 4 //2 to 4
|
||||
if(VERM_BEES)
|
||||
spawn_types = /obj/machinery/apiary/wild
|
||||
vermstring = "angry bees"
|
||||
max_number = 2
|
||||
|
||||
var/number = rand(2, max_number)
|
||||
|
||||
@@ -121,20 +116,3 @@
|
||||
warning = "Drive them away!" //DF reference
|
||||
|
||||
command_alert(new /datum/command_alert/vermin(vermstring, locstring, warning))
|
||||
|
||||
#undef LOC_KITCHEN
|
||||
#undef LOC_ATMOS
|
||||
#undef LOC_INCIN
|
||||
#undef LOC_CHAPEL
|
||||
#undef LOC_LIBRARY
|
||||
#undef LOC_HYDRO
|
||||
#undef LOC_VAULT
|
||||
#undef LOC_TECH
|
||||
|
||||
#undef VERM_MICE
|
||||
#undef VERM_LIZARDS
|
||||
#undef VERM_SPIDERS
|
||||
#undef VERM_SLIMES
|
||||
#undef VERM_BATS
|
||||
#undef VERM_MIMICS
|
||||
#undef VERM_GREMLINS
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#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
|
||||
#define BOREDOM_TO_RETURN 30//once reached, the bee will head back to its hive
|
||||
|
||||
|
||||
//////////////////////BEE DATUMS///////////////////////////////////////
|
||||
@@ -12,7 +12,7 @@
|
||||
/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/damage = 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
|
||||
@@ -27,7 +27,7 @@
|
||||
..()
|
||||
if (spawner)
|
||||
home = spawner
|
||||
mut = spawner.mut
|
||||
damage = spawner.damage
|
||||
toxic = spawner.toxic
|
||||
|
||||
/datum/bee/proc/goPollinate()
|
||||
@@ -42,8 +42,9 @@
|
||||
mob.updateState = 1
|
||||
|
||||
/datum/bee/proc/homeCall()
|
||||
state = BEE_HEADING_HOME
|
||||
mob.updateState = 1
|
||||
if (home)//Hive-less bees never calm down
|
||||
state = BEE_HEADING_HOME
|
||||
mob.updateState = 1
|
||||
|
||||
/datum/bee/proc/Die()
|
||||
if (mob)
|
||||
@@ -79,7 +80,7 @@
|
||||
icon_state = "bee_dead"
|
||||
anchored = 0
|
||||
mouse_opacity = 1
|
||||
plane = MOB_PLANE
|
||||
plane = LYING_MOB_PLANE
|
||||
|
||||
/obj/effect/decal/cleanable/bee/New()
|
||||
..()
|
||||
@@ -105,7 +106,7 @@
|
||||
can_butcher = 0
|
||||
|
||||
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/state = BEE_ROAMING
|
||||
var/atom/destination = null
|
||||
var/list/bees = list()
|
||||
var/mob/target = null
|
||||
@@ -214,7 +215,7 @@
|
||||
|
||||
/mob/living/simple_animal/bee/adjustBruteLoss(var/amount)
|
||||
if(status_flags & GODMODE)
|
||||
return 0 //godmode
|
||||
return 0
|
||||
|
||||
while (amount > 0 && bees.len)
|
||||
var/datum/bee/B = pick(bees)
|
||||
@@ -223,7 +224,10 @@
|
||||
amount = 0
|
||||
else
|
||||
amount -= B.health
|
||||
current_physical_damage -= B.damage/2
|
||||
current_poison_damage -= B.toxic/2
|
||||
B.Die()
|
||||
|
||||
if (bees.len <= 0)
|
||||
qdel(src)
|
||||
update_icon()
|
||||
@@ -231,16 +235,16 @@
|
||||
|
||||
//CUSTOM PROCS
|
||||
/mob/living/simple_animal/bee/proc/addBee(var/datum/bee/B)
|
||||
var/total_mut = 0
|
||||
var/total_brute = 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_brute += BEE.damage
|
||||
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))
|
||||
current_physical_damage = total_brute/2
|
||||
current_poison_damage = total_toxic/2
|
||||
update_icon()
|
||||
|
||||
/mob/living/simple_animal/bee/proc/panic_attack(mob/damagesource)
|
||||
@@ -265,7 +269,7 @@
|
||||
if(stat != DEAD)
|
||||
|
||||
|
||||
//SPLITTING THE SWARM DEPENDING ON THEIR INTENT
|
||||
//SPLITTING THE SWARM DEPENDING ON THEIR INTENT
|
||||
if (updateState)
|
||||
updateState = 0
|
||||
var/list/swarmers = list()
|
||||
@@ -319,10 +323,7 @@
|
||||
state = BEE_OUT_FOR_ENEMIES
|
||||
|
||||
|
||||
|
||||
|
||||
///////////////////////////CALMING STUFF/////////////////////////////////////////
|
||||
|
||||
//CALMING BEES
|
||||
var/list/calmers = list(
|
||||
/obj/effect/decal/chemical_puff,
|
||||
/obj/effect/effect/smoke/chem,
|
||||
@@ -346,10 +347,10 @@
|
||||
updateState = 1
|
||||
break
|
||||
|
||||
////////////////ATTACKING STUFF///////////////////////////////////////////
|
||||
|
||||
if(stat == CONSCIOUS)
|
||||
|
||||
//ATTACKING TARGET
|
||||
var/mob/living/carbon/human/M = target
|
||||
|
||||
if(calmed > 0)
|
||||
@@ -376,20 +377,20 @@
|
||||
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!
|
||||
if(prob(sting_prob))
|
||||
M.apply_damage(current_physical_damage, BRUTE)
|
||||
M.apply_damage(current_poison_damage, TOX)
|
||||
to_chat(M, "<span class='warning'>You have been stung!</span>")
|
||||
M.flash_pain()
|
||||
|
||||
///////////////////////NOISE STUFF
|
||||
//MAKING NOISE
|
||||
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*bees.len,100), 1)
|
||||
playsound(get_turf(src), 'sound/effects/bees.ogg', min(20 * bees.len, 100), 1)
|
||||
|
||||
|
||||
////////////////////////GROUPING STUFF
|
||||
//(DE)GROUPING WITH OTHER BEES
|
||||
for(var/mob/living/simple_animal/bee/B_mob in src.loc)
|
||||
if(B_mob == src)
|
||||
continue
|
||||
@@ -410,33 +411,34 @@
|
||||
visited_plants.Add(B_mob.visited_plants)
|
||||
qdel(B_mob)
|
||||
|
||||
//spreading out a bit
|
||||
if(bees.len > 1 && pollinating <= 0 && prob(bees.len*2))
|
||||
//SPREADING OUT
|
||||
if(bees.len > 1 && pollinating <= 0 && prob(bees.len*2) && state != BEE_SWARM)
|
||||
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.target = target
|
||||
B_mob.update_icon()
|
||||
B_mob.home = home
|
||||
B_mob.visited_plants.Add(visited_plants)
|
||||
B_mob.Move(get_turf(pick(orange(src,1))))
|
||||
|
||||
|
||||
///////////////TARGETING PEOPLE
|
||||
|
||||
//REACHING FOR MOBS
|
||||
if(state == BEE_OUT_FOR_ENEMIES)
|
||||
var/turf/target_turf = null
|
||||
if(target && target in view(src,7))
|
||||
if(target && target in view(src,7) && target.stat != DEAD)
|
||||
target_turf = get_turf(target)
|
||||
wander = 0
|
||||
else
|
||||
target = null
|
||||
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
|
||||
if (B.home == home || (B.home.wild && home.wild))//we'll allow bees to fight bees from other hives, unless they're both from wild hives
|
||||
continue
|
||||
if (G.flags & INVULNERABLE) continue
|
||||
if (G.stat != DEAD)
|
||||
@@ -448,7 +450,7 @@
|
||||
else
|
||||
for (var/datum/bee/B in bees)
|
||||
B.bored++
|
||||
if (B.fatigue > BOREDOM_TO_RETURN)
|
||||
if (B.bored > BOREDOM_TO_RETURN && B.home && !B.home.wild)
|
||||
B.homeCall()
|
||||
|
||||
if(target_turf)
|
||||
@@ -459,8 +461,7 @@
|
||||
if(src.loc == target_turf)
|
||||
wander = 1
|
||||
|
||||
//////////////TARGETING FLOWERS
|
||||
|
||||
//REACHING FOR FLOWERS
|
||||
if(state == BEE_OUT_FOR_PLANTS && pollinating <= 0)
|
||||
var/turf/target_turf = null
|
||||
if(target_plant && target_plant in view(src,7))
|
||||
@@ -500,8 +501,7 @@
|
||||
wander = 1
|
||||
|
||||
|
||||
//////////////TARGETING APIARY
|
||||
|
||||
//REACHING FOR HOME
|
||||
if(state == BEE_HEADING_HOME || state == BEE_SWARM)
|
||||
wander = 0
|
||||
var/turf/target_turf = get_turf(home)
|
||||
@@ -520,6 +520,9 @@
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
////////////////////////////////UPDATE ICON/////////////////////////////////
|
||||
|
||||
/mob/living/simple_animal/bee/update_icon()
|
||||
overlays.len = 0
|
||||
|
||||
@@ -545,7 +548,7 @@
|
||||
|
||||
|
||||
|
||||
////////////////////////////BEE PRESETS//////////////////////////////////////////////////
|
||||
////////////////////////////BEE PRESETS/////////////////////////////////////
|
||||
|
||||
/mob/living/simple_animal/bee/adminSpawned/New(loc, var/obj/machinery/apiary/new_home)
|
||||
..()
|
||||
@@ -565,7 +568,7 @@
|
||||
..()
|
||||
var/datum/bee/B = new()
|
||||
B.toxic = 5
|
||||
B.mut = 2
|
||||
B.damage = 2
|
||||
B.state = BEE_OUT_FOR_ENEMIES
|
||||
state = BEE_OUT_FOR_ENEMIES
|
||||
addBee(B)
|
||||
@@ -577,7 +580,7 @@
|
||||
for (var/i = 1 to 20)
|
||||
var/datum/bee/B = new()
|
||||
B.toxic = 5
|
||||
B.mut = 2
|
||||
B.damage = 2
|
||||
B.state = BEE_OUT_FOR_ENEMIES
|
||||
addBee(B)
|
||||
state = BEE_OUT_FOR_ENEMIES
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Reference in New Issue
Block a user