Monster Autokill disabled, HP in bars Updated

This commit is contained in:
Niklas Ulf Anders Cullberg
2012-10-30 22:22:45 +01:00
parent f14623c882
commit 8f0b981bd3
4 changed files with 341 additions and 333 deletions
+3 -3
View File
@@ -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;
}
+1
View File
@@ -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)
+9 -2
View File
@@ -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;
}
}
}
}
+2 -2
View File
@@ -78,8 +78,8 @@ namespace DepthsBelow
{
MaxHP = 100,
MaxPanic = 100,
//Life = 10,
Defence = 10,
Life = 100,
Defence = 25,
Strength = 50,
GetAim = 40,
GetDodge = 20