public void TryHit(Spell.Hit hit)
 {
     if (hitChecker.CheckHit(hit, out int dmg))
     {
         Damage(dmg);
     }
 }
 public void TryHeal(Spell.Hit hit)
 {
     if (hitChecker.CheckHit(hit, out int dmg))
     {
         Heal(dmg);
     }
 }
Beispiel #3
0
 public bool CheckHit(Spell.Hit hit, out int damage)
 {
     if (!currentHits.Contains(hit))
     {
         currentHits.Add(hit);
         damage = hit.damage;
         timer.Restart();
         return(true);
     }
     else
     {
         damage = hit.damage;
         return(false);
     }
 }
Beispiel #4
0
        public void SetAllCells(Spell.Description spell, Vector3 offset)
        {
            Spell.Hit hit = spell.hits[0];

            RemoveCells();

            aimFLoors = new List <GameObject>();


            foreach (Vector2Int pos in hit.Locations)
            {
                GameObject floor = Instantiate(floorPrefab);
                aimFLoors.Add(floor);
            }
        }
Beispiel #5
0
        public void PositionAllCells(Spell.Description spell, Vector3 offset)
        {
            Spell.Hit hit = spell.hits[0];
            if (aimFLoors == null || hit.Locations.Count != aimFLoors.Count)
            {
                SetAllCells(spell, offset);
            }

            for (int i = 0; i < aimFLoors.Count; i++)
            {
                Vector2Int pos   = hit.Locations[i];
                GameObject floor = aimFLoors[i];
                if (floor == null)
                {
                    continue;
                }

                //pat = grid.GridPattern(pos);
                Vector3 floorPos = grid.GridToWorld(pos, WorldGrid.PlaceMode.TileCenter) + offset;
                floor.transform.position = floorPos + FLOOR_OFFSET;
            }
        }