画怪物模块.bas
资源名称:vbmcrisrc.rar [点击查看]
上传用户:pcw2004
上传日期:2022-02-02
资源大小:743k
文件大小:6k
源码类别:
DirextX编程
开发平台:
Visual Basic
- Attribute VB_Name = "画怪物模块"
- Option Explicit
- Public Sub DrawMon(MonNum As Long, XX As Long, YY As Long, Optional mColor As Long = -1)
- On Error GoTo dErr
- Dim TexFileNum As Integer, mNum As Integer, TexNum As Long
- Dim MM As String
- Dim XX1 As Long, YY1 As Long
- XX1 = XX: YY1 = YY
- If Mon(MonNum).DBInfo.Appr_形象代码 >= 10 Then
- TexFileNum = Left(Str(Mon(MonNum).DBInfo.Appr_形象代码), Len(Str(Mon(MonNum).DBInfo.Appr_形象代码) - 1)) + 1
- Else
- TexFileNum = 1
- End If
- mNum = Right(Mon(MonNum).DBInfo.Appr_形象代码, 1)
- If TexFileNum > 24 Or TexFileNum = 18 Then Exit Sub
- If Mon(MonNum).Act = Move_怪移动 Then
- Select Case Mon(MonNum).Face
- Case FaceInfo.UpFace
- YY1 = YY1 + Mon(MonNum).YOFFECT
- Case FaceInfo.RightUpFace
- XX1 = XX1 - Mon(MonNum).XOFFECT
- YY1 = YY1 + Mon(MonNum).YOFFECT
- Case FaceInfo.RightFace
- XX1 = XX1 - Mon(MonNum).XOFFECT
- Case FaceInfo.RightDownFace
- XX1 = XX1 - Mon(MonNum).XOFFECT
- YY1 = YY1 - Mon(MonNum).YOFFECT
- Case FaceInfo.DownFace
- YY1 = YY1 - Mon(MonNum).YOFFECT
- Case FaceInfo.LeftDownFace
- XX1 = XX1 + Mon(MonNum).XOFFECT
- YY1 = YY1 - Mon(MonNum).YOFFECT
- Case FaceInfo.Leftface
- XX1 = XX1 + Mon(MonNum).XOFFECT
- Case FaceInfo.LeftUpFace
- XX1 = XX1 + Mon(MonNum).XOFFECT
- YY1 = YY1 + Mon(MonNum).YOFFECT
- End Select
- End If
- Select Case Mon(MonNum).DBInfo.RaceImage_种族图像
- Case 11, 14, 17, 18, 19, 20, 21, 22, 23, 31, 40, 41, 42, 45, 32, 52, 53 '近身物理,配合52(鹿);配合51(鸡)
- Select Case Mon(MonNum).Act
- Case MonActType.Stand_怪站立
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic
- Case MonActType.Move_怪移动
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic + 80
- Case MonActType.AttAck_怪攻击
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic + 160
- Case MonActType.Bruise_怪受伤
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic + 240
- Case MonActType.Dead_怪死亡
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic + 260
- End Select
- If Mon(MonNum).DBInfo.RaceImage_种族图像 = 42 Then
- TexNum = TexNum + mNum * 430
- Else
- If Mon(MonNum).DBInfo.Appr_形象代码 = 218 Then
- TexNum = TexNum + 2700
- Else
- TexNum = TexNum + mNum * 360
- End If
- End If
- Case 47 '物理攻击,配合101(祖玛卫士),从石像中释放自己
- Select Case Mon(MonNum).Act
- Case MonActType.Stone_怪石化
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic
- Case MonActType.Stand_怪站立
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic + 80
- Case MonActType.Move_怪移动
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic + 160
- Case MonActType.AttAck_怪攻击
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic + 240
- Case MonActType.Bruise_怪受伤
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic + 320
- Case MonActType.Dead_怪死亡
- TexNum = Mon(MonNum).Face * 10 + Mon(MonNum).Pic + 340
- End Select
- TexNum = TexNum + mNum * 440
- End Select
- If MonPic(TexFileNum).MonTex(TexNum).Tex Is Nothing Then
- CreateTexture MonPic(TexFileNum).MonTex(TexNum), ResPath & "DataMon" & TexFileNum & ".Wil"
- End If
- GetRect MonPic(TexFileNum).MonTex(TexNum).Wid, MonPic(TexFileNum).MonTex(TexNum).Hei, XX1, YY1, mRECT
- Draw MonPic(TexFileNum).MonTex(TexNum).Tex, XX1 + MonPic(TexFileNum).MonTex(TexNum).PosX, YY1 + MonPic(TexFileNum).MonTex(TexNum).PosY, mRECT, , , , mColor
- ' If MsgBox("dkfj", vbYesNo) = vbYes Then End
- mRECT.Left = XX1
- mRECT.Right = mRECT.Left + 48
- mRECT.Top = YY1 - 25
- mRECT.bottom = mRECT.Top + 30
- ' D3DX.DrawText D3DFont, D3DColorRGBA(255, 255, 255, 255), Mon(MonNum).ID, mRECT, DT_CENTER
- If Mon(MonNum).Act <> Dead_怪死亡 Then
- If Prguse3Tex(0).Tex Is Nothing Then
- CreateTexture Prguse3Tex(0), ResPath & "DataPrguse3.wil"
- End If
- mRECT.Left = 0
- mRECT.Right = Prguse3Tex(0).Wid
- mRECT.Top = 0
- mRECT.bottom = Prguse3Tex(0).Hei
- Draw Prguse3Tex(0).Tex, XX1 + 8, YY1 - 60, mRECT
- If Prguse3Tex(1).Tex Is Nothing Then
- CreateTexture Prguse3Tex(1), ResPath & "DataPrguse3.wil"
- End If
- mRECT.Left = 0
- If Mon(MonNum).MaxHP > 0 Then
- mRECT.Right = (Mon(MonNum).HP / Mon(MonNum).MaxHP) * Prguse3Tex(1).Wid
- Else
- mRECT.Right = Prguse3Tex(1).Wid
- End If
- mRECT.Top = 0
- mRECT.bottom = Prguse3Tex(1).Hei
- Draw Prguse3Tex(1).Tex, XX1 + 8, YY1 - 60, mRECT
- If Mon(MonNum).MaxHP > 0 Then
- mRECT.Left = XX1 - 10
- mRECT.Right = mRECT.Left + 68
- mRECT.Top = YY1 - 73
- mRECT.bottom = mRECT.Top + 20
- D3DX.DrawText D3DFont, D3DColorRGBA(255, 255, 255, 255), Mon(MonNum).HP & "/" & Mon(MonNum).MaxHP, mRECT, DT_CENTER
- End If
- If Mouse.MSelMonNum = MonNum Then
- mRECT.Left = XX1
- mRECT.Right = mRECT.Left + 48
- mRECT.Top = YY1 - 25
- mRECT.bottom = mRECT.Top + 30
- D3DX.DrawText D3DFont, D3DColorRGBA(255, 255, 255, 255), Mon(MonNum).DBInfo.Name_名称, mRECT, DT_CENTER
- End If
- End If
- dErr:
- End Sub