예제 #1
0
        public void Load(S.ObjectItem info)
        {
            Name       = info.Name;
            NameColour = info.NameColour;

            BodyLibrary = Libraries.FloorItems;

            CurrentLocation = info.Location;
            MapLocation     = info.Location;
            GameScene.Scene.MapControl.AddObject(this);
            DrawFrame = info.Image;

            Size = BodyLibrary.GetTrueSize(DrawFrame);

            DrawY = CurrentLocation.Y;
        }
예제 #2
0
        public void Load(S.ObjectGold info)
        {
            // Name = string.Format("Gold ({0:###,###,###})", info.Gold);
            Name = "金币";

            BodyLibrary = Libraries.FloorItems;

            CurrentLocation = info.Location;
            MapLocation     = info.Location;
            GameScene.Scene.MapControl.AddObject(this);

            if (info.Gold < 100)
            {
                DrawFrame = 112;
            }
            else if (info.Gold < 200)
            {
                DrawFrame = 113;
            }
            else if (info.Gold < 500)
            {
                DrawFrame = 114;
            }
            else if (info.Gold < 1000)
            {
                DrawFrame = 115;
            }
            else
            {
                DrawFrame = 116;
            }

            Size = BodyLibrary.GetTrueSize(DrawFrame);

            DrawY = CurrentLocation.Y;
        }
예제 #3
0
        public override void Process()
        {
            bool update = CMain.Time >= NextMotion || GameScene.CanMove;

            ProcessFrames();

            if (update)
            {
                UpdateBestQuestIcon();
            }

            if (Frame == null)
            {
                DrawFrame     = 0;
                DrawWingFrame = 0;
            }
            else
            {
                DrawFrame     = Frame.Start + (Frame.OffSet * (byte)Direction) + FrameIndex;
                DrawWingFrame = Frame.EffectStart + (Frame.EffectOffSet * (byte)Direction) + EffectFrameIndex;
            }

            DrawY = CurrentLocation.Y;

            DrawLocation = new Point((Movement.X - User.Movement.X + MapControl.OffSetX) * MapControl.CellWidth, (Movement.Y - User.Movement.Y + MapControl.OffSetY) * MapControl.CellHeight);
            DrawLocation.Offset(User.OffSetMove);
            if (BodyLibrary != null)
            {
                FinalDrawLocation = DrawLocation.Add(BodyLibrary.GetOffSet(DrawFrame));
            }

            if (BodyLibrary != null && update)
            {
                FinalDrawLocation = DrawLocation.Add(BodyLibrary.GetOffSet(DrawFrame));
                DisplayRectangle  = new Rectangle(DrawLocation, BodyLibrary.GetTrueSize(DrawFrame));
            }

            for (int i = 0; i < Effects.Count; i++)
            {
                Effects[i].Process();
            }

            Color colour = DrawColour;

            switch (Poison)
            {
            case PoisonType.None:
                DrawColour = Color.White;
                break;

            case PoisonType.Green:
                DrawColour = Color.Green;
                break;

            case PoisonType.Red:
                DrawColour = Color.Red;
                break;

            case PoisonType.Bleeding:
                DrawColour = Color.DarkRed;
                break;

            case PoisonType.Slow:
                DrawColour = Color.Purple;
                break;

            case PoisonType.Stun:
                DrawColour = Color.Yellow;
                break;

            case PoisonType.Frozen:
                DrawColour = Color.Blue;
                break;

            case PoisonType.Paralysis:
                DrawColour = Color.Gray;
                break;
            }


            if (colour != DrawColour)
            {
                GameScene.Scene.MapControl.TextureValid = false;
            }


            if (CMain.Time > QuestTime)
            {
                QuestTime = CMain.Time + 500;
                if (++QuestIndex > 1)
                {
                    QuestIndex = 0;
                }
            }
        }