public ActionResult GoSleep()
        {
            var username = HttpContext.User.Identity.Name;
            var user     = db.User.Where(x => x.Username == username).FirstOrDefault();

            ReloadTimer reloadTimer;

            if (user.SleepTemporary.Any())
            {
                var sTemp = user.SleepTemporary.LastOrDefault();

                //if start sleep time remembered
                if (!sTemp.StartSleep.Equals(DateTime.MinValue)) //jeśli jest wypełnione
                {
                    var amountOfSLeep = DateTime.Now - sTemp.StartSleep;
                    reloadTimer = new ReloadTimer {
                        RememberTimer = true,
                        Hours         = amountOfSLeep.Hours,
                        Minutes       = amountOfSLeep.Minutes,
                        Seconds       = amountOfSLeep.Seconds
                    };
                }
                else
                {
                    throw new Exception();
                }
            }
            else
            {
                reloadTimer = new ReloadTimer {
                    RememberTimer = false
                }
            };
            return(View(reloadTimer));
        }
Exemple #2
0
 private void ReloadBtn_Click(object sender, EventArgs e)
 {
     if (ReloadTimer.Enabled == false)
     {
         if (ShootTimer.Enabled == false)
         {
             ReloadTimer.Start();
             Reload++;        //counts reloads
             Cap *= 0;        //gets rid of excess ammo to simulate a maximum clip
             Cap += Ammo * 5; //Finds if ammo upgrades have been purchased then sets it
             #region Reload Sound
             ////////////////////////////////////////////////////////////////////////
             try
             {
                 SoundPlayer sndplayr = new
                                        SoundPlayer(ClickingGame.Properties.Resources.Mush_Appear);
                 sndplayr.Play();
             }                                                                       //Plays Reload sound
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message + ": " + ex.StackTrace.ToString(),
                                 "Error");
             }
             ///////////////////////////////////////////////////////////////////////
             #endregion
             //everything below refresh's the label txt to reflect its current value.
             ReloadNum.Text = Convert.ToString(Reload);
             label3.Text    = Convert.ToString(Cap);
             label5.Text    = Convert.ToString(Shoot);
             label7.Text    = Convert.ToString(coin);
             //end
         }
     }
 }
Exemple #3
0
    public void Start()
    {
        GameStateManager.OnGameEventChanged += CheckEvent;
        timer = gameObject.AddComponent <ReloadTimer>();
        timer.Setup(timeToExpire, true);

        SetPrefabToCurrentUpgrade();
    }
        public static void dbReload_OnCommand(CommandEventArgs e)
        {
            SpeechData.blockRequests = true;

            // 2 second pause for pending requests to clear
            ReloadTimer t = new ReloadTimer(e.Mobile);

            t.Start();
        }
Exemple #5
0
    protected override void Awake()
    {
        base.Awake();

        _targets = new List <Collider>();


        AttackAnimationEvent.OnEnd += () =>
        {
            ReloadTimer.Start();
        };
    }
Exemple #6
0
        public AutoReloader(Action <string> action)
        {
            ReloadAction = action;

            Watcher.Changed += Watcher_Changed;

            ReloadTimer = new Timer((state) =>
            {
                ReloadTimer.Change(Timeout.Infinite, Timeout.Infinite);

                ReloadAction.Invoke(File);
            });
        }
Exemple #7
0
    public void Setup(DamageData data)
    {
        this.damageData = data;
        gameObject.name = "Shooter";

        enemyOnRangeChecker = gameObject.AddComponent <EnemyOnRangeNoCollider>();
        enemyOnRangeChecker.Setup(damageData);
        weapon = gameObject.AddComponent <Weapon>();
        transform.localPosition = Vector3.zero;

        reloadTimer = gameObject.AddComponent <ReloadTimer>();
        reloadTimer.Setup(damageData.reloadTime);
    }
Exemple #8
0
    private void Start()
    {
        AttackAnimationEvent.OnStart += () =>
        {
            _ammo.Reduce();
        };

        AttackAnimationEvent.OnEnd += () =>
        {
            if (_ammo.CurrentCount <= 0)
            {
                ReloadTimer.Start();
            }
        };
    }
Exemple #9
0
    public void Start()
    {
        this.damageData = GetComponentInParent <DamageData>();
        gameObject.name = "Shooter";

        animator = GetComponent <Animator>();

        enemyOnRangeChecker = gameObject.AddComponent <EnemyOnRangeNoCollider>();
        enemyOnRangeChecker.Setup(damageData);
        weapon = gameObject.AddComponent <Weapon>();
        //transform.localPosition = Vector3.zero;

        reloadTimer = gameObject.AddComponent <ReloadTimer>();
        reloadTimer.Setup(damageData.reloadTime);
    }
Exemple #10
0
 // Use this for initialization
 void Start()
 {
     timer = gameObject.AddComponent <ReloadTimer>();
     timer.Setup(timeToExpire);
     timer.Start();
 }
Exemple #11
0
 private void Start()
 {
     reloadTime = GetComponent <ReloadTimer>();
 }
Exemple #12
0
 void Start()
 {
     health = GetComponent <Health>();
     timer  = gameObject.AddComponent <ReloadTimer>();
     timer.Setup(health.timeToResuscitate);
 }
Exemple #13
0
 void Start()
 {
     health      = GetComponent <Health>();
     reloadTimer = gameObject.AddComponent <ReloadTimer>();
     reloadTimer.Setup(1f);
 }
 private void Awake()
 {
     ReloadTimer  = Reload.GetComponentInChildren <ReloadTimer>();
     RecoverTimer = Recover.GetComponentInChildren <RecoverTimer>();
 }