Browse Source

favorite things

bumblebacchanal
Josh 10 months ago
parent
commit
e30738d193
  1. 83
      namedropper/Assets/Resources/categories.yaml
  2. 18
      namedropper/Assets/Scripts/GameDataManager.cs
  3. 6
      namedropper/Assets/Scripts/TopicSelect.cs

83
namedropper/Assets/Resources/categories.yaml

@ -1,4 +1,87 @@
Topics:
- Topic: Favorite Things
Categories:
- Category: Josh
Elements:
- Shopsin's
- Mangoes
- Lewis & Clark
- Backpack rap
- Jackie Brown
- Marvel Snap
- Jazz saxophone
- Crosswords
- My wife Amanda
- Bonne Maman jelly
- Bukowski
- Nabokov
- Broguelikes
- The Magnetic Fields
- Category: Yalan
Elements:
- Tea with milk
- silky bed sheet
- hot spring
- High ceiling
- furry dog
- Category: Mus
Elements:
- The Good, the Bad & the Ugly
- Dragon Ball Z
- One Piece
- Spider-man
- Killer Queen Arcade
- Sculpting
- Dawn
- Rainy days in
- Smash Bros Melee
- Action figures
- Category: Nik
Elements:
- Chicken Fried steak
- Black Sabbath
- The Kinks
- They Might be Giants
- Led Zeppelin
- Motown
- Disco
- Swimming
- Jiu Jitsu
- 70s Blaxploitation
- Quentin Tarantino
- Super Smash Brothers
- Scott Pilgrim
- The Legend of Zelda
- Hedwig & the Angry Inch
- Cappuccinos
- Philip K Dick
- Vector Displays
- Attack on Titan
- Category: Amanda
Elements:
- bourbon neat
- black coffee
- Hooded sweatshirts
- Books
- Campfires
- Tent camping
- Exploring new places
- L&B Spumoni Gardens
- Sausage, egg and cheese
- black pepper
- Category: Maria von Trapp
Elements:
- raindrops on roses
- whiskers on kittens
- bright copper kettles
- warm woolen mittens
- cream-colored ponies
- crisp apple strudels
- doorbells
- sleigh bells
- schnitzel with noodles
- Topic: Contemporary TV
Categories:
- Category: White Lotus

18
namedropper/Assets/Scripts/GameDataManager.cs

@ -22,20 +22,34 @@ public class GameDataManager {
_gameData = deserializer.Deserialize<GameData>(yamlText);
}
public TopicData GetRandomTopicData()
public TopicData GetRandomTopicData(bool ignoreFirst=false)
{
if (_gameData.Topics.Count == 0)
if (_gameData.Topics.Count == 0 || (ignoreFirst && _gameData.Topics.Count == 1))
{
Reset();
}
int topicIndex = Random.Range(0, _gameData.Topics.Count);
if (ignoreFirst && topicIndex == 0)
topicIndex = 1;
TopicData topicData = _gameData.Topics[topicIndex];
_gameData.Topics.RemoveAt(topicIndex);
return topicData;
}
public TopicData GetFirstTopicData()
{
if (_gameData.Topics.Count == 0)
{
Reset();
}
TopicData topicData = _gameData.Topics[0];
return topicData;
}
public CategoryData GetRandomCategoryData(TopicData topicData, bool removeFromTopic = true)
{

6
namedropper/Assets/Scripts/TopicSelect.cs

@ -244,9 +244,9 @@ public class TopicSelect : Level
}
}
_topic1Box.TopicData = GameDataManager.Instance.GetRandomTopicData();
_topic2Box.TopicData = GameDataManager.Instance.GetRandomTopicData();
_topic3Box.TopicData = GameDataManager.Instance.GetRandomTopicData();
_topic1Box.TopicData = GameDataManager.Instance.GetRandomTopicData(true);
_topic2Box.TopicData = GameDataManager.Instance.GetFirstTopicData();
_topic3Box.TopicData = GameDataManager.Instance.GetRandomTopicData(true);
_topic1Box.Name = _topic1Box.TopicData.Topic;
_topic2Box.Name = _topic2Box.TopicData.Topic;
_topic3Box.Name = _topic3Box.TopicData.Topic;

Loading…
Cancel
Save