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

📄 cenemy.cls

📁 3D纵版射击程序
💻 CLS
📖 第 1 页 / 共 3 页
字号:
            
            If Parent.Parent.Parent.FrameCount Mod 2 = 0 Then
            
                If Not IsPowerup Then
                    If Not NoHit Then
                        Set L_oShot = Parent.Parent.Shots.Hit(PositionX \ 10 - Frame.Width \ 2, PositionY \ 10 - Frame.Height \ 2, PositionX \ 10 + Frame.Width \ 2, PositionY \ 10 + Frame.Height \ 2, True)
                        If Not (L_oShot Is Nothing) Then
                            L_oShot.Terminating = True
                            I_nCurrentHitpoints = I_nCurrentHitpoints - L_oShot.Power * (3 - Parent.Parent.Parent.Difficulty)
                            Parent.Parent.Parent.Player.Stat_OwnShotsHit = Parent.Parent.Parent.Player.Stat_OwnShotsHit + 1
                            If I_nCurrentHitpoints < 0 Then
                                I_nTerminateCount = ExplosionSize * IIf(Parent.Parent.Parent.Detail, 30, 10) + 5
                            Else
                                Parent.Parent.Effects.Add L_oShot.ExploStyle, Int(PositionX), Int(PositionY), L_oShot.PositionX - Int(PositionX), L_oShot.PositionY - Int(PositionY), Me
                                If (I_nCurrentHitpoints - L_oShot.Power * (3 - Parent.Parent.Parent.Difficulty) < I_nMaxHitpoints \ 2) And (I_nCurrentHitpoints > I_nMaxHitpoints \ 2) And ExplosionSize > 2 Then
                                    Parent.Parent.Effects.Add "EXPLO2", Int(PositionX), Int(PositionY), Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(Rnd * Frame.Height * 6) - Frame.Height * 3, Me
                                    Parent.Parent.Effects.Add "EXPLO2", Int(PositionX), Int(PositionY), Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(Rnd * Frame.Height * 6) - Frame.Height * 3, Me
                                    If Parent.Parent.Parent.Detail Then Parent.Parent.Effects.Add "EXPLO2", Int(PositionX), Int(PositionY), Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(Rnd * Frame.Height * 6) - Frame.Height * 3, Me
                                    Parent.Parent.Effects.Add "EXPLO1", Int(PositionX), Int(PositionY), Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(Rnd * Frame.Height * 6) - Frame.Height * 3, Me
                                    Parent.Parent.Effects.Add "EXPLO1", Int(PositionX), Int(PositionY), Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(Rnd * Frame.Height * 6) - Frame.Height * 3, Me
                                    Parent.Parent.Effects.Add "EXPLO1", Int(PositionX), Int(PositionY), Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(Rnd * Frame.Height * 6) - Frame.Height * 3, Me
                                    If Parent.Parent.Parent.Detail Then Parent.Parent.Effects.Add "EXPLO1", Int(PositionX), Int(PositionY), Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(Rnd * Frame.Height * 6) - Frame.Height * 3, Me
                                    If Parent.Parent.Parent.Detail Then Parent.Parent.Effects.Add "EXPLO1", Int(PositionX), Int(PositionY), Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(Rnd * Frame.Height * 6) - Frame.Height * 3, Me
                                    If Parent.Parent.Parent.Detail Then Parent.Parent.Effects.Add "EXPLO1", Int(PositionX), Int(PositionY), Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(Rnd * Frame.Height * 6) - Frame.Height * 3, Me
                                End If
                            End If
                        End If
                    End If
                End If
                
                If (Not NoCollide) And (I_nTerminateCount <= 0) And Not Parent.Parent.Parent.DebugMode Then
                    If Parent.Parent.Parent.Player.Active Then
                        With Parent.Parent.Parent.Player
                            If .PositionX + .Frame.Width * 2 > Int(PositionX) - Frame.Width * 5 Then
                                If .PositionX - .Frame.Width * 2 < Int(PositionX) + Frame.Width * 5 Then
                                    If .PositionY + .Frame.Height * 2 > Int(PositionY) - Frame.Height * 5 Then
                                        If .PositionY - .Frame.Height * 2 < Int(PositionY) + Frame.Height * 5 Then
                                        
                                            If IsPowerup Then
                                                Parent.Parent.Parent.Player.Stat_PowerupCollected = Parent.Parent.Parent.Player.Stat_PowerupCollected + 1
                                                Me.Terminating = True
                                                Parent.Parent.Effects.Add "EXPLOP", Int(PositionX), Int(PositionY), 0, IIf(Parent.Parent.Parent.Level.Stopper Is Nothing, 5, 0)
                                                
                                                Select Case PowerUpStyle
                                                    Case 1
                                                        If Parent.Parent.Parent.Player.Weapon = 0 Or Parent.Parent.Parent.Player.Weapon = 1 Or Parent.Parent.Parent.Player.Weapon = 2 Or Parent.Parent.Parent.Player.Weapon = 4 Then
                                                            Parent.Parent.Parent.Player.SetEquipment , IIf(Parent.Parent.Parent.Player.Mounts < 2, 2, Parent.Parent.Parent.Player.Mounts)
                                                            Parent.Parent.Message = "twin mount acquired"
                                                        End If
                                                    Case 2
                                                        If Parent.Parent.Parent.Player.Weapon = 0 Or Parent.Parent.Parent.Player.Weapon = 4 Then
                                                            Parent.Parent.Parent.Player.SetEquipment , 3
                                                            Parent.Parent.Message = "tripple mount acquired"
                                                        End If
                                                    Case 3
                                                        If Parent.Parent.Parent.Player.Weapon < 4 Then
                                                            Parent.Parent.Parent.Player.SetEquipment Parent.Parent.Parent.Player.Weapon + 1
                                                            Parent.Parent.Message = "weapon upgraded"
                                                        End If
                                                    Case 4
                                                        Parent.Parent.Parent.Player.Shield = Parent.Parent.Parent.Player.MaxHitpoints
                                                        Parent.Parent.Message = "shields charged"
                                                    Case 5
                                                        Parent.Parent.Parent.Player.Hitpoints = Parent.Parent.Parent.Player.MaxHitpoints
                                                        Parent.Parent.Message = "ship repaired"
                                                    Case 6
                                                        If Parent.Parent.Parent.Player.Orbiter < 4 Then
                                                            Parent.Parent.Parent.Player.SetEquipment , , Parent.Parent.Parent.Player.Orbiter + 1
                                                        End If
                                                        Parent.Parent.Message = "drones acquired"
                                                    Case 7
                                                        If Parent.Parent.Parent.Player.Lifes < 9 Then Parent.Parent.Parent.Player.Lifes = Parent.Parent.Parent.Player.Lifes + 1
                                                        Parent.Parent.Message = "extra ship acquired"
                                                End Select
                                                
                                            Else
                                                Parent.Parent.Parent.Player.Hitpoints = Parent.Parent.Parent.Player.Hitpoints - Int(I_nCurrentHitpoints * (Parent.Parent.Parent.Difficulty + 1) * 1.5)
                                                I_nCurrentHitpoints = -1
                                                I_nTerminateCount = 5
                                            End If
                                            
                                        End If
                                    End If
                                End If
                            End If
                        End With
                    End If
                End If
                
            End If
            
            If ComponentParent Is Nothing Then
            
                If State.Style = 1 Then
                    If LifeCount Mod State.CircleRad = 0 Then
                        State.Direction = State.Direction + 2 * State.CircleRad * State.CircleDir
                        If State.Direction > 359 Then State.Direction = State.Direction - 360
                        If State.Direction < 0 Then State.Direction = State.Direction + 360
                        If (State.Direction \ (2 * State.CircleRad)) = State.CircleXit Then
                            State.Style = 0
                        End If
                    End If
                End If
                
                If State.Style = 0 Then
                    If Not (I_oWayPoints.Current Is Nothing) Then
                        If I_oWayPoints.Current.Orientation = "H" Then
                            If L_nDX > 0 Then
                                If Int(PositionX) > Int(400 * (I_oWayPoints.Current.Position / 100)) * 10 Then
                                    I_oWayPoints.Current.Apply
                                    I_oWayPoints.Advance
                                    GoTo M_FinishedWaypoints
                                End If
                            End If
                            If L_nDX < 0 Then
                                If Int(PositionX) < Int(400 * (I_oWayPoints.Current.Position / 100)) * 10 Then
                                    I_oWayPoints.Current.Apply
                                    I_oWayPoints.Advance
                                    GoTo M_FinishedWaypoints
                                End If
                            End If
                        End If
                        If I_oWayPoints.Current.Orientation = "V" Then
                            If L_nDY > 0 Then
                                If Int(PositionY) > Int(500 * (I_oWayPoints.Current.Position / 100)) * 10 Then
                                    I_oWayPoints.Current.Apply
                                    I_oWayPoints.Advance
                                    GoTo M_FinishedWaypoints
                                End If
                            End If
                            If L_nDY < 0 Then
                                If Int(PositionY) < Int(500 * (I_oWayPoints.Current.Position / 100)) * 10 Then
                                    I_oWayPoints.Current.Apply
                                    I_oWayPoints.Advance
                                    GoTo M_FinishedWaypoints
                                End If
                            End If
                        End If
                    End If
                End If
M_FinishedWaypoints:
            End If
        End If
        
    Else
        
        If ComponentParent Is Nothing Then
        
            If Parent.Parent.Position = TriggerAt Then
                
                Active = True
                If IsPowerup Then
                Parent.Parent.Parent.Player.Stat_PowerupTotal = Parent.Parent.Parent.Player.Stat_PowerupTotal + 1
                End If
                I_nMaxHitpoints = Hitpoints
                I_nCurrentHitpoints = Hitpoints
                If Not I_oWayPoints.Current Is Nothing Then I_oWayPoints.Current.Apply
                I_oWayPoints.Advance
                            
                If State.Orientation = "H" Then
                    PositionX = 10 * (Int(400 * (State.Position / 100)))
                    PositionY = 10 * (-Frame.Height \ 2 + 1)
                End If
                
                If State.Orientation = "V" Then
                    PositionX = IIf(State.Direction > 180, 4000 + 10 * (Frame.Width \ 2 - 1), 10 * (-Frame.Width \ 2 + 1))
                    PositionY = 10 * (Int(500 * (State.Position / 100)))
                End If
                
                Dim L_oItem As cEnemy
                For Each L_oItem In Parent
                    If L_oItem.ComponentParent Is Me Then
                        With L_oItem
                            .Active = True
                            .InitHitpoints
                        End With
                    End If
                Next
                
            End If
            
            
        End If
        
    End If
    
End Sub

⌨️ 快捷键说明

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