diff --git a/DepthsBelow/DepthsBelow/Component/Stat.cs b/DepthsBelow/DepthsBelow/Component/Stat.cs index 278cbc4..de40c82 100644 --- a/DepthsBelow/DepthsBelow/Component/Stat.cs +++ b/DepthsBelow/DepthsBelow/Component/Stat.cs @@ -26,6 +26,12 @@ namespace DepthsBelow.Component set { weaponAccuracy = value; } } + public int GetStep + { + get { return stepsTaken; } + set { stepsTaken = value; } + } + public int GetDodge { get { return enemyDodge; } @@ -80,7 +86,8 @@ namespace DepthsBelow.Component int penalty = 0; if (distance >= penaltyRange * 3) { - penalty = 100; + distance -= penaltyRange * 3; + penalty = penaltyRange + penaltyRange * 3 + penaltyRange * 5 + distance * 10; } else if (distance >= penaltyRange * 2) { diff --git a/DepthsBelow/DepthsBelow/Soldier.cs b/DepthsBelow/DepthsBelow/Soldier.cs index 21e9a96..81661b1 100644 --- a/DepthsBelow/DepthsBelow/Soldier.cs +++ b/DepthsBelow/DepthsBelow/Soldier.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using DepthsBelow.Component; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; @@ -33,7 +33,7 @@ namespace DepthsBelow } public int numberOfSteps = 14; - public int currentStep = 0; + int currentStep = 0; public int step { @@ -41,10 +41,11 @@ namespace DepthsBelow set { currentStep = value; + GetComponent().GetStep = currentStep; } - } - - public Soldier(EntityManager entityManager, ref List squad) + } + + public Soldier(EntityManager entityManager, ref List squad) : base(entityManager) { if (Texture == null) @@ -62,16 +63,16 @@ namespace DepthsBelow AddComponent(cc); var pfc = new PathFinder(this); - AddComponent(pfc); - - var stat = new Component.Stat(this) - { - Life = 10, - Defence = 10, - Strength = 10, - GetAim = 10, - GetDodge = 20 - }; + AddComponent(pfc); + + var stat = new Component.Stat(this) + { + Life = 10, + Defence = 10, + Strength = 10, + GetAim = 40, + GetDodge = 20 + }; AddComponent(stat); } @@ -145,9 +146,9 @@ namespace DepthsBelow if (Transform.World == nodeWorldPos) { - if (currentStep < numberOfSteps) + if (step < numberOfSteps) { - currentStep++; + step++; lastLastNode = lastNode; lastNode = nextNode; nextNode = GetComponent().Next(); diff --git a/DepthsBelow/DepthsBelow/Utility.cs b/DepthsBelow/DepthsBelow/Utility.cs index 3cce561..4d7d54e 100644 --- a/DepthsBelow/DepthsBelow/Utility.cs +++ b/DepthsBelow/DepthsBelow/Utility.cs @@ -30,7 +30,7 @@ namespace DepthsBelow int baseHitChance = shooting.GetAim; int baseDodgeChance = dodging.GetDodge; int distance = (int)Vector2.Distance(attacker.GetComponent().World.Position, defender.GetComponent().World.Position); - int basePenalty = shooting.Penalty(distance / (Grid.TileSize / 2)); + int basePenalty = shooting.Penalty(distance / (Grid.TileSize)); Console.WriteLine("Penalty = " + basePenalty); int chanceToHit = baseHitChance - baseDodgeChance - basePenalty; //Console.WriteLine(chanceToHit);