Exemple #1
0
    private void InitNewGame()
    {
        GameData.EraseGame();

        // initialize events here for the moment..
        EventState.Clear();
        EventState.PushEvent(new TutorialEventChain.IntroductionEvent(), 0, 0);
        WifeEventChain.Init();
        InvestmentEventChain.Init();
        FestivalEventChain.Init();
        PoisonDemandChangeEventChain.Init();

        GameData.singleton.money          = DebugOverrides.StartingMoney;
        GameData.singleton.initialBalance = GameData.singleton.money;
        // Set final balance for the previous quarter so that next Q can use it as initial balance
        GameData.singleton.finalBalance = GameData.singleton.money;
        GameData.singleton.rent         = 300;

        // Starting unlocks
        GameData.singleton.potionsUnlocked[(int)PotionType.PT_LOVE_POTION] = true;
        GameData.singleton.potionsUnlocked[(int)PotionType.PT_FIRE_POTION] = true;
        // Queue timed unlocks of other potion types
        // The game starts in quarter 0
        EventState.PushEvent(new UnlockPotionEvent(PotionType.PT_POISON_POTION), 1);
        EventState.PushEvent(new UnlockPotionEvent(PotionType.PT_INVIS_POTION), 2);
        EventState.PushEvent(new UnlockPotionEvent(PotionType.PT_LUCK_POTION), 3);

        // Starting feathers owned
        GameData.singleton.feathersOwned[(int)FeatherType.FT_GREEN_FEATHER]  = 0;
        GameData.singleton.feathersOwned[(int)FeatherType.FT_PINK_FEATHER]   = 0;
        GameData.singleton.feathersOwned[(int)FeatherType.FT_ORANGE_FEATHER] = 5;
        GameData.singleton.feathersOwned[(int)FeatherType.FT_BLUE_FEATHER]   = 5;

        for (int i = 0; i < (int)FeatherType.FT_MAX; i++)
        {
            GameData.singleton.feathersUnlocked[i] = GameData.singleton.feathersOwned[i] > 0;
        }

        // Starting potions owned and prices
        for (int i = 0; i < GameData.singleton.potionsOwned.Length; ++i)
        {
            GameData.singleton.potionsOwned[i] = GameData.singleton.potionsUnlocked[i] ? 10 : 0;
            int numFeathersInRecipe = 0;
            foreach (FeatherAndCount feathAndCount in ((PotionType)i).GetIngredients())
            {
                numFeathersInRecipe += feathAndCount.count;
            }
            GameData.singleton.potionPrices[i] = 25 * numFeathersInRecipe;
            GameData.singleton.quarterlyReportSalePrices[i] = 25 * numFeathersInRecipe;
        }

        InitWorldParams();
    }