소스 검색

Updated to the loot screen and gameover screen

Axel Nordh 8 달 전
부모
커밋
4fe75a43cd
45개의 변경된 파일6815개의 추가작업 그리고 110개의 파일을 삭제
  1. 1 1
      Assets/Prefabs/Characters/Enemies/EnemyCharacter.prefab
  2. 1 1
      Assets/Prefabs/Characters/Players/PlayerCharacter.prefab
  3. 20 0
      Assets/Resources/MainSettings.asset
  4. 33 0
      Assets/Resources/UI/BattleSceneUI/BattleControlls.uss
  5. 7 0
      Assets/Resources/UI/BattleSceneUI/BattleControlls.uxml
  6. 171 0
      Assets/Resources/UI/BattleSceneUI/GameOverScreen.uss
  7. 139 0
      Assets/Resources/UI/BattleSceneUI/GameOverScreen.uxml
  8. 171 0
      Assets/Resources/UI/BattleSceneUI/GameOverScreen_Clean.uss
  9. 213 0
      Assets/Resources/UI/BattleSceneUI/PostBattleLootScreen.uss
  10. 66 0
      Assets/Resources/UI/BattleSceneUI/PostBattleLootScreen.uxml
  11. 213 0
      Assets/Resources/UI/BattleSceneUI/PostBattleLootScreen_Clean.uss
  12. 136 38
      Assets/Scenes/BattleScene.unity
  13. 24 2
      Assets/Scripts/BattleScene/BattleActionIntegration.cs
  14. 143 15
      Assets/Scripts/BattleScene/BattleItemSelector.cs
  15. 142 0
      Assets/Scripts/BattleScene/BattleSetup.cs
  16. 523 0
      Assets/Scripts/BattleScene/BattleTestMode.cs
  17. 368 0
      Assets/Scripts/BattleScene/EnhancedBattleTestMode.cs
  18. 215 4
      Assets/Scripts/BattleScene/GameManager.cs
  19. 0 0
      Assets/Scripts/BattleScene/ItemSelectionUI.cs
  20. 0 0
      Assets/Scripts/BattleScene/ItemSelectionUI_New.cs
  21. 897 0
      Assets/Scripts/BattleScene/PostBattleLootSystem.cs
  22. 16 0
      Assets/Scripts/BattleSetup/CombatDataTransfer.cs
  23. 2 0
      Assets/Scripts/Characters/Enemies/SkeletonCharacter.cs
  24. 2 0
      Assets/Scripts/Characters/HumanCharacter.cs
  25. 44 0
      Assets/Scripts/Objects/Character.cs
  26. 427 0
      Assets/Scripts/Objects/CharacterCarryCapacity.cs
  27. 656 0
      Assets/Scripts/UI/GameOverScreen.cs
  28. 5 0
      Assets/Scripts/UI/QuickShopSetup.cs
  29. 171 0
      Assets/UI/BattleSceneUI/GameOverScreen.uss
  30. 139 0
      Assets/UI/BattleSceneUI/GameOverScreen.uxml
  31. 171 0
      Assets/UI/BattleSceneUI/GameOverScreen_Clean.uss
  32. 213 0
      Assets/UI/BattleSceneUI/PostBattleLootScreen.uss
  33. 66 0
      Assets/UI/BattleSceneUI/PostBattleLootScreen.uxml
  34. 213 0
      Assets/UI/BattleSceneUI/PostBattleLootScreen_Clean.uss
  35. 0 0
      Assets/UI/ItemSelectionUI.uss
  36. 0 0
      Assets/UI/ItemSelectionUI.uxml
  37. 101 0
      BASIC_TEST_MODE_INVENTORY_UPDATE.md
  38. 220 0
      BATTLE_SCENE_TEST_MODE_GUIDE.md
  39. 95 0
      DRAG_TO_MOVE_ATTACK_FIX.md
  40. 131 0
      INVENTORY_INTEGRATION_COMPLETE.md
  41. 273 0
      POST_BATTLE_LOOTING_SYSTEM_GUIDE.md
  42. 166 0
      POST_BATTLE_SYSTEMS_SUMMARY.md
  43. 172 0
      QUICK_SETUP_POST_BATTLE_SYSTEMS.md
  44. 2 2
      UserSettings/EditorUserSettings.asset
  45. 47 47
      UserSettings/Layouts/default-6000.dwlt

+ 1 - 1
Assets/Prefabs/Characters/Enemies/EnemyCharacter.prefab

@@ -557,7 +557,7 @@ MonoBehaviour:
     m_PressedTrigger: Pressed
     m_SelectedTrigger: Selected
     m_DisabledTrigger: Disabled
-  m_Interactable: 1
+  m_Interactable: 0
   m_TargetGraphic: {fileID: 0}
   m_FillRect: {fileID: 3460715561665505408}
   m_HandleRect: {fileID: 0}

+ 1 - 1
Assets/Prefabs/Characters/Players/PlayerCharacter.prefab

@@ -77,7 +77,7 @@ MonoBehaviour:
     m_PressedTrigger: Pressed
     m_SelectedTrigger: Selected
     m_DisabledTrigger: Disabled
-  m_Interactable: 1
+  m_Interactable: 0
   m_TargetGraphic: {fileID: 0}
   m_FillRect: {fileID: 7405259244441291236}
   m_HandleRect: {fileID: 0}

+ 20 - 0
Assets/Resources/MainSettings.asset

@@ -0,0 +1,20 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 0}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
+  m_Name: TravelPanelSettings
+  themeUss: {fileID: -4733365628477956816, guid: 0000000000000000f000000000000000, type: 0}
+  targetTexture: {fileID: 0}
+  scaleMode: 1
+  scale: 1
+  fallbackDpi: 96
+  referenceDpi: 96
+  sortingOrder: 0

+ 33 - 0
Assets/Resources/UI/BattleSceneUI/BattleControlls.uss

@@ -0,0 +1,33 @@
+.battle-button {
+    min-width: 150px; /* Increased width */
+    height: 45px;    /* Increased height */
+    margin-left: 15px;
+    margin-right: 15px;
+    font-size: 18px; /* Slightly larger font */
+    -unity-font-style: bold;
+    background-color: rgb(60, 90, 180); /* A nice blue */
+    color: white;
+    border-left-width: 0px; /* Cleaner look without borders, relying on background and shadow */
+    border-right-width: 0px;
+    border-top-width: 0px;
+    border-bottom-width: 0px;
+    border-radius: 8px; /* More rounded corners */
+    transition-property: background-color, transform, box-shadow;
+    transition-duration: 0.15s; 
+    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
+}
+
+.battle-button:hover {
+    background-color: rgb(80, 110, 200); /* Lighter blue on hover */
+}
+
+.battle-button:active {
+    background-color: rgb(50, 80, 160); /* Darker blue when pressed */
+    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);  
+}
+
+.battle-button:disabled {
+    background-color: rgb(120, 120, 120); /* Greyed out when disabled */
+    color: rgb(180, 180, 180);
+    box-shadow: none; /* No shadow when disabled */
+}

+ 7 - 0
Assets/Resources/UI/BattleSceneUI/BattleControlls.uxml

@@ -0,0 +1,7 @@
+<ui:UXML xmlns:ui="UnityEngine.UIElements">
+    <Style src="project://database/Assets/UI/BattleSceneUI/BattleControlls.uss?fileID=7433441132597879392&amp;guid=fbc34c6a6f43e6e4586bf7f1ff6a9390&amp;type=3#BattleControlls" />
+    <ui:VisualElement name="BattleControlsContainer" style="flex-direction: row; justify-content: center; align-items: center; position: absolute; bottom: 20px; width: 100%; padding: 10px;">
+        <ui:Button name="AdvanceActionButton" text="Advance Action" class="battle-button" />
+        <ui:Button name="RunPauseButton" text="Run" class="battle-button" />
+    </ui:VisualElement>
+</ui:UXML>

+ 171 - 0
Assets/Resources/UI/BattleSceneUI/GameOverScreen.uss

@@ -0,0 +1,171 @@
+/* Clean Game Over Screen Styles - Unity UI Toolkit Compatible */
+
+/* Main Overlay */
+.gameover-overlay {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(30, 0, 0, 0.9);
+    justify-content: center;
+    align-items: center;
+}
+
+.gameover-background {
+    background-color: rgba(40, 20, 20, 0.95);
+    border-width: 2px;
+    border-color: rgb(160, 60, 60);
+    border-radius: 15px;
+    padding: 30px;
+    width: 85%;
+    max-width: 1000px;
+    max-height: 90%;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+/* Header */
+.gameover-title {
+    font-size: 42px;
+    color: rgb(255, 80, 80);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.gameover-subtitle {
+    font-size: 18px;
+    color: rgb(200, 150, 150);
+    margin-bottom: 20px;
+    -unity-text-align: center;
+    -unity-font-style: italic;
+}
+
+/* Main Content */
+.main-content {
+    flex-grow: 1;
+    flex-direction: row;
+    justify-content: space-between;
+}
+
+.statistics-section {
+    flex-grow: 1;
+    background-color: rgba(50, 30, 30, 0.7);
+    border-radius: 10px;
+    padding: 20px;
+    margin-right: 10px;
+}
+
+.assessment-section {
+    width: 30%;
+    background-color: rgba(60, 25, 25, 0.7);
+    border-radius: 10px;
+    padding: 20px;
+    margin-left: 10px;
+}
+
+.section-title {
+    font-size: 20px;
+    color: rgb(255, 150, 150);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+/* Statistics Categories */
+.stats-category {
+    margin-bottom: 20px;
+    padding: 15px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 8px;
+}
+
+.category-title {
+    font-size: 16px;
+    color: rgb(255, 200, 100);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.stat-row {
+    flex-direction: row;
+    justify-content: space-between;
+    margin-bottom: 5px;
+    padding: 2px 0;
+}
+
+.stat-label {
+    font-size: 14px;
+    color: rgb(200, 180, 180);
+    flex-grow: 1;
+}
+
+.stat-value {
+    font-size: 14px;
+    color: rgb(255, 255, 255);
+    -unity-text-align: right;
+    -unity-font-style: bold;
+}
+
+/* Assessment */
+.assessment-title {
+    font-size: 18px;
+    color: rgb(255, 150, 150);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.assessment-text {
+    font-size: 16px;
+    color: rgb(220, 200, 200);
+    margin-bottom: 20px;
+    -unity-text-align: center;
+    white-space: normal;
+}
+
+/* Footer Buttons */
+.footer-section {
+    align-items: center;
+    margin-top: 20px;
+}
+
+.button-container {
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+}
+
+.action-button {
+    min-width: 140px;
+    height: 45px;
+    margin: 0 15px;
+    border-radius: 22px;
+    font-size: 16px;
+    -unity-font-style: bold;
+    cursor: pointer;
+}
+
+.restart-button {
+    background-color: rgb(100, 60, 60);
+    border-color: rgb(140, 80, 80);
+    color: rgb(255, 255, 255);
+}
+
+.restart-button:hover {
+    background-color: rgb(140, 80, 80);
+    border-color: rgb(180, 100, 100);
+}
+
+.menu-button {
+    background-color: rgb(60, 60, 100);
+    border-color: rgb(80, 80, 140);
+    color: rgb(255, 255, 255);
+}
+
+.menu-button:hover {
+    background-color: rgb(80, 80, 140);
+    border-color: rgb(100, 100, 180);
+}

+ 139 - 0
Assets/Resources/UI/BattleSceneUI/GameOverScreen.uxml

@@ -0,0 +1,139 @@
+<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
+    
+    <!-- Full Screen Overlay -->
+    <ui:VisualElement name="GameOverOverlay" class="gameover-overlay">
+        <!-- Background Panel -->
+        <ui:VisualElement name="GameOverBackground" class="gameover-background">
+            
+            <!-- Header Section -->
+            <ui:VisualElement name="HeaderSection" class="header-section">
+                <ui:Label text="GAME OVER" display-tooltip-when-elided="true" name="GameOverTitle" class="gameover-title" />
+                <ui:Label text="All heroes have fallen..." display-tooltip-when-elided="true" name="GameOverSubtitle" class="gameover-subtitle" />
+            </ui:VisualElement>
+            
+            <!-- Main Content Section -->
+            <ui:VisualElement name="MainContent" class="main-content">
+                
+                <!-- Statistics Section -->
+                <ui:VisualElement name="StatisticsSection" class="statistics-section">
+                    <ui:Label text="Journey Statistics" display-tooltip-when-elided="true" name="StatisticsTitle" class="section-title" />
+                    <ui:ScrollView name="StatisticsList" class="statistics-list">
+                        
+                        <!-- Time & Travel Stats -->
+                        <ui:VisualElement name="TimeSection" class="stats-category">
+                            <ui:Label text="Time &amp; Travel" display-tooltip-when-elided="true" name="TimeSectionTitle" class="category-title" />
+                            <ui:VisualElement name="TimeStats" class="stat-group">
+                                <ui:VisualElement name="PlayTimeRow" class="stat-row">
+                                    <ui:Label text="Total Play Time:" display-tooltip-when-elided="true" name="PlayTimeLabel" class="stat-label" />
+                                    <ui:Label text="0h 0m" display-tooltip-when-elided="true" name="PlayTimeValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="TravelTimeRow" class="stat-row">
+                                    <ui:Label text="Time Traveling:" display-tooltip-when-elided="true" name="TravelTimeLabel" class="stat-label" />
+                                    <ui:Label text="0h 0m" display-tooltip-when-elided="true" name="TravelTimeValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="DaysTraveledRow" class="stat-row">
+                                    <ui:Label text="Days Traveled:" display-tooltip-when-elided="true" name="DaysTraveledLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="DaysTraveledValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="LocationsRow" class="stat-row">
+                                    <ui:Label text="Locations Visited:" display-tooltip-when-elided="true" name="LocationsLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="LocationsVisitedValue" class="stat-value" />
+                                </ui:VisualElement>
+                            </ui:VisualElement>
+                        </ui:VisualElement>
+                        
+                        <!-- Combat Stats -->
+                        <ui:VisualElement name="CombatSection" class="stats-category">
+                            <ui:Label text="Combat" display-tooltip-when-elided="true" name="CombatSectionTitle" class="category-title" />
+                            <ui:VisualElement name="CombatStats" class="stat-group">
+                                <ui:VisualElement name="BattlesWonRow" class="stat-row">
+                                    <ui:Label text="Battles Won:" display-tooltip-when-elided="true" name="BattlesWonLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="BattlesWonValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="BattlesLostRow" class="stat-row">
+                                    <ui:Label text="Battles Lost:" display-tooltip-when-elided="true" name="BattlesLostLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="BattlesLostValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="WinRateRow" class="stat-row">
+                                    <ui:Label text="Win Rate:" display-tooltip-when-elided="true" name="WinRateLabel" class="stat-label" />
+                                    <ui:Label text="0%" display-tooltip-when-elided="true" name="WinRateValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="EnemiesSlainRow" class="stat-row">
+                                    <ui:Label text="Enemies Slain:" display-tooltip-when-elided="true" name="EnemiesSlainLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="EnemiesSlainValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="DamageDealtRow" class="stat-row">
+                                    <ui:Label text="Damage Dealt:" display-tooltip-when-elided="true" name="DamageDealtLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="DamageDealtValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="DamageTakenRow" class="stat-row">
+                                    <ui:Label text="Damage Taken:" display-tooltip-when-elided="true" name="DamageTakenLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="DamageTakenValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="CharactersLostRow" class="stat-row">
+                                    <ui:Label text="Characters Lost:" display-tooltip-when-elided="true" name="CharactersLostLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="CharactersLostValue" class="stat-value" />
+                                </ui:VisualElement>
+                            </ui:VisualElement>
+                        </ui:VisualElement>
+                        
+                        <!-- Social & Quests Stats -->
+                        <ui:VisualElement name="SocialSection" class="stats-category">
+                            <ui:Label text="Social &amp; Quests" display-tooltip-when-elided="true" name="SocialSectionTitle" class="category-title" />
+                            <ui:VisualElement name="SocialStats" class="stat-group">
+                                <ui:VisualElement name="PeopleHelpedRow" class="stat-row">
+                                    <ui:Label text="People Helped:" display-tooltip-when-elided="true" name="PeopleHelpedLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="PeopleHelpedValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="LivesSavedRow" class="stat-row">
+                                    <ui:Label text="Lives Saved:" display-tooltip-when-elided="true" name="LivesSavedLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="LivesSavedValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="QuestsCompletedRow" class="stat-row">
+                                    <ui:Label text="Quests Completed:" display-tooltip-when-elided="true" name="QuestsCompletedLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="QuestsCompletedValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="QuestsFailedRow" class="stat-row">
+                                    <ui:Label text="Quests Failed:" display-tooltip-when-elided="true" name="QuestsFailedLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="QuestsFailedValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="FameLevelRow" class="stat-row">
+                                    <ui:Label text="Fame Level:" display-tooltip-when-elided="true" name="FameLevelLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="FameLevelValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="GoldEarnedRow" class="stat-row">
+                                    <ui:Label text="Gold Earned:" display-tooltip-when-elided="true" name="GoldEarnedLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="GoldEarnedValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="GoldSpentRow" class="stat-row">
+                                    <ui:Label text="Gold Spent:" display-tooltip-when-elided="true" name="GoldSpentLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="GoldSpentValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="NetWorthRow" class="stat-row">
+                                    <ui:Label text="Net Worth:" display-tooltip-when-elided="true" name="NetWorthLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="NetWorthValue" class="stat-value" />
+                                </ui:VisualElement>
+                            </ui:VisualElement>
+                        </ui:VisualElement>
+                    </ui:ScrollView>
+                </ui:VisualElement>
+                
+                <!-- Final Assessment Section -->
+                <ui:VisualElement name="AssessmentSection" class="assessment-section">
+                    <ui:Label text="Final Assessment" display-tooltip-when-elided="true" name="AssessmentTitle" class="section-title" />
+                    <ui:VisualElement name="AssessmentContent" class="assessment-content">
+                        <ui:Label text="Your adventure has ended..." display-tooltip-when-elided="true" name="AssessmentText" class="assessment-text" />
+                    </ui:VisualElement>
+                </ui:VisualElement>
+            </ui:VisualElement>
+            
+            <!-- Footer Section -->
+            <ui:VisualElement name="FooterSection" class="footer-section">
+                <ui:VisualElement name="ButtonContainer" class="button-container">
+                    <ui:Button text="Restart Game" display-tooltip-when-elided="true" name="RestartButton" class="action-button restart-button" />
+                    <ui:Button text="Main Menu" display-tooltip-when-elided="true" name="MainMenuButton" class="action-button menu-button" />
+                </ui:VisualElement>
+            </ui:VisualElement>
+        </ui:VisualElement>
+    </ui:VisualElement>
+</ui:UXML>

+ 171 - 0
Assets/Resources/UI/BattleSceneUI/GameOverScreen_Clean.uss

@@ -0,0 +1,171 @@
+/* Clean Game Over Screen Styles - Unity UI Toolkit Compatible */
+
+/* Main Overlay */
+.gameover-overlay {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(30, 0, 0, 0.9);
+    justify-content: center;
+    align-items: center;
+}
+
+.gameover-background {
+    background-color: rgba(40, 20, 20, 0.95);
+    border-width: 2px;
+    border-color: rgb(160, 60, 60);
+    border-radius: 15px;
+    padding: 30px;
+    width: 85%;
+    max-width: 1000px;
+    max-height: 90%;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+/* Header */
+.gameover-title {
+    font-size: 42px;
+    color: rgb(255, 80, 80);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.gameover-subtitle {
+    font-size: 18px;
+    color: rgb(200, 150, 150);
+    margin-bottom: 20px;
+    -unity-text-align: center;
+    -unity-font-style: italic;
+}
+
+/* Main Content */
+.main-content {
+    flex-grow: 1;
+    flex-direction: row;
+    justify-content: space-between;
+}
+
+.statistics-section {
+    flex-grow: 1;
+    background-color: rgba(50, 30, 30, 0.7);
+    border-radius: 10px;
+    padding: 20px;
+    margin-right: 10px;
+}
+
+.assessment-section {
+    width: 30%;
+    background-color: rgba(60, 25, 25, 0.7);
+    border-radius: 10px;
+    padding: 20px;
+    margin-left: 10px;
+}
+
+.section-title {
+    font-size: 20px;
+    color: rgb(255, 150, 150);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+/* Statistics Categories */
+.stats-category {
+    margin-bottom: 20px;
+    padding: 15px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 8px;
+}
+
+.category-title {
+    font-size: 16px;
+    color: rgb(255, 200, 100);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.stat-row {
+    flex-direction: row;
+    justify-content: space-between;
+    margin-bottom: 5px;
+    padding: 2px 0;
+}
+
+.stat-label {
+    font-size: 14px;
+    color: rgb(200, 180, 180);
+    flex-grow: 1;
+}
+
+.stat-value {
+    font-size: 14px;
+    color: rgb(255, 255, 255);
+    -unity-text-align: right;
+    -unity-font-style: bold;
+}
+
+/* Assessment */
+.assessment-title {
+    font-size: 18px;
+    color: rgb(255, 150, 150);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.assessment-text {
+    font-size: 16px;
+    color: rgb(220, 200, 200);
+    margin-bottom: 20px;
+    -unity-text-align: center;
+    white-space: normal;
+}
+
+/* Footer Buttons */
+.footer-section {
+    align-items: center;
+    margin-top: 20px;
+}
+
+.button-container {
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+}
+
+.action-button {
+    min-width: 140px;
+    height: 45px;
+    margin: 0 15px;
+    border-radius: 22px;
+    font-size: 16px;
+    -unity-font-style: bold;
+    cursor: pointer;
+}
+
+.restart-button {
+    background-color: rgb(100, 60, 60);
+    border-color: rgb(140, 80, 80);
+    color: rgb(255, 255, 255);
+}
+
+.restart-button:hover {
+    background-color: rgb(140, 80, 80);
+    border-color: rgb(180, 100, 100);
+}
+
+.menu-button {
+    background-color: rgb(60, 60, 100);
+    border-color: rgb(80, 80, 140);
+    color: rgb(255, 255, 255);
+}
+
+.menu-button:hover {
+    background-color: rgb(80, 80, 140);
+    border-color: rgb(100, 100, 180);
+}

+ 213 - 0
Assets/Resources/UI/BattleSceneUI/PostBattleLootScreen.uss

@@ -0,0 +1,213 @@
+/* Clean Post Battle Loot Screen Styles - Unity UI Toolkit Compatible */
+
+/* Main Overlay */
+.loot-overlay {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(0, 0, 0, 0.8);
+    justify-content: center;
+    align-items: center;
+}
+
+.loot-background {
+    background-color: rgba(20, 20, 30, 0.95);
+    border-width: 2px;
+    border-color: rgb(180, 140, 60);
+    border-radius: 15px;
+    padding: 30px;
+    width: 80%;
+    max-width: 800px;
+    max-height: 90%;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+/* Header Section */
+.header-section {
+    align-items: center;
+    margin-bottom: 20px;
+}
+
+.victory-title {
+    font-size: 32px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 5px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.victory-subtitle {
+    font-size: 18px;
+    color: rgb(200, 200, 200);
+    -unity-text-align: center;
+    -unity-font-style: italic;
+}
+
+/* Main Content */
+.main-content {
+    flex-grow: 1;
+    flex-direction: column;
+}
+
+.enemy-loot-section {
+    background-color: rgba(40, 40, 50, 0.7);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.total-rewards-section {
+    background-color: rgba(60, 40, 20, 0.7);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.section-title {
+    font-size: 20px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.enemy-loot-list {
+    max-height: 150px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    padding: 10px;
+}
+
+.enemy-loot-item {
+    margin-bottom: 10px;
+    padding: 8px;
+    background-color: rgba(255, 255, 255, 0.1);
+    border-radius: 5px;
+}
+
+.enemy-name {
+    font-size: 16px;
+    color: rgb(255, 100, 100);
+    margin-bottom: 5px;
+    -unity-font-style: bold;
+}
+
+.enemy-rewards {
+    flex-direction: row;
+    margin-bottom: 5px;
+}
+
+.enemy-items {
+    flex-direction: column;
+}
+
+/* Currency Display */
+.currency-display {
+    flex-direction: row;
+    justify-content: space-around;
+    align-items: center;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.currency-item {
+    align-items: center;
+    flex-direction: column;
+}
+
+.currency-icon {
+    font-size: 24px;
+    margin-bottom: 5px;
+}
+
+.currency-amount {
+    font-size: 20px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 3px;
+    -unity-font-style: bold;
+}
+
+.currency-label {
+    font-size: 12px;
+    color: rgb(200, 200, 200);
+}
+
+/* Items Display */
+.items-display {
+    margin-top: 10px;
+}
+
+.items-title {
+    font-size: 16px;
+    color: rgb(180, 180, 180);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+}
+
+.items-list {
+    max-height: 100px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    padding: 10px;
+}
+
+.item-entry {
+    color: rgb(150, 200, 150);
+    margin-bottom: 3px;
+}
+
+/* Footer Section */
+.footer-section {
+    align-items: center;
+    margin-top: 20px;
+}
+
+.continue-prompt {
+    font-size: 16px;
+    color: rgb(200, 200, 200);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+}
+
+.button-container {
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+}
+
+.action-button {
+    min-width: 120px;
+    height: 40px;
+    margin: 0 10px;
+    border-radius: 20px;
+    font-size: 16px;
+    -unity-font-style: bold;
+    cursor: pointer;
+}
+
+.primary-button {
+    background-color: rgb(100, 150, 100);
+    border-color: rgb(120, 180, 120);
+    color: rgb(255, 255, 255);
+}
+
+.primary-button:hover {
+    background-color: rgb(120, 180, 120);
+    border-color: rgb(140, 200, 140);
+}
+
+.secondary-button {
+    background-color: rgb(80, 80, 120);
+    border-color: rgb(100, 100, 140);
+    color: rgb(255, 255, 255);
+}
+
+.secondary-button:hover {
+    background-color: rgb(100, 100, 140);
+    border-color: rgb(120, 120, 160);
+}

+ 66 - 0
Assets/Resources/UI/BattleSceneUI/PostBattleLootScreen.uxml

@@ -0,0 +1,66 @@
+<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
+    
+    <!-- Full Screen Overlay -->
+    <ui:VisualElement name="LootScreenOverlay" class="loot-overlay">
+        <!-- Background Panel -->
+        <ui:VisualElement name="LootScreenBackground" class="loot-background">
+            
+            <!-- Header Section -->
+            <ui:VisualElement name="HeaderSection" class="header-section">
+                <ui:Label text="🏆 VICTORY! 🏆" display-tooltip-when-elided="true" name="VictoryTitle" class="victory-title" />
+                <ui:Label text="Collecting loot from defeated enemies..." display-tooltip-when-elided="true" name="VictorySubtitle" class="victory-subtitle" />
+            </ui:VisualElement>
+            
+            <!-- Main Content Section -->
+            <ui:VisualElement name="MainContent" class="main-content">
+                
+                <!-- Enemy Loot Section -->
+                <ui:VisualElement name="EnemyLootSection" class="enemy-loot-section">
+                    <ui:Label text="Defeated Enemies" display-tooltip-when-elided="true" name="EnemyLootTitle" class="section-title" />
+                    <ui:ScrollView name="EnemyLootContainer" class="enemy-loot-list" />
+                </ui:VisualElement>
+                
+                <!-- Total Rewards Section -->
+                <ui:VisualElement name="TotalRewardsSection" class="total-rewards-section">
+                    <ui:Label text="Total Rewards" display-tooltip-when-elided="true" name="TotalRewardsTitle" class="section-title" />
+                    
+                    <!-- Currency Display -->
+                    <ui:VisualElement name="CurrencyDisplay" class="currency-display">
+                        <ui:VisualElement name="GoldDisplay" class="currency-item">
+                            <ui:Label text="G" display-tooltip-when-elided="true" name="GoldIcon" class="currency-icon" />
+                            <ui:Label text="0" display-tooltip-when-elided="true" name="GoldAmount" class="currency-amount" />
+                            <ui:Label text="Gold" display-tooltip-when-elided="true" name="GoldLabel" class="currency-label" />
+                        </ui:VisualElement>
+                        
+                        <ui:VisualElement name="SilverDisplay" class="currency-item">
+                            <ui:Label text="S" display-tooltip-when-elided="true" name="SilverIcon" class="currency-icon" />
+                            <ui:Label text="0" display-tooltip-when-elided="true" name="SilverAmount" class="currency-amount" />
+                            <ui:Label text="Silver" display-tooltip-when-elided="true" name="SilverLabel" class="currency-label" />
+                        </ui:VisualElement>
+                        
+                        <ui:VisualElement name="CopperDisplay" class="currency-item">
+                            <ui:Label text="C" display-tooltip-when-elided="true" name="CopperIcon" class="currency-icon" />
+                            <ui:Label text="0" display-tooltip-when-elided="true" name="CopperAmount" class="currency-amount" />
+                            <ui:Label text="Copper" display-tooltip-when-elided="true" name="CopperLabel" class="currency-label" />
+                        </ui:VisualElement>
+                    </ui:VisualElement>
+                    
+                    <!-- Items Display -->
+                    <ui:VisualElement name="ItemsDisplay" class="items-display">
+                        <ui:Label text="Items Collected" display-tooltip-when-elided="true" name="ItemsTitle" class="items-title" />
+                        <ui:ScrollView name="ItemsList" class="items-list" />
+                    </ui:VisualElement>
+                </ui:VisualElement>
+            </ui:VisualElement>
+            
+            <!-- Footer Section -->
+            <ui:VisualElement name="FooterSection" class="footer-section">
+                <ui:Label text="Press SPACE to continue..." display-tooltip-when-elided="true" name="ContinuePrompt" class="continue-prompt" />
+                <ui:VisualElement name="ButtonContainer" class="button-container">
+                    <ui:Button text="Take All" display-tooltip-when-elided="true" name="TakeAllButton" class="action-button primary-button" />
+                    <ui:Button text="Continue" display-tooltip-when-elided="true" name="ContinueButton" class="action-button secondary-button" />
+                </ui:VisualElement>
+            </ui:VisualElement>
+        </ui:VisualElement>
+    </ui:VisualElement>
+</ui:UXML>

+ 213 - 0
Assets/Resources/UI/BattleSceneUI/PostBattleLootScreen_Clean.uss

@@ -0,0 +1,213 @@
+/* Clean Post Battle Loot Screen Styles - Unity UI Toolkit Compatible */
+
+/* Main Overlay */
+.loot-overlay {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(0, 0, 0, 0.8);
+    justify-content: center;
+    align-items: center;
+}
+
+.loot-background {
+    background-color: rgba(20, 20, 30, 0.95);
+    border-width: 2px;
+    border-color: rgb(180, 140, 60);
+    border-radius: 15px;
+    padding: 30px;
+    width: 80%;
+    max-width: 800px;
+    max-height: 90%;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+/* Header Section */
+.header-section {
+    align-items: center;
+    margin-bottom: 20px;
+}
+
+.victory-title {
+    font-size: 32px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 5px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.victory-subtitle {
+    font-size: 18px;
+    color: rgb(200, 200, 200);
+    -unity-text-align: center;
+    -unity-font-style: italic;
+}
+
+/* Main Content */
+.main-content {
+    flex-grow: 1;
+    flex-direction: column;
+}
+
+.enemy-loot-section {
+    background-color: rgba(40, 40, 50, 0.7);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.total-rewards-section {
+    background-color: rgba(60, 40, 20, 0.7);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.section-title {
+    font-size: 20px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.enemy-loot-list {
+    max-height: 150px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    padding: 10px;
+}
+
+.enemy-loot-item {
+    margin-bottom: 10px;
+    padding: 8px;
+    background-color: rgba(255, 255, 255, 0.1);
+    border-radius: 5px;
+}
+
+.enemy-name {
+    font-size: 16px;
+    color: rgb(255, 100, 100);
+    margin-bottom: 5px;
+    -unity-font-style: bold;
+}
+
+.enemy-rewards {
+    flex-direction: row;
+    margin-bottom: 5px;
+}
+
+.enemy-items {
+    flex-direction: column;
+}
+
+/* Currency Display */
+.currency-display {
+    flex-direction: row;
+    justify-content: space-around;
+    align-items: center;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.currency-item {
+    align-items: center;
+    flex-direction: column;
+}
+
+.currency-icon {
+    font-size: 24px;
+    margin-bottom: 5px;
+}
+
+.currency-amount {
+    font-size: 20px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 3px;
+    -unity-font-style: bold;
+}
+
+.currency-label {
+    font-size: 12px;
+    color: rgb(200, 200, 200);
+}
+
+/* Items Display */
+.items-display {
+    margin-top: 10px;
+}
+
+.items-title {
+    font-size: 16px;
+    color: rgb(180, 180, 180);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+}
+
+.items-list {
+    max-height: 100px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    padding: 10px;
+}
+
+.item-entry {
+    color: rgb(150, 200, 150);
+    margin-bottom: 3px;
+}
+
+/* Footer Section */
+.footer-section {
+    align-items: center;
+    margin-top: 20px;
+}
+
+.continue-prompt {
+    font-size: 16px;
+    color: rgb(200, 200, 200);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+}
+
+.button-container {
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+}
+
+.action-button {
+    min-width: 120px;
+    height: 40px;
+    margin: 0 10px;
+    border-radius: 20px;
+    font-size: 16px;
+    -unity-font-style: bold;
+    cursor: pointer;
+}
+
+.primary-button {
+    background-color: rgb(100, 150, 100);
+    border-color: rgb(120, 180, 120);
+    color: rgb(255, 255, 255);
+}
+
+.primary-button:hover {
+    background-color: rgb(120, 180, 120);
+    border-color: rgb(140, 200, 140);
+}
+
+.secondary-button {
+    background-color: rgb(80, 80, 120);
+    border-color: rgb(100, 100, 140);
+    color: rgb(255, 255, 255);
+}
+
+.secondary-button:hover {
+    background-color: rgb(100, 100, 140);
+    border-color: rgb(120, 120, 160);
+}

+ 136 - 38
Assets/Scenes/BattleScene.unity

@@ -129,8 +129,6 @@ GameObject:
   m_Component:
   - component: {fileID: 291472280}
   - component: {fileID: 291472279}
-  - component: {fileID: 291472281}
-  - component: {fileID: 291472282}
   m_Layer: 0
   m_Name: BattleIntegrationSetup
   m_TagString: Untagged
@@ -171,39 +169,6 @@ Transform:
   m_Children: []
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!114 &291472281
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 291472278}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: e4b3beaf54c40e040a42193e12fe18fa, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  uiDocument: {fileID: 291472282}
-  maxItemsToShow: 10
---- !u!114 &291472282
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 291472278}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  m_PanelSettings: {fileID: 11400000, guid: 0d7125098b341c74d868b72a1bacddf4, type: 2}
-  m_ParentUI: {fileID: 0}
-  sourceAsset: {fileID: 9197481963319205126, guid: f2b5bbcffdc7d9e44a089bd0887d3def, type: 3}
-  m_SortingOrder: 0
-  m_WorldSpaceSizeMode: 1
-  m_WorldSpaceWidth: 1920
-  m_WorldSpaceHeight: 1080
 --- !u!1 &330585543
 GameObject:
   m_ObjectHideFlags: 0
@@ -723,6 +688,70 @@ Transform:
   m_Children: []
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &715722813
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 715722815}
+  - component: {fileID: 715722814}
+  m_Layer: 0
+  m_Name: BattleTestMode
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!114 &715722814
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 715722813}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: c03902c67a546064ca026a5cf262db74, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  enableTestMode: 1
+  testPlayerCount: 2
+  testEnemyCount: 2
+  availableWeapons:
+  - Sword
+  - Bow
+  - Fists
+  playerNames:
+  - TestWarrior
+  - TestRanger
+  - TestMage
+  - TestRogue
+  enemyNames:
+  - TestSkeleton
+  - TestBandit
+  - TestOrc
+  - TestGoblin
+  - TestTroll
+  - TestSpider
+  showDebugLogs: 1
+--- !u!4 &715722815
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 715722813}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 12.970818, y: 433.2704, z: 802.6817}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &754193781
 GameObject:
   m_ObjectHideFlags: 0
@@ -1469,10 +1498,11 @@ MonoBehaviour:
   playerDecisionController: {fileID: 0}
   battleActionSystem: {fileID: 0}
   actionWheel: {fileID: 0}
-  enemySelectionUI: {fileID: 0}
-  itemSelectionUI: {fileID: 0}
+  enemySelectionUI: {fileID: 1566626104}
+  itemSelectionUI: {fileID: 1828288688}
   useNewActionSystem: 1
   actionWheelKey: 32
+  toggleSystemKey: 116
 --- !u!4 &1566626103
 Transform:
   m_ObjectHideFlags: 0
@@ -1505,6 +1535,72 @@ MonoBehaviour:
   windowWidth: 300
   windowHeight: 400
   buttonHeight: 40
+--- !u!1 &1828288687
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1828288690}
+  - component: {fileID: 1828288689}
+  - component: {fileID: 1828288688}
+  m_Layer: 0
+  m_Name: ItemSelectionUI
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!114 &1828288688
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1828288687}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: e4b3beaf54c40e040a42193e12fe18fa, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  uiDocument: {fileID: 1828288689}
+  maxItemsToShow: 10
+--- !u!114 &1828288689
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1828288687}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_PanelSettings: {fileID: 11400000, guid: 0d7125098b341c74d868b72a1bacddf4, type: 2}
+  m_ParentUI: {fileID: 0}
+  sourceAsset: {fileID: 9197481963319205126, guid: f2b5bbcffdc7d9e44a089bd0887d3def, type: 3}
+  m_SortingOrder: 0
+  m_WorldSpaceSizeMode: 1
+  m_WorldSpaceWidth: 1920
+  m_WorldSpaceHeight: 1080
+--- !u!4 &1828288690
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1828288687}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 12.970818, y: 433.2704, z: 802.6817}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &1940765008
 GameObject:
   m_ObjectHideFlags: 0
@@ -1788,5 +1884,7 @@ SceneRoots:
   - {fileID: 1429499005}
   - {fileID: 864824021}
   - {fileID: 865903348}
-  - {fileID: 291472280}
   - {fileID: 1566626103}
+  - {fileID: 291472280}
+  - {fileID: 1828288690}
+  - {fileID: 715722815}

+ 24 - 2
Assets/Scripts/BattleScene/BattleActionIntegration.cs

@@ -15,8 +15,12 @@ public class BattleActionIntegration : MonoBehaviour
     public BattleItemSelector itemSelectionUI;
 
     [Header("Settings")]
-    public bool useNewActionSystem = true;
+    [Tooltip("Enable new action wheel system (false = use old click-drag system)")]
+    public bool useNewActionSystem = false; // Changed to false by default for simpler testing
     public KeyCode actionWheelKey = KeyCode.Q; // Use Q consistently
+    [Space]
+    [Tooltip("Press this key to toggle between action systems")]
+    public KeyCode toggleSystemKey = KeyCode.T;
 
     private Character lastSelectedCharacter;
     private MonoBehaviour simpleWheelComponent;
@@ -97,10 +101,18 @@ public class BattleActionIntegration : MonoBehaviour
 
     void Update()
     {
+        // Allow toggling between systems
+        if (Input.GetKeyDown(toggleSystemKey))
+        {
+            ToggleActionSystem();
+        }
+
         if (useNewActionSystem)
         {
             HandleNewActionSystemInput();
         }
+        // Note: When useNewActionSystem is false, the old PlayerDecisionController.Update() 
+        // will handle input automatically - no need to interfere
 
         // Update instruction timer
         if (instructionTimer > 0f)
@@ -536,9 +548,19 @@ public class BattleActionIntegration : MonoBehaviour
         if (playerDecisionController != null)
         {
             playerDecisionController.enabled = !useNewActionSystem;
+
+            // If switching to old system, make sure it's properly enabled
+            if (!useNewActionSystem)
+            {
+                playerDecisionController.SetEnabled(true);
+            }
         }
 
-        Debug.Log($"🎯 Action system switched to: {(useNewActionSystem ? "New Action Wheel" : "Old Click-Drag")}");
+        // Clear any instruction messages when switching
+        currentInstruction = "";
+        instructionTimer = 0f;
+
+        Debug.Log($"🎯 Action system switched to: {(useNewActionSystem ? "New Action Wheel (Q to open wheel)" : "Old Click-Drag (direct drag to move/attack)")}");
     }
 
     /// <summary>

+ 143 - 15
Assets/Scripts/BattleScene/BattleItemSelector.cs

@@ -301,8 +301,9 @@ public class BattleItemSelector : MonoBehaviour
         var button = new Button();
         button.AddToClassList("item-button");
 
-        // Item name
-        var nameLabel = new Label(item.name);
+        // Item name with quantity
+        string itemText = item.quantity > 1 ? $"{item.name} x{item.quantity}" : item.name;
+        var nameLabel = new Label(itemText);
         nameLabel.AddToClassList("item-name");
 
         // Item description
@@ -312,11 +313,21 @@ public class BattleItemSelector : MonoBehaviour
         button.Add(nameLabel);
         button.Add(descLabel);
 
-        button.clicked += () =>
+        // Only allow selection if item is usable and quantity > 0
+        if (item.isUsable && item.quantity > 0)
         {
-            OnItemSelected?.Invoke(item.name, index);
-            HideSelection();
-        };
+            button.clicked += () =>
+            {
+                OnItemSelected?.Invoke(item.name, index);
+                HideSelection();
+            };
+        }
+        else
+        {
+            button.SetEnabled(false);
+            nameLabel.style.color = Color.gray;
+            descLabel.style.color = Color.gray;
+        }
 
         itemList.Add(button);
     }
@@ -331,17 +342,134 @@ public class BattleItemSelector : MonoBehaviour
 
     private List<ItemData> GetCharacterItems()
     {
-        // Placeholder implementation - return sample items
-        // TODO: Get actual items from character's inventory
+        if (currentCharacter == null)
+        {
+            Debug.LogWarning("📦 GetCharacterItems: currentCharacter is null");
+            return new List<ItemData>();
+        }
 
-        return new List<ItemData>
+        var items = new List<ItemData>();
+
+        // Method 1: Try to get items from Inventory component (ScriptableObject-based system)
+        var inventory = currentCharacter.GetComponent<Inventory>();
+        if (inventory != null)
         {
-            new ItemData { name = "Health Potion", description = "Restores 50 HP" },
-            new ItemData { name = "Mana Potion", description = "Restores 30 MP" },
-            new ItemData { name = "Antidote", description = "Cures poison" },
-            new ItemData { name = "Strength Elixir", description = "+3 Str for 5 rounds" },
-            new ItemData { name = "Magic Scroll", description = "Casts Magic Missile" }
-        };
+            Debug.Log($"📦 Found Inventory component on {currentCharacter.CharacterName}");
+
+            // Get misc/consumable items from inventory
+            foreach (var slot in inventory.Miscellaneous)
+            {
+                if (slot.item is MiscellaneousItem miscItem && miscItem.isConsumable)
+                {
+                    items.Add(new ItemData
+                    {
+                        name = miscItem.itemName,
+                        description = miscItem.GetEffectDescription(),
+                        quantity = slot.quantity,
+                        isUsable = true
+                    });
+                }
+            }
+
+            Debug.Log($"📦 Found {items.Count} consumable items in Inventory component");
+            return items;
+        }
+
+        // Method 2: Try to get items from CombatDataTransfer session data
+        if (CombatDataTransfer.HasValidSession())
+        {
+            var session = CombatDataTransfer.GetCurrentSession();
+            var characterData = session.playerTeam.Find(p => p.characterName == currentCharacter.CharacterName ||
+                                                             currentCharacter.CharacterName.StartsWith(p.characterName));
+
+            if (characterData != null && characterData.miscItems != null)
+            {
+                Debug.Log($"📦 Found {characterData.miscItems.Count} misc items in CombatDataTransfer for {currentCharacter.CharacterName}");
+
+                foreach (var itemName in characterData.miscItems)
+                {
+                    // Try to find the actual Item asset to get proper description
+                    var itemAsset = FindItemAsset(itemName);
+                    if (itemAsset is MiscellaneousItem miscItem && miscItem.isConsumable)
+                    {
+                        items.Add(new ItemData
+                        {
+                            name = miscItem.itemName,
+                            description = miscItem.GetEffectDescription(),
+                            quantity = 1, // Default quantity for string-based inventory
+                            isUsable = true
+                        });
+                    }
+                    else
+                    {
+                        // Fallback for items without ScriptableObject assets
+                        string description = GetFallbackItemDescription(itemName);
+                        items.Add(new ItemData
+                        {
+                            name = itemName,
+                            description = description,
+                            quantity = 1,
+                            isUsable = true
+                        });
+                    }
+                }
+
+                return items;
+            }
+        }
+
+        // Method 3: Fallback - try to access string-based inventory directly (if exposed)
+        Debug.LogWarning($"📦 No inventory data found for {currentCharacter.CharacterName}. Using empty inventory.");
+
+        return items; // Return empty list
+    }
+
+    /// <summary>
+    /// Try to find an Item ScriptableObject asset by name
+    /// </summary>
+    private Item FindItemAsset(string itemName)
+    {
+        // Try to find in Resources folder first
+        var item = Resources.Load<Item>($"Items/{itemName}");
+        if (item != null) return item;
+
+        // Try to find using Resources.LoadAll as fallback
+        var allItems = Resources.LoadAll<Item>("Items");
+        foreach (var itemAsset in allItems)
+        {
+            if (itemAsset.itemName == itemName)
+                return itemAsset;
+        }
+
+        return null;
+    }
+
+    /// <summary>
+    /// Get a fallback description for items that don't have ScriptableObject assets
+    /// </summary>
+    private string GetFallbackItemDescription(string itemName)
+    {
+        // Basic descriptions for common item names
+        switch (itemName.ToLower())
+        {
+            case "health potion":
+            case "healing potion":
+                return "Restores health";
+            case "mana potion":
+            case "magic potion":
+                return "Restores mana";
+            case "antidote":
+                return "Cures poison";
+            case "strength elixir":
+                return "Temporarily increases strength";
+            case "rope":
+            case "hemp rope":
+                return "Useful utility item";
+            case "torch":
+                return "Provides light";
+            default:
+                return "A useful item";
+        }
     }
 
     [System.Serializable]

+ 142 - 0
Assets/Scripts/BattleScene/BattleSetup.cs

@@ -144,6 +144,68 @@ public class BattleSetup : MonoBehaviour
         return null;
     }
 
+    /// <summary>
+    /// Apply team character stats from combat data to a Character instance
+    /// </summary>
+    private void ApplyTeamDataToCharacter(Character character, string characterName)
+    {
+        var sessionData = CombatDataTransfer.GetCurrentSession();
+        if (sessionData == null)
+        {
+            Debug.LogWarning($"No combat session data found for character: {characterName}");
+            return;
+        }
+
+        // Find the team character data (match by exact name or base name)
+        var teamData = sessionData.playerTeam?.Find(p => p.characterName == characterName);
+        if (teamData == null)
+        {
+            // Try to match base name without suffix
+            teamData = sessionData.playerTeam?.Find(p => characterName.StartsWith(p.characterName));
+        }
+
+        if (teamData != null)
+        {
+            character.ApplyStatsFromCombatData(teamData);
+            Debug.Log($"📊 Applied team stats to {characterName}: STR:{teamData.strength} DEX:{teamData.dexterity} CON:{teamData.constitution} WIS:{teamData.wisdom} PER:{teamData.perception}");
+        }
+        else
+        {
+            Debug.LogWarning($"No team data found for character: {characterName}");
+        }
+    }
+
+    /// <summary>
+    /// Apply enemy character stats from combat data to a Character instance
+    /// </summary>
+    private void ApplyEnemyDataToCharacter(Character character, string characterName)
+    {
+        var sessionData = CombatDataTransfer.GetCurrentSession();
+        if (sessionData == null)
+        {
+            Debug.LogWarning($"No combat session data found for enemy: {characterName}");
+            return;
+        }
+
+        // Find the enemy character data (match by exact name or base type)
+        var enemyData = sessionData.enemies?.Find(e => e.enemyName == characterName);
+        if (enemyData == null)
+        {
+            // Try to match base type without suffix
+            enemyData = sessionData.enemies?.Find(e => characterName.StartsWith(e.enemyType));
+        }
+
+        if (enemyData != null)
+        {
+            character.ApplyStatsFromCombatData(enemyData);
+            Debug.Log($"📊 Applied enemy stats to {characterName}");
+        }
+        else
+        {
+            Debug.LogWarning($"No enemy data found for character: {characterName}");
+        }
+    }
+
     // Enhanced weapon equipping with WeaponItem support
     void EquipWeapon(Character character, WeaponItem weaponItem)
     {
@@ -328,6 +390,9 @@ public class BattleSetup : MonoBehaviour
             {
                 Debug.Log($"🔍 SpawnNextPlayerCharacterForPlacement: Character '{selection.characterName}' with weapon '{selection.weaponType}'");
 
+                // Apply team data stats to the character
+                ApplyTeamDataToCharacter(character, selection.characterName);
+
                 // Try to get enhanced weapon data first
                 WeaponItem enhancedWeapon = GetEnhancedWeaponItem(selection.characterName, true);
                 Debug.Log($"🔍 Enhanced weapon lookup for '{selection.characterName}': {(enhancedWeapon != null ? enhancedWeapon.name : "NULL")}");
@@ -523,6 +588,10 @@ public class BattleSetup : MonoBehaviour
             {
                 agent.enabled = true; // Re-enable NavMeshAgent
             }
+
+            // Add carry capacity system to player characters
+            AddCarryCapacityComponent(character);
+
             // Enable AI or other components as needed
             // e.g., character.GetComponent<AIController>()?.enabled = true;
         }
@@ -534,12 +603,82 @@ public class BattleSetup : MonoBehaviour
             {
                 agent.enabled = true; // Re-enable NavMeshAgent
             }
+
+            // Add carry capacity system to enemy characters too (for consistency)
+            AddCarryCapacityComponent(character);
+
             // Enable AI or other components as needed
             // e.g., character.GetComponent<AIController>()?.enabled = true;
         }
 
     }
 
+    /// <summary>
+    /// Add CharacterCarryCapacity component to a character GameObject
+    /// </summary>
+    private void AddCarryCapacityComponent(GameObject characterObj)
+    {
+        if (characterObj == null) return;
+
+        // Only add if it doesn't already exist
+        var existingCapacity = characterObj.GetComponent<CharacterCarryCapacity>();
+        if (existingCapacity != null) return;
+
+        var character = characterObj.GetComponent<Character>();
+        if (character == null) return;
+
+        // Add the carry capacity component
+        var carryCapacity = characterObj.AddComponent<CharacterCarryCapacity>();
+
+        // Configure based on character type/name
+        ConfigureCarryCapacity(carryCapacity, character);
+
+        Debug.Log($"📦 Added carry capacity system to {character.CharacterName}");
+    }
+
+    /// <summary>
+    /// Configure carry capacity settings based on character
+    /// </summary>
+    private void ConfigureCarryCapacity(CharacterCarryCapacity carryCapacity, Character character)
+    {
+        if (carryCapacity == null || character == null) return;
+
+        // Adjust settings based on character type or name
+        string characterName = character.CharacterName.ToLower();
+
+        if (characterName.Contains("warrior") || characterName.Contains("fighter"))
+        {
+            // Warriors can carry more
+            carryCapacity.carrySystem.baseCarryCapacity = 60;
+            carryCapacity.carrySystem.strengthMultiplier = 6f;
+        }
+        else if (characterName.Contains("rogue") || characterName.Contains("thief"))
+        {
+            // Rogues are more agile but carry less
+            carryCapacity.carrySystem.baseCarryCapacity = 40;
+            carryCapacity.carrySystem.strengthMultiplier = 4f;
+            carryCapacity.carrySystem.lightLoadThreshold = 0.4f; // Stay light more often
+        }
+        else if (characterName.Contains("mage") || characterName.Contains("wizard"))
+        {
+            // Mages have lower physical capacity
+            carryCapacity.carrySystem.baseCarryCapacity = 35;
+            carryCapacity.carrySystem.strengthMultiplier = 3f;
+        }
+        else
+        {
+            // Default settings are already good for most characters
+            carryCapacity.carrySystem.baseCarryCapacity = 50;
+            carryCapacity.carrySystem.strengthMultiplier = 5f;
+        }
+
+        // Enable debug info for player characters
+        if (character.CompareTag("Player"))
+        {
+            carryCapacity.showDebugInfo = true;
+        }
+    }
+
     private void PlaceEnemyCharacters()
     {
         Collider spawnAreaCollider = enemySpawnArea.GetComponent<Collider>();
@@ -574,6 +713,9 @@ public class BattleSetup : MonoBehaviour
             Character character = placedEnemy.GetComponent<Character>();
             if (character != null)
             {
+                // Apply enemy data stats to the character
+                ApplyEnemyDataToCharacter(character, selection.characterName);
+
                 // Try to get enhanced weapon data first
                 WeaponItem enhancedWeapon = GetEnhancedWeaponItem(selection.characterName, false);
                 if (enhancedWeapon != null)

+ 523 - 0
Assets/Scripts/BattleScene/BattleTestMode.cs

@@ -0,0 +1,523 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+/// <summary>
+/// Test mode for battle scene that creates test characters and enemies automatically
+/// Attach this to a GameObject in the battle scene to enable test mode
+/// Enhanced with post-battle looting and defeat testing capabilities
+/// </summary>
+public class BattleTestMode : MonoBehaviour
+{
+    [Header("Test Mode Settings")]
+    [Tooltip("Enable test mode to automatically create test characters")]
+    public bool enableTestMode = true;
+
+    [Tooltip("Number of player characters to create")]
+    [Range(1, 4)]
+    public int testPlayerCount = 2;
+
+    [Tooltip("Number of enemy characters to create")]
+    [Range(1, 6)]
+    public int testEnemyCount = 2;
+
+    [Header("Test Character Configuration")]
+    [Tooltip("Available weapon types for testing")]
+    public string[] availableWeapons = { "Sword", "Bow", "Fists" };
+
+    [Tooltip("Player character names")]
+    public string[] playerNames = { "TestWarrior", "TestRanger", "TestMage", "TestRogue" };
+
+    [Tooltip("Enemy character names")]
+    public string[] enemyNames = { "TestSkeleton", "TestBandit", "TestOrc", "TestGoblin", "TestTroll", "TestSpider" };
+
+    [Header("Debug Settings")]
+    public bool showDebugLogs = true;
+
+    void Awake()
+    {
+        if (!enableTestMode)
+        {
+            if (showDebugLogs)
+                Debug.Log("🧪 BattleTestMode: Test mode is disabled");
+            return;
+        }
+
+        // Only activate test mode if there are no existing selections
+        if (BattleSetupData.playerSelections.Count == 0 && BattleSetupData.enemySelections.Count == 0)
+        {
+            CreateTestBattleData();
+        }
+        else
+        {
+            if (showDebugLogs)
+                Debug.Log("🧪 BattleTestMode: Battle data already exists, skipping test mode");
+        }
+    }
+
+    /// <summary>
+    /// Create test battle data with predefined characters and enemies
+    /// </summary>
+    void CreateTestBattleData()
+    {
+        if (showDebugLogs)
+            Debug.Log("🧪 BattleTestMode: Creating test battle data...");
+
+        // Clear any existing data
+        BattleSetupData.playerSelections.Clear();
+        BattleSetupData.enemySelections.Clear();
+
+        // Create test player characters
+        CreateTestPlayers();
+
+        // Create test enemy characters
+        CreateTestEnemies();
+
+        // Create basic inventory data for the test characters
+        CreateBasicInventoryData();
+
+        // Add carry capacity components to test characters
+        AddCarryCapacityToTestCharacters();
+
+        if (showDebugLogs)
+        {
+            Debug.Log($"🧪 BattleTestMode: Created {BattleSetupData.playerSelections.Count} test players and {BattleSetupData.enemySelections.Count} test enemies");
+            LogTestData();
+        }
+    }
+
+    /// <summary>
+    /// Create test player characters with varied weapons
+    /// </summary>
+    void CreateTestPlayers()
+    {
+        for (int i = 0; i < testPlayerCount; i++)
+        {
+            string playerName = i < playerNames.Length ? playerNames[i] : $"TestPlayer{i + 1}";
+            string weaponType = availableWeapons[i % availableWeapons.Length];
+
+            var playerSelection = new CharacterSelection
+            {
+                characterName = playerName,
+                weaponType = weaponType
+            };
+
+            BattleSetupData.playerSelections.Add(playerSelection);
+
+            if (showDebugLogs)
+                Debug.Log($"🧪 Created test player: {playerName} with {weaponType}");
+        }
+    }
+
+    /// <summary>
+    /// Create test enemy characters with varied weapons
+    /// </summary>
+    void CreateTestEnemies()
+    {
+        for (int i = 0; i < testEnemyCount; i++)
+        {
+            string enemyName = i < enemyNames.Length ? enemyNames[i] : $"TestEnemy{i + 1}";
+            string weaponType = availableWeapons[Random.Range(0, availableWeapons.Length)];
+
+            var enemySelection = new CharacterSelection
+            {
+                characterName = enemyName,
+                weaponType = weaponType
+            };
+
+            BattleSetupData.enemySelections.Add(enemySelection);
+
+            if (showDebugLogs)
+                Debug.Log($"🧪 Created test enemy: {enemyName} with {weaponType}");
+        }
+    }
+
+    /// <summary>
+    /// Log all test data for debugging
+    /// </summary>
+    void LogTestData()
+    {
+        Debug.Log("🧪 === Test Battle Data ===");
+        Debug.Log($"🧪 Players ({BattleSetupData.playerSelections.Count}):");
+        foreach (var player in BattleSetupData.playerSelections)
+        {
+            Debug.Log($"🧪   - {player.characterName} ({player.weaponType})");
+        }
+
+        Debug.Log($"🧪 Enemies ({BattleSetupData.enemySelections.Count}):");
+        foreach (var enemy in BattleSetupData.enemySelections)
+        {
+            Debug.Log($"🧪   - {enemy.characterName} ({enemy.weaponType})");
+        }
+        Debug.Log("🧪 ========================");
+    }
+
+    /// <summary>
+    /// Create basic inventory data for test characters using CombatDataTransfer
+    /// </summary>
+    void CreateBasicInventoryData()
+    {
+        // Create minimal combat session data to provide inventory
+        var sessionData = new CombatDataTransfer.CombatSessionData
+        {
+            battleTerrain = TerrainType.Plains,
+            battleFeature = FeatureType.None,
+            weather = Weather.Clear,
+            timeOfDay = 12f,
+            playerTeam = new List<CombatDataTransfer.TeamCharacterCombatData>(),
+            enemies = new List<CombatDataTransfer.EnemyCombatData>()
+        };
+
+        // Create inventory data for each player
+        for (int i = 0; i < BattleSetupData.playerSelections.Count; i++)
+        {
+            var player = BattleSetupData.playerSelections[i];
+            var playerData = new CombatDataTransfer.TeamCharacterCombatData
+            {
+                characterName = player.characterName,
+                maxHealth = 20 + Random.Range(-5, 10),
+                currentHealth = 20 + Random.Range(-5, 10),
+                armorClass = 12,
+                equippedWeapon = player.weaponType,
+                strength = Random.Range(8, 16),
+                dexterity = Random.Range(8, 16),
+                constitution = Random.Range(8, 16),
+                wisdom = Random.Range(8, 16),
+                perception = Random.Range(8, 16),
+                miscItems = CreateBasicTestInventory(i)
+            };
+            sessionData.playerTeam.Add(playerData);
+        }
+
+        // Create basic enemy data (no inventory needed for enemies)
+        for (int i = 0; i < BattleSetupData.enemySelections.Count; i++)
+        {
+            var enemy = BattleSetupData.enemySelections[i];
+            var enemyData = new CombatDataTransfer.EnemyCombatData
+            {
+                enemyName = enemy.characterName,
+                maxHealth = 15 + Random.Range(-3, 8),
+                currentHealth = 15 + Random.Range(-3, 8),
+                armorClass = 11,
+                preferredWeapon = enemy.weaponType,
+                threatLevel = Random.Range(1, 4)
+            };
+            sessionData.enemies.Add(enemyData);
+        }
+
+        // Set the combat session
+        CombatDataTransfer.SetCombatSession(sessionData);
+
+        if (showDebugLogs)
+            Debug.Log($"🧪 Created basic inventory data for {sessionData.playerTeam.Count} players");
+    }
+
+    /// <summary>
+    /// Create a basic test inventory with health potions and other items
+    /// </summary>
+    List<string> CreateBasicTestInventory(int characterIndex)
+    {
+        var inventory = new List<string>();
+
+        // Everyone gets health potions
+        inventory.Add("Health Potion");
+        inventory.Add("Health Potion"); // Give 2 health potions
+
+        // Basic survival items
+        inventory.Add("Bread");
+        inventory.Add("Bandage");
+
+        // Add some variety based on character index
+        switch (characterIndex % 3)
+        {
+            case 0:
+                inventory.Add("Health Potion"); // Extra healing for first character
+                inventory.Add("Iron Ration");
+                break;
+            case 1:
+                inventory.Add("Antidote");
+                inventory.Add("Rope");
+                break;
+            case 2:
+                inventory.Add("Torch");
+                inventory.Add("Waterskin");
+                break;
+        }
+
+        return inventory;
+    }
+
+    /// <summary>
+    /// Add carry capacity components to test characters for weight management
+    /// </summary>
+    void AddCarryCapacityToTestCharacters()
+    {
+        // This will add carry capacity to actual character GameObjects when they're spawned
+        // For now, just log that this system is available
+        if (showDebugLogs)
+            Debug.Log("🧪 Carry capacity system ready for test characters");
+
+        // TODO: This method will be called after character spawning when the actual GameObjects exist
+        // It would add CharacterCarryCapacity components to each spawned character
+    }
+
+    /// <summary>
+    /// Context menu method to manually create test data
+    /// </summary>
+    [ContextMenu("Create Test Battle Data")]
+    public void ManualCreateTestData()
+    {
+        CreateTestBattleData();
+    }
+
+    /// <summary>
+    /// Context menu method to clear test data
+    /// </summary>
+    [ContextMenu("Clear Test Data")]
+    public void ClearTestData()
+    {
+        BattleSetupData.playerSelections.Clear();
+        BattleSetupData.enemySelections.Clear();
+        CombatDataTransfer.ClearSession();
+
+        if (showDebugLogs)
+            Debug.Log("🧪 BattleTestMode: Test data and inventory cleared");
+    }
+
+    /// <summary>
+    /// Context menu method to create random test data
+    /// </summary>
+    [ContextMenu("Create Random Test Data")]
+    public void CreateRandomTestData()
+    {
+        // Randomize counts
+        testPlayerCount = Random.Range(1, 5);
+        testEnemyCount = Random.Range(1, 7);
+
+        CreateTestBattleData();
+    }
+
+    /// <summary>
+    /// Create a quick 1v1 battle for testing specific mechanics
+    /// </summary>
+    [ContextMenu("Create 1v1 Test Battle")]
+    public void Create1v1TestBattle()
+    {
+        BattleSetupData.playerSelections.Clear();
+        BattleSetupData.enemySelections.Clear();
+
+        // Single player with sword
+        BattleSetupData.playerSelections.Add(new CharacterSelection
+        {
+            characterName = "TestHero",
+            weaponType = "Sword"
+        });
+
+        // Single enemy with bow
+        BattleSetupData.enemySelections.Add(new CharacterSelection
+        {
+            characterName = "TestSkeleton",
+            weaponType = "Bow"
+        });
+
+        // Create inventory data for the 1v1 battle
+        CreateBasicInventoryData();
+
+        if (showDebugLogs)
+            Debug.Log("🧪 Created 1v1 test battle: TestHero (Sword) vs TestSkeleton (Bow)");
+    }
+
+    /// <summary>
+    /// Create a larger battle for stress testing
+    /// </summary>
+    [ContextMenu("Create Large Test Battle")]
+    public void CreateLargeTestBattle()
+    {
+        BattleSetupData.playerSelections.Clear();
+        BattleSetupData.enemySelections.Clear();
+
+        // Create 4 players with different weapons
+        for (int i = 0; i < 4; i++)
+        {
+            BattleSetupData.playerSelections.Add(new CharacterSelection
+            {
+                characterName = playerNames[i],
+                weaponType = availableWeapons[i % availableWeapons.Length]
+            });
+        }
+
+        // Create 6 enemies with random weapons
+        for (int i = 0; i < 6; i++)
+        {
+            BattleSetupData.enemySelections.Add(new CharacterSelection
+            {
+                characterName = enemyNames[i],
+                weaponType = availableWeapons[Random.Range(0, availableWeapons.Length)]
+            });
+        }
+
+        // Create inventory data for the large battle
+        CreateBasicInventoryData();
+
+        if (showDebugLogs)
+            Debug.Log("🧪 Created large test battle: 4 players vs 6 enemies");
+    }
+
+    /// <summary>
+    /// Create a test battle designed to test victory looting (weak enemies)
+    /// </summary>
+    [ContextMenu("Create Victory Test Battle")]
+    public void CreateVictoryTestBattle()
+    {
+        BattleSetupData.playerSelections.Clear();
+        BattleSetupData.enemySelections.Clear();
+
+        // Create 2 strong players
+        for (int i = 0; i < 2; i++)
+        {
+            BattleSetupData.playerSelections.Add(new CharacterSelection
+            {
+                characterName = playerNames[i],
+                weaponType = availableWeapons[i % availableWeapons.Length]
+            });
+        }
+
+        // Create 3 weak enemies
+        for (int i = 0; i < 3; i++)
+        {
+            BattleSetupData.enemySelections.Add(new CharacterSelection
+            {
+                characterName = enemyNames[i],
+                weaponType = "Fists" // Weak weapon
+            });
+        }
+
+        // Create enhanced session data with stronger players and weaker enemies
+        var sessionData = new CombatDataTransfer.CombatSessionData
+        {
+            battleTerrain = TerrainType.Plains,
+            battleFeature = FeatureType.None,
+            weather = Weather.Clear,
+            timeOfDay = 12f,
+            playerTeam = new List<CombatDataTransfer.TeamCharacterCombatData>(),
+            enemies = new List<CombatDataTransfer.EnemyCombatData>()
+        };
+
+        // Create strong player data
+        for (int i = 0; i < BattleSetupData.playerSelections.Count; i++)
+        {
+            var player = BattleSetupData.playerSelections[i];
+            var playerData = new CombatDataTransfer.TeamCharacterCombatData
+            {
+                characterName = player.characterName,
+                maxHealth = 35, // Higher health
+                currentHealth = 35,
+                armorClass = 15, // Better armor
+                equippedWeapon = player.weaponType,
+                strength = 16, // High strength for carry capacity
+                dexterity = 14,
+                constitution = 16,
+                wisdom = 12,
+                perception = 14,
+                miscItems = CreateBasicTestInventory(i)
+            };
+            sessionData.playerTeam.Add(playerData);
+        }
+
+        // Create weak enemy data
+        for (int i = 0; i < BattleSetupData.enemySelections.Count; i++)
+        {
+            var enemy = BattleSetupData.enemySelections[i];
+            var enemyData = new CombatDataTransfer.EnemyCombatData
+            {
+                enemyName = enemy.characterName,
+                maxHealth = 5, // Very low health
+                currentHealth = 5,
+                armorClass = 8, // Poor armor
+                preferredWeapon = enemy.weaponType,
+                threatLevel = 1 // Low threat
+            };
+            sessionData.enemies.Add(enemyData);
+        }
+
+        CombatDataTransfer.SetCombatSession(sessionData);
+
+        if (showDebugLogs)
+            Debug.Log("🧪 Created victory test battle: 2 strong players vs 3 weak enemies (for testing post-battle looting)");
+    }
+
+    /// <summary>
+    /// Create a test battle designed to test defeat (weak players)
+    /// </summary>
+    [ContextMenu("Create Defeat Test Battle")]
+    public void CreateDefeatTestBattle()
+    {
+        BattleSetupData.playerSelections.Clear();
+        BattleSetupData.enemySelections.Clear();
+
+        // Create 1 weak player
+        BattleSetupData.playerSelections.Add(new CharacterSelection
+        {
+            characterName = "WeakHero",
+            weaponType = "Fists"
+        });
+
+        // Create 2 strong enemies
+        for (int i = 0; i < 2; i++)
+        {
+            BattleSetupData.enemySelections.Add(new CharacterSelection
+            {
+                characterName = enemyNames[i],
+                weaponType = "Sword"
+            });
+        }
+
+        // Create session data with weak player and strong enemies
+        var sessionData = new CombatDataTransfer.CombatSessionData
+        {
+            battleTerrain = TerrainType.Forest,
+            battleFeature = FeatureType.None,
+            weather = Weather.Storm,
+            timeOfDay = 20f, // Night
+            playerTeam = new List<CombatDataTransfer.TeamCharacterCombatData>(),
+            enemies = new List<CombatDataTransfer.EnemyCombatData>()
+        };
+
+        // Create weak player data
+        var weakPlayer = new CombatDataTransfer.TeamCharacterCombatData
+        {
+            characterName = "WeakHero",
+            maxHealth = 8, // Very low health
+            currentHealth = 8,
+            armorClass = 10, // Poor armor
+            equippedWeapon = "Fists",
+            strength = 8,
+            dexterity = 8,
+            constitution = 8,
+            wisdom = 8,
+            perception = 8,
+            miscItems = new List<string> { "Health Potion" } // Minimal inventory
+        };
+        sessionData.playerTeam.Add(weakPlayer);
+
+        // Create strong enemy data
+        for (int i = 0; i < BattleSetupData.enemySelections.Count; i++)
+        {
+            var enemy = BattleSetupData.enemySelections[i];
+            var enemyData = new CombatDataTransfer.EnemyCombatData
+            {
+                enemyName = enemy.characterName,
+                maxHealth = 25, // High health
+                currentHealth = 25,
+                armorClass = 14, // Good armor
+                preferredWeapon = "Sword",
+                threatLevel = 5 // High threat
+            };
+            sessionData.enemies.Add(enemyData);
+        }
+
+        CombatDataTransfer.SetCombatSession(sessionData);
+
+        if (showDebugLogs)
+            Debug.Log("🧪 Created defeat test battle: 1 weak player vs 2 strong enemies (for testing game over screen)");
+    }
+}

+ 368 - 0
Assets/Scripts/BattleScene/EnhancedBattleTestMode.cs

@@ -0,0 +1,368 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+/// <summary>
+/// Enhanced test mode that creates both BattleSetupData and CombatDataTransfer test data
+/// This provides more realistic character stats, equipment, and battle context
+/// </summary>
+public class EnhancedBattleTestMode : MonoBehaviour
+{
+    [Header("Enhanced Test Mode Settings")]
+    [Tooltip("Enable enhanced test mode with full combat data")]
+    public bool enableEnhancedTestMode = true;
+
+    [Tooltip("Number of player characters to create")]
+    [Range(1, 4)]
+    public int testPlayerCount = 2;
+
+    [Tooltip("Number of enemy characters to create")]
+    [Range(1, 6)]
+    public int testEnemyCount = 2;
+
+    [Header("Battle Context Settings")]
+    [Tooltip("Test terrain type")]
+    public TerrainType testTerrain = TerrainType.Plains;
+
+    [Tooltip("Test weather")]
+    public Weather testWeather = Weather.Clear;
+
+    [Tooltip("Test time of day (0-24)")]
+    [Range(0f, 24f)]
+    public float testTimeOfDay = 12f;
+
+    [Header("Character Stats Settings")]
+    [Tooltip("Base health for test players")]
+    [Range(10, 100)]
+    public int basePlayerHealth = 25;
+
+    [Tooltip("Base health for test enemies")]
+    [Range(5, 50)]
+    public int baseEnemyHealth = 15;
+
+    [Tooltip("Base armor class for test characters")]
+    [Range(8, 18)]
+    public int baseArmorClass = 12;
+
+    [Header("Available Equipment")]
+    public WeaponItem[] testWeapons;
+
+    [Header("Debug Settings")]
+    public bool showDebugLogs = true;
+
+    // Test character names
+    private readonly string[] playerNames = { "TestHero", "TestRanger", "TestMage", "TestRogue" };
+    private readonly string[] enemyNames = { "TestSkeleton", "TestBandit", "TestOrc", "TestGoblin", "TestTroll", "TestSpider" };
+
+    void Awake()
+    {
+        if (!enableEnhancedTestMode)
+        {
+            if (showDebugLogs)
+                Debug.Log("🧪 EnhancedBattleTestMode: Enhanced test mode is disabled");
+            return;
+        }
+
+        // Only activate if no existing data
+        if (!CombatDataTransfer.HasValidSession() &&
+            BattleSetupData.playerSelections.Count == 0 &&
+            BattleSetupData.enemySelections.Count == 0)
+        {
+            CreateEnhancedTestData();
+        }
+        else
+        {
+            if (showDebugLogs)
+                Debug.Log("🧪 EnhancedBattleTestMode: Combat session or battle data already exists, skipping test mode");
+        }
+    }
+
+    /// <summary>
+    /// Create comprehensive test data including combat session and battle setup data
+    /// </summary>
+    void CreateEnhancedTestData()
+    {
+        if (showDebugLogs)
+            Debug.Log("🧪 EnhancedBattleTestMode: Creating enhanced test data...");
+
+        // Create test combat session
+        CreateTestCombatSession();
+
+        // Create legacy battle setup data for compatibility
+        CreateTestBattleSetupData();
+
+        if (showDebugLogs)
+        {
+            Debug.Log("🧪 EnhancedBattleTestMode: Enhanced test data created successfully");
+            LogEnhancedTestData();
+        }
+    }
+
+    /// <summary>
+    /// Create a test combat session with realistic character data
+    /// </summary>
+    void CreateTestCombatSession()
+    {
+        var sessionData = new CombatDataTransfer.CombatSessionData
+        {
+            battleTerrain = testTerrain,
+            battleFeature = FeatureType.None,
+            weather = testWeather,
+            timeOfDay = testTimeOfDay,
+            playerTeam = new List<CombatDataTransfer.TeamCharacterCombatData>(),
+            enemies = new List<CombatDataTransfer.EnemyCombatData>()
+        };
+
+        // Create test players
+        for (int i = 0; i < testPlayerCount; i++)
+        {
+            var playerData = CreateTestPlayerData(i);
+            sessionData.playerTeam.Add(playerData);
+        }
+
+        // Create test enemies
+        for (int i = 0; i < testEnemyCount; i++)
+        {
+            var enemyData = CreateTestEnemyData(i);
+            sessionData.enemies.Add(enemyData);
+        }
+
+        // Set the combat session
+        CombatDataTransfer.SetCombatSession(sessionData);
+
+        if (showDebugLogs)
+            Debug.Log($"🧪 Created combat session with {sessionData.playerTeam.Count} players and {sessionData.enemies.Count} enemies");
+    }
+
+    /// <summary>
+    /// Create test player character data
+    /// </summary>
+    CombatDataTransfer.TeamCharacterCombatData CreateTestPlayerData(int index)
+    {
+        string playerName = index < playerNames.Length ? playerNames[index] : $"TestPlayer{index + 1}";
+        WeaponItem weapon = GetRandomTestWeapon();
+
+        var playerData = new CombatDataTransfer.TeamCharacterCombatData
+        {
+            characterName = playerName,
+            maxHealth = basePlayerHealth + Random.Range(-5, 10),
+            armorClass = baseArmorClass + Random.Range(-1, 3),
+            equippedWeapon = weapon?.itemName ?? "Sword",
+            equippedWeaponItem = weapon,
+            // Add some variety to stats
+            strength = Random.Range(8, 16),
+            dexterity = Random.Range(8, 16),
+            constitution = Random.Range(8, 16),
+            wisdom = Random.Range(8, 16),
+            perception = Random.Range(8, 16),
+            // Add test inventory items
+            miscItems = CreateTestInventory(index)
+        };
+
+        // Set current health to max health
+        playerData.currentHealth = playerData.maxHealth;
+
+        if (showDebugLogs)
+            Debug.Log($"🧪 Created test player: {playerName} (HP: {playerData.maxHealth}, AC: {playerData.armorClass}, Weapon: {playerData.equippedWeapon})");
+
+        return playerData;
+    }
+
+    /// <summary>
+    /// Create test enemy character data
+    /// </summary>
+    CombatDataTransfer.EnemyCombatData CreateTestEnemyData(int index)
+    {
+        string enemyName = index < enemyNames.Length ? enemyNames[index] : $"TestEnemy{index + 1}";
+        WeaponItem weapon = GetRandomTestWeapon();
+
+        var enemyData = new CombatDataTransfer.EnemyCombatData
+        {
+            enemyName = enemyName,
+            maxHealth = baseEnemyHealth + Random.Range(-3, 8),
+            armorClass = baseArmorClass + Random.Range(-2, 2),
+            preferredWeapon = weapon?.itemName ?? "Fists",
+            preferredWeaponItem = weapon,
+            threatLevel = Random.Range(1, 6)
+        };
+
+        // Set current health to max health
+        enemyData.currentHealth = enemyData.maxHealth;
+
+        if (showDebugLogs)
+            Debug.Log($"🧪 Created test enemy: {enemyName} (HP: {enemyData.maxHealth}, AC: {enemyData.armorClass}, Weapon: {enemyData.preferredWeapon}, Threat: {enemyData.threatLevel})");
+
+        return enemyData;
+    }
+
+    /// <summary>
+    /// Create legacy battle setup data for backward compatibility
+    /// </summary>
+    void CreateTestBattleSetupData()
+    {
+        // Populate legacy data from the combat session
+        CombatDataTransfer.PopulateLegacyBattleSetupData();
+
+        if (showDebugLogs)
+            Debug.Log($"🧪 Populated legacy battle setup data: {BattleSetupData.playerSelections.Count} players, {BattleSetupData.enemySelections.Count} enemies");
+    }
+
+    /// <summary>
+    /// Get a random weapon from available test weapons
+    /// </summary>
+    WeaponItem GetRandomTestWeapon()
+    {
+        if (testWeapons == null || testWeapons.Length == 0)
+            return null;
+
+        return testWeapons[Random.Range(0, testWeapons.Length)];
+    }
+
+    /// <summary>
+    /// Create a test inventory with varied items for each character
+    /// </summary>
+    List<string> CreateTestInventory(int characterIndex)
+    {
+        var inventory = new List<string>();
+
+        // Base items all characters get
+        inventory.Add("Health Potion");
+        inventory.Add("Bread");
+
+        // Varied items based on character index
+        switch (characterIndex % 4)
+        {
+            case 0: // Fighter-type
+                inventory.Add("Health Potion"); // Extra healing
+                inventory.Add("Bandage");
+                inventory.Add("Iron Ration");
+                break;
+            case 1: // Rogue-type
+                inventory.Add("Thieves' Tools");
+                inventory.Add("Rope");
+                inventory.Add("Antidote");
+                break;
+            case 2: // Mage-type
+                inventory.Add("Spell Component");
+                inventory.Add("Scroll of Identify");
+                inventory.Add("Magic Ink");
+                break;
+            case 3: // Cleric-type
+                inventory.Add("Holy Water");
+                inventory.Add("Bandage");
+                inventory.Add("Blessed Bread");
+                break;
+        }
+
+        // Random bonus items
+        var bonusItems = new[] { "Torch", "Trail Rations", "Blanket", "Waterskin", "Flint and Steel" };
+        int bonusCount = Random.Range(1, 3);
+        for (int i = 0; i < bonusCount; i++)
+        {
+            string bonusItem = bonusItems[Random.Range(0, bonusItems.Length)];
+            if (!inventory.Contains(bonusItem))
+                inventory.Add(bonusItem);
+        }
+
+        return inventory;
+    }
+
+    /// <summary>
+    /// Log all enhanced test data for debugging
+    /// </summary>
+    void LogEnhancedTestData()
+    {
+        Debug.Log("🧪 === Enhanced Test Battle Data ===");
+
+        var session = CombatDataTransfer.GetCurrentSession();
+        if (session != null)
+        {
+            Debug.Log($"🧪 Battle Context: {session.battleTerrain} terrain, {session.weather} weather, {session.timeOfDay:F1}h");
+
+            Debug.Log($"🧪 Players ({session.playerTeam.Count}):");
+            foreach (var player in session.playerTeam)
+            {
+                Debug.Log($"🧪   - {player.characterName}: HP {player.currentHealth}/{player.maxHealth}, AC {player.armorClass}, Weapon: {player.equippedWeapon}");
+            }
+
+            Debug.Log($"🧪 Enemies ({session.enemies.Count}):");
+            foreach (var enemy in session.enemies)
+            {
+                Debug.Log($"🧪   - {enemy.enemyName}: HP {enemy.currentHealth}/{enemy.maxHealth}, AC {enemy.armorClass}, Weapon: {enemy.preferredWeapon}, Threat: {enemy.threatLevel}");
+            }
+        }
+
+        Debug.Log("🧪 ====================================");
+    }
+
+    /// <summary>
+    /// Context menu method to manually create enhanced test data
+    /// </summary>
+    [ContextMenu("Create Enhanced Test Data")]
+    public void ManualCreateEnhancedTestData()
+    {
+        CreateEnhancedTestData();
+    }
+
+    /// <summary>
+    /// Context menu method to clear all test data
+    /// </summary>
+    [ContextMenu("Clear All Test Data")]
+    public void ClearAllTestData()
+    {
+        CombatDataTransfer.ClearSession();
+        BattleSetupData.playerSelections.Clear();
+        BattleSetupData.enemySelections.Clear();
+
+        if (showDebugLogs)
+            Debug.Log("🧪 EnhancedBattleTestMode: All test data cleared");
+    }
+
+    /// <summary>
+    /// Create a balanced test battle
+    /// </summary>
+    [ContextMenu("Create Balanced Test Battle")]
+    public void CreateBalancedTestBattle()
+    {
+        testPlayerCount = 2;
+        testEnemyCount = 2;
+        testTerrain = TerrainType.Plains;
+        testWeather = Weather.Clear;
+        testTimeOfDay = 14f;
+
+        CreateEnhancedTestData();
+    }
+
+    /// <summary>
+    /// Create a challenging test battle
+    /// </summary>
+    [ContextMenu("Create Challenging Test Battle")]
+    public void CreateChallengingTestBattle()
+    {
+        testPlayerCount = 2;
+        testEnemyCount = 4;
+        baseEnemyHealth = 20; // Tougher enemies
+        testTerrain = TerrainType.Plains;
+        testWeather = Weather.Storm;
+        testTimeOfDay = 22f; // Night battle
+
+        CreateEnhancedTestData();
+
+        // Reset values
+        baseEnemyHealth = 15;
+    }
+
+    /// <summary>
+    /// Create a simple test battle for quick testing
+    /// </summary>
+    [ContextMenu("Create Simple Test Battle")]
+    public void CreateSimpleTestBattle()
+    {
+        testPlayerCount = 1;
+        testEnemyCount = 1;
+        testTerrain = TerrainType.Plains;
+        testWeather = Weather.Clear;
+        testTimeOfDay = 12f;
+
+        CreateEnhancedTestData();
+    }
+}

+ 215 - 4
Assets/Scripts/BattleScene/GameManager.cs

@@ -150,16 +150,34 @@ public class GameManager : MonoBehaviour
                 PauseGame();
             }
 
-            // Check for battle end conditions
-            if (playerCharacters.Count == 0 || enemyCharacters.Count == 0)
-            {
+            // Check for battle end conditions using proper alive/dead detection
+            List<GameObject> alivePlayers = GetAlivePlayers();
+            List<GameObject> aliveEnemies = GetAliveEnemies();
+
+            // Debug: Log current battle state
+            Debug.Log($"🔍 Battle state check: {alivePlayers.Count} alive players, {aliveEnemies.Count} alive enemies");
 
+            if (alivePlayers.Count == 0 || aliveEnemies.Count == 0)
+            {
+                Debug.Log("🏁 BATTLE END DETECTED!");
                 PauseGame();
                 if (BattleUIManager.Instance != null)
                 {
                     BattleUIManager.Instance.DisableBattleControls(); // Disable UI controls
                 }
-                // Handle battle end logic here (e.g., show results, reset game state, etc.)
+
+                // Handle battle end logic
+                if (alivePlayers.Count == 0)
+                {
+                    Debug.Log("💀 PLAYER DEFEAT");
+                    HandlePlayerDefeat(playerCharacters);
+                }
+                else if (aliveEnemies.Count == 0)
+                {
+                    Debug.Log("🏆 PLAYER VICTORY");
+                    HandlePlayerVictory(enemyCharacters);
+                }
+
                 break; // Exit the loop if battle is over
             }
         }
@@ -170,6 +188,199 @@ public class GameManager : MonoBehaviour
         return playerCharacters.Concat(enemyCharacters).ToList();
     }
 
+    /// <summary>
+    /// Get all alive player characters
+    /// </summary>
+    public List<GameObject> GetAlivePlayers()
+    {
+        var alive = playerCharacters
+            .Where(p => p != null)
+            .Where(p =>
+            {
+                var character = p.GetComponent<Character>();
+                bool isAlive = character != null && !character.IsDead;
+                Debug.Log($"🔍 Player {p.name}: Character={character != null}, IsDead={character?.IsDead}, Alive={isAlive}");
+                return isAlive;
+            })
+            .ToList();
+
+        Debug.Log($"🔍 Total alive players: {alive.Count}/{playerCharacters.Count}");
+        return alive;
+    }
+
+    /// <summary>
+    /// Get all alive enemy characters
+    /// </summary>
+    public List<GameObject> GetAliveEnemies()
+    {
+        var alive = enemyCharacters
+            .Where(e => e != null)
+            .Where(e =>
+            {
+                var character = e.GetComponent<Character>();
+                bool isAlive = character != null && !character.IsDead;
+                Debug.Log($"🔍 Enemy {e.name}: Character={character != null}, IsDead={character?.IsDead}, Alive={isAlive}");
+                return isAlive;
+            })
+            .ToList();
+
+        Debug.Log($"🔍 Total alive enemies: {alive.Count}/{enemyCharacters.Count}");
+        return alive;
+    }
+
+    /// <summary>
+    /// Handle player victory (all enemies defeated)
+    /// </summary>
+    private void HandlePlayerVictory(List<GameObject> defeatedEnemies)
+    {
+        Debug.Log("🏆 Players have won the battle!");
+
+        // Find or create the post-battle loot system
+        var lootSystem = FindFirstObjectByType<PostBattleLootSystem>();
+        if (lootSystem == null)
+        {
+            // Create loot system if it doesn't exist
+            GameObject lootSystemGO = new GameObject("PostBattleLootSystem");
+            lootSystem = lootSystemGO.AddComponent<PostBattleLootSystem>();
+        }
+
+        // Initialize and start looting
+        lootSystem.InitializeLootSystem(defeatedEnemies);
+        lootSystem.OnLootingComplete += OnLootingComplete;
+        lootSystem.StartLooting();
+    }
+
+    /// <summary>
+    /// Handle player defeat (all players dead)
+    /// </summary>
+    private void HandlePlayerDefeat(List<GameObject> defeatedPlayers)
+    {
+        Debug.Log("💀 All players have been defeated!");
+
+        // Find or create the game over screen
+        var gameOverScreen = FindFirstObjectByType<GameOverScreen>();
+        if (gameOverScreen == null)
+        {
+            // Create game over screen if it doesn't exist
+            GameObject gameOverGO = new GameObject("GameOverScreen");
+            gameOverScreen = gameOverGO.AddComponent<GameOverScreen>();
+        }
+
+        // Show game over screen with statistics
+        gameOverScreen.ShowGameOver(defeatedPlayers);
+    }
+
+    /// <summary>
+    /// Called when looting is complete, proceed to end battle
+    /// </summary>
+    private void OnLootingComplete()
+    {
+        Debug.Log("🏆 Battle and looting complete, returning to exploration");
+
+        // Save any updated team data back to the game state
+        SaveBattleResults();
+
+        // Return to MapScene2 (exploration scene)
+        StartCoroutine(ReturnToExplorationScene());
+    }
+
+    /// <summary>
+    /// Save battle results and return to exploration
+    /// </summary>
+    private System.Collections.IEnumerator ReturnToExplorationScene()
+    {
+        // Give a brief moment for any final UI updates
+        yield return new WaitForSeconds(0.5f);
+
+        // Load the exploration scene
+        try
+        {
+            UnityEngine.SceneManagement.SceneManager.LoadScene("MapScene2");
+        }
+        catch (System.Exception e)
+        {
+            Debug.LogError($"Failed to load MapScene2: {e.Message}");
+            // Fallback - try to find and use battle setup
+            var battleSetup = FindFirstObjectByType<EnhancedBattleSetup>();
+            if (battleSetup != null)
+            {
+                battleSetup.EndBattleSession(true); // Player victory
+            }
+            else
+            {
+                Debug.LogWarning("No scene transition method available");
+            }
+        }
+    }
+
+    /// <summary>
+    /// Save battle results back to persistent game state
+    /// </summary>
+    private void SaveBattleResults()
+    {
+        // Update team data with any changes from battle (health, items, etc.)
+        var alivePlayerCharacters = GetAlivePlayers();
+
+        // You could save character states here if needed
+        Debug.Log($"💾 Saved battle results for {alivePlayerCharacters.Count} surviving players");
+    }
+
+    #region Debug and Testing Methods
+
+    /// <summary>
+    /// [DEBUG] Force battle end for testing post-battle systems
+    /// </summary>
+    [ContextMenu("Test Battle Victory")]
+    public void TestBattleVictory()
+    {
+        Debug.Log("🧪 [TEST] Forcing battle victory to test post-battle loot system");
+
+        // Kill all enemies for testing
+        foreach (var enemy in enemyCharacters)
+        {
+            if (enemy != null)
+            {
+                var character = enemy.GetComponent<Character>();
+                if (character != null && !character.IsDead)
+                {
+                    // Force enemy death for testing
+                    character.TakeDamage(1000);
+                }
+            }
+        }
+
+        // Manually trigger victory
+        HandlePlayerVictory(enemyCharacters);
+    }
+
+    /// <summary>
+    /// [DEBUG] Force battle defeat for testing game over
+    /// </summary>
+    [ContextMenu("Test Battle Defeat")]
+    public void TestBattleDefeat()
+    {
+        Debug.Log("🧪 [TEST] Forcing battle defeat to test game over screen");
+
+        // Kill all players for testing
+        foreach (var player in playerCharacters)
+        {
+            if (player != null)
+            {
+                var character = player.GetComponent<Character>();
+                if (character != null && !character.IsDead)
+                {
+                    // Force player death for testing
+                    character.TakeDamage(1000);
+                }
+            }
+        }
+
+        // Manually trigger defeat
+        HandlePlayerDefeat(playerCharacters);
+    }
+
+    #endregion
+
     private IEnumerator ExecuteAllActionsSimultaneously()
     {
 

+ 0 - 0
Assets/Scripts/BattleScene/ItemSelectionUI.cs


+ 0 - 0
Assets/Scripts/BattleScene/ItemSelectionUI_New.cs


+ 897 - 0
Assets/Scripts/BattleScene/PostBattleLootSystem.cs

@@ -0,0 +1,897 @@
+using System.Collections.Generic;
+using UnityEngine;
+using System.Linq;
+using UnityEngine.UIElements;
+#if UNITY_EDITOR
+using UnityEditor;
+#endif
+
+/// <summary>
+/// Handles post-battle looting when all enemies are defeated
+/// Allows players to loot enemy corpses and manage inventory weight
+/// </summary>
+public class PostBattleLootSystem : MonoBehaviour
+{
+    [Header("UI Toolkit References")]
+    public UIDocument lootUIDocument;
+    public VisualTreeAsset lootScreenTemplate;
+    public PanelSettings panelSettings;
+
+    [Header("Currency Settings")]
+    public int baseGoldReward = 5;
+    public int baseSilverReward = 15;
+    public int baseCopperReward = 25;
+
+    [Header("Debug Settings")]
+    public bool showDebugLogs = true;
+
+    // Events
+    public event System.Action OnLootingComplete;
+
+    private List<LootableEnemy> lootableEnemies = new List<LootableEnemy>();
+    private bool isLootingActive = false;
+    private VisualElement rootElement;
+    private bool takeAllPressed = false;
+
+    /// <summary>
+    /// Gets whether the looting process is currently active
+    /// </summary>
+    public bool IsLootingActive => isLootingActive;
+
+    [System.Serializable]
+    public class LootableEnemy
+    {
+        public string enemyName;
+        public List<string> dropItems = new List<string>();
+        public int goldReward;
+        public int silverReward;
+        public int copperReward;
+        public bool hasBeenLooted = false;
+        public Vector3 corpsePosition;
+
+        public LootableEnemy(string name, Vector3 position)
+        {
+            enemyName = name;
+            corpsePosition = position;
+        }
+    }
+
+    [System.Serializable]
+    public class LootableItem
+    {
+        public string itemName;
+        public string description;
+        public int weight = 1;
+        public int value = 1; // In copper
+        public bool isSelected = false;
+
+        public LootableItem(string name, string desc, int itemWeight = 1, int itemValue = 1)
+        {
+            itemName = name;
+            description = desc;
+            weight = itemWeight;
+            value = itemValue;
+        }
+    }
+
+    /// <summary>
+    /// Initialize looting system with defeated enemies
+    /// </summary>
+    public void InitializeLootSystem(List<GameObject> defeatedEnemies)
+    {
+        lootableEnemies.Clear();
+
+        foreach (var enemy in defeatedEnemies)
+        {
+            if (enemy == null) continue;
+
+            Character enemyCharacter = enemy.GetComponent<Character>();
+            if (enemyCharacter == null || !enemyCharacter.IsDead) continue;
+
+            var lootableEnemy = new LootableEnemy(enemyCharacter.CharacterName, enemy.transform.position);
+
+            // Generate loot based on enemy type and random factors
+            GenerateEnemyLoot(lootableEnemy, enemyCharacter);
+
+            lootableEnemies.Add(lootableEnemy);
+        }
+
+        if (showDebugLogs)
+            Debug.Log($"💰 Initialized loot system with {lootableEnemies.Count} lootable enemies");
+    }
+
+    /// <summary>
+    /// Show the loot UI and start looting phase
+    /// </summary>
+    public void StartLooting()
+    {
+        if (lootableEnemies.Count == 0)
+        {
+            if (showDebugLogs)
+                Debug.Log("💰 No enemies to loot, ending battle");
+            OnLootingComplete?.Invoke();
+            return;
+        }
+
+        isLootingActive = true;
+        CreateAndShowLootUI();
+
+        if (showDebugLogs)
+            Debug.Log("💰 Started post-battle looting phase");
+    }
+
+    /// <summary>
+    /// Create and show the UI Toolkit loot interface
+    /// </summary>
+    private void CreateAndShowLootUI()
+    {
+        // Find or create UI Document
+        if (lootUIDocument == null)
+        {
+            GameObject uiGO = new GameObject("LootUIDocument");
+            uiGO.transform.SetParent(transform);
+            lootUIDocument = uiGO.AddComponent<UIDocument>();
+        }
+
+        // Set up the UI Document with proper references
+        SetupLootUIDocument();
+
+        // Get the root element
+        if (lootUIDocument.visualTreeAsset != null)
+        {
+            rootElement = lootUIDocument.rootVisualElement;
+
+            // Show the overlay
+            var overlay = rootElement.Q<VisualElement>("LootScreenOverlay");
+            if (overlay != null)
+            {
+                overlay.style.display = DisplayStyle.Flex;
+            }
+
+            // Populate the UI with loot data
+            PopulateLootUI();
+
+            // Set up button callbacks
+            SetupUICallbacks();
+        }
+        else
+        {
+            // Fallback - create basic UI if template loading failed
+            Debug.LogWarning("PostBattleLootScreen.uxml not found. Creating basic UI.");
+            CreateBasicLootUI();
+        }
+    }
+
+    /// <summary>
+    /// Set up the UIDocument with proper UXML template and panel settings
+    /// </summary>
+    private void SetupLootUIDocument()
+    {
+        if (lootUIDocument == null) return;
+
+        // Load the UXML template if not assigned
+        if (lootScreenTemplate == null)
+        {
+            lootScreenTemplate = Resources.Load<VisualTreeAsset>("UI/BattleSceneUI/PostBattleLootScreen");
+            if (lootScreenTemplate == null)
+            {
+#if UNITY_EDITOR
+                // Try alternative path in editor
+                lootScreenTemplate = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>("Assets/UI/BattleSceneUI/PostBattleLootScreen.uxml");
+#endif
+            }
+        }
+
+        // Load panel settings if not assigned
+        if (panelSettings == null)
+        {
+            panelSettings = Resources.Load<PanelSettings>("MainSettings");
+            if (panelSettings == null)
+            {
+                // Try alternative panel settings
+                panelSettings = Resources.Load<PanelSettings>("UI/TravelPanelSettings");
+                if (panelSettings == null)
+                {
+                    // Try to find any PanelSettings in the project
+                    var allPanelSettings = Resources.FindObjectsOfTypeAll<PanelSettings>();
+                    if (allPanelSettings.Length > 0)
+                        panelSettings = allPanelSettings[0];
+                }
+            }
+        }
+
+        // Configure the UIDocument
+        lootUIDocument.visualTreeAsset = lootScreenTemplate;
+        lootUIDocument.panelSettings = panelSettings;
+
+        // Load and apply stylesheet
+        var stylesheet = Resources.Load<StyleSheet>("UI/BattleSceneUI/PostBattleLootScreen");
+        if (stylesheet == null)
+        {
+#if UNITY_EDITOR
+            stylesheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/UI/BattleSceneUI/PostBattleLootScreen.uss");
+#endif
+        }
+        if (stylesheet != null && lootUIDocument.rootVisualElement != null)
+        {
+            lootUIDocument.rootVisualElement.styleSheets.Add(stylesheet);
+        }
+
+        if (lootScreenTemplate == null)
+        {
+            Debug.LogError("PostBattleLootSystem: Could not load PostBattleLootScreen.uxml template!");
+        }
+
+        if (panelSettings == null)
+        {
+            Debug.LogWarning("PostBattleLootSystem: No PanelSettings found. UI may not display correctly.");
+        }
+    }
+
+    /// <summary>
+    /// Create a basic fallback UI if the UXML template isn't available
+    /// </summary>
+    private void CreateBasicLootUI()
+    {
+        // Create a simple overlay using UI Toolkit elements
+        rootElement = lootUIDocument.rootVisualElement;
+
+        // Create overlay
+        var overlay = new VisualElement();
+        overlay.name = "LootScreenOverlay";
+        overlay.style.position = Position.Absolute;
+        overlay.style.top = 0;
+        overlay.style.left = 0;
+        overlay.style.right = 0;
+        overlay.style.bottom = 0;
+        overlay.style.backgroundColor = new Color(0, 0, 0, 0.8f);
+        overlay.style.justifyContent = Justify.Center;
+        overlay.style.alignItems = Align.Center;
+
+        // Create background panel
+        var background = new VisualElement();
+        background.style.backgroundColor = new Color(0.1f, 0.1f, 0.2f, 0.95f);
+        background.style.borderTopWidth = 2;
+        background.style.borderBottomWidth = 2;
+        background.style.borderLeftWidth = 2;
+        background.style.borderRightWidth = 2;
+        background.style.borderTopColor = new Color(0.7f, 0.5f, 0.2f);
+        background.style.borderBottomColor = new Color(0.7f, 0.5f, 0.2f);
+        background.style.borderLeftColor = new Color(0.7f, 0.5f, 0.2f);
+        background.style.borderRightColor = new Color(0.7f, 0.5f, 0.2f);
+        background.style.borderTopLeftRadius = 15;
+        background.style.borderTopRightRadius = 15;
+        background.style.borderBottomLeftRadius = 15;
+        background.style.borderBottomRightRadius = 15;
+        background.style.paddingTop = 30;
+        background.style.paddingBottom = 30;
+        background.style.paddingLeft = 30;
+        background.style.paddingRight = 30;
+        background.style.width = new Length(80, LengthUnit.Percent);
+        background.style.maxWidth = 800;
+
+        // Add title
+        var title = new Label("🏆 VICTORY! 🏆");
+        title.style.fontSize = 36;
+        title.style.color = new Color(1f, 0.84f, 0f);
+        title.style.unityTextAlign = TextAnchor.MiddleCenter;
+        title.style.marginBottom = 20;
+
+        // Add loot info
+        var lootInfo = new Label();
+        lootInfo.name = "LootInfo";
+        lootInfo.style.fontSize = 14;
+        lootInfo.style.color = Color.white;
+        lootInfo.style.whiteSpace = WhiteSpace.Normal;
+        lootInfo.style.marginBottom = 20;
+
+        // Add continue button
+        var continueButton = new Button(() => CompleteLootingProcess());
+        continueButton.text = "Continue";
+        continueButton.name = "ContinueButton";
+        continueButton.style.fontSize = 16;
+        continueButton.style.paddingTop = 10;
+        continueButton.style.paddingBottom = 10;
+        continueButton.style.paddingLeft = 20;
+        continueButton.style.paddingRight = 20;
+
+        // Assemble the UI
+        background.Add(title);
+        background.Add(lootInfo);
+        background.Add(continueButton);
+        overlay.Add(background);
+        rootElement.Add(overlay);
+
+        // Populate basic loot info
+        PopulateBasicLootInfo(lootInfo);
+    }
+
+    /// <summary>
+    /// Set up UI element callbacks for the loot interface
+    /// </summary>
+    private void SetupUICallbacks()
+    {
+        if (rootElement == null) return;
+
+        // Set up Take All button
+        var takeAllButton = rootElement.Q<Button>("TakeAllButton");
+        if (takeAllButton != null)
+        {
+            takeAllButton.clicked += () =>
+            {
+                takeAllPressed = true;
+                AutoLootAll();
+                CompleteLootingProcess();
+            };
+        }
+
+        // Set up Continue button
+        var continueButton = rootElement.Q<Button>("ContinueButton");
+        if (continueButton != null)
+        {
+            continueButton.clicked += () =>
+            {
+                if (!takeAllPressed)
+                {
+                    AutoLootAll(); // Auto-loot if not already done
+                }
+                CompleteLootingProcess();
+            };
+        }
+
+        // Set up keyboard input for space key
+        rootElement.RegisterCallback<KeyDownEvent>(OnKeyDown);
+
+        // Make sure the root element can receive focus for keyboard events
+        rootElement.focusable = true;
+        rootElement.Focus();
+    }
+
+    /// <summary>
+    /// Handle keyboard input for the loot UI
+    /// </summary>
+    private void OnKeyDown(KeyDownEvent evt)
+    {
+        if (evt.keyCode == KeyCode.Space)
+        {
+            if (!takeAllPressed)
+            {
+                AutoLootAll();
+            }
+            CompleteLootingProcess();
+        }
+    }
+
+    /// <summary>
+    /// Populate basic loot information for fallback UI
+    /// </summary>
+    private void PopulateBasicLootInfo(Label lootInfo)
+    {
+        var lootText = "Collecting loot from defeated enemies...\n\n";
+
+        int totalGold = 0, totalSilver = 0, totalCopper = 0;
+        List<string> allItems = new List<string>();
+
+        foreach (var enemy in lootableEnemies)
+        {
+            totalGold += enemy.goldReward;
+            totalSilver += enemy.silverReward;
+            totalCopper += enemy.copperReward;
+            allItems.AddRange(enemy.dropItems);
+            lootText += $"💀 {enemy.enemyName}: {enemy.goldReward}g {enemy.silverReward}s {enemy.copperReward}c\n";
+            foreach (var item in enemy.dropItems)
+            {
+                lootText += $"   📦 {item}\n";
+            }
+        }
+
+        lootText += $"\n💰 Total: {totalGold} gold, {totalSilver} silver, {totalCopper} copper\n";
+        lootText += $"📦 {allItems.Count} items collected\n\n";
+        lootText += "Click Continue to proceed or press SPACE...";
+
+        lootInfo.text = lootText;
+    }
+
+    /// <summary>
+    /// Show a temporary on-screen message for looting
+    /// </summary>
+    private System.Collections.IEnumerator ShowLootingMessage()
+    {
+        // Create a temporary UI GameObject
+        GameObject tempUI = new GameObject("TempLootUI");
+        tempUI.transform.SetParent(FindFirstObjectByType<Canvas>()?.transform, false);
+
+        // Add background panel
+        var canvasGroup = tempUI.AddComponent<CanvasGroup>();
+        var image = tempUI.AddComponent<UnityEngine.UI.Image>();
+        image.color = new Color(0, 0, 0, 0.8f); // Semi-transparent black
+
+        // Set full screen size
+        var rectTransform = tempUI.GetComponent<RectTransform>();
+        rectTransform.anchorMin = Vector2.zero;
+        rectTransform.anchorMax = Vector2.one;
+        rectTransform.offsetMin = Vector2.zero;
+        rectTransform.offsetMax = Vector2.zero;
+
+        // Add text
+        GameObject textObj = new GameObject("LootText");
+        textObj.transform.SetParent(tempUI.transform, false);
+        var text = textObj.AddComponent<UnityEngine.UI.Text>();
+        text.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
+        text.fontSize = 24;
+        text.color = Color.white;
+        text.alignment = TextAnchor.MiddleCenter;
+
+        // Set text content
+        string lootText = "🏆 VICTORY! 🏆\n\n";
+        lootText += "Collecting loot from defeated enemies...\n\n";
+
+        int totalGold = 0, totalSilver = 0, totalCopper = 0;
+        List<string> allItems = new List<string>();
+
+        foreach (var enemy in lootableEnemies)
+        {
+            totalGold += enemy.goldReward;
+            totalSilver += enemy.silverReward;
+            totalCopper += enemy.copperReward;
+            allItems.AddRange(enemy.dropItems);
+            lootText += $"💀 {enemy.enemyName}: {enemy.goldReward}g {enemy.silverReward}s {enemy.copperReward}c\n";
+            foreach (var item in enemy.dropItems)
+            {
+                lootText += $"   📦 {item}\n";
+            }
+        }
+
+        lootText += $"\n💰 Total: {totalGold} gold, {totalSilver} silver, {totalCopper} copper\n";
+        lootText += $"📦 {allItems.Count} items collected\n\n";
+        lootText += "Press SPACE to continue...";
+
+        text.text = lootText;
+
+        // Set text position
+        var textRect = textObj.GetComponent<RectTransform>();
+        textRect.anchorMin = Vector2.zero;
+        textRect.anchorMax = Vector2.one;
+        textRect.offsetMin = new Vector2(50, 50);
+        textRect.offsetMax = new Vector2(-50, -50);
+
+        // Auto-loot everything
+        AutoLootAll();
+
+        // Wait for space key or 5 seconds
+        float timer = 0f;
+        while (timer < 5f && !Input.GetKeyDown(KeyCode.Space))
+        {
+            timer += Time.deltaTime;
+            yield return null;
+        }
+
+        // Cleanup UI
+        if (tempUI != null)
+            Destroy(tempUI);
+
+        // Complete looting
+        CompleteLootingProcess();
+    }
+
+    /// <summary>
+    /// Complete the looting process and trigger the callback
+    /// </summary>
+    private void CompleteLootingProcess()
+    {
+        isLootingActive = false;
+
+        if (showDebugLogs)
+            Debug.Log("💰 Looting completed, triggering OnLootingComplete");
+
+        OnLootingComplete?.Invoke();
+    }
+
+    /// <summary>
+    /// Generate loot for a defeated enemy
+    /// </summary>
+    private void GenerateEnemyLoot(LootableEnemy lootableEnemy, Character enemyCharacter)
+    {
+        // Base currency rewards
+        lootableEnemy.goldReward = Random.Range(0, baseGoldReward + 1);
+        lootableEnemy.silverReward = Random.Range(0, baseSilverReward + 1);
+        lootableEnemy.copperReward = Random.Range(baseCopperReward - 5, baseCopperReward + 10);
+
+        // Basic item drops based on enemy type
+        GenerateBasicDrops(lootableEnemy, enemyCharacter.CharacterName);
+
+        // Try to get drops from enemy data if available
+        TryGetEnemyDataDrops(lootableEnemy, enemyCharacter);
+
+        if (showDebugLogs)
+        {
+            Debug.Log($"💰 Generated loot for {lootableEnemy.enemyName}: " +
+                     $"{lootableEnemy.goldReward}g {lootableEnemy.silverReward}s {lootableEnemy.copperReward}c, " +
+                     $"{lootableEnemy.dropItems.Count} items");
+        }
+    }
+
+    /// <summary>
+    /// Generate basic drops based on enemy name/type
+    /// </summary>
+    private void GenerateBasicDrops(LootableEnemy lootableEnemy, string enemyName)
+    {
+        string lowerName = enemyName.ToLower();
+
+        // Skeleton-type enemies
+        if (lowerName.Contains("skeleton"))
+        {
+            if (Random.Range(0f, 1f) < 0.3f) lootableEnemy.dropItems.Add("Bone");
+            if (Random.Range(0f, 1f) < 0.2f) lootableEnemy.dropItems.Add("Rusty Sword");
+            if (Random.Range(0f, 1f) < 0.15f) lootableEnemy.dropItems.Add("Bone Dust");
+        }
+        // Bandit-type enemies
+        else if (lowerName.Contains("bandit") || lowerName.Contains("thief"))
+        {
+            if (Random.Range(0f, 1f) < 0.4f) lootableEnemy.dropItems.Add("Thieves' Tools");
+            if (Random.Range(0f, 1f) < 0.3f) lootableEnemy.dropItems.Add("Rope");
+            if (Random.Range(0f, 1f) < 0.2f) lootableEnemy.dropItems.Add("Dagger");
+            // Bandits often have extra coin
+            lootableEnemy.copperReward += Random.Range(5, 15);
+        }
+        // Orc-type enemies
+        else if (lowerName.Contains("orc") || lowerName.Contains("goblin"))
+        {
+            if (Random.Range(0f, 1f) < 0.3f) lootableEnemy.dropItems.Add("Crude Axe");
+            if (Random.Range(0f, 1f) < 0.25f) lootableEnemy.dropItems.Add("Hide Armor");
+            if (Random.Range(0f, 1f) < 0.2f) lootableEnemy.dropItems.Add("Iron Ration");
+        }
+        // Default/unknown enemies
+        else
+        {
+            if (Random.Range(0f, 1f) < 0.2f) lootableEnemy.dropItems.Add("Leather Scraps");
+            if (Random.Range(0f, 1f) < 0.15f) lootableEnemy.dropItems.Add("Iron Ration");
+        }
+
+        // Common drops for all enemies
+        if (Random.Range(0f, 1f) < 0.1f) lootableEnemy.dropItems.Add("Health Potion");
+        if (Random.Range(0f, 1f) < 0.05f) lootableEnemy.dropItems.Add("Bandage");
+    }
+
+    /// <summary>
+    /// Try to get drops from EnemyCharacterData if available
+    /// </summary>
+    private void TryGetEnemyDataDrops(LootableEnemy lootableEnemy, Character enemyCharacter)
+    {
+        // This would integrate with the EnemyCharacterData system
+        // For now, we'll use the basic drop system above
+        // TODO: Integrate with EnemyCharacterData.dropTable when available
+    }
+
+    /// <summary>
+    /// Show the loot UI
+    /// </summary>
+    private void ShowLootUI()
+    {
+        if (rootElement != null)
+        {
+            // Show the UI Toolkit loot interface
+            rootElement.style.display = DisplayStyle.Flex;
+            PopulateLootUI();
+        }
+        else
+        {
+            // Fallback to console-based looting for now
+            Debug.Log("💰 === POST-BATTLE LOOT ===");
+            foreach (var enemy in lootableEnemies)
+            {
+                Debug.Log($"💰 {enemy.enemyName}: {enemy.goldReward}g {enemy.silverReward}s {enemy.copperReward}c");
+                foreach (var item in enemy.dropItems)
+                {
+                    Debug.Log($"💰   - {item}");
+                }
+            }
+            Debug.Log("💰 ========================");
+
+            // Auto-loot everything for now
+            AutoLootAll();
+        }
+    }
+
+    /// <summary>
+    /// Populate the loot UI with available items
+    /// </summary>
+    private void PopulateLootUI()
+    {
+        if (rootElement == null) return;
+
+        // Calculate totals first
+        int totalGold = 0, totalSilver = 0, totalCopper = 0;
+        List<string> allItems = new List<string>();
+
+        foreach (var enemy in lootableEnemies)
+        {
+            totalGold += enemy.goldReward;
+            totalSilver += enemy.silverReward;
+            totalCopper += enemy.copperReward;
+            allItems.AddRange(enemy.dropItems);
+        }
+
+        // Update currency displays
+        var goldLabel = rootElement.Q<Label>("GoldAmount");
+        var silverLabel = rootElement.Q<Label>("SilverAmount");
+        var copperLabel = rootElement.Q<Label>("CopperAmount");
+
+        if (goldLabel != null) goldLabel.text = totalGold.ToString();
+        if (silverLabel != null) silverLabel.text = totalSilver.ToString();
+        if (copperLabel != null) copperLabel.text = totalCopper.ToString();
+
+        // Update item count
+        var itemCountLabel = rootElement.Q<Label>("ItemCount");
+        if (itemCountLabel != null)
+            itemCountLabel.text = $"{allItems.Count} items";
+
+        // Populate enemy loot sections
+        var enemyLootContainer = rootElement.Q<VisualElement>("EnemyLootContainer");
+        if (enemyLootContainer != null)
+        {
+            enemyLootContainer.Clear();
+
+            foreach (var enemy in lootableEnemies)
+            {
+                var enemySection = new VisualElement();
+                enemySection.AddToClassList("enemy-loot-section");
+
+                // Enemy header
+                var enemyHeader = new Label($"💀 {enemy.enemyName}");
+                enemyHeader.AddToClassList("enemy-name");
+                enemySection.Add(enemyHeader);
+
+                // Enemy currency
+                if (enemy.goldReward > 0 || enemy.silverReward > 0 || enemy.copperReward > 0)
+                {
+                    var currencyContainer = new VisualElement();
+                    currencyContainer.AddToClassList("enemy-currency");
+
+                    if (enemy.goldReward > 0)
+                    {
+                        var enemyGoldLabel = new Label($"🪙 {enemy.goldReward}");
+                        enemyGoldLabel.AddToClassList("currency-gold");
+                        currencyContainer.Add(enemyGoldLabel);
+                    }
+
+                    if (enemy.silverReward > 0)
+                    {
+                        var enemySilverLabel = new Label($"🪙 {enemy.silverReward}");
+                        enemySilverLabel.AddToClassList("currency-silver");
+                        currencyContainer.Add(enemySilverLabel);
+                    }
+
+                    if (enemy.copperReward > 0)
+                    {
+                        var enemyCopperLabel = new Label($"🪙 {enemy.copperReward}");
+                        enemyCopperLabel.AddToClassList("currency-copper");
+                        currencyContainer.Add(enemyCopperLabel);
+                    }
+
+                    enemySection.Add(currencyContainer);
+                }
+
+                // Enemy items
+                if (enemy.dropItems != null && enemy.dropItems.Count > 0)
+                {
+                    var itemsContainer = new VisualElement();
+                    itemsContainer.AddToClassList("enemy-items");
+
+                    foreach (var item in enemy.dropItems)
+                    {
+                        var itemLabel = new Label($"📦 {item}");
+                        itemLabel.AddToClassList("item-entry");
+                        itemsContainer.Add(itemLabel);
+                    }
+
+                    enemySection.Add(itemsContainer);
+                }
+
+                enemyLootContainer.Add(enemySection);
+            }
+        }
+    }
+
+    /// <summary>
+    /// Auto-loot all items and currency (temporary solution)
+    /// </summary>
+    private void AutoLootAll()
+    {
+        int totalGold = 0, totalSilver = 0, totalCopper = 0;
+        List<string> allItems = new List<string>();
+
+        foreach (var enemy in lootableEnemies)
+        {
+            if (!enemy.hasBeenLooted)
+            {
+                totalGold += enemy.goldReward;
+                totalSilver += enemy.silverReward;
+                totalCopper += enemy.copperReward;
+                allItems.AddRange(enemy.dropItems);
+                enemy.hasBeenLooted = true;
+            }
+        }
+
+        // Distribute rewards to players
+        DistributeRewards(totalGold, totalSilver, totalCopper, allItems);
+
+        if (showDebugLogs)
+        {
+            Debug.Log($"💰 Auto-looted: {totalGold}g {totalSilver}s {totalCopper}c and {allItems.Count} items");
+        }
+
+        // End looting phase
+        FinishLooting();
+    }
+
+    /// <summary>
+    /// Distribute looted rewards among surviving players
+    /// </summary>
+    private void DistributeRewards(int gold, int silver, int copper, List<string> items)
+    {
+        // Get surviving players
+        var survivingPlayers = GetSurvivingPlayers();
+        if (survivingPlayers.Count == 0)
+        {
+            Debug.LogWarning("💰 No surviving players to distribute loot to!");
+            return;
+        }
+
+        // Distribute currency evenly
+        int goldPerPlayer = gold / survivingPlayers.Count;
+        int silverPerPlayer = silver / survivingPlayers.Count;
+        int copperPerPlayer = copper / survivingPlayers.Count;
+
+        // Handle remainder
+        int goldRemainder = gold % survivingPlayers.Count;
+        int silverRemainder = silver % survivingPlayers.Count;
+        int copperRemainder = copper % survivingPlayers.Count;
+
+        for (int i = 0; i < survivingPlayers.Count; i++)
+        {
+            var player = survivingPlayers[i];
+            Character playerCharacter = player.GetComponent<Character>();
+
+            if (playerCharacter == null) continue;
+
+            // Get player's bank (assuming it exists)
+            var bank = playerCharacter.GetComponent<Bank>();
+            if (bank != null)
+            {
+                bank.gold += goldPerPlayer + (i < goldRemainder ? 1 : 0);
+                bank.silver += silverPerPlayer + (i < silverRemainder ? 1 : 0);
+                bank.copper += copperPerPlayer + (i < copperRemainder ? 1 : 0);
+            }
+
+            // Distribute items (simple round-robin for now)
+            var inventory = playerCharacter.GetComponent<Inventory>();
+            if (inventory != null)
+            {
+                for (int j = i; j < items.Count; j += survivingPlayers.Count)
+                {
+                    // TODO: Create proper Item objects instead of strings
+                    // For now, add to string-based inventory if available
+                    AddItemToPlayer(playerCharacter, items[j]);
+                }
+            }
+
+            if (showDebugLogs)
+            {
+                int finalGold = goldPerPlayer + (i < goldRemainder ? 1 : 0);
+                int finalSilver = silverPerPlayer + (i < silverRemainder ? 1 : 0);
+                int finalCopper = copperPerPlayer + (i < copperRemainder ? 1 : 0);
+                Debug.Log($"💰 {playerCharacter.CharacterName} received: {finalGold}g {finalSilver}s {finalCopper}c");
+            }
+        }
+    }
+
+    /// <summary>
+    /// Add an item to a player's inventory
+    /// </summary>
+    private void AddItemToPlayer(Character player, string itemName)
+    {
+        // Try to add to CombatDataTransfer session data
+        if (CombatDataTransfer.HasValidSession())
+        {
+            var session = CombatDataTransfer.GetCurrentSession();
+            var playerData = session.playerTeam.Find(p =>
+                p.characterName == player.CharacterName ||
+                player.CharacterName.StartsWith(p.characterName));
+
+            if (playerData != null)
+            {
+                if (playerData.miscItems == null)
+                    playerData.miscItems = new List<string>();
+
+                playerData.miscItems.Add(itemName);
+
+                if (showDebugLogs)
+                    Debug.Log($"💰 Added {itemName} to {player.CharacterName}'s inventory");
+                return;
+            }
+        }
+
+        // Fallback: log that item would be added
+        if (showDebugLogs)
+            Debug.Log($"💰 Would add {itemName} to {player.CharacterName} (no inventory system found)");
+    }
+
+    /// <summary>
+    /// Get list of surviving player characters
+    /// </summary>
+    private List<GameObject> GetSurvivingPlayers()
+    {
+        var gameManager = GameManager.Instance;
+        if (gameManager == null) return new List<GameObject>();
+
+        return gameManager.playerCharacters
+            .Where(p => p != null)
+            .Where(p =>
+            {
+                var character = p.GetComponent<Character>();
+                return character != null && !character.IsDead;
+            })
+            .ToList();
+    }
+
+    /// <summary>
+    /// Complete the looting phase
+    /// </summary>
+    private void FinishLooting()
+    {
+        isLootingActive = false;
+
+        if (rootElement != null)
+            rootElement.style.display = DisplayStyle.None;
+
+        OnLootingComplete?.Invoke();
+
+        if (showDebugLogs)
+            Debug.Log("💰 Looting phase completed");
+    }
+
+    /// <summary>
+    /// Skip looting and proceed to battle end
+    /// </summary>
+    public void SkipLooting()
+    {
+        if (showDebugLogs)
+            Debug.Log("💰 Skipping looting phase");
+
+        FinishLooting();
+    }
+
+    /// <summary>
+    /// Check if all enemies have been looted
+    /// </summary>
+    public bool AllEnemiesLooted()
+    {
+        return lootableEnemies.All(e => e.hasBeenLooted);
+    }
+
+    /// <summary>
+    /// Get total weight of all available loot
+    /// </summary>
+    public int GetTotalLootWeight()
+    {
+        // TODO: Implement when item weight system is added
+        return lootableEnemies.Sum(e => e.dropItems.Count); // Placeholder: 1 weight per item
+    }
+
+    /// <summary>
+    /// Get total value of all available loot in copper
+    /// </summary>
+    public int GetTotalLootValue()
+    {
+        int totalValue = 0;
+        foreach (var enemy in lootableEnemies)
+        {
+            totalValue += enemy.goldReward * 100; // 1 gold = 100 copper
+            totalValue += enemy.silverReward * 10; // 1 silver = 10 copper
+            totalValue += enemy.copperReward;
+            // TODO: Add item values when item system is integrated
+        }
+        return totalValue;
+    }
+}

+ 16 - 0
Assets/Scripts/BattleSetup/CombatDataTransfer.cs

@@ -1,3 +1,4 @@
+using System;
 using System.Collections.Generic;
 using UnityEngine;
 
@@ -57,6 +58,7 @@ public static class CombatDataTransfer
         public string equippedArmor = "";
         public List<string> availableWeapons = new List<string>();
         public List<string> availableArmor = new List<string>();
+        public List<string> miscItems = new List<string>(); // Character's inventory items
 
         // Resources
         public int gold = 25;
@@ -67,6 +69,7 @@ public static class CombatDataTransfer
         {
             availableWeapons = new List<string>();
             availableArmor = new List<string>();
+            miscItems = new List<string>();
         }
 
         /// <summary>
@@ -121,6 +124,8 @@ public static class CombatDataTransfer
                     combatData.availableWeapons.AddRange(teamChar.weapons);
                 if (teamChar.armor != null)
                     combatData.availableArmor.AddRange(teamChar.armor);
+                if (teamChar.miscItems != null)
+                    combatData.miscItems.AddRange(teamChar.miscItems);
             }
 
             return combatData;
@@ -445,4 +450,15 @@ public static class CombatDataTransfer
         Debug.LogError($"❌ FindWeaponItem: No weapon found for '{weaponIdentifier}'");
         return null;
     }
+
+    internal static void SetCombatSession(CombatSessionData sessionData)
+    {
+        if (sessionData == null)
+        {
+            Debug.LogError($"❌ SetCombatSession: Invalid session data");
+            return;
+        }
+
+        currentSession = sessionData;
+    }
 }

+ 2 - 0
Assets/Scripts/Characters/Enemies/SkeletonCharacter.cs

@@ -10,9 +10,11 @@ public class SkeletonCharacter : Character
         MaxHealth = 10;
         CurrentHealth = MaxHealth;
         Attack = 8;
+        Strength = 8;           // Default strength
         Constitution = 5;
         Dexterity = 3;
         Wisdom = 2;
+        Perception = 8;         // Default perception
 
         InitModifier = -2;
         DamageModifier = 0;

+ 2 - 0
Assets/Scripts/Characters/HumanCharacter.cs

@@ -9,9 +9,11 @@ public class HumanCharacter : Character
         MaxHealth = 20;
         CurrentHealth = MaxHealth;
         Attack = 8;
+        Strength = 10;          // Default strength
         Constitution = 5;
         Dexterity = 3;
         Wisdom = 2;
+        Perception = 10;        // Default perception
 
         InitModifier = -2;
         DamageModifier = 0;

+ 44 - 0
Assets/Scripts/Objects/Character.cs

@@ -47,9 +47,11 @@ public abstract class Character : MonoBehaviour
     private int maxHealth;
     private int currentHealth;
     private int attack;
+    private int strength;
     private int constitution;
     private int dexterity;
     private int wisdom;
+    private int perception;
     private Sprite characterSprite;
     private int level;
     private int experiencePoints;
@@ -97,9 +99,11 @@ public abstract class Character : MonoBehaviour
     public int MaxHealth { get => maxHealth; set => maxHealth = value; }
     public int CurrentHealth { get => currentHealth; set => currentHealth = value; }
     public int Attack { get => attack; set => attack = value; }
+    public int Strength { get => strength; set => strength = value; }
     public int Constitution { get => constitution; set => constitution = value; }
     public int Dexterity { get => dexterity; set => dexterity = value; }
     public int Wisdom { get => wisdom; set => wisdom = value; }
+    public int Perception { get => perception; set => perception = value; }
     public Sprite CharacterSprite { get => characterSprite; set => characterSprite = value; }
     public int Level { get => level; set => level = value; }
     public int ExperiencePoints { get => experiencePoints; set => experiencePoints = value; }
@@ -158,6 +162,46 @@ public abstract class Character : MonoBehaviour
         // Override in subclasses to set character stats
     }
 
+    /// <summary>
+    /// Apply stats from combat data to this character
+    /// </summary>
+    public virtual void ApplyStatsFromCombatData(object combatData)
+    {
+        // Handle TeamCharacterCombatData
+        if (combatData is CombatDataTransfer.TeamCharacterCombatData teamData)
+        {
+            CharacterName = teamData.characterName;
+            Strength = teamData.strength;
+            Dexterity = teamData.dexterity;
+            Constitution = teamData.constitution;
+            Wisdom = teamData.wisdom;
+            Perception = teamData.perception;
+
+            // Calculate derived stats based on new base stats
+            MaxHealth = Mathf.Max(10, 10 + (Constitution - 10) * 2 + (Strength - 10) + (Dexterity - 10) / 2);
+            CurrentHealth = MaxHealth;
+            InitModifier = Dexterity - 10;
+            DamageModifier = (Strength - 10) / 2;
+            SpellModifier = Wisdom - 10;
+            MovementSpeed = 30 + (int)(Mathf.Ceil((Dexterity - 10) / 5.0f) * 5);
+            ArmorClass = 10 + (Dexterity - 10) / 2 + (Constitution - 10) / 3;
+
+            Debug.Log($"Applied team stats to {CharacterName}: STR:{Strength} DEX:{Dexterity} CON:{Constitution} WIS:{Wisdom} PER:{Perception}");
+        }
+        // Handle EnemyCombatData
+        else if (combatData is CombatDataTransfer.EnemyCombatData enemyData)
+        {
+            CharacterName = enemyData.enemyName;
+            // Apply enemy stats (you may want to add these fields to EnemyCombatData)
+            // For now, keep the initialized stats but update the name
+            Debug.Log($"Applied enemy data to {CharacterName}");
+        }
+        else
+        {
+            Debug.LogWarning($"Unknown combat data type for {CharacterName}");
+        }
+    }
+
     public Weapon GetEquippedWeapon()
     {
         return spawnedWeapon;

+ 427 - 0
Assets/Scripts/Objects/CharacterCarryCapacity.cs

@@ -0,0 +1,427 @@
+using UnityEngine;
+using System.Collections.Generic;
+using System.Linq;
+
+/// <summary>
+/// Manages character carry capacity and item weights
+/// Provides penalties for exceeding carry limits
+/// </summary>
+[System.Serializable]
+public class CarryCapacitySystem
+{
+    [Header("Base Capacity Settings")]
+    [Tooltip("Base carry capacity in pounds")]
+    public int baseCarryCapacity = 50;
+
+    [Tooltip("How much strength affects carry capacity")]
+    public float strengthMultiplier = 5f;
+
+    [Header("Encumbrance Thresholds")]
+    [Tooltip("Light load threshold (fraction of max capacity)")]
+    [Range(0f, 1f)]
+    public float lightLoadThreshold = 0.33f;
+
+    [Tooltip("Medium load threshold (fraction of max capacity)")]
+    [Range(0f, 1f)]
+    public float mediumLoadThreshold = 0.66f;
+
+    [Header("Encumbrance Penalties")]
+    [Tooltip("Movement speed penalty for medium load (%)")]
+    [Range(0f, 1f)]
+    public float mediumLoadMovementPenalty = 0.25f;
+
+    [Tooltip("Movement speed penalty for heavy load (%)")]
+    [Range(0f, 1f)]
+    public float heavyLoadMovementPenalty = 0.5f;
+
+    [Tooltip("Dexterity penalty for heavy load")]
+    public int heavyLoadDexterityPenalty = 3;
+
+    public enum EncumbranceLevel
+    {
+        Light,      // 0-33% capacity
+        Medium,     // 34-66% capacity
+        Heavy,      // 67-100% capacity
+        Overloaded  // 100%+ capacity
+    }
+
+    /// <summary>
+    /// Calculate maximum carry capacity for a character based on strength
+    /// </summary>
+    public int CalculateMaxCapacity(int strength)
+    {
+        return baseCarryCapacity + Mathf.RoundToInt(strength * strengthMultiplier);
+    }
+
+    /// <summary>
+    /// Get current encumbrance level based on carried weight and capacity
+    /// </summary>
+    public EncumbranceLevel GetEncumbranceLevel(int currentWeight, int maxCapacity)
+    {
+        if (currentWeight > maxCapacity)
+            return EncumbranceLevel.Overloaded;
+
+        float loadRatio = (float)currentWeight / maxCapacity;
+
+        if (loadRatio <= lightLoadThreshold)
+            return EncumbranceLevel.Light;
+        else if (loadRatio <= mediumLoadThreshold)
+            return EncumbranceLevel.Medium;
+        else
+            return EncumbranceLevel.Heavy;
+    }
+
+    /// <summary>
+    /// Get movement speed modifier based on encumbrance
+    /// </summary>
+    public float GetMovementSpeedModifier(EncumbranceLevel encumbrance)
+    {
+        switch (encumbrance)
+        {
+            case EncumbranceLevel.Light:
+                return 1.0f; // No penalty
+            case EncumbranceLevel.Medium:
+                return 1.0f - mediumLoadMovementPenalty;
+            case EncumbranceLevel.Heavy:
+                return 1.0f - heavyLoadMovementPenalty;
+            case EncumbranceLevel.Overloaded:
+                return 0.25f; // Severe penalty for being overloaded
+            default:
+                return 1.0f;
+        }
+    }
+
+    /// <summary>
+    /// Get dexterity modifier based on encumbrance
+    /// </summary>
+    public int GetDexterityModifier(EncumbranceLevel encumbrance)
+    {
+        switch (encumbrance)
+        {
+            case EncumbranceLevel.Light:
+            case EncumbranceLevel.Medium:
+                return 0; // No penalty
+            case EncumbranceLevel.Heavy:
+                return -heavyLoadDexterityPenalty;
+            case EncumbranceLevel.Overloaded:
+                return -heavyLoadDexterityPenalty * 2; // Double penalty
+            default:
+                return 0;
+        }
+    }
+
+    /// <summary>
+    /// Get encumbrance status description
+    /// </summary>
+    public string GetEncumbranceDescription(EncumbranceLevel encumbrance)
+    {
+        switch (encumbrance)
+        {
+            case EncumbranceLevel.Light:
+                return "Light Load - No penalties";
+            case EncumbranceLevel.Medium:
+                return $"Medium Load - {mediumLoadMovementPenalty * 100:F0}% movement penalty";
+            case EncumbranceLevel.Heavy:
+                return $"Heavy Load - {heavyLoadMovementPenalty * 100:F0}% movement, -{heavyLoadDexterityPenalty} DEX penalty";
+            case EncumbranceLevel.Overloaded:
+                return $"Overloaded! - Severe penalties, consider dropping items";
+            default:
+                return "Unknown";
+        }
+    }
+}
+
+/// <summary>
+/// Component for managing a character's carry capacity and current load
+/// Attach to Character objects that need inventory weight management
+/// </summary>
+public class CharacterCarryCapacity : MonoBehaviour
+{
+    [Header("Carry Capacity System")]
+    public CarryCapacitySystem carrySystem = new CarryCapacitySystem();
+
+    [Header("Current Load Info (Read-Only)")]
+    [SerializeField] private int currentWeight = 0;
+    [SerializeField] private int maxCapacity = 0;
+    [SerializeField] private CarryCapacitySystem.EncumbranceLevel currentEncumbrance = CarryCapacitySystem.EncumbranceLevel.Light;
+
+    [Header("Debug")]
+    public bool showDebugInfo = true;
+
+    private Character character;
+    private Inventory inventory;
+
+    // Events
+    public event System.Action<CarryCapacitySystem.EncumbranceLevel> OnEncumbranceChanged;
+
+    void Start()
+    {
+        character = GetComponent<Character>();
+        inventory = GetComponent<Inventory>();
+
+        if (character == null)
+        {
+            Debug.LogError($"CharacterCarryCapacity requires a Character component on {gameObject.name}");
+            enabled = false;
+            return;
+        }
+
+        UpdateCapacity();
+    }
+
+    /// <summary>
+    /// Update maximum capacity based on current strength
+    /// </summary>
+    public void UpdateCapacity()
+    {
+        if (character == null) return;
+
+        maxCapacity = carrySystem.CalculateMaxCapacity(character.Strength);
+        UpdateCurrentWeight();
+
+        if (showDebugInfo)
+            Debug.Log($"📦 {character.CharacterName} capacity: {currentWeight}/{maxCapacity} lbs ({currentEncumbrance})");
+    }
+
+    /// <summary>
+    /// Update current weight by calculating all carried items
+    /// </summary>
+    public void UpdateCurrentWeight()
+    {
+        currentWeight = CalculateTotalWeight();
+
+        var previousEncumbrance = currentEncumbrance;
+        currentEncumbrance = carrySystem.GetEncumbranceLevel(currentWeight, maxCapacity);
+
+        if (previousEncumbrance != currentEncumbrance)
+        {
+            OnEncumbranceChanged?.Invoke(currentEncumbrance);
+
+            if (showDebugInfo)
+                Debug.Log($"📦 {character.CharacterName} encumbrance changed to: {carrySystem.GetEncumbranceDescription(currentEncumbrance)}");
+        }
+    }
+
+    /// <summary>
+    /// Calculate total weight of all carried items
+    /// </summary>
+    private int CalculateTotalWeight()
+    {
+        int totalWeight = 0;
+
+        // Calculate inventory weight if available
+        if (inventory != null)
+        {
+            totalWeight += CalculateInventoryWeight();
+        }
+
+        // Calculate equipped item weight
+        totalWeight += CalculateEquippedWeight();
+
+        return totalWeight;
+    }
+
+    /// <summary>
+    /// Calculate weight of items in inventory
+    /// </summary>
+    private int CalculateInventoryWeight()
+    {
+        int weight = 0;
+
+        // Weapons
+        foreach (var slot in inventory.Weapons)
+        {
+            if (slot.item is WeaponItem weapon)
+            {
+                weight += GetItemWeight(weapon) * slot.quantity;
+            }
+        }
+
+        // Armor
+        foreach (var slot in inventory.Armor)
+        {
+            if (slot.item is ArmorItem armor && !slot.isEquipped) // Don't count equipped armor twice
+            {
+                weight += GetItemWeight(armor) * slot.quantity;
+            }
+        }
+
+        // Miscellaneous items
+        foreach (var slot in inventory.Miscellaneous)
+        {
+            if (slot.item is MiscellaneousItem misc)
+            {
+                weight += GetItemWeight(misc) * slot.quantity;
+            }
+        }
+
+        return weight;
+    }
+
+    /// <summary>
+    /// Calculate weight of equipped items
+    /// </summary>
+    private int CalculateEquippedWeight()
+    {
+        int weight = 0;
+
+        if (inventory != null)
+        {
+            // Equipped weapon
+            if (inventory.EquippedWeapon != null)
+            {
+                weight += GetItemWeight(inventory.EquippedWeapon);
+            }
+
+            // Equipped armor
+            var equippedArmor = inventory.GetEquippedArmor();
+            foreach (var armor in equippedArmor)
+            {
+                weight += GetItemWeight(armor);
+            }
+        }
+
+        return weight;
+    }
+
+    /// <summary>
+    /// Get weight of a specific item (with fallback values)
+    /// </summary>
+    private int GetItemWeight(Item item)
+    {
+        // TODO: When items get weight properties, use those
+        // For now, use reasonable defaults based on item type
+
+        if (item is WeaponItem weapon)
+        {
+            return GetWeaponWeight(weapon.itemName);
+        }
+        else if (item is ArmorItem armor)
+        {
+            return GetArmorWeight(armor.itemName, armor.armorType);
+        }
+        else if (item is MiscellaneousItem misc)
+        {
+            return GetMiscWeight(misc.itemName);
+        }
+
+        return 1; // Default weight
+    }
+
+    /// <summary>
+    /// Get weapon weight based on name/type
+    /// </summary>
+    private int GetWeaponWeight(string weaponName)
+    {
+        string lower = weaponName.ToLower();
+
+        if (lower.Contains("dagger") || lower.Contains("knife"))
+            return 1;
+        else if (lower.Contains("sword") || lower.Contains("axe"))
+            return 3;
+        else if (lower.Contains("bow"))
+            return 2;
+        else if (lower.Contains("staff") || lower.Contains("wand"))
+            return 2;
+        else if (lower.Contains("hammer") || lower.Contains("mace"))
+            return 4;
+        else if (lower.Contains("fist") || lower.Contains("unarmed"))
+            return 0;
+
+        return 3; // Default sword weight
+    }
+
+    /// <summary>
+    /// Get armor weight based on type
+    /// </summary>
+    private int GetArmorWeight(string armorName, ArmorType armorType)
+    {
+        switch (armorType)
+        {
+            case ArmorType.Light:
+                return 5;
+            case ArmorType.Medium:
+                return 15;
+            case ArmorType.Heavy:
+                return 25;
+            case ArmorType.Shield:
+                return 3;
+            default:
+                return 10;
+        }
+    }
+
+    /// <summary>
+    /// Get miscellaneous item weight
+    /// </summary>
+    private int GetMiscWeight(string itemName)
+    {
+        string lower = itemName.ToLower();
+
+        if (lower.Contains("potion") || lower.Contains("scroll"))
+            return 0; // Negligible weight
+        else if (lower.Contains("rope"))
+            return 10;
+        else if (lower.Contains("torch"))
+            return 1;
+        else if (lower.Contains("ration") || lower.Contains("bread"))
+            return 2;
+        else if (lower.Contains("bandage"))
+            return 0;
+        else if (lower.Contains("tool"))
+            return 5;
+
+        return 1; // Default misc weight
+    }
+
+    /// <summary>
+    /// Check if character can carry additional weight
+    /// </summary>
+    public bool CanCarryWeight(int additionalWeight)
+    {
+        return (currentWeight + additionalWeight) <= maxCapacity;
+    }
+
+    /// <summary>
+    /// Get available carrying capacity
+    /// </summary>
+    public int GetAvailableCapacity()
+    {
+        return Mathf.Max(0, maxCapacity - currentWeight);
+    }
+
+    /// <summary>
+    /// Get current movement speed modifier due to encumbrance
+    /// </summary>
+    public float GetMovementSpeedModifier()
+    {
+        return carrySystem.GetMovementSpeedModifier(currentEncumbrance);
+    }
+
+    /// <summary>
+    /// Get current dexterity modifier due to encumbrance
+    /// </summary>
+    public int GetDexterityModifier()
+    {
+        return carrySystem.GetDexterityModifier(currentEncumbrance);
+    }
+
+    /// <summary>
+    /// Get encumbrance info for UI display
+    /// </summary>
+    public string GetEncumbranceInfo()
+    {
+        return $"{currentWeight}/{maxCapacity} lbs - {carrySystem.GetEncumbranceDescription(currentEncumbrance)}";
+    }
+
+    // Properties for external access
+    public int CurrentWeight => currentWeight;
+    public int MaxCapacity => maxCapacity;
+    public CarryCapacitySystem.EncumbranceLevel CurrentEncumbrance => currentEncumbrance;
+
+    // Manual weight update for when inventory changes
+    public void RefreshWeight()
+    {
+        UpdateCurrentWeight();
+    }
+}

+ 656 - 0
Assets/Scripts/UI/GameOverScreen.cs

@@ -0,0 +1,656 @@
+using UnityEngine;
+using UnityEngine.UIElements;
+using System.Collections.Generic;
+using System.Linq;
+#if UNITY_EDITOR
+using UnityEditor;
+#endif
+
+/// <summary>
+/// Manages the Game Over screen with statistics and final results using UI Toolkit
+/// Shows when all player characters die
+/// </summary>
+public class GameOverScreen : MonoBehaviour
+{
+    [Header("UI Toolkit Settings")]
+    public UIDocument uiDocument;
+    public VisualTreeAsset gameOverTemplate;
+    public PanelSettings panelSettings;
+
+    [Header("Statistics Settings")]
+    public bool showDetailedStats = true;
+
+    [Header("Audio")]
+    public AudioClip gameOverMusic;
+    public AudioClip defeatSound;
+
+    private GameStatistics gameStats;
+    private VisualElement rootElement;
+
+    [System.Serializable]
+    public class GameStatistics
+    {
+        [Header("Time & Travel")]
+        public float totalPlayTime = 0f;
+        public float totalTravelTime = 0f;
+        public int daysTravaeled = 0;
+        public int locationsVisited = 0;
+
+        [Header("Combat")]
+        public int battlesWon = 0;
+        public int battlesLost = 0;
+        public int enemiesSlain = 0;
+        public int totalDamageDealt = 0;
+        public int totalDamageTaken = 0;
+
+        [Header("Social & Quests")]
+        public int peopleHelped = 0;
+        public int peopleSaved = 0;
+        public int questsCompleted = 0;
+        public int questsFailed = 0;
+
+        [Header("Character Development")]
+        public int finalFameLevel = 0;
+        public int totalExperienceGained = 0;
+        public int levelsGained = 0;
+
+        [Header("Economic")]
+        public int totalGoldEarned = 0;
+        public int totalGoldSpent = 0;
+        public int itemsBought = 0;
+        public int itemsSold = 0;
+
+        [Header("Survival")]
+        public int charactersLost = 0;
+        public int timesRested = 0;
+        public int healthPotionsUsed = 0;
+
+        public GameStatistics()
+        {
+            // Initialize with default values
+        }
+
+        /// <summary>
+        /// Calculate derived statistics
+        /// </summary>
+        public int GetTotalBattles() => battlesWon + battlesLost;
+        public float GetWinRate() => GetTotalBattles() > 0 ? (float)battlesWon / GetTotalBattles() * 100f : 0f;
+        public int GetNetGold() => totalGoldEarned - totalGoldSpent;
+        public float GetDamageRatio() => totalDamageTaken > 0 ? (float)totalDamageDealt / totalDamageTaken : 0f;
+    }
+
+    void Awake()
+    {
+        // Initialize game statistics
+        gameStats = new GameStatistics();
+
+        // Set up UI Document component
+        SetupUIDocument();
+
+        if (uiDocument != null && uiDocument.visualTreeAsset != null)
+        {
+            rootElement = uiDocument.rootVisualElement;
+
+            // Hide game over panel initially
+            if (rootElement != null)
+                rootElement.style.display = DisplayStyle.None;
+
+            // Set up button events
+            SetupUICallbacks();
+        }
+    }
+
+    /// <summary>
+    /// Set up the UIDocument component with proper references
+    /// </summary>
+    private void SetupUIDocument()
+    {
+        // Get or create UIDocument component
+        if (uiDocument == null)
+            uiDocument = GetComponent<UIDocument>();
+
+        if (uiDocument == null)
+            uiDocument = gameObject.AddComponent<UIDocument>();
+
+        // Load the UXML template if not assigned
+        if (gameOverTemplate == null)
+        {
+            gameOverTemplate = Resources.Load<VisualTreeAsset>("UI/BattleSceneUI/GameOverScreen");
+            if (gameOverTemplate == null)
+            {
+#if UNITY_EDITOR
+                // Try alternative path in editor
+                gameOverTemplate = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>("Assets/UI/BattleSceneUI/GameOverScreen.uxml");
+#endif
+            }
+        }
+
+        // Load panel settings if not assigned
+        if (panelSettings == null)
+        {
+            panelSettings = Resources.Load<PanelSettings>("MainSettings");
+            if (panelSettings == null)
+            {
+                // Try alternative panel settings
+                panelSettings = Resources.Load<PanelSettings>("UI/TravelPanelSettings");
+                if (panelSettings == null)
+                {
+                    // Try to find any PanelSettings in the project
+                    var allPanelSettings = Resources.FindObjectsOfTypeAll<PanelSettings>();
+                    if (allPanelSettings.Length > 0)
+                        panelSettings = allPanelSettings[0];
+                }
+            }
+        }
+
+        // Configure the UIDocument
+        if (uiDocument != null)
+        {
+            uiDocument.visualTreeAsset = gameOverTemplate;
+            uiDocument.panelSettings = panelSettings;
+
+            // Load and apply stylesheet
+            var stylesheet = Resources.Load<StyleSheet>("UI/BattleSceneUI/GameOverScreen");
+            if (stylesheet == null)
+            {
+#if UNITY_EDITOR
+                stylesheet = AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/UI/BattleSceneUI/GameOverScreen.uss");
+#endif
+            }
+            if (stylesheet != null && uiDocument.rootVisualElement != null)
+            {
+                uiDocument.rootVisualElement.styleSheets.Add(stylesheet);
+            }
+
+            if (gameOverTemplate == null)
+            {
+                Debug.LogError("GameOverScreen: Could not load GameOverScreen.uxml template!");
+            }
+
+            if (panelSettings == null)
+            {
+                Debug.LogWarning("GameOverScreen: No PanelSettings found. UI may not display correctly.");
+            }
+        }
+    }
+
+    /// <summary>
+    /// Set up UI element callbacks for the game over interface
+    /// </summary>
+    private void SetupUICallbacks()
+    {
+        if (rootElement == null) return;
+
+        // Set up Restart Game button
+        var restartButton = rootElement.Q<Button>("RestartButton");
+        if (restartButton != null)
+        {
+            restartButton.clicked += RestartGame;
+        }
+
+        // Set up Main Menu button
+        var mainMenuButton = rootElement.Q<Button>("MainMenuButton");
+        if (mainMenuButton != null)
+        {
+            mainMenuButton.clicked += ReturnToMainMenu;
+        }
+
+        // Set up keyboard input for space key (restart)
+        rootElement.RegisterCallback<KeyDownEvent>(OnKeyDown);
+
+        // Make sure the root element can receive focus for keyboard events
+        rootElement.focusable = true;
+    }
+
+    /// <summary>
+    /// Handle keyboard input for the game over UI
+    /// </summary>
+    private void OnKeyDown(KeyDownEvent evt)
+    {
+        if (evt.keyCode == KeyCode.Space || evt.keyCode == KeyCode.Return)
+        {
+            RestartGame();
+        }
+        else if (evt.keyCode == KeyCode.Escape)
+        {
+            ReturnToMainMenu();
+        }
+    }
+
+    /// <summary>
+    /// Show the game over screen with current statistics
+    /// </summary>
+    public void ShowGameOver(List<GameObject> defeatedPlayers = null)
+    {
+        // Calculate final statistics
+        CalculateFinalStatistics(defeatedPlayers);
+
+        // Show the panel
+        if (rootElement != null)
+        {
+            rootElement.style.display = DisplayStyle.Flex;
+            rootElement.Focus(); // Allow keyboard input
+            Time.timeScale = 0f; // Pause the game
+        }
+
+        // Update UI elements
+        UpdateGameOverUI();
+
+        // Play audio
+        PlayGameOverAudio();
+
+        Debug.Log("💀 Game Over screen displayed");
+    }
+
+    /// <summary>
+    /// Calculate final statistics before showing game over
+    /// </summary>
+    private void CalculateFinalStatistics(List<GameObject> defeatedPlayers)
+    {
+        // Calculate total play time
+        gameStats.totalPlayTime = Time.time;
+
+        // Calculate characters lost
+        if (defeatedPlayers != null)
+        {
+            gameStats.charactersLost = defeatedPlayers.Count;
+        }
+
+        // Try to get additional stats from game systems
+        GatherStatisticsFromSystems();
+
+        Debug.Log($"💀 Final statistics calculated - {gameStats.enemiesSlain} enemies slain, {gameStats.battlesWon} battles won");
+    }
+
+    /// <summary>
+    /// Gather statistics from various game systems
+    /// </summary>
+    private void GatherStatisticsFromSystems()
+    {
+        // Try to get stats from GameManager if available
+        var gameManager = GameManager.Instance;
+        if (gameManager != null)
+        {
+            // Count enemies slain (this battle)
+            var allEnemies = gameManager.enemyCharacters;
+            gameStats.enemiesSlain += allEnemies.Count(enemy =>
+            {
+                var character = enemy?.GetComponent<Character>();
+                return character != null && character.IsDead;
+            });
+        }
+
+        // Try to get travel statistics
+        GatherTravelStatistics();
+
+        // Try to get combat statistics
+        GatherCombatStatistics();
+
+        // Try to get social statistics
+        GatherSocialStatistics();
+    }
+
+    /// <summary>
+    /// Gather travel-related statistics
+    /// </summary>
+    private void GatherTravelStatistics()
+    {
+        // TODO: Integrate with travel system when available
+        // For now, use placeholder values
+        gameStats.daysTravaeled = Mathf.RoundToInt(gameStats.totalPlayTime / 60f); // Rough estimate
+        gameStats.locationsVisited = Random.Range(5, 15); // Placeholder
+    }
+
+    /// <summary>
+    /// Gather combat-related statistics
+    /// </summary>
+    private void GatherCombatStatistics()
+    {
+        // TODO: Integrate with combat statistics system when available
+        // For now, estimate based on current battle
+        gameStats.battlesLost = 1; // This battle was lost
+        gameStats.totalDamageDealt = Random.Range(50, 200); // Placeholder
+        gameStats.totalDamageTaken = Random.Range(100, 300); // Placeholder
+    }
+
+    /// <summary>
+    /// Gather social and quest statistics
+    /// </summary>
+    private void GatherSocialStatistics()
+    {
+        // TODO: Integrate with quest and social systems when available
+        gameStats.peopleHelped = Random.Range(0, 5); // Placeholder
+        gameStats.questsCompleted = Random.Range(0, 3); // Placeholder
+        gameStats.questsFailed = Random.Range(0, 2); // Placeholder
+        gameStats.finalFameLevel = Random.Range(1, 5); // Placeholder
+    }
+
+    /// <summary>
+    /// Update the game over UI with statistics using UI Toolkit
+    /// </summary>
+    private void UpdateGameOverUI()
+    {
+        if (rootElement == null) return;
+
+        // Update title
+        var titleLabel = rootElement.Q<Label>("GameOverTitle");
+        if (titleLabel != null)
+        {
+            titleLabel.text = "GAME OVER";
+        }
+
+        // Populate statistics sections
+        PopulateStatisticsUI();
+    }
+
+    /// <summary>
+    /// Populate all statistics sections in the UI
+    /// </summary>
+    private void PopulateStatisticsUI()
+    {
+        // Time & Travel Statistics
+        PopulateTimeAndTravelStats();
+
+        // Combat Statistics
+        PopulateCombatStats();
+
+        // Social & Quest Statistics
+        PopulateSocialStats();
+
+        // Assessment
+        PopulateAssessment();
+    }
+
+    /// <summary>
+    /// Populate time and travel statistics
+    /// </summary>
+    private void PopulateTimeAndTravelStats()
+    {
+        var playTimeLabel = rootElement.Q<Label>("PlayTimeValue");
+        if (playTimeLabel != null)
+            playTimeLabel.text = FormatTime(gameStats.totalPlayTime);
+
+        var daysLabel = rootElement.Q<Label>("DaysTraveledValue");
+        if (daysLabel != null)
+            daysLabel.text = gameStats.daysTravaeled.ToString();
+
+        var locationsLabel = rootElement.Q<Label>("LocationsVisitedValue");
+        if (locationsLabel != null)
+            locationsLabel.text = gameStats.locationsVisited.ToString();
+    }
+
+    /// <summary>
+    /// Populate combat statistics
+    /// </summary>
+    private void PopulateCombatStats()
+    {
+        var battlesWonLabel = rootElement.Q<Label>("BattlesWonValue");
+        if (battlesWonLabel != null)
+            battlesWonLabel.text = gameStats.battlesWon.ToString();
+
+        var battlesLostLabel = rootElement.Q<Label>("BattlesLostValue");
+        if (battlesLostLabel != null)
+            battlesLostLabel.text = gameStats.battlesLost.ToString();
+
+        var winRateLabel = rootElement.Q<Label>("WinRateValue");
+        if (winRateLabel != null)
+            winRateLabel.text = $"{gameStats.GetWinRate():F1}%";
+
+        var enemiesSlainLabel = rootElement.Q<Label>("EnemiesSlainValue");
+        if (enemiesSlainLabel != null)
+            enemiesSlainLabel.text = gameStats.enemiesSlain.ToString();
+
+        var damageDealtLabel = rootElement.Q<Label>("DamageDealtValue");
+        if (damageDealtLabel != null)
+            damageDealtLabel.text = gameStats.totalDamageDealt.ToString();
+
+        var damageTakenLabel = rootElement.Q<Label>("DamageTakenValue");
+        if (damageTakenLabel != null)
+            damageTakenLabel.text = gameStats.totalDamageTaken.ToString();
+
+        var charactersLostLabel = rootElement.Q<Label>("CharactersLostValue");
+        if (charactersLostLabel != null)
+            charactersLostLabel.text = gameStats.charactersLost.ToString();
+    }
+
+    /// <summary>
+    /// Populate social and quest statistics
+    /// </summary>
+    private void PopulateSocialStats()
+    {
+        var peopleHelpedLabel = rootElement.Q<Label>("PeopleHelpedValue");
+        if (peopleHelpedLabel != null)
+            peopleHelpedLabel.text = gameStats.peopleHelped.ToString();
+
+        var livesSavedLabel = rootElement.Q<Label>("LivesSavedValue");
+        if (livesSavedLabel != null)
+            livesSavedLabel.text = gameStats.peopleSaved.ToString();
+
+        var questsCompletedLabel = rootElement.Q<Label>("QuestsCompletedValue");
+        if (questsCompletedLabel != null)
+            questsCompletedLabel.text = gameStats.questsCompleted.ToString();
+
+        var questsFailedLabel = rootElement.Q<Label>("QuestsFailedValue");
+        if (questsFailedLabel != null)
+            questsFailedLabel.text = gameStats.questsFailed.ToString();
+
+        var fameLevelLabel = rootElement.Q<Label>("FameLevelValue");
+        if (fameLevelLabel != null)
+            fameLevelLabel.text = gameStats.finalFameLevel.ToString();
+
+        var goldEarnedLabel = rootElement.Q<Label>("GoldEarnedValue");
+        if (goldEarnedLabel != null)
+            goldEarnedLabel.text = gameStats.totalGoldEarned.ToString();
+
+        var goldSpentLabel = rootElement.Q<Label>("GoldSpentValue");
+        if (goldSpentLabel != null)
+            goldSpentLabel.text = gameStats.totalGoldSpent.ToString();
+
+        var netWorthLabel = rootElement.Q<Label>("NetWorthValue");
+        if (netWorthLabel != null)
+            netWorthLabel.text = gameStats.GetNetGold().ToString();
+    }
+
+    /// <summary>
+    /// Populate the final assessment section
+    /// </summary>
+    private void PopulateAssessment()
+    {
+        var assessmentLabel = rootElement.Q<Label>("AssessmentText");
+        if (assessmentLabel != null)
+            assessmentLabel.text = GetFinalMessage();
+    }
+
+    /// <summary>
+    /// Generate the statistics text for display
+    /// </summary>
+    private string GenerateStatisticsText()
+    {
+        var stats = new System.Text.StringBuilder();
+
+        stats.AppendLine("=== FINAL STATISTICS ===\n");
+
+        // Time & Travel
+        stats.AppendLine("📅 JOURNEY SUMMARY");
+        stats.AppendLine($"Total Play Time: {FormatTime(gameStats.totalPlayTime)}");
+        stats.AppendLine($"Days Traveled: {gameStats.daysTravaeled}");
+        stats.AppendLine($"Locations Visited: {gameStats.locationsVisited}");
+        stats.AppendLine();
+
+        // Combat
+        stats.AppendLine("⚔️ COMBAT RECORD");
+        stats.AppendLine($"Battles Won: {gameStats.battlesWon}");
+        stats.AppendLine($"Battles Lost: {gameStats.battlesLost}");
+        stats.AppendLine($"Win Rate: {gameStats.GetWinRate():F1}%");
+        stats.AppendLine($"Enemies Slain: {gameStats.enemiesSlain}");
+        if (showDetailedStats)
+        {
+            stats.AppendLine($"Damage Dealt: {gameStats.totalDamageDealt}");
+            stats.AppendLine($"Damage Taken: {gameStats.totalDamageTaken}");
+        }
+        stats.AppendLine();
+
+        // Social & Quests
+        stats.AppendLine("🤝 SOCIAL IMPACT");
+        stats.AppendLine($"People Helped: {gameStats.peopleHelped}");
+        stats.AppendLine($"Lives Saved: {gameStats.peopleSaved}");
+        stats.AppendLine($"Quests Completed: {gameStats.questsCompleted}");
+        stats.AppendLine($"Quests Failed: {gameStats.questsFailed}");
+        stats.AppendLine($"Final Fame Level: {gameStats.finalFameLevel}");
+        stats.AppendLine();
+
+        // Character Development
+        if (showDetailedStats)
+        {
+            stats.AppendLine("📈 CHARACTER GROWTH");
+            stats.AppendLine($"Experience Gained: {gameStats.totalExperienceGained}");
+            stats.AppendLine($"Levels Gained: {gameStats.levelsGained}");
+            stats.AppendLine($"Characters Lost: {gameStats.charactersLost}");
+            stats.AppendLine();
+        }
+
+        // Economic
+        stats.AppendLine("💰 ECONOMIC SUMMARY");
+        stats.AppendLine($"Gold Earned: {gameStats.totalGoldEarned}");
+        stats.AppendLine($"Gold Spent: {gameStats.totalGoldSpent}");
+        stats.AppendLine($"Net Worth: {gameStats.GetNetGold()}");
+
+        // Final message
+        stats.AppendLine();
+        stats.AppendLine(GetFinalMessage());
+
+        return stats.ToString();
+    }
+
+    /// <summary>
+    /// Get a final message based on performance
+    /// </summary>
+    private string GetFinalMessage()
+    {
+        float winRate = gameStats.GetWinRate();
+        int heroicScore = gameStats.peopleHelped + gameStats.peopleSaved + gameStats.questsCompleted;
+
+        if (winRate >= 80f && heroicScore >= 10)
+            return "You died as a legendary hero, remembered for ages!";
+        else if (winRate >= 60f && heroicScore >= 5)
+            return "You fought valiantly and helped many before falling.";
+        else if (gameStats.enemiesSlain >= 10)
+            return "Though you fell, your enemies remember your fierce combat.";
+        else if (heroicScore >= 3)
+            return "Your kind deeds will be remembered by those you helped.";
+        else if (gameStats.daysTravaeled >= 10)
+            return "You traveled far but met an unfortunate end.";
+        else
+            return "Your adventure was brief but not without purpose.";
+    }
+
+    /// <summary>
+    /// Format time in minutes and seconds
+    /// </summary>
+    private string FormatTime(float timeInSeconds)
+    {
+        int minutes = Mathf.FloorToInt(timeInSeconds / 60f);
+        int seconds = Mathf.FloorToInt(timeInSeconds % 60f);
+        return $"{minutes:D2}:{seconds:D2}";
+    }
+
+    /// <summary>
+    /// Play game over audio
+    /// </summary>
+    private void PlayGameOverAudio()
+    {
+        var audioSource = GetComponent<AudioSource>();
+        if (audioSource != null)
+        {
+            if (defeatSound != null)
+            {
+                audioSource.PlayOneShot(defeatSound);
+            }
+
+            if (gameOverMusic != null)
+            {
+                audioSource.clip = gameOverMusic;
+                audioSource.loop = true;
+                audioSource.Play();
+            }
+        }
+    }
+
+    /// <summary>
+    /// Restart the game
+    /// </summary>
+    private void RestartGame()
+    {
+        Time.timeScale = 1f; // Resume time
+        Debug.Log("💀 Restarting game...");
+
+        // TODO: Implement proper game restart logic
+        // For now, reload the current scene
+        UnityEngine.SceneManagement.SceneManager.LoadScene(
+            UnityEngine.SceneManagement.SceneManager.GetActiveScene().name
+        );
+    }
+
+    /// <summary>
+    /// Return to main menu
+    /// </summary>
+    private void ReturnToMainMenu()
+    {
+        Time.timeScale = 1f; // Resume time
+        Debug.Log("💀 Returning to main menu...");
+
+        // TODO: Load main menu scene
+        // For now, just hide the game over screen
+        if (rootElement != null)
+            rootElement.style.display = DisplayStyle.None;
+    }
+
+    /// <summary>
+    /// Hide the game over screen (for testing)
+    /// </summary>
+    public void HideGameOver()
+    {
+        if (rootElement != null)
+            rootElement.style.display = DisplayStyle.None;
+        Time.timeScale = 1f;
+    }
+
+    /// <summary>
+    /// Update a specific statistic
+    /// </summary>
+    public void UpdateStatistic(string statName, int value)
+    {
+        switch (statName.ToLower())
+        {
+            case "enemiesslain":
+                gameStats.enemiesSlain += value;
+                break;
+            case "battlewon":
+                gameStats.battlesWon += value;
+                break;
+            case "battleslost":
+                gameStats.battlesLost += value;
+                break;
+            case "peoplehelped":
+                gameStats.peopleHelped += value;
+                break;
+            case "questscompleted":
+                gameStats.questsCompleted += value;
+                break;
+            case "goldearned":
+                gameStats.totalGoldEarned += value;
+                break;
+            default:
+                Debug.LogWarning($"Unknown statistic: {statName}");
+                break;
+        }
+    }
+
+    /// <summary>
+    /// Get current statistics (for external access)
+    /// </summary>
+    public GameStatistics GetStatistics()
+    {
+        return gameStats;
+    }
+}

+ 5 - 0
Assets/Scripts/UI/QuickShopSetup.cs

@@ -18,6 +18,11 @@ public class QuickShopSetup : MonoBehaviour
     [SerializeField] private bool shopSetupComplete = false;
     [SerializeField] private string statusMessage = "Not setup yet";
 
+    /// <summary>
+    /// Gets the current status message for debugging purposes
+    /// </summary>
+    public string GetStatusMessage() => statusMessage;
+
     void Start()
     {
         if (autoSetupOnStart)

+ 171 - 0
Assets/UI/BattleSceneUI/GameOverScreen.uss

@@ -0,0 +1,171 @@
+/* Clean Game Over Screen Styles - Unity UI Toolkit Compatible */
+
+/* Main Overlay */
+.gameover-overlay {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(30, 0, 0, 0.9);
+    justify-content: center;
+    align-items: center;
+}
+
+.gameover-background {
+    background-color: rgba(40, 20, 20, 0.95);
+    border-width: 2px;
+    border-color: rgb(160, 60, 60);
+    border-radius: 15px;
+    padding: 30px;
+    width: 85%;
+    max-width: 1000px;
+    max-height: 90%;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+/* Header */
+.gameover-title {
+    font-size: 42px;
+    color: rgb(255, 80, 80);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.gameover-subtitle {
+    font-size: 18px;
+    color: rgb(200, 150, 150);
+    margin-bottom: 20px;
+    -unity-text-align: center;
+    -unity-font-style: italic;
+}
+
+/* Main Content */
+.main-content {
+    flex-grow: 1;
+    flex-direction: row;
+    justify-content: space-between;
+}
+
+.statistics-section {
+    flex-grow: 1;
+    background-color: rgba(50, 30, 30, 0.7);
+    border-radius: 10px;
+    padding: 20px;
+    margin-right: 10px;
+}
+
+.assessment-section {
+    width: 30%;
+    background-color: rgba(60, 25, 25, 0.7);
+    border-radius: 10px;
+    padding: 20px;
+    margin-left: 10px;
+}
+
+.section-title {
+    font-size: 20px;
+    color: rgb(255, 150, 150);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+/* Statistics Categories */
+.stats-category {
+    margin-bottom: 20px;
+    padding: 15px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 8px;
+}
+
+.category-title {
+    font-size: 16px;
+    color: rgb(255, 200, 100);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.stat-row {
+    flex-direction: row;
+    justify-content: space-between;
+    margin-bottom: 5px;
+    padding: 2px 0;
+}
+
+.stat-label {
+    font-size: 14px;
+    color: rgb(200, 180, 180);
+    flex-grow: 1;
+}
+
+.stat-value {
+    font-size: 14px;
+    color: rgb(255, 255, 255);
+    -unity-text-align: right;
+    -unity-font-style: bold;
+}
+
+/* Assessment */
+.assessment-title {
+    font-size: 18px;
+    color: rgb(255, 150, 150);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.assessment-text {
+    font-size: 16px;
+    color: rgb(220, 200, 200);
+    margin-bottom: 20px;
+    -unity-text-align: center;
+    white-space: normal;
+}
+
+/* Footer Buttons */
+.footer-section {
+    align-items: center;
+    margin-top: 20px;
+}
+
+.button-container {
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+}
+
+.action-button {
+    min-width: 140px;
+    height: 45px;
+    margin: 0 15px;
+    border-radius: 22px;
+    font-size: 16px;
+    -unity-font-style: bold;
+    cursor: pointer;
+}
+
+.restart-button {
+    background-color: rgb(100, 60, 60);
+    border-color: rgb(140, 80, 80);
+    color: rgb(255, 255, 255);
+}
+
+.restart-button:hover {
+    background-color: rgb(140, 80, 80);
+    border-color: rgb(180, 100, 100);
+}
+
+.menu-button {
+    background-color: rgb(60, 60, 100);
+    border-color: rgb(80, 80, 140);
+    color: rgb(255, 255, 255);
+}
+
+.menu-button:hover {
+    background-color: rgb(80, 80, 140);
+    border-color: rgb(100, 100, 180);
+}

+ 139 - 0
Assets/UI/BattleSceneUI/GameOverScreen.uxml

@@ -0,0 +1,139 @@
+<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
+    
+    <!-- Full Screen Overlay -->
+    <ui:VisualElement name="GameOverOverlay" class="gameover-overlay">
+        <!-- Background Panel -->
+        <ui:VisualElement name="GameOverBackground" class="gameover-background">
+            
+            <!-- Header Section -->
+            <ui:VisualElement name="HeaderSection" class="header-section">
+                <ui:Label text="GAME OVER" display-tooltip-when-elided="true" name="GameOverTitle" class="gameover-title" />
+                <ui:Label text="All heroes have fallen..." display-tooltip-when-elided="true" name="GameOverSubtitle" class="gameover-subtitle" />
+            </ui:VisualElement>
+            
+            <!-- Main Content Section -->
+            <ui:VisualElement name="MainContent" class="main-content">
+                
+                <!-- Statistics Section -->
+                <ui:VisualElement name="StatisticsSection" class="statistics-section">
+                    <ui:Label text="Journey Statistics" display-tooltip-when-elided="true" name="StatisticsTitle" class="section-title" />
+                    <ui:ScrollView name="StatisticsList" class="statistics-list">
+                        
+                        <!-- Time & Travel Stats -->
+                        <ui:VisualElement name="TimeSection" class="stats-category">
+                            <ui:Label text="Time &amp; Travel" display-tooltip-when-elided="true" name="TimeSectionTitle" class="category-title" />
+                            <ui:VisualElement name="TimeStats" class="stat-group">
+                                <ui:VisualElement name="PlayTimeRow" class="stat-row">
+                                    <ui:Label text="Total Play Time:" display-tooltip-when-elided="true" name="PlayTimeLabel" class="stat-label" />
+                                    <ui:Label text="0h 0m" display-tooltip-when-elided="true" name="PlayTimeValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="TravelTimeRow" class="stat-row">
+                                    <ui:Label text="Time Traveling:" display-tooltip-when-elided="true" name="TravelTimeLabel" class="stat-label" />
+                                    <ui:Label text="0h 0m" display-tooltip-when-elided="true" name="TravelTimeValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="DaysTraveledRow" class="stat-row">
+                                    <ui:Label text="Days Traveled:" display-tooltip-when-elided="true" name="DaysTraveledLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="DaysTraveledValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="LocationsRow" class="stat-row">
+                                    <ui:Label text="Locations Visited:" display-tooltip-when-elided="true" name="LocationsLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="LocationsVisitedValue" class="stat-value" />
+                                </ui:VisualElement>
+                            </ui:VisualElement>
+                        </ui:VisualElement>
+                        
+                        <!-- Combat Stats -->
+                        <ui:VisualElement name="CombatSection" class="stats-category">
+                            <ui:Label text="Combat" display-tooltip-when-elided="true" name="CombatSectionTitle" class="category-title" />
+                            <ui:VisualElement name="CombatStats" class="stat-group">
+                                <ui:VisualElement name="BattlesWonRow" class="stat-row">
+                                    <ui:Label text="Battles Won:" display-tooltip-when-elided="true" name="BattlesWonLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="BattlesWonValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="BattlesLostRow" class="stat-row">
+                                    <ui:Label text="Battles Lost:" display-tooltip-when-elided="true" name="BattlesLostLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="BattlesLostValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="WinRateRow" class="stat-row">
+                                    <ui:Label text="Win Rate:" display-tooltip-when-elided="true" name="WinRateLabel" class="stat-label" />
+                                    <ui:Label text="0%" display-tooltip-when-elided="true" name="WinRateValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="EnemiesSlainRow" class="stat-row">
+                                    <ui:Label text="Enemies Slain:" display-tooltip-when-elided="true" name="EnemiesSlainLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="EnemiesSlainValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="DamageDealtRow" class="stat-row">
+                                    <ui:Label text="Damage Dealt:" display-tooltip-when-elided="true" name="DamageDealtLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="DamageDealtValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="DamageTakenRow" class="stat-row">
+                                    <ui:Label text="Damage Taken:" display-tooltip-when-elided="true" name="DamageTakenLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="DamageTakenValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="CharactersLostRow" class="stat-row">
+                                    <ui:Label text="Characters Lost:" display-tooltip-when-elided="true" name="CharactersLostLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="CharactersLostValue" class="stat-value" />
+                                </ui:VisualElement>
+                            </ui:VisualElement>
+                        </ui:VisualElement>
+                        
+                        <!-- Social & Quests Stats -->
+                        <ui:VisualElement name="SocialSection" class="stats-category">
+                            <ui:Label text="Social &amp; Quests" display-tooltip-when-elided="true" name="SocialSectionTitle" class="category-title" />
+                            <ui:VisualElement name="SocialStats" class="stat-group">
+                                <ui:VisualElement name="PeopleHelpedRow" class="stat-row">
+                                    <ui:Label text="People Helped:" display-tooltip-when-elided="true" name="PeopleHelpedLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="PeopleHelpedValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="LivesSavedRow" class="stat-row">
+                                    <ui:Label text="Lives Saved:" display-tooltip-when-elided="true" name="LivesSavedLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="LivesSavedValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="QuestsCompletedRow" class="stat-row">
+                                    <ui:Label text="Quests Completed:" display-tooltip-when-elided="true" name="QuestsCompletedLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="QuestsCompletedValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="QuestsFailedRow" class="stat-row">
+                                    <ui:Label text="Quests Failed:" display-tooltip-when-elided="true" name="QuestsFailedLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="QuestsFailedValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="FameLevelRow" class="stat-row">
+                                    <ui:Label text="Fame Level:" display-tooltip-when-elided="true" name="FameLevelLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="FameLevelValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="GoldEarnedRow" class="stat-row">
+                                    <ui:Label text="Gold Earned:" display-tooltip-when-elided="true" name="GoldEarnedLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="GoldEarnedValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="GoldSpentRow" class="stat-row">
+                                    <ui:Label text="Gold Spent:" display-tooltip-when-elided="true" name="GoldSpentLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="GoldSpentValue" class="stat-value" />
+                                </ui:VisualElement>
+                                <ui:VisualElement name="NetWorthRow" class="stat-row">
+                                    <ui:Label text="Net Worth:" display-tooltip-when-elided="true" name="NetWorthLabel" class="stat-label" />
+                                    <ui:Label text="0" display-tooltip-when-elided="true" name="NetWorthValue" class="stat-value" />
+                                </ui:VisualElement>
+                            </ui:VisualElement>
+                        </ui:VisualElement>
+                    </ui:ScrollView>
+                </ui:VisualElement>
+                
+                <!-- Final Assessment Section -->
+                <ui:VisualElement name="AssessmentSection" class="assessment-section">
+                    <ui:Label text="Final Assessment" display-tooltip-when-elided="true" name="AssessmentTitle" class="section-title" />
+                    <ui:VisualElement name="AssessmentContent" class="assessment-content">
+                        <ui:Label text="Your adventure has ended..." display-tooltip-when-elided="true" name="AssessmentText" class="assessment-text" />
+                    </ui:VisualElement>
+                </ui:VisualElement>
+            </ui:VisualElement>
+            
+            <!-- Footer Section -->
+            <ui:VisualElement name="FooterSection" class="footer-section">
+                <ui:VisualElement name="ButtonContainer" class="button-container">
+                    <ui:Button text="Restart Game" display-tooltip-when-elided="true" name="RestartButton" class="action-button restart-button" />
+                    <ui:Button text="Main Menu" display-tooltip-when-elided="true" name="MainMenuButton" class="action-button menu-button" />
+                </ui:VisualElement>
+            </ui:VisualElement>
+        </ui:VisualElement>
+    </ui:VisualElement>
+</ui:UXML>

+ 171 - 0
Assets/UI/BattleSceneUI/GameOverScreen_Clean.uss

@@ -0,0 +1,171 @@
+/* Clean Game Over Screen Styles - Unity UI Toolkit Compatible */
+
+/* Main Overlay */
+.gameover-overlay {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(30, 0, 0, 0.9);
+    justify-content: center;
+    align-items: center;
+}
+
+.gameover-background {
+    background-color: rgba(40, 20, 20, 0.95);
+    border-width: 2px;
+    border-color: rgb(160, 60, 60);
+    border-radius: 15px;
+    padding: 30px;
+    width: 85%;
+    max-width: 1000px;
+    max-height: 90%;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+/* Header */
+.gameover-title {
+    font-size: 42px;
+    color: rgb(255, 80, 80);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.gameover-subtitle {
+    font-size: 18px;
+    color: rgb(200, 150, 150);
+    margin-bottom: 20px;
+    -unity-text-align: center;
+    -unity-font-style: italic;
+}
+
+/* Main Content */
+.main-content {
+    flex-grow: 1;
+    flex-direction: row;
+    justify-content: space-between;
+}
+
+.statistics-section {
+    flex-grow: 1;
+    background-color: rgba(50, 30, 30, 0.7);
+    border-radius: 10px;
+    padding: 20px;
+    margin-right: 10px;
+}
+
+.assessment-section {
+    width: 30%;
+    background-color: rgba(60, 25, 25, 0.7);
+    border-radius: 10px;
+    padding: 20px;
+    margin-left: 10px;
+}
+
+.section-title {
+    font-size: 20px;
+    color: rgb(255, 150, 150);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+/* Statistics Categories */
+.stats-category {
+    margin-bottom: 20px;
+    padding: 15px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 8px;
+}
+
+.category-title {
+    font-size: 16px;
+    color: rgb(255, 200, 100);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.stat-row {
+    flex-direction: row;
+    justify-content: space-between;
+    margin-bottom: 5px;
+    padding: 2px 0;
+}
+
+.stat-label {
+    font-size: 14px;
+    color: rgb(200, 180, 180);
+    flex-grow: 1;
+}
+
+.stat-value {
+    font-size: 14px;
+    color: rgb(255, 255, 255);
+    -unity-text-align: right;
+    -unity-font-style: bold;
+}
+
+/* Assessment */
+.assessment-title {
+    font-size: 18px;
+    color: rgb(255, 150, 150);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.assessment-text {
+    font-size: 16px;
+    color: rgb(220, 200, 200);
+    margin-bottom: 20px;
+    -unity-text-align: center;
+    white-space: normal;
+}
+
+/* Footer Buttons */
+.footer-section {
+    align-items: center;
+    margin-top: 20px;
+}
+
+.button-container {
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+}
+
+.action-button {
+    min-width: 140px;
+    height: 45px;
+    margin: 0 15px;
+    border-radius: 22px;
+    font-size: 16px;
+    -unity-font-style: bold;
+    cursor: pointer;
+}
+
+.restart-button {
+    background-color: rgb(100, 60, 60);
+    border-color: rgb(140, 80, 80);
+    color: rgb(255, 255, 255);
+}
+
+.restart-button:hover {
+    background-color: rgb(140, 80, 80);
+    border-color: rgb(180, 100, 100);
+}
+
+.menu-button {
+    background-color: rgb(60, 60, 100);
+    border-color: rgb(80, 80, 140);
+    color: rgb(255, 255, 255);
+}
+
+.menu-button:hover {
+    background-color: rgb(80, 80, 140);
+    border-color: rgb(100, 100, 180);
+}

+ 213 - 0
Assets/UI/BattleSceneUI/PostBattleLootScreen.uss

@@ -0,0 +1,213 @@
+/* Clean Post Battle Loot Screen Styles - Unity UI Toolkit Compatible */
+
+/* Main Overlay */
+.loot-overlay {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(0, 0, 0, 0.8);
+    justify-content: center;
+    align-items: center;
+}
+
+.loot-background {
+    background-color: rgba(20, 20, 30, 0.95);
+    border-width: 2px;
+    border-color: rgb(180, 140, 60);
+    border-radius: 15px;
+    padding: 30px;
+    width: 80%;
+    max-width: 800px;
+    max-height: 90%;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+/* Header Section */
+.header-section {
+    align-items: center;
+    margin-bottom: 20px;
+}
+
+.victory-title {
+    font-size: 32px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 5px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.victory-subtitle {
+    font-size: 18px;
+    color: rgb(200, 200, 200);
+    -unity-text-align: center;
+    -unity-font-style: italic;
+}
+
+/* Main Content */
+.main-content {
+    flex-grow: 1;
+    flex-direction: column;
+}
+
+.enemy-loot-section {
+    background-color: rgba(40, 40, 50, 0.7);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.total-rewards-section {
+    background-color: rgba(60, 40, 20, 0.7);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.section-title {
+    font-size: 20px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.enemy-loot-list {
+    max-height: 150px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    padding: 10px;
+}
+
+.enemy-loot-item {
+    margin-bottom: 10px;
+    padding: 8px;
+    background-color: rgba(255, 255, 255, 0.1);
+    border-radius: 5px;
+}
+
+.enemy-name {
+    font-size: 16px;
+    color: rgb(255, 100, 100);
+    margin-bottom: 5px;
+    -unity-font-style: bold;
+}
+
+.enemy-rewards {
+    flex-direction: row;
+    margin-bottom: 5px;
+}
+
+.enemy-items {
+    flex-direction: column;
+}
+
+/* Currency Display */
+.currency-display {
+    flex-direction: row;
+    justify-content: space-around;
+    align-items: center;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.currency-item {
+    align-items: center;
+    flex-direction: column;
+}
+
+.currency-icon {
+    font-size: 24px;
+    margin-bottom: 5px;
+}
+
+.currency-amount {
+    font-size: 20px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 3px;
+    -unity-font-style: bold;
+}
+
+.currency-label {
+    font-size: 12px;
+    color: rgb(200, 200, 200);
+}
+
+/* Items Display */
+.items-display {
+    margin-top: 10px;
+}
+
+.items-title {
+    font-size: 16px;
+    color: rgb(180, 180, 180);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+}
+
+.items-list {
+    max-height: 100px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    padding: 10px;
+}
+
+.item-entry {
+    color: rgb(150, 200, 150);
+    margin-bottom: 3px;
+}
+
+/* Footer Section */
+.footer-section {
+    align-items: center;
+    margin-top: 20px;
+}
+
+.continue-prompt {
+    font-size: 16px;
+    color: rgb(200, 200, 200);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+}
+
+.button-container {
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+}
+
+.action-button {
+    min-width: 120px;
+    height: 40px;
+    margin: 0 10px;
+    border-radius: 20px;
+    font-size: 16px;
+    -unity-font-style: bold;
+    cursor: pointer;
+}
+
+.primary-button {
+    background-color: rgb(100, 150, 100);
+    border-color: rgb(120, 180, 120);
+    color: rgb(255, 255, 255);
+}
+
+.primary-button:hover {
+    background-color: rgb(120, 180, 120);
+    border-color: rgb(140, 200, 140);
+}
+
+.secondary-button {
+    background-color: rgb(80, 80, 120);
+    border-color: rgb(100, 100, 140);
+    color: rgb(255, 255, 255);
+}
+
+.secondary-button:hover {
+    background-color: rgb(100, 100, 140);
+    border-color: rgb(120, 120, 160);
+}

+ 66 - 0
Assets/UI/BattleSceneUI/PostBattleLootScreen.uxml

@@ -0,0 +1,66 @@
+<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
+    
+    <!-- Full Screen Overlay -->
+    <ui:VisualElement name="LootScreenOverlay" class="loot-overlay">
+        <!-- Background Panel -->
+        <ui:VisualElement name="LootScreenBackground" class="loot-background">
+            
+            <!-- Header Section -->
+            <ui:VisualElement name="HeaderSection" class="header-section">
+                <ui:Label text="🏆 VICTORY! 🏆" display-tooltip-when-elided="true" name="VictoryTitle" class="victory-title" />
+                <ui:Label text="Collecting loot from defeated enemies..." display-tooltip-when-elided="true" name="VictorySubtitle" class="victory-subtitle" />
+            </ui:VisualElement>
+            
+            <!-- Main Content Section -->
+            <ui:VisualElement name="MainContent" class="main-content">
+                
+                <!-- Enemy Loot Section -->
+                <ui:VisualElement name="EnemyLootSection" class="enemy-loot-section">
+                    <ui:Label text="Defeated Enemies" display-tooltip-when-elided="true" name="EnemyLootTitle" class="section-title" />
+                    <ui:ScrollView name="EnemyLootContainer" class="enemy-loot-list" />
+                </ui:VisualElement>
+                
+                <!-- Total Rewards Section -->
+                <ui:VisualElement name="TotalRewardsSection" class="total-rewards-section">
+                    <ui:Label text="Total Rewards" display-tooltip-when-elided="true" name="TotalRewardsTitle" class="section-title" />
+                    
+                    <!-- Currency Display -->
+                    <ui:VisualElement name="CurrencyDisplay" class="currency-display">
+                        <ui:VisualElement name="GoldDisplay" class="currency-item">
+                            <ui:Label text="G" display-tooltip-when-elided="true" name="GoldIcon" class="currency-icon" />
+                            <ui:Label text="0" display-tooltip-when-elided="true" name="GoldAmount" class="currency-amount" />
+                            <ui:Label text="Gold" display-tooltip-when-elided="true" name="GoldLabel" class="currency-label" />
+                        </ui:VisualElement>
+                        
+                        <ui:VisualElement name="SilverDisplay" class="currency-item">
+                            <ui:Label text="S" display-tooltip-when-elided="true" name="SilverIcon" class="currency-icon" />
+                            <ui:Label text="0" display-tooltip-when-elided="true" name="SilverAmount" class="currency-amount" />
+                            <ui:Label text="Silver" display-tooltip-when-elided="true" name="SilverLabel" class="currency-label" />
+                        </ui:VisualElement>
+                        
+                        <ui:VisualElement name="CopperDisplay" class="currency-item">
+                            <ui:Label text="C" display-tooltip-when-elided="true" name="CopperIcon" class="currency-icon" />
+                            <ui:Label text="0" display-tooltip-when-elided="true" name="CopperAmount" class="currency-amount" />
+                            <ui:Label text="Copper" display-tooltip-when-elided="true" name="CopperLabel" class="currency-label" />
+                        </ui:VisualElement>
+                    </ui:VisualElement>
+                    
+                    <!-- Items Display -->
+                    <ui:VisualElement name="ItemsDisplay" class="items-display">
+                        <ui:Label text="Items Collected" display-tooltip-when-elided="true" name="ItemsTitle" class="items-title" />
+                        <ui:ScrollView name="ItemsList" class="items-list" />
+                    </ui:VisualElement>
+                </ui:VisualElement>
+            </ui:VisualElement>
+            
+            <!-- Footer Section -->
+            <ui:VisualElement name="FooterSection" class="footer-section">
+                <ui:Label text="Press SPACE to continue..." display-tooltip-when-elided="true" name="ContinuePrompt" class="continue-prompt" />
+                <ui:VisualElement name="ButtonContainer" class="button-container">
+                    <ui:Button text="Take All" display-tooltip-when-elided="true" name="TakeAllButton" class="action-button primary-button" />
+                    <ui:Button text="Continue" display-tooltip-when-elided="true" name="ContinueButton" class="action-button secondary-button" />
+                </ui:VisualElement>
+            </ui:VisualElement>
+        </ui:VisualElement>
+    </ui:VisualElement>
+</ui:UXML>

+ 213 - 0
Assets/UI/BattleSceneUI/PostBattleLootScreen_Clean.uss

@@ -0,0 +1,213 @@
+/* Clean Post Battle Loot Screen Styles - Unity UI Toolkit Compatible */
+
+/* Main Overlay */
+.loot-overlay {
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: rgba(0, 0, 0, 0.8);
+    justify-content: center;
+    align-items: center;
+}
+
+.loot-background {
+    background-color: rgba(20, 20, 30, 0.95);
+    border-width: 2px;
+    border-color: rgb(180, 140, 60);
+    border-radius: 15px;
+    padding: 30px;
+    width: 80%;
+    max-width: 800px;
+    max-height: 90%;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+/* Header Section */
+.header-section {
+    align-items: center;
+    margin-bottom: 20px;
+}
+
+.victory-title {
+    font-size: 32px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 5px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.victory-subtitle {
+    font-size: 18px;
+    color: rgb(200, 200, 200);
+    -unity-text-align: center;
+    -unity-font-style: italic;
+}
+
+/* Main Content */
+.main-content {
+    flex-grow: 1;
+    flex-direction: column;
+}
+
+.enemy-loot-section {
+    background-color: rgba(40, 40, 50, 0.7);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.total-rewards-section {
+    background-color: rgba(60, 40, 20, 0.7);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.section-title {
+    font-size: 20px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+    -unity-font-style: bold;
+}
+
+.enemy-loot-list {
+    max-height: 150px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    padding: 10px;
+}
+
+.enemy-loot-item {
+    margin-bottom: 10px;
+    padding: 8px;
+    background-color: rgba(255, 255, 255, 0.1);
+    border-radius: 5px;
+}
+
+.enemy-name {
+    font-size: 16px;
+    color: rgb(255, 100, 100);
+    margin-bottom: 5px;
+    -unity-font-style: bold;
+}
+
+.enemy-rewards {
+    flex-direction: row;
+    margin-bottom: 5px;
+}
+
+.enemy-items {
+    flex-direction: column;
+}
+
+/* Currency Display */
+.currency-display {
+    flex-direction: row;
+    justify-content: space-around;
+    align-items: center;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 10px;
+    padding: 15px;
+    margin-bottom: 15px;
+}
+
+.currency-item {
+    align-items: center;
+    flex-direction: column;
+}
+
+.currency-icon {
+    font-size: 24px;
+    margin-bottom: 5px;
+}
+
+.currency-amount {
+    font-size: 20px;
+    color: rgb(255, 215, 0);
+    margin-bottom: 3px;
+    -unity-font-style: bold;
+}
+
+.currency-label {
+    font-size: 12px;
+    color: rgb(200, 200, 200);
+}
+
+/* Items Display */
+.items-display {
+    margin-top: 10px;
+}
+
+.items-title {
+    font-size: 16px;
+    color: rgb(180, 180, 180);
+    margin-bottom: 10px;
+    -unity-text-align: center;
+}
+
+.items-list {
+    max-height: 100px;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    padding: 10px;
+}
+
+.item-entry {
+    color: rgb(150, 200, 150);
+    margin-bottom: 3px;
+}
+
+/* Footer Section */
+.footer-section {
+    align-items: center;
+    margin-top: 20px;
+}
+
+.continue-prompt {
+    font-size: 16px;
+    color: rgb(200, 200, 200);
+    margin-bottom: 15px;
+    -unity-text-align: center;
+}
+
+.button-container {
+    flex-direction: row;
+    justify-content: center;
+    align-items: center;
+}
+
+.action-button {
+    min-width: 120px;
+    height: 40px;
+    margin: 0 10px;
+    border-radius: 20px;
+    font-size: 16px;
+    -unity-font-style: bold;
+    cursor: pointer;
+}
+
+.primary-button {
+    background-color: rgb(100, 150, 100);
+    border-color: rgb(120, 180, 120);
+    color: rgb(255, 255, 255);
+}
+
+.primary-button:hover {
+    background-color: rgb(120, 180, 120);
+    border-color: rgb(140, 200, 140);
+}
+
+.secondary-button {
+    background-color: rgb(80, 80, 120);
+    border-color: rgb(100, 100, 140);
+    color: rgb(255, 255, 255);
+}
+
+.secondary-button:hover {
+    background-color: rgb(100, 100, 140);
+    border-color: rgb(120, 120, 160);
+}

+ 0 - 0
Assets/UI/ItemSelectionUI.uss


+ 0 - 0
Assets/UI/ItemSelectionUI.uxml


+ 101 - 0
BASIC_TEST_MODE_INVENTORY_UPDATE.md

@@ -0,0 +1,101 @@
+# Basic Test Mode Inventory Update ✅
+
+## Overview
+Updated the basic `BattleTestMode.cs` to include health potions and other inventory items for test characters, so the inventory list actually shows items during testing.
+
+## Changes Made
+
+### 1. Enhanced CreateTestBattleData Method
+- Added call to `CreateBasicInventoryData()` after creating characters
+- Now creates both legacy BattleSetupData and modern CombatDataTransfer inventory data
+
+### 2. Added CreateBasicInventoryData Method
+- Creates `CombatDataTransfer.CombatSessionData` with basic battle context
+- Generates `TeamCharacterCombatData` for each player with inventory
+- Gives realistic stats (HP 15-25, AC 12, random attributes)
+- Creates basic enemy data for completeness
+
+### 3. Added CreateBasicTestInventory Method
+- **All characters get**: 2x Health Potions, Bread, Bandage
+- **Character-specific items**:
+  - Character 0: Extra Health Potion + Iron Ration
+  - Character 1: Antidote + Rope  
+  - Character 2: Torch + Waterskin
+- Provides variety while ensuring everyone has healing items
+
+### 4. Updated Clear Test Data
+- Now clears both `BattleSetupData` and `CombatDataTransfer` session data
+- Ensures clean state between tests
+
+## Inventory Items Provided
+
+### Base Items (All Characters)
+- **Health Potion** x2 - Primary healing items
+- **Bread** - Basic food
+- **Bandage** - Secondary healing
+
+### Varied Items (By Character Index)
+- **Fighter-type** (Index 0): Extra Health Potion, Iron Ration
+- **Utility-type** (Index 1): Antidote, Rope
+- **Explorer-type** (Index 2): Torch, Waterskin
+
+## How It Works
+
+### Hybrid System
+The basic test mode now creates **both** data systems:
+1. **BattleSetupData** (legacy): CharacterSelection objects for backward compatibility
+2. **CombatDataTransfer** (modern): Full character data including inventory
+
+### Inventory Access
+When the battle scene loads:
+1. BattleItemSelector looks for inventory data
+2. Finds CombatDataTransfer session with character inventories
+3. Displays actual inventory items instead of empty lists
+
+## Testing Instructions
+
+### Using Context Menu Commands
+```csharp
+// Right-click on BattleTestMode component:
+1. "Create Test Battle Data" - Creates characters with inventory
+2. "Create Random Test Data" - Random character counts + inventory
+3. "Create 1v1 Test Battle" - Quick test with inventory
+4. "Create Large Test Battle" - 4v6 battle with inventory
+5. "Clear Test Data" - Clears both systems
+```
+
+### In Battle Scene
+1. Create test battle using any context menu command
+2. Select a character action that uses items (like "Use Item")
+3. **Verify**: Item list shows Health Potions, Bread, Bandages, etc.
+4. **Check quantities**: Should see "Health Potion x2" or similar
+5. **Test usage**: Items should be usable and show proper descriptions
+
+## Benefits
+
+### For Quick Testing
+- **No setup required**: Just enable test mode and get inventories
+- **Realistic items**: Health potions for actual battle testing
+- **Variety**: Different characters have different utility items
+- **Backward compatible**: Works with existing BattleSetupData systems
+
+### For Development
+- **Dual system support**: Works with both old and new data systems
+- **Easy debugging**: Clear logging of inventory creation
+- **Flexible**: Can easily modify inventory contents
+- **Clean state**: Proper cleanup between test sessions
+
+## Files Modified
+- `Assets/Scripts/BattleScene/BattleTestMode.cs`
+  - Added `CreateBasicInventoryData()` method
+  - Added `CreateBasicTestInventory()` method  
+  - Enhanced `CreateTestBattleData()` to include inventory
+  - Updated `ClearTestData()` to clear both systems
+
+## Next Steps
+1. Test the basic test mode in battle scene
+2. Verify item selection shows health potions and other items
+3. Test item usage functionality
+4. Consider adding more item variety if needed
+
+The basic test mode now provides realistic inventories for proper battle testing! 🎉

+ 220 - 0
BATTLE_SCENE_TEST_MODE_GUIDE.md

@@ -0,0 +1,220 @@
+# Battle Scene Test Mode Guide
+
+This guide explains how to use the test modes for the battle scene to quickly create test characters and enemies for development and testing purposes.
+
+## Overview
+
+Two test mode scripts have been created to help with battle scene testing:
+
+1. **BattleTestMode.cs** - Basic test mode for simple character creation
+2. **EnhancedBattleTestMode.cs** - Advanced test mode with full combat data and realistic stats
+
+## Basic Test Mode (BattleTestMode)
+
+### Features
+- ✅ Creates test player and enemy characters automatically
+- ✅ Configurable character counts and weapon types
+- ✅ Multiple preset battle configurations
+- ✅ Context menu commands for easy testing
+
+### Setup Instructions
+
+1. **Add to Battle Scene**:
+   ```
+   1. Open your BattleScene
+   2. Create an empty GameObject named "BattleTestMode"
+   3. Add the BattleTestMode component to it
+   4. Configure the settings in the inspector
+   ```
+
+2. **Configuration Options**:
+   - `Enable Test Mode`: Master switch to enable/disable test mode
+   - `Test Player Count`: Number of player characters (1-4)
+   - `Test Enemy Count`: Number of enemy characters (1-6)
+   - `Available Weapons`: Array of weapon types to randomly assign
+   - `Player Names`: Array of names for test players
+   - `Enemy Names`: Array of names for test enemies
+
+3. **Automatic Activation**:
+   - Test mode only activates if no existing battle data is present
+   - Characters are created automatically when the scene loads
+   - Debug logs show what was created
+
+### Context Menu Commands
+
+Right-click on the BattleTestMode component to access these commands:
+
+- **Create Test Battle Data**: Manually create test data
+- **Clear Test Data**: Remove all test battle data
+- **Create Random Test Data**: Create random character counts and weapons
+- **Create 1v1 Test Battle**: Quick single combat for testing
+- **Create Large Test Battle**: 4 players vs 6 enemies for stress testing
+
+## Enhanced Test Mode (EnhancedBattleTestMode)
+
+### Features
+- ✅ Creates full CombatDataTransfer sessions with realistic stats
+- ✅ Configurable battle context (terrain, weather, time)
+- ✅ Character stats and equipment integration
+- ✅ Support for WeaponItem assets
+- ✅ Backward compatibility with legacy BattleSetupData
+
+### Setup Instructions
+
+1. **Add to Battle Scene**:
+   ```
+   1. Open your BattleScene
+   2. Create an empty GameObject named "EnhancedBattleTestMode"
+   3. Add the EnhancedBattleTestMode component to it
+   4. Configure the settings in the inspector
+   ```
+
+2. **Configuration Options**:
+   - `Enable Enhanced Test Mode`: Master switch
+   - `Test Player Count`: Number of players (1-4)
+   - `Test Enemy Count`: Number of enemies (1-6)
+   - `Test Terrain`: Terrain type for the battle
+   - `Test Weather`: Weather conditions
+   - `Test Time Of Day`: Time in 24-hour format
+   - `Base Player Health`: Starting HP for players
+   - `Base Enemy Health`: Starting HP for enemies
+   - `Base Armor Class`: Base AC value
+   - `Test Weapons`: Array of WeaponItem assets to use
+
+3. **WeaponItem Setup** (Optional but Recommended):
+   ```
+   1. Create WeaponItem assets in Project window:
+      Right-click → Create → RPG → Items → Weapon
+   2. Configure the weapon stats and behavior
+   3. Assign them to the Test Weapons array
+   4. Test characters will randomly get these weapons
+   ```
+
+### Context Menu Commands
+
+Right-click on the EnhancedBattleTestMode component:
+
+- **Create Enhanced Test Data**: Manually create full test session
+- **Clear All Test Data**: Remove both CombatDataTransfer and BattleSetupData
+- **Create Balanced Test Battle**: 2v2 balanced encounter
+- **Create Challenging Test Battle**: 2v4 difficult encounter
+- **Create Simple Test Battle**: 1v1 for quick testing
+
+## Using Both Test Modes
+
+### Recommended Setup
+
+1. **For Simple Testing**: Use `BattleTestMode` when you just need basic characters for testing placement, movement, or basic combat mechanics.
+
+2. **For Full Testing**: Use `EnhancedBattleTestMode` when you need realistic character stats, equipment, and battle context for testing the complete combat system.
+
+3. **Don't Use Both**: Only use one test mode at a time to avoid conflicts.
+
+### Integration with Existing Battle System
+
+Both test modes integrate seamlessly with the existing battle setup:
+
+- **BattleSetup.cs** will find and use the test characters
+- **EnhancedBattleSetup.cs** will use the enhanced combat session data
+- **GameManager.cs** will manage the test characters normally
+- All existing battle mechanics work with test characters
+
+## Example Workflows
+
+### Quick Combat Test
+```
+1. Add EnhancedBattleTestMode to scene
+2. Set Test Player Count = 1, Test Enemy Count = 1
+3. Right-click component → "Create Simple Test Battle"
+4. Press Play to test 1v1 combat
+```
+
+### Weapon System Test
+```
+1. Create several WeaponItem assets with different stats
+2. Add them to the Test Weapons array in EnhancedBattleTestMode
+3. Right-click component → "Create Enhanced Test Data"
+4. Characters will spawn with random weapons from your array
+```
+
+### Stress Test
+```
+1. Add BattleTestMode to scene
+2. Right-click component → "Create Large Test Battle"
+3. Press Play to test 4v6 battle performance
+```
+
+### Battle Context Test
+```
+1. Add EnhancedBattleTestMode to scene
+2. Set Test Terrain = Mountains, Test Weather = Storm, Time = 22
+3. Create Enhanced Test Data
+4. Test how different environments affect combat
+```
+
+## Debug Information
+
+Both test modes provide extensive debug logging:
+
+- 🧪 Prefix indicates test mode messages
+- Character creation details (names, weapons, stats)
+- Battle context information
+- Data population confirmation
+
+Enable `Show Debug Logs` in the inspector to see all test mode activity.
+
+## Troubleshooting
+
+### Test Mode Not Activating
+- Check that `Enable Test Mode` is checked
+- Ensure no existing battle data is present
+- Clear existing data using context menu commands
+
+### Characters Not Spawning
+- Ensure you have `playerPrefab` and `enemyPrefab` assigned in BattleSetup
+- Check that PlayerSpawnArea and EnemySpawnArea exist in scene
+- Verify ground layer mask is set correctly
+
+### Weapons Not Working
+- For Enhanced mode, ensure WeaponItem assets are properly configured
+- Check that weapon class names match existing weapon classes
+- Verify prefab references in WeaponItem assets
+
+### Performance Issues
+- Reduce character counts for stress testing
+- Use Simple Test Battle for basic testing
+- Clear test data between tests to avoid memory buildup
+
+## Advanced Usage
+
+### Custom Test Characters
+
+You can extend the test modes to create specific character builds:
+
+```csharp
+// In EnhancedBattleTestMode.CreateTestPlayerData()
+if (playerName == "TestMage")
+{
+    playerData.wisdom = 18;  // High wisdom for mage
+    playerData.equippedWeapon = "Staff";
+}
+```
+
+### Dynamic Test Scenarios
+
+Create different test scenarios by modifying the context:
+
+```csharp
+[ContextMenu("Create Night Ambush Test")]
+public void CreateNightAmbushTest()
+{
+    testTerrain = TerrainType.Forest;
+    testWeather = Weather.Clear;
+    testTimeOfDay = 2f; // 2 AM
+    testPlayerCount = 2;
+    testEnemyCount = 4;
+    CreateEnhancedTestData();
+}
+```
+
+This system makes it easy to test any battle scenario quickly without going through the full character creation and travel system.

+ 95 - 0
DRAG_TO_MOVE_ATTACK_FIX.md

@@ -0,0 +1,95 @@
+# Drag-to-Move/Attack Fix ✅
+
+## Problem Identified
+The drag-to-move/attack functionality was broken because the `BattleActionIntegration` system was enabled with `useNewActionSystem = true` by default, which was disabling the `PlayerDecisionController` that handles the drag input.
+
+## Root Cause
+In `BattleActionIntegration.cs`, line 540:
+```csharp
+playerDecisionController.enabled = !useNewActionSystem;
+```
+
+When `useNewActionSystem` was `true`, this line was setting `playerDecisionController.enabled = false`, completely disabling the drag input system.
+
+## Fix Applied
+
+### 1. Changed Default System
+- **Before**: `useNewActionSystem = true` (new action wheel system)
+- **After**: `useNewActionSystem = false` (classic drag system)
+
+### 2. Added Toggle Functionality
+- **Toggle Key**: Press `T` to switch between systems
+- **Visual Feedback**: Console shows which system is active
+- **Improved State Management**: Ensures PlayerDecisionController is properly enabled when switching
+
+### 3. Enhanced User Experience
+- Added tooltip to inspector explaining the setting
+- Added clear debug messages indicating which system is active
+- Ensured proper cleanup when switching systems
+
+## How the Systems Work
+
+### Old Drag System (Default)
+- **Click and drag** from character to enemy = **Attack**
+- **Click and drag** from character to empty space = **Move**
+- **Simple and direct** - no additional UI needed
+
+### New Action Wheel System (Press T to toggle)
+1. **Click** character to select
+2. **Press Q** to open action wheel
+3. **Click action** (Move, Attack, Use Item, etc.)
+4. **Drag** to target (if targeting required)
+
+## Testing Instructions
+
+### Test the Fix
+1. **Load battle scene** with test mode
+2. **Verify current system**: Should see "Old Click-Drag" in console
+3. **Test drag functionality**:
+   - Click and drag from player character to enemy (should attack)
+   - Click and drag from player character to empty space (should move)
+
+### Test System Toggle
+1. **Press T** to toggle to new system
+2. **Console should show**: "New Action Wheel" message
+3. **Test new system**:
+   - Click character
+   - Press Q for action wheel
+   - Select action
+   - Drag to target
+
+### Switch Back
+1. **Press T again** to return to old system
+2. **Test drag functionality** works again
+
+## Files Modified
+- `Assets/Scripts/BattleScene/BattleActionIntegration.cs`
+  - Changed `useNewActionSystem` default to `false`
+  - Added toggle key functionality
+  - Improved state management in `ToggleActionSystem()`
+  - Enhanced debug messaging
+
+## Benefits of This Fix
+
+### For Testing
+- **Immediate functionality**: Drag-to-move works out of the box
+- **No learning curve**: Uses familiar drag interface
+- **Quick battles**: No need to navigate action wheels for simple actions
+
+### For Development
+- **Flexible**: Can toggle between systems with T key
+- **Debuggable**: Clear console messages about system state
+- **Backward compatible**: Both systems remain available
+
+### For Users
+- **Choice**: Can use either simple drag or advanced action wheel
+- **Intuitive**: Drag behavior matches expectations
+- **Responsive**: No UI delays for common actions
+
+## Current Status
+✅ **Drag-to-move/attack is now working**
+✅ **Both systems are available and can be toggled**
+✅ **Test mode creates characters with inventories**
+✅ **Battle system is fully functional**
+
+The battle scene should now respond properly to click-and-drag input for movement and attacks! 🎉

+ 131 - 0
INVENTORY_INTEGRATION_COMPLETE.md

@@ -0,0 +1,131 @@
+# Inventory Integration Complete ✅
+
+## Overview
+The battle scene inventory system has been successfully updated to show actual character inventory items instead of hardcoded placeholders. Both test mode and real mode now properly access individualized character inventories.
+
+## Changes Made
+
+### 1. CombatDataTransfer.cs Updates
+- **Added `miscItems` field** to `TeamCharacterCombatData` class
+- **Updated constructor** to initialize miscItems as empty list
+- **Enhanced `FromTeamCharacter`** method to copy inventory from TeamCharacter.miscItems
+- **Improved data flow** between exploration and battle scenes
+
+### 2. BattleItemSelector.cs Complete Overhaul
+- **Replaced hardcoded items** with dynamic inventory access
+- **Added multi-pathway inventory system**:
+  - Primary: ScriptableObject-based Inventory component
+  - Secondary: CombatDataTransfer session data
+  - Fallback: String-based inventory descriptions
+- **Enhanced item display** with quantity support (e.g., "Health Potion x3")
+- **Added usability checks** - items with 0 quantity are disabled
+- **Improved error handling** and debug logging
+
+### 3. EnhancedBattleTestMode.cs Inventory Creation
+- **Added `CreateTestInventory`** method for realistic test items
+- **Character-specific inventories**:
+  - Fighter: Extra healing items, bandages, iron rations
+  - Rogue: Thieves' tools, rope, antidotes
+  - Mage: Spell components, scrolls, magic ink
+  - Cleric: Holy water, bandages, blessed bread
+- **Random bonus items** for variety
+- **Test characters now have proper inventories**
+
+## Features Implemented
+
+### Dynamic Inventory Access
+```csharp
+// Multi-pathway inventory system
+1. Inventory Component (ScriptableObject)
+2. CombatDataTransfer Session Data
+3. String-based descriptions (fallback)
+```
+
+### Quantity Display
+- Items show quantity when > 1 (e.g., "Health Potion x3")
+- Items with 0 quantity are grayed out and disabled
+- Proper usability validation
+
+### Character-Specific Test Inventories
+- Each test character gets thematically appropriate items
+- Variety through random bonus items
+- Realistic item distributions for testing
+
+### Error Handling
+- Comprehensive null checks
+- Debug logging for troubleshooting
+- Graceful fallbacks when data is missing
+
+## Testing Instructions
+
+### 1. Test Mode Usage
+```csharp
+// In Unity Editor, right-click on EnhancedBattleTestMode component:
+1. "Create Enhanced Test Data" - Full combat session with inventories
+2. "Create Simple Test Battle" - Quick 1v1 test
+3. "Create Balanced Test Battle" - 2v2 test
+4. "Create Boss Battle Test" - Boss encounter test
+```
+
+### 2. Inventory Verification
+1. Create test battle using any context menu command
+2. In battle scene, select a character action that uses items
+3. Verify the item list shows character-specific items (not hardcoded)
+4. Check quantities are displayed correctly
+5. Verify unusable items are grayed out
+
+### 3. Real Mode Testing
+1. Create characters in exploration mode with various inventory items
+2. Enter battle normally
+3. Verify battle item selector shows actual character inventories
+4. Test item usage and quantity updates
+
+## Technical Details
+
+### Inventory Data Flow
+```
+TeamCharacter.miscItems → CombatDataTransfer.TeamCharacterCombatData.miscItems → BattleItemSelector.GetCharacterItems()
+```
+
+### Item Resolution Priority
+1. **Inventory Component**: Full ScriptableObject data with quantities
+2. **CombatDataTransfer**: String-based items from exploration scene
+3. **Fallback**: Basic description for unknown items
+
+### Debug Features
+- Detailed logging in BattleItemSelector for troubleshooting
+- Debug logs in EnhancedBattleTestMode for test character creation
+- Clear error messages for missing components
+
+## Benefits
+
+### For Testing
+- **Realistic inventories** for each test character
+- **Quick setup** with context menu commands
+- **Varied scenarios** with different character types
+- **No manual inventory setup** required
+
+### For Players
+- **Accurate item display** from their actual inventories
+- **Quantity awareness** for consumable items
+- **Proper item availability** based on what they actually have
+- **Consistent experience** between exploration and battle
+
+### For Developers
+- **Maintainable code** with clear separation of concerns
+- **Robust error handling** for edge cases
+- **Flexible system** supporting multiple inventory approaches
+- **Debug-friendly** with comprehensive logging
+
+## Files Modified
+- `Assets/Scripts/BattleSetup/CombatDataTransfer.cs`
+- `Assets/Scripts/BattleScene/BattleItemSelector.cs`
+- `Assets/Scripts/BattleScene/EnhancedBattleTestMode.cs`
+
+## Next Steps
+1. Test the inventory system in various scenarios
+2. Verify item consumption properly updates quantities
+3. Test with characters who have Inventory components vs string-based items
+4. Consider adding more test scenarios if needed
+
+The inventory integration is now complete and ready for use! 🎉

+ 273 - 0
POST_BATTLE_LOOTING_SYSTEM_GUIDE.md

@@ -0,0 +1,273 @@
+# Post-Battle Looting System Implementation Guide
+
+## Overview
+This guide covers the implementation of the post-battle looting system, carry capacity management, and game over screen functionality for when battles end.
+
+## 🎯 Features Implemented
+
+### 1. Post-Battle Looting System (`PostBattleLootSystem.cs`)
+- **Automatic loot generation** from defeated enemies
+- **Currency rewards** (gold/silver/copper) based on enemy type
+- **Item drops** with type-specific loot tables
+- **Auto-distribution** to surviving players
+- **Integration** with existing inventory systems
+
+### 2. Carry Capacity System (`CharacterCarryCapacity.cs`)
+- **Weight-based inventory** management
+- **Strength-based capacity** calculation
+- **Encumbrance penalties** for overloading
+- **Movement and Dexterity penalties** for heavy loads
+- **Real-time weight calculation** from inventory
+
+### 3. Game Over Screen (`GameOverScreen.cs`)
+- **Comprehensive statistics** display
+- **Performance analysis** (battles won/lost, enemies slain)
+- **Social impact tracking** (people helped, quests completed)
+- **Final hero assessment** based on achievements
+- **Restart/Main Menu options**
+
+## 🚀 Quick Setup
+
+### Step 1: Battle Scene Integration
+The new systems integrate automatically with the existing `GameManager`:
+
+```csharp
+// Victory Detection (Enhanced)
+- Properly detects when all enemies are defeated
+- Automatically starts looting phase
+- Distributes rewards to surviving players
+
+// Defeat Detection (Enhanced) 
+- Detects when all players are dead
+- Shows comprehensive game over screen
+- Displays final statistics and achievements
+```
+
+### Step 2: Character Setup
+Add carry capacity to your characters:
+
+```csharp
+// Add to player prefabs
+var carryCapacity = playerPrefab.AddComponent<CharacterCarryCapacity>();
+carryCapacity.carrySystem.baseCarryCapacity = 50; // Base capacity
+carryCapacity.carrySystem.strengthMultiplier = 5f; // STR bonus
+```
+
+### Step 3: UI Setup (Optional)
+For custom UI, create these UI elements:
+- **Loot Panel**: For manual loot selection
+- **Game Over Panel**: For defeat screen display
+
+## 📊 Loot System Details
+
+### Enemy-Based Loot Generation
+Different enemy types drop different items:
+
+```csharp
+// Skeleton Enemies
+- Bone (30% chance)
+- Rusty Sword (20% chance) 
+- Bone Dust (15% chance)
+
+// Bandit Enemies
+- Thieves' Tools (40% chance)
+- Rope (30% chance)
+- Dagger (20% chance)
+- Extra copper coins
+
+// Orc/Goblin Enemies  
+- Crude Axe (30% chance)
+- Hide Armor (25% chance)
+- Iron Ration (20% chance)
+```
+
+### Currency Rewards
+Base currency generation per enemy:
+- **Gold**: 0-5 pieces
+- **Silver**: 0-15 pieces  
+- **Copper**: 20-35 pieces
+
+### Distribution Method
+- Currency distributed evenly among survivors
+- Items distributed round-robin style
+- Remainder currency goes to first players
+
+## ⚖️ Carry Capacity System
+
+### Weight Categories
+Default item weights:
+- **Potions/Scrolls**: 0 lbs (negligible)
+- **Daggers**: 1 lb
+- **Swords/Axes**: 3 lbs
+- **Hammers/Maces**: 4 lbs
+- **Light Armor**: 5 lbs
+- **Medium Armor**: 15 lbs
+- **Heavy Armor**: 25 lbs
+
+### Encumbrance Levels
+Based on percentage of max capacity:
+
+```csharp
+Light Load (0-33%):    No penalties
+Medium Load (34-66%):  -25% movement speed
+Heavy Load (67-100%):  -50% movement, -3 DEX
+Overloaded (100%+):    -75% movement, -6 DEX
+```
+
+### Capacity Calculation
+```csharp
+Max Capacity = Base Capacity + (Strength × Strength Multiplier)
+Default: 50 + (STR × 5) pounds
+```
+
+## 📈 Game Over Statistics
+
+### Tracked Statistics
+The system tracks and displays:
+
+**Journey:**
+- Total play time
+- Days traveled  
+- Locations visited
+
+**Combat:**
+- Battles won/lost
+- Win rate percentage
+- Enemies slain
+- Damage dealt/taken
+
+**Social Impact:**
+- People helped
+- Lives saved
+- Quests completed/failed
+- Final fame level
+
+**Economic:**
+- Gold earned/spent
+- Net worth
+- Items bought/sold
+
+### Performance Messages
+Final message based on achievements:
+- **Legendary Hero**: High win rate + high social impact
+- **Valiant Fighter**: Good combat record + some helping
+- **Fierce Warrior**: Many enemies slain
+- **Kind Soul**: Helped many people
+- **Explorer**: Traveled extensively
+- **Brief Adventure**: Short journey
+
+## 🔧 Integration Points
+
+### With Existing Systems
+
+**BattleSetup Integration:**
+- Automatically hooks into `GameManager.MainBattleLoopCoroutine()`
+- Uses existing `Character.IsDead` detection
+- Works with `BattleSetupData` and `CombatDataTransfer`
+
+**Inventory Integration:**
+- Compatible with existing `Inventory` component
+- Uses `CombatDataTransfer.miscItems` for session data
+- Supports both ScriptableObject and string-based items
+
+**Character Integration:**
+- Extends existing `Character` class functionality
+- Uses `Character.Strength` for capacity calculation
+- Compatible with existing stat modifiers
+
+### Test Mode Enhancement
+`BattleTestMode` now includes:
+- Carry capacity setup for test characters
+- Enhanced inventory generation
+- Integration with post-battle systems
+
+## 🐛 Troubleshooting
+
+### Loot Not Appearing
+- Check that enemies have `Character` component with `IsDead = true`
+- Verify `PostBattleLootSystem` is created automatically
+- Check console for loot generation debug logs
+
+### Carry Capacity Not Working  
+- Ensure `CharacterCarryCapacity` component is added to characters
+- Verify character has `Character` component with `Strength` property
+- Check that `Inventory` component exists for weight calculation
+
+### Game Over Not Showing
+- Confirm all player characters have `IsDead = true`
+- Check that `GameOverScreen` component is created
+- Verify UI panel references are set up correctly
+
+### Weight Calculation Issues
+- Ensure items have proper types (`WeaponItem`, `ArmorItem`, etc.)
+- Check that inventory slots have correct quantities
+- Verify weight calculation fallbacks are working
+
+## 📝 Example Usage
+
+### Manual Loot System Setup
+```csharp
+// In your battle scene
+var lootSystem = battleScene.AddComponent<PostBattleLootSystem>();
+lootSystem.baseGoldReward = 10; // Increase gold rewards
+lootSystem.showDebugLogs = true; // Enable debugging
+
+// When battle ends with victory
+lootSystem.InitializeLootSystem(defeatedEnemies);
+lootSystem.StartLooting();
+```
+
+### Character Capacity Setup
+```csharp
+// Add to character prefab or runtime setup
+var capacity = character.AddComponent<CharacterCarryCapacity>();
+capacity.carrySystem.baseCarryCapacity = 75; // Higher base capacity
+capacity.carrySystem.strengthMultiplier = 7f; // More STR bonus
+capacity.showDebugInfo = true; // Enable weight logging
+```
+
+### Game Over Integration
+```csharp
+// Setup in main scene
+var gameOver = gameObject.AddComponent<GameOverScreen>();
+gameOver.showDetailedStats = true; // Show all statistics
+
+// Update statistics during gameplay
+gameOver.UpdateStatistic("enemiesslain", 1);
+gameOver.UpdateStatistic("peoplehelped", 1);
+gameOver.UpdateStatistic("goldearned", 50);
+```
+
+## 🔮 Future Enhancements
+
+### Planned Features
+1. **Custom Loot UI**: Visual item selection interface
+2. **Item Weight Properties**: ScriptableObject weight fields
+3. **Advanced Drop Tables**: Integration with `EnemyCharacterData.dropTable`
+4. **Persistent Statistics**: Save/load game statistics
+5. **Achievement System**: Unlock titles based on performance
+6. **Encumbrance Visual**: UI indicators for carry capacity
+7. **Auto-Sort Inventory**: Organize by weight/value
+8. **Loot Quality**: Rare/legendary item drops
+
+### Integration Opportunities
+1. **Travel System**: Track actual travel statistics
+2. **Quest System**: Real quest completion tracking  
+3. **Social System**: Actual people helped/saved counts
+4. **Fame System**: Real fame level progression
+5. **Market System**: Item value based on market prices
+
+## 📂 File Structure
+```
+Assets/Scripts/
+├── BattleScene/
+│   ├── PostBattleLootSystem.cs     # Main looting logic
+│   ├── GameManager.cs              # Enhanced battle detection
+│   └── BattleTestMode.cs           # Enhanced test setup
+├── Objects/
+│   └── CharacterCarryCapacity.cs   # Weight management
+└── UI/
+    └── GameOverScreen.cs           # Defeat screen system
+```
+
+This system provides a solid foundation for post-battle gameplay and can be extended as your RPG systems grow!

+ 166 - 0
POST_BATTLE_SYSTEMS_SUMMARY.md

@@ -0,0 +1,166 @@
+# Post-Battle Systems Implementation Summary
+
+## 🎯 Completed Implementation
+
+Your RPG now has a complete post-battle system that handles both victory and defeat scenarios!
+
+### ✅ What Was Implemented
+
+#### 1. **Victory Scenario - Looting System**
+- **Automatic loot detection** when all enemies are defeated
+- **Enemy-specific loot tables** based on character types
+- **Currency rewards** (gold/silver/copper) distributed to survivors  
+- **Item drops** added to player inventories
+- **Weight-based carry capacity** system for inventory management
+
+#### 2. **Defeat Scenario - Game Over Screen**
+- **Comprehensive statistics** tracking throughout the game
+- **Performance analysis** (battles won/lost, enemies slain, win rate)
+- **Social impact metrics** (people helped, quests completed) 
+- **Final hero assessment** with personalized ending messages
+- **Economic summary** (gold earned/spent, net worth)
+
+#### 3. **Enhanced Battle Detection**
+- **Proper alive/dead checking** using `Character.IsDead` instead of list counts
+- **Automatic system activation** when battle conditions are met
+- **Clean integration** with existing battle flow
+
+## 🚀 How It Works
+
+### Victory Flow:
+```
+All Enemies Dead → PostBattleLootSystem Activated → Loot Generated → 
+Items/Currency Distributed → Return to Exploration
+```
+
+### Defeat Flow:
+```
+All Players Dead → GameOverScreen Activated → Statistics Calculated → 
+Final Assessment → Restart/Main Menu Options
+```
+
+## 📂 Files Created/Modified
+
+### **New Core Systems:**
+- `PostBattleLootSystem.cs` - Main looting logic and distribution
+- `CharacterCarryCapacity.cs` - Weight management and encumbrance  
+- `GameOverScreen.cs` - Defeat statistics and final assessment
+
+### **Enhanced Existing Files:**
+- `GameManager.cs` - Improved battle end detection and system integration
+- `BattleTestMode.cs` - Added victory/defeat test scenarios
+- `BattleSetup.cs` - Enhanced with carry capacity component addition
+
+### **Documentation:**
+- `POST_BATTLE_LOOTING_SYSTEM_GUIDE.md` - Comprehensive system documentation
+- `QUICK_SETUP_POST_BATTLE_SYSTEMS.md` - Quick start guide
+- `POST_BATTLE_SYSTEMS_SUMMARY.md` - This summary
+
+## 🧪 Testing Your New Systems
+
+### **Victory Testing:**
+1. Open Unity and the BattleScene
+2. Right-click on `BattleTestMode` component  
+3. Select **"Create Victory Test Battle"**
+4. Start battle and defeat the weak enemies
+5. Watch console for looting messages
+
+### **Defeat Testing:**
+1. Right-click on `BattleTestMode` component
+2. Select **"Create Defeat Test Battle"**  
+3. Start battle and let the weak player die
+4. See the Game Over screen with statistics
+
+### **Expected Console Output:**
+```
+Victory:
+🏆 Players have won the battle!
+💰 Generated loot for TestSkeleton: 2g 8s 25c, 2 items
+💰 TestWarrior received: 1g 4s 12c
+💰 Added Bone to TestWarrior's inventory
+
+Defeat:  
+💀 All players have been defeated!
+📅 Journey Summary: 02:34 play time, 2 days traveled
+⚔️ Combat Record: 0 wins, 1 loss, 2 enemies slain
+Final Message: "You fought valiantly but met an unfortunate end."
+```
+
+## 🎮 Key Features
+
+### **Smart Loot Generation:**
+- **Skeleton enemies** → Bone, Rusty Sword, Bone Dust
+- **Bandit enemies** → Thieves' Tools, Rope, Dagger + extra coins
+- **Orc/Goblin enemies** → Crude Axe, Hide Armor, Iron Ration
+- **All enemies** → Random chance for Health Potions, Bandages
+
+### **Carry Capacity System:**
+- **Base capacity**: 50 lbs + (Strength × 5)
+- **Encumbrance levels**: Light/Medium/Heavy/Overloaded
+- **Penalties**: Movement speed and Dexterity reductions
+- **Character-specific**: Warriors carry more, rogues prefer staying light
+
+### **Comprehensive Statistics:**
+- **Time & Travel**: Play time, days traveled, locations visited
+- **Combat**: Win/loss record, damage dealt/taken, enemies slain  
+- **Social**: People helped, lives saved, quests completed/failed
+- **Economic**: Gold earned/spent, items bought/sold, net worth
+- **Character**: Experience gained, levels gained, characters lost
+
+## 🔧 Integration Points
+
+### **Automatic Integration:**
+- **GameManager** - Enhanced battle loop with proper end detection
+- **BattleSetup** - Carry capacity components added to characters
+- **CombatDataTransfer** - Items added to `miscItems` for session persistence
+- **Inventory System** - Compatible with existing ScriptableObject items
+
+### **Debug Features:**
+- **Detailed logging** for all loot generation and distribution
+- **Weight calculation** with encumbrance status updates  
+- **Statistics tracking** with comprehensive final assessment
+- **Test scenarios** for easy victory/defeat testing
+
+## 🔮 Future Enhancement Opportunities
+
+### **UI Enhancements:**
+- Visual loot selection interface
+- Carry capacity indicators in inventory
+- Interactive statistics dashboard
+
+### **System Integration:**
+- Real travel statistics from exploration system
+- Actual quest completion tracking
+- Persistent statistics across game sessions
+- Integration with EnemyCharacterData drop tables
+
+### **Gameplay Enhancements:**
+- Manual loot selection with weight consideration
+- Achievement system based on statistics
+- Difficulty scaling based on performance
+- Market-based item values for economic system
+
+## ✅ Verification Checklist
+
+Before considering this complete, verify:
+
+- [ ] **Victory looting works** - Enemies drop appropriate items and currency
+- [ ] **Defeat screen shows** - Statistics display when all players die  
+- [ ] **Carry capacity functions** - Weight penalties apply correctly
+- [ ] **Console logging active** - Debug messages show system operation
+- [ ] **Test scenarios work** - Context menus create appropriate battles
+- [ ] **Integration clean** - No conflicts with existing systems
+
+## 🎯 Final Notes
+
+This implementation provides a solid foundation for post-battle gameplay that enhances your RPG's progression systems. The modular design allows for easy extension and customization as your game grows.
+
+The systems work immediately with your existing battle framework and provide meaningful consequences for both victory and defeat, encouraging strategic play and character development.
+
+**Your players now have:**
+- **Meaningful rewards** for victory through loot and progression
+- **Comprehensive feedback** on their performance through statistics  
+- **Strategic weight management** decisions for inventory optimization
+- **Clear consequences** for both success and failure in combat
+
+The post-battle experience is now as engaging as the battle itself! 🏆

+ 172 - 0
QUICK_SETUP_POST_BATTLE_SYSTEMS.md

@@ -0,0 +1,172 @@
+# Quick Setup Guide: Post-Battle Looting System
+
+## 🚀 Immediate Setup Steps
+
+### Step 1: Test the Enhanced Battle Detection
+1. **Open Unity** and let scripts compile
+2. **Open BattleScene**
+3. **Run BattleTestMode** with new context menus:
+   - Right-click on `BattleTestMode` component
+   - Choose **"Create Victory Test Battle"** (strong players vs weak enemies)
+   - OR choose **"Create Defeat Test Battle"** (weak player vs strong enemies)
+
+### Step 2: Battle End Detection (Auto-Working)
+The enhanced `GameManager` now properly detects:
+- ✅ **Player Victory**: When all enemies are dead (`Character.IsDead = true`)
+- ✅ **Player Defeat**: When all players are dead  
+- ✅ **Auto-Looting**: Automatic loot distribution to survivors
+- ✅ **Game Over Screen**: Statistics display on defeat
+
+### Step 3: Enable Detailed Logging
+For debugging, check these components:
+```csharp
+// In PostBattleLootSystem
+showDebugLogs = true
+
+// In GameOverScreen  
+showDetailedStats = true
+
+// In CharacterCarryCapacity
+showDebugInfo = true
+```
+
+## 🧪 Testing the New Systems
+
+### Test Player Victory & Looting:
+1. **Use "Create Victory Test Battle"** context menu
+2. **Start battle** and defeat the weak enemies
+3. **Check console** for loot generation messages:
+   ```
+   💰 Generated loot for TestSkeleton: 2g 5s 25c, 2 items
+   💰 Auto-looted: 6g 15s 75c and 6 items
+   💰 Added Bone to TestWarrior's inventory
+   ```
+
+### Test Player Defeat & Game Over:
+1. **Use "Create Defeat Test Battle"** context menu  
+2. **Start battle** and let the weak player die
+3. **See Game Over screen** with statistics:
+   ```
+   🏆 FINAL STATISTICS
+   📅 Journey: 02:34 play time, 2 days traveled
+   ⚔️ Combat: 0 wins, 1 loss, 2 enemies slain
+   🤝 Social: 3 people helped, 1 quest completed
+   ```
+
+## 🎯 What Works Right Now
+
+### ✅ Automatic Systems (No Setup Required)
+- **Battle end detection** - Works immediately
+- **Loot generation** - Based on enemy names/types
+- **Currency distribution** - Evenly split among survivors  
+- **Item distribution** - Round-robin to player inventories
+- **Game over statistics** - Calculated from battle data
+
+### ✅ Enemy-Specific Loot Tables
+```csharp
+Skeleton Enemies → Bone, Rusty Sword, Bone Dust
+Bandit Enemies  → Thieves' Tools, Rope, Dagger + Extra Coins  
+Orc/Goblin      → Crude Axe, Hide Armor, Iron Ration
+Default         → Leather Scraps, Iron Ration, Health Potion
+```
+
+### ✅ Smart Currency Rewards
+- **Base**: 0-5 gold, 0-15 silver, 20-35 copper per enemy
+- **Bandit Bonus**: +5-15 extra copper (they're thieves!)
+- **Distribution**: Even split + remainder to first players
+
+## 🔧 Manual Component Addition (Optional)
+
+If you want to add carry capacity manually to existing characters:
+
+```csharp
+// Add to any character GameObject
+var carryCapacity = character.AddComponent<CharacterCarryCapacity>();
+
+// Configure for different character types
+if (character.name.Contains("Warrior"))
+{
+    carryCapacity.carrySystem.baseCarryCapacity = 60;  // Higher capacity
+    carryCapacity.carrySystem.strengthMultiplier = 6f; // More STR bonus
+}
+else if (character.name.Contains("Rogue"))  
+{
+    carryCapacity.carrySystem.baseCarryCapacity = 40;  // Lower capacity
+    carryCapacity.carrySystem.lightLoadThreshold = 0.4f; // Stay agile
+}
+
+carryCapacity.showDebugInfo = true; // Enable weight logging
+```
+
+## 📊 Console Output Examples
+
+### Victory Looting Messages:
+```
+🏆 Players have won the battle!
+💰 Initialized loot system with 3 lootable enemies
+💰 Generated loot for TestSkeleton: 1g 8s 22c, 1 items
+💰 Generated loot for TestBandit: 3g 12s 31c, 3 items  
+💰 Generated loot for TestOrc: 0g 6s 28c, 2 items
+💰 Auto-looted: 4g 26s 81c and 6 items
+💰 TestWarrior received: 2g 13s 40c
+💰 TestRanger received: 2g 13s 41c
+💰 Added Bone to TestWarrior's inventory
+💰 Added Thieves' Tools to TestRanger's inventory
+🏆 Battle and looting complete, returning to exploration
+```
+
+### Defeat Game Over:
+```
+💀 All players have been defeated!
+💀 Final statistics calculated - 2 enemies slain, 0 battles won
+📅 JOURNEY SUMMARY: 03:42 play time, 3 days traveled
+⚔️ COMBAT RECORD: 0 wins, 1 loss, 2 enemies slain  
+🤝 SOCIAL IMPACT: 2 people helped, 0 quests completed
+💰 ECONOMIC: 15g earned, 8g spent, 7g net worth
+Final Message: "You fought valiantly but met an unfortunate end."
+```
+
+### Carry Capacity (When Added):
+```
+📦 TestWarrior capacity: 12/65 lbs (Light)
+📦 TestRogue capacity: 18/36 lbs (Medium Load - 25% movement penalty)
+📦 TestMage encumbrance changed to: Heavy Load - 50% movement, -3 DEX penalty
+📦 Would add Iron Ration to TestWarrior (no inventory system found)
+```
+
+## 🎮 Integration with Existing Features
+
+### Battle Test Mode Enhanced:
+- **"Create Victory Test Battle"**: Strong players vs weak enemies
+- **"Create Defeat Test Battle"**: Weak player vs strong enemies  
+- **Enhanced inventory**: Character-specific test items
+- **Carry capacity ready**: Components will be added automatically
+
+### Inventory Integration:
+- **CombatDataTransfer**: Items added to `miscItems` list
+- **String-based fallback**: Works with existing inventory systems
+- **Quantity support**: Multiple of same item handled correctly
+
+### Battle System Integration: 
+- **GameManager**: Enhanced battle end detection
+- **Character.IsDead**: Proper alive/dead checking
+- **BattleUIManager**: Auto-disabled on battle end
+- **EnhancedBattleSetup**: Proper session cleanup
+
+## 🚫 Known Limitations (To Be Enhanced)
+
+1. **UI**: Currently console-based, visual UI planned
+2. **Manual Loot Selection**: Auto-loot only for now  
+3. **Weight System**: Default weights, ScriptableObject integration planned
+4. **Statistics Persistence**: Runtime only, save system integration planned
+5. **Advanced Drop Tables**: Basic generation, `EnemyCharacterData.dropTable` integration planned
+
+## 🔮 Next Steps
+
+1. **Test the systems** using the context menus
+2. **Check console output** to verify functionality  
+3. **Create UI prefabs** for loot selection (optional)
+4. **Add carry capacity** to character prefabs (optional)
+5. **Integrate with save system** when ready (future)
+
+The core systems work immediately - just run the enhanced test battles to see them in action! 🎯

+ 2 - 2
UserSettings/EditorUserSettings.asset

@@ -24,10 +24,10 @@ EditorUserSettings:
       value: 510500025d560a0c095d092111730d44464f4b78757b72357a701c31b7b16368
       flags: 0
     RecentlyUsedSceneGuid-5:
-      value: 5a08575f5207595a0f5d59741173094444164f7d7d2a23317c7a4465bbe1646d
+      value: 5a090503000558580f0d557342700844144f4d7c7b7d74692c281e63b0e2623c
       flags: 0
     RecentlyUsedSceneGuid-6:
-      value: 5a090503000558580f0d557342700844144f4d7c7b7d74692c281e63b0e2623c
+      value: 5a08575f5207595a0f5d59741173094444164f7d7d2a23317c7a4465bbe1646d
       flags: 0
     vcSharedLogLevel:
       value: 0d5e400f0650

+ 47 - 47
UserSettings/Layouts/default-6000.dwlt

@@ -19,7 +19,7 @@ MonoBehaviour:
     width: 3440
     height: 1349
   m_ShowMode: 4
-  m_Title: Scene
+  m_Title: Game
   m_RootView: {fileID: 5}
   m_MinSize: {x: 875, y: 332}
   m_MaxSize: {x: 10000, y: 10000}
@@ -39,9 +39,9 @@ MonoBehaviour:
   m_Children: []
   m_Position:
     serializedVersion: 2
-    x: 1680
+    x: 1667
     y: 0
-    width: 1105
+    width: 1098
     height: 439
   m_MinSize: {x: 102, y: 126}
   m_MaxSize: {x: 4002, y: 4026}
@@ -69,12 +69,12 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 854
-    width: 2785
+    width: 2765
     height: 439
   m_MinSize: {x: 200, y: 50}
   m_MaxSize: {x: 16192, y: 8096}
   vertical: 0
-  controlID: 74
+  controlID: 126
   draggingID: 0
 --- !u!114 &4
 MonoBehaviour:
@@ -91,9 +91,9 @@ MonoBehaviour:
   m_Children: []
   m_Position:
     serializedVersion: 2
-    x: 1400
+    x: 1391
     y: 0
-    width: 1385
+    width: 1374
     height: 854
   m_MinSize: {x: 52, y: 76}
   m_MaxSize: {x: 4002, y: 4026}
@@ -198,7 +198,7 @@ MonoBehaviour:
   m_MinSize: {x: 400, y: 100}
   m_MaxSize: {x: 32384, y: 16192}
   vertical: 0
-  controlID: 38
+  controlID: 162
   draggingID: 0
 --- !u!114 &9
 MonoBehaviour:
@@ -219,12 +219,12 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 0
-    width: 2785
+    width: 2765
     height: 1293
   m_MinSize: {x: 300, y: 100}
   m_MaxSize: {x: 24288, y: 16192}
   vertical: 1
-  controlID: 39
+  controlID: 48
   draggingID: 0
 --- !u!114 &10
 MonoBehaviour:
@@ -246,12 +246,12 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 0
-    width: 2785
+    width: 2765
     height: 854
   m_MinSize: {x: 300, y: 50}
   m_MaxSize: {x: 24288, y: 8096}
   vertical: 0
-  controlID: 40
+  controlID: 49
   draggingID: 0
 --- !u!114 &11
 MonoBehaviour:
@@ -270,7 +270,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 0
-    width: 637
+    width: 633
     height: 854
   m_MinSize: {x: 201, y: 226}
   m_MaxSize: {x: 4001, y: 4026}
@@ -294,9 +294,9 @@ MonoBehaviour:
   m_Children: []
   m_Position:
     serializedVersion: 2
-    x: 637
+    x: 633
     y: 0
-    width: 763
+    width: 758
     height: 854
   m_MinSize: {x: 202, y: 226}
   m_MaxSize: {x: 4002, y: 4026}
@@ -324,7 +324,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 0
-    width: 1680
+    width: 1667
     height: 439
   m_MinSize: {x: 231, y: 276}
   m_MaxSize: {x: 10001, y: 10026}
@@ -348,9 +348,9 @@ MonoBehaviour:
   m_Children: []
   m_Position:
     serializedVersion: 2
-    x: 2785
+    x: 2765
     y: 0
-    width: 655
+    width: 675
     height: 1293
   m_MinSize: {x: 276, y: 76}
   m_MaxSize: {x: 4001, y: 4026}
@@ -380,9 +380,9 @@ MonoBehaviour:
     m_TextWithWhitespace: "UI Builder\u200B"
   m_Pos:
     serializedVersion: 2
-    x: 1400
+    x: 1391
     y: 79
-    width: 1383
+    width: 1372
     height: 828
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -416,9 +416,9 @@ MonoBehaviour:
     m_TextWithWhitespace: "Game\u200B"
   m_Pos:
     serializedVersion: 2
-    x: 1401
+    x: 1392
     y: 24
-    width: 1383
+    width: 1372
     height: 828
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -437,7 +437,7 @@ MonoBehaviour:
   m_ShowGizmos: 0
   m_TargetDisplay: 0
   m_ClearColor: {r: 0, g: 0, b: 0, a: 0}
-  m_TargetSize: {x: 1383, y: 807}
+  m_TargetSize: {x: 1372, y: 807}
   m_TextureFilterMode: 0
   m_TextureHideFlags: 61
   m_RenderIMGUI: 1
@@ -452,8 +452,8 @@ MonoBehaviour:
     m_VRangeLocked: 0
     hZoomLockedByDefault: 0
     vZoomLockedByDefault: 0
-    m_HBaseRangeMin: -691.5
-    m_HBaseRangeMax: 691.5
+    m_HBaseRangeMin: -686
+    m_HBaseRangeMax: 686
     m_VBaseRangeMin: -403.5
     m_VBaseRangeMax: 403.5
     m_HAllowExceedBaseRangeMin: 1
@@ -473,23 +473,23 @@ MonoBehaviour:
       serializedVersion: 2
       x: 0
       y: 21
-      width: 1383
+      width: 1372
       height: 807
     m_Scale: {x: 1, y: 1}
-    m_Translation: {x: 691.5, y: 403.5}
+    m_Translation: {x: 686, y: 403.5}
     m_MarginLeft: 0
     m_MarginRight: 0
     m_MarginTop: 0
     m_MarginBottom: 0
     m_LastShownAreaInsideMargins:
       serializedVersion: 2
-      x: -691.5
+      x: -686
       y: -403.5
-      width: 1383
+      width: 1372
       height: 807
     m_MinimalGUI: 1
   m_defaultScale: 1
-  m_LastWindowPixelSize: {x: 1383, y: 828}
+  m_LastWindowPixelSize: {x: 1372, y: 828}
   m_ClearInEditMode: 1
   m_NoCameraWarning: 1
   m_LowResolutionForAspectRatios: 01000000000000000000
@@ -534,7 +534,7 @@ MonoBehaviour:
     m_OverlaysVisible: 1
   m_LockTracker:
     m_IsLocked: 0
-  m_LastSelectedObjectID: 52244
+  m_LastSelectedObjectID: 52458
 --- !u!114 &18
 MonoBehaviour:
   m_ObjectHideFlags: 52
@@ -558,7 +558,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 24
-    width: 636
+    width: 632
     height: 828
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -576,7 +576,7 @@ MonoBehaviour:
       scrollPos: {x: 0, y: 0}
       m_SelectedIDs: 
       m_LastClickedID: 0
-      m_ExpandedIDs: f2ff4cff56064dfffe064dff6ea755ffb4ba66ff90566fff32576fff56e980ffdaa889ffcaaa89ffc0ad89ff42d489ff52db89ff06e789ff82e889ff56e989ffe0f1ffff1afbffff1acc0000
+      m_ExpandedIDs: 5062e6ff0a72e6ffb87ae6ff64eaeeff5af3eeff32c5ffff04c6ffff5ef6ffff1afbfffff4ffffff8ebf0000
       m_RenameOverlay:
         m_UserAcceptedRename: 0
         m_Name: 
@@ -622,9 +622,9 @@ MonoBehaviour:
     m_TextWithWhitespace: "Scene\u200B"
   m_Pos:
     serializedVersion: 2
-    x: 638
+    x: 634
     y: 24
-    width: 761
+    width: 756
     height: 828
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -1388,7 +1388,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 24
-    width: 1679
+    width: 1666
     height: 413
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -1412,7 +1412,7 @@ MonoBehaviour:
     m_SkipHidden: 0
     m_SearchArea: 1
     m_Folders:
-    - Assets/Scenes
+    - Assets/Resources/UI/BattleSceneUI
     m_Globs: []
     m_ProductIds: 
     m_AnyWithAssetOrigin: 0
@@ -1422,16 +1422,16 @@ MonoBehaviour:
   m_ViewMode: 1
   m_StartGridSize: 67
   m_LastFolders:
-  - Assets/Scenes
+  - Assets/Resources/UI/BattleSceneUI
   m_LastFoldersGridSize: 67
   m_LastProjectPath: C:\Users\Axel-PC\RPG-RougeLiteBatteler
   m_LockTracker:
     m_IsLocked: 0
   m_FolderTreeState:
-    scrollPos: {x: 0, y: 219}
-    m_SelectedIDs: 2eb50000
-    m_LastClickedID: 46382
-    m_ExpandedIDs: 
+    scrollPos: {x: 0, y: 271}
+    m_SelectedIDs: 80d10000
+    m_LastClickedID: 53632
+    m_ExpandedIDs: 00000000d2b40000d4b40000
     m_RenameOverlay:
       m_UserAcceptedRename: 0
       m_Name: 
@@ -1460,7 +1460,7 @@ MonoBehaviour:
     scrollPos: {x: 0, y: 0}
     m_SelectedIDs: 
     m_LastClickedID: 0
-    m_ExpandedIDs: 
+    m_ExpandedIDs: 00000000d2b40000d4b40000
     m_RenameOverlay:
       m_UserAcceptedRename: 0
       m_Name: 
@@ -1539,9 +1539,9 @@ MonoBehaviour:
     m_TextWithWhitespace: "Console\u200B"
   m_Pos:
     serializedVersion: 2
-    x: 1681
+    x: 1668
     y: 24
-    width: 1103
+    width: 1096
     height: 413
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -1575,9 +1575,9 @@ MonoBehaviour:
     m_TextWithWhitespace: "Inspector\u200B"
   m_Pos:
     serializedVersion: 2
-    x: 2786
+    x: 2766
     y: 24
-    width: 654
+    width: 674
     height: 1267
   m_SerializedDataModeController:
     m_DataMode: 0