Exemple #1
0
 public void ConfirmSkillLaunch()
 {
     if (ActiveConfirmationSkill.CanUse() && GetOwner().CanCastSkill(ActiveConfirmationSkill))
     {
         ActiveConfirmationSkill.Start(Target);
     }
 }
Exemple #2
0
        /// <summary>
        /// Spusti i-tý skill hrace (vola se po stisknuti klavesy 1-5)
        /// </summary>
        /// <param name="key">1-5</param>
        public void LaunchSkill(int key)
        {
            // select the skill mapped to the key
            Skill skill = player.Skills.GetSkill(key - 1);

            if (skill == null)
            {
                Debug.Log("NPE nemuzu najit skill " + key);
                return;
            }

#if UNITY_ANDROID
            if (ActiveConfirmationSkill != null && ActiveConfirmationSkill.Equals(skill))
            {
                ActiveConfirmationSkill.AbortCast();
                return;
            }
#endif

            //Debug.Log("Launching skill... " + skill.Name);

            //MovementChanged();

            // cast this skill
            player.CastSkill(skill);
        }
Exemple #3
0
        public override void Update()
        {
            // if the player is waiting to confirm skill casting, call the skills method to render the confirmation elements (eg. arrow to select where the skill should be casted, etc)
            if (ActiveConfirmationSkill != null)
            {
                ActiveConfirmationSkill.OnBeingConfirmed();
            }

            // updatnout pohyb
            base.Update();
        }
Exemple #4
0
        public void SetPlayersMoveToTarget(GameObject newTarget)
        {
            AbortMeleeAttacking();

            if (!allowMovePointChange)
            {
                return;
            }

            if (ActiveConfirmationSkill != null && ActiveConfirmationSkill.MovementBreaksConfirmation)
            {
                ActiveConfirmationSkill.AbortCast();
            }

            SetMovementTarget(newTarget);
        }
Exemple #5
0
        public void StartMeleeTargeting(bool rightClick)
        {
            if (ActiveConfirmationSkill != null && !ActiveConfirmationSkill.Equals(GetOwner().MeleeSkill))
            {
                BreakCasting();

                if (rightClick)
                {
                    return;
                }
            }

            if (GetOwner().MeleeSkill != null && GetOwner().CanCastSkill(GetOwner().MeleeSkill))
            {
                GetOwner().MeleeSkill.DoAutoattack();
            }
        }
Exemple #6
0
        public bool SetPlayersMoveToTarget(Vector3 newTarget)
        {
            AbortMeleeAttacking();
            CheckSkillsToAbort();

            if (!allowMovePointChange)
            {
                return(false);
            }

            if (Utils.IsNotAccessible(GetBody().transform.position, newTarget))
            {
                return(false);
            }

            if (ActiveConfirmationSkill != null && ActiveConfirmationSkill.MovementBreaksConfirmation)
            {
                ActiveConfirmationSkill.AbortCast();
            }

            return(SetMovementTarget(newTarget));
        }
Exemple #7
0
 public void ConfirmSkillLaunch(Vector3 mousePosition)
 {
     ActiveConfirmationSkill.Start(mousePosition);
 }