示例#1
0
    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();
			}
		}
    }
示例#2
0
    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();
			}
        }
    }
示例#3
0
    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...");
        }
    }
示例#4
0
    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];
    }
示例#5
0
    public void waitForParticipant(_CombatParticipant participant, float seconds) {
        waitForParticipantFinished = false;
        waitingParticipant = participant;
        //finishedWaitingTime = Time.time + seconds;
		finishedWaitingTime = Time.time + turnDuration;
    }
示例#6
0
 protected virtual void specialMove(_CombatParticipant other) {
     basicAttack(other);
 }
示例#7
0
    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);
    }