using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using Terraria;
using TAPI;
namespace T727Mod.Items
{
public class M4A1 : ModItem
{
byte wheelmanager = -0;
public override bool CanEquip(Player player, TAPI.UIKit.ItemSlot slot)
{
int CurrentClip = 30 ;
int ClipSize = 30 ; //Clip size base
int FireRate = 9 ; //in FPS, the higher, the slower
int ReloadTime = 132 ; //2.2 sec reload
if (CurrentClip == 0 )
{
System.Diagnostics.Stopwatch reloader = new System.Diagnostics.Stopwatch();
Dictionary<int, Texture2D> wheelSprites = new Dictionary<int, Texture2D>();
wheelSprites.Add(0, Content.Load<Texture2D>("ReloadbarEmpty"));
wheelSprites.Add(1, Content.Load<Texture2D>("Reloadbar1of19"));
wheelSprites.Add(2, Content.Load<Texture2D>("Reloadbar2of19"));
wheelSprites.Add(3, Content.Load<Texture2D>("Reloadbar3of19"));
wheelSprites.Add(4, Content.Load<Texture2D>("Reloadbar4of19"));
wheelSprites.Add(5, Content.Load<Texture2D>("Reloadbar5of19"));
wheelSprites.Add(6, Content.Load<Texture2D>("Reloadbar6of19"));
wheelSprites.Add(7, Content.Load<Texture2D>("Reloadbar7of19"));
wheelSprites.Add(8, Content.Load<Texture2D>("Reloadbar8of19"));
wheelSprites.Add(9, Content.Load<Texture2D>("Reloadbar9of19"));
wheelSprites.Add(10, Content.Load<Texture2D>("Reloadbar10of19"));
wheelSprites.Add(11, Content.Load<Texture2D>("Reloadbar11of19"));
wheelSprites.Add(12, Content.Load<Texture2D>("Reloadbar12of19"));
wheelSprites.Add(13, Content.Load<Texture2D>("Reloadbar13of19"));
wheelSprites.Add(14, Content.Load<Texture2D>("Reloadbar14of19"));
wheelSprites.Add(15, Content.Load<Texture2D>("Reloadbar15of19"));
wheelSprites.Add(16, Content.Load<Texture2D>("Reloadbar16of19"));
wheelSprites.Add(17, Content.Load<Texture2D>("Reloadbar17of19"));
wheelSprites.Add(18, Content.Load<Texture2D>("Reloadbar18of19"));
wheelSprites.Add(19, Content.Load<Texture2D>("Reloadbar19of19"));
if (reloader.ElapsedMilliseconds %150 < 1)
{
wheelmanager += 1;
if (wheelmanager == 20)
{
wheelmanager = 0;
}
}
}
}
}
}