-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnemy.cs
34 lines (29 loc) · 907 Bytes
/
Enemy.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DndSpellCards
{
public class Enemy
{
public string name { get; }
public int healthPoints { get; set; }
public int creatureRating { get; }
public Image image;
public Enemy(string _name, int _healthPoints, int _creatureRating, Image image)
{
this.name = _name;
this.healthPoints = _healthPoints;
this.creatureRating = _creatureRating;
this.image = image;
}
//Calulate damage to be done to current player
public int Bite(Character character) {
Random r = new Random();
int damage = r.Next(1, 9) + 3 + r.Next(2,7) + r.Next(2, 7);
character.health -= damage;
return damage;
}
}
}