Esempio n. 1
0
        public static bool regrowWeeds(Patch patch)
        {
            bool shouldRemoveFromList = false;

            if (!patch.patchOccupied())
            {
                if (misc.random(4) != 0 || patch.isWeeding())
                {
                    return(false);
                }
                Player owner = Server.getPlayerForName(patch.getOwnerName());
                patch.setHasWeeds(true);
                patch.setStatus(patch.getStatus() - 1);
                if (patch.getStatus() <= -1)
                {
                    patch.setStatus(0);
                    shouldRemoveFromList = true;
                }
                if (owner != null)
                {
                    setConfig(owner, patch);
                }
            }
            return(shouldRemoveFromList);
        }