Fix Mob Spawn
This commit is contained in:
@@ -163,6 +163,7 @@ public class ViewModel : AdminPageModel
|
||||
return new JsonResult(new { error = "Mob definition not found" }) { StatusCode = 404 };
|
||||
int mobId = dungeon.Simulation.Mobs.Count + 1;
|
||||
var stats = mobDef.GetStatsForBracket(dungeon.LevelBracketMin);
|
||||
var rng = new Random(dungeon.LayoutV2.Seed);
|
||||
// Create a new mob instance
|
||||
var mob = new MobInstance
|
||||
{
|
||||
@@ -172,12 +173,15 @@ public class ViewModel : AdminPageModel
|
||||
Type = mobDef.Type,
|
||||
X = x,
|
||||
Y = y,
|
||||
SpawnX = x,
|
||||
SpawnY = y,
|
||||
Health = stats.MaxHealth,
|
||||
MaxHealth = stats.MaxHealth,
|
||||
Mana = mobDef.BaseMana,
|
||||
MaxMana = mobDef.BaseMana,
|
||||
Stats = stats,
|
||||
State = MobState.Idle,
|
||||
StateTime = (float)(rng.NextDouble() * 3f),
|
||||
SpriteConfigJson = mobDef.SpriteConfigJson,
|
||||
TintColor = mobDef.TintColor,
|
||||
Scale = mobDef.Scale,
|
||||
|
||||
Reference in New Issue
Block a user