425 |
425 |
426 //////////////////////////////////////////////////////////////////////////////// |
426 //////////////////////////////////////////////////////////////////////////////// |
427 |
427 |
428 procedure doStepBlowTorchWork(Gear: PGear); |
428 procedure doStepBlowTorchWork(Gear: PGear); |
429 var HHGear: PGear; |
429 var HHGear: PGear; |
|
430 yy: Double; |
430 begin |
431 begin |
431 AllInactive:= false; |
432 AllInactive:= false; |
432 dec(Gear.Timer); |
433 dec(Gear.Timer); |
433 HHGear:= PHedgehog(Gear.Hedgehog).Gear; |
434 HHGear:= PHedgehog(Gear.Hedgehog).Gear; |
434 |
435 |
435 HedgehogChAngle(HHGear); |
436 HedgehogChAngle(HHGear); |
436 |
437 |
437 if Gear.Timer mod cHHStepTicks = 0 then |
438 if Gear.Timer mod cHHStepTicks = 0 then |
438 begin |
439 begin |
439 DrawTunnel(HHGear.X, HHGear.Y - 3, |
440 yy:= Cos(HHGear.Angle*pi/cMaxAngle) * (-0.5); |
440 Gear.dX, Cos(HHGear.Angle*pi/cMaxAngle) * (-0.5), |
441 DrawTunnel(HHGear.X, HHGear.Y - 2 + yy * cHHRadius, |
441 cHHRadius * 3, cHHRadius * 2 + 4); |
442 Gear.dX, yy, |
|
443 cHHRadius * 3, cHHRadius * 2 + 2); |
442 if Gear.dX < 0 then HHGear.Message:= (HHGear.Message or gm_Left) and not gm_Right |
444 if Gear.dX < 0 then HHGear.Message:= (HHGear.Message or gm_Left) and not gm_Right |
443 else HHGear.Message:= (HHGear.Message or gm_Right) and not gm_Left; |
445 else HHGear.Message:= (HHGear.Message or gm_Right) and not gm_Left; |
444 HedgehogStep(HHGear); |
446 HedgehogStep(HHGear); |
445 if (HHGear.State and gstFalling) <> 0 then Gear.Timer:= 0 |
447 if (HHGear.State and gstFalling) <> 0 then Gear.Timer:= 0 |
446 end; |
448 end; |
447 |
449 |
448 if Gear.Timer = 0 then |
450 if (Gear.Timer = 0) or ((HHGear.Message and gm_Attack) <> 0) then |
449 begin |
451 begin |
450 HHGear.Message:= 0; |
452 HHGear.Message:= 0; |
451 DeleteGear(Gear); |
453 DeleteGear(Gear); |
452 AfterAttack |
454 AfterAttack |
453 end |
455 end |
456 procedure doStepBlowTorch(Gear: PGear); |
458 procedure doStepBlowTorch(Gear: PGear); |
457 var HHGear: PGear; |
459 var HHGear: PGear; |
458 begin |
460 begin |
459 HHGear:= PHedgehog(Gear.Hedgehog).Gear; |
461 HHGear:= PHedgehog(Gear.Hedgehog).Gear; |
460 HHGear.State:= HHGear.State and not gstAttacking; |
462 HHGear.State:= HHGear.State and not gstAttacking; |
|
463 HHGear.Message:= 0; |
461 Gear.doStep:= doStepBlowTorchWork |
464 Gear.doStep:= doStepBlowTorchWork |
462 end; |
465 end; |
463 |
466 |
464 //////////////////////////////////////////////////////////////////////////////// |
467 //////////////////////////////////////////////////////////////////////////////// |
465 |
468 |