📄 cenemy.cls
字号:
End If
If I_nTerminateCount > 0 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
Parent.Parent.Parent.Player.Stat_OwnShotsHit = Parent.Parent.Parent.Player.Stat_OwnShotsHit + 1
End If
End If
If I_nTerminateCount Mod 20 = 0 Then
If ExplosionSize > 2 Then
Parent.Parent.Effects.Add "EXPLO3", 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
If I_nTerminateCount Mod (10 + IIf(Not Parent.Parent.Parent.Detail, 5, 0)) = 0 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
If I_nTerminateCount Mod (15 + IIf(Not Parent.Parent.Parent.Detail, 5, 0)) = 0 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
End If
I_nTerminateCount = I_nTerminateCount - 1
If I_nTerminateCount = 0 Then
Me.Terminating = True
Parent.Parent.Parent.Player.Stat_Frags = Parent.Parent.Parent.Player.Stat_Frags + 1
If Me.ComponentParent Is Nothing Then
If Parent.Parent.Parent.Level.Stopper Is Me Then Set Parent.Parent.Parent.Level.Stopper = Nothing
End If
Parent.Parent.Parent.Campaign.CheckExtraLife Me.ScoreValue
Parent.Parent.Parent.Player.Score = Parent.Parent.Parent.Player.Score + Me.ScoreValue
Parent.Parent.Effects.Add "EXPLO3", Int(PositionX), Int(PositionY), 0, IIf(Parent.Parent.Parent.Level.Stopper Is Nothing, 5, 0)
If ExplosionSize = 1 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
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
End If
If 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
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 "EXPLO4", Int(PositionX), Int(PositionY), 0, 0, Me
End If
If ExplosionSize = 3 Then
If Parent.Parent.Parent.Detail Then Parent.Parent.Effects.Add "EXPLO3", Int(PositionX) + Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(PositionY) + Int(Rnd * Frame.Height * 6) - Frame.Height * 3, 0, 0
Parent.Parent.Effects.Add "EXPLO3", Int(PositionX) + Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(PositionY) + Int(Rnd * Frame.Height * 6) - Frame.Height * 3, 0, 0
Parent.Parent.Effects.Add "EXPLO4", Int(PositionX), Int(PositionY), 0, 0, Me
End If
If ExplosionSize = 4 Then
If Parent.Parent.Parent.Detail Then Parent.Parent.Effects.Add "EXPLO3", Int(PositionX) + Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(PositionY) + Int(Rnd * Frame.Height * 6) - Frame.Height * 3, 0, 0
If Parent.Parent.Parent.Detail Then Parent.Parent.Effects.Add "EXPLO3", Int(PositionX) + Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(PositionY) + Int(Rnd * Frame.Height * 6) - Frame.Height * 3, 0, 0
Parent.Parent.Effects.Add "EXPLO3", Int(PositionX) + Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(PositionY) + Int(Rnd * Frame.Height * 6) - Frame.Height * 3, 0, 0
Parent.Parent.Effects.Add "EXPLO3", Int(PositionX) + Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(PositionY) + Int(Rnd * Frame.Height * 6) - Frame.Height * 3, 0, 0
If Parent.Parent.Parent.Detail Then Parent.Parent.Effects.Add "EXPLO4", Int(PositionX) + Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(PositionY) + Int(Rnd * Frame.Height * 6) - Frame.Height * 3, 0, 0
If Parent.Parent.Parent.Detail Then Parent.Parent.Effects.Add "EXPLO4", Int(PositionX) + Int(Rnd * Frame.Width * 6) - Frame.Width * 3, Int(PositionY) + Int(Rnd * Frame.Height * 6) - Frame.Height * 3, 0, 0
Parent.Parent.Effects.Add "EXPLO4", Int(PositionX), Int(PositionY), 0, 0, Me
End If
End If
Else
If Me.ExplosionSize > 1 And Me.ExplosionSize < 4 Then
If I_nCurrentHitpoints < Hitpoints \ 4 Then
If Me.ComponentParent Is Nothing Then
If Parent.Parent.Parent.FrameCount Mod (10 + IIf(Not Parent.Parent.Parent.Detail, 10, 0)) = 0 Then
Parent.Parent.Effects.Add "SMOKESHIP", Int(PositionX), Int(PositionY), -Int(L_nDX / 2), -Int(L_nDY / 2)
End If
End If
End If
End If
If Parent.Parent.Parent.Player.Active And Active Then
If Not IsPowerup Then
If Int(PositionY) < 4500 Then
Select Case Weapon
' Single Ball, straight down
Case 1
If Parent.Parent.Parent.FrameCount Mod 25 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT1", Int(PositionX), Int(PositionY) + Frame.Height * 4, Int(PositionX), 5000
I_nShooting = 1
End If
End If
' Single Ball, directed at player
Case 2
If Parent.Parent.Parent.FrameCount Mod 25 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT1", Int(PositionX), Int(PositionY), Parent.Parent.Parent.Player.PositionX, Parent.Parent.Parent.Player.PositionY
I_nShooting = 1
End If
End If
' Single ball, in direction of enemy
Case 3
If Parent.Parent.Parent.FrameCount Mod 25 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT1", Int(PositionX), Int(PositionY), Int(PositionX) + L_nDX * 10000, Int(PositionY) + L_nDY * 10000
I_nShooting = 1
End If
End If
' Fireball, straight down
Case 4
If Parent.Parent.Parent.FrameCount Mod 25 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT3", Int(PositionX), Int(PositionY) + Frame.Height * 4, Int(PositionX), Int(PositionY) + 10000
I_nShooting = 1
End If
End If
' Fireball, directed at player
Case 5
If Parent.Parent.Parent.FrameCount Mod 25 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT3", Int(PositionX), Int(PositionY), Parent.Parent.Parent.Player.PositionX, Parent.Parent.Parent.Player.PositionY
I_nShooting = 1
End If
End If
' fireball ball, in direction of enemy
Case 6
If Parent.Parent.Parent.FrameCount Mod 25 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT3", Int(PositionX), Int(PositionY), Int(PositionX) + L_nDX * 10000, Int(PositionY) + L_nDY * 10000
I_nShooting = 1
End If
End If
' Fireline, straight down
Case 7
If Parent.Parent.Parent.FrameCount Mod 25 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT2", Int(PositionX), Int(PositionY) + Frame.Height * 4, Int(PositionX), Int(PositionY) + 10000
I_nShooting = 1
End If
End If
' Single fireball (down with deviation)
Case 8
If Parent.Parent.Parent.FrameCount Mod 25 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT3", Int(PositionX), Int(PositionY) + Frame.Height * 4, Int(PositionX) - 150 + Int(Rnd * 300), 5000
I_nShooting = 1
End If
End If
' Twin fireball (down with deviation)
Case 9
If Parent.Parent.Parent.FrameCount Mod 25 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT1", Int(PositionX) - Frame.Width * 2, Int(PositionY) + Frame.Height * 4, Int(PositionX) - Frame.Width * 2 - 150 + Int(Rnd * 300), 5000
Parent.Parent.Shots.Add "ENEMYSHOT1", Int(PositionX) + Frame.Width * 2, Int(PositionY) + Frame.Height * 4, Int(PositionX) + Frame.Width * 2 - 150 + Int(Rnd * 300), 5000
I_nShooting = 1
End If
End If
' Mix: Overkill
Case 10
If Parent.Parent.Parent.FrameCount Mod 25 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT2", Int(PositionX), Int(PositionY) + Frame.Width * 4, Int(PositionX), 5000
I_nShooting = 1
End If
End If
If Parent.Parent.Parent.FrameCount Mod 35 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT3", Int(PositionX) - Frame.Width, Int(PositionY) + Frame.Width * 4, Int(PositionX) - Frame.Width - 150 + Rnd * 300, 5000
I_nShooting = 1
End If
End If
If Parent.Parent.Parent.FrameCount Mod 40 = 0 Then
If Int(Rnd * 150) < State.AttackPropability Then
Parent.Parent.Shots.Add "ENEMYSHOT3", Int(PositionX) + Frame.Width, Int(PositionY) + Frame.Width * 4, Int(PositionX) + Frame.Width - 150 + Rnd * 300, 5000
I_nShooting = 1
End If
End If
End Select
End If
End If
End If
LifeCount = LifeCount + 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -