Monster Autokill disabled, HP in bars Updated
This commit is contained in:
@@ -539,9 +539,9 @@ namespace DepthsBelow
|
||||
frame.Y = lastFrame.Y + lastFrame.Height;
|
||||
|
||||
// Update HP
|
||||
//var healthBarBg = (GUI.Frame)frame["healthBarBg"];
|
||||
//var healthBar = (GUI.Frame)frame["healthBar"];
|
||||
//healthBar.Width = (int)((healthBarBg.Width - 2) * (soldier.GetComponent<Component.Stat>().HP / soldier.GetComponent<Component.Stat>().MaxHP));
|
||||
var healthBarBg = (GUI.Frame)frame["healthBarBg"];
|
||||
var healthBar = (GUI.Frame)frame["healthBar"];
|
||||
healthBar.Width = (int)((healthBarBg.Width - 2) * (soldier.GetComponent<Component.Stat>().Life / soldier.GetComponent<Component.Stat>().MaxHP));
|
||||
|
||||
lastFrame = frame;
|
||||
}
|
||||
|
||||
@@ -152,6 +152,7 @@ namespace DepthsBelow
|
||||
foreach (var enemy in core.Swarm)
|
||||
{
|
||||
enemy.step = 0;
|
||||
enemy.AttackedThisTurn = false;
|
||||
Point target = Point.Zero;
|
||||
float distance = 7000;
|
||||
foreach (var unit in core.Squad)
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace DepthsBelow
|
||||
public int numberOfSteps = 5;
|
||||
public int currentStep = 0;
|
||||
|
||||
public bool AttackedThisTurn = false;
|
||||
|
||||
public int step
|
||||
{
|
||||
get { return currentStep; }
|
||||
@@ -150,15 +152,20 @@ namespace DepthsBelow
|
||||
|
||||
GetComponent<PathFinder>().Stop();
|
||||
}
|
||||
|
||||
foreach (var entity in entityManager.Entities)
|
||||
{
|
||||
if (entity is Soldier)
|
||||
{
|
||||
if (entity.GetComponent<Component.Collision>().Rectangle.Intersects(this.GetComponent<Component.Collision>().Rectangle))
|
||||
{
|
||||
if (Utility.AttackTest(this.GetComponent<Component.Stat>(), entity, Utility.CalculateHitChance(this.GetComponent<Component.Stat>(), this.Transform.World.Position, entity)))
|
||||
if (AttackedThisTurn == false)
|
||||
{
|
||||
break;
|
||||
if (Utility.AttackTest(this.GetComponent<Component.Stat>(), entity, Utility.CalculateHitChance(this.GetComponent<Component.Stat>(), this.Transform.World.Position, entity)))
|
||||
{
|
||||
AttackedThisTurn = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@ namespace DepthsBelow
|
||||
{
|
||||
MaxHP = 100,
|
||||
MaxPanic = 100,
|
||||
//Life = 10,
|
||||
Defence = 10,
|
||||
Life = 100,
|
||||
Defence = 25,
|
||||
Strength = 50,
|
||||
GetAim = 40,
|
||||
GetDodge = 20
|
||||
|
||||
Reference in New Issue
Block a user