Ejemplo n.º 1
0
 static void PayFromIncomeSources()
 {
     for (int i = 0; i < incomeSources().Count; i++)
     {
         if (incomeSources().Count == 0)
         {
             return;
         }
         if (GlobalGameFlags.GetFlag("PLAYER_HAS_APPLIED_TAXFORM") == null)
         {
             Flag taxFlag = new Flag("PLAYER_INFORMED_ABOUT_TAXFORM", 0, true);
             taxFlag.FireFlag();
             PaerToolBox.changePlayerMoney(incomeSources()[i].getNetIncomeInAMonth() * 0.6f);;  //Pelaaja ei ole hakenut verokorttia, rankaise
         }
         else
         {
             PaerToolBox.changePlayerMoney(incomeSources()[i].getNetIncomeInAMonth());
             Flag flag = GlobalGameFlags.GetFlag("FIRST_INCOME_RECEIVED");
             if (flag == null)
             {
                 flag = new Flag("FIRST_INCOME_RECEIVED", 0, true);
                 GlobalGameFlags.addFlag(flag);
                 flag.FireFlag();
             }
         }
     }
     removeExtras();
 }
Ejemplo n.º 2
0
 //static void checkBelowZeroMoney()
 //{
 //    float checkedAmount = PlayerDataHolder.Current.PlayerMoney.getValue<float>();
 //    float bankBackUp = Bank.Current.SavedMoney.getValue<float>();
 //    if (checkedAmount < 0)
 //    {
 //        float bankCheck = checkedAmount + bankBackUp;
 //        if (bankCheck > 0)
 //        {
 //            Bank.Current.SavedMoney.MoneyChange(checkedAmount);
 //            Flag savingsSave = new Flag("PLAYER_ECONOMY_SAVED_BY_SAVINGS", 0, false);
 //            savingsSave.FireFlag();
 //            PlayerDataHolder.Current.PlayerMoney.resetMoney();
 //            return;
 //        }
 //        int strikesGenerated = (checkedAmount > 500f) ? 2 : 1;
 //        //Pelaaja menettää kaksi "elämää" jos hänen velkansa on yli 500
 //        OnBust?.Invoke(strikesGenerated);
 //    }
 //}
 static void deductExpenses()
 {
     for (int i = 0; i < PlayerDataHolder.MonthlyListableExpenses.Count; i++)
     {
         PaerToolBox.changePlayerMoney(-PlayerDataHolder.MonthlyListableExpenses[i].getTotal());
     }
     onExpensesPay?.Invoke();
 }
    static void checkBustState(int strikes)
    {
        maxBusts -= strikes;
        OnDamage.Invoke(strikes);

        if (maxBusts < 0)
        {
            gameFailEnd();
        }
        if (maxBusts > 0)
        {
            Flag flag = new Flag("PLAYER_LOST_HP", 0, false);
            flag.FireFlag();
            PlayerDataHolder.Current.PlayerMoney.resetMoney();
            PaerToolBox.changePlayerMoney(100);
        }
    }
 public void SellItem()
 {
     PaerToolBox.changePlayerMoney(buyValue * 0.75f);
     PlayerDataHolder.Current.Comfortableness.ChangeStat(-satisfactionGain);
 }