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; frame.Y = lastFrame.Y + lastFrame.Height;
// Update HP // Update HP
//var healthBarBg = (GUI.Frame)frame["healthBarBg"]; var healthBarBg = (GUI.Frame)frame["healthBarBg"];
//var healthBar = (GUI.Frame)frame["healthBar"]; var healthBar = (GUI.Frame)frame["healthBar"];
//healthBar.Width = (int)((healthBarBg.Width - 2) * (soldier.GetComponent<Component.Stat>().HP / soldier.GetComponent<Component.Stat>().MaxHP)); healthBar.Width = (int)((healthBarBg.Width - 2) * (soldier.GetComponent<Component.Stat>().Life / soldier.GetComponent<Component.Stat>().MaxHP));
lastFrame = frame; lastFrame = frame;
} }
+1
View File
@@ -152,6 +152,7 @@ namespace DepthsBelow
foreach (var enemy in core.Swarm) foreach (var enemy in core.Swarm)
{ {
enemy.step = 0; enemy.step = 0;
enemy.AttackedThisTurn = false;
Point target = Point.Zero; Point target = Point.Zero;
float distance = 7000; float distance = 7000;
foreach (var unit in core.Squad) foreach (var unit in core.Squad)
+7
View File
@@ -22,6 +22,8 @@ namespace DepthsBelow
public int numberOfSteps = 5; public int numberOfSteps = 5;
public int currentStep = 0; public int currentStep = 0;
public bool AttackedThisTurn = false;
public int step public int step
{ {
get { return currentStep; } get { return currentStep; }
@@ -150,14 +152,18 @@ namespace DepthsBelow
GetComponent<PathFinder>().Stop(); GetComponent<PathFinder>().Stop();
} }
foreach (var entity in entityManager.Entities) foreach (var entity in entityManager.Entities)
{ {
if (entity is Soldier) if (entity is Soldier)
{ {
if (entity.GetComponent<Component.Collision>().Rectangle.Intersects(this.GetComponent<Component.Collision>().Rectangle)) if (entity.GetComponent<Component.Collision>().Rectangle.Intersects(this.GetComponent<Component.Collision>().Rectangle))
{
if (AttackedThisTurn == false)
{ {
if (Utility.AttackTest(this.GetComponent<Component.Stat>(), entity, Utility.CalculateHitChance(this.GetComponent<Component.Stat>(), this.Transform.World.Position, entity))) if (Utility.AttackTest(this.GetComponent<Component.Stat>(), entity, Utility.CalculateHitChance(this.GetComponent<Component.Stat>(), this.Transform.World.Position, entity)))
{ {
AttackedThisTurn = true;
break; break;
} }
} }
@@ -165,6 +171,7 @@ namespace DepthsBelow
} }
} }
} }
}
} }
} }
+2 -2
View File
@@ -78,8 +78,8 @@ namespace DepthsBelow
{ {
MaxHP = 100, MaxHP = 100,
MaxPanic = 100, MaxPanic = 100,
//Life = 10, Life = 100,
Defence = 10, Defence = 25,
Strength = 50, Strength = 50,
GetAim = 40, GetAim = 40,
GetDodge = 20 GetDodge = 20