Skip to content

Commit

Permalink
Removed dice usage from Character
Browse files Browse the repository at this point in the history
  • Loading branch information
Zegis committed Feb 11, 2021
1 parent b11a1d5 commit a00638d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Kaeshi/Entity/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ public class Character: IVisible, IBattler
public int Strength { get; set; }
public int Dexterity { get; set; }
private int _life { get; set; }
public bool _isAlive { get; private set; }

private bool _isAlive { get; set; }
private int Defence { get { return Dexterity; } }

public Character(int strength, int dexterity, int maxLife)
{
Expand Down Expand Up @@ -44,10 +45,8 @@ public int GetDamage()

public bool IsHit(int hitValue)
{

var defence = Dice.Throw(Dexterity);
Console.WriteLine($"Trying to hit with {hitValue} against {defence}");
if (hitValue >= defence)
Console.WriteLine($"Trying to hit with {hitValue} against {Defence}");
if (hitValue >= Defence)
return true;

return false;
Expand Down

0 comments on commit a00638d

Please sign in to comment.