I'm trying to intoxicate bees by being near the flower. Toxicity is a flower-own variable, however, I want to add the number of said toxicity to the established mortality for the bees. I get the error that toxicity is not a bees variable, which is true, but how do I add this. The idea is that the flower has a set toxicity and if someone is near it gets intoxicated making them die faster. Thanks in advance, the code should work copy past.
breed [flowers flower]
breed [bees bee]
turtles-own
[
mortality
tipo_exposicion
t_supervivencia
]
flowers-own [toxicity]
to setup
clear-all
create-flowers 5
[
set shape "flower"
set color red
set size 4
move-to one-of patches
]
ask patches [set pcolor 63]
create-bees 100
[
setxy random-xcor random-ycor
]
ask bees
[
set shape "person"
set size 1
set color yellow
set t_supervivencia 0
]
ask flowers [set color gray]
reset-ticks
end
to go
ask bees [
move-bees
]
ask bees[intoxicarse]
ask flowers [ morir_bees_eating]
tick
end
to move-bees
right random 60
forward 1
set t_supervivencia t_supervivencia + 1
set mortality mortality + 1
end
to intoxicarse
ask bees in-radius 10 [if any? flowers with [color = gray][
set mortality mortality + toxicity]]
end
to morir_bees_eating
if color = gray [set toxicity 34]
end