Exemplo n.º 1
0
 private void ExecuteBasicSkill()
 {
     if (!skillUser.usingSkill && canInput)
     {
         if (skillUser.userStats.currentMana >= playerStats.solarRace.basicSkill.skillCost)
         {
             skillUser.InitializeSkill(playerStats.solarRace.basicSkill);
         }
     }
 }
Exemplo n.º 2
0
    public override bool Initialize(SkillUser user)
    {
        if (skillsToUse == null || skillsToUse.Length <= 0)//não tem skills configuradas
        {
            Debug.LogError("Skill Combo Sequence Object has no skills.");
            return(false);
        }
        //tem skills
        Skill nextSkill = skillsToUse[0];

        if (user.timeSinceLastSkill <= timeToUseNextSkill)//vamos ver qual é a proxima skill a se usar
        {
            int targetSkillIndex = 0;
            for (int i = 0; i < skillsToUse.Length; i++)
            {
                if (user.lastUsedSkill != null && user.lastUsedSkill == skillsToUse[i])
                {
                    targetSkillIndex = (i + 1) % skillsToUse.Length;
                    //Debug.Log("advancing skill");
                }
            }
            //Debug.Log("Combo skill id: "+targetSkillIndex);
            nextSkill = skillsToUse[targetSkillIndex];
        }
        user.InitializeSkill(nextSkill);
        return(false);
    }
Exemplo n.º 3
0
 public void EnemyFSM()
 {
     if (attackTimer > 0)
     {
         attackTimer -= Time.deltaTime;
     }
     if (attacking) // true if player within range
     {
         if (moveTimer > 0)
         {
             moveTimer -= Time.deltaTime;
             if (moveTimer <= 0 && (chase.target == null || chase.reachedEndOfPath))
             {
                 chase.target = GetNextRangedReference();
                 moveTimer    = timeToMoveAgain;
             }
         }
         if (attackTimer <= 0 && !skillUser.usingSkill)
         {
             skillUser.InitializeSkill(rangedSkill);
             shotsFired++;
             if (shotsFired >= maxShots || (shotsFired >= minShots && Random.Range(0, 10) < 5))
             {
                 attackTimer = timeToAttackAgain;
                 shotsFired  = 0;
             }
         }
     }
 }
Exemplo n.º 4
0
 protected virtual void Attack()
 {
     skillUser.InitializeSkill(attackSkill);
     chase.target = null;
 }