Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void SkillsMenu()
- {
- defaultMenu.SetActive(false);
- skillsMenu.SetActive(true);
- nativeSkillsMenu.SetActive(true);
- otherSkillsMenu.SetActive(true);
- //Clearing the native moves list of the player. (This isn't really needed because it should be clear beforehand)
- //This is just for testing purposes, when adding a new move to the moves available within the job class and refreshing.
- activeBattlers[0].nativeMoves.Clear();
- //Setting it so you cannot scroll out of range of your moves with the buttons.
- scrollNativeMoves = Mathf.Clamp(scrollNativeMoves, 0, Mathf.Abs(activeBattlers[0].movesAvailable.Length - battleSkills.Length));
- //Setting what moves appear on the skill buttons.
- for (int i = 0; i < battleSkills.Length; i++)
- {
- //Checking to what job class the player is.
- if (activeBattlers[0].jobClass == moveList[i].jobClass)
- {
- //Setting what skills the player will have.
- for (int j = 0; j < activeBattlers[0].movesAvailable.Length; j++)
- {
- //Checking to see what move the player has within the job class.
- if (activeBattlers[0].movesAvailable[j] == moveList[i].moveName)
- {
- //Adding that move to the nativeMoves list.
- activeBattlers[0].nativeMoves.Add(moveList[i].moveName);
- }
- }
- }
- //Making sure the buttons have a move they can be assigned.
- if (activeBattlers[0].movesAvailable.Length > i)
- {
- //Setting the button to be true.
- battleSkills[i].gameObject.SetActive(true);
- //Setting the skill name to the moves found on the list.
- battleSkills[i].skillName = activeBattlers[0].movesAvailable[i + scrollNativeMoves];
- //Changing the skill text to the skill name.
- battleSkills[i].skillText.text = battleSkills[i].skillName;
- //Setting the cost of the move.
- for (int j = 0; j < moveList.Length; j++)
- {
- //If the movelist finds a move that the player also has.
- if (moveList[j].moveName == battleSkills[i].skillName)
- {
- //Setting the hp cost of the move.
- battleSkills[i].hpCost = moveList[j].hpCost;
- //Setting the mp cost of the move.
- battleSkills[i].mpCost = moveList[j].mpCost;
- //Setting the st cost of the move.
- battleSkills[i].stCost = moveList[j].stCost;
- }
- }
- }
- else
- {
- //The button is turned off.
- battleSkills[i].gameObject.SetActive(false);
- }
- //Setting the main button to have information from the first skill set as default.
- skillText.text = battleSkills[0].skillName;
- hpCost.text = battleSkills[0].hpCost.ToString();
- mpCost.text = battleSkills[0].mpCost.ToString();
- spCost.text = battleSkills[0].stCost.ToString();
- }
- /*for (int i = 0; i < battleSkills.Length; i++)
- {
- //Setting the skill name to the moves found on the list.
- battleSkills[i].skillName = moveList[i].moveName;
- //Changing the skill text to the skill name.
- battleSkills[i].skillText.text = battleSkills[i].skillName;
- //Setting the hp cost of the move.
- battleSkills[i].hpCost = moveList[i].hpCost;
- //Setting the mp cost of the move.
- battleSkills[i].mpCost = moveList[i].mpCost;
- //Setting the st cost of the move.
- battleSkills[i].stCost = moveList[i].stCost;
- Debug.Log("Test");
- }*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement