Make your own free website on Tripod.com
=MaxCreature;End;functionTForm1.NewSBullet:SmallInt;vari:SmallInt;Oke:Boolean;Temp:PSBullet;BeginOke:=False;i:=0;Repeatinc(i
);If(AllPtrSBullet[i]<>nil)and(notAllPtrSBullet[i]^.Exist)thenOke:=True;IfAllPtrSBullet[i]=nilthenBeginNew(Temp);Fillchar(Te
mp^,Sizeof(Temp^),0);AllPtrSBullet[i]:=Temp;Oke:=True;End;Until(i=MaxSBullet)or(Oke);IfOkethenNewSBullet:=ielseNewSBullet:=M
axSBullet;End;FunctionTForm1.NewSPEffect:SmallInt;vari:SmallInt;Oke:Boolean;Temp:PtrSPEffect;BeginOke:=False;i:=0;Repeatinc(
i);If(AllPtrSPEffect[i]<>nil)and(notAllPtrSPEffect[i]^.Exist)thenOke:=True;IfAllPtrSPEffect[i]=nilthenBeginNew(Temp);Fillcha
r(Temp^,Sizeof(Temp^),0);AllPtrSPEffect[i]:=Temp;Oke:=True;End;Until(i=MaxSPEffect)or(Oke);IfOkethenNewSPEffect:=ielseNewSPE
ffect:=MaxSPEffect;End;procedureTform1.NewSpecialEffect(Idx:Byte;x,y:SmallInt);varn:SmallInt;Beginn:=NewSPEffect;AllPtrSPEff
ect[n]^.Exist:=True;AllPtrSPEffect[n]^.TileX:=x;AllPtrSPEffect[n]^.TileY:=Y;WithAllPtrSPEffect[n]^.EffectdoBeginExist:=True;
SpdEffect:=1+Random(3);MakeSound(4,xdiv40,ydiv40);CaseIdxof1:BeginIDEffect:=21;CurEffect:=21;MaxEffect:=1;CtrLoop:=1;TxEffec
t:=-25;TyEffect:=-22;End;2:BeginIDEffect:=15;CurEffect:=15;CtrLoop:=1;MaxEffect:=1;TxEffect:=-45;TyEffect:=-35;End;3:BeginID
Effect:=17;CurEffect:=17;CtrLoop:=1;MaxEffect:=5;TxEffect:=-25;TyEffect:=-22;End;4:BeginIDEffect:=11;CurEffect:=11;CtrLoop:=
1;MaxEffect:=5;TxEffect:=-45;TyEffect:=-35;End;5:BeginIDEffect:=3;CurEffect:=3;CtrLoop:=1+Random(20);MaxEffect:=2;TxEffect:=
-17;TyEffect:=-40;End;6:BeginIDEffect:=23;CurEffect:=23;CtrLoop:=1;MaxEffect:=2;TxEffect:=-30;TyEffect:=-28;End;End;End;End;
ProcedureTForm1.NewSpecialBullet(Ptr:PObjCreature;x,y:SmallInt);varn,i:SmallInt;Beginn:=NewSBullet;move(AllSBulet[Ptr^.Bull.
Ammomod20],AllPtrSBullet[n]^,sizeof(AllSBulet[1]));AllPtrSBullet[n]^.ExplodeRange:=Ptr^.Bull.Ammodiv20;AllPtrSBullet[n]^.Exi
st:=True;AllPtrSBullet[n]^.Target:=Ptr^.Target;AllPtrSBullet[n]^.From:=Ptr;AllPtrSBullet[n]^.Ammo:=Ptr^.Bull.Ammo-10;AllPtrS
Bullet[n]^.Power:=Ptr^.Bull.Power;AllPtrSBullet[n]^.Speed:=Ptr^.Bull.Speed;Fori:=1toAllPtrSBullet[n]^.OmnidoBeginAllPtrSBull
et[n]^.TileX[i]:=X-AllPtrSBullet[n]^.Widthdiv2;AllPtrSBullet[n]^.TileY[i]:=Y-AllPtrSBullet[n]^.Heightdiv2;IfAllPtrSBullet[n]
^.TileY[i]<>0thenAllCreature[n]^.CurBlood:=BloodelseAllCreature[n]^.CurBlood:=AllCreature[n]^.MaxBlood;Tiles[AllCreature[n]^
.MapX,AllCreature[n]^.MapY]:=AllCreature[n];ToBigMap(AllCreature[n],True);BigMap.Map.Canvas.Release;End;procedureTForm1.NewD
elivery(Side:Byte);varn,x,y:SmallInt;L1,L2:real;BeginDelAppear[Side]:=0;n:=NewCreature;AllCreature[n]^.Infinite.UnTouchable:
=True;AllCreature[n]^.TypeCreature:=7;AllCreature[n]^.ClassCreature:=3;AllCreature[n]^.BelongTo:=Side;AllCreature[n]^.Genera
lTask:=0;AllCreature[n]^.Idx:=1;AllCreature[n]^.Id:=9999;AllCreature[n]^.Armor:=255;AllCreature[n]^.CurBlood:=20;AllCreature
[n]^.MaxBlood:=20;AllCreature[n]^.Moving:=True;AllCreature[n]^.ActTask1:=0;AllCreature[n]^.ActTask2:=0;AllCreature[n]^.ActTa
sk3:=MaxDelayDelivery-25;AllCreature[n]^.Speed:=3;AllCreature[n]^.Active:=False;AllCreature[n]^.TileX:=-10;AllCreature[n]^.T
ileY:=-13;AllCreature[n]^.UseAs:=0;AllCreature[n]^.Prior:=0;y:=-1;L1:=3500;RepeatInc(y);L2:=Distance(SiloX[Side],SiloY[Side]
,TileSize,y*TileSize);If(L21200thenRepeatInc(x);L2:=Distance(SiloX[Side],SiloY[Side],x*TileSize,TileSize);If(L2<>0thenAllCre
ature[n]^.CurBlood:=BloodelseAllCreature[n]^.CurBlood:=AllCreature[n]^.MaxBlood;ifPtrzzz=nilthenPtrzzz:=AllCreature[n];End;p
rocedureTForm1.Scr1Initialize(Sender:TObject);ProcedureInitPicture;vari,j,k,l,x,y,w,z,x1,y1,x2,y2,a,b,c,whonow,u:SmallInt;s1
,s2,s3,stemp:string;_who,idxRep:array[1..2]ofbyte;Fz:Fileofchar;ch:char;Seen:MapPosition;f,f2:textfile;Ptr:Array[1..3]ofPObj
Creature;PtrDummy:PObjCreature;BeginMM.MenuVisible:=False;EnemyRetreat:=False;PlayerRetreat:=False;PlayerQuit:=False;EnemyLo
ose:=False;PlayerLoose:=False;TimeExpired:=0;PtrZZZ:=Nil;zzz:=0;Debugers:=False;EnemyTurn:=5;EnemyWait:=0;OtherTime:=0;PtrTa
rgetUnit:=Nil;PtrTarget:=Nil;PtrDummy:=Nil;Forj:=1toMaxMosGroupdoFori:=1to10doMosGroup[j].ArrMos[i]:=Nil;Fori:=1to30doBeginM
M.BtMenu[i].Visible:=False;MM.BtMenu[i].Enable:=True;End;MM.BtMenu[1].Title:='[MainBattleMenu]';MM.BtMenu[1].PosX:=230;MM.Bt
Menu[1].PosY:=145;MM.BtMenu[2].Title:='[ExitProgram]';MM.BtMenu[2].PosX:=250;MM.BtMenu[2].PosY:=145;MM.BtMenu[3].Title:='Exi
tProgram';MM.BtMenu[3].PosX:=250;MM.BtMenu[3].PosY:=175;MM.BtMenu[4].Title:='[CancelAttack]';MM.BtMenu[4].PosX:=245;MM.BtMen
u[4].PosY:=145;MM.BtMenu[5].Title:='CancelAttack';MM.BtMenu[5].PosX:=250;MM.BtMenu[5].PosY:=195;MM.BtMenu[6].Title:='[Retrea
t]';MM.BtMenu[6].PosX:=265;MM.BtMenu[6].PosY:=145;MM.BtMenu[7].Title:='Retreat';MM.BtMenu[7].PosX:=250;MM.BtMenu[7].PosY:=19
5;MM.BtMenu[21].Title:='Areyousure?';MM.BtMenu[21].PosX:=250;MM.BtMenu[21].PosY:=205;MM.BtMenu[22].Title:='Yes';MM.BtMenu[22
].PosX:=235;MM.BtMenu[22].PosY:=265;MM.BtMenu[23].Title:='No!';MM.BtMenu[23].PosX:=365;MM.BtMenu[23].PosY:=265;MM.BtMenu[24]
.Title:='Ok';MM.BtMenu[24].PosX:=365;MM.BtMenu[24].PosY:=265;Fori:=1to30doBeginMM.BtMenu[i].PosX2:=MM.BtMenu[i].PosX+Length(
MM.BtMenu[i].Title)*9;MM.BtMenu[i].PosY2:=MM.BtMenu[i].PosY+13;End;fori:=1to3doBeginSilox[i]:=0;CreaCount[i]:=0;FillChar(Upg
rade[i],SizeOf(Upgrade[i]),0);End;fori:=1toMaxTaskBuilddoTaskBuild[i].BelongTo:=0;TempImage:=TImage.Create(Self);Scr1.Create
Surface(TempSurf,800,480);Scr1.CreateSurface(BigMap.Map,MapMaxX,MapMaxY);BigMap.Map.Canvas.Brush.Color:=ClBlack;BigMap.Map.C
anvas.FillRect(Rect(0,0,MapMaxX,MapMaxY));BigMap.Map.Canvas.Release;Scr1.CreateSurface(BigMap.ShadowMap,MapMaxX,MapMaxY);Big
Map.ShadowMap.Canvas.Brush.Color:=$101010;BigMap.ShadowMap.Canvas.FillRect(Rect(0,0,MapMaxX,MapMaxY));BigMap.ShadowMap.Canva
s.Release;Scr1.CreateSurface(Text1,170,18);Text1.Canvas.Brush.Color:=0;Text1.Canvas.Font.Color:=ClWhite;Text1.Canvas.Font.Na
me:='Verdana';Text1.Canvas.Font.Size:=10;Text1.Canvas.Release;Scr1.CreateSurface(Text2,230,18);Text2.Canvas.Brush.Color:=0;T
ext2.Canvas.Font.Color:=ClWhite;Text2.Canvas.Font.Name:='Verdana';Text2.Canvas.Font.Size:=10;Text2.Canvas.Release;Scr1.Creat
eSurface(Text3,200,18);Text3.Canvas.Brush.Color:=0;Text3.Canvas.Font.Color:=$cc0000;Text3.Canvas.Font.Name:='Verdana';Text3.
Canvas.Font.Size:=10;Text3.Canvas.Release;Scr1.CreateSurface(BackLayer,ScrX*TileSize+3,ScrY*TileSize+3);BackLayer.Canvas.Bru
sh.Color:=0;BackLayer.Canvas.FillRect(Rect(0,0,ScrX*TileSize,ScrY*TileSize));BackLayer.Canvas.Release;Scr1.CreateSurface(Sha
dow,TileSize,TileSize);Shadow.Canvas.Brush.Color:=0;Shadow.Canvas.FillRect(Rect(0,0,TileSize,TileSize));Forj:=0toTileSizedoF
ori:=0toTileSizedoIf(j+i)mod2=0thenShadow.Canvas.Pixels[i,j]:=$101010;Shadow.Canvas.Release;TempImage.Picture.LoadFromFile(A
pplication.Getnamepath+'Picture\HVBar.bmp');Scr1.CreateSurface(MainMenu,320,250);MainMenu.Canvas.Draw(0,0,TempImage.Picture.
Graphic);MainMenu.Canvas.Release;TempImage.Canvas.Brush.Color:=0;TempImage.Canvas.FillRect(Rect(0,0,800,200));TempImage.Pict
ure.LoadFromFile(Application.Getnamepath+'Picture\HorBar.bmp');Scr1.CreateSurface(HBar,800,200);HBar.Canvas.Brush.Color:=0;H
Bar.Canvas.FillRect(Rect(0,0,800,200));HBar.Canvas.Draw(0,0,TempImage.Picture.Graphic);HBar.Canvas.Release;TempImage.Picture
.LoadFromFile(Application.Getnamepath+'Picture\VerBar.bmp');Scr1.CreateSurface(VBar,160,460);VBar.Canvas.Brush.Color:=0;VBar
.Canvas.FillRect(Rect(0,0,160,460));VBar.Canvas.Draw(0,0,TempImage.Picture.Graphic);VBar.Canvas.Release;TempImage.Picture.Lo
adFromFile(Application.Getnamepath+'Picture\com.bmp');TempSurf.Canvas.Draw(0,0,TempImage.Picture.Graphic);TempSurf.Canvas.Re
lease;Scr1.CreateSurface(Commands[1],500,20);Commands[1].Surface.BltFast(0,0,TempSurf.Surface,rect(4,5,499,23),0);Scr1.Creat
eSurface(Commands[2],85,26);Commands[2].Surface.BltFast(0,0,TempSurf.Surface,rect(25,73,102,93),0);Scr1.CreateSurface(Comman
ds[3],90,30);Commands[3].Surface.BltFast(0,0,TempSurf.Surface,rect(23,37,104,59),0);TempImage.Picture.LoadFromFile(Applicati
on.Getnamepath+'Picture\mpointer.bmp');TempSurf.Canvas.Draw(0,0,TempImage.Picture.Graphic);TempSurf.Canvas.Release;fory:=1to
6doBeginScr1.CreateSurface(MPointer[1,y],30,30);MPointer[1,y].Surface.BltFast(0,0,TempSurf.Surface,rect(27+(y-1)*60+1,10,57+
(y-1)*60+1,40),0);Scr1.CreateSurface(MPointer[2,y],30,30);MPointer[2,y].Surface.BltFast(0,0,TempSurf.Surface,rect(27+(y-1)*6
0+1,70,57+(y-1)*60+1,100),0);Scr1.CreateSurface(MPointer[3,y],TileSize,TileSize);MPointer[3,y].Surface.BltFast(0,0,TempSurf.
Surface,rect(25+(y-1)*60+1,127,65+(y-1)*60+1,167),0);End;Scr1.CreateSurface(MPointer[4,1],41,41);MPointer[4,1].Surface.BltFa
st(0,0,TempSurf.Surface,rect(31,189,72,230),0);Scr1.CreateSurface(MPointer[4,2],41,41);MPointer[4,2].Surface.BltFast(0,0,Tem