Beispiel #1
0
    // On trigger collision
    void OnTriggerEnter2D(Collider2D coll)
    {
        if (coll.gameObject.tag == Globals.TAGS.Enemy)
        {
            return;
        }

        if (coll.gameObject.tag == Globals.TAGS.Player) // @@@ENUM HERE!!!
        {
            GameObject dragon = coll.gameObject;
            UseItem(dragon);             // For non awarding actions

            if (Audi != null)
            {
                Audi.Play();
            }
            int   hp    = this.award_HP;
            int   stam  = this.award_Stam;
            float flame = this.award_Flame;

            if (p == null)
            {
                p = gameObject.GetComponent <Perks>();
            }

            if (p.BE())
            {
                stam  *= 2;
                flame *= 2;
            }
            if (hp < 0)
            {
                Debug.Log("1");
                dragonSM.HP += (int)(hp * p.damageMult()) + p.damageReduction();
            }
            if (hp > 0 && p.BE())
            {
                dragonSM.HP += hp * 2;
            }
            monitor.Add_Coins(award_Coin_Value);
            Debug.Log(award_Coin_Value);
            dragonSM.StatInput(hp, stam, flame);
            // @@@ SESSION MONITOR
            //monitor.Add_Coins(this.award_Coin_Value);
            Destroy(this.gameObject);     // Goodbye
        }
    }
Beispiel #2
0
 void OnTriggerEnter2D(Collider2D col)
 {
     // GIVE MONEY AND LEAVE!
     monitor.Add_Coins(this.Worth);
     Destroy(this.gameObject);
 }