Steps taken and distance taken into account
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace DepthsBelow
|
||||
}
|
||||
|
||||
public int numberOfSteps = 14;
|
||||
public int currentStep = 0;
|
||||
int currentStep = 0;
|
||||
|
||||
public int step
|
||||
{
|
||||
@@ -41,6 +41,7 @@ namespace DepthsBelow
|
||||
set
|
||||
{
|
||||
currentStep = value;
|
||||
GetComponent<Component.Stat>().GetStep = currentStep;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +70,7 @@ namespace DepthsBelow
|
||||
Life = 10,
|
||||
Defence = 10,
|
||||
Strength = 10,
|
||||
GetAim = 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<PathFinder>().Next();
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace DepthsBelow
|
||||
int baseHitChance = shooting.GetAim;
|
||||
int baseDodgeChance = dodging.GetDodge;
|
||||
int distance = (int)Vector2.Distance(attacker.GetComponent<Transform>().World.Position, defender.GetComponent<Transform>().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);
|
||||
|
||||
Reference in New Issue
Block a user