mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Merge pull request #4356 from FalseIncarnate/botany
Briefcase Full of BEES!
This commit is contained in:
@@ -42,33 +42,23 @@
|
||||
|
||||
var/datum/reagent/beegent = null //hehe, beegent
|
||||
var/obj/structure/beebox/beehome = null
|
||||
var/idle = 0
|
||||
var/isqueen = FALSE
|
||||
var/idle = 0
|
||||
var/icon_base = "bee"
|
||||
var/static/list/bee_icons = list()
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/Process_Spacemove(movement_dir = 0)
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/New()
|
||||
..()
|
||||
generate_bee_visuals()
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/Destroy()
|
||||
if(beehome)
|
||||
beehome.bees.Remove(src)
|
||||
beehome = null
|
||||
beegent = null
|
||||
return ..()
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/death(gibbed)
|
||||
if(beehome)
|
||||
beehome.bees.Remove(src)
|
||||
beehome = null
|
||||
beegent = null
|
||||
..()
|
||||
ghostize()
|
||||
@@ -77,10 +67,6 @@
|
||||
/mob/living/simple_animal/hostile/poison/bees/examine(mob/user)
|
||||
..()
|
||||
|
||||
if(!beehome)
|
||||
to_chat(user, "<span class='warning'>This bee is homeless!</span>")
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/proc/generate_bee_visuals()
|
||||
overlays.Cut()
|
||||
|
||||
@@ -107,31 +93,87 @@
|
||||
wings = bee_icons["[icon_base]_wings"]
|
||||
overlays += wings
|
||||
|
||||
|
||||
//We don't attack beekeepers/people dressed as bees//Todo: bee costume
|
||||
/mob/living/simple_animal/hostile/poison/bees/CanAttack(atom/the_target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return 0
|
||||
if(ishuman(the_target))
|
||||
var/mob/living/carbon/human/H = the_target
|
||||
return !H.bee_friendly()
|
||||
|
||||
return .
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/Found(atom/A)
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
return !L.bee_friendly()
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/AttackingTarget()
|
||||
if(beegent && isliving(target))
|
||||
var/mob/living/L = target
|
||||
if(!isnull(target.reagents))
|
||||
beegent.reaction_mob(L, INGEST)
|
||||
L.reagents.add_reagent(beegent.id, rand(1,5))
|
||||
target.attack_animal(src)
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/proc/assign_reagent(datum/reagent/R)
|
||||
if(istype(R))
|
||||
beegent = R
|
||||
name = "[initial(name)] ([R.name])"
|
||||
generate_bee_visuals()
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/handle_automated_action()
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/proc/reagent_incompatible(mob/living/simple_animal/hostile/poison/bees/B)
|
||||
if(!B)
|
||||
return 0
|
||||
if(B.beegent && beegent && B.beegent.id != beegent.id || B.beegent && !beegent || !B.beegent && beegent)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
|
||||
//Botany Worker Bees
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker
|
||||
//Blank type define in case we need to give them special stuff later, plus organization (currently they are same as base type bee)
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/Destroy()
|
||||
if(beehome)
|
||||
beehome.bees.Remove(src)
|
||||
beehome = null
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/death(gibbed)
|
||||
if(beehome)
|
||||
beehome.bees.Remove(src)
|
||||
beehome = null
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/examine(mob/user)
|
||||
..()
|
||||
|
||||
if(!beehome)
|
||||
to_chat(user, "<span class='warning'>This bee is homeless!</span>")
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/Found(atom/A)
|
||||
if(istype(A, /obj/machinery/portable_atmospherics/hydroponics))
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/Hydro = A
|
||||
if(Hydro.seed && !Hydro.dead && !Hydro.recent_bee_visit)
|
||||
wanted_objects |= /obj/machinery/portable_atmospherics/hydroponics //so we only hunt them while they're alive/seeded/not visisted
|
||||
return 1
|
||||
if(ishuman(A))
|
||||
var/mob/living/carbon/human/H = A
|
||||
return !H.bee_friendly()
|
||||
return 0
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/CanAttack(atom/the_target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return 0
|
||||
if(isliving(the_target)) //Should ignore ghosts and camera mobs already, but just in case
|
||||
var/mob/living/L = the_target
|
||||
return !L.bee_friendly()
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/AttackingTarget()
|
||||
//Pollinate
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/AttackingTarget()
|
||||
//Pollinate
|
||||
if(istype(target, /obj/machinery/portable_atmospherics/hydroponics))
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/Hydro = target
|
||||
pollinate(Hydro)
|
||||
@@ -141,22 +183,9 @@
|
||||
target = null
|
||||
wanted_objects.Remove(/obj/structure/beebox) //so we don't attack beeboxes when not going home
|
||||
else
|
||||
if(beegent && isliving(target))
|
||||
var/mob/living/L = target
|
||||
if(!isnull(target.reagents))
|
||||
beegent.reaction_mob(L, INGEST)
|
||||
L.reagents.add_reagent(beegent.id, rand(1,5))
|
||||
target.attack_animal(src)
|
||||
..()
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/proc/assign_reagent(datum/reagent/R)
|
||||
if(istype(R))
|
||||
beegent = R
|
||||
name = "[initial(name)] ([R.name])"
|
||||
generate_bee_visuals()
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/proc/pollinate(obj/machinery/portable_atmospherics/hydroponics/Hydro)
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/proc/pollinate(obj/machinery/portable_atmospherics/hydroponics/Hydro)
|
||||
if(!istype(Hydro) || !Hydro.seed || Hydro.dead || Hydro.recent_bee_visit)
|
||||
target = null
|
||||
return
|
||||
@@ -187,12 +216,10 @@
|
||||
if(beehome)
|
||||
beehome.bee_resources = min(beehome.bee_resources + growth, 100)
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/handle_automated_action()
|
||||
/mob/living/simple_animal/hostile/poison/bees/worker/handle_automated_action()
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
|
||||
if(!isqueen)
|
||||
if(loc == beehome)
|
||||
idle = min(100, ++idle)
|
||||
@@ -212,7 +239,9 @@
|
||||
beehome = BB
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/queen
|
||||
|
||||
//Botany Queen Bee
|
||||
/mob/living/simple_animal/hostile/poison/bees/queen
|
||||
name = "queen bee"
|
||||
desc = "she's the queen of bees, BZZ BZZ"
|
||||
icon_base = "queen"
|
||||
@@ -223,28 +252,13 @@
|
||||
/mob/living/simple_animal/hostile/poison/bees/queen/Found(atom/A)
|
||||
return 0
|
||||
|
||||
|
||||
//leave pollination for the peasent bees
|
||||
/mob/living/simple_animal/hostile/poison/bees/queen/AttackingTarget()
|
||||
if(beegent && isliving(target))
|
||||
var/mob/living/L = target
|
||||
beegent.reaction_mob(L, TOUCH)
|
||||
L.reagents.add_reagent(beegent.id, rand(1,5))
|
||||
target.attack_animal(src)
|
||||
|
||||
|
||||
//PEASENT BEES
|
||||
/mob/living/simple_animal/hostile/poison/bees/queen/pollinate()
|
||||
return
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/proc/reagent_incompatible(mob/living/simple_animal/hostile/poison/bees/B)
|
||||
if(!B)
|
||||
/mob/living/simple_animal/hostile/poison/bees/queen/CanAttack(atom/the_target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return 0
|
||||
if(B.beegent && beegent && B.beegent.id != beegent.id || B.beegent && !beegent || !B.beegent && beegent)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
if(isliving(the_target)) //Should ignore ghosts and camera mobs already, but just in case
|
||||
var/mob/living/L = the_target
|
||||
return !L.bee_friendly()
|
||||
|
||||
/obj/item/queen_bee
|
||||
name = "queen bee"
|
||||
@@ -254,7 +268,6 @@
|
||||
icon = 'icons/mob/bees.dmi'
|
||||
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/weapon/reagent_containers/syringe))
|
||||
var/obj/item/weapon/reagent_containers/syringe/S = I
|
||||
@@ -280,7 +293,6 @@
|
||||
to_chat(user, "<span class='warning'>You don't have enough units of that chemical to modify the bee's DNA!</span>")
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/queen_bee/bought/New()
|
||||
..()
|
||||
queen = new(src)
|
||||
@@ -288,3 +300,43 @@
|
||||
/obj/item/queen_bee/Destroy()
|
||||
qdel(queen)
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
//Syndicate Bees
|
||||
/mob/living/simple_animal/hostile/poison/bees/syndi
|
||||
name = "syndi-bee"
|
||||
desc = "The result of a large influx of BEES!"
|
||||
melee_damage_lower = 5
|
||||
melee_damage_upper = 5
|
||||
maxHealth = 25
|
||||
health = 25
|
||||
faction = list("hostile", "syndicate")
|
||||
search_objects = 0 //these bees don't care about trivial things like plants, especially when there is havoc to sow
|
||||
beegent = new /datum/reagent/facid() //prepare to die
|
||||
var/list/master_and_friends = list()
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/syndi/assign_reagent(datum/reagent/R)
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/syndi/Found(atom/A)
|
||||
return CanAttack(A)
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/syndi/CanAttack(atom/the_target)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return 0
|
||||
if(isliving(the_target))
|
||||
var/mob/living/L = the_target
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
if(H in master_and_friends)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/bees/syndi/AttackingTarget()
|
||||
..()
|
||||
if(target && isliving(target))
|
||||
var/mob/living/L = target
|
||||
if(L.stat)
|
||||
LoseTarget()
|
||||
|
||||
Reference in New Issue
Block a user