void ManageDuels() { if (variables.clueList.Contains(clueNeededToDuel) && duelingStatus == DuelingStatus.PreDuel) { duelingStatus = DuelingStatus.CanDuel; } }
public virtual void Update() { if (clueNeededToDuel == null && duelingStatus == DuelingStatus.PreDuel) { duelingStatus = DuelingStatus.CanDuel; } else { ManageDuels(); } switch (duelingStatus) { case DuelingStatus.PreDuel: treeToLoad = npcInfo.preDuelTrees[preDuelIndex]; break; case DuelingStatus.CanDuel: treeToLoad = npcInfo.dialogueTrees[dialogueIndex]; break; case DuelingStatus.PostDuel: treeToLoad = npcInfo.postDuelTrees[postDuelIndex]; break; } try{ thisDuelManager = GetComponent <DuelManager>(); CheckForPlayer(); ManageDossierInformation(); switch (attitude) { case Attitude.AngryIfLose: if (thisDuelManager.playerWin) { AngryAtPlayer = true; } break; case Attitude.AngryIfWin: if (thisDuelManager.playerLose) { AngryAtPlayer = true; } break; case Attitude.AngryIfOthersLose: SympatheticNPC(); break; case Attitude.AlwaysAngry: if (thisDuelManager.duelFinished) { AngryAtPlayer = true; } break; } thisDuelManager.enemyId = newDuelId; } catch (System.NullReferenceException) {} switch (currentStatus) { case NPCStatus.Neutral: heatedTimer = 10f; heatedIcon.gameObject.SetActive(false); break; case NPCStatus.Heated: heatedTimer -= Time.deltaTime; heatedIcon.gameObject.SetActive(true); Color heat = heatedIcon.GetComponent <SpriteRenderer>().color; heat.a = heatedTimer / 10f; heatedIcon.GetComponent <SpriteRenderer>().color = heat; if (heatedTimer <= 0f) { currentStatus = NPCStatus.Neutral; } break; } }