Exemple #1
0
        private static void OverdueLoan(int regionIndex)
        {
            // Try to repay the loan off player's account
            int transferAmount = (int)Math.Min(DaggerfallBankManager.GetLoanedTotal(regionIndex), DaggerfallBankManager.GetAccountTotal(regionIndex));

            DaggerfallBankManager.MakeTransaction(TransactionType.Repaying_loan_from_account, transferAmount, regionIndex);
            if (!DaggerfallBankManager.HasLoan(regionIndex))
            {
                return;
            }

            // Only apply reputation drop once
            if (DaggerfallBankManager.HasDefaulted(regionIndex))
            {
                return;
            }

            // Set hasDefaulted flag (Note: Does not seem to ever be set in classic)
            DaggerfallBankManager.SetDefaulted(regionIndex, true);

            PlayerEntity playerEntity = GameManager.Instance.PlayerEntity;

            // Should that be weighted by the amount?
            playerEntity.LowerRepForCrime(regionIndex, PlayerEntity.Crimes.LoanDefault);
        }
 //handles button clicks from Sell ship message box
 void SellShip_messageBox_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton)
 {
     if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes)
     {
         DaggerfallBankManager.MakeTransaction(TransactionType.Sell_ship, 0, regionIndex);
     }
     sender.CloseWindow();
 }
        //handles button clicks from Deposit LOC message box
        void DepositLOC_messageBox_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton)
        {
            if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes)
            {
                DaggerfallBankManager.MakeTransaction(TransactionType.Depositing_LOC, 0, regionIndex);
            }

            sender.CloseWindow();
        }
        void HandleTransactionInput()
        {
            int amount = 0;

            if (string.IsNullOrEmpty(transactionInput.Text))
            {
                return;
            }
            else if (!System.Int32.TryParse(transactionInput.Text, out amount))
            {
                Debug.LogError("Failed to parse input");
                return;
            }
            else if (amount < 1)
            {
                return;
            }
            else
            {
                DaggerfallBankManager.MakeTransaction(transactionType, amount, regionIndex);
            }
        }