public static double getHungerRate(Monster monster) { //get basic stat hunger rate double baseHR = monster.stats.getHungerRate(); //get speed divider based on items double hrPercent=0; foreach(ItemSlot tempSlot in Enum.GetValues(typeof(ItemSlot)).Cast<ItemSlot>()) { Item tempItem = monster.inventory.getItem(tempSlot); if(tempItem != null) { foreach(ItemAttribute attribute in tempItem.attributes) { if(attribute.type == ItemAttributeType.QUICKEN_HUNGER) { hrPercent = hrPercent - Double.Parse(attribute.parameter.Replace("%", "")); } else if(attribute.type == ItemAttributeType.SLOW_HUNGER) { hrPercent = hrPercent + Double.Parse(attribute.parameter.Replace("%", "")); } } } } double adjustedHR = baseHR * ((100.0 - hrPercent) / 100.0); if(adjustedHR < 0.0) { adjustedHR = 0.0; } //if sleeping, then slow to 1/4 hunger rate if(monster.isSleeping()) { adjustedHR = adjustedHR / 4.0; } return adjustedHR; }