Explorar o código

modify create char

Florian Morel %!s(int64=3) %!d(string=hai) anos
pai
achega
4a378f9615
Modificáronse 1 ficheiros con 8 adicións e 5 borrados
  1. 8 5
      Dotnet/DeathwatchConsoleApp/Program.cs

+ 8 - 5
Dotnet/DeathwatchConsoleApp/Program.cs

@@ -8,19 +8,22 @@ using System.Text.Json.Serialization;
 Console.WriteLine("Hello, World!");
 Console.WriteLine("Hello, World!");
 Player perso = new Player();
 Player perso = new Player();
 var fileName = $"C:/newCharacter.json";
 var fileName = $"C:/newCharacter.json";
+const string roll = "roll";
+const string createperso = "createperso";
 
 
 while (true)
 while (true)
 {
 {
     string? methodToExec = Console.ReadLine();
     string? methodToExec = Console.ReadLine();
     if (methodToExec != null)
     if (methodToExec != null)
     {
     {
+
         switch (methodToExec.ToLower())
         switch (methodToExec.ToLower())
         {
         {
-            case "roll":
-                Console.WriteLine(RollInitialStat());
+            case roll:
+                Console.WriteLine(DiceService.RollDices(1, 100));
                 break;
                 break;
 
 
-            case "createperso":
+            case createperso:
                 string jsonPerso = "";
                 string jsonPerso = "";
                 object createPerso = await CreatePerso(perso, fileName, jsonPerso);
                 object createPerso = await CreatePerso(perso, fileName, jsonPerso);
                 Console.Write(createPerso);
                 Console.Write(createPerso);
@@ -31,7 +34,8 @@ while (true)
 
 
 static int RollInitialStat()
 static int RollInitialStat()
 {
 {
-    var rollValue = DiceService.RollDices(1, 20);
+    var rollValue = DiceService.RollDices(1, 10);
+    rollValue += DiceService.RollDices(1, 10);
     rollValue += 30;
     rollValue += 30;
     return rollValue;
     return rollValue;
 }
 }
@@ -69,7 +73,6 @@ static Player InitRandomStat()
         F = RollInitialStat(),
         F = RollInitialStat(),
         FM = RollInitialStat(),
         FM = RollInitialStat(),
         INT = RollInitialStat(),
         INT = RollInitialStat(),
-        MF = RollInitialStat(),
         PER = RollInitialStat(),
         PER = RollInitialStat(),
         SOC = RollInitialStat()
         SOC = RollInitialStat()
     };
     };