Skip to content
Snippets Groups Projects
Commit b63bca4d authored by echicken's avatar echicken
Browse files

Vagrants may now loot up to 100% of your prepared products, as well as items from your stock room.

parent 7ab95ffb
No related branches found
No related tags found
No related merge requests found
......@@ -423,10 +423,17 @@ var playTurn = function() {
for(var product in player.products) {
if(player.products[product].quantity < 2)
continue;
var loss = Math.floor((Math.random() * (player.products[product].quantity * .7)) + 1);
var loss = Math.floor((Math.random() * (player.products[product].quantity)) + 1);
player.products[product].quantity = player.products[product].quantity - loss;
losses.push(loss + " units of " + player.products[product].name);
}
for(var ingredient in player.inventory) {
if(player.inventory[ingredient].quantity < 2)
continue;
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");
}
report.push(
[ format(
"Your shop was looted by vagrants! You lost %s.",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment