private bool Attack() { NewWeights(new List <int>() { _weaponsWeight[0], _weaponsWeight[1] }); for (int i = 0; i < 2; ++i) { if (_characterBhv.Character.Skills[i].Nature == SkillNature.Offensive) { _weights.Add(_skillsWeight[i]); } } for (int i = 0; i < 2; ++i) { if (_characterBhv.Character.Skills[i].Nature == SkillNature.Offensive && IsTheBiggest(_skillsWeight[i]) && _skillsWeight[i] > 0) { _characterBhv.Character.Skills[i].Activate(_opponentBhv.X, _opponentBhv.Y); return(true); } } for (int i = 0; i < 2; ++i) { if (IsTheBiggest(_weaponsWeight[i]) && _weaponsWeight[i] > 0) { _opponentBhv.TakeDamages(_characterBhv.AttackWithWeapon(i, _opponentBhv, _gridBhv.Map, touchedPosition: _gridBhv.Cells[_rangeClicked[i].X, _rangeClicked[i].Y].transform.position)); return(true); } } return(false); }
public void Smite(CharacterBhv smitedOpponentBhv) { if (smitedOpponentBhv == null) { return; } var floatAmount = 100.0f * CharacterBhv.Character.GetDamageMultiplier(); smitedOpponentBhv.TakeDamages(new Damage((int)floatAmount)); }