⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drawlayers.vb.svn-base

📁 MirUnleashed vb.net Module modMainServer Public WithEvents Socket As New WinsockServer Pub
💻 SVN-BASE
字号:
'### Visual Basic.NET and Direct X9 Legend of MiR Project ###'
'### Mir Unleashed Client Draw Game Layers Module ###'
'### http://www.lomcn.co.uk ###' '### Credits to TrueADM and DeathWish ###'

'Used so the players/actors/monsters/npcs/magics etc. are drawn above/below the objects and tiles if needed.

Imports Microsoft.DirectX
Imports Microsoft.DirectX.Direct3D

Module DrawLayers

    Public Sub DrawGameLayers()

        Dim MinimumVal2 As Integer
        Dim MaximumVal2 As Integer

        If Actor.CurrentY < 10 Then
            MinimumVal2 = Actor.CurrentY
        Else
            MinimumVal2 = 9
        End If

        If Actor.CurrentY > Map.Height - 31 Then
            MaximumVal2 = Map.Height - Actor.CurrentY
        Else
            MaximumVal2 = 30
        End If

        Dim BaseX As Single
        Dim BaseY As Single
        Dim TempInt As Integer
        Dim Y As Long

        BaseX = Actor.CurrentX
        BaseY = Actor.CurrentY

        For Y = Actor.CurrentY - MinimumVal2 To Actor.CurrentY + MaximumVal2

            GameSprite.Begin(SpriteFlags.DoNotSaveState)
            SetBlend(1)
            DrawObjects(Y, BaseX, BaseY)
            GameSprite.End()

            If Not Y > Actor.Y + 11 Then

                If Not TotalFloorItems = 0 Then
                    GameSprite.Begin(SpriteFlags.DoNotSaveState)
                    SetBlend(1)
                    DrawFloorItems(Y)
                    GameSprite.End()
                End If

                If Actor.Y = Y Then
                    DrawActor()
                End If

                Dim I As Integer

                For I = 0 To 1000
                    If Player(I).Exist = True And Player(I).Y = Y Then
                        DrawPlayer(I, BaseX, BaseY)
                        TempInt = TempInt + 1
                    End If
                    If TempInt = TotalPlayer Then Exit For
                Next I

                TempInt = 0

                GameSprite.Begin(SpriteFlags.DoNotSaveState)
                SetBlend(1)

                For I = 0 To 1000
                    If Mob(I).Exist = True And Mob(I).Y = Y Then
                        DrawMob(I)
                        TempInt = TempInt + 1
                    End If
                    If TempInt = TotalMob Then Exit For
                Next I

                GameSprite.End()

                TempInt = 0

                GameSprite.Begin(SpriteFlags.DoNotSaveState)
                SetBlend(1)

                For I = 0 To 1000
                    If NPC(I).Exist = True And NPC(I).Y = Y Then
                        DrawNPC(I)
                        TempInt = TempInt + 1
                    End If
                    If TempInt = TotalNPC Then Exit For
                Next I
                GameSprite.End()

                TempInt = 0

                GameSprite.Begin(SpriteFlags.AlphaBlend)

                For I = 0 To 1000
                    If Magic(I).Exist = True And Magic(I).Y = Y Then
                        DrawMagic(I)
                        TempInt = TempInt + 1
                    End If
                    If TempInt = TotalMagic Then Exit For
                Next I

                GameSprite.End()

            End If

        Next Y

        DrawActorFade()

    End Sub

End Module

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -