|
@@ -29,8 +29,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
|
|
|
|
|
void Start()
|
|
void Start()
|
|
|
{
|
|
{
|
|
|
- Debug.Log("🚀 BattleActionIntegration starting...");
|
|
|
|
|
-
|
|
|
|
|
// FORCE useNewActionSystem to false to preserve drag functionality
|
|
// FORCE useNewActionSystem to false to preserve drag functionality
|
|
|
useNewActionSystem = false;
|
|
useNewActionSystem = false;
|
|
|
|
|
|
|
@@ -55,7 +53,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
playerDecisionController.enabled = true;
|
|
playerDecisionController.enabled = true;
|
|
|
playerDecisionController.SetEnabled(true);
|
|
playerDecisionController.SetEnabled(true);
|
|
|
- Debug.Log("🎮 PlayerDecisionController enabled for drag functionality");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Try to find or create a simple wheel component
|
|
// Try to find or create a simple wheel component
|
|
@@ -65,7 +62,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
if (comp.GetType().Name == "SimpleActionWheel")
|
|
if (comp.GetType().Name == "SimpleActionWheel")
|
|
|
{
|
|
{
|
|
|
simpleWheelComponent = comp;
|
|
simpleWheelComponent = comp;
|
|
|
- Debug.Log("🎮 Found existing SimpleActionWheel");
|
|
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -79,7 +75,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
if (componentType != null)
|
|
if (componentType != null)
|
|
|
{
|
|
{
|
|
|
simpleWheelComponent = wheelObj.AddComponent(componentType) as MonoBehaviour;
|
|
simpleWheelComponent = wheelObj.AddComponent(componentType) as MonoBehaviour;
|
|
|
- Debug.Log("🎮 Created SimpleActionWheel automatically");
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -99,7 +94,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
ConnectSimpleWheelEvents();
|
|
ConnectSimpleWheelEvents();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Debug.Log($"✅ BattleActionIntegration initialized - useNewActionSystem: {useNewActionSystem}");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void Update()
|
|
void Update()
|
|
@@ -144,13 +138,8 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
// Allow reopening the action wheel even if an action is already selected
|
|
// Allow reopening the action wheel even if an action is already selected
|
|
|
// This enables canceling/changing the selected action
|
|
// This enables canceling/changing the selected action
|
|
|
- Debug.Log($"⌨️ {wheelKey} pressed, showing wheel for {characterForWheel.CharacterName}");
|
|
|
|
|
ShowActionWheelForCharacter(characterForWheel);
|
|
ShowActionWheelForCharacter(characterForWheel);
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- Debug.Log($"⌨️ {wheelKey} pressed but no character selected");
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (useNewActionSystem)
|
|
if (useNewActionSystem)
|
|
@@ -167,8 +156,7 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
if (currentlySelected != null && currentlySelected != lastSelectedCharacter)
|
|
if (currentlySelected != null && currentlySelected != lastSelectedCharacter)
|
|
|
{
|
|
{
|
|
|
lastSelectedCharacter = currentlySelected;
|
|
lastSelectedCharacter = currentlySelected;
|
|
|
- Debug.Log($"🖱️ Character selected for action wheel: {currentlySelected.CharacterName}");
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Clear any old instructions and show current action status
|
|
// Clear any old instructions and show current action status
|
|
|
ShowCharacterActionStatus(currentlySelected);
|
|
ShowCharacterActionStatus(currentlySelected);
|
|
|
}
|
|
}
|
|
@@ -290,25 +278,15 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
Character selectedCharacter = GetCharacterAtMousePosition();
|
|
Character selectedCharacter = GetCharacterAtMousePosition();
|
|
|
if (selectedCharacter != null)
|
|
if (selectedCharacter != null)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"🖱️ Clicked on character: {selectedCharacter.CharacterName} - Tag: {selectedCharacter.tag}");
|
|
|
|
|
-
|
|
|
|
|
if (selectedCharacter.CompareTag("Player"))
|
|
if (selectedCharacter.CompareTag("Player"))
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"✅ Confirmed player character: {selectedCharacter.CharacterName}");
|
|
|
|
|
SelectCharacterForAction(selectedCharacter);
|
|
SelectCharacterForAction(selectedCharacter);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"❌ Not a player character: {selectedCharacter.CharacterName} (Tag: {selectedCharacter.tag})");
|
|
|
|
|
- // Try to force selection anyway for testing
|
|
|
|
|
- Debug.Log($"🧪 Trying to select anyway for testing...");
|
|
|
|
|
SelectCharacterForAction(selectedCharacter);
|
|
SelectCharacterForAction(selectedCharacter);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- Debug.Log("🖱️ Clicked but no character found");
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -360,13 +338,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
// Update all character visual states to maintain proper color coding
|
|
// Update all character visual states to maintain proper color coding
|
|
|
UpdateAllCharacterVisualStates();
|
|
UpdateAllCharacterVisualStates();
|
|
|
|
|
|
|
|
- Debug.Log($"🎯 Selected character for action: {character.CharacterName}");
|
|
|
|
|
-
|
|
|
|
|
- // Don't auto-show wheel - let user press Q manually
|
|
|
|
|
- // if (useNewActionSystem)
|
|
|
|
|
- // {
|
|
|
|
|
- // ShowActionWheelForCharacter(character);
|
|
|
|
|
- // }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -403,7 +374,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
|
|
|
|
|
private void ShowActionWheelForCharacter(Character character)
|
|
private void ShowActionWheelForCharacter(Character character)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"🎯 ShowActionWheelForCharacter called for: {character.CharacterName}");
|
|
|
|
|
|
|
|
|
|
// Clear any existing instruction when showing the wheel
|
|
// Clear any existing instruction when showing the wheel
|
|
|
currentInstruction = "";
|
|
currentInstruction = "";
|
|
@@ -419,7 +389,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
var existingActionData = character.GetEnhancedActionData<EnhancedCharacterActionData>();
|
|
var existingActionData = character.GetEnhancedActionData<EnhancedCharacterActionData>();
|
|
|
if (existingActionData != null && existingActionData.hasValidAction)
|
|
if (existingActionData != null && existingActionData.hasValidAction)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"🔄 Resetting existing action for {character.CharacterName}: {existingActionData.GetActionDescription()}");
|
|
|
|
|
existingActionData.Reset();
|
|
existingActionData.Reset();
|
|
|
character.SetVisualState(ActionDecisionState.NoAction);
|
|
character.SetVisualState(ActionDecisionState.NoAction);
|
|
|
}
|
|
}
|
|
@@ -427,36 +396,21 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
// Try simple wheel first
|
|
// Try simple wheel first
|
|
|
if (simpleWheelComponent != null)
|
|
if (simpleWheelComponent != null)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"🎮 Found SimpleActionWheel component: {simpleWheelComponent.GetType().Name}");
|
|
|
|
|
|
|
|
|
|
// Use reflection to call ShowWheelForCharacter
|
|
// Use reflection to call ShowWheelForCharacter
|
|
|
var method = simpleWheelComponent.GetType().GetMethod("ShowWheelForCharacter");
|
|
var method = simpleWheelComponent.GetType().GetMethod("ShowWheelForCharacter");
|
|
|
if (method != null)
|
|
if (method != null)
|
|
|
{
|
|
{
|
|
|
- Debug.Log("🔧 Calling ShowWheelForCharacter via reflection...");
|
|
|
|
|
method.Invoke(simpleWheelComponent, new object[] { character });
|
|
method.Invoke(simpleWheelComponent, new object[] { character });
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- Debug.LogError("❌ ShowWheelForCharacter method not found on SimpleActionWheel!");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- Debug.LogError("❌ simpleWheelComponent is null!");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Fallback to battle action system
|
|
// Fallback to battle action system
|
|
|
if (battleActionSystem != null)
|
|
if (battleActionSystem != null)
|
|
|
{
|
|
{
|
|
|
- Debug.Log("🔄 Falling back to BattleActionSystem...");
|
|
|
|
|
battleActionSystem.ShowActionWheel(character);
|
|
battleActionSystem.ShowActionWheel(character);
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- Debug.LogError("BattleActionIntegration: No action wheel system found!");
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void ConnectSimpleWheelEvents()
|
|
private void ConnectSimpleWheelEvents()
|
|
@@ -467,13 +421,11 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Debug.Log($"🔧 Connecting events for SimpleActionWheel component: {simpleWheelComponent.GetType().Name}");
|
|
|
|
|
|
|
|
|
|
// Use reflection to connect to OnActionSelected event
|
|
// Use reflection to connect to OnActionSelected event
|
|
|
var eventInfo = simpleWheelComponent.GetType().GetEvent("OnActionSelected");
|
|
var eventInfo = simpleWheelComponent.GetType().GetEvent("OnActionSelected");
|
|
|
if (eventInfo != null)
|
|
if (eventInfo != null)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"✅ Found OnActionSelected event: {eventInfo.EventHandlerType}");
|
|
|
|
|
|
|
|
|
|
// Create delegate that matches the event signature: Action<BattleActionType>
|
|
// Create delegate that matches the event signature: Action<BattleActionType>
|
|
|
var delegateType = eventInfo.EventHandlerType;
|
|
var delegateType = eventInfo.EventHandlerType;
|
|
@@ -481,14 +433,8 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
|
|
|
|
|
if (methodInfo != null)
|
|
if (methodInfo != null)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"✅ Found OnActionSelected method: {methodInfo.Name}");
|
|
|
|
|
var handler = System.Delegate.CreateDelegate(delegateType, this, methodInfo);
|
|
var handler = System.Delegate.CreateDelegate(delegateType, this, methodInfo);
|
|
|
eventInfo.AddEventHandler(simpleWheelComponent, handler);
|
|
eventInfo.AddEventHandler(simpleWheelComponent, handler);
|
|
|
- Debug.Log("✅ Successfully connected SimpleActionWheel.OnActionSelected event");
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- Debug.LogError("❌ Could not find OnActionSelected method in BattleActionIntegration");
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
@@ -499,7 +445,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
|
|
|
|
|
private void OnActionSelected(BattleActionType actionType)
|
|
private void OnActionSelected(BattleActionType actionType)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"🔥 OnActionSelected called with: {actionType}");
|
|
|
|
|
|
|
|
|
|
if (lastSelectedCharacter == null)
|
|
if (lastSelectedCharacter == null)
|
|
|
{
|
|
{
|
|
@@ -507,7 +452,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Debug.Log($"🎯 {lastSelectedCharacter.CharacterName} selected action: {actionType}");
|
|
|
|
|
|
|
|
|
|
// Set action data for the character
|
|
// Set action data for the character
|
|
|
var actionData = lastSelectedCharacter.GetEnhancedActionData<EnhancedCharacterActionData>();
|
|
var actionData = lastSelectedCharacter.GetEnhancedActionData<EnhancedCharacterActionData>();
|
|
@@ -515,7 +459,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
actionData = new EnhancedCharacterActionData();
|
|
actionData = new EnhancedCharacterActionData();
|
|
|
lastSelectedCharacter.SetEnhancedActionData(actionData);
|
|
lastSelectedCharacter.SetEnhancedActionData(actionData);
|
|
|
- Debug.Log($"📝 Created new EnhancedCharacterActionData for {lastSelectedCharacter.CharacterName}");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Configure action based on type and enable targeting mode
|
|
// Configure action based on type and enable targeting mode
|
|
@@ -523,21 +466,18 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
case BattleActionType.Attack:
|
|
case BattleActionType.Attack:
|
|
|
actionData.actionType = actionType;
|
|
actionData.actionType = actionType;
|
|
|
- Debug.Log("🗡️ Attack selected - Now drag from character to target enemy!");
|
|
|
|
|
ShowInstructionMessage("ATTACK: Drag from character to enemy");
|
|
ShowInstructionMessage("ATTACK: Drag from character to enemy");
|
|
|
StartTargetingMode(lastSelectedCharacter, actionType);
|
|
StartTargetingMode(lastSelectedCharacter, actionType);
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case BattleActionType.Move:
|
|
case BattleActionType.Move:
|
|
|
actionData.actionType = actionType;
|
|
actionData.actionType = actionType;
|
|
|
- Debug.Log("👟 Move selected - Now drag from character to target position!");
|
|
|
|
|
ShowInstructionMessage("MOVE: Drag from character to target position");
|
|
ShowInstructionMessage("MOVE: Drag from character to target position");
|
|
|
StartTargetingMode(lastSelectedCharacter, actionType);
|
|
StartTargetingMode(lastSelectedCharacter, actionType);
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case BattleActionType.UseItem:
|
|
case BattleActionType.UseItem:
|
|
|
actionData.actionType = actionType;
|
|
actionData.actionType = actionType;
|
|
|
- Debug.Log("🧪 Use Item selected - showing item selection UI");
|
|
|
|
|
ShowInstructionMessage("USE ITEM: Select item from list");
|
|
ShowInstructionMessage("USE ITEM: Select item from list");
|
|
|
ShowItemSelection(lastSelectedCharacter);
|
|
ShowItemSelection(lastSelectedCharacter);
|
|
|
break;
|
|
break;
|
|
@@ -546,40 +486,32 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
actionData.actionType = actionType;
|
|
actionData.actionType = actionType;
|
|
|
actionData.state = ActionDecisionState.ActionSelected;
|
|
actionData.state = ActionDecisionState.ActionSelected;
|
|
|
lastSelectedCharacter.SetVisualState(ActionDecisionState.ActionSelected);
|
|
lastSelectedCharacter.SetVisualState(ActionDecisionState.ActionSelected);
|
|
|
- Debug.Log("✨ Cast Spell selected - implement spell selection UI");
|
|
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case BattleActionType.Defend:
|
|
case BattleActionType.Defend:
|
|
|
actionData.actionType = actionType;
|
|
actionData.actionType = actionType;
|
|
|
actionData.state = ActionDecisionState.ActionSelected;
|
|
actionData.state = ActionDecisionState.ActionSelected;
|
|
|
lastSelectedCharacter.SetVisualState(ActionDecisionState.ActionSelected);
|
|
lastSelectedCharacter.SetVisualState(ActionDecisionState.ActionSelected);
|
|
|
- Debug.Log("🛡️ Defend action set - character will defend this turn");
|
|
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case BattleActionType.RunAway:
|
|
case BattleActionType.RunAway:
|
|
|
actionData.actionType = actionType;
|
|
actionData.actionType = actionType;
|
|
|
actionData.state = ActionDecisionState.ActionSelected;
|
|
actionData.state = ActionDecisionState.ActionSelected;
|
|
|
lastSelectedCharacter.SetVisualState(ActionDecisionState.ActionSelected);
|
|
lastSelectedCharacter.SetVisualState(ActionDecisionState.ActionSelected);
|
|
|
- Debug.Log("💨 Run Away action set - character will attempt to flee");
|
|
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Debug.Log($"✅ Action {actionType} configured for {lastSelectedCharacter.CharacterName}");
|
|
|
|
|
-
|
|
|
|
|
// Update all character visual states to show proper action status
|
|
// Update all character visual states to show proper action status
|
|
|
UpdateAllCharacterVisualStates();
|
|
UpdateAllCharacterVisualStates();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void StartTargetingMode(Character character, BattleActionType actionType)
|
|
private void StartTargetingMode(Character character, BattleActionType actionType)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"🎯 Starting targeting mode for {character.CharacterName} with action {actionType}");
|
|
|
|
|
-
|
|
|
|
|
// Enable the PlayerDecisionController to handle targeting
|
|
// Enable the PlayerDecisionController to handle targeting
|
|
|
if (playerDecisionController != null)
|
|
if (playerDecisionController != null)
|
|
|
{
|
|
{
|
|
|
// Use the new public method to start targeting
|
|
// Use the new public method to start targeting
|
|
|
playerDecisionController.StartTargetingForCharacter(character, actionType);
|
|
playerDecisionController.StartTargetingForCharacter(character, actionType);
|
|
|
- Debug.Log($"✅ PlayerDecisionController targeting started for {actionType}");
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -589,7 +521,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
|
|
|
|
|
private void ShowItemSelection(Character character)
|
|
private void ShowItemSelection(Character character)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"🧪 Showing item selection for {character.CharacterName}");
|
|
|
|
|
|
|
|
|
|
if (itemSelectionUI != null)
|
|
if (itemSelectionUI != null)
|
|
|
{
|
|
{
|
|
@@ -616,7 +547,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
|
|
|
|
|
private void OnItemSelected(string itemName, int itemIndex)
|
|
private void OnItemSelected(string itemName, int itemIndex)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"📦 Item selected: {itemName} (index: {itemIndex})");
|
|
|
|
|
|
|
|
|
|
if (lastSelectedCharacter != null)
|
|
if (lastSelectedCharacter != null)
|
|
|
{
|
|
{
|
|
@@ -625,21 +555,19 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
// Check if item requires targeting (healing potions, etc. might target allies)
|
|
// Check if item requires targeting (healing potions, etc. might target allies)
|
|
|
bool requiresTargeting = IsItemRequiringTargeting(itemName);
|
|
bool requiresTargeting = IsItemRequiringTargeting(itemName);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Properly set the item action using the SetItemAction method
|
|
// Properly set the item action using the SetItemAction method
|
|
|
actionData.SetItemAction(itemName, itemIndex, requiresTargeting);
|
|
actionData.SetItemAction(itemName, itemIndex, requiresTargeting);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (!requiresTargeting)
|
|
if (!requiresTargeting)
|
|
|
{
|
|
{
|
|
|
lastSelectedCharacter.SetVisualState(ActionDecisionState.ActionSelected);
|
|
lastSelectedCharacter.SetVisualState(ActionDecisionState.ActionSelected);
|
|
|
- Debug.Log($"✅ {lastSelectedCharacter.CharacterName} will use {itemName}");
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Show the updated action status
|
|
// Show the updated action status
|
|
|
ShowCharacterActionStatus(lastSelectedCharacter);
|
|
ShowCharacterActionStatus(lastSelectedCharacter);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"🎯 {itemName} requires targeting - start targeting mode");
|
|
|
|
|
ShowInstructionMessage($"TARGET: Select target for {itemName}");
|
|
ShowInstructionMessage($"TARGET: Select target for {itemName}");
|
|
|
StartTargetingMode(lastSelectedCharacter, BattleActionType.UseItem);
|
|
StartTargetingMode(lastSelectedCharacter, BattleActionType.UseItem);
|
|
|
}
|
|
}
|
|
@@ -655,20 +583,19 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
// Add logic here to determine if item needs targeting
|
|
// Add logic here to determine if item needs targeting
|
|
|
// For now, assume most items are self-use (like health potions)
|
|
// For now, assume most items are self-use (like health potions)
|
|
|
// Healing items that can target others would return true
|
|
// Healing items that can target others would return true
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (itemName.ToLower().Contains("heal") && itemName.ToLower().Contains("other"))
|
|
if (itemName.ToLower().Contains("heal") && itemName.ToLower().Contains("other"))
|
|
|
return true;
|
|
return true;
|
|
|
if (itemName.ToLower().Contains("revive"))
|
|
if (itemName.ToLower().Contains("revive"))
|
|
|
return true;
|
|
return true;
|
|
|
if (itemName.ToLower().Contains("bomb") || itemName.ToLower().Contains("throw"))
|
|
if (itemName.ToLower().Contains("bomb") || itemName.ToLower().Contains("throw"))
|
|
|
return true;
|
|
return true;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return false; // Most items are self-use
|
|
return false; // Most items are self-use
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void OnItemSelectionCancelled()
|
|
private void OnItemSelectionCancelled()
|
|
|
{
|
|
{
|
|
|
- Debug.Log("❌ Item selection cancelled");
|
|
|
|
|
|
|
|
|
|
if (lastSelectedCharacter != null)
|
|
if (lastSelectedCharacter != null)
|
|
|
{
|
|
{
|
|
@@ -683,7 +610,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
|
|
|
|
|
private void OnCharacterActionCompleted(Character character)
|
|
private void OnCharacterActionCompleted(Character character)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"✅ Action completed for {character.CharacterName}");
|
|
|
|
|
|
|
|
|
|
// Clear selection after action is complete
|
|
// Clear selection after action is complete
|
|
|
if (character == lastSelectedCharacter)
|
|
if (character == lastSelectedCharacter)
|
|
@@ -740,7 +666,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
currentInstruction = "";
|
|
currentInstruction = "";
|
|
|
instructionTimer = 0f;
|
|
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>
|
|
/// <summary>
|
|
@@ -785,7 +710,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
lastSelectedCharacter = null;
|
|
lastSelectedCharacter = null;
|
|
|
- Debug.Log("🔄 All player actions reset");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -798,23 +722,17 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
var actionData = character.GetEnhancedActionData<EnhancedCharacterActionData>();
|
|
var actionData = character.GetEnhancedActionData<EnhancedCharacterActionData>();
|
|
|
if (actionData != null && actionData.hasValidAction)
|
|
if (actionData != null && actionData.hasValidAction)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"❌ Canceling action for {character.CharacterName}: {actionData.GetActionDescription()}");
|
|
|
|
|
actionData.Reset();
|
|
actionData.Reset();
|
|
|
character.SetVisualState(ActionDecisionState.NoAction);
|
|
character.SetVisualState(ActionDecisionState.NoAction);
|
|
|
|
|
|
|
|
ShowInstructionMessage($"Action canceled for {character.CharacterName}");
|
|
ShowInstructionMessage($"Action canceled for {character.CharacterName}");
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- Debug.Log($"No action to cancel for {character.CharacterName}");
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void ShowInstructionMessage(string message)
|
|
private void ShowInstructionMessage(string message)
|
|
|
{
|
|
{
|
|
|
currentInstruction = message;
|
|
currentInstruction = message;
|
|
|
instructionTimer = instructionDuration;
|
|
instructionTimer = instructionDuration;
|
|
|
- Debug.Log($"📢 Instruction: {message}");
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -833,7 +751,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
// Clear instructions if no action set
|
|
// Clear instructions if no action set
|
|
|
currentInstruction = "";
|
|
currentInstruction = "";
|
|
|
instructionTimer = 0f;
|
|
instructionTimer = 0f;
|
|
|
- Debug.Log($"📢 No action set for {character.CharacterName} - instructions cleared");
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -842,8 +759,6 @@ public class BattleActionIntegration : MonoBehaviour
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
public void OnTargetingComplete(Character character)
|
|
public void OnTargetingComplete(Character character)
|
|
|
{
|
|
{
|
|
|
- Debug.Log($"✅ Targeting complete for {character.CharacterName}");
|
|
|
|
|
-
|
|
|
|
|
// Update lastSelectedCharacter so action wheel knows which character was last used
|
|
// Update lastSelectedCharacter so action wheel knows which character was last used
|
|
|
lastSelectedCharacter = character;
|
|
lastSelectedCharacter = character;
|
|
|
|
|
|