Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 54bfc3c021 |
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using Babushka.scripts.CSharp.Common.Util;
|
using Babushka.scripts.CSharp.Common.Util;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
@@ -15,15 +16,14 @@ public partial class FightRoomSceneSetup : Node
|
|||||||
{
|
{
|
||||||
var room = FightWorld.Instance.currentRoom!;
|
var room = FightWorld.Instance.currentRoom!;
|
||||||
|
|
||||||
var i = 0;
|
foreach (var (parent, group) in _enemyGroupSpawns.Zip(room.enemyGroups))
|
||||||
foreach (var availableParent in _enemyGroupSpawns.Shuffle())
|
|
||||||
{
|
{
|
||||||
var enemyGroup = room.enemyGroups[i];
|
if (group.AreAllDead())
|
||||||
|
continue;
|
||||||
|
|
||||||
var roamingEnemyGroup = _roamingEnemyGroupPrefab.Instantiate<RoamingEnemyGroup>();
|
var roamingEnemyGroup = _roamingEnemyGroupPrefab.Instantiate<RoamingEnemyGroup>();
|
||||||
roamingEnemyGroup.Initialize(enemyGroup, _fightSceneSwitcher);
|
roamingEnemyGroup.Initialize(group, _fightSceneSwitcher);
|
||||||
availableParent.AddChild(roamingEnemyGroup);
|
parent.AddChild(roamingEnemyGroup);
|
||||||
if (i >= room.enemyGroups.Count - 1) break;
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user