Ejemplo n.º 1
0
    public virtual void Hit(Collider2D coll)
    {
        EnemyStatsTest enemyStats = coll.gameObject.GetComponent <EnemyStatsTest> ();

        // did player kill the enemy
        bool kill = false;

        if (enemyStats != null)
        {
            kill = enemyStats.TakeDamage(Damage);
        }
        if (kill && Player != null)
        {
            Player.GetComponent <AbstractPlayerStats>().IncreaseExperience(enemyStats.GetExperienceGain());
        }
    }
Ejemplo n.º 2
0
    public void DealDamage(GameObject enemy)
    {
        EnemyStatsTest enemyStats = enemy.GetComponent <EnemyStatsTest>();

        // did player kill the enemy
        bool kill = false;

        if (enemyStats != null)
        {
            kill = enemyStats.TakeDamage(damage);
        }
        if (kill && player != null)
        {
            player.GetComponent <AbstractPlayerStats>().IncreaseExperience(enemyStats.GetExperienceGain());
        }
    }
Ejemplo n.º 3
0
    public void CmdDealDamage(GameObject enemy)
    {
        EnemyStatsTest enemyStats = enemy.GetComponent <EnemyStatsTest> ();

        // did player kill the enemy
        bool kill = false;

        if (enemyStats != null)
        {
            kill = enemyStats.TakeDamage((int)(stats.GetWpnDamage() * (0.5f + stats.GetStrength() / 50f)));
        }

        if (kill)
        {
            stats.IncreaseExperience(enemyStats.GetExperienceGain());
        }
    }
    public void CmdDealDamage(GameObject enemy, int ability)
    {
        if (!isLocalPlayer)
        {
            return;
        }

        EnemyStatsTest enemyStats = enemy.GetComponent <EnemyStatsTest>();

        // did player kill the enemy
        bool kill = false;

        if (enemyStats != null)
        {
            kill = enemyStats.TakeDamage((int)(stats.GetAbilityPower() * (0.5f + (stats.GetStrength() + new FrostCone().GetDamage()) / 50f)));
        }

        if (kill)
        {
            stats.IncreaseExperience(enemyStats.GetExperienceGain());
        }
    }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     _stats = GetComponent <EnemyStatsTest> ();
 }