public class LuckyGift
{
	public int id;

	public string info;

	public Image icon;

	public int num;

	public int type;

	public int itemID = -1;

	public int luckyCode;

	public int tCount;

	public int index = CRes.random(0, 5);

	public bool isWait;

	public bool isServerSend;

	public bool isShow;

	private int[] dx = new int[10] { -2, 2, -2, 2, -2, 2, 0, 0, 0, 0 };

	private int x;

	private int y;

	public void paint(mGraphics g, int x, int y)
	{
		this.x = x;
		this.y = y;
		if (isShow)
		{
			if (type == 0 || type == 1)
			{
				mFont.tahoma_7b_white.drawString(g, info, x, y, 3);
			}
			if (type == 3)
			{
				Item.DrawItem(g, itemID, x - 8, y - 8);
				mFont.tahoma_7b_white.drawString(g, info, x + 8, y + 6, 3);
			}
			if (type == 2 && icon != null)
			{
				g.drawImage(icon, x, y, 3, false);
				mFont.tahoma_7b_white.drawString(g, info, x + 8, y + 6, 3);
			}
		}
		else
		{
			g.drawImage(Boss.gift_1, x + dx[index], y, 3, false);
		}
	}

	public void update()
	{
		if (!isWait)
		{
			return;
		}
		tCount++;
		index++;
		if (index == dx.Length)
		{
			index = 0;
		}
		if (type != 2)
		{
			if (tCount > 15 && isServerSend)
			{
				isWait = false;
				isShow = true;
				isServerSend = false;
				new Explosion(x, y + 6, 1);
			}
		}
		else if (tCount > 15 && icon != null && isServerSend)
		{
			isWait = false;
			isShow = true;
			isServerSend = false;
			new Explosion(x, y + 6, 1);
		}
	}
}
