Пример #1
0
            protected override void OnTick()
            {
                int renewalPrice = m_Vendor.RenewalPrice;
                int totalGold    = m_Vendor.BankAccount + m_Vendor.HoldGold;

                //if we dont have the gold at all on vendor destroy is
                if (renewalPrice > totalGold)
                {
                    m_Vendor.Destroy(true);
                }

                else
                {
                    if (m_Vendor.BankAccount >= renewalPrice)
                    {
                        m_Vendor.BankAccount -= renewalPrice;
                        m_Vendor.RentalGold  += renewalPrice;

                        m_Vendor.RentalPrice        = renewalPrice;
                        m_Vendor.m_RentalExpireTime = DateTime.Now + m_Vendor.RentalDuration.Duration;
                    }
                    else
                    {
                        m_Vendor.RentalGold += renewalPrice;
                        renewalPrice        -= m_Vendor.BankAccount;
                        m_Vendor.BankAccount = 0;

                        m_Vendor.HoldGold          -= renewalPrice;
                        m_Vendor.RentalPrice        = renewalPrice;
                        m_Vendor.m_RentalExpireTime = DateTime.Now + m_Vendor.RentalDuration.Duration;
                    }
                }
            }
Пример #2
0
            protected override void OnTick()
            {
                int renewalPrice = m_Vendor.RenewalPrice;

                if (m_Vendor.Renew && m_Vendor.HoldGold >= renewalPrice)
                {
                    m_Vendor.HoldGold   -= renewalPrice;
                    m_Vendor.RentalGold += renewalPrice;

                    m_Vendor.RentalPrice = renewalPrice;

                    m_Vendor.m_RentalExpireTime = DateTime.Now + m_Vendor.RentalDuration.Duration;
                }
                else
                {
                    m_Vendor.Destroy(false);
                }
            }
Пример #3
0
            protected override void OnTick()
            {
                int renewalPrice = m_Vendor.RenewalPrice;

                if (m_Vendor.Renew && m_Vendor.HoldCurrency >= renewalPrice)
                {
                    m_Vendor.HoldCurrency   -= renewalPrice;
                    m_Vendor.RentalCurrency += renewalPrice;

                    m_Vendor.RentalPrice = renewalPrice;

                    m_Vendor.RentalExpireTime = DateTime.UtcNow + m_Vendor.RentalDuration.Duration;
                }
                else
                {
                    m_Vendor.Destroy(true);
                }
            }