公共函数.bas
上传用户:pcw2004
上传日期:2022-02-02
资源大小:743k
文件大小:85k
源码类别:

DirextX编程

开发平台:

Visual Basic

  1. Attribute VB_Name = "公共函数"
  2. Option Explicit
  3. '///////  载入地图数据
  4. Public Sub LoadMap(mMap As String)
  5.     Dim i As Long, j As Long
  6.     
  7. End Sub
  8. '//////  怪Y排序
  9. Public Sub MonPaiXu()
  10.     Dim i As Long
  11.     Dim Work As Boolean
  12.     Dim PMon As MonInfo
  13.     Work = True
  14.     Do
  15.         Work = False
  16.         For i = 1 To MonCount - 1
  17.             If Mon(i).Y > Mon(i + 1).Y Then
  18.                 PMon = Mon(i)
  19.                 Mon(i) = Mon(i + 1)
  20.                 Mon(i + 1) = PMon
  21.                 Work = True
  22.             End If
  23.         Next
  24.         DoEvents
  25.     Loop While Work = True
  26.             
  27. End Sub
  28. Public Sub MouseSelMonNum()
  29.     Dim i As Long, mSel As Boolean
  30.     Mouse.MSelMonNum = 0
  31.     mSel = False
  32.     For i = 1 To MonCount
  33.         If Mon(i).X = Mouse.SelX And Mon(i).Y = Mouse.SelY + 1 Then
  34.             Mouse.MSelMonNum = i
  35.             mSel = True
  36.             Exit For
  37.         End If
  38.     Next
  39.     If mSel = False Then
  40.         For i = 1 To MonCount
  41.             If Mon(i).X = Mouse.SelX And Mon(i).Y = Mouse.SelY Then
  42.                 Mouse.MSelMonNum = i
  43.                 mSel = True
  44.                 Exit For
  45.             End If
  46.         Next
  47.     End If
  48.     
  49.     
  50. End Sub
  51. '/////  魔法锁定函数
  52. Public Sub GetMagicLock()
  53.     Dim i As Integer
  54.     MouseSelMonNum
  55.     If Mouse.MSelMonNum > 0 Then
  56.         If UBound(Mon) >= Mouse.MSelMonNum Then
  57.             If Mouse.SelX = Mon(Mouse.MSelMonNum).X And Mouse.SelY = Mon(Mouse.MSelMonNum).Y Then
  58.                 Hero.MagicLock = True
  59.                 Hero.MagicLockType = 0
  60.                 Hero.MagicLockNum = Mouse.MSelMonNum
  61.             End If
  62.         End If
  63.     End If
  64.     
  65.     If Hero.MagicLock = True Then
  66.         If Hero.MagicLockType = 0 Then
  67.             If UBound(Mon) < Hero.MagicLockNum Then GoTo aErr
  68.             Hero.MagicX = Mon(Hero.MagicLockNum).X
  69.             Hero.MagicY = Mon(Hero.MagicLockNum).Y
  70.         ElseIf Hero.MagicLockType = 1 Then
  71.             Hero.MagicX = Player(Hero.MagicLockNum).X
  72.             Hero.MagicY = Player(Hero.MagicLockNum).Y
  73.         End If
  74.     Else
  75. aErr:
  76.         Hero.MagicX = Mouse.SelX
  77.         Hero.MagicY = Mouse.SelY
  78.         
  79.     End If
  80. End Sub
  81. '/////////  鼠标选取怪物编号
  82. '/////////  得到物品
  83. Public Sub GetItems(mItem As ItemType, mCount As Integer)
  84.     Dim i As Integer
  85.     For i = 0 To 39
  86.         If Bag(i).State = False Then
  87.             Bag(i).State = True
  88.             Bag(i).Item = mItem
  89.             mCount = mCount - 1
  90.             If mCount <= 0 Then Exit For
  91.         End If
  92.     Next
  93. End Sub
  94. '//////////将一条长的信息自动换行
  95. Public Function InfoHuangHang(mStr As String) As PlayerTalkType
  96.     Dim i As Integer, MM() As String
  97.     ReDim MM(Len(mStr)  10)
  98.     For i = 0 To UBound(MM)
  99.         If i < UBound(MM) Then
  100.             MM(i) = Mid(mStr, i * 10 + 1 + 0, 10)
  101.         ElseIf i = UBound(MM) Then
  102.             MM(i) = Mid(mStr, i * 10 + 1, Len(mStr) - i * 10)
  103.         End If
  104.     Next
  105.     
  106.     For i = 0 To UBound(MM)
  107.         InfoHuangHang.LiaoTianStr = InfoHuangHang.LiaoTianStr & MM(i) & vbCrLf
  108.         
  109.     Next
  110.     InfoHuangHang.StrHei = UBound(MM)
  111.             
  112. End Function
  113. '//////////  增加一条聊天记录
  114. Public Sub AddTalkStr(mStr As String, mColor As Long, Optional PlayerName As String = "")
  115.     TalkCount = TalkCount + 1
  116.     ReDim Preserve TalkStr(TalkCount)
  117.     TalkStr(TalkCount).mStr = mStr
  118.     TalkStr(TalkCount).mColor = mColor
  119.     TalkStr(TalkCount).PlayerName = PlayerName
  120.     If TalkStrStart + 7 < TalkCount Then TalkStrStart = TalkStrStart + 1
  121. End Sub
  122. Public Sub GetHeroInfo()
  123.     Dim i As Integer
  124.     Player(MainHeroNum).AC1 = 0
  125.     Player(MainHeroNum).AC2 = Player(MainHeroNum).AC_自身物防
  126.     Player(MainHeroNum).MAC2 = 0
  127.     Player(MainHeroNum).MAC2 = Player(MainHeroNum).MAC_自身魔防
  128.     Player(MainHeroNum).DC1 = 0
  129.     Player(MainHeroNum).DC2 = Player(MainHeroNum).DC_自身攻击
  130.     Player(MainHeroNum).MC1 = 0
  131.     Player(MainHeroNum).MC2 = Player(MainHeroNum).MC_自身魔法
  132.     Player(MainHeroNum).SC1 = 0
  133.     Player(MainHeroNum).SC2 = Player(MainHeroNum).SC_自身道术
  134.     
  135.     
  136.     If Player(MainHeroNum).Weapon.State = True Then
  137.         Player(MainHeroNum).DC1 = Player(MainHeroNum).DC1 + Player(MainHeroNum).Weapon.Item.Dc
  138.         Player(MainHeroNum).DC2 = Player(MainHeroNum).DC2 + Player(MainHeroNum).Weapon.Item.DC2
  139.         Player(MainHeroNum).MC1 = Player(MainHeroNum).MC1 + Player(MainHeroNum).Weapon.Item.MC
  140.         Player(MainHeroNum).MC2 = Player(MainHeroNum).MC2 + Player(MainHeroNum).Weapon.Item.MC2
  141.         Player(MainHeroNum).SC1 = Player(MainHeroNum).SC1 + Player(MainHeroNum).Weapon.Item.sc
  142.         Player(MainHeroNum).SC2 = Player(MainHeroNum).SC2 + Player(MainHeroNum).Weapon.Item.SC2
  143.     End If
  144.     
  145.     If Player(MainHeroNum).Clothing.State = True Then
  146.         Player(MainHeroNum).AC1 = Player(MainHeroNum).AC1 + Player(MainHeroNum).Clothing.Item.AC
  147.         Player(MainHeroNum).AC2 = Player(MainHeroNum).AC2 + Player(MainHeroNum).Clothing.Item.AC2
  148.         Player(MainHeroNum).MAC1 = Player(MainHeroNum).MAC1 + Player(MainHeroNum).Clothing.Item.MAC
  149.         Player(MainHeroNum).MAC2 = Player(MainHeroNum).MAC2 + Player(MainHeroNum).Clothing.Item.MAC2
  150.         Player(MainHeroNum).DC1 = Player(MainHeroNum).DC1 + Player(MainHeroNum).Clothing.Item.Dc
  151.         Player(MainHeroNum).DC2 = Player(MainHeroNum).DC2 + Player(MainHeroNum).Clothing.Item.DC2
  152.         Player(MainHeroNum).MC1 = Player(MainHeroNum).MC1 + Player(MainHeroNum).Clothing.Item.MC
  153.         Player(MainHeroNum).MC2 = Player(MainHeroNum).MC2 + Player(MainHeroNum).Clothing.Item.MC2
  154.         Player(MainHeroNum).SC1 = Player(MainHeroNum).SC1 + Player(MainHeroNum).Clothing.Item.sc
  155.         Player(MainHeroNum).SC2 = Player(MainHeroNum).SC2 + Player(MainHeroNum).Clothing.Item.SC2
  156.     End If
  157.     
  158.     If Player(MainHeroNum).HeadPiece.State = True Then
  159.         Player(MainHeroNum).AC1 = Player(MainHeroNum).AC1 + Player(MainHeroNum).HeadPiece.Item.AC
  160.         Player(MainHeroNum).AC2 = Player(MainHeroNum).AC2 + Player(MainHeroNum).HeadPiece.Item.AC2
  161.         Player(MainHeroNum).MAC1 = Player(MainHeroNum).MAC1 + Player(MainHeroNum).HeadPiece.Item.MAC
  162.         Player(MainHeroNum).MAC2 = Player(MainHeroNum).MAC2 + Player(MainHeroNum).HeadPiece.Item.MAC2
  163.         Player(MainHeroNum).DC1 = Player(MainHeroNum).DC1 + Player(MainHeroNum).HeadPiece.Item.Dc
  164.         Player(MainHeroNum).DC2 = Player(MainHeroNum).DC2 + Player(MainHeroNum).HeadPiece.Item.DC2
  165.         Player(MainHeroNum).MC1 = Player(MainHeroNum).MC1 + Player(MainHeroNum).HeadPiece.Item.MC
  166.         Player(MainHeroNum).MC2 = Player(MainHeroNum).MC2 + Player(MainHeroNum).HeadPiece.Item.MC2
  167.         Player(MainHeroNum).SC1 = Player(MainHeroNum).SC1 + Player(MainHeroNum).HeadPiece.Item.sc
  168.         Player(MainHeroNum).SC2 = Player(MainHeroNum).SC2 + Player(MainHeroNum).HeadPiece.Item.SC2
  169.     End If
  170.     
  171.     If Player(MainHeroNum).Necklace.State = True Then
  172.         Player(MainHeroNum).DC1 = Player(MainHeroNum).DC1 + Player(MainHeroNum).Necklace.Item.Dc
  173.         Player(MainHeroNum).DC2 = Player(MainHeroNum).DC2 + Player(MainHeroNum).Necklace.Item.DC2
  174.         Player(MainHeroNum).MC1 = Player(MainHeroNum).MC1 + Player(MainHeroNum).Necklace.Item.MC
  175.         Player(MainHeroNum).MC2 = Player(MainHeroNum).MC2 + Player(MainHeroNum).Necklace.Item.MC2
  176.         Player(MainHeroNum).SC1 = Player(MainHeroNum).SC1 + Player(MainHeroNum).Necklace.Item.sc
  177.         Player(MainHeroNum).SC2 = Player(MainHeroNum).SC2 + Player(MainHeroNum).Necklace.Item.SC2
  178.     End If
  179.     
  180.     If Player(MainHeroNum).BraceletLeft.State = True Then
  181.         Player(MainHeroNum).AC1 = Player(MainHeroNum).AC1 + Player(MainHeroNum).BraceletLeft.Item.AC
  182.         Player(MainHeroNum).AC2 = Player(MainHeroNum).AC2 + Player(MainHeroNum).BraceletLeft.Item.AC2
  183.         Player(MainHeroNum).MAC1 = Player(MainHeroNum).MAC1 + Player(MainHeroNum).BraceletLeft.Item.MAC
  184.         Player(MainHeroNum).MAC2 = Player(MainHeroNum).MAC2 + Player(MainHeroNum).BraceletLeft.Item.MAC2
  185.         Player(MainHeroNum).DC1 = Player(MainHeroNum).DC1 + Player(MainHeroNum).BraceletLeft.Item.Dc
  186.         Player(MainHeroNum).DC2 = Player(MainHeroNum).DC2 + Player(MainHeroNum).BraceletLeft.Item.DC2
  187.         Player(MainHeroNum).MC1 = Player(MainHeroNum).MC1 + Player(MainHeroNum).BraceletLeft.Item.MC
  188.         Player(MainHeroNum).MC2 = Player(MainHeroNum).MC2 + Player(MainHeroNum).BraceletLeft.Item.MC2
  189.         Player(MainHeroNum).SC1 = Player(MainHeroNum).SC1 + Player(MainHeroNum).BraceletLeft.Item.sc
  190.         Player(MainHeroNum).SC2 = Player(MainHeroNum).SC2 + Player(MainHeroNum).BraceletLeft.Item.SC2
  191.     End If
  192.     
  193.     If Player(MainHeroNum).BraceletRight.State = True Then
  194.         Player(MainHeroNum).AC1 = Player(MainHeroNum).AC1 + Player(MainHeroNum).BraceletRight.Item.AC
  195.         Player(MainHeroNum).AC2 = Player(MainHeroNum).AC2 + Player(MainHeroNum).BraceletRight.Item.AC2
  196.         Player(MainHeroNum).MAC1 = Player(MainHeroNum).MAC1 + Player(MainHeroNum).BraceletRight.Item.MAC
  197.         Player(MainHeroNum).MAC2 = Player(MainHeroNum).MAC2 + Player(MainHeroNum).BraceletRight.Item.MAC2
  198.         Player(MainHeroNum).DC1 = Player(MainHeroNum).DC1 + Player(MainHeroNum).BraceletRight.Item.Dc
  199.         Player(MainHeroNum).DC2 = Player(MainHeroNum).DC2 + Player(MainHeroNum).BraceletRight.Item.DC2
  200.         Player(MainHeroNum).MC1 = Player(MainHeroNum).MC1 + Player(MainHeroNum).BraceletRight.Item.MC
  201.         Player(MainHeroNum).MC2 = Player(MainHeroNum).MC2 + Player(MainHeroNum).BraceletRight.Item.MC2
  202.         Player(MainHeroNum).SC1 = Player(MainHeroNum).SC1 + Player(MainHeroNum).BraceletRight.Item.sc
  203.         Player(MainHeroNum).SC2 = Player(MainHeroNum).SC2 + Player(MainHeroNum).BraceletRight.Item.SC2
  204.     End If
  205.     
  206.     If Player(MainHeroNum).FingerringLeft.State = True Then
  207.         Player(MainHeroNum).DC1 = Player(MainHeroNum).DC1 + Player(MainHeroNum).FingerringLeft.Item.Dc
  208.         Player(MainHeroNum).DC2 = Player(MainHeroNum).DC2 + Player(MainHeroNum).FingerringLeft.Item.DC2
  209.         Player(MainHeroNum).MC1 = Player(MainHeroNum).MC1 + Player(MainHeroNum).FingerringLeft.Item.MC
  210.         Player(MainHeroNum).MC2 = Player(MainHeroNum).MC2 + Player(MainHeroNum).FingerringLeft.Item.MC2
  211.         Player(MainHeroNum).SC1 = Player(MainHeroNum).SC1 + Player(MainHeroNum).FingerringLeft.Item.sc
  212.         Player(MainHeroNum).SC2 = Player(MainHeroNum).SC2 + Player(MainHeroNum).FingerringLeft.Item.SC2
  213.     End If
  214.     
  215.     If Player(MainHeroNum).FingerringRight.State = True Then
  216.         Player(MainHeroNum).DC1 = Player(MainHeroNum).DC1 + Player(MainHeroNum).FingerringRight.Item.Dc
  217.         Player(MainHeroNum).DC2 = Player(MainHeroNum).DC2 + Player(MainHeroNum).FingerringRight.Item.DC2
  218.         Player(MainHeroNum).MC1 = Player(MainHeroNum).MC1 + Player(MainHeroNum).FingerringRight.Item.MC
  219.         Player(MainHeroNum).MC2 = Player(MainHeroNum).MC2 + Player(MainHeroNum).FingerringRight.Item.MC2
  220.         Player(MainHeroNum).SC1 = Player(MainHeroNum).SC1 + Player(MainHeroNum).FingerringRight.Item.sc
  221.         Player(MainHeroNum).SC2 = Player(MainHeroNum).SC2 + Player(MainHeroNum).FingerringRight.Item.SC2
  222.     End If
  223. End Sub
  224. Public Sub MonTexAct()
  225.     Dim i As Integer
  226.     If MonCount = 0 Then Exit Sub
  227.     For i = 1 To MonCount
  228.         If Mon(i).Act = Stone_怪石化 Then
  229.             If Mon(i).Pic > 0 Then
  230.                 Mon(i).PicSpeed = Mon(i).PicSpeed + 1
  231.                 If Mon(i).PicSpeed > 5 Then
  232.                     Mon(i).PicSpeed = 0
  233.                     Mon(i).Pic = Mon(i).Pic + 1
  234.                 End If
  235.             End If
  236.         Else
  237.             Mon(i).PicSpeed = Mon(i).PicSpeed + 1
  238.             If Mon(i).PicSpeed > 3 Then
  239.                 Mon(i).PicSpeed = 0
  240.                 Mon(i).Pic = Mon(i).Pic + 1
  241.             End If
  242.         End If
  243.         Select Case Mon(i).Act
  244.             Case MonActType.Stone_怪石化
  245.                 If Mon(i).Pic > 5 Then
  246.                     Mon(i).PicSpeed = 0
  247.                     Mon(i).Pic = 0
  248.                     Mon(i).Act = Stand_怪站立
  249.                 End If
  250.             Case MonActType.Stand_怪站立
  251.                 If Mon(i).Pic > 3 Then
  252.                     Mon(i).PicSpeed = 0
  253.                     Mon(i).Pic = 0
  254.                     Mon(i).Act = Stand_怪站立
  255.                 End If
  256.             Case MonActType.Move_怪移动
  257.                 Mon(i).XOFFECT = (5 - Mon(i).Pic) * (48 / 6)
  258.                 Mon(i).YOFFECT = (5 - Mon(i).Pic) * (32 / 6)
  259.                 If Mon(i).Pic > 5 Then
  260.                     Mon(i).Pic = 0
  261.                     Mon(i).Act = Stand_怪站立
  262.                     Mon(i).PicSpeed = 0
  263.                 End If
  264.             Case MonActType.Bruise_怪受伤
  265.                 If Mon(i).Pic > 2 Then
  266.                     Mon(i).Pic = 0
  267.                     Mon(i).Act = Stand_怪站立
  268.                     Mon(i).PicSpeed = 0
  269.                 End If
  270.             Case MonActType.AttAck_怪攻击
  271.                 If Mon(i).Pic > 5 Then
  272.                     Mon(i).Pic = 0
  273.                     Mon(i).PicSpeed = 0
  274.                     Mon(i).Act = Stand_怪站立
  275.                 End If
  276.             Case MonActType.Dead_怪死亡
  277.                 If Mon(i).DBInfo.Appr_形象代码 = 218 Then
  278.                     If Mon(i).Pic > 19 Then
  279.                         Mon(i).Pic = 19
  280.                     End If
  281.                 Else
  282.                     If Mon(i).Pic > 9 Then
  283.                         Mon(i).Pic = 9
  284.                     End If
  285.                 End If
  286.         End Select
  287.     Next
  288.             
  289. End Sub
  290. '/////////////  交易情况 ///////////////////////////
  291. Public Sub JiaoYiOKCancel(JiaoYi成败 As Boolean)
  292.     Dim i As Integer, j As Integer
  293.     Select Case JiaoYi成败
  294.         Case Is = True
  295.             For i = 0 To 9
  296.                 If JiaoYi.BeiJiaoYiItems(i).State = True Then
  297.                     For j = 0 To 39
  298.                         If Bag(j).State = False Then
  299.                             Bag(j).State = True
  300.                             Bag(j).Item = JiaoYi.BeiJiaoYiItems(i).Item
  301.                             JiaoYi.BeiJiaoYiItems(i).State = False
  302.                             Exit For
  303.                         End If
  304.                     Next
  305.                 End If
  306.             Next
  307.         Case Is = False
  308.             For i = 0 To 9
  309.                 If JiaoYi.JiaoYiItems(i).State = True Then
  310.                     For j = 0 To 39
  311.                         If Bag(j).State = False Then
  312.                             Bag(j).State = True
  313.                             Bag(j).Item = JiaoYi.JiaoYiItems(i).Item
  314.                             JiaoYi.JiaoYiItems(i).State = False
  315.                             Exit For
  316.                         End If
  317.                     Next
  318.                 End If
  319.             Next
  320.     End Select
  321.     JiaoYi.State = False
  322.     For i = 0 To 9
  323.         JiaoYi.BeiJiaoYiItems(i).State = False
  324.         JiaoYi.JiaoYiItems(i).State = False
  325.     Next
  326.     JiaoYi.JiaoYiOK = False
  327. End Sub
  328. '////////////////   检测地图上的玩家编号  ///////////////
  329. Public Function GetMapXYPlayerNum(PlayerX As Long, PlayerY As Long, PlayerFace As FaceInfo, mSpace As Integer) As Integer
  330.     Dim i As Integer
  331.     Select Case PlayerFace
  332.         Case FaceInfo.UpFace
  333.             For i = 1 To PlayerCount
  334.                 If Player(i).X = PlayerX And Player(i).Y = PlayerY - mSpace Then
  335.                     If Player(i).Conneted = True And Player(i).Act <> Dead_死亡 Then
  336.                         GetMapXYPlayerNum = i
  337.                         Exit For
  338.                     End If
  339.                 End If
  340.             Next
  341.         Case FaceInfo.RightUpFace
  342.             For i = 1 To PlayerCount
  343.                 If Player(i).X = PlayerX + mSpace And Player(i).Y = PlayerY - mSpace Then
  344.                     If Player(i).Conneted = True And Player(i).Act <> Dead_死亡 Then
  345.                         GetMapXYPlayerNum = i
  346.                         Exit For
  347.                     End If
  348.                 End If
  349.             Next
  350.         Case FaceInfo.RightFace
  351.             For i = 1 To PlayerCount
  352.                 If Player(i).X = PlayerX + mSpace And Player(i).Y = PlayerY Then
  353.                     If Player(i).Conneted = True And Player(i).Act <> Dead_死亡 Then
  354.                         GetMapXYPlayerNum = i
  355.                         Exit For
  356.                     End If
  357.                 End If
  358.             Next
  359.         Case FaceInfo.RightDownFace
  360.             For i = 1 To PlayerCount
  361.                 If Player(i).X = PlayerX + mSpace And Player(i).Y = PlayerY + mSpace Then
  362.                     If Player(i).Conneted = True And Player(i).Act <> Dead_死亡 Then
  363.                         GetMapXYPlayerNum = i
  364.                         Exit For
  365.                     End If
  366.                 End If
  367.             Next
  368.         Case FaceInfo.DownFace
  369.             For i = 1 To PlayerCount
  370.                 If Player(i).X = PlayerX And Player(i).Y = PlayerY + mSpace Then
  371.                     If Player(i).Conneted = True And Player(i).Act <> Dead_死亡 Then
  372.                         GetMapXYPlayerNum = i
  373.                         Exit For
  374.                     End If
  375.                 End If
  376.             Next
  377.         Case FaceInfo.LeftDownFace
  378.             For i = 1 To PlayerCount
  379.                 If Player(i).X = PlayerX - mSpace And Player(i).Y = PlayerY + mSpace Then
  380.                     If Player(i).Conneted = True And Player(i).Act <> Dead_死亡 Then
  381.                         GetMapXYPlayerNum = i
  382.                         Exit For
  383.                     End If
  384.                 End If
  385.             Next
  386.         Case FaceInfo.Leftface
  387.             For i = 1 To PlayerCount
  388.                 If Player(i).X = PlayerX - mSpace And Player(i).Y = PlayerY Then
  389.                     If Player(i).Conneted = True And Player(i).Act <> Dead_死亡 Then
  390.                         GetMapXYPlayerNum = i
  391.                         Exit For
  392.                     End If
  393.                 End If
  394.             Next
  395.         Case FaceInfo.LeftUpFace
  396.             For i = 1 To PlayerCount
  397.                 If Player(i).X = PlayerX - mSpace And Player(i).Y = PlayerY - mSpace Then
  398.                     If Player(i).Conneted = True And Player(i).Act <> Dead_死亡 Then
  399.                         GetMapXYPlayerNum = i
  400.                         Exit For
  401.                     End If
  402.                 End If
  403.             Next
  404.     End Select
  405. End Function
  406. '///////////  鼠标选择 窗口
  407. Public Sub MouseSelFrm()
  408.     Dim i As Integer
  409.     If Mouse.Button1Down = False And Mouse.button2Down = False Then
  410.         Mouse.SelFrm = MainFrom
  411.         If Mouse.X < 190 And Mouse.Y > 385 Then
  412.             Mouse.SelFrm = InfoFrom
  413.         ElseIf Mouse.X >= 190 And Mouse.X < 630 And Mouse.Y > 400 Then
  414.             Mouse.SelFrm = InfoFrom
  415.         ElseIf Mouse.X >= 630 And Mouse.Y > 348 Then
  416.             Mouse.SelFrm = InfoFrom
  417.         End If
  418.         
  419.         If JiaoYi.State = True Then
  420.             If Mouse.X > 350 And Mouse.X < 570 And _
  421.                Mouse.Y > 20 And Mouse.Y < 195 Or _
  422.                Mouse.X > 350 And Mouse.X < 586 And _
  423.                Mouse.Y > 180 And Mouse.Y < 327 Then
  424.                Mouse.SelFrm = JiaoYiFrom
  425.             End If
  426.         End If
  427.         
  428.         If NpcFrm.State = True Then
  429.             If Mouse.X > 0 And Mouse.X < PrguseTex(384).Wid And _
  430.                Mouse.Y > 0 And Mouse.Y < PrguseTex(384).Hei Then
  431.                 Mouse.SelFrm = NpcFrom
  432.             End If
  433.         End If
  434.         
  435.         
  436.         If BagFrm.State = True Then
  437.             If Mouse.X > BagFrm.X And Mouse.X < BagFrm.X + PrguseTex(3).Wid And _
  438.                Mouse.Y > BagFrm.Y And Mouse.Y < BagFrm.Y + PrguseTex(3).Hei Then
  439.                 Mouse.SelFrm = BagFrom
  440.             End If
  441.         End If
  442.         
  443.         If HeroInfoFrm.State = True Then
  444.             If Mouse.X > HeroInfoFrm.X And Mouse.X < HeroInfoFrm.X + Prguse3Tex(207).Wid And _
  445.                Mouse.Y > HeroInfoFrm.Y And Mouse.Y < HeroInfoFrm.Y + Prguse3Tex(207).Hei Then
  446.                 Mouse.SelFrm = HeroInfoFrom
  447.             End If
  448.         End If
  449.         
  450.         If ErrorFrm.State = True Then
  451.             If Mouse.X > ErrorFrm.X And Mouse.X < ErrorFrm.X + PrguseTex(360).Wid And _
  452.                Mouse.Y > ErrorFrm.Y And Mouse.Y < ErrorFrm.Y + PrguseTex(360).Hei Then
  453.                 Mouse.SelFrm = ErrorFrom
  454.             End If
  455.         End If
  456.     End If
  457.     
  458. End Sub
  459. Public Function CheckKey(KeyCode As Long) As Boolean
  460.     Dim Key As Long
  461.     Key = GetKeyState(KeyCode)
  462.     If Key And KEY_DOWN Then
  463.         CheckKey = True
  464.     Else
  465.         CheckKey = False
  466.     End If
  467. End Function
  468. '///////////    魔法排序
  469. Public Sub MagicPaiXu()
  470.     Dim mMagic As MagicActType
  471.     Dim i As Integer, j As Integer
  472.     Dim Work As Boolean
  473.     Work = True
  474.     Do While Work
  475.         Work = False
  476.         For i = 1 To MagicCount
  477.             If i < MagicCount Then
  478.                 If Magic(i).Y > Magic(i + 1).Y Then
  479.                     mMagic = Magic(i)
  480.                     Magic(i) = Magic(i + 1)
  481.                     Magic(i + 1) = mMagic
  482.                     Work = True
  483.                 End If
  484.             End If
  485.         Next
  486.         DoEvents
  487.     Loop
  488. End Sub
  489. '//////////////////////  施放魔法效果贴图属性
  490. Public Sub UserPlayerMagic(PlayerNum As Integer, PlayerName As String, MagicName As String, X As Long, Y As Long)
  491.     Dim i As Integer
  492.     Select Case MagicName
  493.         Case "火球术"      '自愈术
  494.             Player(PlayerNum).PlayerMagicCount = Player(PlayerNum).PlayerMagicCount + 1
  495.             ReDim Preserve Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount)
  496.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).MagicName = MagicName
  497.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PlayerNum = PlayerNum
  498.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PlayerName = PlayerName
  499.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).StartPic = 0
  500.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Pic = 0
  501.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PicSpeed = 0
  502.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).MaxPicNum = 9
  503.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).X = X
  504.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Y = Y
  505.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PicSuDu = 2
  506.             For i = 1 To MagicDBCount
  507.                 If MagicDB(i).MagName_名称 = MagicName Then
  508.                     Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Effect = MagicDB(i).Effect_魔法效果
  509.                     Exit For
  510.                 End If
  511.             Next
  512.         Case "治愈术"      '自愈术
  513.             Player(PlayerNum).PlayerMagicCount = Player(PlayerNum).PlayerMagicCount + 1
  514.             ReDim Preserve Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount)
  515.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).MagicName = MagicName
  516.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PlayerNum = PlayerNum
  517.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PlayerName = PlayerName
  518.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).StartPic = 200
  519.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Pic = 0
  520.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PicSpeed = 0
  521.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).MaxPicNum = 9
  522.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).X = X
  523.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Y = Y
  524.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PicSuDu = 2
  525.             For i = 1 To MagicDBCount
  526.                 If MagicDB(i).MagName_名称 = MagicName Then
  527.                     Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Effect = MagicDB(i).Effect_魔法效果
  528.                     Exit For
  529.                 End If
  530.             Next
  531.             
  532.         Case "冰咆哮"      '冰咆哮
  533.             Player(PlayerNum).PlayerMagicCount = Player(PlayerNum).PlayerMagicCount + 1
  534.             ReDim Preserve Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount)
  535.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).MagicName = MagicName
  536.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PlayerNum = PlayerNum
  537.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PlayerName = PlayerName
  538.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).StartPic = 3840
  539.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Pic = 0
  540.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PicSpeed = 0
  541.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).MaxPicNum = 9
  542.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).X = X
  543.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Y = Y
  544.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PicSuDu = 2
  545.             For i = 1 To MagicDBCount
  546.                 If MagicDB(i).MagName_名称 = MagicName Then
  547.                     Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Effect = MagicDB(i).Effect_魔法效果
  548.                     Exit For
  549.                 End If
  550.             Next
  551.         Case "魔法盾"
  552.             Player(PlayerNum).PlayerMagicCount = Player(PlayerNum).PlayerMagicCount + 1
  553.             ReDim Preserve Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount)
  554.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).MagicName = MagicName
  555.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PlayerNum = PlayerNum
  556.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PlayerName = PlayerName
  557.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).StartPic = 3880
  558.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Pic = 0
  559.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PicSpeed = 0
  560.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).MaxPicNum = 9
  561.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).X = Player(PlayerNum).X
  562.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Y = Player(PlayerNum).Y
  563.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PicSuDu = 2
  564.             For i = 1 To MagicDBCount
  565.                 If MagicDB(i).MagName_名称 = MagicName Then
  566.                     Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Effect = MagicDB(i).Effect_魔法效果
  567.                     
  568.                     Exit For
  569.                     
  570.                 End If
  571.             Next
  572.             Set LoginGameMusic = DS.CreateSoundBufferFromFile(ResPath & "WavM31-1.wav", DSBDESC)
  573.             LoginGameMusic.SetVolume mVolume
  574.             LoginGameMusic.Play DSBPLAY_DEFAULT
  575.         Case "雷电术"
  576.             Player(PlayerNum).PlayerMagicCount = Player(PlayerNum).PlayerMagicCount + 1
  577.             ReDim Preserve Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount)
  578.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).MagicName = MagicName
  579.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PlayerNum = PlayerNum
  580.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PlayerName = PlayerName
  581.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).StartPic = 20
  582.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Pic = 0
  583.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PicSpeed = 0
  584.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).MaxPicNum = 5
  585.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).X = X
  586.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Y = Y
  587.             Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).PicSuDu = 3
  588.             For i = 1 To MagicDBCount
  589.                 If MagicDB(i).MagName_名称 = MagicName Then
  590.                     Player(PlayerNum).PlayerMagic(Player(PlayerNum).PlayerMagicCount).Effect = MagicDB(i).Effect_魔法效果
  591.                     
  592.                     Exit For
  593.                     
  594.                 End If
  595.             Next
  596.         Case "剑法"
  597.             MagicCount = MagicCount + 1
  598.             ReDim Preserve Magic(MagicCount)
  599.             Magic(MagicCount).MagicName = "剑法"
  600.             Magic(MagicCount).MaxPicNum = 16
  601.             Magic(MagicCount).StartPic = 10
  602.             Magic(MagicCount).Pic = 0
  603.             Magic(MagicCount).PicSpeed = 0
  604.             Magic(MagicCount).PicSuDu = 2
  605.             Magic(MagicCount).Effect = 90
  606.             Magic(MagicCount).Face = Player(PlayerNum).Face
  607.             Magic(MagicCount).X = Player(PlayerNum).X
  608.             Magic(MagicCount).Y = Player(PlayerNum).Y
  609.             Magic(MagicCount).PlayerName = PlayerName
  610.             Magic(MagicCount).PlayerNum = PlayerNum
  611.     End Select
  612. End Sub
  613. '///////////    地面魔法贴图动作
  614. Public Sub MapMagicTexAct()
  615.     Dim i As Integer, j As Integer, l As Integer, N As Integer
  616.     Dim k As Integer, M As Integer, GongVal As Long
  617.     Dim MM  As Integer
  618.     If MagicCount <= 0 Then Exit Sub
  619.     For i = 1 To MagicCount
  620.         If i > MagicCount Then Exit For
  621.         Magic(i).PicSpeed = Magic(i).PicSpeed + 1
  622.         If Magic(i).PicSpeed > Magic(i).PicSuDu Then
  623.             Magic(i).PicSpeed = 0
  624.             Magic(i).Pic = Magic(i).Pic + 1
  625.                 
  626.             If Magic(i).PlayerNum = MainHeroNum And Magic(i).PlayerName = Player(MainHeroNum).Name_名字 Then
  627.                 Select Case Magic(i).MagicName
  628.                     Case "冰咆哮"
  629.                         If Magic(i).Pic = 3 And Magic(i).PicSpeed = 0 Then
  630.                             GongVal = Rnd * Abs(Player(MainHeroNum).MC1 - Player(MainHeroNum).MC2) + IIf(Player(MainHeroNum).MC1 < Player(MainHeroNum).MC2, Player(MainHeroNum).MC1, Player(MainHeroNum).MC2) + MagicDB(GetMagicDBNum(Magic(i).MagicName)).Power_基本威力
  631.                             For k = -2 To 2
  632.                                 For M = -2 To 2
  633.                                     If Hero.攻击模式 <> 和平攻击模式 Then
  634.                                         For j = 1 To PlayerCount
  635.                                             '///////////////  伤害玩家
  636.                                             If Player(j).X = Magic(i).X + k And Player(j).Y = Magic(i).Y + M Then
  637.                                                 FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & j & KONGDATA & GongVal & KONGDATA & 1 & NETKONGDATA
  638.                                             End If
  639.                                         Next
  640.                                     End If
  641.                                     For j = 1 To MonCount
  642.                                         If Mon(j).X = Magic(i).X + k And Mon(j).Y = Magic(i).Y + M Then
  643.                                             FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(j).ID & KONGDATA & GongVal & KONGDATA & 1 & NETKONGDATA
  644.                                         End If
  645.                                     Next
  646.                                 Next
  647.                             Next
  648.                         End If
  649.                     Case "雷电术"
  650.                         If Magic(i).Pic = 2 And Magic(i).PicSpeed = 0 Then
  651.                             GongVal = Rnd * Abs(Player(MainHeroNum).MC1 - Player(MainHeroNum).MC2) + IIf(Player(MainHeroNum).MC1 < Player(MainHeroNum).MC2, Player(MainHeroNum).MC1, Player(MainHeroNum).MC2) + MagicDB(GetMagicDBNum(Magic(i).MagicName)).Power_基本威力
  652.                             If Map.Map3(Magic(i).X, Magic(i).Y) > 0 Then
  653.                                 '///////////////  伤害玩家
  654.                                 If Map.Map3(Magic(i).X, Magic(i).Y) <> MainHeroNum Then
  655.                                     FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & Map.Map3(Magic(i).X, Magic(i).Y) & KONGDATA & GongVal & KONGDATA & 1 & NETKONGDATA
  656.                                 End If
  657.                             End If
  658.                             
  659.                             For k = 1 To MonCount
  660.                                 If Mon(k).X = Magic(i).X And Mon(k).Y = Magic(i).Y Then
  661.                                     FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 1 & NETKONGDATA
  662.                                 End If
  663.                             Next
  664.                         End If
  665.                     Case Is = "剑法"
  666.                         If Magic(i).Pic > 3 And Magic(i).Pic < 9 And Magic(i).PicSpeed = 0 Then
  667.                             GongVal = Rnd * Abs(Player(MainHeroNum).DC1 - Player(MainHeroNum).DC2) + IIf(Player(MainHeroNum).DC1 < Player(MainHeroNum).DC2, Player(MainHeroNum).DC1, Player(MainHeroNum).DC2) + MagicDB(GetMagicDBNum(Magic(i).MagicName)).Power_基本威力
  668.                             Select Case Magic(i).Face
  669.                                 Case FaceInfo.UpFace
  670.                                     If Hero.攻击模式 <> 和平攻击模式 Then
  671.                                         For k = 1 To PlayerCount
  672.                                             If Player(k).X = Magic(i).X And Player(k).Y = Magic(i).Y - Magic(i).Pic + 3 Then
  673.                                                 If k <> MainHeroNum Then
  674.                                                     FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  675.                                                 End If
  676.                                             End If
  677.                                         Next
  678.                                     End If
  679.                                     For k = 1 To MonCount
  680.                                         If Mon(k).X = Magic(i).X And Mon(k).Y = Magic(i).Y - Magic(i).Pic + 3 Then
  681.                                             FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  682.                                         End If
  683.                                     Next
  684.                                 Case FaceInfo.RightUpFace
  685.                                     If Hero.攻击模式 <> 和平攻击模式 Then
  686.                                         For k = 1 To PlayerCount
  687.                                             If Player(k).X = Magic(i).X + Magic(i).Pic - 3 And Player(k).Y = Magic(i).Y - Magic(i).Pic + 3 Then
  688.                                                 If k <> MainHeroNum Then
  689.                                                     FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  690.                                                 End If
  691.                                             End If
  692.                                         Next
  693.                                     End If
  694.                                     For k = 1 To MonCount
  695.                                         If Mon(k).X = Magic(i).X + Magic(i).Pic - 3 And Mon(k).Y = Magic(i).Y - Magic(i).Pic + 3 Then
  696.                                             FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  697.                                         End If
  698.                                     Next
  699.                                 Case FaceInfo.RightFace
  700.                                     If Hero.攻击模式 <> 和平攻击模式 Then
  701.                                         For k = 1 To PlayerCount
  702.                                             If Player(k).X = Magic(i).X + Magic(i).Pic - 3 And Player(k).Y = Magic(i).Y Then
  703.                                                 If k <> MainHeroNum Then
  704.                                                     FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  705.                                                 End If
  706.                                             End If
  707.                                         Next
  708.                                     End If
  709.                                     
  710.                                     For k = 1 To MonCount
  711.                                         If Mon(k).X = Magic(i).X + Magic(i).Pic - 3 And Mon(k).Y = Magic(i).Y Then
  712.                                             FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  713.                                         End If
  714.                                     Next
  715.                                 Case FaceInfo.RightDownFace
  716.                                     If Hero.攻击模式 <> 和平攻击模式 Then
  717.                                         For k = 1 To PlayerCount
  718.                                             If Player(k).X = Magic(i).X + Magic(i).Pic - 3 And Player(k).Y = Magic(i).Y + Magic(i).Pic - 3 Then
  719.                                                 If k <> MainHeroNum Then
  720.                                                     FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  721.                                                 End If
  722.                                             End If
  723.                                         Next
  724.                                     End If
  725.                                     
  726.                                     For k = 1 To MonCount
  727.                                         If Mon(k).X = Magic(i).X + Magic(i).Pic - 3 And Mon(k).Y = Magic(i).Y + Magic(i).Pic - 3 Then
  728.                                             FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  729.                                         End If
  730.                                     Next
  731.                                 Case FaceInfo.DownFace
  732.                                     If Hero.攻击模式 <> 和平攻击模式 Then
  733.                                         For k = 1 To PlayerCount
  734.                                             If Player(k).X = Magic(i).X And Player(k).Y = Magic(i).Y + Magic(i).Pic - 3 Then
  735.                                                 If k <> MainHeroNum Then
  736.                                                     FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  737.                                                 End If
  738.                                             End If
  739.                                         Next
  740.                                     End If
  741.                                     
  742.                                     For k = 1 To MonCount
  743.                                         If Mon(k).X = Magic(i).X And Mon(k).Y = Magic(i).Y + Magic(i).Pic - 3 Then
  744.                                             FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  745.                                         End If
  746.                                     Next
  747.                                 Case FaceInfo.LeftDownFace
  748.                                     If Hero.攻击模式 <> 和平攻击模式 Then
  749.                                         For k = 1 To PlayerCount
  750.                                             If Player(k).X = Magic(i).X - Magic(i).Pic + 3 And Player(k).Y = Magic(i).Y + Magic(i).Pic - 3 Then
  751.                                                 If k <> MainHeroNum Then
  752.                                                     FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  753.                                                 End If
  754.                                             End If
  755.                                         Next
  756.                                     End If
  757.                                     For k = 1 To MonCount
  758.                                         If Mon(k).X = Magic(i).X - Magic(i).Pic + 3 And Mon(k).Y = Magic(i).Y + Magic(i).Pic - 3 Then
  759.                                             FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  760.                                         End If
  761.                                     Next
  762.                                 Case FaceInfo.Leftface
  763.                                     If Hero.攻击模式 <> 和平攻击模式 Then
  764.                                         For k = 1 To PlayerCount
  765.                                             If Player(k).X = Magic(i).X - Magic(i).Pic + 3 And Player(k).Y = Magic(i).Y Then
  766.                                                 If k <> MainHeroNum Then
  767.                                                     FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  768.                                                 End If
  769.                                             End If
  770.                                         Next
  771.                                     End If
  772.                                     
  773.                                     For k = 1 To MonCount
  774.                                         If Mon(k).X = Magic(i).X - Magic(i).Pic + 3 And Mon(k).Y = Magic(i).Y Then
  775.                                             FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  776.                                         End If
  777.                                     Next
  778.                                 Case FaceInfo.LeftUpFace
  779.                                     If Hero.攻击模式 <> 和平攻击模式 Then
  780.                                         For k = 1 To PlayerCount
  781.                                             If Player(k).X = Magic(i).X - Magic(i).Pic + 3 And Player(k).Y = Magic(i).Y - Magic(i).Pic + 3 Then
  782.                                                 If k <> MainHeroNum Then
  783.                                                     FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  784.                                                 End If
  785.                                             End If
  786.                                         Next
  787.                                     End If
  788.                                     
  789.                                     For k = 1 To MonCount
  790.                                         If Mon(k).X = Magic(i).X - Magic(i).Pic + 3 And Mon(k).Y = Magic(i).Y - Magic(i).Pic + 3 Then
  791.                                             FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  792.                                         End If
  793.                                     Next
  794.                             End Select
  795.                         End If
  796.                 End Select
  797.             End If
  798.             If Magic(i).MagicName = "火球术" Then
  799.                 If Magic(i).EndX > 1000 And Magic(i).EndY > 800 Then
  800.                     For j = i To MagicCount
  801.                         If j < MagicCount Then
  802.                             Magic(j) = Magic(j + 1)
  803.                         End If
  804.                     Next
  805.                     MagicCount = MagicCount - 1
  806.                     ReDim Preserve Magic(MagicCount)
  807.                 End If
  808.                 
  809.                 If Magic(i).Pic > Magic(i).MaxPicNum Then
  810.                     Magic(i).Pic = 0
  811.                     Magic(i).PicSpeed = 0
  812.                 End If
  813.             Else
  814.                 If Magic(i).Pic > Magic(i).MaxPicNum Then
  815.                     For j = i To MagicCount
  816.                         If j < MagicCount Then
  817.                             Magic(j) = Magic(j + 1)
  818.                         End If
  819.                     Next
  820.                     MagicCount = MagicCount - 1
  821.                     ReDim Preserve Magic(MagicCount)
  822.                 End If
  823.             End If
  824.         End If
  825.     Next
  826. End Sub
  827. '////////// 施放出去的魔法效果图片
  828. Public Sub ActMagic(PlayerNum As Integer, PlayerName As String, MagicName As String, X As Long, Y As Long)
  829.     Dim i As Integer, mRot As Single
  830.     Select Case MagicName
  831.         Case "火球术"
  832.             MagicCount = MagicCount + 1
  833.             ReDim Preserve Magic(MagicCount)
  834.             Magic(MagicCount).X = Player(PlayerNum).X
  835.             Magic(MagicCount).Y = Player(PlayerNum).Y - 1
  836.             Magic(MagicCount).EndX = Player(PlayerNum).X
  837.             Magic(MagicCount).EndY = Player(PlayerNum).Y
  838.             Magic(MagicCount).XOFFECT = (X * 48 - Player(PlayerNum).X * 48) / 20
  839.             Magic(MagicCount).YOFFECT = (Y * 32 - Player(PlayerNum).Y * 32) / 20
  840.             Magic(MagicCount).Pic = 0
  841.             Magic(MagicCount).PicSpeed = 0
  842.             mRot = GetRot(X * 48 - Player(PlayerNum).X * 48, Y * 32 - Player(PlayerNum).Y * 32)
  843.             If mRot <= 6.4 And mRot > 6 Then Magic(MagicCount).StartPic = 10
  844.             If mRot <= 6 And mRot > 5.6 Then Magic(MagicCount).StartPic = 20
  845.             If mRot <= 5.6 And mRot > 5.2 Then Magic(MagicCount).StartPic = 30
  846.             If mRot <= 5.2 And mRot > 4.8 Then Magic(MagicCount).StartPic = 40
  847.             If mRot <= 4.8 And mRot > 4.4 Then Magic(MagicCount).StartPic = 50
  848.             If mRot <= 4.4 And mRot > 4 Then Magic(MagicCount).StartPic = 60
  849.             If mRot <= 4 And mRot > 3.6 Then Magic(MagicCount).StartPic = 70
  850.             If mRot <= 3.6 And mRot > 3.2 Then Magic(MagicCount).StartPic = 90
  851.             If mRot <= 3.2 And mRot > 2.8 Then Magic(MagicCount).StartPic = 90
  852.             If mRot <= 2.8 And mRot > 2.4 Then Magic(MagicCount).StartPic = 100
  853.             If mRot <= 2.4 And mRot > 2 Then Magic(MagicCount).StartPic = 110
  854.             If mRot <= 2 And mRot > 1.6 Then Magic(MagicCount).StartPic = 120
  855.             If mRot <= 1.6 Or mRot > 7.7 Then Magic(MagicCount).StartPic = 130
  856.             If mRot <= 7.7 And mRot > 7.2 Then Magic(MagicCount).StartPic = 140
  857.             If mRot <= 7.2 And mRot > 6.8 Then Magic(MagicCount).StartPic = 150
  858.             If mRot >= 6.8 And mRot < 6.4 Then Magic(MagicCount).StartPic = 160
  859.             Magic(MagicCount).MaxPicNum = 4
  860.             Magic(MagicCount).MagicName = MagicName
  861.             Magic(MagicCount).PlayerNum = PlayerNum
  862.             Magic(MagicCount).PlayerName = PlayerName
  863.             Magic(MagicCount).PicSuDu = 1
  864.             For i = 1 To MagicDBCount
  865.                 If MagicDB(i).MagName_名称 = MagicName Then
  866.                     Magic(MagicCount).Effect = MagicDB(i).EffectType_动作效果
  867.                     Exit For
  868.                 End If
  869.             Next
  870.         Case "治愈术"
  871.             
  872.             Player(PlayerNum).PlayerMagic2Count = Player(PlayerNum).PlayerMagic2Count + 1
  873.             ReDim Preserve Player(PlayerNum).PlayerMagic2(Player(PlayerNum).PlayerMagic2Count)
  874.             Player(PlayerNum).PlayerMagic2(Player(PlayerNum).PlayerMagic2Count).Pic = 0
  875.             Player(PlayerNum).PlayerMagic2(Player(PlayerNum).PlayerMagic2Count).PicSpeed = 0
  876.             Player(PlayerNum).PlayerMagic2(Player(PlayerNum).PlayerMagic2Count).StartPic = 370
  877.             Player(PlayerNum).PlayerMagic2(Player(PlayerNum).PlayerMagic2Count).MaxPicNum = 10
  878.             Player(PlayerNum).PlayerMagic2(Player(PlayerNum).PlayerMagic2Count).MagicName = MagicName
  879.             Player(PlayerNum).PlayerMagic2(Player(PlayerNum).PlayerMagic2Count).PlayerNum = PlayerNum
  880.             Player(PlayerNum).PlayerMagic2(Player(PlayerNum).PlayerMagic2Count).PlayerName = PlayerName
  881.             Player(PlayerNum).PlayerMagic2(Player(PlayerNum).PlayerMagic2Count).PicSuDu = 2
  882.             For i = 1 To MagicDBCount
  883.                 If MagicDB(i).MagName_名称 = MagicName Then
  884.                     Player(PlayerNum).PlayerMagic2(Player(PlayerNum).PlayerMagic2Count).Effect = MagicDB(i).Effect_魔法效果
  885.                     Exit For
  886.                 End If
  887.             Next
  888.         Case "冰咆哮"
  889.             MagicCount = MagicCount + 1
  890.             ReDim Preserve Magic(MagicCount)
  891.             Magic(MagicCount).X = X
  892.             Magic(MagicCount).Y = Y
  893.             Magic(MagicCount).Pic = 0
  894.             Magic(MagicCount).PicSpeed = 0
  895.             Magic(MagicCount).StartPic = 3850
  896.             Magic(MagicCount).MaxPicNum = 19
  897.             Magic(MagicCount).MagicName = MagicName
  898.             Magic(MagicCount).PlayerNum = PlayerNum
  899.             Magic(MagicCount).PlayerName = PlayerName
  900.             Magic(MagicCount).PicSuDu = 1
  901.             For i = 1 To MagicDBCount
  902.                 If MagicDB(i).MagName_名称 = MagicName Then
  903.                     Magic(MagicCount).Effect = MagicDB(i).EffectType_动作效果
  904.                     Exit For
  905.                 End If
  906.             Next
  907.         Case "雷电术"
  908.             MagicCount = MagicCount + 1
  909.             ReDim Preserve Magic(MagicCount)
  910.             Magic(MagicCount).X = X
  911.             Magic(MagicCount).Y = Y
  912.             Magic(MagicCount).Pic = 0
  913.             Magic(MagicCount).PicSpeed = 0
  914.             Magic(MagicCount).StartPic = 10
  915.             Magic(MagicCount).MaxPicNum = 4
  916.             Magic(MagicCount).MagicName = MagicName
  917.             Magic(MagicCount).PlayerNum = PlayerNum
  918.             Magic(MagicCount).PlayerName = PlayerName
  919.             Magic(MagicCount).PicSuDu = 3
  920.             For i = 1 To MagicDBCount
  921.                 If MagicDB(i).MagName_名称 = MagicName Then
  922.                     Magic(MagicCount).Effect = MagicDB(i).EffectType_动作效果
  923.                     Exit For
  924.                 End If
  925.             Next
  926.             Set LoginGameMusic = DS.CreateSoundBufferFromFile(ResPath & "WavM11-2.wav", DSBDESC)
  927.             LoginGameMusic.SetVolume mVolume
  928.             LoginGameMusic.Play DSBPLAY_DEFAULT
  929.         Case "魔法盾"
  930.             If Player(PlayerNum).Magic盾 = False And Player(PlayerNum).Name_名字 = PlayerName Then
  931.                 Player(PlayerNum).Magic盾 = True
  932.                 Player(PlayerNum).Magic盾LTime = GetTickCount
  933.                 Player(PlayerNum).Magic盾PTime = 5000
  934.                 Player(PlayerNum).Magic盾StartPic = 3890
  935.                 Player(PlayerNum).Magic盾Pic = 0
  936.                 Player(PlayerNum).Magic盾MaxPic = 2
  937.             End If
  938.             
  939.             
  940.     End Select
  941.                         
  942. End Sub
  943. '////////// 自身魔法贴图动作
  944. Public Sub PlayerMagicTexAct()
  945.     Dim i As Integer, j As Integer, l As Integer
  946.     For i = 1 To PlayerCount
  947.         If Player(i).PlayerMagicCount > 0 Then
  948.             For j = 1 To Player(i).PlayerMagicCount
  949.                 If j <= Player(i).PlayerMagicCount Then
  950.                     Player(i).PlayerMagic(j).PicSpeed = Player(i).PlayerMagic(j).PicSpeed + 1
  951.                     If Player(i).PlayerMagic(j).PicSpeed > Player(i).PlayerMagic(j).PicSuDu Then
  952.                         Player(i).PlayerMagic(j).PicSpeed = 0
  953.                         Player(i).PlayerMagic(j).Pic = Player(i).PlayerMagic(j).Pic + 1
  954. '                        PlayerMagicActInfo i, j, Player(i).PlayerMagic(j).Type
  955.                         If Player(i).PlayerMagic(j).Pic > Player(i).PlayerMagic(j).MaxPicNum Then
  956.                             For l = j To Player(i).PlayerMagicCount
  957.                                 If l < Player(i).PlayerMagicCount Then
  958.                                     Player(i).PlayerMagic(l) = Player(i).PlayerMagic(l + 1)
  959.                                 End If
  960.                             Next
  961.                             Player(i).PlayerMagicCount = Player(i).PlayerMagicCount - 1
  962.                             ReDim Preserve Player(i).PlayerMagic(Player(i).PlayerMagicCount)
  963.                         End If
  964.                     End If
  965.                 End If
  966.             Next
  967.         End If
  968.         
  969.         
  970.         If Player(i).PlayerMagic2Count > 0 Then
  971.             For j = 1 To Player(i).PlayerMagic2Count
  972.                 If j <= Player(i).PlayerMagic2Count Then
  973.                     Player(i).PlayerMagic2(j).PicSpeed = Player(i).PlayerMagic2(j).PicSpeed + 1
  974.                     If Player(i).PlayerMagic2(j).PicSpeed > Player(i).PlayerMagic2(j).PicSuDu Then
  975.                         Player(i).PlayerMagic2(j).PicSpeed = 0
  976.                         Player(i).PlayerMagic2(j).Pic = Player(i).PlayerMagic2(j).Pic + 1
  977.                         If Player(i).PlayerMagic2(j).Pic > Player(i).PlayerMagic2(j).MaxPicNum Then
  978.                             For l = j To Player(i).PlayerMagic2Count
  979.                                 If l < Player(i).PlayerMagic2Count Then
  980.                                     Player(i).PlayerMagic2(l) = Player(i).PlayerMagic2(l + 1)
  981.                                 End If
  982.                             Next
  983.                             Player(i).PlayerMagic2Count = Player(i).PlayerMagic2Count - 1
  984.                             ReDim Preserve Player(i).PlayerMagic2(Player(i).PlayerMagic2Count)
  985.                         End If
  986.                     End If
  987.                 End If
  988.             Next
  989.         End If
  990.         
  991.         If Player(i).Magic盾 = True Then
  992.             Player(i).Magic盾PicSpeed = Player(i).Magic盾PicSpeed + 1
  993.             If Player(i).Magic盾PicSpeed > 3 Then
  994.                 Player(i).Magic盾PicSpeed = 0
  995.                 Player(i).Magic盾Pic = Player(i).Magic盾Pic + 1
  996.                 If Player(i).Magic盾Pic > Player(i).Magic盾MaxPic Then
  997.                     Player(i).Magic盾Pic = 0
  998.                 End If
  999.             End If
  1000.             If GetTickCount - Player(i).Magic盾LTime > Player(i).Magic盾PTime Then
  1001.                 Player(i).Magic盾 = False
  1002.             End If
  1003.         End If
  1004.     Next
  1005.     
  1006. End Sub
  1007. '//////////  自身魔法动作属性
  1008. Public Sub PlayerMagicActInfo1()
  1009.     Dim i As Integer, j As Integer
  1010.     For i = 1 To PlayerCount
  1011.         If Player(i).PlayerMagicCount > 0 Then
  1012.             For j = 1 To Player(i).PlayerMagicCount
  1013.                 Select Case Player(i).PlayerMagic(j).MagicName
  1014.                     Case "治愈术"
  1015.                         If Player(i).PlayerMagic(j).Pic = 5 And Player(i).PlayerMagic(j).PicSpeed = 0 Then
  1016.                              ActMagic i, Player(i).Name_名字, "治愈术", Player(i).PlayerMagic(j).X, Player(i).PlayerMagic(j).Y
  1017.                         End If
  1018.                     Case "冰咆哮"
  1019.                         If Player(i).PlayerMagic(j).Pic = 5 And Player(i).PlayerMagic(j).PicSpeed = 0 Then
  1020.                              ActMagic i, Player(i).Name_名字, "冰咆哮", Player(i).PlayerMagic(j).X, Player(i).PlayerMagic(j).Y
  1021.                         End If
  1022.                     Case "魔法盾"
  1023.                         If Player(i).PlayerMagic(j).Pic = 9 And Player(i).PlayerMagic(j).PicSpeed = 0 Then
  1024.                             ActMagic i, Player(i).Name_名字, "魔法盾", Player(i).PlayerMagic(j).X, Player(i).PlayerMagic(j).Y
  1025.                         End If
  1026.                     Case "雷电术"
  1027.                         If Player(i).PlayerMagic(j).Pic = 5 And Player(i).PlayerMagic(j).PicSpeed = 0 Then
  1028.                             ActMagic i, Player(i).Name_名字, "雷电术", Player(i).PlayerMagic(j).X, Player(i).PlayerMagic(j).Y
  1029.                         End If
  1030.                     Case "火球术"
  1031.                         If Player(i).PlayerMagic(j).Pic = 4 And Player(i).PlayerMagic(j).PicSpeed = 0 Then
  1032.                             ActMagic i, Player(i).Name_名字, "火球术", Player(i).PlayerMagic(j).X, Player(i).PlayerMagic(j).Y
  1033.                         End If
  1034.                 End Select
  1035.             Next
  1036.         End If
  1037.     Next
  1038.         
  1039. End Sub
  1040. '//////////  获取键盘鼠标输入
  1041. Public Sub GetInput()
  1042.     Dim i As Integer
  1043.     
  1044.     If Mouse.SelFrm = MainFrom Then
  1045.         If Mouse.Button1Down = True Then
  1046.         
  1047.             If Mouse.Item.State = False Then
  1048.             
  1049.                 If ShiftKey = True Then
  1050.                     If Player(MainHeroNum).CanAct = True Then
  1051.                         Player(MainHeroNum).Act = AttAck_攻击
  1052.                         Player(MainHeroNum).Pic = 0
  1053.                         Player(MainHeroNum).PicSpeed = 0
  1054.                         Player(MainHeroNum).CanAct = False
  1055. '                        If Player(MainHeroNum).Face <> GetMouseFace Then
  1056.                             Player(MainHeroNum).Face = GetMouseFace
  1057.                             FrmMain.Client.SendData PLAYERFACEDATA & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Face & NETKONGDATA
  1058. '                        End If
  1059.                         FrmMain.Client.SendData PLAYERATTACKDATA & KONGDATA & MainHeroNum & NETKONGDATA
  1060.                         NetAttackData = True
  1061.                     End If
  1062.                 Else
  1063.                     If Mouse.SelX <> Player(MainHeroNum).X Or Mouse.SelY <> Player(MainHeroNum).Y Then
  1064.                         If GetMouseFace <> -1 Then
  1065.                             If Player(MainHeroNum).CanAct = True Then
  1066.                                 If Player(MainHeroNum).Face <> GetMouseFace Then
  1067.                                     Player(MainHeroNum).Face = GetMouseFace
  1068.                                     FrmMain.Client.SendData PLAYERFACEDATA & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Face & NETKONGDATA
  1069.                                 End If
  1070.                                 
  1071.                                 Player(MainHeroNum).ActState = walk_走
  1072.                             End If
  1073.                         End If
  1074.                     End If
  1075.                 End If
  1076.             End If
  1077.         ElseIf Mouse.button2Down = True Then
  1078.             If Mouse.SelX <> Player(MainHeroNum).X Or Mouse.SelY <> Player(MainHeroNum).Y Then
  1079.                 If GetMouseFace <> -1 Then
  1080.                     If Player(MainHeroNum).CanAct = True Then
  1081.                         If Player(MainHeroNum).Face <> GetMouseFace Then
  1082.                                 Player(MainHeroNum).Face = GetMouseFace
  1083.                                 FrmMain.Client.SendData PLAYERFACEDATA & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).Face & NETKONGDATA
  1084.                             End If
  1085.                         Player(MainHeroNum).ActState = Run_跑
  1086.                     End If
  1087.                 End If
  1088.             End If
  1089.         End If
  1090.     End If
  1091. End Sub
  1092. '/////////   主角移动
  1093. Public Sub MovePlayer()
  1094.     Dim XX As Integer, YY As Integer
  1095.     Dim XX1 As Integer, YY1 As Integer
  1096.     XX = Player(MainHeroNum).X: YY = Player(MainHeroNum).Y
  1097.     XX1 = Player(MainHeroNum).X: YY1 = Player(MainHeroNum).Y
  1098.     If Player(MainHeroNum).CanAct = False Then Exit Sub
  1099.     Player(MainHeroNum).Act = Player(MainHeroNum).ActState
  1100.     If Player(MainHeroNum).ActState = walk_走 Then
  1101.         Select Case Player(MainHeroNum).Face
  1102.             Case FaceInfo.UpFace
  1103.                 YY = YY - 1
  1104.             Case FaceInfo.RightUpFace
  1105.                 XX = XX + 1
  1106.                 YY = YY - 1
  1107.             Case FaceInfo.RightFace
  1108.                 XX = XX + 1
  1109.             Case FaceInfo.RightDownFace
  1110.                 XX = XX + 1
  1111.                 YY = YY + 1
  1112.             Case FaceInfo.DownFace
  1113.                 YY = YY + 1
  1114.             Case FaceInfo.LeftDownFace
  1115.                 XX = XX - 1
  1116.                 YY = YY + 1
  1117.             Case FaceInfo.Leftface
  1118.                 XX = XX - 1
  1119.             Case FaceInfo.LeftUpFace
  1120.                 XX = XX - 1
  1121.                 YY = YY - 1
  1122.         End Select
  1123.         
  1124.         If XX < 0 Or XX > Map.Width Then GoTo Walk
  1125.         If YY < 0 Or YY > Map.Height Then GoTo Walk
  1126.         If Map.Map3(XX, YY) > 0 Then GoTo Walk
  1127.         If Map.Map4(XX, YY) > 0 Then GoTo Walk
  1128.         If Map.Map5(XX, YY) > 0 Then GoTo Walk
  1129.         Map.Map3(Player(MainHeroNum).X, Player(MainHeroNum).Y) = 0
  1130.         Player(MainHeroNum).X = XX: Player(MainHeroNum).Y = YY
  1131.         Map.Map3(Player(MainHeroNum).X, Player(MainHeroNum).Y) = MainHeroNum
  1132.         FrmMain.Client.SendData WALKDATA & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).X & KONGDATA & Player(MainHeroNum).Y & KONGDATA & Player(MainHeroNum).Face & NETKONGDATA
  1133.         NetWalkData = True
  1134.         Player(MainHeroNum).Act = walk_走
  1135.         Player(MainHeroNum).ActState = Stand_站立
  1136.         Player(MainHeroNum).CanAct = False
  1137.         Player(MainHeroNum).XOFFECT = 48
  1138.         Player(MainHeroNum).YOFFECT = 32
  1139.         Player(MainHeroNum).PicSpeed = 0
  1140.         Player(MainHeroNum).Pic = 0
  1141.         
  1142.     End If
  1143.     
  1144.     If Player(MainHeroNum).ActState = Run_跑 Then
  1145.         Select Case Player(MainHeroNum).Face
  1146.             Case FaceInfo.UpFace
  1147.                 YY = YY - 2
  1148.                 YY1 = YY1 - 1
  1149.             Case FaceInfo.RightUpFace
  1150.                 XX = XX + 2
  1151.                 YY = YY - 2
  1152.                 XX1 = XX1 + 1
  1153.                 YY1 = YY1 - 1
  1154.             Case FaceInfo.RightFace
  1155.                 XX = XX + 2
  1156.                 XX1 = XX1 + 1
  1157.             Case FaceInfo.RightDownFace
  1158.                 XX = XX + 2
  1159.                 YY = YY + 2
  1160.                 XX1 = XX1 + 1
  1161.                 YY1 = YY1 + 1
  1162.             Case FaceInfo.DownFace
  1163.                 YY = YY + 2
  1164.                 YY1 = YY1 + 1
  1165.             Case FaceInfo.LeftDownFace
  1166.                 XX = XX - 2
  1167.                 YY = YY + 2
  1168.                 XX1 = XX1 - 1
  1169.                 YY1 = YY1 + 1
  1170.             Case FaceInfo.Leftface
  1171.                 XX = XX - 2
  1172.                 XX1 = XX1 - 1
  1173.             Case FaceInfo.LeftUpFace
  1174.                 XX = XX - 2
  1175.                 YY = YY - 2
  1176.                 XX1 = XX1 - 1
  1177.                 YY1 = YY1 - 1
  1178.         End Select
  1179.         
  1180.         If XX < 0 Or XX > Map.Width Then GoTo Run
  1181.         If YY < 0 Or YY > Map.Height Then GoTo Run
  1182.         If Map.Map3(XX, YY) > 0 Then GoTo Run
  1183. '        If Map.Map4(XX, YY) > 0 Then GoTo Run
  1184.          If Map.Map5(XX, YY) > 0 Then GoTo Run
  1185.         If XX1 < 0 Or XX1 > Map.Width Then GoTo Run
  1186.         If YY1 < 0 Or YY1 > Map.Height Then GoTo Run
  1187.         If Map.Map3(XX1, YY1) > 0 Then GoTo Run
  1188. '        If Map.Map4(XX1, YY1) > 0 Then GoTo Run
  1189.         If Map.Map5(XX1, YY1) > 0 Then GoTo Run
  1190.         Map.Map3(Player(MainHeroNum).X, Player(MainHeroNum).Y) = 0
  1191.         Player(MainHeroNum).X = XX: Player(MainHeroNum).Y = YY
  1192.         Map.Map3(Player(MainHeroNum).X, Player(MainHeroNum).Y) = MainHeroNum
  1193.         FrmMain.Client.SendData RUNDATA & KONGDATA & MainHeroNum & KONGDATA & Player(MainHeroNum).X & KONGDATA & Player(MainHeroNum).Y & KONGDATA & Player(MainHeroNum).Face & NETKONGDATA
  1194.         NetRunData = True
  1195.         Player(MainHeroNum).Act = Run_跑
  1196.         Player(MainHeroNum).ActState = Stand_站立
  1197.         Player(MainHeroNum).CanAct = False
  1198.         Player(MainHeroNum).XOFFECT = 96
  1199.         Player(MainHeroNum).YOFFECT = 64
  1200.         Player(MainHeroNum).PicSpeed = 0
  1201.         Player(MainHeroNum).Pic = 0
  1202.         
  1203.     End If
  1204.     Exit Sub
  1205. Walk:
  1206.     Player(MainHeroNum).Act = Stand_站立
  1207.     Player(MainHeroNum).ActState = Stand_站立
  1208.     Player(MainHeroNum).XOFFECT = 0
  1209.     Player(MainHeroNum).YOFFECT = 0
  1210.     Player(MainHeroNum).CanAct = True
  1211.     Exit Sub
  1212. Run:
  1213.     Player(MainHeroNum).ActState = walk_走
  1214.     MovePlayer
  1215.                 
  1216. End Sub
  1217. '////////  获取鼠标对玩家的方向
  1218. Public Function GetMouseFace() As FaceInfo
  1219.     Dim AA As Single
  1220. '    If (Mouse.X + WorldX - 388)  48 > Player(MainHeroNum).X Then
  1221. '        If (Mouse.Y + WorldY - 300)  32 < Player(MainHeroNum).Y Then GetMouseFace = RightUpFace
  1222. '        If (Mouse.Y + WorldY - 300)  32 > Player(MainHeroNum).Y Then GetMouseFace = RightDownFace
  1223. '        If (Mouse.Y + WorldY - 300)  32 = Player(MainHeroNum).Y Then GetMouseFace = RightFace
  1224. '    ElseIf (Mouse.X + WorldX - 388)  48 < Player(MainHeroNum).X Then
  1225. '        If (Mouse.Y + WorldY - 300)  32 < Player(MainHeroNum).Y Then GetMouseFace = LeftUpFace
  1226. '        If (Mouse.Y + WorldY - 300)  32 > Player(MainHeroNum).Y Then GetMouseFace = LeftDownFace
  1227. '        If (Mouse.Y + WorldY - 300)  32 = Player(MainHeroNum).Y Then GetMouseFace = Leftface
  1228. '    ElseIf (Mouse.X + WorldX - 388)  48 = Player(MainHeroNum).X Then
  1229. '        If (Mouse.Y + WorldY - 300)  32 < Player(MainHeroNum).Y Then GetMouseFace = UpFace
  1230. '        If (Mouse.Y + WorldY - 300)  32 > Player(MainHeroNum).Y Then GetMouseFace = DownFace
  1231. '    End If
  1232.     AA = GetRot(Mouse.X - Player(MainHeroNum).X * 48 + WorldX - 384, Mouse.Y - Player(MainHeroNum).Y * 32 + WorldY - 288)
  1233.     If AA < 6.5 And AA > 5.7 Then GetMouseFace = UpFace
  1234.     If AA < 5.7 And AA > 5.1 Then GetMouseFace = RightUpFace
  1235.     If AA < 5.1 And AA > 4.5 Then GetMouseFace = RightFace
  1236.     If AA < 4.5 And AA > 3.8 Then GetMouseFace = RightDownFace
  1237.     If AA < 3.8 And AA > 2.8 Then GetMouseFace = DownFace
  1238.     If AA < 2.8 And AA > 1.9 Then GetMouseFace = LeftDownFace
  1239.     If AA < 1.9 Or AA > 7.5 Then GetMouseFace = Leftface
  1240.     If AA < 7.5 And AA > 6.5 Then GetMouseFace = LeftUpFace
  1241.     
  1242.     
  1243. End Function
  1244. '///////  玩家动作
  1245. Public Sub PlayerAct()
  1246.     Dim i As Integer, j As Integer, k As Integer
  1247.     For i = 1 To PlayerCount
  1248.         Select Case Player(i).Act
  1249.             Case HeroActType.Stand_站立
  1250.                 Player(i).CanAct = True
  1251.                 Player(i).PicSpeed = Player(i).PicSpeed + 1
  1252.                 If Player(i).PicSpeed > 5 Then
  1253.                     Player(i).PicSpeed = 0
  1254.                     Player(i).Pic = Player(i).Pic + 1
  1255.                     If Player(i).Pic > 3 Then Player(i).Pic = 0
  1256.                 End If
  1257.             Case HeroActType.walk_走
  1258.                 If NetWalkData = True Then
  1259.                     Player(i).PicSpeed = Player(i).PicSpeed + 1
  1260.                     If Player(i).PicSpeed > 100 Then NetWalkData = False
  1261.                     If Player(i).Pic < 3 Then
  1262.                         If Player(i).PicSpeed = 2 Then
  1263.                             Player(i).XOFFECT = Player(i).XOFFECT - 48 / 12
  1264.                             Player(i).YOFFECT = Player(i).YOFFECT - 32 / 12
  1265.                             If Player(i).XOFFECT <= 0 Then Player(i).XOFFECT = 0
  1266.                             If Player(i).YOFFECT <= 0 Then Player(i).YOFFECT = 0
  1267.                         End If
  1268.                         If Player(i).PicSpeed >= 4 Then
  1269.                             Player(i).PicSpeed = 0
  1270.                             Player(i).XOFFECT = Player(i).XOFFECT - 48 / 12
  1271.                             Player(i).YOFFECT = Player(i).YOFFECT - 32 / 12
  1272.                             If Player(i).XOFFECT <= 0 Then Player(i).XOFFECT = 0
  1273.                             If Player(i).YOFFECT <= 0 Then Player(i).YOFFECT = 0
  1274.                             Player(i).Pic = Player(i).Pic + 1
  1275.                             If Player(i).Pic > 5 Then
  1276.                                 Player(i).Pic = 0
  1277.                                 Player(i).ActState = Stand_站立
  1278.                                 Player(i).CanAct = True
  1279.                                 If i <> MainHeroNum Then Player(i).Act = Stand_站立
  1280.                             End If
  1281.                             
  1282.                         End If
  1283.                     End If
  1284.                 Else
  1285.                     Player(i).PicSpeed = Player(i).PicSpeed + 1
  1286.                     If Player(i).PicSpeed = 2 Then
  1287.                         Player(i).XOFFECT = Player(i).XOFFECT - 48 / 12
  1288.                         Player(i).YOFFECT = Player(i).YOFFECT - 32 / 12
  1289.                         If Player(i).XOFFECT <= 0 Then Player(i).XOFFECT = 0
  1290.                         If Player(i).YOFFECT <= 0 Then Player(i).YOFFECT = 0
  1291.                     ElseIf Player(i).PicSpeed > 4 Then
  1292.                         Player(i).PicSpeed = 0
  1293.                         Player(i).XOFFECT = Player(i).XOFFECT - 48 / 12
  1294.                         Player(i).YOFFECT = Player(i).YOFFECT - 32 / 12
  1295.                         If Player(i).XOFFECT <= 0 Then Player(i).XOFFECT = 0
  1296.                         If Player(i).YOFFECT <= 0 Then Player(i).YOFFECT = 0
  1297.                         Player(i).Pic = Player(i).Pic + 1
  1298.                         If Player(i).Pic > 5 Then
  1299.                             Player(i).Pic = 0
  1300.                             Player(i).ActState = Stand_站立
  1301.                             Player(i).CanAct = True
  1302.                             If i <> MainHeroNum Then Player(i).Act = Stand_站立
  1303.                         End If
  1304.                     End If
  1305.                 End If
  1306.                 
  1307.             Case HeroActType.Run_跑
  1308.                 If NetRunData = True Then
  1309.                     Player(i).PicSpeed = Player(i).PicSpeed + 1
  1310.                     If Player(i).PicSpeed > 100 Then NetRunData = False
  1311.                     If Player(i).Pic < 3 Then
  1312.                         If Player(i).PicSpeed = 2 Then
  1313.                             
  1314.                             Player(i).XOFFECT = Player(i).XOFFECT - 96 / 12
  1315.                             Player(i).YOFFECT = Player(i).YOFFECT - 64 / 12
  1316.                             If Player(i).XOFFECT <= 0 Then Player(i).XOFFECT = 0
  1317.                             If Player(i).YOFFECT <= 0 Then Player(i).YOFFECT = 0
  1318.                         ElseIf Player(i).PicSpeed >= 4 Then
  1319.                             Player(i).PicSpeed = 0
  1320.                             Player(i).XOFFECT = Player(i).XOFFECT - 96 / 12
  1321.                             Player(i).YOFFECT = Player(i).YOFFECT - 64 / 12
  1322.                             If Player(i).XOFFECT <= 0 Then Player(i).XOFFECT = 0
  1323.                             If Player(i).YOFFECT <= 0 Then Player(i).YOFFECT = 0
  1324.                             Player(i).Pic = Player(i).Pic + 1
  1325.                             
  1326.                             If Player(i).Pic > 5 Then
  1327.                                 Player(i).Pic = 0
  1328.                                 Player(i).ActState = Stand_站立
  1329.                                 Player(i).CanAct = True
  1330.                                 If i <> MainHeroNum Then Player(i).Act = Stand_站立
  1331.                             End If
  1332.                         End If
  1333.                     End If
  1334.                 Else
  1335.                     Player(i).PicSpeed = Player(i).PicSpeed + 1
  1336.                     If Player(i).PicSpeed = 2 Then
  1337.                         
  1338.                         
  1339.                         Player(i).XOFFECT = Player(i).XOFFECT - 96 / 12
  1340.                         Player(i).YOFFECT = Player(i).YOFFECT - 64 / 12
  1341.                         If Player(i).XOFFECT <= 0 Then Player(i).XOFFECT = 0
  1342.                         If Player(i).YOFFECT <= 0 Then Player(i).YOFFECT = 0
  1343.                     ElseIf Player(i).PicSpeed >= 4 Then
  1344.                         Player(i).PicSpeed = 0
  1345.                         Player(i).XOFFECT = Player(i).XOFFECT - 96 / 12
  1346.                         Player(i).YOFFECT = Player(i).YOFFECT - 64 / 12
  1347.                         If Player(i).XOFFECT <= 0 Then Player(i).XOFFECT = 0
  1348.                         If Player(i).YOFFECT <= 0 Then Player(i).YOFFECT = 0
  1349.                         Player(i).Pic = Player(i).Pic + 1
  1350.                         If Player(i).Pic > 5 Then
  1351.                             Player(i).Pic = 0
  1352.                             Player(i).ActState = Stand_站立
  1353.                             Player(i).CanAct = True
  1354.                             If i <> MainHeroNum Then Player(i).Act = Stand_站立
  1355.                         End If
  1356.                     End If
  1357.                 End If
  1358.             Case HeroActType.AttAck_攻击
  1359.                 If NetAttackData = True Then
  1360.                     Player(i).PicSpeed = Player(i).PicSpeed + 1
  1361.                     If Player(i).PicSpeed > 100 Then NetAttackData = False
  1362.                     If Player(i).Pic < 3 Then
  1363.                         If Player(i).PicSpeed > 3 Then
  1364.                             Player(i).PicSpeed = 0
  1365.                             Player(i).Pic = Player(i).Pic + 1
  1366.                             If Player(i).Pic > 5 Then
  1367.                                 Player(i).Pic = 0
  1368.                                 Player(i).Act = Attack_等待
  1369.                                 Player(i).ActState = Attack_等待
  1370.                                 Player(i).CanAct = True
  1371.                             End If
  1372.                             
  1373.                             
  1374.                         End If
  1375.                     End If
  1376.                 Else
  1377.                     Player(i).PicSpeed = Player(i).PicSpeed + 1
  1378.                     If Player(i).PicSpeed > 3 Then
  1379.                         Player(i).PicSpeed = 0
  1380.                         Player(i).Pic = Player(i).Pic + 1
  1381.                         If Player(i).Pic > 5 Then
  1382.                             Player(i).Pic = 0
  1383.                             Player(i).Act = Attack_等待
  1384.                             Player(i).ActState = Attack_等待
  1385.                             Player(i).CanAct = True
  1386.                         End If
  1387.                     End If
  1388.                 End If
  1389.                 
  1390.                 If i = MainHeroNum And Player(i).Pic = 4 And Player(i).PicSpeed = 0 Then
  1391.                     Dim GongVal As Long
  1392.                     GongVal = Rnd * Abs(Player(MainHeroNum).DC1 - Player(MainHeroNum).DC2) + IIf(Player(MainHeroNum).DC1 < Player(MainHeroNum).DC2, Player(MainHeroNum).DC1, Player(MainHeroNum).DC2)
  1393.                     Select Case Player(i).Face
  1394.                         Case FaceInfo.UpFace
  1395.                             For k = 1 To PlayerCount
  1396.                                 If Player(k).X = Player(i).X And Player(k).Y = Player(i).Y - 1 Then
  1397.                                     If k <> MainHeroNum Then
  1398.                                         FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1399.                                     End If
  1400.                                 End If
  1401.                             Next
  1402.                             For k = 1 To MonCount
  1403.                                 If Mon(k).X = Player(i).X And Mon(k).Y = Player(i).Y - 1 Then
  1404.                                     If k <> MainHeroNum Then
  1405.                                         FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1406.                                     End If
  1407.                                 End If
  1408.                             Next
  1409.                         Case FaceInfo.RightUpFace
  1410.                             For k = 1 To PlayerCount
  1411.                                 If Player(k).X = Player(i).X + 1 And Player(k).Y = Player(i).Y - 1 Then
  1412.                                     If k <> MainHeroNum Then
  1413.                                         FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1414.                                     End If
  1415.                                 End If
  1416.                             Next
  1417.                             For k = 1 To MonCount
  1418.                                 If Mon(k).X = Player(i).X + 1 And Mon(k).Y = Player(i).Y - 1 Then
  1419.                                     If k <> MainHeroNum Then
  1420.                                         FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1421.                                     End If
  1422.                                 End If
  1423.                             Next
  1424.                         Case FaceInfo.RightFace
  1425.                             For k = 1 To PlayerCount
  1426.                                 If Player(k).X = Player(i).X + 1 And Player(k).Y = Player(i).Y Then
  1427.                                     If k <> MainHeroNum Then
  1428.                                         FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1429.                                     End If
  1430.                                 End If
  1431.                             Next
  1432.                             For k = 1 To MonCount
  1433.                                 If Mon(k).X = Player(i).X + 1 And Mon(k).Y = Player(i).Y Then
  1434.                                     If k <> MainHeroNum Then
  1435.                                         FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1436.                                     End If
  1437.                                 End If
  1438.                             Next
  1439.                         Case FaceInfo.RightDownFace
  1440.                             For k = 1 To PlayerCount
  1441.                                 If Player(k).X = Player(i).X + 1 And Player(k).Y = Player(i).Y + 1 Then
  1442.                                     If k <> MainHeroNum Then
  1443.                                         FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1444.                                     End If
  1445.                                 End If
  1446.                             Next
  1447.                             For k = 1 To MonCount
  1448.                                 If Mon(k).X = Player(i).X + 1 And Mon(k).Y = Player(i).Y + 1 Then
  1449.                                     If k <> MainHeroNum Then
  1450.                                         FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1451.                                     End If
  1452.                                 End If
  1453.                             Next
  1454.                         Case FaceInfo.DownFace
  1455.                             For k = 1 To PlayerCount
  1456.                                 If Player(k).X = Player(i).X And Player(k).Y = Player(i).Y + 1 Then
  1457.                                     If k <> MainHeroNum Then
  1458.                                         FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1459.                                     End If
  1460.                                 End If
  1461.                             Next
  1462.                             For k = 1 To MonCount
  1463.                                 If Mon(k).X = Player(i).X And Mon(k).Y = Player(i).Y + 1 Then
  1464.                                     If k <> MainHeroNum Then
  1465.                                         FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1466.                                     End If
  1467.                                 End If
  1468.                             Next
  1469.                         Case FaceInfo.LeftDownFace
  1470.                             For k = 1 To PlayerCount
  1471.                                 If Player(k).X = Player(i).X - 1 And Player(k).Y = Player(i).Y + 1 Then
  1472.                                     If k <> MainHeroNum Then
  1473.                                         FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1474.                                     End If
  1475.                                 End If
  1476.                             Next
  1477.                             For k = 1 To MonCount
  1478.                                 If Mon(k).X = Player(i).X - 1 And Mon(k).Y = Player(i).Y + 1 Then
  1479.                                     If k <> MainHeroNum Then
  1480.                                         FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1481.                                     End If
  1482.                                 End If
  1483.                             Next
  1484.                         Case FaceInfo.Leftface
  1485.                             For k = 1 To PlayerCount
  1486.                                 If Player(k).X = Player(i).X - 1 And Player(k).Y = Player(i).Y Then
  1487.                                     If k <> MainHeroNum Then
  1488.                                         FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1489.                                     End If
  1490.                                 End If
  1491.                             Next
  1492.                             For k = 1 To MonCount
  1493.                                 If Mon(k).X = Player(i).X - 1 And Mon(k).Y = Player(i).Y Then
  1494.                                     If k <> MainHeroNum Then
  1495.                                         FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1496.                                     End If
  1497.                                 End If
  1498.                             Next
  1499.                         Case FaceInfo.LeftUpFace
  1500.                             For k = 1 To PlayerCount
  1501.                                 If Player(k).X = Player(i).X - 1 And Player(k).Y = Player(i).Y - 1 Then
  1502.                                     If k <> MainHeroNum Then
  1503.                                         FrmMain.Client.SendData SHANGHAIDATA & KONGDATA & k & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1504.                                     End If
  1505.                                 End If
  1506.                             Next
  1507.                             For k = 1 To MonCount
  1508.                                 If Mon(k).X = Player(i).X - 1 And Mon(k).Y = Player(i).Y - 1 Then
  1509.                                     If k <> MainHeroNum Then
  1510.                                         FrmMain.Client.SendData MONSHANGHAI & KONGDATA & Mon(k).ID & KONGDATA & GongVal & KONGDATA & 0 & NETKONGDATA
  1511.                                     End If
  1512.                                 End If
  1513.                             Next
  1514.                     End Select
  1515.                 End If
  1516.             Case HeroActType.Attack_等待
  1517.                 Player(i).PicSpeed = Player(i).PicSpeed + 1
  1518.                 If Player(i).PicSpeed > 50 Then
  1519.                     Player(i).PicSpeed = 0
  1520.                     Player(i).Pic = Player(i).Pic + 1
  1521.                     If Player(i).Pic > 0 Then
  1522.                         Player(i).Pic = 0
  1523.                         Player(i).Act = Stand_站立
  1524.                         Player(i).ActState = Stand_站立
  1525.                         Player(i).CanAct = True
  1526.                     End If
  1527.                 End If
  1528.             Case HeroActType.Bruise_受伤
  1529.                 Player(i).PicSpeed = Player(i).PicSpeed + 1
  1530.                 If Player(i).PicSpeed > 5 Then
  1531.                     Player(i).PicSpeed = 0
  1532.                     Player(i).Pic = Player(i).Pic + 1
  1533.                     If Player(i).Pic > 2 Then
  1534.                         Player(i).Pic = 0
  1535.                         Player(i).Act = Stand_站立
  1536.                         Player(i).ActState = Stand_站立
  1537.                         Player(i).CanAct = True
  1538.                     End If
  1539.                 End If
  1540.             Case HeroActType.Dead_死亡
  1541.                 Player(i).PicSpeed = Player(i).PicSpeed + 1
  1542.                 If Player(i).PicSpeed > 3 Then
  1543.                     Player(i).PicSpeed = 0
  1544.                     Player(i).Pic = Player(i).Pic + 1
  1545.                     If Player(i).Pic > 3 Then
  1546.                         Player(i).Pic = 3
  1547.                         Player(i).CanAct = False
  1548.                     End If
  1549.                 End If
  1550.             Case HeroActType.Magic_魔法
  1551.                 If NetMagicData = True Then
  1552.                     Player(i).PicSpeed = Player(i).PicSpeed + 1
  1553.                     If Player(i).PicSpeed > 100 Then NetMagicData = False
  1554.                     If Player(i).Pic < 3 Then
  1555.                         If Player(i).PicSpeed > 3 Then
  1556.                             Player(i).PicSpeed = 0
  1557.                             Player(i).Pic = Player(i).Pic + 1
  1558.                             If Player(i).Pic > 5 Then
  1559.                                 Player(i).Pic = 0
  1560.                                 Player(i).Act = Attack_等待
  1561.                                 Player(i).ActState = Attack_等待
  1562.                                 Player(i).CanAct = True
  1563.                             End If
  1564.                         End If
  1565.                     End If
  1566.                 Else
  1567.                     Player(i).PicSpeed = Player(i).PicSpeed + 1
  1568.                     If Player(i).PicSpeed > 3 Then
  1569.                         Player(i).PicSpeed = 0
  1570.                         Player(i).Pic = Player(i).Pic + 1
  1571.                         If Player(i).Pic > 5 Then
  1572.                             Player(i).Pic = 0
  1573.                             Player(i).Act = Attack_等待
  1574.                             Player(i).ActState = Attack_等待
  1575.                             Player(i).CanAct = True
  1576.                         End If
  1577.                     End If
  1578.                 End If
  1579.         End Select
  1580.     Next
  1581. End Sub
  1582. Public Sub MoveScreen()
  1583.     WorldX = Player(MainHeroNum).X * 48
  1584.     WorldY = Player(MainHeroNum).Y * 32 + 30
  1585.     If Player(MainHeroNum).Act = walk_走 Or Player(MainHeroNum).Act = Run_跑 Then
  1586.         Select Case Player(MainHeroNum).Face
  1587.             Case FaceInfo.UpFace
  1588.                 WorldY = WorldY + Player(MainHeroNum).YOFFECT
  1589.             Case FaceInfo.RightUpFace
  1590.                 WorldX = WorldX - Player(MainHeroNum).XOFFECT
  1591.                 WorldY = WorldY + Player(MainHeroNum).YOFFECT
  1592.             Case FaceInfo.RightFace
  1593.                 WorldX = WorldX - Player(MainHeroNum).XOFFECT
  1594.             Case FaceInfo.RightDownFace
  1595.                 WorldX = WorldX - Player(MainHeroNum).XOFFECT
  1596.                 WorldY = WorldY - Player(MainHeroNum).YOFFECT
  1597.             Case FaceInfo.DownFace
  1598.                 WorldY = WorldY - Player(MainHeroNum).YOFFECT
  1599.             Case FaceInfo.LeftDownFace
  1600.                 WorldX = WorldX + Player(MainHeroNum).XOFFECT
  1601.                 WorldY = WorldY - Player(MainHeroNum).YOFFECT
  1602.             Case FaceInfo.Leftface
  1603.                 WorldX = WorldX + Player(MainHeroNum).XOFFECT
  1604.             Case FaceInfo.LeftUpFace
  1605.                 WorldX = WorldX + Player(MainHeroNum).XOFFECT
  1606.                 WorldY = WorldY + Player(MainHeroNum).YOFFECT
  1607.         End Select
  1608.     End If
  1609. '    If WorldX < 400 Then WorldX = 400
  1610. '    If WorldX > Map.Width * 48 + 48 - 420 Then WorldX = Map.Width * 48 + 48 - 420
  1611. '    If WorldY < 290 Then WorldY = 290
  1612. '    If WorldY > Map.Height * 32 + 32 - 200 Then WorldY = Map.Height * 32 + 32 - 200
  1613.     
  1614. End Sub
  1615. '///////////////   玩家排序
  1616. Public Sub PaiXuPlayer()
  1617.     Dim i As Integer, N As Integer
  1618.     Dim Work As Boolean
  1619.     Work = False
  1620.     For i = 1 To PlayerCount
  1621.         PaiXuPlayerNum(i) = i
  1622.     Next
  1623.     Do While Work = True
  1624.         Work = False
  1625.         For i = 1 To PlayerCount
  1626.             If i < PlayerCount Then
  1627.                 If Player(PaiXuPlayerNum(i)).Y > Player(PaiXuPlayerNum(i) + 1).Y Then
  1628.                     N = PaiXuPlayerNum(i)
  1629.                     PaiXuPlayerNum(i) = PaiXuPlayerNum(i + 1)
  1630.                     PaiXuPlayerNum(i + 1) = N
  1631.                     Work = True
  1632.                 End If
  1633.             End If
  1634.         Next
  1635.         DoEvents
  1636.     Loop
  1637. End Sub