summaryrefslogtreecommitdiff
path: root/DSACore/DSA_Game/Characters/NPC.cs
diff options
context:
space:
mode:
Diffstat (limited to 'DSACore/DSA_Game/Characters/NPC.cs')
-rw-r--r--DSACore/DSA_Game/Characters/NPC.cs80
1 files changed, 26 insertions, 54 deletions
diff --git a/DSACore/DSA_Game/Characters/NPC.cs b/DSACore/DSA_Game/Characters/NPC.cs
index 0a660ee..e6b7bed 100644
--- a/DSACore/DSA_Game/Characters/NPC.cs
+++ b/DSACore/DSA_Game/Characters/NPC.cs
@@ -5,8 +5,7 @@ using DSALib.Characters;
namespace DSACore.Characters
{
using System;
-
- using DSACore.Auxiliary;
+ using Auxiliary;
using DSACore.DSA_Game.Characters;
public class Npc : Being, ICharacter
@@ -17,94 +16,67 @@ namespace DSACore.Characters
{
this.mean = mean;
this.stDv = stDv;
- this.Name = name;
+ Name = name;
}
public string TestTalent(string talent, int tap = 3)
{
- for (int i = 0; i <= 2; i++)
+ for (var i = 0; i <= 2; i++)
{
// foreach property, dice and tap
- int temp = Dice.Roll();
- int eigenschaft = (int)Math.Round(RandomMisc.Random(this.stDv, this.mean));
+ var temp = Dice.Roll();
+ var eigenschaft = (int) Math.Round(RandomMisc.Random(stDv, mean));
- if (eigenschaft < temp)
- {
- tap -= temp - eigenschaft;
- }
+ if (eigenschaft < temp) tap -= temp - eigenschaft;
}
- if (tap >= 0)
- {
- return $"{this.Name} vollführt {talent} erfolgreich";
- }
+ if (tap >= 0) return $"{Name} vollführt {talent} erfolgreich";
- return $"{this.Name} scheitert an {talent}";
+ return $"{Name} scheitert an {talent}";
}
public string TestEigenschaft(string eigenschaft, int erschwernis = 0)
{
- int temp = Dice.Roll();
- int prop = (int)Math.Round(RandomMisc.Random(this.stDv, this.stDv));
-
- if (temp + erschwernis < prop)
- {
- return $"{this.Name} vollführt {eigenschaft} erfolgreich";
- }
+ var temp = Dice.Roll();
+ var prop = (int) Math.Round(RandomMisc.Random(stDv, stDv));
- return $"{this.Name} scheitert an {eigenschaft}";
+ if (temp + erschwernis < prop) return $"{Name} vollführt {eigenschaft} erfolgreich";
+
+ return $"{Name} scheitert an {eigenschaft}";
}
public string Angriff(string waffe, int erschwernis = 0)
{
- int temp = Dice.Roll();
+ var temp = Dice.Roll();
- if (temp == 1)
- {
- return $"{this.Name} greift kritisch mit {waffe} an";
- }
+ if (temp == 1) return $"{Name} greift kritisch mit {waffe} an";
- if (temp < erschwernis)
- {
- return $"{this.Name} greift mit {waffe} an";
- }
+ if (temp < erschwernis) return $"{Name} greift mit {waffe} an";
- return $"{this.Name} haut mit {waffe} daneben";
+ return $"{Name} haut mit {waffe} daneben";
}
public string Parade(string waffe, int erschwernis = 0)
{
- int temp = Dice.Roll();
+ var temp = Dice.Roll();
- if (temp == 1)
- {
- return $"{this.Name} pariert mit {waffe} meisterlich";
- }
+ if (temp == 1) return $"{Name} pariert mit {waffe} meisterlich";
- if (temp < erschwernis)
- {
- return $"{this.Name} pariert mit {waffe} an";
- }
+ if (temp < erschwernis) return $"{Name} pariert mit {waffe} an";
- return $"{this.Name} schafft es nicht mit {waffe} zu parieren";
+ return $"{Name} schafft es nicht mit {waffe} zu parieren";
}
public string Fernkampf(string waffe, int erschwernis = 0)
{
- int temp = Dice.Roll();
+ var temp = Dice.Roll();
- if (temp == 1)
- {
- return $"{this.Name} trifft kritisch mit {waffe}";
- }
+ if (temp == 1) return $"{Name} trifft kritisch mit {waffe}";
- if (temp < erschwernis)
- {
- return $"{this.Name} greift mit {waffe} an";
- }
+ if (temp < erschwernis) return $"{Name} greift mit {waffe} an";
- return $"{this.Name} schießt mit {waffe} daneben";
+ return $"{Name} schießt mit {waffe} daneben";
}
public string TestZauber(string zauber, int erschwernis)
@@ -112,4 +84,4 @@ namespace DSACore.Characters
return TestTalent(zauber, erschwernis);
}
}
-}
+} \ No newline at end of file