using System; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; [RequireComponent(typeof(EntityStats))] public class Player : Entity { public enum PlayerType { Fighter, Berserker, Wizard, Sorcerer, Ranger, Gunslinger, IsAlly } private Inventory playerInventory; private PlayerType playerType; protected override void OnEnable() { modList = new EntityModList(); animator = GetComponent<EntityAnimation>(); if (this.spawnedPosition == null) this.spawnedPosition = transform.parent; } /// <summary> /// Connects all of the stats that were gathered during creation to the player class for battling /// </summary> public void IndicateStats(PlayerHandler playerHandler) { this.Entity_Name = playerHandler.PlayerName; this.Health = playerHandler.Health; this.maxHealth = playerHandler.MaxHealth; this.Mana = playerHandler.Mana; this.maxMana = playerHandler.MaxMana; this.Armor = playerHandler.Armor; this.maxArmor = playerHandler.Armor; this.stats.SetStat("STR", playerHandler.Strength); this.stats.SetStat("INT", playerHandler.Intelligence); this.stats.SetStat("CON", playerHandler.Constitution); this.stats.SetStat("WIS", playerHandler.Wisdom); this.stats.SetStat("DEX", playerHandler.Dexterity); this.stats.SetStat("CHA", playerHandler.Charisma); this.stats.SetStat("LCK", playerHandler.Luck); this.playerInventory = playerHandler.PlayerInven; this.playerType = playerHandler.PlayersType; } protected override void UpdateHealthVis() { base.UpdateHealthVis(); GeneralUI.Instance.UpdateHealthAndMana(this); this.genStatsChanged = false; } protected override void UpdateStatusFields() { base.UpdateStatusFields(); GeneralUI.Instance.UpdateModifiers(this); } public void InitiateAttack() => animator.PlayAttackAnimation(); public override Inventory GetInventory() => playerInventory; public PlayerType GetPlayerType() => playerType; }