532 if (Gear^.State and gstCollision) <> 0 then |
532 if (Gear^.State and gstCollision) <> 0 then |
533 begin |
533 begin |
534 PlaySound(sndMolotov); |
534 PlaySound(sndMolotov); |
535 gX := hwRound(Gear^.X); |
535 gX := hwRound(Gear^.X); |
536 gY := hwRound(Gear^.Y); |
536 gY := hwRound(Gear^.Y); |
537 for i:= 0 to 2 do |
537 for i:= 0 to 4 do |
538 begin |
538 begin |
539 glass:= AddVisualGear(gx+random(7)-3, gy+random(5)-2, vgtEgg); |
539 (*glass:= AddVisualGear(gx+random(7)-3, gy+random(5)-2, vgtEgg); |
540 if glass <> nil then |
540 if glass <> nil then |
541 begin |
541 begin |
542 glass^.Frame:= 2; |
542 glass^.Frame:= 2; |
543 glass^.Tint:= $41B83ED0 - i * $10081000; |
543 glass^.Tint:= $41B83ED0 - i * $10081000; |
544 glass^.dX:= 1/(10*(random(11)-5)); |
544 glass^.dX:= 1/(10*(random(11)-5)); |
545 glass^.dY:= -1/(random(4)+5); |
545 glass^.dY:= -1/(random(4)+5); |
546 end; |
546 end;*) |
|
547 glass:= AddVisualGear(gx+random(7)-3, gy+random(7)-3, vgtStraightShot); |
|
548 if glass <> nil then |
|
549 with glass^ do |
|
550 begin |
|
551 Frame:= 2; |
|
552 Tint:= $41B83ED0 - i * $10081000; |
|
553 Angle:= random * 360; |
|
554 dx:= 0.0000001; |
|
555 dy:= 0; |
|
556 if random(2) = 0 then dx := -dx; |
|
557 FrameTicks:= 750; |
|
558 State:= ord(sprEgg) |
|
559 end; |
547 end; |
560 end; |
548 for i:= 0 to 24 do |
561 for i:= 0 to 24 do |
549 begin |
562 begin |
550 dX := AngleCos(i * 2) * ((_0_15*(i div 5))) * (GetRandom + _1); |
563 dX := AngleCos(i * 2) * ((_0_15*(i div 5))) * (GetRandom + _1); |
551 dY := AngleSin(i * 8) * _0_5 * (GetRandom + _1); |
564 dY := AngleSin(i * 8) * _0_5 * (GetRandom + _1); |
1100 end; |
1113 end; |
1101 |
1114 |
1102 procedure doStepDEagleShot(Gear: PGear); |
1115 procedure doStepDEagleShot(Gear: PGear); |
1103 begin |
1116 begin |
1104 PlaySound(sndGun); |
1117 PlaySound(sndGun); |
1105 // add 2 initial steps to avoid problem with ammoshove related to calculation of radius + 1 radius as gear widths |
1118 // add 3 initial steps to avoid problem with ammoshove related to calculation of radius + 1 radius as gear widths, and also just plain old weird angles |
1106 Gear^.X := Gear^.X + Gear^.dX * 2; |
1119 Gear^.X := Gear^.X + Gear^.dX * 3; |
1107 Gear^.Y := Gear^.Y + Gear^.dY * 2; |
1120 Gear^.Y := Gear^.Y + Gear^.dY * 3; |
1108 Gear^.doStep := @doStepBulletWork |
1121 Gear^.doStep := @doStepBulletWork |
1109 end; |
1122 end; |
1110 |
1123 |
1111 procedure doStepSniperRifleShot(Gear: PGear); |
1124 procedure doStepSniperRifleShot(Gear: PGear); |
1112 var |
1125 var |
1136 end; |
1149 end; |
1137 Gear^.State := Gear^.State or gstAnimation; |
1150 Gear^.State := Gear^.State or gstAnimation; |
1138 Gear^.dX := SignAs(AngleSin(HHGear^.Angle), HHGear^.dX) * _0_5; |
1151 Gear^.dX := SignAs(AngleSin(HHGear^.Angle), HHGear^.dX) * _0_5; |
1139 Gear^.dY := -AngleCos(HHGear^.Angle) * _0_5; |
1152 Gear^.dY := -AngleCos(HHGear^.Angle) * _0_5; |
1140 PlaySound(sndGun); |
1153 PlaySound(sndGun); |
1141 // add an initial step to avoid problem with ammoshove related to calculation of radius + 1 radius as gear widths |
1154 // add 3 initial steps to avoid problem with ammoshove related to calculation of radius + 1 radius as gear widths, and also just weird angles |
1142 Gear^.X := Gear^.X + Gear^.dX; |
1155 Gear^.X := Gear^.X + Gear^.dX * 3; |
1143 Gear^.Y := Gear^.Y + Gear^.dY; |
1156 Gear^.Y := Gear^.Y + Gear^.dY * 3; |
1144 Gear^.doStep := @doStepBulletWork; |
1157 Gear^.doStep := @doStepBulletWork; |
1145 end |
1158 end |
1146 else |
1159 else |
1147 if (GameTicks mod 32) = 0 then |
1160 if (GameTicks mod 32) = 0 then |
1148 if (GameTicks mod 4096) < 2048 then |
1161 if (GameTicks mod 4096) < 2048 then |
2798 Gear^.X := HHGear^.X; |
2811 Gear^.X := HHGear^.X; |
2799 Gear^.Y := HHGear^.Y; |
2812 Gear^.Y := HHGear^.Y; |
2800 if (GameTicks mod 2 = 0) and hasWishes then |
2813 if (GameTicks mod 2 = 0) and hasWishes then |
2801 begin |
2814 begin |
2802 sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1); |
2815 sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1); |
2803 if sparkles <> nil then sparkles^.Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF; |
2816 if sparkles <> nil then |
|
2817 begin |
|
2818 sparkles^.Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF; |
|
2819 sparkles^.Angle:= random * 360; |
|
2820 end |
2804 end; |
2821 end; |
2805 |
2822 |
2806 i := 2; |
2823 i := 2; |
2807 repeat |
2824 repeat |
2808 |
2825 |
2843 end; |
2860 end; |
2844 |
2861 |
2845 if Gear^.Health < Gear^.Damage then |
2862 if Gear^.Health < Gear^.Damage then |
2846 begin |
2863 begin |
2847 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound); |
2864 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound); |
|
2865 for i:= 0 to 31 do |
|
2866 begin |
|
2867 sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtStraightShot); |
|
2868 if sparkles <> nil then |
|
2869 with sparkles^ do |
|
2870 begin |
|
2871 Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF; |
|
2872 Angle:= random * 360; |
|
2873 dx:= 0.001 * (random(200)); |
|
2874 dy:= 0.001 * (random(200)); |
|
2875 if random(2) = 0 then dx := -dx; |
|
2876 if random(2) = 0 then dy := -dy; |
|
2877 FrameTicks:= random(400) + 250 |
|
2878 end; |
|
2879 end; |
2848 AfterAttack; |
2880 AfterAttack; |
2849 DeleteGear(Gear); |
2881 DeleteGear(Gear); |
2850 DeleteGear(HHGear); |
2882 DeleteGear(HHGear); |
2851 end |
2883 end |
2852 else |
2884 else |
2859 procedure doStepKamikazeIdle(Gear: PGear); |
2891 procedure doStepKamikazeIdle(Gear: PGear); |
2860 begin |
2892 begin |
2861 AllInactive := false; |
2893 AllInactive := false; |
2862 dec(Gear^.Timer); |
2894 dec(Gear^.Timer); |
2863 if Gear^.Timer = 0 then |
2895 if Gear^.Timer = 0 then |
2864 begin |
2896 begin |
2865 Gear^.Pos := 1; |
2897 Gear^.Pos := 1; |
2866 PlaySound(sndKamikaze, Gear^.Hedgehog^.Team^.voicepack); |
2898 PlaySound(sndKamikaze, Gear^.Hedgehog^.Team^.voicepack); |
2867 Gear^.doStep := @doStepKamikazeWork |
2899 Gear^.doStep := @doStepKamikazeWork |
2868 end |
2900 end |
2869 end; |
2901 end; |
2870 |
2902 |
2871 procedure doStepKamikaze(Gear: PGear); |
2903 procedure doStepKamikaze(Gear: PGear); |
2872 var |
2904 var |
2873 HHGear: PGear; |
2905 HHGear: PGear; |
4143 // You're now officially portaled! |
4175 // You're now officially portaled! |
4144 // |
4176 // |
4145 |
4177 |
4146 // Until loops are reliably broken |
4178 // Until loops are reliably broken |
4147 if iscake then iterator^.PortalCounter:= 33 |
4179 if iscake then iterator^.PortalCounter:= 33 |
4148 else inc(iterator^.PortalCounter); |
4180 else |
|
4181 begin |
|
4182 inc(iterator^.PortalCounter); |
|
4183 iterator^.State:= iterator^.State and not gstHHHJump |
|
4184 end; |
4149 |
4185 |
4150 if not isbullet and (iterator^.Kind <> gtFlake) then |
4186 if not isbullet and (iterator^.Kind <> gtFlake) then |
4151 FollowGear := iterator; |
4187 FollowGear := iterator; |
4152 |
4188 |
4153 // store X/Y values of exit for net bullet trail |
4189 // store X/Y values of exit for net bullet trail |
5068 StopSound(Gear^.SoundChannel); |
5104 StopSound(Gear^.SoundChannel); |
5069 if (Gear^.Timer = 0) then |
5105 if (Gear^.Timer = 0) then |
5070 begin |
5106 begin |
5071 if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible = 0) then |
5107 if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible = 0) then |
5072 begin |
5108 begin |
5073 AfterAttack; |
5109 AfterAttack; |
5074 if Gear = CurAmmoGear then CurAmmoGear := nil; |
5110 if Gear = CurAmmoGear then CurAmmoGear := nil; |
5075 HideHog(HH) |
5111 HideHog(HH) |
5076 end |
5112 end |
5077 //else if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible <> 0) then |
5113 //else if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible <> 0) then |
5078 else if (HH^.GearHidden <> nil) then// and (HH^.Gear^.State and gstInvisible <> 0) then |
5114 else if (HH^.GearHidden <> nil) then// and (HH^.Gear^.State and gstInvisible <> 0) then |
5085 Gear^.SoundChannel := LoopSound(sndTardis); |
5121 Gear^.SoundChannel := LoopSound(sndTardis); |
5086 Gear^.Pos:= 3 |
5122 Gear^.Pos:= 3 |
5087 end |
5123 end |
5088 end; |
5124 end; |
5089 |
5125 |
5090 if (Gear^.Pos = 1) and (GameTicks and $1F = 0) and (Gear^.Power < 255) then inc(Gear^.Power); |
5126 if (Gear^.Pos = 1) and (GameTicks and $1F = 0) and (Gear^.Power < 255) then |
|
5127 begin |
|
5128 inc(Gear^.Power); |
|
5129 if (Gear^.Power = 172) and (Gear^.Hedgehog^.Gear <> nil) then |
|
5130 begin |
|
5131 with Gear^.Hedgehog^.Gear^ do |
|
5132 begin |
|
5133 State:= State or gstAnimation; |
|
5134 Tag:= 2; |
|
5135 Timer:= 0; |
|
5136 Pos:= 0 |
|
5137 end |
|
5138 end |
|
5139 end; |
5091 if (Gear^.Pos = 3) and (GameTicks and $1F = 0) and (Gear^.Power > 0) then dec(Gear^.Power); |
5140 if (Gear^.Pos = 3) and (GameTicks and $1F = 0) and (Gear^.Power > 0) then dec(Gear^.Power); |
5092 if (Gear^.Pos = 1) and (Gear^.Power = 255) and ((GameTicks mod 2000) = 1000) then Gear^.Pos:= 2; |
5141 if (Gear^.Pos = 1) and (Gear^.Power = 255) and ((GameTicks mod 2000) = 1000) then Gear^.Pos:= 2; |
5093 if (Gear^.Pos = 3) and (Gear^.Power = 0) then |
5142 if (Gear^.Pos = 3) and (Gear^.Power = 0) then |
5094 begin |
5143 begin |
5095 StopSound(Gear^.SoundChannel); |
5144 StopSound(Gear^.SoundChannel); |