public SpeedloaderRecipe(SpeedloaderItem myitem) : base(TMRMod.Instance)
 {
     this.AddIngredient(ItemID.IllegalGunParts, 1);
     this.AddIngredient(ItemID.Actuator, 6);
     this.AddTile(TileID.WorkBenches);
     this.SetResult(myitem);
 }
        /// <summary>
        /// Begins a gun reload sequence, if the gun or player allows. Not synced.
        /// </summary>
        /// <param name="plr"></param>
        /// <param name="mygun"></param>
        /// <returns></returns>
        public bool BeginReload(Player plr, TheMadRangerItem mygun)
        {
            if (this.IsReloading)
            {
                return(false);
            }

            if (SpeedloaderItem.IsReloading(plr.whoAmI))
            {
                return(false);
            }

            if (mygun.IsCylinderFull())
            {
                return(false);
            }

            mygun.OpenCylinder(plr);
            this.ReloadDuration = TMRConfig.Instance.Get <int>(nameof(TMRConfig.ReloadInitTickDuration));

            this.IsQuickDrawReady = true;

            return(true);
        }
Example #3
0
        ////////////////

        public bool CanAttemptToShootGun(Player player)
        {
            return(!this.IsHolstering &&
                   (!this.IsReloading || this.ReloadingRounds) &&
                   !SpeedloaderItem.IsReloading(player.whoAmI));
        }