private void Awake() { m_onBoat = false; m_movement = GetComponent <PlayerMovement>(); m_actions = GetComponent <PlayerActions>(); m_statusEffects = GetComponent <PlayerStatusEffects>(); m_anim = transform.Find("Model").GetComponent <Animator>(); m_charcontroller = GetComponent <CharacterController>(); // FOR NOW, ALWAYS RESET PLAYER STATS TO DEFAULT m_currentStats.Reset(m_baseStats); m_startPos = transform.position; }
/// <summary> /// Applies the provided effects to the player /// </summary> /// <param name="effects">The effects to apply to the player</param> public void ApplyStatusEffects(PlayerStatusEffects effects) { if (effects.HasFlag(PlayerStatusEffects.WINDFURY)) { // If we're applying windfury, we need to unexhaust the player if it has // only attacked once so far this turn if (this.attacksThisTurn < 2) { this.RemoveStatusEffects(PlayerStatusEffects.EXHAUSTED); } } this.StatusEffects |= effects; }
void Awake() { charControl = GetComponent <CharacterController>(); m_playerStatusEffects = GetComponent <PlayerStatusEffects>(); m_playerStatusEffects.m_onStunned += onStunned; m_playerStatusEffects.m_onUnStunned += onUnStunned; m_flyingSandParticles = transform.Find("FlyingSand").GetComponent <ParticleSystem>(); m_animator = transform.Find("Model").GetComponent <Animator>(); m_groundLayer = 1 << LayerMask.NameToLayer("Terrain"); m_stepAudio = GetComponent <AudioSource>(); m_onBoat = false; }
/// <summary> /// Removes the provided effects from the player /// </summary> /// <param name="effects">The effects to remove</param> public void RemoveStatusEffects(PlayerStatusEffects effects) { this.StatusEffects = this.StatusEffects & ~effects; }