using System; using System.Collections.Generic; [Serializable] public class ModeDefinition { public string key; public string name; public string tag; public string description; public string previewMoves; public string previewFruits; } [Serializable] public class PowerUpDefinition { public string key; public string name; public string shortName; public int price; public string description; public string spriteResource; } [Serializable] public class CheckInReward { public bool coins; public int amount; public string itemKey; public string label; } [Serializable] public class DrawPrize { public bool coins; public int amount; public string itemKey; public int weight; public string label; } public static class GameDefinitions { public const int MaxLevel = 20; public const int MaxCheckInDay = 7; public const int LedgerLimit = 200; public const int DefaultCoins = 1500; public const int MaxAdRevivesPerDay = 5; public const int AdReviveMoveBonus = 5; public const string ClassicMode = "classic"; public const string RushMode = "rush"; public const string SealedMode = "sealed"; public const string HammerItem = "hammer"; public const string MovesItem = "moves"; public const string ShuffleItem = "shuffle"; public const string KeyItem = "key"; public static readonly ModeDefinition[] Modes = { new ModeDefinition { key = ClassicMode, name = "CLASSIC STAND", tag = "NO TIMER", description = "Tap a fruit, then tap a shelf. Empty the stand.", previewMoves = "17 MOVES", previewFruits = "4 FRUITS" }, new ModeDefinition { key = RushMode, name = "RUSH HOUR", tag = "TIMED", description = "A countdown runs - every set you serve adds 2 seconds.", previewMoves = "17 MOVES", previewFruits = "5 FRUITS" }, new ModeDefinition { key = SealedMode, name = "SEALED STAND", tag = "CHAINED", description = "Chained shelves stay shut until you serve enough sets.", previewMoves = "18 MOVES", previewFruits = "6 FRUITS" } }; public static readonly PowerUpDefinition[] PowerUps = { new PowerUpDefinition { key = HammerItem, name = "HAMMER", shortName = "HAMMER", price = 400, description = "Smash any single fruit off a shelf. Free - does not cost a move.", spriteResource = "UI/02_game/powerup/spr_powerup_hammer" }, new PowerUpDefinition { key = MovesItem, name = "+5 MOVES", shortName = "+5 MOVES", price = 500, description = "Instantly add 5 moves to the current level.", spriteResource = "UI/02_game/powerup/spr_powerup_add_moves" }, new PowerUpDefinition { key = ShuffleItem, name = "SHUFFLE", shortName = "SHUFFLE", price = 450, description = "Re-deal every visible fruit across the open shelves. Free - does not cost a move.", spriteResource = "UI/02_game/powerup/spr_powerup_shuffle" }, new PowerUpDefinition { key = KeyItem, name = "MASTER KEY", shortName = "KEY", price = 700, description = "Snap the chains off one sealed shelf. With no chains left it empties a shelf instead.", spriteResource = "UI/02_game/powerup/spr_powerup_key" } }; public static readonly CheckInReward[] CheckInRewards = { new CheckInReward { coins = true, amount = 200, label = "200" }, new CheckInReward { coins = false, amount = 1, itemKey = HammerItem, label = "HAMMER" }, new CheckInReward { coins = true, amount = 300, label = "300" }, new CheckInReward { coins = false, amount = 1, itemKey = ShuffleItem, label = "SHUFFLE" }, new CheckInReward { coins = true, amount = 500, label = "500" }, new CheckInReward { coins = false, amount = 1, itemKey = MovesItem, label = "+5 MOVES" }, new CheckInReward { coins = true, amount = 1000, label = "1000" } }; public static readonly DrawPrize[] DrawPrizes = { new DrawPrize { coins = true, amount = 200, weight = 24, label = "200" }, new DrawPrize { coins = false, amount = 1, itemKey = HammerItem, weight = 10, label = "HAMMER" }, new DrawPrize { coins = true, amount = 500, weight = 16, label = "500" }, new DrawPrize { coins = false, amount = 1, itemKey = ShuffleItem, weight = 10, label = "SHUFFLE" }, new DrawPrize { coins = true, amount = 1000, weight = 7, label = "1000" }, new DrawPrize { coins = false, amount = 1, itemKey = MovesItem, weight = 6, label = "+5 MOVES" }, new DrawPrize { coins = true, amount = 300, weight = 18, label = "300" }, new DrawPrize { coins = false, amount = 1, itemKey = KeyItem, weight = 9, label = "KEY" } }; // Grid order used by the 3 x 3 draw board. -1 is the centre spin button. public static readonly int[] DrawGridPrizeMap = { 0, 1, 2, 3, -1, 4, 5, 6, 7 }; // Clockwise ring around the centre of the 3 x 3 draw board. public static readonly int[] DrawRingGridOrder = { 0, 1, 2, 5, 8, 7, 6, 3 }; // The twelve selectable avatars shown in 07_profile, in visual cell order. public static readonly int[] AvatarSpriteIndices = { 1, 2, 4, 6, 11, 5, 8, 10, 7, 9, 12, 13 }; public static bool IsSelectableAvatar(int spriteIndex) { for (int i = 0; i < AvatarSpriteIndices.Length; i++) { if (AvatarSpriteIndices[i] == spriteIndex) return true; } return false; } public static ModeDefinition GetMode(string key) { for (int i = 0; i < Modes.Length; i++) { if (Modes[i].key == key) return Modes[i]; } return Modes[0]; } public static PowerUpDefinition GetPowerUp(string key) { for (int i = 0; i < PowerUps.Length; i++) { if (PowerUps[i].key == key) return PowerUps[i]; } return null; } }