add trolley and uncertain. start on parlor puzzles
This commit is contained in:
@@ -80,7 +80,7 @@ public class DoorManager : MonoBehaviour, IDescribable
|
||||
|
||||
public string GetUnknownDescription()
|
||||
{
|
||||
if (mod == "RED" || mod == "BLUE")
|
||||
if (mod == "RED" || mod == "BLUE" || mod == "PLAIN")
|
||||
{
|
||||
return $"the {mod} door";
|
||||
} // add more modification here
|
||||
|
||||
@@ -13,6 +13,8 @@ public class GlobalStateManager : Singleton<GlobalStateManager>
|
||||
|
||||
public List<TextAsset> levels;
|
||||
|
||||
public TextAsset parlorPuzzles;
|
||||
|
||||
//aaaaa theres nicer syntax for this i think
|
||||
protected override bool dontDestroyOnLoad()
|
||||
{
|
||||
|
||||
@@ -12,6 +12,9 @@ public class GuardManager : MonoBehaviour, IDescribable
|
||||
public string mod;
|
||||
|
||||
public GameObject hat;
|
||||
|
||||
public string puzzle;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
@@ -107,6 +110,10 @@ public class GuardManager : MonoBehaviour, IDescribable
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
else if (question == "RANDOM")
|
||||
{
|
||||
return Random.value > 0.5? QuestionAnswer.YES : QuestionAnswer.NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
@@ -33,6 +33,13 @@ public class LevelLoader : Singleton<LevelLoader>
|
||||
data.doors.Shuffle();
|
||||
data.guards.Shuffle();
|
||||
|
||||
//maybe in wrong place, idc at this point engine almost done
|
||||
//get parlor puzzles
|
||||
var parlorText = GlobalStateManager.Instance.parlorPuzzles.ToString();
|
||||
var parlorData = JsonUtility.FromJson<PuzzleData>(parlorText);
|
||||
var puzzleId = Random.Range(0, parlorData.boxes.Count);
|
||||
|
||||
|
||||
//spawn in doors
|
||||
float spacingDoors = widthAvail / (data.doors.Count + 1);
|
||||
for(int i = 0; i < data.doors.Count; i++)
|
||||
@@ -41,8 +48,37 @@ public class LevelLoader : Singleton<LevelLoader>
|
||||
doorinstance.transform.position = new Vector3(spacingDoors*(i+1), 0, 0);
|
||||
|
||||
var manager = doorinstance.GetComponent<DoorManager>();
|
||||
manager.type = data.doors[i].action;
|
||||
manager.mod = data.doorsmods.GetRandomAndRemove();
|
||||
manager.type = data.doors[i].action;
|
||||
|
||||
|
||||
|
||||
|
||||
if (data.doorsmods == null || data.doorsmods.Count == 0)
|
||||
{
|
||||
//continue?
|
||||
}
|
||||
else if (data.doorsmods[0].StartsWith("#"))
|
||||
{
|
||||
manager.mod = data.doorsmods.GetTopAndRemove();
|
||||
|
||||
//aaaaaaa
|
||||
//shoehoerned in puzzle implementation
|
||||
if (manager.type == "PUZZLE")
|
||||
{
|
||||
if (manager.mod.ToLower().EndsWith(parlorData.boxes[puzzleId].color.ToLower()))
|
||||
{
|
||||
manager.type = "LIFE";
|
||||
}
|
||||
else
|
||||
{
|
||||
manager.type = "DEATH";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
manager.mod = data.doorsmods.GetRandomAndRemove();
|
||||
}
|
||||
|
||||
Doors.Add(manager);
|
||||
}
|
||||
@@ -56,8 +92,13 @@ public class LevelLoader : Singleton<LevelLoader>
|
||||
|
||||
var manager = guardinstance.GetComponent<GuardManager>();
|
||||
manager.type = data.guards[i].action;
|
||||
|
||||
if (data.guardsmods[0].StartsWith("#"))
|
||||
manager.puzzle = parlorData.boxes[puzzleId].puzzles[i];
|
||||
|
||||
if (data.guardsmods == null || data.guardsmods.Count == 0)
|
||||
{
|
||||
//continue?
|
||||
}
|
||||
else if (data.guardsmods[0].StartsWith("#"))
|
||||
{
|
||||
manager.mod = data.guardsmods.GetTopAndRemove();
|
||||
}
|
||||
|
||||
@@ -27,4 +27,17 @@ namespace Utils
|
||||
public string type;
|
||||
public string action;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class PuzzleData
|
||||
{
|
||||
public List<Puzzle> boxes;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class Puzzle
|
||||
{
|
||||
public string[] puzzles;
|
||||
public string color;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user