Exemplo n.º 1
0
    private void Update()
    {
        if (trueStamina < BaseStamina)
        {
            trueStamina += StaminaReg * Time.deltaTime;
        }
        UIUpdate();

        if (!m_invulnerable)
        {
            return;
        }

        if (InvulnerabilityOff())
        {
            m_invulnerable = false;
        }

        if (trueHP <= 0)
        {
            Dead = true;
            LevelEventHandler.TriggerEvent("GameOver");
            GetComponent <Animator>().SetBool("Dead", true);
        }
    }
Exemplo n.º 2
0
 public void DispatchEvent(LevelEventHandler evt)
 {
     if (evt != null)
     {
         evt(this);
     }
 }
Exemplo n.º 3
0
 //To be called upon unit death.
 public void Die()
 {
     if (m_currentAttack != null)
     {
         m_currentAttack.StopAttack();
     }
     m_currentAttack = null;
     m_attackPatterns.Clear();
     Destroy(gameObject);
     LevelEventHandler.TriggerEvent("Victory");
 }
Exemplo n.º 4
0
 //public Stats m_Stat;
 // Use this for initialization
 void Start()
 {
     LevelEventHandler.StartListening("GameOver", PlayWin);
     LevelEventHandler.StartListening("Taunt", PlayTaunt);
     m_animator    = GetComponent <Animator>();
     m_rigidbody2D = GetComponent <Rigidbody2D>();
     m_attackPatterns.AddRange(GetComponents <AttackPattern>());
     m_health     = m_EnemyStat.HP;
     m_invulColor = GetComponent <SpriteRenderer>().color.r;
     m_animator.SetBool("Taunt", true);
     fullCol = Color.green;
     lowCol  = Color.red;
 }
Exemplo n.º 5
0
    public void Taunt()
    {
        if (target.transform.position.x < transform.position.x)
        {
            m_bossAI.m_flipValue = -1;
        }
        else
        {
            m_bossAI.m_flipValue = 1;
        }

        LevelEventHandler.TriggerEvent("Taunt");
        m_bossAI.Flip();
        m_bossAI.GetAnimator.SetBool("Attack", false);
        m_bossAI.GetRigidBody.velocity = Vector2.zero;
        m_dash = false;
        m_bossAI.GetAnimator.SetBool("Taunt", true);
        m_taunt = true;
    }
Exemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     LevelEventHandler.StartListening("GameOver", SetActive);
     gameObject.SetActive(false);
 }
Exemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     LevelEventHandler.StartListening("Victory", Victory);
     gameObject.SetActive(false);
 }
Exemplo n.º 8
0
 public void DispatchEvent(LevelEventHandler evt)
 {
     if (evt != null) evt(this);
 }