//Select an idle state //Cycle through all avaivable IdleStates until the default is hit void NextIdleState() { if (idleState == ReactionCategory.Positive) { idleState = ReactionCategory.Nuetral; } else if (idleState == ReactionCategory.Nuetral) { idleState = ReactionCategory.Negative; } else if (idleState == ReactionCategory.Negative) { idleState = ReactionCategory.AFK; } else if (idleState == ReactionCategory.AFK) { idleState = ReactionCategory.AFK; } else { idleState = ReactionCategory.Nuetral; } boredumLevelTimer = timeUntilNextBoredumLevel; }
void ChooseAReaction(ReactionType rt, ReactionCategory rc) { VoiceLine tempReaction = reactions[Random.Range(0, reactions.Length)]; if (tempReaction == currentReaction) { ChooseAReaction(rt, rc); } else { currentReaction = tempReaction; } boredumLevelTimer = (rt == ReactionType.Event) ? timeUntilNextBoredumLevel : boredumLevelTimer; currentReaction.spriteSheet.animationFinished = false; currentReaction.spriteSheet.index = 0; currentReaction.audio.audioStarted = false; currentReaction.audio.audioFinished = false; currentReaction.text.subtitlesFinished = false; currentReaction.text.subtitleTimer = 0; speakingState = (rt == ReactionType.Event) ? SpeakingState.Speaking : SpeakingState.IdleSpeaking; /*foreach (VoiceLine vl in reactions) * { * vl.tried = false; * }*/ }
//Used for Unity Event, attach to any Negative Tank Event public void ReactNegatively() { // If a speaking event is not currently active, choose a random negative reaction if (speakingState != SpeakingState.Speaking) { ChooseAReaction(ReactionType.Event, ReactionCategory.Negative); idleState = ReactionCategory.Negative; } }