Lowered break chance for items.
This commit is contained in:
@@ -204,9 +204,9 @@ const int RESIDENT_SNARE_CHECK_CHANCE = 15; // 15% chance per hour to check sna
|
||||
const int RESIDENT_FISHING_CHANCE = 6; // 6% chance per resident per hour to catch a fish
|
||||
const int RESIDENT_SMOKE_FISH_CHANCE = 10; // 10% chance per hour to smoke a stored fish
|
||||
const int RESIDENT_TOOL_BREAK_CHANCE = 2; // 2% chance tools break during resident use (fishing poles, knives, baskets)
|
||||
const int PLAYER_ITEM_BREAK_CHANCE_MIN = 1;
|
||||
const int PLAYER_ITEM_BREAK_CHANCE_MAX = 100;
|
||||
const int PLAYER_ITEM_BREAK_CHANCE_INCREMENT = 1;
|
||||
const float PLAYER_ITEM_BREAK_CHANCE_MIN = 1.0;
|
||||
const float PLAYER_ITEM_BREAK_CHANCE_MAX = 100.0;
|
||||
const float PLAYER_ITEM_BREAK_CHANCE_INCREMENT = 0.1;
|
||||
const int PLAYER_ITEM_BREAKS_PER_DAY = 2;
|
||||
|
||||
// Goose settings
|
||||
|
||||
@@ -1300,7 +1300,7 @@ bool load_game_state_from_file(const string&in filename) {
|
||||
if (invasion_chance > 100) invasion_chance = 100;
|
||||
if (invasion_scheduled_hour < -1) invasion_scheduled_hour = -1;
|
||||
if (invasion_scheduled_hour > 23) invasion_scheduled_hour = -1;
|
||||
playerItemBreakChance = int(get_number(saveData, "player_item_break_chance", PLAYER_ITEM_BREAK_CHANCE_MIN));
|
||||
playerItemBreakChance = float(get_number(saveData, "player_item_break_chance", PLAYER_ITEM_BREAK_CHANCE_MIN));
|
||||
playerItemBreaksToday = int(get_number(saveData, "player_item_breaks_today", 0));
|
||||
playerItemBreakPending = get_bool(saveData, "player_item_break_pending", false);
|
||||
playerItemBreakPendingType = int(get_number(saveData, "player_item_break_pending_type", -1));
|
||||
|
||||
@@ -12,7 +12,7 @@ bool is_daytime = true;
|
||||
bool sun_setting_warned = false;
|
||||
bool sunrise_warned = false;
|
||||
|
||||
int playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN;
|
||||
float playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN;
|
||||
int playerItemBreaksToday = 0;
|
||||
bool playerItemBreakPending = false;
|
||||
int playerItemBreakPendingType = -1;
|
||||
@@ -124,7 +124,8 @@ void attempt_player_item_break_check() {
|
||||
if (breakableItems.length() == 0) return;
|
||||
|
||||
int roll = random(1, 100);
|
||||
if (roll <= playerItemBreakChance) {
|
||||
int checkChance = int(playerItemBreakChance); // Floor for comparison
|
||||
if (roll <= checkChance) {
|
||||
int pickIndex = random(0, int(breakableItems.length()) - 1);
|
||||
int itemType = breakableItems[pickIndex];
|
||||
playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN;
|
||||
|
||||
Reference in New Issue
Block a user