Almanach
This commit is contained in:
parent
008fa31dd4
commit
b932e82555
39 changed files with 575 additions and 78 deletions
|
|
@ -38,16 +38,16 @@ public partial class SurvivalZombieSpawner : Node
|
|||
|
||||
cachedTankPool.Sort((x, y) =>
|
||||
{
|
||||
return (int)(x.cost - y.cost);
|
||||
return (int)(x.Cost - y.Cost);
|
||||
});
|
||||
cachedHordePool.Sort((x, y) =>
|
||||
{
|
||||
return (int)(x.cost - y.cost);
|
||||
return (int)(x.Cost - y.Cost);
|
||||
});
|
||||
|
||||
minSupportPoints = cachedSupportPool[0].cost;
|
||||
minTankPoints = cachedTankPool[0].cost;
|
||||
minHordePoints = cachedHordePool[0].cost;
|
||||
minSupportPoints = cachedSupportPool[0].Cost;
|
||||
minTankPoints = cachedTankPool[0].Cost;
|
||||
minHordePoints = cachedHordePool[0].Cost;
|
||||
|
||||
fin_a = (velocity_curve.Sample(velocity_curve.MaxDomain) - velocity_curve.Sample(velocity_curve.MaxDomain - 0.001f)) / 0.001f;
|
||||
}
|
||||
|
|
@ -107,10 +107,10 @@ public partial class SurvivalZombieSpawner : Node
|
|||
while (given_points >= minSupportPoints)
|
||||
{
|
||||
var chosen_zombie = cachedSupportPool[rng.RandiRange(0, cachedSupportPool.Count - 1)];
|
||||
if (given_points - chosen_zombie.cost >= 0)
|
||||
if (given_points - chosen_zombie.Cost >= 0)
|
||||
{
|
||||
wave.Add(chosen_zombie);
|
||||
given_points -= chosen_zombie.cost;
|
||||
given_points -= chosen_zombie.Cost;
|
||||
}
|
||||
}
|
||||
return given_points;
|
||||
|
|
@ -124,14 +124,14 @@ public partial class SurvivalZombieSpawner : Node
|
|||
int zombieIndex = cachedTankPool.Count - 1;
|
||||
while (given_points >= minSupportPoints && zombieIndex > -1)
|
||||
{
|
||||
if (cachedTankPool[zombieIndex].cost > given_points)
|
||||
if (cachedTankPool[zombieIndex].Cost > given_points)
|
||||
{
|
||||
zombieIndex--;
|
||||
continue;
|
||||
}
|
||||
var chosen_zombie = cachedTankPool[zombieIndex];
|
||||
wave.Add(chosen_zombie);
|
||||
given_points -= chosen_zombie.cost;
|
||||
given_points -= chosen_zombie.Cost;
|
||||
}
|
||||
return given_points;
|
||||
}
|
||||
|
|
@ -141,18 +141,18 @@ public partial class SurvivalZombieSpawner : Node
|
|||
{
|
||||
return given_points;
|
||||
}
|
||||
while (is_big == false && cachedHordePool.Count > 1 && cachedHordePool[1].cost * 15 <= given_points)
|
||||
while (is_big == false && cachedHordePool.Count > 1 && cachedHordePool[1].Cost * 15 <= given_points)
|
||||
{
|
||||
cachedHordePool.RemoveAt(0);
|
||||
minHordePoints = cachedHordePool[0].cost;
|
||||
minHordePoints = cachedHordePool[0].Cost;
|
||||
}
|
||||
while (given_points >= minHordePoints)
|
||||
{
|
||||
var chosen_zombie = cachedHordePool[rng.RandiRange(0, cachedHordePool.Count - 1)];
|
||||
if (given_points - chosen_zombie.cost >= 0)
|
||||
if (given_points - chosen_zombie.Cost >= 0)
|
||||
{
|
||||
wave.Add(chosen_zombie);
|
||||
given_points -= chosen_zombie.cost;
|
||||
given_points -= chosen_zombie.Cost;
|
||||
}
|
||||
}
|
||||
return given_points;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public partial class ZombieSequencer : Node2D
|
|||
|
||||
private void Spawn(string id, int lane)
|
||||
{
|
||||
RuntimeZombieData zombie = GameRegistry.GetZombieByName(id).scene.Instantiate<RuntimeZombieData>();
|
||||
RuntimeZombieData zombie = GameRegistry.GetZombieByName(id).Scene.Instantiate<RuntimeZombieData>();
|
||||
PoolContainer.Instance.Zombies.AddChild(zombie);
|
||||
|
||||
zombie.GlobalPosition = new Vector2(GlobalPosition.X, Utility.RightFieldBoundary.Y - (lane - 1) * Utility.TileHeight);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue