示例#1
0
    public static int calculateDamage(ShotsFired myHits)
    {
        int hits = 0;

        for (int i = 0; i < myHits.power; i++)
        {
            if (Random.value <= myHits.hitChance)
            {
                hits++;
            }
        }
        CombatIndicationSpawner.spawnHits(myHits.source, hits);
        int damage = 0;

        for (int i = 0; i < hits; i++)
        {
            //higher dodge chance means less bullets go through
            if (Random.value >= myHits.dodgeChance)
            {
                damage++;
            }
        }
        CombatIndicationSpawner.spawnMisses(myHits.destination, hits - damage);
        return(damage);
    }
示例#2
0
 static TutorialCombat()
 {
     marker = GameObject.Find("Marker").GetComponent <Marker>();
     CombatIndicationSpawner.instantiate();
 }