obj
proc
feeding()
if(usr.incubators)
var/obj/Inventory/egg/O = locate(/obj/Inventory/egg) in usr.hatchstorage
var/obj/Inventory/eggfood/C = locate(/obj/Inventory/eggfood) in usr
if(O.hatchrate==5)
usr<<"This Egg has been fed to contempt. It is ready to be hatched!"
else
if(/obj/Inventory/eggfood in usr)
if(C.foodtype== O.eggtype)
if(C.amount >= O.foodreq)
var/n = O.foodreq C.removeAmount(n)
var/obj/Inventory/eggfood/D = new C.type
D.addAmount(n-1)
O.hatchrate++
usr<<"You have fed the Egg. ([O.hatchrate]/5)"
Problem description:
When you click on the Hatching Incubator it gives you an option to feed the egg, but when I do, nothing happens. :[
The proc is supposed to check and see if there is currently an Egg inside the Incubator (usr.incubators), then check if the user has food on them (eggfood) , then check to see if the Egg can "consume" that "brand" of food (foodtype/eggtype) and that the user has enough food for one serving(foodreq) since some Eggs will require more food than others. Then if everything checks out, the amount of eggfood in the users contents is removed equal to the require amount of food needed to feed the Egg. And then that Egg gains a Hatchrate, meaning its a step closer to hatching.
But it doesn't work...pretty sure it has something to do with the var/obj = locate thing, because I just threw that in there not knowing what to do...
Should be: