public IEnumerator Start_Attack()
    {
        hurt_active = true;

        sprite.color = HushPuppy.getColorWithOpacity(sprite.color, 1f);
        yield return(new WaitForSeconds(attack_duration));
    }
Exemple #2
0
    IEnumerator Destroy_Capture()
    {
        float wait_time = 0.2f;

        spearCapture.transform.DOScale(
            spearCapture.transform.localScale * 1.2f,
            wait_time
            );

        spearCapture.DOColor(
            HushPuppy.getColorWithOpacity(spearCapture.color, 0f),
            wait_time
            );

        yield return(new WaitForSeconds(wait_time));

        Destroy(spearCapture.gameObject);
        player.is_capturing_spear = false;
        if (spear != null)
        {
            Destroy(spear.gameObject);
        }
        else
        {
            //is fixed in dragon
            var     dragon    = GameObject.FindGameObjectWithTag("Dragon");
            Vector3 blood_pos = (this.transform.position + dragon.transform.position) / 2;
            var     blood     = Instantiate(blood_prefab, blood_pos, Quaternion.identity);
            blood.GetComponentInChildren <Blood>().Initialize(3f);
            Destroy(this.transform.parent.gameObject);
        }
    }
    public IEnumerator Attack()
    {
        //telegraph
        sprite.enabled = true;
        sprite.color   = HushPuppy.getColorWithOpacity(sprite.color, 0f);
        sprite.DOFade(0.5f, 0.1f);
        yield return(new WaitForSeconds(telegraph_time));

        //capable of doing damage
        hurt_box_active = true;
        flames.Play();
        sprite.color = HushPuppy.getColorWithOpacity(sprite.color, 1f);
        yield return(new WaitForSeconds(attack_duration));

        //end
        flames.Stop();
        sprite.color = HushPuppy.getColorWithOpacity(sprite.color, 0.5f);
        yield return(new WaitForSeconds(flames.main.startLifetime.constant));

        hurt_box_active = false;
        sprite.DOFade(0f, 0.1f);
        yield return(new WaitForSeconds(0.1f));

        sprite.enabled = false;
    }
Exemple #4
0
 void Start()
 {
     if (invert)
     {
         this.gameObject.SetActive(false);
         sr.color = HushPuppy.getColorWithOpacity(sr.color, 0f);
     }
 }
    public IEnumerator Telegraph()
    {
        sprite.enabled = true;

        sprite.color = HushPuppy.getColorWithOpacity(sprite.color, 0f);
        sprite.DOFade(0.3f, 0.1f);
        yield return(new WaitForSeconds(telegraph_duration));
    }
Exemple #6
0
    public IEnumerator Die_Coroutine()
    {
        this.sr.color = HushPuppy.getColorWithOpacity(this.sr.color, 0.3f);

        yield return(new WaitForSeconds(timeBetweenRespawns));

        ResetState();
    }
Exemple #7
0
    void Set_Alpha(float alpha)
    {
        if (alpha < 0f || alpha > 1f)
        {
            print("Alpha not received correctly.");
        }

        sr.color = HushPuppy.getColorWithOpacity(sr.color, alpha);
    }
    public IEnumerator End_Attack()
    {
        hurt_active = false;

        sprite.color = HushPuppy.getColorWithOpacity(sprite.color, 0.5f);
        sprite.DOFade(0f, 0.1f);

        yield return(new WaitForSeconds(0.1f));

        sprite.enabled = false;
    }
Exemple #9
0
    void Set_Alpha(float alpha)
    {
        if (alpha < 0f || alpha > 1f)
        {
            print("Alpha not received correctly.");
        }

        foreach (SpriteRenderer s in GetComponentsInChildren <SpriteRenderer>())
        {
            if (s.gameObject.tag != "SpearCapture")
            {
                s.color = HushPuppy.getColorWithOpacity(s.color, alpha);
            }
        }
    }
Exemple #10
0
 void ResetState()
 {
     this.sr.color = HushPuppy.getColorWithOpacity(this.sr.color, 1f);
     this.size     = 0f;
     this.lifeForm.ResetState();
 }