Данная процедура будет просчитывать урон, который герой наносит и монстрам и его промахи
procedure UronMonstram(ix,iy,uron:Integer); var bah:Integer; begin
if (Karta.monsters[ix,iy,2]<>0) and (monsters[Karta.monsters[ix,iy,2]].Visible=true) then begin
if (Monsters[ Karta.monsters[ix,iy,2] ].health>0) then begin Player.udaril:=true; //raschet udara randomize; bah:=random(Player.tochnost_udara+ Monsters[ Karta.monsters[ix,iy,2] ].lovkost)+1;
//esli promazal if bah>Player.tochnost_udara then begin Pik.buf.Canvas.Draw(Monsters[ Karta.monsters[ix,iy,2] ].x-Karta.mx+20, Monsters[ Karta.monsters[ix,iy,2] ].y-Karta.my-30,Pik.soobsheniya[1]); end;
//esli popal if bah<=Player.tochnost_udara then begin Player.udaril:=true;
if uron<10 then Pik.buf.Canvas.Draw(Monsters[ Karta.monsters[ix,iy,2] ].x-Karta.mx+20, Monsters[ Karta.monsters[ix,iy,2] ].y-Karta.my-30, Pik.uron[uron,1]);
if (uron>=10) and (uron<100) then begin Pik.buf.Canvas.Draw(Monsters[ Karta.monsters[ix,iy,2] ].x-Karta.mx+20, Monsters[ Karta.monsters[ix,iy,2] ].y-Karta.my-30,Pik.uron[round(uron div 10),1]); Pik.buf.Canvas.Draw(Monsters[ Karta.monsters[ix,iy,2] ].x-Karta.mx+45, Monsters[ Karta.monsters[ix,iy,2] ].y-Karta.my-30,Pik.uron[round(uron mod 10),1]); end;
if (uron>=100) then begin Pik.buf.Canvas.Draw(Monsters[ Karta.monsters[ix,iy,2] ].x-Karta.mx, Monsters[ Karta.monsters[ix,iy,2] ].y-Karta.my-30,Pik.uron[round(uron div 100),1]); Pik.buf.Canvas.Draw(Monsters[ Karta.monsters[ix,iy,2] ].x-Karta.mx+25, Monsters[ Karta.monsters[ix,iy,2] ].y-Karta.my-30,Pik.uron[round(uron mod 10),1]); Pik.buf.Canvas.Draw(Monsters[ Karta.monsters[ix,iy,2] ].x-Karta.mx+50, Monsters[ Karta.monsters[ix,iy,2] ].y-Karta.my-30,Pik.uron[round(uron mod 100),1]); end;