start work on microgames

This commit is contained in:
myondev 2026-09-03 08:59:35 -07:00
parent ef733054ef
commit ecff3c6b69
6 changed files with 105 additions and 0 deletions

View file

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
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
{
public string[] chemicals;
}
public void AddChemical(string chemical)
{
if (currentPotion.chemicals[currentPotionIndex+1] == chemical )
{
currentPotionIndex++;
if (currentPotion.chemicals.Length > currentPotionIndex)
{
CompletePotion(currentPotion, true);
}
}
else
{
CompletePotion(currentPotion, false);
}
}
public void CompletePotion(Potion potion, bool success)
{
requestedPotions.Remove(potion); //doesn't work if there's multiple of the same potion....
if (success)
{
completedPotions.Add(potion);
}
else
{
failedPotions.Add(potion);
}
}
}