equal
deleted
inserted
replaced
3042 DeleteGear(Gear) |
3042 DeleteGear(Gear) |
3043 end |
3043 end |
3044 end; |
3044 end; |
3045 |
3045 |
3046 procedure doStepAirAttack(Gear: PGear); |
3046 procedure doStepAirAttack(Gear: PGear); |
|
3047 var valid: boolean; |
|
3048 HHGear: PGear; |
|
3049 planeY: LongInt; |
3047 begin |
3050 begin |
3048 AllInactive := false; |
3051 AllInactive := false; |
|
3052 |
|
3053 planeY:= topY - 300; |
|
3054 valid:= true; |
|
3055 if (WorldEdge = weBounce) then |
|
3056 if (Gear^.X.QWordValue = 0) and (Gear^.Target.X > rightX) then |
|
3057 valid:= false |
|
3058 else if (Gear^.X.QWordValue <> 0) and (Gear^.Target.X < leftX) then |
|
3059 valid:= false |
|
3060 else if (Gear^.Target.Y < planeY) then |
|
3061 valid:= false; |
|
3062 |
|
3063 if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then |
|
3064 HHGear:= Gear^.Hedgehog^.Gear; |
|
3065 |
|
3066 if (not valid) then |
|
3067 begin |
|
3068 if (HHGear <> nil) then |
|
3069 begin |
|
3070 HHGear^.Message := HHGear^.Message and (not gmAttack); |
|
3071 HHGear^.State := HHGear^.State and (not gstAttacking); |
|
3072 HHGear^.State := HHGear^.State or gstChooseTarget; |
|
3073 isCursorVisible := true; |
|
3074 end; |
|
3075 DeleteGear(Gear); |
|
3076 PlaySound(sndDenied); |
|
3077 exit; |
|
3078 end; |
|
3079 |
|
3080 if (HHGear <> nil) then |
|
3081 PlaySoundV(sndIncoming, Gear^.Hedgehog^.Team^.voicepack); |
3049 |
3082 |
3050 if Gear^.X.QWordValue = 0 then |
3083 if Gear^.X.QWordValue = 0 then |
3051 begin |
3084 begin |
3052 Gear^.Tag := 1; |
3085 Gear^.Tag := 1; |
3053 Gear^.X := -_2048; |
3086 Gear^.X := -_2048; |
3056 begin |
3089 begin |
3057 Gear^.Tag := -1; |
3090 Gear^.Tag := -1; |
3058 Gear^.X := int2hwFloat(max(LAND_WIDTH,4096) + 2048); |
3091 Gear^.X := int2hwFloat(max(LAND_WIDTH,4096) + 2048); |
3059 end; |
3092 end; |
3060 |
3093 |
3061 Gear^.Y := int2hwFloat(topY-300); |
3094 Gear^.Y := int2hwFloat(planeY); |
3062 Gear^.dX := int2hwFloat(Gear^.Target.X) - int2hwFloat(Gear^.Tag * (Gear^.Health-1) * Gear^.Damage) / 2; |
3095 Gear^.dX := int2hwFloat(Gear^.Target.X) - int2hwFloat(Gear^.Tag * (Gear^.Health-1) * Gear^.Damage) / 2; |
3063 |
3096 |
3064 // calcs for Napalm Strike, so that it will hit the target (without wind at least :P) |
3097 // calcs for Napalm Strike, so that it will hit the target (without wind at least :P) |
3065 if (Gear^.State = 2) then |
3098 if (Gear^.State = 2) then |
3066 Gear^.dX := Gear^.dX - cBombsSpeed * Gear^.Tag * 900 |
3099 Gear^.dX := Gear^.dX - cBombsSpeed * Gear^.Tag * 900 |