Reviewed-on: #12 Reviewed-by: Ader_Alisma <ader.alisma.1@ens.etsmtl.ca> Co-authored-by: MaximilienBlanchardBizien1 <maximilien.blanchard-bizien.1@ens.etsmtl.ca> Co-committed-by: MaximilienBlanchardBizien1 <maximilien.blanchard-bizien.1@ens.etsmtl.ca>
19 lines
467 B
C#
19 lines
467 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class GhostOpponent : Opponent
|
|
{
|
|
|
|
[SerializeField]
|
|
//Le taux de chance, en pourcantage (un chiffre entre 0 et 99) que l'ennemie a d'eviter un projectile.
|
|
private int dodgePercent;
|
|
|
|
public bool dodgedProjectile()
|
|
{
|
|
System.Random random = new System.Random();
|
|
if(random.Next(0, 99) > dodgePercent) return false;
|
|
else return true;
|
|
}
|
|
}
|