@Override
    public void performStep() {
        setChanged(true);

        if (getState() == FIRE && (r.nextInt() % FIRE_DURATION_COEFFICIENT) == 0) {
            setState(BLANK);
            return;
        }

        if (getState() == TREE) {
            if (isFireNearby() || (r.nextInt() % SELF_FIRE_COEFFICIENT) == 0) {
                setState(FIRE);
                return;
            }
        }

        if (getRoundScore() > 2 && (r.nextInt() % NEAR_FIRE_COEFFICIENT) == 0) {
            setState(FIRE);
            return;
        }

        if (getState() == BLANK && (r.nextInt() % TREE_COEFFICIENT) == 0) {
            setState(TREE);
            return;
        }

        setChanged(false);
    }