Open RichardRam87 opened 9 years ago
public override void GetDamage (int dmg) { int blockChance = 0; if (_currentWeapon.GetComponent<MeleeWeapon>() != null) { blockChance = Mathf.RoundToInt(Random.Range (0, 100)); if(blockChance < _chanceToBlockPercentage){ blockChance = 1; }else{ blockChance = 0; } } if(blockChance == 0){ base.GetDamage (dmg); }else{ //block animation. } }
Bestand: https://github.com/Darkfafi/Mythe_Orion_Game/blob/master/Assets/_Scripts/Actors/Player/Player.cs
Ik zou hier de verantwoordelijkheden van deze functie scheiden of de naam v/d functie veranderen. Het berekenen v/d blockchange is iets anders dan het verwerken van dmg.
Bestand: https://github.com/Darkfafi/Mythe_Orion_Game/blob/master/Assets/_Scripts/Actors/Player/Player.cs
Ik zou hier de verantwoordelijkheden van deze functie scheiden of de naam v/d functie veranderen. Het berekenen v/d blockchange is iets anders dan het verwerken van dmg.