60 |
60 |
61 var skipFlag: boolean; |
61 var skipFlag: boolean; |
62 |
62 |
63 var delay: LongWord; |
63 var delay: LongWord; |
64 delay2: LongWord; |
64 delay2: LongWord; |
65 step: (stInit, stDelay, stChDmg, stSweep, stTurnStats, stChWin1, |
65 step: (stInit, stDelay1, stChDmg, stSweep, stTurnStats, stChWin1, |
66 stTurnReact, stAfterDelay, stChWin2, stWater, stChWin3, |
66 stTurnReact, stDelay2, stChWin2, stWater, stChWin3, |
67 stChKing, stHealth, stSpawn, stNTurn); |
67 stChKing, stSuddenDeath, stDelay3, stHealth, stSpawn, stDelay4, |
|
68 stNTurn); |
68 NewTurnTick: LongWord; |
69 NewTurnTick: LongWord; |
69 //SDMusic: shortstring; |
70 //SDMusic: shortstring; |
|
71 |
|
72 const delaySDStart = 1600; |
|
73 delaySDWarning = 1000; |
|
74 delayDamageTag = 500; |
|
75 delayTurnReact = 1500; |
|
76 delayFinal = 100; |
70 |
77 |
71 function CheckNoDamage: boolean; // returns TRUE in case of no damaged hhs |
78 function CheckNoDamage: boolean; // returns TRUE in case of no damaged hhs |
72 var Gear: PGear; |
79 var Gear: PGear; |
73 dmg: LongInt; |
80 dmg: LongInt; |
74 begin |
81 begin |
389 if (not isInMultiShoot) and (CheckMinionsDie) then |
394 if (not isInMultiShoot) and (CheckMinionsDie) then |
390 step:= stChDmg |
395 step:= stChDmg |
391 else |
396 else |
392 inc(step); |
397 inc(step); |
393 end; |
398 end; |
394 stHealth: |
399 stSuddenDeath: |
395 begin |
400 begin |
396 if (cWaterRise <> 0) or (cHealthDecrease <> 0) then |
401 if (cWaterRise <> 0) or (cHealthDecrease <> 0) then |
397 begin |
402 begin |
398 if (TotalRoundsPre = cSuddenDTurns) and (not SuddenDeath) and (not isInMultiShoot) then |
403 if (TotalRoundsPre = cSuddenDTurns) and (not SuddenDeath) and (not isInMultiShoot) then |
399 StartSuddenDeath() |
404 begin |
|
405 StartSuddenDeath(); |
|
406 delay:= delaySDStart; |
|
407 end |
400 else if (TotalRoundsPre < cSuddenDTurns) and (not isInMultiShoot) then |
408 else if (TotalRoundsPre < cSuddenDTurns) and (not isInMultiShoot) then |
401 begin |
409 begin |
402 i:= cSuddenDTurns - TotalRoundsPre; |
410 i:= cSuddenDTurns - TotalRoundsPre; |
403 s:= ansistring(inttostr(i)); |
411 s:= ansistring(inttostr(i)); |
404 if i = 1 then |
412 if i = 1 then |
405 AddCaption(trmsg[sidRoundSD], capcolDefault, capgrpGameState) |
413 begin |
|
414 AddCaption(trmsg[sidRoundSD], capcolDefault, capgrpGameState); |
|
415 delay:= delaySDWarning; |
|
416 end |
406 else if (i = 2) or ((i > 0) and ((i mod 50 = 0) or ((i <= 25) and (i mod 5 = 0)))) then |
417 else if (i = 2) or ((i > 0) and ((i mod 50 = 0) or ((i <= 25) and (i mod 5 = 0)))) then |
|
418 begin |
407 AddCaption(FormatA(trmsg[sidRoundsSD], s), capcolDefault, capgrpGameState); |
419 AddCaption(FormatA(trmsg[sidRoundsSD], s), capcolDefault, capgrpGameState); |
|
420 delay:= delaySDWarning; |
|
421 end |
408 end; |
422 end; |
409 end; |
423 inc(step); |
410 if bBetweenTurns |
424 end |
411 or isInMultiShoot |
425 else |
412 or (TotalRoundsPre = -1) then |
426 inc(step, 2); |
413 inc(step) |
427 end; |
414 else |
428 stDelay3: |
415 begin |
429 if DoDelay() then |
416 bBetweenTurns:= true; |
430 inc(step); |
417 HealthMachine; |
431 stHealth: |
418 step:= stChDmg |
432 begin |
419 end |
433 if bBetweenTurns |
420 end; |
434 or isInMultiShoot |
|
435 or (TotalRoundsPre = -1) then |
|
436 inc(step) |
|
437 else |
|
438 begin |
|
439 bBetweenTurns:= true; |
|
440 HealthMachine; |
|
441 step:= stChDmg |
|
442 end; |
|
443 end; |
421 stSpawn: |
444 stSpawn: |
422 begin |
445 begin |
423 if not isInMultiShoot then |
446 if (not isInMultiShoot) then |
|
447 begin |
424 SpawnBoxOfSmth; |
448 SpawnBoxOfSmth; |
425 inc(step) |
449 delay:= delayFinal; |
426 end; |
450 inc(step); |
|
451 end |
|
452 else |
|
453 inc(step, 2) |
|
454 end; |
|
455 stDelay4: |
|
456 if DoDelay() then |
|
457 inc(step); |
427 stNTurn: |
458 stNTurn: |
428 begin |
459 begin |
429 if isInMultiShoot then |
460 if isInMultiShoot then |
430 isInMultiShoot:= false |
461 isInMultiShoot:= false |
431 else |
462 else |