mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Update hunger-games.js
This commit is contained in:
@@ -128,7 +128,11 @@ module.exports = class HungerGamesCommand extends Command {
|
||||
if (event.spoils && !event.spoils.includes('food') && tribute.weapon) return false;
|
||||
return event.tributes <= turn.size && event.deaths.length < turn.size;
|
||||
});
|
||||
const event = valid[Math.floor(Math.random() * valid.length)];
|
||||
let event = valid[Math.floor(Math.random() * valid.length)];
|
||||
if (!event) {
|
||||
const fallback = eventsArr.filter(e => e.type === 'action' && event.deaths.length === 0);
|
||||
event = fallback[Math.floor(Math.random() * fallback.length];
|
||||
}
|
||||
turn.delete(tribute.name);
|
||||
if (event.tributes === 1) {
|
||||
if (event.requires === 'food') tribute.food--;
|
||||
|
||||
Reference in New Issue
Block a user