private void ExecuteBasicSkill() { if (!skillUser.usingSkill && canInput) { if (skillUser.userStats.currentMana >= playerStats.solarRace.basicSkill.skillCost) { skillUser.InitializeSkill(playerStats.solarRace.basicSkill); } } }
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); }
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; } } } }
protected virtual void Attack() { skillUser.InitializeSkill(attackSkill); chase.target = null; }