Livestock has a chance to give feathers.

This commit is contained in:
Storm Dragon
2026-02-06 22:39:17 -05:00
parent 17e0cd065f
commit f5dd4f1d25
2 changed files with 11 additions and 1 deletions

View File

@@ -209,6 +209,7 @@ void attempt_livestock_production() {
int meat_produced = 0;
int skins_produced = 0;
int feathers_produced = 0;
for (int i = 0; i < count; i++) {
if (get_storage_count(ITEM_MEAT) < BASE_STORAGE_MAX) {
@@ -224,13 +225,21 @@ void attempt_livestock_production() {
skins_produced++;
}
}
if (get_storage_count(ITEM_FEATHERS) < BASE_STORAGE_MAX) {
if (random(1, 100) <= LIVESTOCK_FEATHER_CHANCE) {
add_storage_count(ITEM_FEATHERS, 1);
feathers_produced++;
}
}
}
if ((meat_produced > 0 || skins_produced > 0) && x <= BASE_END) {
if ((meat_produced > 0 || skins_produced > 0 || feathers_produced > 0) && x <= BASE_END) {
string msg = "Livestock produced ";
string[] outputs;
if (meat_produced > 0) outputs.insert_last(meat_produced + " meat");
if (skins_produced > 0) outputs.insert_last(skins_produced + " skins");
if (feathers_produced > 0) outputs.insert_last(feathers_produced + " feathers");
for (uint i = 0; i < outputs.length(); i++) {
if (i > 0) {

View File

@@ -148,6 +148,7 @@ const int HORSE_SUCCESS_BONUS_PER = 2;
const int HORSE_DAMAGE_BONUS_STEP = 3;
const int LIVESTOCK_MEAT_CHANCE = 6;
const int LIVESTOCK_SKIN_CHANCE = 3;
const int LIVESTOCK_FEATHER_CHANCE = 2;
// Bandit settings
const int BANDIT_HEALTH = 4;