Axel Nordh hai 1 mes
pai
achega
a157fea900

+ 3 - 0
Assets/Scripts/AgentGroup.cs

@@ -35,12 +35,14 @@ public class AgentGroup
     public int CombinedMagic { get; private set; }
     public int CombinedDexterity { get; private set; }
     public int CombinedIntelligence { get; private set; }
+    public int CombinedConstitution { get; private set; }
 
     public int AvgStrength => members.Count > 0 ? (int)members.Average(a => a.Stats.Strength) : 0;
     public int AvgSpeed => members.Count > 0 ? (int)members.Average(a => a.Stats.Speed) : 0;
     public int AvgMagic => members.Count > 0 ? (int)members.Average(a => a.Stats.Magic) : 0;
     public int AvgDexterity => members.Count > 0 ? (int)members.Average(a => a.Stats.Dexterity) : 0;
     public int AvgIntelligence => members.Count > 0 ? (int)members.Average(a => a.Stats.Intelligence) : 0;
+    public int AvgConstitution => members.Count > 0 ? (int)members.Average(a => a.Stats.Constitution) : 0;
 
     private readonly List<AIAgent> members = new();
     private static int nextGroupId = 1;
@@ -126,6 +128,7 @@ public class AgentGroup
         CombinedMagic = members.Max(a => a.Stats.Magic);
         CombinedDexterity = members.Max(a => a.Stats.Dexterity);
         CombinedIntelligence = members.Max(a => a.Stats.Intelligence);
+        CombinedConstitution = members.Max(a => a.Stats.Constitution);
     }
 
     // ------------------------------------------------------------------ //

+ 3 - 1
Assets/Scripts/AgentInfoPanel.cs

@@ -124,10 +124,11 @@ public class AgentInfoPanel : MonoBehaviour
             UpdateStatDisplay("MagicBar", "MagicValue", group.CombinedMagic);
             UpdateStatDisplay("DexterityBar", "DexterityValue", group.CombinedDexterity);
             UpdateStatDisplay("IntelligenceBar", "IntelligenceValue", group.CombinedIntelligence);
+            UpdateStatDisplay("ConstitutionBar", "ConstitutionValue", group.CombinedConstitution);
             var totalLabel = panelRoot.Q<Label>("TotalStatsValue");
             if (totalLabel != null)
                 totalLabel.text = (group.CombinedStrength + group.CombinedSpeed + group.CombinedMagic
-                                   + group.CombinedDexterity + group.CombinedIntelligence).ToString();
+                                   + group.CombinedDexterity + group.CombinedIntelligence + group.CombinedConstitution).ToString();
         }
         else
         {
@@ -137,6 +138,7 @@ public class AgentInfoPanel : MonoBehaviour
             UpdateStatDisplay("MagicBar", "MagicValue", stats.Magic);
             UpdateStatDisplay("DexterityBar", "DexterityValue", stats.Dexterity);
             UpdateStatDisplay("IntelligenceBar", "IntelligenceValue", stats.Intelligence);
+            UpdateStatDisplay("ConstitutionBar", "ConstitutionValue", stats.Constitution);
             var totalLabel = panelRoot.Q<Label>("TotalStatsValue");
             if (totalLabel != null)
                 totalLabel.text = stats.GetTotalStats().ToString();

+ 8 - 4
Assets/Scripts/AgentStats.cs

@@ -11,9 +11,10 @@ public class AgentStats
     public int Magic { get; private set; }
     public int Dexterity { get; private set; }
     public int Intelligence { get; private set; }
+    public int Constitution { get; private set; }
 
-    private const int STAT_TOTAL_POOL = 50; // (5 stats * 100) / 10
-    private const int NUM_STATS = 5;
+    private const int STAT_TOTAL_POOL = 60; // (6 stats * 100) / 10
+    private const int NUM_STATS = 6;
     private const int MAX_STAT_VALUE = 100;
     private const int MIN_STAT_VALUE = 1;
 
@@ -51,6 +52,7 @@ public class AgentStats
         Magic = stats[2];
         Dexterity = stats[3];
         Intelligence = stats[4];
+        Constitution = stats[5];
 
         // Normalize to fit within pool
         NormalizeStats();
@@ -71,12 +73,14 @@ public class AgentStats
             Magic = Mathf.Max(MIN_STAT_VALUE, (int)(Magic * scale));
             Dexterity = Mathf.Max(MIN_STAT_VALUE, (int)(Dexterity * scale));
             Intelligence = Mathf.Max(MIN_STAT_VALUE, (int)(Intelligence * scale));
+            Constitution = Mathf.Max(MIN_STAT_VALUE, (int)(Constitution * scale));
+
         }
     }
 
     public int GetTotalStats()
     {
-        return Strength + Speed + Magic + Dexterity + Intelligence;
+        return Strength + Speed + Magic + Dexterity + Intelligence + Constitution;
     }
 
     /// <summary>
@@ -93,6 +97,6 @@ public class AgentStats
 
     public override string ToString()
     {
-        return $"STR: {Strength} | SPD: {Speed} | MAG: {Magic} | DEX: {Dexterity} | INT: {Intelligence} | Total: {GetTotalStats()}";
+        return $"STR: {Strength} | SPD: {Speed} | MAG: {Magic} | DEX: {Dexterity} | INT: {Intelligence} | CON: {Constitution} | Total: {GetTotalStats()}";
     }
 }

+ 31 - 38
Assets/UI/AgentInfoPanel.uxml

@@ -1,62 +1,55 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ui:UXML xmlns:ui="UnityEngine.UIElements">
-    <Style src="project://database/Assets/UI/AgentInfoPanel.uss" />
+<ui:UXML xmlns:ui="UnityEngine.UIElements" editor-extension-mode="False">
+    <Style src="project://database/Assets/UI/AgentInfoPanel.uss?fileID=7433441132597879392&amp;guid=ff1db6af3a8955b4794314866fe49e28&amp;type=3#AgentInfoPanel"/>
     <ui:VisualElement name="AgentInfoPanelRoot" class="info-panel-container">
         <ui:VisualElement class="info-panel-header">
-            <ui:Label name="AgentNameLabel" text="Agent Name" class="agent-name-title" />
-            <ui:Button name="CloseButton" text="✕" class="close-button" />
+            <ui:Label name="AgentNameLabel" text="Agent Name" class="agent-name-title"/>
+            <ui:Button name="CloseButton" text="✕" class="close-button"/>
         </ui:VisualElement>
-        
         <ui:ScrollView class="info-panel-content">
-
-            <!-- Group banner – hidden when solo -->
             <ui:VisualElement name="GroupBanner" class="group-banner">
-                <ui:Label name="GroupSizeLabel" text="Group of 2" class="group-size-label" />
-                <ui:Label name="GroupMembersLabel" text="" class="group-members-label" />
+                <ui:Label name="GroupSizeLabel" text="Group of 2" class="group-size-label"/>
+                <ui:Label name="GroupMembersLabel" text="" class="group-members-label"/>
             </ui:VisualElement>
-
             <ui:VisualElement class="stat-group">
-                <ui:Label name="StatsTitle" text="Stats" class="section-title" />
-                
+                <ui:Label name="StatsTitle" text="Stats" class="section-title"/>
                 <ui:VisualElement class="stat-item">
-                    <ui:Label text="Strength:" class="stat-name" />
-                    <ui:ProgressBar name="StrengthBar" class="stat-bar" />
-                    <ui:Label name="StrengthValue" text="0" class="stat-number" />
+                    <ui:Label text="Strength:" class="stat-name"/>
+                    <ui:ProgressBar name="StrengthBar" class="stat-bar"/>
+                    <ui:Label name="StrengthValue" text="0" class="stat-number"/>
                 </ui:VisualElement>
-                
                 <ui:VisualElement class="stat-item">
-                    <ui:Label text="Speed:" class="stat-name" />
-                    <ui:ProgressBar name="SpeedBar" class="stat-bar" />
-                    <ui:Label name="SpeedValue" text="0" class="stat-number" />
+                    <ui:Label text="Speed:" class="stat-name"/>
+                    <ui:ProgressBar name="SpeedBar" class="stat-bar"/>
+                    <ui:Label name="SpeedValue" text="0" class="stat-number"/>
                 </ui:VisualElement>
-                
                 <ui:VisualElement class="stat-item">
-                    <ui:Label text="Magic:" class="stat-name" />
-                    <ui:ProgressBar name="MagicBar" class="stat-bar" />
-                    <ui:Label name="MagicValue" text="0" class="stat-number" />
+                    <ui:Label text="Magic:" class="stat-name"/>
+                    <ui:ProgressBar name="MagicBar" class="stat-bar"/>
+                    <ui:Label name="MagicValue" text="0" class="stat-number"/>
                 </ui:VisualElement>
-                
                 <ui:VisualElement class="stat-item">
-                    <ui:Label text="Dexterity:" class="stat-name" />
-                    <ui:ProgressBar name="DexterityBar" class="stat-bar" />
-                    <ui:Label name="DexterityValue" text="0" class="stat-number" />
+                    <ui:Label text="Dexterity:" class="stat-name"/>
+                    <ui:ProgressBar name="DexterityBar" class="stat-bar"/>
+                    <ui:Label name="DexterityValue" text="0" class="stat-number"/>
                 </ui:VisualElement>
-
                 <ui:VisualElement class="stat-item">
-                    <ui:Label text="Intelligence:" class="stat-name" />
-                    <ui:ProgressBar name="IntelligenceBar" class="stat-bar" />
-                    <ui:Label name="IntelligenceValue" text="0" class="stat-number" />
+                    <ui:Label text="Intelligence:" class="stat-name"/>
+                    <ui:ProgressBar name="IntelligenceBar" class="stat-bar"/>
+                    <ui:Label name="IntelligenceValue" text="0" class="stat-number"/>
+                </ui:VisualElement>
+                <ui:VisualElement name="VisualElement" class="stat-item">
+                    <ui:Label text="Constitution:" class="stat-name"/>
+                    <ui:ProgressBar name="ConstitutionBar" class="stat-bar"/>
+                    <ui:Label name="ConstitutionValue" text="0" class="stat-number"/>
                 </ui:VisualElement>
-
                 <ui:VisualElement class="total-stat">
-                    <ui:Label text="Total Stats:" class="stat-name" />
-                    <ui:Label name="TotalStatsValue" text="0" class="total-stat-number" />
+                    <ui:Label text="Total Stats:" class="stat-name"/>
+                    <ui:Label name="TotalStatsValue" text="0" class="total-stat-number"/>
                 </ui:VisualElement>
             </ui:VisualElement>
-
             <ui:VisualElement class="status-group">
-                <ui:Label text="Status" class="section-title" />
-                <ui:Label name="StatusLabel" text="Exploring maze..." class="status-text" />
+                <ui:Label text="Status" class="section-title"/>
+                <ui:Label name="StatusLabel" text="Exploring maze..." class="status-text"/>
             </ui:VisualElement>
         </ui:ScrollView>
     </ui:VisualElement>