This commit is contained in:
Niklas Ulf Anders Cullberg
2012-10-17 11:39:01 +02:00
parent 28b6e20f94
commit c7a1317a32
4 changed files with 6 additions and 3 deletions
@@ -57,6 +57,7 @@ namespace DepthsBelow.Component
public void Kill() public void Kill()
{ {
hp = 0; hp = 0;
//Console.WriteLine("Blargh! I am dead!");
} }
public int Penalty(int distance) public int Penalty(int distance)
+3 -2
View File
@@ -52,9 +52,9 @@ namespace DepthsBelow
stat.Life = 2; stat.Life = 2;
stat.Defence = 0; stat.Defence = 0;
stat.Strength = 5; stat.Strength = 5000;
stat.GetAim = 100; stat.GetAim = 100;
stat.GetDodge = 10; stat.GetDodge = 50;
} }
public bool Selected public bool Selected
@@ -110,6 +110,7 @@ namespace DepthsBelow
nextNode = GetComponent<PathFinder>().Next(); nextNode = GetComponent<PathFinder>().Next();
break; break;
} }
Utility.HitTest(this, soldier, Utility.CalculateHitChance(this, soldier));
} }
if (nextNode != null) if (nextNode != null)
+1 -1
View File
@@ -65,7 +65,7 @@ namespace DepthsBelow
stat.Life = 10; stat.Life = 10;
stat.Defence = 10; stat.Defence = 10;
stat.Strength = 10; stat.Strength = 10;
stat.GetAim = 100; stat.GetAim = 10;
stat.GetDodge = 20; stat.GetDodge = 20;
} }
+1
View File
@@ -20,6 +20,7 @@ namespace DepthsBelow
int baseDodgeChance = dodging.GetDodge; int baseDodgeChance = dodging.GetDodge;
int basePenalty = shooting.Penalty((int)Vector2.Distance(attacker.GetComponent<Component.Transform>().World.Position, defender.GetComponent<Component.Transform>().World.Position) / Grid.TileSize); int basePenalty = shooting.Penalty((int)Vector2.Distance(attacker.GetComponent<Component.Transform>().World.Position, defender.GetComponent<Component.Transform>().World.Position) / Grid.TileSize);
int chanceToHit = baseHitChance - baseDodgeChance - basePenalty; int chanceToHit = baseHitChance - baseDodgeChance - basePenalty;
//Console.WriteLine(chanceToHit);
return chanceToHit; return chanceToHit;
} }
public static bool HitTest(Entity attacker, Entity defender, int chanceToHit) public static bool HitTest(Entity attacker, Entity defender, int chanceToHit)