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()); } }
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()); } }
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()); } }