equal
deleted
inserted
replaced
640 function TestTeleport(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; |
640 function TestTeleport(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt; |
641 var |
641 var |
642 i, failNum: longword; |
642 i, failNum: longword; |
643 begin |
643 begin |
644 FillBonuses(true, [gtCase]); |
644 FillBonuses(true, [gtCase]); |
645 if bonuses.Count = 0 then |
645 if bonuses.Count = 0 then begin |
646 TestTeleport := BadTurn |
646 if Me^.Health <= 100 then begin |
|
647 ap.AttackPutX := Targ.X; |
|
648 ap.AttackPutY := topY + cHHRadius*2; |
|
649 TestTeleport := Targ.Y - topY; |
|
650 end |
|
651 else |
|
652 TestTeleport := BadTurn; |
|
653 end |
647 else begin |
654 else begin |
648 failNum := 0; |
655 failNum := 0; |
649 repeat |
656 repeat |
650 i := random(bonuses.Count); |
657 i := random(bonuses.Count); |
651 inc(failNum); |
658 inc(failNum); |