(result, defeatThangsGoal)
| 636 | } |
| 637 | |
| 638 | function generateEnemies (result, defeatThangsGoal) { |
| 639 | let i |
| 640 | for (i = 0; i < Math.ceil(Math.random() * 8);) { |
| 641 | const enemy = { |
| 642 | id: getRandomThang(['Crab Monster Junior']), |
| 643 | pos: getRandomPosition(result), |
| 644 | margin: 0 |
| 645 | } |
| 646 | if (result.falseCount === 99) { |
| 647 | result.falseCount = 0 |
| 648 | break |
| 649 | } |
| 650 | if (addThang(result, enemy)) { |
| 651 | ++i |
| 652 | } |
| 653 | } |
| 654 | if (!i) { |
| 655 | console.log("Couldn't find space for an enemy; removing defeatThangsGoal") |
| 656 | result.goals = _.without(result.goals, defeatThangsGoal) |
| 657 | } |
| 658 | } |
| 659 | |
| 660 | function generateGetToLocations (result, getToLocationsGoal) { |
| 661 | while (true) { |
no test coverage detected