Many changes to Invector inventory system, added WIP UI system, added implementation for max stamina, moving speed, attack speed, attack power, thorns
This commit is contained in:
@@ -24,6 +24,7 @@ namespace Beyond
|
||||
public float faithMult;
|
||||
public float damageMult;
|
||||
public float speedMult;
|
||||
public float staminaMult;
|
||||
public float attackSpeedMult;
|
||||
public float faithRegenMult;
|
||||
public float thornDamageMult;
|
||||
@@ -77,7 +78,8 @@ namespace Beyond
|
||||
speedMult = 1f,
|
||||
attackSpeedMult = 1f,
|
||||
faithRegenMult = 1f,
|
||||
thornDamageMult = 1f
|
||||
thornDamageMult = 1f,
|
||||
staminaMult = 1f
|
||||
};
|
||||
|
||||
// 2. Get Currently Equipped Items
|
||||
@@ -101,6 +103,7 @@ namespace Beyond
|
||||
stats.attackSpeedMult += GetPct(item, bItemAttributes.AttackSpeedBonusPercent);
|
||||
stats.faithRegenMult += GetPct(item, bItemAttributes.FaithRegenBonusPercent);
|
||||
stats.thornDamageMult += GetPct(item, bItemAttributes.ThornDamageBonusPercent);
|
||||
stats.staminaMult += GetPct(item, bItemAttributes.StaminaBonusPercent);
|
||||
}
|
||||
|
||||
// 4. Apply Harmonies (Based on Table)
|
||||
|
||||
91
Assets/Scripts/Powers/TrinketUIController.cs
Normal file
91
Assets/Scripts/Powers/TrinketUIController.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using Invector.vItemManager;
|
||||
using Invector.vCharacterController;
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
|
||||
namespace Beyond
|
||||
{
|
||||
public class TrinketUIController : MonoBehaviour
|
||||
{
|
||||
[Header("Main References")]
|
||||
public Canvas mainCanvas;
|
||||
public bEquipArea trinketEquipArea;
|
||||
public bItemWindow trinketItemWindow;
|
||||
|
||||
[Header("Settings")]
|
||||
public KeyCode openKey = KeyCode.T;
|
||||
|
||||
// CHANGED: Use a list to catch all potential item types (Gemstones, Trinkets, etc)
|
||||
public List<bItemType> trinketTypes = new List<bItemType>() { bItemType.Gemstones, bItemType.Trinkets };
|
||||
|
||||
[Header("Events")]
|
||||
public UnityEvent onOpenWindow;
|
||||
public UnityEvent onCloseWindow;
|
||||
|
||||
private bool isOpen = false;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (!mainCanvas) mainCanvas = GetComponent<Canvas>();
|
||||
if (mainCanvas) mainCanvas.enabled = false;
|
||||
if (trinketItemWindow) trinketItemWindow.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(openKey)) Toggle();
|
||||
}
|
||||
[Button]
|
||||
|
||||
public void Toggle()
|
||||
{
|
||||
isOpen = !isOpen;
|
||||
if (isOpen) Open(); else Close();
|
||||
}
|
||||
[Button]
|
||||
public void Open()
|
||||
{
|
||||
var player = Player.Instance;
|
||||
if (!player) return;
|
||||
|
||||
var itemManager = player.ItemManager;
|
||||
var inventory = itemManager.inventory;
|
||||
|
||||
if (!inventory) return;
|
||||
|
||||
// Setup Components
|
||||
trinketEquipArea.inventory = inventory;
|
||||
trinketEquipArea.itemManager = itemManager;
|
||||
trinketEquipArea.Init(); // This calls Start(), which calls SetInventory() on slots
|
||||
|
||||
// Setup Window
|
||||
trinketItemWindow.inventory = inventory;
|
||||
trinketItemWindow.gameObject.SetActive(true);
|
||||
|
||||
if (mainCanvas) mainCanvas.enabled = true;
|
||||
|
||||
Cursor.visible = true;
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
Time.timeScale = 0;
|
||||
|
||||
trinketEquipArea.SetNewItemWindow(trinketItemWindow);
|
||||
|
||||
// Pass the list of types instead of just one
|
||||
trinketEquipArea.SetEquipmentwindowWithFilter(trinketTypes);
|
||||
|
||||
onOpenWindow.Invoke();
|
||||
}
|
||||
|
||||
[Button]
|
||||
public void Close()
|
||||
{
|
||||
if (mainCanvas) mainCanvas.enabled = false;
|
||||
Cursor.visible = false;
|
||||
Cursor.lockState = CursorLockMode.Locked;
|
||||
Time.timeScale = 1;
|
||||
onCloseWindow.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Powers/TrinketUIController.cs.meta
Normal file
2
Assets/Scripts/Powers/TrinketUIController.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10136cee38aa547eeb77d6233acc00a4
|
||||
Reference in New Issue
Block a user