using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO; using TinySaveAPI; using System.Threading.Tasks; // Enum index corresponds with stat index for that character. public enum Employee { Elaine, Irida, Clem, Schroder } public enum Unlockable { None, IridaPlayable, ClemPlayable, SchroderPlayable, Dialogue_Elaine_Voyeurism, Dialogue_Elaine_Femdom, Dialogue_Elaine_Foodplay, Dialogue_Irida_Anal, Dialogue_Irida_Boobies, Dialogue_Irida_Oral, Dialogue_Clem_FFM, Dialogue_Clem_BadGirl, Dialogue_Clem_Exploration, Dialogue_Clem_Confession, Dialogue_Schroder_Packing, Dialogue_Schroder_Anal, Dialogue_Schroder_Lapdance, Dialogue_Schroder_Dom, Backrooms, } public class EmployeeStats { // TODO: Add performance-based stats for employees, such as // Speed - how efficiently they complete timed tasks // Appeal - affects chance of receiving tasks, and tip percentages // Specialty - affects the chance and effectiveness of a special buff during gameplay. // The buff varies by character and might even have different trigger conditions. // Each employee should build a different amount of these stats per level. // The starting energy that this employee has at the beginning of each shift. // Should increase with employee level. public int maxEnergy { get; set; } = 100; // RPG-style level and experience. Completing a work day earns each employee EXP, // depending on how well you did and how much energy they expended. // The max level is 10. // TODO: Write a formula for EXP given based on daily performance. public int level { get; set; } = 1; public int exp { get; set; } = 0; // "Love" stat. Increases as you interact with the employee, and at the end of // any shift based on their performance. // This is the primary way to unlock sex scenes. // TODO: Write a formula for interactions and unlock thresholds. public int affinity { get; set; } = 0; // Chosen hairstyle for the character. public int hair { get; set; } = 0; // Returns true iff the employee leveled up. public bool GainExp(int newExp) { exp += newExp; bool leveledUp = false; while (level <= expRequirement.Length && exp > expRequirement[level-1]) { exp -= expRequirement[level - 1]; level += 1; leveledUp = true; } return leveledUp; } public static int[] expRequirement = { 25, // to level 2 100, 300, 600, 1000, 1500, 3000, 5000, 10000 // to level 10 }; } [System.Serializable] public class GameData { public int money = 0; public int day = 1; public EmployeeStats[] employeeStats = { // Elaine new EmployeeStats() { maxEnergy = 100, level = 1, exp = 0, affinity = 10, hair = 0, }, // Irida new EmployeeStats() { maxEnergy = 110, level = 2, exp = 0, affinity = 10, hair = 1, }, // Clem new EmployeeStats() { maxEnergy = 60, level = 3, exp = 0, affinity = -20, hair = 2, }, // Schroder new EmployeeStats() { maxEnergy = 200, level = 5, exp = 0, affinity = 20, hair = 3, }, }; public HashSet unlocked = new HashSet() { Unlockable.ClemPlayable, Unlockable.IridaPlayable, Unlockable.SchroderPlayable, Unlockable.Dialogue_Clem_BadGirl, }; public HashSet viewedScenes = new HashSet(); // Who's displayed in the game's main menu? public Employee sidePiece = Employee.Elaine; GameData() { } public static bool IsUnlocked(Unlockable u) { return GLOBAL.unlocked.Contains(u); } public static void Unlock(Unlockable u) { GLOBAL.unlocked.Add(u); } public static bool IsPlayerUnlocked(Employee e) { switch (e) { case Employee.Elaine: return true; case Employee.Irida: return IsUnlocked(Unlockable.IridaPlayable); case Employee.Clem: return IsUnlocked(Unlockable.ClemPlayable); case Employee.Schroder: return IsUnlocked(Unlockable.SchroderPlayable); } return false; } public static EmployeeStats StatsOf(Employee e) { return GLOBAL.employeeStats[(int)e]; } public static GameData GLOBAL = new GameData(); public static void Save() { Debug.Log("GAME SAVE!"); string loc = Application.persistentDataPath + "/save.ihob"; Debug.Log("TODO: Actually save the game"); } public static bool Load() { Debug.Log("GAME LOAD!"); string loc = Application.persistentDataPath + "/save.ihob"; if (!File.Exists(loc)) { return false; } Debug.Log("TODO: Actually save the game"); return true; } }