400 |
400 |
401 Gear:= Gear^.NextGear |
401 Gear:= Gear^.NextGear |
402 end; |
402 end; |
403 end; |
403 end; |
404 |
404 |
|
405 function WaterMachine: boolean; |
|
406 const |
|
407 decStep: Longword = 0; |
|
408 LastTurn: LongWord = 0; |
|
409 var i: LongWord; |
|
410 begin |
|
411 if (decStep = 0) and (LastTurn < FinishedTurnsTotal) then |
|
412 begin |
|
413 LastTurn:= FinishedTurnsTotal; |
|
414 decStep:= 40 |
|
415 end; |
|
416 |
|
417 if decStep <> 0 then |
|
418 begin |
|
419 dec(decStep); |
|
420 dec(cWaterLine); |
|
421 for i:= 0 to 2047 do |
|
422 Land[cWaterLine, i]:= 0; |
|
423 SetAllToActive |
|
424 end; |
|
425 |
|
426 WaterMachine:= decStep <> 0; |
|
427 end; |
|
428 |
405 procedure AddDamageTag(X, Y, Damage: LongWord; Gear: PGear); |
429 procedure AddDamageTag(X, Y, Damage: LongWord; Gear: PGear); |
406 begin |
430 begin |
407 if cAltDamage then |
431 if cAltDamage then |
408 AddGear(X, Y, gtSmallDamage, Damage, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; |
432 AddGear(X, Y, gtSmallDamage, Damage, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; |
409 end; |
433 end; |
410 |
434 |
411 procedure ProcessGears; |
435 procedure ProcessGears; |
412 const delay: LongWord = 0; |
436 const delay: LongWord = 0; |
413 step: (stDelay, stChDmg, stTurnReact, |
437 step: (stDelay, stChDmg, stTurnReact, |
414 stAfterDelay, stChWin, stHealth, stSpawn, stNTurn) = stDelay; |
438 stAfterDelay, stChWin, stWater, stHealth, |
|
439 stSpawn, stNTurn) = stDelay; |
415 |
440 |
416 var Gear, t: PGear; |
441 var Gear, t: PGear; |
417 begin |
442 begin |
418 PrvInactive:= AllInactive; |
443 PrvInactive:= AllInactive; |
419 AllInactive:= true; |
444 AllInactive:= true; |
453 |
478 |
454 if delay = 0 then |
479 if delay = 0 then |
455 inc(step) |
480 inc(step) |
456 end; |
481 end; |
457 stChWin: if not CheckForWin then inc(step) else step:= stDelay; |
482 stChWin: if not CheckForWin then inc(step) else step:= stDelay; |
458 stHealth: if (cHealthDecrease = 0) |
483 stWater: begin |
|
484 if GameTicks > 25 * 60 * 1000 then bWaterRising:= true; |
|
485 |
|
486 if not bWaterRising then inc(step); |
|
487 if delay = 0 then |
|
488 delay:= 17 |
|
489 else |
|
490 dec(delay); |
|
491 |
|
492 if delay = 0 then |
|
493 if not WaterMachine then inc(step) |
|
494 end; |
|
495 stHealth: begin |
|
496 if GameTicks > 20 * 60 * 1000 then cHealthDecrease:= 5; |
|
497 |
|
498 if (cHealthDecrease = 0) |
459 or bBetweenTurns |
499 or bBetweenTurns |
460 or isInMultiShoot |
500 or isInMultiShoot |
461 or (FinishedTurnsTotal = 0) then inc(step) |
501 or (FinishedTurnsTotal = 0) then inc(step) |
462 else begin |
502 else begin |
463 bBetweenTurns:= true; |
503 bBetweenTurns:= true; |
464 HealthMachine; |
504 HealthMachine; |
465 step:= stChDmg |
505 step:= stChDmg |
466 end; |
506 end |
|
507 end; |
467 stSpawn: begin |
508 stSpawn: begin |
468 if not isInMultiShoot then SpawnBoxOfSmth; |
509 if not isInMultiShoot then SpawnBoxOfSmth; |
469 inc(step) |
510 inc(step) |
470 end; |
511 end; |
471 stNTurn: begin |
512 stNTurn: begin |