public void UpdateStatusEffects(EntityCombatManager combat) { ///* Let's generate the status effect string */ //string status_string = ""; //List<StatusEffect> effects = combat.GetStatusEffects(); //foreach(StatusEffect e in effects) //{ // /* Is the value positive or negative? */ // string pos_neg = "+"; // if (e.effect_value < 0) // pos_neg = "-"; // /* Get the absolute value of this effect */ // int value = Mathf.Abs(e.effect_value); // /* Should we append a newline? */ // if (!string.IsNullOrEmpty(status_string)) // status_string += "\n"; // /* Append the status string */ // status_string += pos_neg + value + " " + StatusEffect.EffectToName(e.effect_type); //} //statusEffectsText.text = status_string; }
protected override void AfterAwake() { /* Get the combat manager for this player */ combatManager = GetComponent <EntityCombatManager>(); if (combatManager == null) { throw new System.Exception("Why does this player not have a combat manager?"); } /* Get the player skills manager for this player */ skillsManager = GetComponent <PlayerSkillsManager>(); if (skillsManager == null) { throw new System.Exception("Why does this player not have a player skills manager?"); } /* Get our quest manager */ questManager = GetComponent <PlayerQuestManager>(); if (questManager == null) { throw new System.Exception("There is no quest manager attached to this player!"); } /* We're not inspecting any item right now */ inspecting = false; beforeInspecting = null; }
// Update is called once per frame void Update() { EntityCombatManager playerCombat = PlayerManager.Instance.Player.CombatManager; float healthPCT = playerCombat.CurrentHealth / playerCombat.MaxHealth; float manaPCT = playerCombat.EntitySpellManager.CurrentMana / playerCombat.EntitySpellManager.MaxMana; float staminaPCT = playerCombat.CurrentStamina / playerCombat.MaxStamina; HealthBar.fillAmount = healthPCT; ManaBar.fillAmount = manaPCT; StaminaBar.fillAmount = staminaPCT; }
public Entity(EntityCombatAI combatAI, EntityTaskAI taskAI, EntityMovementData movementData, string name = "un-named_entity", bool isFixed = false) { Name = name; IsFixed = isFixed; SetPosition(Vector3.zero); EntityAI = new EntityAI(this, combatAI, taskAI); Inventory = new Inventory(); CombatManager = new EntityCombatManager(this); SkillTree = new SkillTree(); MovementData = movementData; }
public Entity(EntityCombatAI combatAI, EntityTaskAI taskAI, EntityMovementData movementData, string name = "un-named_entity", bool isFixed = false) { Name = name; IsFixed = isFixed; // MoveEntity(Vector3.zero); Debug.Log("Base entity created"); EntityAI = new EntityAI(this, combatAI, taskAI); Inventory = new Inventory(); CombatManager = new EntityCombatManager(this); SkillTree = new SkillTree(); MovementData = movementData; CurrentSubworldID = -1; IsAlive = true; }
/// <summary> /// Handles processing the charge levels of the current attack. /// </summary> /// <param name="entityManager">The entity itself.</param> /// <param name="currentAttack">The current attack the entity is doing.</param> /// <returns>If the frame should be held.</returns> private bool HandleChargeLevels(EntityManager entityManager, AttackDefinition currentAttack) { EntityCombatManager cManager = (EntityCombatManager)entityManager.CombatManager; if (!charging) { return(false); } if (!entityManager.InputManager.GetButton((int)EntityInputs.ATTACK).isDown) { charging = false; return(false); } bool result = false; for (int i = 0; i < currentAttack.chargeWindows.Count; i++) { // Not on the correct frame. if (entityManager.StateManager.CurrentStateFrame != currentAttack.chargeWindows[i].frame) { continue; } // Still have charge levels to go through. if (entityManager.CombatManager.CurrentChargeLevel < currentAttack.chargeWindows[i].chargeLevels.Count) { cManager.IncrementChargeLevelCharge(); // Charge completed, move on to the next level. if (cManager.CurrentChargeLevelCharge == currentAttack.chargeWindows[i].chargeLevels[cManager.CurrentChargeLevel].maxChargeFrames) { cManager.SetChargeLevel(cManager.CurrentChargeLevel + 1); cManager.SetChargeLevelCharge(0); } } else if (currentAttack.chargeWindows[i].releaseOnCompletion) { charging = false; } result = true; // Only one charge level can be handled per frame, ignore everything else. break; } return(result); }
/** * Update the player's stats in the journal. This does not flip the journal * open to the stats page and only updates the page's information. */ public void UpdateStats(string player_name, EntitySkills skills, EntityCombatManager combat) { /* Load the left page */ PlayerStatsLeftPage leftPage = (PlayerStatsLeftPage)playerStats.pageLeft; /* Update all of the page progresses */ leftPage.UpdatePlayerName(player_name); if (skills != null) { leftPage.UpdatePlayerSkills(skills); } /* Load the right page */ PlayerStatsRightPage rightPage = (PlayerStatsRightPage)playerStats.pageRight; /* Update the status effects that are affecting the player */ if (combat != null) { rightPage.UpdateStatusEffects(combat); } }
public EntityHitboxManager(EntityCombatManager combatManager, EntityManager manager) : base(combatManager, manager) { }
public void SetupPageManager(string player_name, PlayerQuestManager quests, EntitySkills skills, EntityCombatManager combat) { if (pages != null) { return; } /* Setup the page manager */ pages = new PageManager(this, quests.GetCurrentQuests(), quests.GetCompletedQuests()); /* Update player name */ pages.UpdateStats(player_name, skills, combat); if (debug) { Debug.Log("JournalManager: Journal has been setup."); } }
public void UpdateStats(string player_name, EntitySkills skills, EntityCombatManager combat) { /* Update the stats of our player skills page */ pages.UpdateStats(player_name, skills, combat); }