[Player][Interaction][Assets] Add placeholder assets for some more sprites. Move all to External/Placeholder. Add list of assets with attributions. Pulver combines items now

This commit is contained in:
Michal Pikulski
2025-09-04 13:08:14 +02:00
parent 496ef10b8b
commit da5d2f2545
60 changed files with 3245 additions and 15 deletions

View File

@@ -0,0 +1,40 @@
using UnityEngine;
[RequireComponent(typeof(Pickup))]
public class CombineWithBehavior : InteractionRequirementBase
{
public override bool TryInteract(FollowerController follower)
{
var heldItem = follower.currentlyHeldItem;
var pickup = GetComponent<Pickup>();
if (heldItem == null)
{
DebugUIMessage.Show("You need an item to combine.");
OnFailure?.Invoke();
return false;
}
if (pickup == null || pickup.itemData == null)
{
DebugUIMessage.Show("Target item is missing or invalid.");
OnFailure?.Invoke();
return false;
}
var rule = GameManager.Instance.GetCombinationRule(heldItem, pickup.itemData);
if (rule != null && rule.result != null)
{
// Remove both items and add result to follower's inventory
follower.SetHeldItem(rule.result);
follower.justCombined = true;
OnSuccess?.Invoke();
return true;
}
else
{
string heldName = heldItem.itemName ?? "an item";
string targetName = pickup.itemData.itemName ?? "target item";
DebugUIMessage.Show($"Cannot combine {heldName} with {targetName}.");
OnFailure?.Invoke();
return false;
}
}
}