Button to deal damage to random participant

This commit is contained in:
henriquenakashima 2020-09-17 23:31:49 -04:00
parent 778228bc6b
commit 581d9d7811
2 changed files with 15 additions and 2 deletions

View file

@ -61,4 +61,12 @@ public class BattleController : MonoBehaviour
{
}
public void HitRandomParticipant() {
if (Random.Range(0f, 1f) < 0.5f) {
heroes[Random.Range(0, heroes.Length)].dealDamage(1);
} else {
monsters[Random.Range(0, monsters.Length)].dealDamage(2);
}
}
}