summaryrefslogtreecommitdiff
path: root/DiscoBot/DSA_Game
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-07-09 00:35:52 +0200
committerTrueDoctor <d-kobert@web.de>2018-07-09 00:35:52 +0200
commitf0d68ad8edb06ff68400644fd4c943f66705cc97 (patch)
tree19ba132dd5d5ca5a53830176c64f7a864b626c3c /DiscoBot/DSA_Game
parent6ecf94cfc3e780d4c960447375b138e7473f6926 (diff)
Reworked inheritance structure
added Entity, Being, ICombatent
Diffstat (limited to 'DiscoBot/DSA_Game')
-rw-r--r--DiscoBot/DSA_Game/Characters/Being.cs23
-rw-r--r--DiscoBot/DSA_Game/Characters/Character.cs15
-rw-r--r--DiscoBot/DSA_Game/Characters/Combatant.cs26
-rw-r--r--DiscoBot/DSA_Game/Characters/Entity.cs18
-rw-r--r--DiscoBot/DSA_Game/Characters/ICharacter.cs19
-rw-r--r--DiscoBot/DSA_Game/Characters/NPC.cs13
6 files changed, 70 insertions, 44 deletions
diff --git a/DiscoBot/DSA_Game/Characters/Being.cs b/DiscoBot/DSA_Game/Characters/Being.cs
new file mode 100644
index 0000000..154e69e
--- /dev/null
+++ b/DiscoBot/DSA_Game/Characters/Being.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DiscoBot.DSA_Game.Characters
+{
+ public class Being : Entity
+ {
+ public int Lebenspunkte_Basis { get; set; } = 30;
+
+ public int Lebenspunkte_Aktuell { get; set; } = 30;
+
+ public int Ausdauer_Basis { get; set; } = 30;
+
+ public int Ausdauer_Aktuell { get; set; } = 30;
+
+ public int Astralpunkte_Basis { get; set; } = 0;
+
+ public int Astralpunkte_Aktuell { get; set; } = 0;
+ }
+}
diff --git a/DiscoBot/DSA_Game/Characters/Character.cs b/DiscoBot/DSA_Game/Characters/Character.cs
index 6616a03..c2d14eb 100644
--- a/DiscoBot/DSA_Game/Characters/Character.cs
+++ b/DiscoBot/DSA_Game/Characters/Character.cs
@@ -9,7 +9,7 @@
using DiscoBot.Audio;
using DiscoBot.Auxiliary;
- public class Character : ICharacter
+ public class Character : Being, ICharacter
{
public Character()
{
@@ -61,19 +61,6 @@
this.Post_process(); // calculate derived values
}
- public string Name { get; set; } // char name
-
- public int Lebenspunkte_Basis { get; set; }
- public int Lebenspunkte_Aktuell { get; set; }
-
- public int Astralpunkte_Basis { get; set; }
- public int Astralpunkte_Aktuell { get; set; }
-
- public int Ausdauer_Basis { get; set; }
- public int Ausdauer_Aktuell { get; set; }
-
-
-
public Dictionary<string, int> Eigenschaften { get; set; } = new Dictionary<string, int>(); // char properties
public List<Talent> Talente { get; set; } = new List<Talent>(); // list of talent objects (talents)
diff --git a/DiscoBot/DSA_Game/Characters/Combatant.cs b/DiscoBot/DSA_Game/Characters/Combatant.cs
new file mode 100644
index 0000000..a99bff9
--- /dev/null
+++ b/DiscoBot/DSA_Game/Characters/Combatant.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DiscoBot.DSA_Game.Characters
+{
+ public interface ICombatant
+ {
+ string Name { get; set; }
+
+ int Lebenspunkte_Basis { get; set; }
+ int Lebenspunkte_Aktuell { get; set; }
+
+ int Ausdauer_Basis { get; set; }
+ int Ausdauer_Aktuell { get; set; }
+
+ int Astralpunkte_Basis { get; set; }
+ int Astralpunkte_Aktuell { get; set; }
+
+ string Angriff(string talent, int erschwernis = 0);
+
+ string Parade(string talent, int erschwernis = 0);
+ }
+}
diff --git a/DiscoBot/DSA_Game/Characters/Entity.cs b/DiscoBot/DSA_Game/Characters/Entity.cs
new file mode 100644
index 0000000..f8e7a12
--- /dev/null
+++ b/DiscoBot/DSA_Game/Characters/Entity.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DiscoBot.DSA_Game.Characters
+{
+ public class Entity
+ {
+ public string Name { get; set; }
+
+ public override string ToString()
+ {
+ return this.Name;
+ }
+ }
+}
diff --git a/DiscoBot/DSA_Game/Characters/ICharacter.cs b/DiscoBot/DSA_Game/Characters/ICharacter.cs
index 3ec4258..aabebe6 100644
--- a/DiscoBot/DSA_Game/Characters/ICharacter.cs
+++ b/DiscoBot/DSA_Game/Characters/ICharacter.cs
@@ -1,28 +1,11 @@
namespace DiscoBot.DSA_Game.Characters
{
- public interface ICharacter
+ public interface ICharacter : ICombatant
{
- string Name { get; set; }
-
- int Lebenspunkte_Basis { get; set; }
- int Lebenspunkte_Aktuell { get; set; }
-
- int Ausdauer_Basis { get; set; }
- int Ausdauer_Aktuell { get; set; }
-
- int Astralpunkte_Basis { get; set; }
- int Astralpunkte_Aktuell { get; set; }
-
- //int Karmapunkte { get; set; }
-
string TestTalent(string talent, int erschwernis = 0);
string TestEigenschaft(string eigenschaft, int erschwernis = 0);
- string Angriff(string talent, int erschwernis = 0);
-
- string Parade(string talent, int erschwernis = 0);
-
string Fernkampf(string talent, int erschwernis = 0);
string TestZauber(string waffe, int erschwernis);
diff --git a/DiscoBot/DSA_Game/Characters/NPC.cs b/DiscoBot/DSA_Game/Characters/NPC.cs
index 0894df6..c135e30 100644
--- a/DiscoBot/DSA_Game/Characters/NPC.cs
+++ b/DiscoBot/DSA_Game/Characters/NPC.cs
@@ -5,7 +5,7 @@
using DiscoBot.Auxiliary;
using DiscoBot.DSA_Game.Characters;
- public class Npc : ICharacter
+ public class Npc : Being, ICharacter
{
private readonly int mean, stDv;
@@ -16,17 +16,6 @@
this.Name = name;
}
- public string Name { get; set; }
-
- public int Lebenspunkte_Basis { get; set; }
- public int Lebenspunkte_Aktuell { get; set; }
-
- public int Astralpunkte_Basis { get; set; }
- public int Astralpunkte_Aktuell { get; set; }
-
- public int Ausdauer_Basis { get; set; }
- public int Ausdauer_Aktuell { get; set; }
-
public string TestTalent(string talent, int tap = 3)
{
for (int i = 0; i <= 2; i++)