public void specialMoveOther(_CombatParticipant other) { specialMove(other); if (particleSpecialAttack != null) { if( particleSpecialAttack.GetComponent<ParticleSystem>() != null) { particleSpecialAttack.GetComponent<ParticleSystem>().Play(); } if( particleSpecialAttack.GetComponent<AudioSource>() != null) { particleSpecialAttack.GetComponent<AudioSource>().Play(); } } }
public void basicAttackOther(_CombatParticipant other) { basicAttack(other); if (particleBasicAttack != null) { if( particleBasicAttack.GetComponent<ParticleSystem>() != null) { particleBasicAttack.GetComponent<ParticleSystem>().Play(); } if( particleBasicAttack.GetComponent<AudioSource>()) { particleBasicAttack.GetComponent<AudioSource>().Play(); } } }
protected sealed override void specialMove(_CombatParticipant other) { if (currentMp >= 10) { useMP(10); int damageAmount = Random.Range(minAttack * 2, maxAttack * 3); other.damage(damageAmount); animator.SetTrigger("sword"); //combatController.waitForAnimationFinished(animator); combatController.waitForParticipant(this, 4); } else { Debug.Log("Aria does not have enough MP. Skipping turn..."); } }
private int getRandomLiveParticipant(_CombatParticipant[] participants) { int numParticipants = 0; for (int i = 0; i < participants.Length; i++) { if (!participants[i].isDead()) { numParticipants++; } } if (numParticipants == 0) { return -1; } int[] liveParticipants = new int[numParticipants]; for (int i = 0, j = 0; i < activeEnemies.Length; i++) { if (!activeEnemies[i].isDead()) { liveParticipants[j++] = i; } } int randomIndex = Random.Range(0, numParticipants); return liveParticipants[randomIndex]; }
public void waitForParticipant(_CombatParticipant participant, float seconds) { waitForParticipantFinished = false; waitingParticipant = participant; //finishedWaitingTime = Time.time + seconds; finishedWaitingTime = Time.time + turnDuration; }
protected virtual void specialMove(_CombatParticipant other) { basicAttack(other); }
protected virtual void basicAttack(_CombatParticipant other) { int damageAmount = Random.Range(minAttack, maxAttack); other.damage(damageAmount); Debug.Log(gameObject.name + " has done " + damageAmount + " damage to " + other.gameObject.name); if (this is _HeroCombat) { animator.SetTrigger("basic"); } else if (this is _EnemyCombat) { animator.SetTrigger("Attack"); } //combatController.waitForAnimationFinished(animator); combatController.waitForParticipant(this, 4); }