fix abilities
This commit is contained in:
@@ -166,24 +166,7 @@ public partial class DungeonHandler
|
|||||||
FacingDirection = "down"
|
FacingDirection = "down"
|
||||||
};
|
};
|
||||||
|
|
||||||
mob.Abilities.Add(new MobAbilityState
|
dungeon.Simulation.InitializeMobAbilities(mob, mobDef, stats);
|
||||||
{
|
|
||||||
AbilityId = 0,
|
|
||||||
Definition = new DataServer.Data.Entities.MobAbilityDefinition
|
|
||||||
{
|
|
||||||
Id = 0,
|
|
||||||
Name = "Basic Attack",
|
|
||||||
Key = "basic_attack",
|
|
||||||
AbilityType = DataServer.Data.Enums.MobAbilityType.MeleeAttack,
|
|
||||||
BaseDamage = stats.PhysicalDamage,
|
|
||||||
Range = stats.AttackRange,
|
|
||||||
Cooldown = 1f / stats.AttackSpeed,
|
|
||||||
AnimationKey = "attack",
|
|
||||||
DamageTypeKey = stats.DamageTypeKey
|
|
||||||
},
|
|
||||||
CooldownRemaining = 0,
|
|
||||||
Priority = 1
|
|
||||||
});
|
|
||||||
|
|
||||||
dungeon.Simulation.Mobs[newMobId] = mob;
|
dungeon.Simulation.Mobs[newMobId] = mob;
|
||||||
return mob;
|
return mob;
|
||||||
|
|||||||
@@ -237,41 +237,47 @@ public partial class DungeonSimulation
|
|||||||
FacingDirection = "down"
|
FacingDirection = "down"
|
||||||
};
|
};
|
||||||
|
|
||||||
LoadMobAbilities(mob, mobDef);
|
InitializeMobAbilities(mob, mobDef, stats);
|
||||||
|
|
||||||
// If no abilities loaded, give a basic attack
|
|
||||||
if (mob.Abilities.Count == 0)
|
|
||||||
{
|
|
||||||
if (mobDef.Id == 100 || mobDef.Name == "The Bone Lord")
|
|
||||||
{
|
|
||||||
Console.WriteLine(
|
|
||||||
$"[DungeonSimulation] Bone Lord has no loaded abilities; falling back to Basic Attack.");
|
|
||||||
}
|
|
||||||
|
|
||||||
mob.Abilities.Add(new MobAbilityState
|
|
||||||
{
|
|
||||||
AbilityId = 0,
|
|
||||||
Definition = new MobAbilityDefinition
|
|
||||||
{
|
|
||||||
Id = 0,
|
|
||||||
Name = "Basic Attack",
|
|
||||||
Key = "basic_attack",
|
|
||||||
AbilityType = MobAbilityType.MeleeAttack,
|
|
||||||
BaseDamage = stats.PhysicalDamage,
|
|
||||||
Range = stats.AttackRange,
|
|
||||||
Cooldown = 1f / stats.AttackSpeed,
|
|
||||||
AnimationKey = "attack",
|
|
||||||
DamageTypeKey = stats.DamageTypeKey
|
|
||||||
},
|
|
||||||
CooldownRemaining = 0,
|
|
||||||
Priority = 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Mobs[mobSpawn.Id] = mob;
|
Mobs[mobSpawn.Id] = mob;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void InitializeMobAbilities(MobInstance mob, DungeonMobDefinition mobDef, DungeonMobCombatStats stats)
|
||||||
|
{
|
||||||
|
mob.Abilities.Clear();
|
||||||
|
LoadMobAbilities(mob, mobDef);
|
||||||
|
|
||||||
|
// If no abilities loaded, give a basic attack
|
||||||
|
if (mob.Abilities.Count == 0)
|
||||||
|
{
|
||||||
|
if (mobDef.Id == 100 || mobDef.Name == "The Bone Lord")
|
||||||
|
{
|
||||||
|
Console.WriteLine(
|
||||||
|
$"[DungeonSimulation] Bone Lord has no loaded abilities; falling back to Basic Attack.");
|
||||||
|
}
|
||||||
|
|
||||||
|
mob.Abilities.Add(new MobAbilityState
|
||||||
|
{
|
||||||
|
AbilityId = 0,
|
||||||
|
Definition = new MobAbilityDefinition
|
||||||
|
{
|
||||||
|
Id = 0,
|
||||||
|
Name = "Basic Attack",
|
||||||
|
Key = "basic_attack",
|
||||||
|
AbilityType = MobAbilityType.MeleeAttack,
|
||||||
|
BaseDamage = stats.PhysicalDamage,
|
||||||
|
Range = stats.AttackRange,
|
||||||
|
Cooldown = 1f / stats.AttackSpeed,
|
||||||
|
AnimationKey = "attack",
|
||||||
|
DamageTypeKey = stats.DamageTypeKey
|
||||||
|
},
|
||||||
|
CooldownRemaining = 0,
|
||||||
|
Priority = 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void InitializeChests()
|
private void InitializeChests()
|
||||||
{
|
{
|
||||||
foreach (var chestSpawn in Layout.ChestSpawns)
|
foreach (var chestSpawn in Layout.ChestSpawns)
|
||||||
@@ -1395,30 +1401,7 @@ public partial class DungeonSimulation
|
|||||||
Phases = mobDef.Phases
|
Phases = mobDef.Phases
|
||||||
};
|
};
|
||||||
|
|
||||||
LoadMobAbilities(mob, mobDef);
|
InitializeMobAbilities(mob, mobDef, stats);
|
||||||
|
|
||||||
// If no abilities loaded, give a basic attack
|
|
||||||
if (mob.Abilities.Count == 0)
|
|
||||||
{
|
|
||||||
mob.Abilities.Add(new MobAbilityState
|
|
||||||
{
|
|
||||||
AbilityId = 0,
|
|
||||||
Definition = new MobAbilityDefinition
|
|
||||||
{
|
|
||||||
Id = 0,
|
|
||||||
Name = "Basic Attack",
|
|
||||||
Key = "basic_attack",
|
|
||||||
AbilityType = MobAbilityType.MeleeAttack,
|
|
||||||
BaseDamage = stats.PhysicalDamage,
|
|
||||||
Range = stats.AttackRange,
|
|
||||||
Cooldown = 1f / stats.AttackSpeed,
|
|
||||||
AnimationKey = "attack",
|
|
||||||
DamageTypeKey = stats.DamageTypeKey
|
|
||||||
},
|
|
||||||
CooldownRemaining = 0,
|
|
||||||
Priority = 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Mobs[mob.Id] = mob;
|
Mobs[mob.Id] = mob;
|
||||||
Console.WriteLine($"[DungeonSimulation] Summoned {mob.Name} (ID {mob.Id}) at ({x}, {y})");
|
Console.WriteLine($"[DungeonSimulation] Summoned {mob.Name} (ID {mob.Id}) at ({x}, {y})");
|
||||||
|
|||||||
Reference in New Issue
Block a user