425 |
426 |
426 Gear:= Gear^.NextGear |
427 Gear:= Gear^.NextGear |
427 end; |
428 end; |
428 end; |
429 end; |
429 |
430 |
430 function WaterMachine: boolean; |
|
431 const |
|
432 decStep: Longword = 0; |
|
433 LastTurn: LongInt = 0; |
|
434 var i: LongWord; |
|
435 begin |
|
436 if (decStep = 0) and (LastTurn < FinishedTurnsTotal) then |
|
437 begin |
|
438 LastTurn:= FinishedTurnsTotal; |
|
439 decStep:= 40 |
|
440 end; |
|
441 |
|
442 if decStep <> 0 then |
|
443 begin |
|
444 dec(decStep); |
|
445 dec(cWaterLine); |
|
446 for i:= 0 to 2047 do |
|
447 Land[cWaterLine, i]:= 0; |
|
448 SetAllToActive |
|
449 end; |
|
450 |
|
451 WaterMachine:= decStep <> 0; |
|
452 end; |
|
453 |
|
454 procedure AddDamageTag(X, Y, Damage: LongWord; Gear: PGear); |
431 procedure AddDamageTag(X, Y, Damage: LongWord; Gear: PGear); |
455 begin |
432 begin |
456 if cAltDamage then |
433 if cAltDamage then |
457 AddGear(X, Y, gtSmallDamage, Damage, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; |
434 AddGear(X, Y, gtSmallDamage, Damage, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; |
458 end; |
435 end; |
459 |
436 |
460 procedure ProcessGears; |
437 procedure ProcessGears; |
461 const delay: LongWord = 0; |
438 const delay: LongWord = 0; |
462 step: (stDelay, stChDmg, stTurnReact, |
439 step: (stDelay, stChDmg, stTurnReact, |
463 stAfterDelay, stChWin, stWater, stHealth, |
440 stAfterDelay, stChWin, stWater, stChWin2, stHealth, |
464 stSpawn, stNTurn) = stDelay; |
441 stSpawn, stNTurn) = stDelay; |
465 |
442 |
466 var Gear, t: PGear; |
443 var Gear, t: PGear; |
467 begin |
444 begin |
468 PrvInactive:= AllInactive; |
445 PrvInactive:= AllInactive; |
502 dec(delay); |
479 dec(delay); |
503 |
480 |
504 if delay = 0 then |
481 if delay = 0 then |
505 inc(step) |
482 inc(step) |
506 end; |
483 end; |
507 stChWin: if not CheckForWin then |
484 stChWin: begin |
508 begin |
485 CheckForWin; |
509 if not (bBetweenTurns or isInMultiShoot) then |
486 inc(step) |
510 begin |
487 end; |
511 ParseCommand('/nextturn', true); |
|
512 SwitchHedgehog; |
|
513 end; |
|
514 inc(step) |
|
515 end else step:= stDelay; |
|
516 stWater: begin |
488 stWater: begin |
517 if TotalRounds = 17 then bWaterRising:= true; |
489 if TotalRounds = 17 then bWaterRising:= true; |
518 |
490 |
519 if not bWaterRising then |
491 if bWaterRising then |
520 inc(step) |
492 AddGear(0, 0, gtWaterUp, 0, _0, _0, 0); |
521 else |
493 |
522 begin |
494 inc(step) |
523 if delay = 0 then |
495 end; |
524 delay:= 17 |
496 stChWin2: begin |
525 else |
497 CheckForWin; |
526 dec(delay); |
498 inc(step) |
527 |
|
528 if delay = 0 then |
|
529 if not WaterMachine then inc(step) |
|
530 end |
|
531 end; |
499 end; |
532 stHealth: begin |
500 stHealth: begin |
533 if (TotalRounds = 15) and (cHealthDecrease = 0) then |
501 if (TotalRounds = 15) and (cHealthDecrease = 0) then |
534 begin |
502 begin |
535 cHealthDecrease:= 5; |
503 cHealthDecrease:= 5; |