コード例 #1
0
        public void Begin()
        {
            m_skill.GetValidPositions(m_spawnPositions);

            if (m_spawnPositions.Count > 0)
            {
                m_timer = 3f;
                Vector2Int spawnPosition = m_spawnPositions[Random.Range(0, m_spawnPositions.Count)];

                EntityType      spawnType = m_skill.SpawnType;
                EntityComponent visual    = m_manager.Service.InstantiateEntity(spawnPosition.x, spawnPosition.y, spawnType);

                GameplayEntity gameplayEntity = m_manager.RegisterEntity(visual);

                gameplayEntity.Move(spawnPosition, 0);

                m_manager.Service.PlayQuakeAnimation(spawnPosition.x, spawnPosition.y, 2);
                m_manager.Pathfinder.NavGraph.SetGridType(spawnPosition, visual.Type);

                if (m_owner.Visual.Type == spawnType)
                {
                    m_manager.Ui.ShowAndHideBanner("Reinforcement has arrived", 0, 2);
                }
                else
                {
                    m_manager.Ui.ShowAndHideBanner("Magic malfunction", 0, 2);
                }
            }
            else
            {
                m_timer = .1f;
            }
        }
コード例 #2
0
        public void Begin()
        {
            m_end = false;
            bool isSuccess = Random.value > (.35f + m_target.Status.Health * .25f);

            GameplayEntity targetConvert;
            EntityType     convertTo;

            if (isSuccess)
            {
                targetConvert = m_target;
                convertTo     = m_attacker.Visual.Type;
            }
            else
            {
                targetConvert = m_attacker;
                convertTo     = m_target.Visual.Type;
            }


            m_manager.Pathfinder.NavGraph.SetGridType(targetConvert.Visual.GridPosition, convertTo);

            m_attacker.Move(m_attacker.Visual.GridPosition, 0);
            m_manager.StartCoroutine(ConvertActions(targetConvert, convertTo, .35f));
            m_manager.Ui.ShowAndHideBanner(isSuccess ? "Yololo yeah" : "Yololonoooo!", .3f);
        }
コード例 #3
0
 public void Begin()
 {
     m_timer = 1;
     m_target.Status.Heal(1);
     m_target.Visual.PlayHealthBarAnimation(m_target.Status.HealthPercentage, .3f);
     m_target.Move(m_target.Visual.GridPosition, 0);
 }
コード例 #4
0
        private IEnumerator AttackRoutine()
        {
            yield return new WaitForSeconds(.2f);

            m_attacker.Move(m_attacker.Visual.GridPosition, .3f);
            m_attacker.Move(m_target.Visual.GridPosition, 0);


            yield return new WaitForSeconds(.3f);

            m_target.PlayHealthBarAnimation(0);
            m_target.Visual.PlayTakeDamageAnimation();
            m_target.Visual.InstantiateSlash(m_target.Visual.GridPosition.x, m_target.Visual.GridPosition.y);

            yield return new WaitForSeconds(.1f);

            if (m_target.Status.Health <= 0)
            {
                m_manager.Pathfinder.NavGraph.SetGridType(m_target.Visual.GridPosition, EntityType.None);
                m_target.Visual.PlayDeathAnimation();
            }
            yield return new WaitForSeconds(1.5f);
            ShouldEnd = true;
        }
コード例 #5
0
        public void Begin()
        {
            if (m_path.Count >= 2)
            {
                Vector2Int start = m_entity.Visual.GridPosition;
                Vector2Int end   = m_path[m_path.Count - 1];

                m_manager.Pathfinder.NavGraph.SetGridType(start, EntityType.None);
                m_manager.Pathfinder.NavGraph.SetGridType(end, m_entity.Visual.Type);

                m_travelTime = m_entity.Move(m_path);
            }
            else
            {
                m_travelTime = 0;
            }
        }