changeset 3407 | dcc129c4352e |
parent 3406 | f4bdebced042 |
child 3408 | 56e636b83cb4 |
3406:f4bdebced042 | 3407:dcc129c4352e |
---|---|
3040 end; |
3040 end; |
3041 end; |
3041 end; |
3042 |
3042 |
3043 //////////////////////////////////////////////////////////////////////////////// |
3043 //////////////////////////////////////////////////////////////////////////////// |
3044 procedure doStepPortal(Gear: PGear); |
3044 procedure doStepPortal(Gear: PGear); |
3045 var tmpGear, iterator: PGear; |
3045 var iterator: PGear; |
3046 begin |
3046 begin |
3047 if (Land[hwRound(Gear^.Y), hwRound(Gear^.X)] and $FF00) = 0 then DeleteGear(Gear); |
3047 if (Land[hwRound(Gear^.Y), hwRound(Gear^.X)] and $FF00) = 0 then DeleteGear(Gear); |
3048 if not AllInactive and (Gear^.IntersectGear <> nil) then |
3048 if not AllInactive and (Gear^.IntersectGear <> nil) then |
3049 //if (Gear^.IntersectGear <> nil) then |
3049 //if (Gear^.IntersectGear <> nil) then |
3050 begin |
3050 begin |
3079 begin |
3079 begin |
3080 Gear^.X:= Gear^.X + Gear^.dX; |
3080 Gear^.X:= Gear^.X + Gear^.dX; |
3081 Gear^.Y:= Gear^.Y + Gear^.dY; |
3081 Gear^.Y:= Gear^.Y + Gear^.dY; |
3082 x:= hwRound(Gear^.X); |
3082 x:= hwRound(Gear^.X); |
3083 y:= hwRound(Gear^.Y); |
3083 y:= hwRound(Gear^.Y); |
3084 tx:= 0; ty:= 0; // avoid compiler hints |
|
3084 |
3085 |
3085 if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) and ((Land[y, x] and $FF00) <> 0) then |
3086 if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) and ((Land[y, x] and $FF00) <> 0) then |
3086 begin |
3087 begin |
3087 if not calcSlopeNormal(Gear, x, y, tx, ty, 255) then |
3088 if not calcSlopeNormal(Gear, x, y, tx, ty, 255) then |
3088 begin |
3089 begin |
3216 end; |
3217 end; |
3217 |
3218 |
3218 |
3219 |
3219 //////////////////////////////////////////////////////////////////////////////// |
3220 //////////////////////////////////////////////////////////////////////////////// |
3220 procedure doStepSineGunShotWork(Gear: PGear); |
3221 procedure doStepSineGunShotWork(Gear: PGear); |
3221 var x, y, rX, rY, t, tmp, initHealth: LongWord; |
3222 var x, y, rX, rY, t, tmp, initHealth: LongInt; |
3222 oX, oY, ldX, ldY, sdX, sdY, sine, lx, ly, amp: hwFloat; |
3223 oX, oY, ldX, ldY, sdX, sdY, sine, lx, ly, amp: hwFloat; |
3223 justCollided: boolean; |
3224 justCollided: boolean; |
3224 begin |
3225 begin |
3225 AllInactive:= false; |
3226 AllInactive:= false; |
3226 initHealth:= Gear^.Health; |
3227 initHealth:= Gear^.Health; |
3302 dec(Gear^.Health, Gear^.Damage); |
3303 dec(Gear^.Health, Gear^.Damage); |
3303 Gear^.Damage:= 0; |
3304 Gear^.Damage:= 0; |
3304 |
3305 |
3305 // add some fire to the tunnel |
3306 // add some fire to the tunnel |
3306 if getRandom(6) = 0 then |
3307 if getRandom(6) = 0 then |
3307 AddGear(x-Gear^.Radius+getRandom(2*Gear^.Radius), y-getRandom(Gear^.Radius+1), gtFlame, gsttmpFlag, _0, _0, 0); |
3308 AddGear(x - Gear^.Radius + LongInt(getRandom(2 * Gear^.Radius)), y - getRandom(Gear^.Radius + 1), gtFlame, gsttmpFlag, _0, _0, 0); |
3308 end; |
3309 end; |
3309 |
3310 |
3310 if getRandom(100) = 0 then |
3311 if getRandom(100) = 0 then |
3311 AddGear(x, y, gtSmokeTrace, 0, _0, _0, 0); |
3312 AddGear(x, y, gtSmokeTrace, 0, _0, _0, 0); |
3312 |
3313 |