public void UpdateText() { _playerName.text = _stats.GetPlayerName(); _health.text = "Health: " + _stats.GetHealth() + "/" + _stats.getMaxHealth(); _strength.text = "Strength: " + _stats.GetStrength(); _defense.text = "Defense: " + _stats.GetDefence(); _speed.text = "Speed: " + _stats.GetSpeed(); _dexterity.text = "Dexterity: " + _stats.GetDexterity(); _mana.text = "Mana: " + _stats.GetMana() + "/" + _stats.GetMaxMana(); _endurance.text = "Endurance: " + _stats.GetEndurance(); _wisdom.text = "Wisdom: " + _stats.GetWisdom(); _level.text = "Level: " + _stats.GetLevel(); _experience.text = "Experience: " + _stats.GetExperience() + "/" + _stats.GetMaxExperience(); }
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 CmdCastFirstAbility(Vector2 target) { if (GetComponent <AbstractAbilityControls>().onCoolDown1) { return; } GetComponent <AbstractAbilityControls>().onCoolDown1 = true; GameObject tempFireBall = Instantiate(fireBallPrefab, transform.position, Quaternion.identity) as GameObject; tempFireBall.GetComponent <FireBallMovement>().SetTarget(target); tempFireBall.GetComponent <FireBallMovement> ().SetShooter(gameObject); tempFireBall.GetComponent <FireBallMovement> ().SetDamage((int)(stats.GetAbilityPower() * (0.5f + (stats.GetStrength() + new FireBall().GetDamage()) / 50f))); NetworkServer.Spawn(tempFireBall); }