void OnParticleCollision(GameObject other)
 {
     //Debug.Log("particle hit something "+other.layer);
     if (other.layer == damage_layer)
     {
         Character_stats character_stats = other.GetComponent <Character_stats>();
         character_stats.TakeDamage(damage_per_hit);
         //Debug.Log("hit player with particle");
     }
 }
Пример #2
0
 void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.layer == damageLayer)
     {
         Character_stats character_stats = col.gameObject.GetComponent <Character_stats>();
         for (int i = 0; i < statusEffekt.Length; i++)
         {
             if (statusEffekt[i])
             {
                 character_stats.status_effects.addEffect((Status_effects.EffectName)i, effectDamage[i], 1);
             }
         }
         character_stats.TakeDamage(damage);
     }
     Destroy(gameObject, explosionTime);
 }
Пример #3
0
 void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.layer == damageLayer)
     {
         Destroy(this.gameObject);
         if (splashDamage)
         {
             // instanciate explosion prefab
             GameObject       explosion = Instantiate(explosionPrefab, transform.position, new Quaternion());
             Explosion_damage do_damage = explosion.GetComponent <Explosion_damage>();
             do_damage.damage       = damage;
             do_damage.damageLayer  = damageLayer;
             do_damage.statusEffekt = statusEffekt;
             do_damage.effectDamage = effectDamage;
         }
         else
         {
             Character_stats character_stats = col.gameObject.GetComponent <Character_stats>();
             for (int i = 0; i < statusEffekt.Length; i++)
             {
                 if (statusEffekt[i])
                 {
                     character_stats.status_effects.addEffect((Status_effects.EffectName)i, effectDamage[i], 1);
                 }
             }
             character_stats.TakeDamage(damage);
         }
     }
     else if (col.gameObject.layer == 10 /*RoomWalls*/)
     {
         Destroy(this.gameObject);
     }
     else if (col.gameObject.layer == 12 /*Bullets*/ && blockable)
     {
         Destroy(this.gameObject);
     }
 }
Пример #4
0
 void doDamage(float damage)
 {
     character_stats.TakeDamage(damage);
 }