microgame progress
This commit is contained in:
parent
ecff3c6b69
commit
79fcc7ce34
16 changed files with 2008 additions and 13 deletions
|
|
@ -1,28 +1,65 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class MarisaPotionMaker : MicroGameHandler
|
||||
{
|
||||
public Potion currentPotion;
|
||||
public List<Potion> requestedPotions = new();
|
||||
public List<Potion> completedPotions = new();
|
||||
public List<Potion> failedPotions = new(); //bad to have 3 lists but whatever.
|
||||
public int currentPotionIndex;
|
||||
|
||||
public class Potion
|
||||
#region Statication
|
||||
|
||||
public static MarisaPotionMaker instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
public string[] chemicals;
|
||||
if (instance != null && instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
instance = this;
|
||||
}
|
||||
|
||||
public void AddChemical(string chemical)
|
||||
#endregion
|
||||
|
||||
public MicrogamePotion currentPotion;
|
||||
public List<MicrogamePotion> requestedPotions = new();
|
||||
public List<MicrogamePotion> completedPotions = new();
|
||||
public List<MicrogamePotion> failedPotions = new(); //bad to have 3 lists but whatever.
|
||||
public int currentPotionIndex;
|
||||
[SerializeField] private TextMeshProUGUI potionRecipeTitle;
|
||||
[SerializeField] private TextMeshProUGUI potionRecipeText;
|
||||
|
||||
public void StartPotion(MicrogamePotion potionRequested)
|
||||
{
|
||||
if (currentPotion.chemicals[currentPotionIndex+1] == chemical )
|
||||
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public void UpdateUI()
|
||||
{
|
||||
//supposed to check off every chemical once added but i'll input that later
|
||||
//for now i have to initialize the ui
|
||||
potionRecipeTitle.text = currentPotion.potionName;
|
||||
string recipe = "";
|
||||
for (int i = 0; i < currentPotion.chemicals.Length; i++)
|
||||
{
|
||||
recipe += $"{i+1}. {currentPotion.chemicals[i].chemicalName}\n";
|
||||
}
|
||||
potionRecipeText.text = recipe;
|
||||
}
|
||||
public void AddChemical(Chemical chemical)
|
||||
{
|
||||
if (currentPotion.chemicals[currentPotionIndex].chemicalName == chemical.chemicalName ) //string comparisons are bad but i don't give a fuck
|
||||
{
|
||||
currentPotionIndex++;
|
||||
if (currentPotion.chemicals.Length > currentPotionIndex)
|
||||
if (currentPotion.chemicals.Length <= currentPotionIndex)
|
||||
{
|
||||
CompletePotion(currentPotion, true);
|
||||
currentPotionIndex = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -31,7 +68,7 @@ public class MarisaPotionMaker : MicroGameHandler
|
|||
}
|
||||
}
|
||||
|
||||
public void CompletePotion(Potion potion, bool success)
|
||||
public void CompletePotion(MicrogamePotion potion, bool success)
|
||||
{
|
||||
requestedPotions.Remove(potion); //doesn't work if there's multiple of the same potion....
|
||||
if (success)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue