diff --git a/xtrn/thirsty/thirsty.js b/xtrn/thirsty/thirsty.js index 610100fdfb3c4260af2c75091ae537a11af541f8..008cc69cc6e8c0827ef76f995ab22154a9b05d8b 100644 --- a/xtrn/thirsty/thirsty.js +++ b/xtrn/thirsty/thirsty.js @@ -416,7 +416,8 @@ var playTurn = function() { } } } - + + var stockLosses = 0; var lpi = 100 - demographics.vagrants.percentage; if(Math.floor((Math.random() * 100) + 1) > lpi) { var losses = []; @@ -433,15 +434,19 @@ var playTurn = function() { var loss = Math.floor((Math.random() * (player.inventory[ingredient].quantity)) + 1); player.inventory[ingredient].quantity = player.inventory[ingredient].quantity - loss; losses.push(loss + " units of " + player.inventory[ingredient].name + " from storage"); + stockLosses = stockLosses + (player.inventory[ingredient].quantity * player.inventory[ingredient].cost); + } + if(losses.length > 0) { + report.push( + [ format( + "Your shop was looted by vagrants! You lost %s.", + losses.join(", ") + ), + LIGHTRED + ] + ); + makeStockList(); } - report.push( - [ format( - "Your shop was looted by vagrants! You lost %s.", - losses.join(", ") - ), - LIGHTRED - ] - ); } var grossSales = 0;