Ejemplo n.º 1
0
        public bool UseOnTarget(Entity self, Vector3Int pos)
        {
            SkillPanel skillPanel = UIManager.Instance.FindSkill(SkillType.Fireball);
            var        strength   = skillPanel.GetDie(DiceType.Strength).value;
            var        aoe        = skillPanel.GetDie(DiceType.AreaOfEffect)?.value != null;

            if (aoe)
            {
                Vector3Int[] toCheck =
                {
                    pos,
                    pos + MoveDirection.North.ToVec3Int(),
                    pos + MoveDirection.West.ToVec3Int(),
                    pos + MoveDirection.South.ToVec3Int(),
                    pos + MoveDirection.East.ToVec3Int()
                };

                foreach (Vector3Int v in toCheck)
                {
                    var entityAt = LevelManager.Instance.GetEntitiesAt(v);
                    foreach (Entity entity in entityAt)
                    {
                        entity.ModifyHp(strength);
                    }
                }
            }
            else
            {
                LevelManager.Instance.GetEntityAt(pos).ModifyHp(strength);
            }

            return(true);
        }
Ejemplo n.º 2
0
        public bool UseOnTarget(Entity self, Vector3Int pos)
        {
            Entity     e          = LevelManager.Instance.GetEntityAt(pos);
            SkillPanel skillPanel = UIManager.Instance.FindSkill(SkillType.Melee);
            var        str        = skillPanel.GetDie(DiceType.Strength).value;

            e.ModifyHp(str);

            return(true);

            throw new NotImplementedException();
        }
Ejemplo n.º 3
0
        public void CheckUiUpdates(SkillPanel s)
        {
            switch (s.data.type)
            {
            case SkillType.Movement:
                DiceScript diceScript = s.GetDie(DiceType.Range);

                if (diceScript != null)
                {
                    moves = maxMoves = diceScript.value;
                    GameManager.Instance.UpdateUI();
                }

                break;
            }
        }