Axel Nordh преди 8 месеца
родител
ревизия
8f10d2c1f4
променени са 31 файла, в които са добавени 1227 реда и са изтрити 418 реда
  1. 33 0
      Assets/Resources/Items/Armor/HalfPlate.asset
  2. 34 0
      Assets/Resources/Items/Armor/Shield.asset
  3. 45 0
      Assets/Resources/Items/Miscellaneous/GreaterHealing.asset
  4. 44 0
      Assets/Resources/Items/Miscellaneous/PotionOfSpeed.asset
  5. 45 0
      Assets/Resources/Items/Miscellaneous/SuperiorHealing.asset
  6. 45 0
      Assets/Resources/Items/Miscellaneous/SupremeHealing 1.asset
  7. 34 0
      Assets/Resources/Items/Weapons/Battleaxe.asset
  8. 6 3
      Assets/Resources/Items/Weapons/Club.asset
  9. 1 1
      Assets/Resources/Items/Weapons/IronSword.asset
  10. 44 0
      Assets/Resources/TravelEvents/CheapPotionsMerchant.asset
  11. 9 9
      Assets/Resources/TravelEvents/HiddenTreasure.asset
  12. 13 15
      Assets/Resources/TravelEvents/SkeletonAmbush.asset
  13. 2 91
      Assets/Scenes/MapScene2.unity
  14. 44 2
      Assets/Scripts/BattleScene/BattleUiScript.cs
  15. 88 2
      Assets/Scripts/BattleScene/GameManager.cs
  16. 179 0
      Assets/Scripts/Debug/BattleSceneDebugHelper.cs
  17. 2 2
      Assets/Scripts/Debug/SettlementGameObjectDiagnostic.cs
  18. 0 3
      Assets/Scripts/Editor/CreateSampleItems.cs
  19. 0 3
      Assets/Scripts/Editor/EnemyWeaponMigrationTool.cs
  20. 2 199
      Assets/Scripts/Events/TravelEvents/CombatTravelEvent.cs
  21. 46 0
      Assets/Scripts/Events/TravelEvents/DiscoveryTravelEvent.cs
  22. 52 0
      Assets/Scripts/Events/TravelEvents/HazardTravelEvent.cs
  23. 47 0
      Assets/Scripts/Events/TravelEvents/RestTravelEvent.cs
  24. 58 0
      Assets/Scripts/Events/TravelEvents/TradingTravelEvent.cs
  25. 10 27
      Assets/Scripts/Objects/Items/WeaponItem.cs
  26. 0 4
      Assets/Scripts/Town/ItemCreatorHelper.cs
  27. 9 9
      Assets/Scripts/Town/SettlementTestHelper.cs
  28. 0 4
      Assets/Scripts/Utilities/SampleItemCreator.cs
  29. 167 0
      Assets/Scripts/Weapons/GenericWeapon.cs
  30. 124 0
      BATTLE_VICTORY_SCENE_TRANSITION_FIX.md
  31. 44 44
      UserSettings/Layouts/default-6000.dwlt

+ 33 - 0
Assets/Resources/Items/Armor/HalfPlate.asset

@@ -0,0 +1,33 @@
+%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: 11500000, guid: d37416b822a924a4ca8b3d4daafd98b5, type: 3}
+  m_Name: HalfPlate
+  m_EditorClassIdentifier: 
+  itemName: Half plate
+  description: Half plate consists of shaped metal plates that cover most of the
+    wearer's body. It does not include leg protection beyond simple greaves that
+    are attached with leather straps.
+  icon: {fileID: 0}
+  model3D: {fileID: 0}
+  itemType: 1
+  rarity: 0
+  goldCost: 100
+  silverCost: 0
+  copperCost: 0
+  searchTags: []
+  armorClass: 2
+  strengthModifier: 0
+  dexterityModifier: 0
+  constitutionModifier: 0
+  wisdomModifier: 0
+  armorType: 1
+  armorSlot: 1

+ 34 - 0
Assets/Resources/Items/Armor/Shield.asset

@@ -0,0 +1,34 @@
+%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: 11500000, guid: d37416b822a924a4ca8b3d4daafd98b5, type: 3}
+  m_Name: Shield
+  m_EditorClassIdentifier: 
+  itemName: Shield
+  description: A normal shield
+  icon: {fileID: 0}
+  model3D: {fileID: 0}
+  itemType: 1
+  rarity: 0
+  goldCost: 5
+  silverCost: 0
+  copperCost: 0
+  searchTags:
+  - Shield
+  - Armour
+  - Hands
+  armorClass: 1
+  strengthModifier: 0
+  dexterityModifier: 0
+  constitutionModifier: 0
+  wisdomModifier: 0
+  armorType: 0
+  armorSlot: 6

+ 45 - 0
Assets/Resources/Items/Miscellaneous/GreaterHealing.asset

@@ -0,0 +1,45 @@
+%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: 11500000, guid: 43b6eb6d169fa44439fbdc878d83e78b, type: 3}
+  m_Name: GreaterHealing
+  m_EditorClassIdentifier: 
+  itemName: Health potion
+  description: A health potion 2d6 + 2
+  icon: {fileID: 0}
+  model3D: {fileID: 0}
+  itemType: 2
+  rarity: 2
+  goldCost: 10
+  silverCost: 0
+  copperCost: 0
+  searchTags:
+  - helath
+  - potion
+  - healing
+  isConsumable: 1
+  isStackable: 1
+  maxStackSize: 99
+  healthRestoreMin: 0
+  healthRestoreMax: 0
+  healthDiceCount: 2
+  healthDiceType: 6
+  healthBonus: 2
+  manaRestoreMin: 0
+  manaRestoreMax: 0
+  manaDiceCount: 0
+  manaDiceType: 0
+  manaBonus: 0
+  temporaryStrengthBonus: 0
+  temporaryDexterityBonus: 0
+  temporaryConstitutionBonus: 0
+  temporaryWisdomBonus: 0
+  effectDuration: 0

+ 44 - 0
Assets/Resources/Items/Miscellaneous/PotionOfSpeed.asset

@@ -0,0 +1,44 @@
+%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: 11500000, guid: 43b6eb6d169fa44439fbdc878d83e78b, type: 3}
+  m_Name: PotionOfSpeed
+  m_EditorClassIdentifier: 
+  itemName: Potion of speed
+  description: A potion to double your speed (Not yet implemented)
+  icon: {fileID: 0}
+  model3D: {fileID: 0}
+  itemType: 2
+  rarity: 2
+  goldCost: 50
+  silverCost: 0
+  copperCost: 0
+  searchTags:
+  - potion
+  - speed
+  isConsumable: 1
+  isStackable: 1
+  maxStackSize: 20
+  healthRestoreMin: 0
+  healthRestoreMax: 0
+  healthDiceCount: 0
+  healthDiceType: 0
+  healthBonus: 0
+  manaRestoreMin: 0
+  manaRestoreMax: 0
+  manaDiceCount: 0
+  manaDiceType: 0
+  manaBonus: 0
+  temporaryStrengthBonus: 0
+  temporaryDexterityBonus: 0
+  temporaryConstitutionBonus: 10
+  temporaryWisdomBonus: 0
+  effectDuration: 2

+ 45 - 0
Assets/Resources/Items/Miscellaneous/SuperiorHealing.asset

@@ -0,0 +1,45 @@
+%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: 11500000, guid: 43b6eb6d169fa44439fbdc878d83e78b, type: 3}
+  m_Name: SuperiorHealing
+  m_EditorClassIdentifier: 
+  itemName: Superior Health potion
+  description: A superior health potion 3d6 + 3
+  icon: {fileID: 0}
+  model3D: {fileID: 0}
+  itemType: 2
+  rarity: 3
+  goldCost: 20
+  silverCost: 0
+  copperCost: 0
+  searchTags:
+  - helath
+  - potion
+  - healing
+  isConsumable: 1
+  isStackable: 1
+  maxStackSize: 99
+  healthRestoreMin: 0
+  healthRestoreMax: 0
+  healthDiceCount: 3
+  healthDiceType: 6
+  healthBonus: 3
+  manaRestoreMin: 0
+  manaRestoreMax: 0
+  manaDiceCount: 0
+  manaDiceType: 0
+  manaBonus: 0
+  temporaryStrengthBonus: 0
+  temporaryDexterityBonus: 0
+  temporaryConstitutionBonus: 0
+  temporaryWisdomBonus: 0
+  effectDuration: 0

+ 45 - 0
Assets/Resources/Items/Miscellaneous/SupremeHealing 1.asset

@@ -0,0 +1,45 @@
+%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: 11500000, guid: 43b6eb6d169fa44439fbdc878d83e78b, type: 3}
+  m_Name: SupremeHealing 1
+  m_EditorClassIdentifier: 
+  itemName: Supreme Health potion
+  description: A supreme health potion 3d6 + 3
+  icon: {fileID: 0}
+  model3D: {fileID: 0}
+  itemType: 2
+  rarity: 4
+  goldCost: 40
+  silverCost: 0
+  copperCost: 0
+  searchTags:
+  - helath
+  - potion
+  - healing
+  isConsumable: 1
+  isStackable: 1
+  maxStackSize: 99
+  healthRestoreMin: 0
+  healthRestoreMax: 0
+  healthDiceCount: 4
+  healthDiceType: 6
+  healthBonus: 4
+  manaRestoreMin: 0
+  manaRestoreMax: 0
+  manaDiceCount: 0
+  manaDiceType: 0
+  manaBonus: 0
+  temporaryStrengthBonus: 0
+  temporaryDexterityBonus: 0
+  temporaryConstitutionBonus: 0
+  temporaryWisdomBonus: 0
+  effectDuration: 0

+ 34 - 0
Assets/Resources/Items/Weapons/Battleaxe.asset

@@ -0,0 +1,34 @@
+%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: 11500000, guid: 3f3fc2d34ad47104ea60fdf8fa56b9e6, type: 3}
+  m_Name: Battleaxe
+  m_EditorClassIdentifier: 
+  itemName: Battleaxe
+  description: 
+  icon: {fileID: 0}
+  model3D: {fileID: 0}
+  itemType: 0
+  rarity: 0
+  goldCost: 10
+  silverCost: 0
+  copperCost: 0
+  searchTags:
+  - axe
+  minDamage: 1
+  maxDamage: 8
+  range: 1
+  weaponModifier: 0
+  attackSpeed: 1
+  weaponType: 8
+  weaponClassName: 
+  weaponPrefab: {fileID: 0}
+  arrowPrefab: {fileID: 0}

+ 6 - 3
Assets/Resources/Items/Weapons/Club.asset

@@ -18,12 +18,15 @@ MonoBehaviour:
   model3D: {fileID: 0}
   itemType: 0
   rarity: 0
-  goldCost: 5
+  goldCost: 1
   silverCost: 0
   copperCost: 0
-  searchTags: []
+  searchTags:
+  - Slow
+  - Club
+  - Hammer
   minDamage: 1
-  maxDamage: 6
+  maxDamage: 4
   range: 0
   weaponModifier: 0
   attackSpeed: 2

+ 1 - 1
Assets/Resources/Items/Weapons/IronSword.asset

@@ -30,7 +30,7 @@ MonoBehaviour:
   - military
   minDamage: 2
   maxDamage: 8
-  range: 5
+  range: 1
   weaponModifier: 1
   attackSpeed: 1
   weaponType: 1

+ 44 - 0
Assets/Resources/TravelEvents/CheapPotionsMerchant.asset

@@ -0,0 +1,44 @@
+%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: 11500000, guid: 543e594d61995984ca34d02bba7480cc, type: 3}
+  m_Name: CheapPotionsMerchant
+  m_EditorClassIdentifier: 
+  eventName: Potions Merchant
+  eventDescription: A Merchant with cheap potions
+  eventType: 1
+  rarity: 3
+  triggerType: 0
+  plainsChance: 0.192
+  forestChance: 0.136
+  mountainChance: 0.087
+  roadChance: 0.536
+  riverChance: 0.254
+  lakeChance: 0.028
+  oceanChance: 0
+  townChance: 0.118
+  villageChance: 0.353
+  bridgeChance: 0.232
+  tunnelChance: 0.093
+  ferryChance: 0
+  canOccurMultipleTimes: 0
+  cooldownDays: 2
+  merchantTypes:
+  - Traveling Merchant
+  - Caravan Trader
+  - Wandering Peddler
+  canHaveRareItems: 1
+  rareItemChance: 0.3
+  priceModifier: 0.76
+  encounterDescriptions:
+  - You encounter a {merchantType} on the road.
+  - A {merchantType} approaches your party with goods to sell.
+  - You come across a {merchantType} resting by the roadside.

+ 9 - 9
Assets/Resources/TravelEvents/HiddenTreasure.asset

@@ -9,11 +9,11 @@ MonoBehaviour:
   m_GameObject: {fileID: 0}
   m_Enabled: 1
   m_EditorHideFlags: 0
-  m_Script: {fileID: 0}
+  m_Script: {fileID: 11500000, guid: 23b1f9d25ae5eb7499084021b0f487db, type: 3}
   m_Name: HiddenTreasure
-  m_EditorClassIdentifier: Assembly-CSharp::DiscoveryTravelEvent
-  eventName: Hidden treasure
-  eventDescription: You spot a hidden treasure with loot in it.
+  m_EditorClassIdentifier: 
+  eventName: A small hidden chest
+  eventDescription: A small hidden chest with some loot in it
   eventType: 2
   rarity: 2
   triggerType: 1
@@ -21,15 +21,15 @@ MonoBehaviour:
   forestChance: 0.7
   mountainChance: 0.8
   roadChance: 0.3
-  riverChance: 0.21
-  lakeChance: 0.246
-  oceanChance: 0.387
+  riverChance: 0.142
+  lakeChance: 0.276
+  oceanChance: 0.099
   townChance: 0.1
   villageChance: 0
   bridgeChance: 0
-  tunnelChance: 0
+  tunnelChance: 0.077
   ferryChance: 0
-  canOccurMultipleTimes: 0
+  canOccurMultipleTimes: 1
   cooldownDays: 0
   minGoldFound: 10
   maxGoldFound: 100

+ 13 - 15
Assets/Resources/TravelEvents/SkeletonAmbush.asset

@@ -9,12 +9,11 @@ MonoBehaviour:
   m_GameObject: {fileID: 0}
   m_Enabled: 1
   m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: f460ab3f7cb3e5342a0c4d4cd2acb8a5, type: 3}
+  m_Script: {fileID: 11500000, guid: a7dbc93a8147cc0468deb3626bd1d55b, type: 3}
   m_Name: SkeletonAmbush
   m_EditorClassIdentifier: 
-  eventName: Skeleton Ambush
-  eventDescription: Ancient skeletal warriors rise from the ground to attack your
-    party!
+  eventName: A group of skeletons
+  eventDescription: A few skeletons wadering around in the area
   eventType: 0
   rarity: 1
   triggerType: 1
@@ -22,16 +21,16 @@ MonoBehaviour:
   forestChance: 0.8
   mountainChance: 0.9
   roadChance: 0.2
-  riverChance: 0.4
-  lakeChance: 0.3
-  oceanChance: 0.1
+  riverChance: 0.5
+  lakeChance: 0.5
+  oceanChance: 0.5
   townChance: 0.1
   villageChance: 0.3
-  bridgeChance: 0.4
-  tunnelChance: 0.7
-  ferryChance: 0.2
+  bridgeChance: 0.5
+  tunnelChance: 0.5
+  ferryChance: 0.5
   canOccurMultipleTimes: 1
-  cooldownDays: 1
+  cooldownDays: 0
   minEnemies: 1
   maxEnemies: 3
   possibleEnemies:
@@ -51,7 +50,6 @@ MonoBehaviour:
   - The enemies block your escape route! Your party suffers {damage} damage in the
     failed attempt.
   encounterDescriptions:
-  - Bones clatter as skeletal warriors emerge from the earth!
-  - Ancient skeletons wielding rusty weapons block your path!
-  - The ground splits open as undead skeletons rise to attack!
-  - Skeletal archers take aim from the shadows ahead!
+  - Your party is ambushed by {enemyType}s!
+  - A group of {enemyType}s blocks your path!
+  - You stumble upon a {enemyType} camp!

+ 2 - 91
Assets/Scenes/MapScene2.unity

@@ -204,50 +204,6 @@ Transform:
   m_Children: []
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!1 &442394812
-GameObject:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 442394814}
-  - component: {fileID: 442394813}
-  m_Layer: 0
-  m_Name: SettlementCoordinateDiagnostic
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!114 &442394813
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 442394812}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 318e63380eb7ced4b998333bb8fe3f02, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
---- !u!4 &442394814
-Transform:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 442394812}
-  serializedVersion: 2
-  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 50.538914, y: 35.312664, z: 66.63946}
-  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 &591284416
 GameObject:
   m_ObjectHideFlags: 0
@@ -519,50 +475,6 @@ Transform:
   m_Children: []
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!1 &1064064992
-GameObject:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 1064064994}
-  - component: {fileID: 1064064993}
-  m_Layer: 0
-  m_Name: SettlementInteractionTest
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!114 &1064064993
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1064064992}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 00a549e6bc5d0e940bd6ca3342f41135, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
---- !u!4 &1064064994
-Transform:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1064064992}
-  serializedVersion: 2
-  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 50.538914, y: 35.312664, z: 66.63946}
-  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 &1079165143
 GameObject:
   m_ObjectHideFlags: 0
@@ -1066,8 +978,9 @@ MonoBehaviour:
   baseEventChance: 0.15
   tilesPerEventCheck: 3
   availableEvents:
-  - {fileID: 0}
   - {fileID: 11400000, guid: 7f47d27e7a16f0d4ca61a2db845dd20e, type: 2}
+  - {fileID: 11400000, guid: 3756641546a12504cbd1273f2dd7bbf3, type: 2}
+  - {fileID: 11400000, guid: 018b7289bd8d6554096ff6df1bf4a498, type: 2}
   showDebugLogs: 0
   forceNextEvent: 0
 --- !u!114 &1581552017
@@ -1415,5 +1328,3 @@ SceneRoots:
   - {fileID: 2053130505}
   - {fileID: 1613003763}
   - {fileID: 1079165145}
-  - {fileID: 442394814}
-  - {fileID: 1064064994}

+ 44 - 2
Assets/Scripts/BattleScene/BattleUiScript.cs

@@ -134,9 +134,51 @@ public class BattleUIManager : MonoBehaviour
     // Call this from GameManager when the battle ends
     public void DisableBattleControls()
     {
-
         SetButtonsInteractable(false);
-        if (runPauseButtonElement != null) runPauseButtonElement.text = "Battle Over";
+        if (runPauseButtonElement != null)
+        {
+            runPauseButtonElement.text = "Return to Map";
+            runPauseButtonElement.SetEnabled(true); // Re-enable this button for map return
+
+            // Add new callback for returning to map
+            runPauseButtonElement.RegisterCallback<ClickEvent>(evt => OnReturnToMapButtonPressed());
+        }
+    }
+
+    /// <summary>
+    /// Handle the return to map button press after battle ends
+    /// </summary>
+    private void OnReturnToMapButtonPressed()
+    {
+        Debug.Log("🗺️ Player requested return to map via Battle Over button");
+
+        // Try to use the existing GameManager victory completion flow
+        if (GameManager.Instance != null)
+        {
+            // Use the new public method for manual return
+            GameManager.Instance.ManualReturnToMap();
+        }
+        else
+        {
+            // Fallback: try to find and use the battle setup system
+            var battleSetup = FindFirstObjectByType<EnhancedBattleSetup>();
+            if (battleSetup != null)
+            {
+                battleSetup.EndBattleSession(true); // Assume player victory
+            }
+            else
+            {
+                // Last resort: directly load the map scene
+                try
+                {
+                    UnityEngine.SceneManagement.SceneManager.LoadScene("MapScene2");
+                }
+                catch (System.Exception e)
+                {
+                    Debug.LogError($"Failed to load MapScene2 via fallback: {e.Message}");
+                }
+            }
+        }
     }
 
     void OnDestroy()

+ 88 - 2
Assets/Scripts/BattleScene/GameManager.cs

@@ -379,6 +379,37 @@ public class GameManager : MonoBehaviour
         returnButton.style.borderTopRightRadius = 8;
         returnButton.style.borderBottomLeftRadius = 8;
         returnButton.style.borderBottomRightRadius = 8;
+        returnButton.style.marginBottom = 10;
+
+        // Backup return button (fallback)
+        var backupButton = new Button(() =>
+        {
+            // Destroy the victory UI
+            if (victoryUIGO != null) Destroy(victoryUIGO);
+
+            // Direct scene load as fallback
+            try
+            {
+                Debug.Log("🗺️ Using backup scene transition to MapScene2");
+                UnityEngine.SceneManagement.SceneManager.LoadScene("MapScene2");
+            }
+            catch (System.Exception e)
+            {
+                Debug.LogError($"Backup scene transition failed: {e.Message}");
+            }
+        });
+        backupButton.text = "Force Return to Map";
+        backupButton.style.fontSize = 14;
+        backupButton.style.paddingTop = 10;
+        backupButton.style.paddingBottom = 10;
+        backupButton.style.paddingLeft = 20;
+        backupButton.style.paddingRight = 20;
+        backupButton.style.backgroundColor = new Color(0.7f, 0.4f, 0.2f, 0.9f);
+        backupButton.style.color = Color.white;
+        backupButton.style.borderTopLeftRadius = 5;
+        backupButton.style.borderTopRightRadius = 5;
+        backupButton.style.borderBottomLeftRadius = 5;
+        backupButton.style.borderBottomRightRadius = 5;
 
         // Space key hint
         var hint = new Label("Press SPACE or click the button to continue");
@@ -391,6 +422,7 @@ public class GameManager : MonoBehaviour
         panel.Add(title);
         panel.Add(message);
         panel.Add(returnButton);
+        panel.Add(backupButton);
         panel.Add(hint);
         overlay.Add(panel);
         rootElement.Add(overlay);
@@ -424,6 +456,7 @@ public class GameManager : MonoBehaviour
     private void OnLootingComplete()
     {
         Debug.Log("🏆 Battle and looting complete, returning to exploration");
+        Debug.Log($"🏆 Called from: {System.Environment.StackTrace}");
 
         // Save any updated team data back to the game state
         SaveBattleResults();
@@ -437,26 +470,65 @@ public class GameManager : MonoBehaviour
     /// </summary>
     private System.Collections.IEnumerator ReturnToExplorationScene()
     {
+        Debug.Log("🗺️ Starting return to exploration scene...");
+
         // Give a brief moment for any final UI updates
         yield return new WaitForSeconds(0.5f);
 
         // Load the exploration scene
         try
         {
+            Debug.Log("🗺️ Loading MapScene2...");
             UnityEngine.SceneManagement.SceneManager.LoadScene("MapScene2");
+            Debug.Log("🗺️ Scene load initiated successfully");
         }
         catch (System.Exception e)
         {
-            Debug.LogError($"Failed to load MapScene2: {e.Message}");
+            Debug.LogError($"❌ Failed to load MapScene2: {e.Message}");
+            Debug.LogError($"Stack trace: {e.StackTrace}");
+
             // Fallback - try to find and use battle setup
             var battleSetup = FindFirstObjectByType<EnhancedBattleSetup>();
             if (battleSetup != null)
             {
+                Debug.Log("🔄 Trying fallback via EnhancedBattleSetup...");
                 battleSetup.EndBattleSession(true); // Player victory
             }
             else
             {
-                Debug.LogWarning("No scene transition method available");
+                Debug.LogWarning("⚠️ No scene transition method available");
+
+                // Create a simple UI to inform the player
+                GameObject errorUIGO = new GameObject("SceneLoadErrorUI");
+                var uiDocument = errorUIGO.AddComponent<UIDocument>();
+                var rootElement = uiDocument.rootVisualElement;
+
+                var overlay = new VisualElement();
+                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.5f, 0, 0, 0.8f);
+                overlay.style.justifyContent = Justify.Center;
+                overlay.style.alignItems = Align.Center;
+
+                var errorLabel = new Label("Scene transition failed. Please restart the game.");
+                errorLabel.style.fontSize = 18;
+                errorLabel.style.color = Color.white;
+                errorLabel.style.unityTextAlign = TextAnchor.MiddleCenter;
+                errorLabel.style.backgroundColor = new Color(0.2f, 0.2f, 0.2f, 0.9f);
+                errorLabel.style.paddingTop = 20;
+                errorLabel.style.paddingBottom = 20;
+                errorLabel.style.paddingLeft = 20;
+                errorLabel.style.paddingRight = 20;
+                errorLabel.style.borderTopLeftRadius = 10;
+                errorLabel.style.borderTopRightRadius = 10;
+                errorLabel.style.borderBottomLeftRadius = 10;
+                errorLabel.style.borderBottomRightRadius = 10;
+
+                overlay.Add(errorLabel);
+                rootElement.Add(overlay);
             }
         }
     }
@@ -527,6 +599,20 @@ public class GameManager : MonoBehaviour
         HandlePlayerDefeat(playerCharacters);
     }
 
+    /// <summary>
+    /// [PUBLIC] Manually trigger return to map - can be called by UI buttons or debug scripts
+    /// </summary>
+    public void ManualReturnToMap()
+    {
+        Debug.Log("🗺️ [MANUAL] Manual return to map requested");
+
+        // Save any updated team data back to the game state
+        SaveBattleResults();
+
+        // Return to MapScene2 (exploration scene)
+        StartCoroutine(ReturnToExplorationScene());
+    }
+
     #endregion
 
     private IEnumerator ExecuteAllActionsSimultaneously()

+ 179 - 0
Assets/Scripts/Debug/BattleSceneDebugHelper.cs

@@ -0,0 +1,179 @@
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+/// <summary>
+/// Debug helper for testing battle scene transitions and victory scenarios
+/// </summary>
+public class BattleSceneDebugHelper : MonoBehaviour
+{
+    [Header("Debug Controls")]
+    [Tooltip("Enable debug mode to show additional logging and controls")]
+    public bool enableDebugMode = true;
+
+    [Header("Scene Testing")]
+    [Tooltip("Name of the map scene to return to")]
+    public string mapSceneName = "MapScene2";
+
+    private void Update()
+    {
+        if (!enableDebugMode) return;
+
+        // Debug hotkeys
+        if (Input.GetKeyDown(KeyCode.F1))
+        {
+            TestSceneTransition();
+        }
+
+        if (Input.GetKeyDown(KeyCode.F2))
+        {
+            ForcePlayerVictory();
+        }
+
+        if (Input.GetKeyDown(KeyCode.F3))
+        {
+            TestReturnToMap();
+        }
+    }
+
+    [ContextMenu("Test Scene Transition")]
+    public void TestSceneTransition()
+    {
+        Debug.Log("🧪 [DEBUG] Testing scene transition to " + mapSceneName);
+
+        try
+        {
+            SceneManager.LoadScene(mapSceneName);
+            Debug.Log("✅ Scene transition initiated successfully");
+        }
+        catch (System.Exception e)
+        {
+            Debug.LogError($"❌ Scene transition failed: {e.Message}");
+        }
+    }
+
+    [ContextMenu("Force Player Victory")]
+    public void ForcePlayerVictory()
+    {
+        Debug.Log("🧪 [DEBUG] Forcing player victory...");
+
+        if (GameManager.Instance != null)
+        {
+            // Use the GameManager's test victory method if available
+            var method = typeof(GameManager).GetMethod("TestBattleVictory",
+                System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
+
+            if (method != null)
+            {
+                method.Invoke(GameManager.Instance, null);
+                Debug.Log("✅ Used GameManager.TestBattleVictory()");
+            }
+            else
+            {
+                Debug.LogWarning("⚠️ GameManager.TestBattleVictory() method not found");
+                // Manually kill all enemies
+                ForceKillAllEnemies();
+            }
+        }
+        else
+        {
+            Debug.LogError("❌ GameManager.Instance is null");
+        }
+    }
+
+    [ContextMenu("Test Return to Map")]
+    public void TestReturnToMap()
+    {
+        Debug.Log("🧪 [DEBUG] Testing return to map via OnLootingComplete...");
+
+        if (GameManager.Instance != null)
+        {
+            // Call the OnLootingComplete method directly
+            var method = typeof(GameManager).GetMethod("OnLootingComplete",
+                System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
+
+            if (method != null)
+            {
+                method.Invoke(GameManager.Instance, null);
+                Debug.Log("✅ Called OnLootingComplete() via reflection");
+            }
+            else
+            {
+                Debug.LogError("❌ OnLootingComplete method not found");
+            }
+        }
+        else
+        {
+            Debug.LogError("❌ GameManager.Instance is null");
+        }
+    }
+
+    private void ForceKillAllEnemies()
+    {
+        Debug.Log("🧪 [DEBUG] Manually killing all enemies...");
+
+        if (GameManager.Instance != null && GameManager.Instance.enemyCharacters != null)
+        {
+            foreach (var enemy in GameManager.Instance.enemyCharacters)
+            {
+                if (enemy != null)
+                {
+                    var character = enemy.GetComponent<Character>();
+                    if (character != null && !character.IsDead)
+                    {
+                        character.TakeDamage(1000); // Force death
+                        Debug.Log($"🔪 Killed enemy: {enemy.name}");
+                    }
+                }
+            }
+        }
+    }
+
+    [ContextMenu("Debug Battle State")]
+    public void DebugBattleState()
+    {
+        Debug.Log("🔍 [DEBUG] Current battle state:");
+
+        if (GameManager.Instance != null)
+        {
+            Debug.Log($"  Players: {GameManager.Instance.playerCharacters?.Count ?? 0}");
+            Debug.Log($"  Enemies: {GameManager.Instance.enemyCharacters?.Count ?? 0}");
+
+            var alivePlayers = GameManager.Instance.GetAlivePlayers();
+            var aliveEnemies = GameManager.Instance.enemyCharacters?.Where(e => e != null && !e.GetComponent<Character>()?.IsDead == true).Count() ?? 0;
+
+            Debug.Log($"  Alive Players: {alivePlayers?.Count ?? 0}");
+            Debug.Log($"  Alive Enemies: {aliveEnemies}");
+
+            bool battleShouldEnd = (alivePlayers?.Count ?? 0) == 0 || aliveEnemies == 0;
+            Debug.Log($"  Battle should end: {battleShouldEnd}");
+        }
+        else
+        {
+            Debug.LogError("  GameManager.Instance is null!");
+        }
+    }
+
+    private void OnGUI()
+    {
+        if (!enableDebugMode) return;
+
+        // Simple debug GUI
+        GUILayout.BeginArea(new Rect(10, 10, 300, 200));
+        GUILayout.Label("Battle Debug Controls", GUI.skin.box);
+
+        if (GUILayout.Button("F1: Test Scene Transition"))
+            TestSceneTransition();
+
+        if (GUILayout.Button("F2: Force Player Victory"))
+            ForcePlayerVictory();
+
+        if (GUILayout.Button("F3: Test Return to Map"))
+            TestReturnToMap();
+
+        if (GUILayout.Button("Debug Battle State"))
+            DebugBattleState();
+
+        GUILayout.Label("Hotkeys: F1, F2, F3");
+        GUILayout.EndArea();
+    }
+}

+ 2 - 2
Assets/Scripts/Debug/SettlementGameObjectDiagnostic.cs

@@ -11,7 +11,7 @@ public class SettlementGameObjectDiagnostic : MonoBehaviour
         Debug.Log("=== SETTLEMENT GAMEOBJECT DIAGNOSTIC ===");
 
         // Find all GameObjects with settlement-related names
-        var allObjects = FindObjectsOfType<GameObject>();
+        var allObjects = FindObjectsByType<GameObject>(UnityEngine.FindObjectsSortMode.None);
 
         foreach (var obj in allObjects)
         {
@@ -63,7 +63,7 @@ public class SettlementGameObjectDiagnostic : MonoBehaviour
         Debug.Log("\n=== UI DOCUMENT SEARCH ===");
 
         // Check for UIDocument components
-        var uiDocuments = FindObjectsOfType<UnityEngine.UIElements.UIDocument>();
+        var uiDocuments = FindObjectsByType<UnityEngine.UIElements.UIDocument>(UnityEngine.FindObjectsSortMode.None);
         Debug.Log($"Found {uiDocuments.Length} UIDocument components:");
 
         foreach (var uiDoc in uiDocuments)

+ 0 - 3
Assets/Scripts/Editor/CreateSampleItems.cs

@@ -40,7 +40,6 @@ public class CreateSampleItems
         sword.weaponModifier = 0;
         sword.attackSpeed = 1.0f;
         sword.weaponType = WeaponType.Sword;
-        sword.weaponClassName = "SimpleSword";
         sword.searchTags = new string[] { "sword", "melee", "blade", "basic", "one-handed" };
 
         AssetDatabase.CreateAsset(sword, "Assets/Resources/Items/Weapons/SimpleSword.asset");
@@ -60,7 +59,6 @@ public class CreateSampleItems
         bow.weaponModifier = 0;
         bow.attackSpeed = 0.8f;
         bow.weaponType = WeaponType.Bow;
-        bow.weaponClassName = "SimpleBow";
         bow.searchTags = new string[] { "bow", "ranged", "arrow", "hunting", "wood" };
 
         AssetDatabase.CreateAsset(bow, "Assets/Resources/Items/Weapons/SimpleBow.asset");
@@ -80,7 +78,6 @@ public class CreateSampleItems
         sword.weaponModifier = 1;
         sword.attackSpeed = 1.0f;
         sword.weaponType = WeaponType.Sword;
-        sword.weaponClassName = "SimpleSword";
         sword.searchTags = new string[] { "sword", "melee", "blade", "iron", "guard", "military" };
 
         AssetDatabase.CreateAsset(sword, "Assets/Resources/Items/Weapons/IronSword.asset");

+ 0 - 3
Assets/Scripts/Editor/EnemyWeaponMigrationTool.cs

@@ -139,7 +139,6 @@ public class EnemyWeaponMigrationTool : EditorWindow
         sword.weaponModifier = 0;
         sword.attackSpeed = 1.0f;
         sword.weaponType = WeaponType.Sword;
-        sword.weaponClassName = "SimpleSword";
         sword.goldCost = 10;
 
         AssetDatabase.CreateAsset(sword, $"{folderPath}/EnemySword.asset");
@@ -154,7 +153,6 @@ public class EnemyWeaponMigrationTool : EditorWindow
         bow.weaponModifier = 0;
         bow.attackSpeed = 2.0f;
         bow.weaponType = WeaponType.Bow;
-        bow.weaponClassName = "SimpleBow";
         bow.goldCost = 15;
 
         AssetDatabase.CreateAsset(bow, $"{folderPath}/EnemyBow.asset");
@@ -169,7 +167,6 @@ public class EnemyWeaponMigrationTool : EditorWindow
         dagger.weaponModifier = 1;
         dagger.attackSpeed = 0.8f;
         dagger.weaponType = WeaponType.Dagger;
-        dagger.weaponClassName = "SimpleSword"; // Using sword class as base
         dagger.goldCost = 8;
 
         AssetDatabase.CreateAsset(dagger, $"{folderPath}/EnemyDagger.asset");

+ 2 - 199
Assets/Scripts/Events/TravelEventTypes.cs → Assets/Scripts/Events/TravelEvents/CombatTravelEvent.cs

@@ -1,3 +1,4 @@
+
 using UnityEngine;
 
 /// <summary>
@@ -210,202 +211,4 @@ public class CombatTravelEvent : TravelEvent
         townChance = 0.1f; // Very unlikely in towns
         villageChance = 0.3f;
     }
-}
-
-/// <summary>
-/// Trading encounter events - merchants, traders, caravans
-/// More likely on roads and near settlements
-/// </summary>
-[CreateAssetMenu(fileName = "New Trading Event", menuName = "RPG/Travel Events/Trading Event")]
-public class TradingTravelEvent : TravelEvent
-{
-    [Header("Trading Event Settings")]
-    public string[] merchantTypes = { "Traveling Merchant", "Caravan Trader", "Wandering Peddler" };
-    public bool canHaveRareItems = true;
-    [Range(0f, 1f)]
-    public float rareItemChance = 0.3f;
-    [Range(0.5f, 1.5f)]
-    public float priceModifier = 1f;
-
-    [Header("Trading Event Descriptions")]
-    [TextArea(2, 4)]
-    public string[] encounterDescriptions = {
-        "You encounter a {merchantType} on the road.",
-        "A {merchantType} approaches your party with goods to sell.",
-        "You come across a {merchantType} resting by the roadside."
-    };
-
-    public override EventResult ExecuteEvent(TravelEventContext context)
-    {
-        string merchantType = merchantTypes[Random.Range(0, merchantTypes.Length)];
-        string description = encounterDescriptions[Random.Range(0, encounterDescriptions.Length)];
-        description = description.Replace("{merchantType}", merchantType);
-
-        var result = EventResult.SimpleTrading(description, merchantType);
-        result.tradingData.hasRareItems = canHaveRareItems && Random.value < rareItemChance;
-        result.tradingData.priceModifier = priceModifier;
-
-        return result;
-    }
-
-    void OnEnable()
-    {
-        // Set default values for trading events
-        eventType = EventType.Trading;
-        rarity = EventRarity.Common;
-
-        // Trading events are more likely on roads and near settlements
-        roadChance = 0.9f;
-        townChance = 0.7f;
-        villageChance = 0.8f;
-        bridgeChance = 0.6f; // Common crossing points
-        ferryChance = 0.5f;
-
-        // Less likely in wilderness
-        forestChance = 0.3f;
-        mountainChance = 0.2f;
-        plainsChance = 0.5f;
-    }
-}
-
-/// <summary>
-/// Discovery events - finding treasures, resources, or hidden locations
-/// </summary>
-[CreateAssetMenu(fileName = "New Discovery Event", menuName = "RPG/Travel Events/Discovery Event")]
-public class DiscoveryTravelEvent : TravelEvent
-{
-    [Header("Discovery Settings")]
-    public int minGoldFound = 10;
-    public int maxGoldFound = 100;
-    public bool canFindItems = true;
-
-    [Header("Discovery Descriptions")]
-    [TextArea(2, 4)]
-    public string[] discoveryDescriptions = {
-        "Your party discovers a hidden cache containing {amount} gold!",
-        "While exploring, you find an abandoned stash with {amount} gold pieces.",
-        "A keen-eyed party member spots something valuable - {amount} gold!"
-    };
-
-    public override EventResult ExecuteEvent(TravelEventContext context)
-    {
-        int goldFound = Random.Range(minGoldFound, maxGoldFound + 1);
-        string description = discoveryDescriptions[Random.Range(0, discoveryDescriptions.Length)];
-        description = description.Replace("{amount}", goldFound.ToString());
-
-        return new EventResult(description)
-        {
-            goldChange = goldFound
-        };
-    }
-
-    void OnEnable()
-    {
-        eventType = EventType.Discovery;
-        rarity = EventRarity.Uncommon;
-
-        // More likely in remote areas
-        forestChance = 0.7f;
-        mountainChance = 0.8f;
-        plainsChance = 0.4f;
-        roadChance = 0.3f;
-        townChance = 0.1f;
-    }
-}
-
-/// <summary>
-/// Rest events - safe camping spots, inns, healing springs
-/// </summary>
-[CreateAssetMenu(fileName = "New Rest Event", menuName = "RPG/Travel Events/Rest Event")]
-public class RestTravelEvent : TravelEvent
-{
-    [Header("Rest Settings")]
-    public int healthRestored = 25;
-    public bool restoresAllHealth = false;
-
-    [Header("Rest Descriptions")]
-    [TextArea(2, 4)]
-    public string[] restDescriptions = {
-        "Your party finds a peaceful grove perfect for resting and recovers {health} health.",
-        "A natural spring provides refreshing water, restoring {health} health to your party.",
-        "Your party discovers a safe camping spot and takes time to tend wounds, recovering {health} health."
-    };
-
-    public override EventResult ExecuteEvent(TravelEventContext context)
-    {
-        int actualHealing = restoresAllHealth ? 100 : healthRestored;
-        string description = restDescriptions[Random.Range(0, restDescriptions.Length)];
-        description = description.Replace("{health}", actualHealing.ToString());
-
-        return new EventResult(description)
-        {
-            healthChange = actualHealing
-        };
-    }
-
-    void OnEnable()
-    {
-        eventType = EventType.Rest;
-        rarity = EventRarity.Common;
-
-        // More likely in natural areas
-        forestChance = 0.8f;
-        riverChance = 0.9f;
-        lakeChance = 0.9f;
-        plainsChance = 0.6f;
-        mountainChance = 0.5f;
-        roadChance = 0.4f;
-        townChance = 0.2f;
-    }
-}
-
-/// <summary>
-/// Hazard events - natural dangers, traps, environmental challenges
-/// </summary>
-[CreateAssetMenu(fileName = "New Hazard Event", menuName = "RPG/Travel Events/Hazard Event")]
-public class HazardTravelEvent : TravelEvent
-{
-    [Header("Hazard Settings")]
-    public int minHealthLoss = 5;
-    public int maxHealthLoss = 20;
-    public int goldCost = 0; // Cost to avoid the hazard
-
-    [Header("Hazard Descriptions")]
-    [TextArea(2, 4)]
-    public string[] hazardDescriptions = {
-        "Your party gets caught in a sudden rockslide, losing {damage} health.",
-        "Treacherous terrain causes injuries to your party members, resulting in {damage} health loss.",
-        "A hidden pit trap catches one of your party members, causing {damage} damage."
-    };
-
-    public override EventResult ExecuteEvent(TravelEventContext context)
-    {
-        int damage = Random.Range(minHealthLoss, maxHealthLoss + 1);
-        string description = hazardDescriptions[Random.Range(0, hazardDescriptions.Length)];
-        description = description.Replace("{damage}", damage.ToString());
-
-        return new EventResult(description)
-        {
-            healthChange = -damage,
-            goldChange = -goldCost
-        };
-    }
-
-    void OnEnable()
-    {
-        eventType = EventType.Hazard;
-        rarity = EventRarity.Common;
-
-        // More likely in dangerous terrain
-        mountainChance = 0.9f;
-        forestChance = 0.6f;
-        riverChance = 0.7f;
-        oceanChance = 0.8f;
-
-        // Less likely in safe areas
-        roadChance = 0.2f;
-        townChance = 0.1f;
-        villageChance = 0.2f;
-        plainsChance = 0.4f;
-    }
-}
+}

+ 46 - 0
Assets/Scripts/Events/TravelEvents/DiscoveryTravelEvent.cs

@@ -0,0 +1,46 @@
+using UnityEngine;
+
+/// <summary>
+/// Discovery events - finding treasures, resources, or hidden locations
+/// </summary>
+[CreateAssetMenu(fileName = "New Discovery Event", menuName = "RPG/Travel Events/Discovery Event")]
+public class DiscoveryTravelEvent : TravelEvent
+{
+    [Header("Discovery Settings")]
+    public int minGoldFound = 10;
+    public int maxGoldFound = 100;
+    public bool canFindItems = true;
+
+    [Header("Discovery Descriptions")]
+    [TextArea(2, 4)]
+    public string[] discoveryDescriptions = {
+        "Your party discovers a hidden cache containing {amount} gold!",
+        "While exploring, you find an abandoned stash with {amount} gold pieces.",
+        "A keen-eyed party member spots something valuable - {amount} gold!"
+    };
+
+    public override EventResult ExecuteEvent(TravelEventContext context)
+    {
+        int goldFound = Random.Range(minGoldFound, maxGoldFound + 1);
+        string description = discoveryDescriptions[Random.Range(0, discoveryDescriptions.Length)];
+        description = description.Replace("{amount}", goldFound.ToString());
+
+        return new EventResult(description)
+        {
+            goldChange = goldFound
+        };
+    }
+
+    void OnEnable()
+    {
+        eventType = EventType.Discovery;
+        rarity = EventRarity.Uncommon;
+
+        // More likely in remote areas
+        forestChance = 0.7f;
+        mountainChance = 0.8f;
+        plainsChance = 0.4f;
+        roadChance = 0.3f;
+        townChance = 0.1f;
+    }
+}

+ 52 - 0
Assets/Scripts/Events/TravelEvents/HazardTravelEvent.cs

@@ -0,0 +1,52 @@
+using UnityEngine;
+
+/// <summary>
+/// Hazard events - natural dangers, traps, environmental challenges
+/// </summary>
+[CreateAssetMenu(fileName = "New Hazard Event", menuName = "RPG/Travel Events/Hazard Event")]
+public class HazardTravelEvent : TravelEvent
+{
+    [Header("Hazard Settings")]
+    public int minHealthLoss = 5;
+    public int maxHealthLoss = 20;
+    public int goldCost = 0; // Cost to avoid the hazard
+
+    [Header("Hazard Descriptions")]
+    [TextArea(2, 4)]
+    public string[] hazardDescriptions = {
+        "Your party gets caught in a sudden rockslide, losing {damage} health.",
+        "Treacherous terrain causes injuries to your party members, resulting in {damage} health loss.",
+        "A hidden pit trap catches one of your party members, causing {damage} damage."
+    };
+
+    public override EventResult ExecuteEvent(TravelEventContext context)
+    {
+        int damage = Random.Range(minHealthLoss, maxHealthLoss + 1);
+        string description = hazardDescriptions[Random.Range(0, hazardDescriptions.Length)];
+        description = description.Replace("{damage}", damage.ToString());
+
+        return new EventResult(description)
+        {
+            healthChange = -damage,
+            goldChange = -goldCost
+        };
+    }
+
+    void OnEnable()
+    {
+        eventType = EventType.Hazard;
+        rarity = EventRarity.Common;
+
+        // More likely in dangerous terrain
+        mountainChance = 0.9f;
+        forestChance = 0.6f;
+        riverChance = 0.7f;
+        oceanChance = 0.8f;
+
+        // Less likely in safe areas
+        roadChance = 0.2f;
+        townChance = 0.1f;
+        villageChance = 0.2f;
+        plainsChance = 0.4f;
+    }
+}

+ 47 - 0
Assets/Scripts/Events/TravelEvents/RestTravelEvent.cs

@@ -0,0 +1,47 @@
+using UnityEngine;
+
+/// <summary>
+/// Rest events - safe camping spots, inns, healing springs
+/// </summary>
+[CreateAssetMenu(fileName = "New Rest Event", menuName = "RPG/Travel Events/Rest Event")]
+public class RestTravelEvent : TravelEvent
+{
+    [Header("Rest Settings")]
+    public int healthRestored = 25;
+    public bool restoresAllHealth = false;
+
+    [Header("Rest Descriptions")]
+    [TextArea(2, 4)]
+    public string[] restDescriptions = {
+        "Your party finds a peaceful grove perfect for resting and recovers {health} health.",
+        "A natural spring provides refreshing water, restoring {health} health to your party.",
+        "Your party discovers a safe camping spot and takes time to tend wounds, recovering {health} health."
+    };
+
+    public override EventResult ExecuteEvent(TravelEventContext context)
+    {
+        int actualHealing = restoresAllHealth ? 100 : healthRestored;
+        string description = restDescriptions[Random.Range(0, restDescriptions.Length)];
+        description = description.Replace("{health}", actualHealing.ToString());
+
+        return new EventResult(description)
+        {
+            healthChange = actualHealing
+        };
+    }
+
+    void OnEnable()
+    {
+        eventType = EventType.Rest;
+        rarity = EventRarity.Common;
+
+        // More likely in natural areas
+        forestChance = 0.8f;
+        riverChance = 0.9f;
+        lakeChance = 0.9f;
+        plainsChance = 0.6f;
+        mountainChance = 0.5f;
+        roadChance = 0.4f;
+        townChance = 0.2f;
+    }
+}

+ 58 - 0
Assets/Scripts/Events/TravelEvents/TradingTravelEvent.cs

@@ -0,0 +1,58 @@
+
+using UnityEngine;
+
+/// <summary>
+/// Trading encounter events - merchants, traders, caravans
+/// More likely on roads and near settlements
+/// </summary>
+[CreateAssetMenu(fileName = "New Trading Event", menuName = "RPG/Travel Events/Trading Event")]
+public class TradingTravelEvent : TravelEvent
+{
+    [Header("Trading Event Settings")]
+    public string[] merchantTypes = { "Traveling Merchant", "Caravan Trader", "Wandering Peddler" };
+    public bool canHaveRareItems = true;
+    [Range(0f, 1f)]
+    public float rareItemChance = 0.3f;
+    [Range(0.5f, 1.5f)]
+    public float priceModifier = 1f;
+
+    [Header("Trading Event Descriptions")]
+    [TextArea(2, 4)]
+    public string[] encounterDescriptions = {
+        "You encounter a {merchantType} on the road.",
+        "A {merchantType} approaches your party with goods to sell.",
+        "You come across a {merchantType} resting by the roadside."
+    };
+
+    public override EventResult ExecuteEvent(TravelEventContext context)
+    {
+        string merchantType = merchantTypes[Random.Range(0, merchantTypes.Length)];
+        string description = encounterDescriptions[Random.Range(0, encounterDescriptions.Length)];
+        description = description.Replace("{merchantType}", merchantType);
+
+        var result = EventResult.SimpleTrading(description, merchantType);
+        result.tradingData.hasRareItems = canHaveRareItems && Random.value < rareItemChance;
+        result.tradingData.priceModifier = priceModifier;
+
+        return result;
+    }
+
+    void OnEnable()
+    {
+        // Set default values for trading events
+        eventType = EventType.Trading;
+        rarity = EventRarity.Common;
+
+        // Trading events are more likely on roads and near settlements
+        roadChance = 0.9f;
+        townChance = 0.7f;
+        villageChance = 0.8f;
+        bridgeChance = 0.6f; // Common crossing points
+        ferryChance = 0.5f;
+
+        // Less likely in wilderness
+        forestChance = 0.3f;
+        mountainChance = 0.2f;
+        plainsChance = 0.5f;
+    }
+}

+ 10 - 27
Assets/Scripts/Objects/Items/WeaponItem.cs

@@ -13,7 +13,7 @@ public class WeaponItem : Item
     public WeaponType weaponType;
 
     [Header("Weapon Behavior")]
-    public string weaponClassName; // The class name to instantiate (e.g., "SimpleSword", "SimpleBow")
+    // weaponClassName is no longer needed - behavior determined by weaponType enum
 
     [Header("Weapon Prefabs")]
     public GameObject weaponPrefab; // 3D model prefab for the weapon
@@ -35,36 +35,19 @@ public class WeaponItem : Item
         GameObject weaponObject = new GameObject(itemName);
         weaponObject.transform.SetParent(parent, false);
 
-        Weapon weaponComponent = null;
+        // Use GenericWeapon for all weapons - it will configure itself based on WeaponType
+        GenericWeapon weaponComponent = weaponObject.AddComponent<GenericWeapon>();
 
-        // Create the appropriate weapon component based on weaponClassName
-        switch (weaponClassName)
+        if (weaponComponent != null)
         {
-            case "SimpleSword":
-                var swordComponent = weaponObject.AddComponent<SimpleSword>();
-                swordComponent.InitializeFromItem(this);
-                weaponComponent = swordComponent;
-                break;
-            case "SimpleBow":
-                var bowComponent = weaponObject.AddComponent<SimpleBow>();
-                bowComponent.arrowPrefab = arrowPrefab;
-                bowComponent.InitializeFromItem(this);
-                weaponComponent = bowComponent;
-                break;
-            case "Fists":
-                var fistsComponent = weaponObject.AddComponent<Fists>();
-                weaponComponent = fistsComponent;
-                break;
-            // Add more weapon types here as you create them
-            default:
-                Debug.LogError($"Unknown weapon class: {weaponClassName}");
-                DestroyImmediate(weaponObject);
-                return null;
+            weaponComponent.InitializeFromItem(this);
+            Debug.Log($"Created weapon instance: {itemName} of type {weaponType}");
         }
-
-        if (weaponComponent != null)
+        else
         {
-            Debug.Log($"Created weapon instance: {itemName}");
+            Debug.LogError($"Failed to create GenericWeapon component for: {itemName}");
+            DestroyImmediate(weaponObject);
+            return null;
         }
 
         return weaponComponent;

+ 0 - 4
Assets/Scripts/Town/ItemCreatorHelper.cs

@@ -33,7 +33,6 @@ public class ItemCreatorHelper
         simpleSword.itemType = ItemType.Weapon;
         simpleSword.rarity = ItemRarity.Common;
         simpleSword.weaponType = WeaponType.Sword;
-        simpleSword.weaponClassName = "SimpleSword";
         simpleSword.minDamage = 4;
         simpleSword.maxDamage = 8;
         simpleSword.searchTags = new string[] { "melee", "blade", "sword", "iron" };
@@ -47,7 +46,6 @@ public class ItemCreatorHelper
         warAxe.itemType = ItemType.Weapon;
         warAxe.rarity = ItemRarity.Common;
         warAxe.weaponType = WeaponType.Axe;
-        warAxe.weaponClassName = "SimpleSword"; // Reuse for now
         warAxe.minDamage = 6;
         warAxe.maxDamage = 12;
         warAxe.searchTags = new string[] { "melee", "axe", "two-handed", "heavy" };
@@ -61,7 +59,6 @@ public class ItemCreatorHelper
         huntingBow.itemType = ItemType.Weapon;
         huntingBow.rarity = ItemRarity.Common;
         huntingBow.weaponType = WeaponType.Bow;
-        huntingBow.weaponClassName = "SimpleBow";
         huntingBow.minDamage = 3;
         huntingBow.maxDamage = 6;
         huntingBow.range = 30;
@@ -76,7 +73,6 @@ public class ItemCreatorHelper
         ironDagger.itemType = ItemType.Weapon;
         ironDagger.rarity = ItemRarity.Common;
         ironDagger.weaponType = WeaponType.Dagger;
-        ironDagger.weaponClassName = "SimpleSword"; // Reuse for now
         ironDagger.minDamage = 2;
         ironDagger.maxDamage = 5;
         ironDagger.searchTags = new string[] { "melee", "dagger", "quick", "light", "iron" };

+ 9 - 9
Assets/Scripts/Town/SettlementTestHelper.cs

@@ -18,15 +18,15 @@ public class SettlementTestHelper : MonoBehaviour
         Debug.Log("SettlementTestHelper: DISABLED - No test context creation allowed");
         return;
 
-        if (createContextOnStart)
-        {
-            Debug.Log("SettlementTestHelper: Creating test context (should only happen during testing)");
-            CreateTestSettlementContext();
-        }
-        else
-        {
-            Debug.Log("SettlementTestHelper: Disabled - not creating test context");
-        }
+        // if (createContextOnStart)
+        // {
+        //     Debug.Log("SettlementTestHelper: Creating test context (should only happen during testing)");
+        //     CreateTestSettlementContext();
+        // }
+        // else
+        // {
+        //     Debug.Log("SettlementTestHelper: Disabled - not creating test context");
+        // }
     }
 
     [ContextMenu("Create Test Town Context")]

+ 0 - 4
Assets/Scripts/Utilities/SampleItemCreator.cs

@@ -28,7 +28,6 @@ public class SampleItemCreator : MonoBehaviour
         simpleSword.weaponModifier = 0;
         simpleSword.attackSpeed = 1.0f;
         simpleSword.weaponType = WeaponType.Sword;
-        simpleSword.weaponClassName = "SimpleSword";
         simpleSword.goldCost = 10;
         simpleSword.searchTags = new string[] { "sword", "melee", "blade", "basic" };
 
@@ -42,7 +41,6 @@ public class SampleItemCreator : MonoBehaviour
         simpleBow.weaponModifier = 0;
         simpleBow.attackSpeed = 2.0f;
         simpleBow.weaponType = WeaponType.Bow;
-        simpleBow.weaponClassName = "SimpleBow";
         simpleBow.goldCost = 15;
         simpleBow.searchTags = new string[] { "bow", "ranged", "arrow", "basic" };
 
@@ -56,7 +54,6 @@ public class SampleItemCreator : MonoBehaviour
         ironSword.weaponModifier = 1;
         ironSword.attackSpeed = 1.0f;
         ironSword.weaponType = WeaponType.Sword;
-        ironSword.weaponClassName = "SimpleSword"; // Still uses SimpleSword for now
         ironSword.rarity = ItemRarity.Uncommon;
         ironSword.goldCost = 25;
         ironSword.searchTags = new string[] { "sword", "melee", "blade", "iron", "metal" };
@@ -71,7 +68,6 @@ public class SampleItemCreator : MonoBehaviour
         compositeBow.weaponModifier = 1;
         compositeBow.attackSpeed = 1.8f;
         compositeBow.weaponType = WeaponType.Bow;
-        compositeBow.weaponClassName = "SimpleBow"; // Still uses SimpleBow for now
         compositeBow.rarity = ItemRarity.Uncommon;
         compositeBow.goldCost = 35;
         compositeBow.searchTags = new string[] { "bow", "ranged", "arrow", "composite" };

+ 167 - 0
Assets/Scripts/Weapons/GenericWeapon.cs

@@ -0,0 +1,167 @@
+using UnityEngine;
+
+/// <summary>
+/// A single weapon class that can handle all weapon types through configuration
+/// </summary>
+public class GenericWeapon : Weapon
+{
+    [Header("Weapon Configuration")]
+    public WeaponBehaviorType behaviorType;
+    public GameObject arrowPrefab; // For ranged weapons
+
+    private WeaponItem weaponData;
+
+    // Implement abstract properties from Weapon base class
+    public override int MinDamage => weaponData?.minDamage ?? 1;
+    public override int MaxDamage => weaponData?.maxDamage ?? 1;
+    public override int Range => weaponData?.range ?? 1;
+    public override int WeaponModifier
+    {
+        get => weaponData?.weaponModifier ?? 0;
+        set => weaponModifier = value; // Set the base class field
+    }
+
+    public void InitializeFromItem(WeaponItem item)
+    {
+        weaponData = item;
+
+        // Set basic weapon properties
+        weaponName = item.itemName;
+        description = item.description;
+        attackSpeed = item.attackSpeed;
+
+        // Determine behavior type from weapon data
+        DetermineBehaviorType(item);
+
+        // Initialize based on behavior
+        InitializeBehavior(item);
+
+        Debug.Log($"GenericWeapon initialized as {behaviorType} for {item.itemName}");
+    }
+
+    private void DetermineBehaviorType(WeaponItem item)
+    {
+        // Determine behavior based on WeaponType enum or weapon name
+        switch (item.weaponType)
+        {
+            case WeaponType.Fists:
+                behaviorType = WeaponBehaviorType.Melee;
+                break;
+            case WeaponType.Bow:
+            case WeaponType.Crossbow:
+                behaviorType = WeaponBehaviorType.Ranged;
+                if (item.arrowPrefab != null) arrowPrefab = item.arrowPrefab;
+                break;
+            case WeaponType.Sword:
+            case WeaponType.Axe:
+            case WeaponType.Mace:
+            case WeaponType.Hammer:
+            case WeaponType.Spear:
+                behaviorType = WeaponBehaviorType.Melee;
+                break;
+            case WeaponType.Staff:
+                behaviorType = WeaponBehaviorType.Magic;
+                break;
+            case WeaponType.Dagger:
+                behaviorType = WeaponBehaviorType.FastMelee;
+                break;
+            default:
+                behaviorType = WeaponBehaviorType.Melee;
+                break;
+        }
+    }
+
+    private void InitializeBehavior(WeaponItem item)
+    {
+        // Set weapon stats from item data
+        // Assuming Weapon base class has these properties
+        // You'll need to adjust based on your actual Weapon class structure
+
+        // Example initialization:
+        // damage = Random.Range(item.minDamage, item.maxDamage + 1);
+        // range = item.range;
+        // attackSpeed = item.attackSpeed;
+
+        // Initialize specific behavior patterns
+        switch (behaviorType)
+        {
+            case WeaponBehaviorType.Ranged:
+                InitializeRangedWeapon(item);
+                break;
+            case WeaponBehaviorType.FastMelee:
+                InitializeFastMeleeWeapon(item);
+                break;
+            case WeaponBehaviorType.Magic:
+                InitializeMagicWeapon(item);
+                break;
+            default:
+                InitializeMeleeWeapon(item);
+                break;
+        }
+    }
+
+    private void InitializeMeleeWeapon(WeaponItem item)
+    {
+        // Standard melee weapon setup
+        Debug.Log($"Initialized melee weapon: {item.itemName}");
+    }
+
+    private void InitializeRangedWeapon(WeaponItem item)
+    {
+        // Ranged weapon setup
+        if (arrowPrefab == null && item.arrowPrefab != null)
+        {
+            arrowPrefab = item.arrowPrefab;
+        }
+        Debug.Log($"Initialized ranged weapon: {item.itemName} with arrows: {arrowPrefab != null}");
+    }
+
+    private void InitializeFastMeleeWeapon(WeaponItem item)
+    {
+        // Fast attack weapon setup (daggers, etc.)
+        Debug.Log($"Initialized fast melee weapon: {item.itemName}");
+    }
+
+    private void InitializeMagicWeapon(WeaponItem item)
+    {
+        // Magic weapon setup (staffs, etc.)
+        Debug.Log($"Initialized magic weapon: {item.itemName}");
+    }
+
+    // Override attack method to add behavior-specific logic
+    public override void Attack(GameObject target)
+    {
+        // Call the base attack method first (handles all the standard logic)
+        base.Attack(target);
+
+        // Add any behavior-specific effects here if needed
+        switch (behaviorType)
+        {
+            case WeaponBehaviorType.Ranged:
+                // Could add special ranged effects here
+                Debug.Log($"{weaponData.itemName} fires with ranged behavior!");
+                break;
+            case WeaponBehaviorType.FastMelee:
+                // Could add fast attack effects here
+                Debug.Log($"{weaponData.itemName} strikes with fast melee behavior!");
+                break;
+            case WeaponBehaviorType.Magic:
+                // Could add magic effects here
+                Debug.Log($"{weaponData.itemName} attacks with magical energy!");
+                break;
+            default:
+                // Standard melee behavior
+                Debug.Log($"{weaponData.itemName} performs melee attack!");
+                break;
+        }
+    }
+}
+
+[System.Serializable]
+public enum WeaponBehaviorType
+{
+    Melee,
+    Ranged,
+    FastMelee,
+    Magic
+}

+ 124 - 0
BATTLE_VICTORY_SCENE_TRANSITION_FIX.md

@@ -0,0 +1,124 @@
+# Battle Victory Scene Transition Fix & Backup Solutions
+
+## 🎯 Problem Addressed
+- MapScene2 doesn't load after victory in BattleScene
+- Need backup "BattleOver" button functionality to return to map
+
+## 🔧 Solutions Implemented
+
+### 1. **Enhanced Battle UI Manager (BattleUiScript.cs)**
+**Changes Made:**
+- Modified `DisableBattleControls()` method to change "Battle Over" button text to "Return to Map"
+- Added click functionality to the "Return to Map" button
+- Implemented multiple fallback mechanisms for scene transition
+
+**New Functionality:**
+- When battle ends, the Run/Pause button becomes "Return to Map"
+- Clicking the button triggers the same victory completion flow as normal
+- Multiple fallback options if primary method fails
+
+### 2. **Enhanced GameManager (GameManager.cs)**
+**Changes Made:**
+- Added extensive logging to `OnLootingComplete()` method for debugging
+- Enhanced error handling in `ReturnToExplorationScene()` with detailed logging
+- Added backup button to victory screen for additional reliability
+- Added public `ManualReturnToMap()` method for external calls
+
+**New Features:**
+- Better error reporting when scene transition fails
+- Visual error message if all transition methods fail
+- Backup "Force Return to Map" button in victory screen
+- Public method for manual map return
+
+### 3. **Debug Helper Tool (BattleSceneDebugHelper.cs)**
+**New Script Created:**
+- Provides debug controls for testing battle transitions
+- Hotkeys: F1 (test scene transition), F2 (force victory), F3 (test return)
+- GUI debug panel with buttons for easy testing
+- Context menu options for testing different scenarios
+
+## 🚀 Setup Instructions
+
+### **Step 1: Automatic Application**
+The changes have been automatically applied to your existing scripts. No manual intervention needed.
+
+### **Step 2: Add Debug Helper (Optional)**
+1. **Create Debug GameObject**:
+   ```
+   In your BattleScene:
+   1. Create an empty GameObject named "DebugHelper"
+   2. Add the BattleSceneDebugHelper component
+   3. Enable "Enable Debug Mode" in the inspector
+   ```
+
+2. **Test the Debug Controls**:
+   - Press F1 to test scene transition
+   - Press F2 to force player victory
+   - Press F3 to test return to map
+   - Use the GUI panel in the top-left corner
+
+### **Step 3: Verify Scene Settings**
+Ensure your build settings include these scenes in order:
+```
+0. TitleScreenScene
+1. MainTeamSelectScene  
+2. MapScene2           <- Important: This must be included
+3. BattleScene
+4. TownScene (optional)
+```
+
+## 🧪 Testing Your Fix
+
+### **Test Scenario 1: Normal Victory**
+1. Start a battle in BattleScene
+2. Defeat all enemies
+3. Complete any looting (if applicable)
+4. Should automatically return to MapScene2
+
+### **Test Scenario 2: Backup Button Method**
+1. Start a battle in BattleScene
+2. Defeat all enemies
+3. If automatic return fails, click "Return to Map" button (was "Battle Over")
+4. Should return to MapScene2
+
+### **Test Scenario 3: Victory Screen Backup**
+1. Force victory (F2 or context menu "Test Battle Victory")
+2. In victory screen, try the main "Return to Map" button
+3. If that fails, try the "Force Return to Map" backup button
+
+### **Test Scenario 4: Debug Tools**
+1. Use F1 to test direct scene transition
+2. Use F2 to force victory and test complete flow
+3. Use F3 to test the return mechanism specifically
+
+## 🔍 Debugging Information
+
+### **Console Log Messages to Watch For:**
+- `🏆 Battle and looting complete, returning to exploration` - Normal flow starting
+- `🗺️ Starting return to exploration scene...` - Scene transition beginning  
+- `🗺️ Loading MapScene2...` - Scene load initiated
+- `🗺️ Player requested return to map via Battle Over button` - Backup button used
+- `❌ Failed to load MapScene2:` - Error occurred (investigate further)
+
+### **Common Issues & Solutions:**
+1. **"Scene not in build settings"** → Check EditorBuildSettings.asset includes MapScene2
+2. **"OnLootingComplete not called"** → Victory logic may not be triggering properly
+3. **"Button not responding"** → UI setup issue, check UIDocument and UXML
+
+## ⚡ Quick Fix Commands
+
+If you need to test quickly, use these context menu options:
+- Right-click GameManager → "Test Battle Victory"
+- Right-click BattleSceneDebugHelper → "Test Scene Transition"
+- Right-click BattleSceneDebugHelper → "Force Player Victory"
+
+## 🛡️ Fallback Chain
+The system now has multiple fallback mechanisms:
+
+1. **Primary**: Normal victory → looting → OnLootingComplete() → ReturnToExplorationScene()
+2. **Backup 1**: "Return to Map" button → ManualReturnToMap() → ReturnToExplorationScene()
+3. **Backup 2**: Victory screen "Force Return to Map" → Direct SceneManager.LoadScene()
+4. **Backup 3**: EnhancedBattleSetup.EndBattleSession() → CombatSceneManager.ReturnToMapCoroutine()
+5. **Last Resort**: Direct SceneManager.LoadScene("MapScene2")
+
+This ensures that players can always return to the map, even if the primary victory flow encounters issues.

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

@@ -39,7 +39,7 @@ MonoBehaviour:
   m_Children: []
   m_Position:
     serializedVersion: 2
-    x: 1667
+    x: 1666
     y: 0
     width: 1098
     height: 439
@@ -69,12 +69,12 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 854
-    width: 2765
+    width: 2764
     height: 439
   m_MinSize: {x: 200, y: 50}
   m_MaxSize: {x: 16192, y: 8096}
   vertical: 0
-  controlID: 125
+  controlID: 124
   draggingID: 0
 --- !u!114 &4
 MonoBehaviour:
@@ -91,9 +91,9 @@ MonoBehaviour:
   m_Children: []
   m_Position:
     serializedVersion: 2
-    x: 924
+    x: 1237
     y: 0
-    width: 1841
+    width: 1527
     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: 161
+  controlID: 160
   draggingID: 0
 --- !u!114 &9
 MonoBehaviour:
@@ -219,12 +219,12 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 0
-    width: 2765
+    width: 2764
     height: 1293
   m_MinSize: {x: 300, y: 100}
   m_MaxSize: {x: 24288, y: 16192}
   vertical: 1
-  controlID: 50
+  controlID: 48
   draggingID: 0
 --- !u!114 &10
 MonoBehaviour:
@@ -246,12 +246,12 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 0
-    width: 2765
+    width: 2764
     height: 854
   m_MinSize: {x: 300, y: 50}
   m_MaxSize: {x: 24288, y: 8096}
   vertical: 0
-  controlID: 51
+  controlID: 49
   draggingID: 0
 --- !u!114 &11
 MonoBehaviour:
@@ -296,7 +296,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 633
     y: 0
-    width: 291
+    width: 604
     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: 1667
+    width: 1666
     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: 2765
+    x: 2764
     y: 0
-    width: 675
+    width: 676
     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: 1391
+    x: 1237
     y: 79
-    width: 1372
+    width: 1525
     height: 828
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -416,9 +416,9 @@ MonoBehaviour:
     m_TextWithWhitespace: "Game\u200B"
   m_Pos:
     serializedVersion: 2
-    x: 925
+    x: 1238
     y: 24
-    width: 1839
+    width: 1525
     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: 1839, y: 807}
+  m_TargetSize: {x: 1525, 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: -919.5
-    m_HBaseRangeMax: 919.5
+    m_HBaseRangeMin: -762.5
+    m_HBaseRangeMax: 762.5
     m_VBaseRangeMin: -403.5
     m_VBaseRangeMax: 403.5
     m_HAllowExceedBaseRangeMin: 1
@@ -473,23 +473,23 @@ MonoBehaviour:
       serializedVersion: 2
       x: 0
       y: 21
-      width: 1839
+      width: 1525
       height: 807
     m_Scale: {x: 1, y: 1}
-    m_Translation: {x: 919.5, y: 403.5}
+    m_Translation: {x: 762.5, y: 403.5}
     m_MarginLeft: 0
     m_MarginRight: 0
     m_MarginTop: 0
     m_MarginBottom: 0
     m_LastShownAreaInsideMargins:
       serializedVersion: 2
-      x: -919.5
+      x: -762.5
       y: -403.5
-      width: 1839
+      width: 1525
       height: 807
     m_MinimalGUI: 1
   m_defaultScale: 1
-  m_LastWindowPixelSize: {x: 1839, y: 828}
+  m_LastWindowPixelSize: {x: 1525, 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: -37720
+  m_LastSelectedObjectID: -20294994
 --- !u!114 &18
 MonoBehaviour:
   m_ObjectHideFlags: 52
@@ -576,7 +576,7 @@ MonoBehaviour:
       scrollPos: {x: 0, y: 0}
       m_SelectedIDs: 
       m_LastClickedID: 0
-      m_ExpandedIDs: 466dffff8ca8ffff50c6ffff12cdffff8ed2ffff72daffff80f2ffff16f3ffff1ef4ffffc0f4ffff68f5ffff08f6ffff1afbffff
+      m_ExpandedIDs: 3c6cb9fe86dcc1fecee1c1feeaeac1fe68f4c1fec2f5c1fe7cf8c1fe7ef8c1fee052cafee252cafedcacd2fedeacd2fe3807dbfe3a07dbfe2261e3fe2461e3fe9abeebfe9cbeebfed6cd04ffd8cd04ff5e8515ff608515ff9e3d26ffa03d26ff3a9c2eff3c9c2eff28563fff2a563ffff8b947fffab947ff241450ff7c7158ff7e7158fff2cb60fff4cb60ff80ead5ff1ef0d5ffb2aee6ff1afbfffff4ffffffd2c80000d4c9000038cc000044cd00000cd000000ed1000074d300004ad500009cd8000070d9000072da000074db000074dc000078dd000034de0000
       m_RenameOverlay:
         m_UserAcceptedRename: 0
         m_Name: 
@@ -624,7 +624,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 634
     y: 24
-    width: 289
+    width: 602
     height: 828
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -1256,9 +1256,9 @@ MonoBehaviour:
     m_GridAxis: 1
     m_gridOpacity: 0.5
   m_Rotation:
-    m_Target: {x: 0.15735282, y: 0.6030923, z: -0.122881055, w: 0.7722813}
+    m_Target: {x: 0.31192484, y: 0.67680126, z: -0.39066193, w: 0.54039305}
     speed: 2
-    m_Value: {x: 0.15735283, y: 0.6030923, z: -0.12288106, w: 0.7722813}
+    m_Value: {x: 0.31192487, y: 0.67680126, z: -0.39066193, w: 0.54039305}
   m_Size:
     m_Target: 10
     speed: 2
@@ -1388,7 +1388,7 @@ MonoBehaviour:
     serializedVersion: 2
     x: 0
     y: 24
-    width: 1666
+    width: 1665
     height: 413
   m_SerializedDataModeController:
     m_DataMode: 0
@@ -1402,7 +1402,7 @@ MonoBehaviour:
     m_ContainerData: []
     m_OverlaysVisible: 1
   m_SearchFilter:
-    m_NameFilter: settlementinte
+    m_NameFilter: 
     m_ClassNames: []
     m_AssetLabels: []
     m_AssetBundleNames: []
@@ -1412,26 +1412,26 @@ MonoBehaviour:
     m_SkipHidden: 0
     m_SearchArea: 1
     m_Folders:
-    - Assets/Scripts/Objects
+    - Assets/Scenes
     m_Globs: []
     m_ProductIds: 
     m_AnyWithAssetOrigin: 0
-    m_OriginalText: settlementinte
+    m_OriginalText: 
     m_ImportLogFlags: 0
     m_FilterByTypeIntersection: 0
   m_ViewMode: 1
   m_StartGridSize: 67
   m_LastFolders:
-  - Assets/Scripts/Objects
+  - Assets/Scenes
   m_LastFoldersGridSize: 67
   m_LastProjectPath: C:\Users\Axel-PC\RPG-RougeLiteBatteler
   m_LockTracker:
     m_IsLocked: 0
   m_FolderTreeState:
-    scrollPos: {x: 0, y: 163}
-    m_SelectedIDs: 4ab70000
-    m_LastClickedID: 46922
-    m_ExpandedIDs: 0000000076b4000078b400007ab400007cb400007eb40000
+    scrollPos: {x: 0, y: 11}
+    m_SelectedIDs: d6b60000
+    m_LastClickedID: 46806
+    m_ExpandedIDs: 00000000c4b40000c6b40000c8b40000cab40000ccb40000
     m_RenameOverlay:
       m_UserAcceptedRename: 0
       m_Name: 
@@ -1460,7 +1460,7 @@ MonoBehaviour:
     scrollPos: {x: 0, y: 0}
     m_SelectedIDs: 
     m_LastClickedID: 0
-    m_ExpandedIDs: 0000000076b4000078b400007ab400007cb400007eb40000
+    m_ExpandedIDs: 00000000c4b40000c6b40000c8b40000cab40000ccb40000
     m_RenameOverlay:
       m_UserAcceptedRename: 0
       m_Name: 
@@ -1539,7 +1539,7 @@ MonoBehaviour:
     m_TextWithWhitespace: "Console\u200B"
   m_Pos:
     serializedVersion: 2
-    x: 1668
+    x: 1667
     y: 24
     width: 1096
     height: 413
@@ -1575,9 +1575,9 @@ MonoBehaviour:
     m_TextWithWhitespace: "Inspector\u200B"
   m_Pos:
     serializedVersion: 2
-    x: 2766
+    x: 2765
     y: 24
-    width: 674
+    width: 675
     height: 1267
   m_SerializedDataModeController:
     m_DataMode: 0