Esempio n. 1
0
 //Deal Damage and deal damage based on type;
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "MonsterHitbox")
     {
         mTd = other.gameObject.GetComponent <MonsterTakeDamage> ();
         if (slashDamageType)
         {
             mTd.dealSlashingDamage(characterStats.meleeAttack);
         }
         else if (pierceDamageType)
         {
             mTd.dealPiercingDamage(characterStats.meleeAttack);
         }
         else if (crushDamageType)
         {
             mTd.dealCrushingDamage(characterStats.meleeAttack);
         }
         else if (explosiveDamageType)
         {
             mTd.dealExplosiveDamage(characterStats.meleeAttack);
         }
         asssc.playSwordHit();
     }
     else
     {
         asssc.playSwordMiss();
     }
 }
Esempio n. 2
0
 //Deal Damage and deal damage based on type;
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "MonsterHitbox")
     {
         mTd = other.gameObject.GetComponent <MonsterTakeDamage> ();
         if (slashDamageType)
         {
             mTd.dealSlashingDamage(characterStats.abilityPower);
         }
         else if (pierceDamageType)
         {
             mTd.dealPiercingDamage(characterStats.abilityPower);
         }
         else if (crushDamageType)
         {
             mTd.dealCrushingDamage(characterStats.abilityPower);
         }
         else if (explosiveDamageType)
         {
             mTd.dealExplosiveDamage(characterStats.abilityPower);
         }
     }
 }