Firstborn/Assets/Scripts/ClassManager.cs

167 lines
4.2 KiB
C#
Raw Normal View History

using System.Security.AccessControl;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public class ClassManager : MonoBehaviour
{
[Header("Stats Displays")]
[SerializeField] private TextMeshProUGUI ClassNameText;
[SerializeField] private TextMeshProUGUI StrengthText;
[SerializeField] private TextMeshProUGUI AgilityText;
[SerializeField] private TextMeshProUGUI ConstitutionText;
[SerializeField] private TextMeshProUGUI SpeedText;
[SerializeField] private TextMeshProUGUI EnduranceText;
[SerializeField] private TextMeshProUGUI DexterityText;
[SerializeField] private TextMeshProUGUI CharismaText;
[SerializeField] private TextMeshProUGUI IntelligenceText;
[SerializeField] private TextMeshProUGUI WillpowerText;
[SerializeField] private int Tracker = 0;
[SerializeField] private GameObject RemainingBox;
[SerializeField] private TextMeshProUGUI RemainingPoints;
[SerializeField] private List<Button> Adjuster;
// Start is called before the first frame update
void Start() {
ClassNameText.text = SetClassName(Tracker);
}
// Update is called once per frame
void Update()
{
}
public void ClassLeftButton() {
if (Tracker == 0) {
Tracker = 12;
} else {
Tracker -= 1;
}
ClassNameText.text = SetClassName(Tracker);
}
public void ClassRightButton() {
if (Tracker == 12) {
Tracker = 0;
} else {
Tracker += 1;
}
ClassNameText.text = SetClassName(Tracker);
}
public string SetClassName(int i) {// all start off with 50 points. all 5's is 45
ResetStats();
if (i != 8) {
ShowAll(false);
RemainingBox.SetActive(false);
} else {
ShowAll(true);
RemainingBox.SetActive(true);
RemainingPoints.text = "5";
}
if (i == 0) {
AgilityText.text = "6";
SpeedText.text = "7";
EnduranceText.text = "7";
return "Aries";
} else if (i == 1) {
StrengthText.text = "7";
EnduranceText.text = "6";
WillpowerText.text = "7";
return "Taurus";
} else if (i == 2) {
ConstitutionText.text = "6";
CharismaText.text = "7";
IntelligenceText.text = "7";
return "Gemini";
} else if (i == 3) {
EnduranceText.text = "6";
CharismaText.text = "6";
IntelligenceText.text = "6";
WillpowerText.text = "7";
return "Cancer";
} else if (i == 4) {
StrengthText.text = "7";
AgilityText.text = "4";
SpeedText.text = "4";
CharismaText.text = "7";
IntelligenceText.text = "7";
WillpowerText.text = "6";
return "Leo";
} else if (i == 5) {
StrengthText.text = "4";
AgilityText.text = "4";
ConstitutionText.text = "7";
CharismaText.text = "4";
IntelligenceText.text = "8";
WillpowerText.text = "8";
return "Virgo";
} else if (i == 6) {
ConstitutionText.text = "8";
IntelligenceText.text = "7";
return "Libra";
} else if (i == 7) {
StrengthText.text = "7";
ConstitutionText.text = "4";
IntelligenceText.text = "7";
WillpowerText.text = "7";
return "Scorpio";
} else if (i == 8) {// need to make the options appear here
return "Sol";
} else if (i == 9) {
StrengthText.text = "7";
AgilityText.text = "7";
ConstitutionText.text = "4";
SpeedText.text = "7";
CharismaText.text = "7";
IntelligenceText.text = "4";
WillpowerText.text = "4";
return "Sagittarius";
} else if (i == 10) {
StrengthText.text = "7";
AgilityText.text = "7";
ConstitutionText.text = "7";
SpeedText.text = "4";
EnduranceText.text = "6";
DexterityText.text = "6";
CharismaText.text = "4";
IntelligenceText.text = "4";
return "Capricorn";
} else if (i == 11) {
StrengthText.text = "7";
ConstitutionText.text = "3";
SpeedText.text = "7";
EnduranceText.text = "7";
DexterityText.text = "7";
CharismaText.text = "3";
WillpowerText.text = "6";
return "Aquarius";
} else {
EnduranceText.text = "7";
CharismaText.text = "8";
return "Pisces";
}
}
private void ShowAll(bool TF) {
for (int i = 0; i < Adjuster.Count; i++) {
Adjuster[i].gameObject.SetActive(TF);
}
}
private void ResetStats() {
StrengthText.text = "5";
AgilityText.text = "5";
ConstitutionText.text = "5";
SpeedText.text = "5";
EnduranceText.text = "5";
DexterityText.text = "5";
CharismaText.text = "5";
IntelligenceText.text = "5";
WillpowerText.text = "5";
}
}