3 interface
6 procedure destroy_block_0(id,xx,yy:integer);//Выполнение кода при разрушении блока не "тем" инструментом
7 procedure destroy_block_1(id,xx,yy:integer);//Выполнение кода при разрушении блока "нужным" инструментом
14 implementation
15 uses invui, maps, drop, console, furnace, png3, func, jpeg, mob, vars, bmp, items, chest, inv, player, items_store, particles, worldgen, phy, sign;
18 var
20 begin
22 begin
25 begin
27 begin
38 begin
43 else
45 begin
50 else
52 begin
57 else
59 begin
64 else
66 begin
74 begin
75 if (getmap(ix+1,iy)=10) and (getmap(ix-1,iy-1)=10) and (getmap(ix+2,iy-1)=10) and (getmap(ix-1,iy-2)=10) and (getmap(ix+2,iy-2)=10) and (getmap(ix-1,iy-3)=10) and (getmap(ix+2,iy-3)=10) and (getmap(ix,iy-4)=10) and (getmap(ix+1,iy-4)=10) then
81 var
85 begin
88 date:=''+getWeekDay(time)+'-'+getMonth(time)+'-'+getDay(time)+'_'+getHour(time)+'.'+getMinute(time)+'.'+getSecond(time);
94 var
98 begin
101 date:=''+getWeekDay(time)+'-'+getMonth(time)+'-'+getDay(time)+'_'+getHour(time)+'.'+getMinute(time)+'.'+getSecond(time);
107 var
111 begin
114 date:=''+getWeekDay(time)+'-'+getMonth(time)+'-'+getDay(time)+'_'+getHour(time)+'.'+getMinute(time)+'.'+getSecond(time);
120 var
124 begin
125 {setmap(0,xx,yy);
126 setmapinfo(0,xx,yy);
127 for iz:=0 to 359 do
128 rays[iz]:=mm;
130 for ir:=1 to rr do
131 for iz:=0 to 359 do
132 if rays[iz]>0 then
133 begin
134 if (iz>=0) and (iz<=180) and (ir=1) then erru:=-1; else erru:=0;
135 if (iz>=180) and (iz<=360) and (ir=1) then erru:=1; else erru:=0;
136 ix:=xx+trunc(cos(iz)*ir)+erru;
137 iy:=yy+trunc(sin(iz)*ir)+erru;
138 rays[iz]:=rays[iz]-getBlockHp(getmap(ix,iy));
139 if rays[iz]<0 then rays[iz]:=0;
140 if coll_boom(ix,iy)=true then minhp:=minhp+(rays[iz]*2);
141 for imob:=0 to 31 do
142 if mob[imob].m_hp>0 then
143 begin
144 if mob_coll_boom(imob,ix,iy)=true then begin mobs_minhp[imob]:=mobs_minhp[imob]+(rays[iz]*2); mob[imob].m_hp:=0; end;
145 end;
146 if getmap(ix,iy)=27 then boom(4,100,ix,iy);
147 if getBlockHp(getmap(ix,iy))<=mm then
148 begin
149 if 30<=random(100) then destroy_block_1(getmap(ix,iy),ix,iy);
150 setmap(0,ix,iy);
151 create_particle(7,(ix*16)+8-16,(iy*16)+8-16);
152 end;
153 end;
154 minhp:=minhp/360;
155 hp:=hp-minhp;
156 for imob:=0 to 31 do
157 begin
158 mobs_minhp[imob]:=mobs_minhp[imob]/360;
159 mob[imob].m_hp:=mob[imob].m_hp-mobs_minhp[imob];
160 end;}
164 begin
166 begin
171 begin
176 begin
180 begin
185 begin
190 begin
195 begin
200 begin
205 begin
210 begin
215 begin
220 begin
225 begin
230 begin
235 begin
240 begin
245 begin
249 begin
256 begin
258 begin
262 begin
266 begin
270 begin
275 begin
283 begin
285 begin
289 begin
294 begin
298 begin
302 begin
306 begin
310 begin
314 begin
318 begin
322 begin
326 begin
330 begin
334 begin
338 begin
342 begin
346 begin
351 begin
355 begin
360 begin
362 if getmapinfo(xx,yy)=3 then begin drop.create(217,random(4),xx*16+4,yy*16+4); drop.create(218,1,xx*16+4,yy*16+4); end;
367 begin
370 //setmap(0,xx,yy);
371 //setmapinfo(0,xx,yy);
375 begin
377 begin
382 begin
386 begin
390 begin
395 begin
399 begin
403 begin
407 begin
411 begin
416 begin
420 begin
424 begin
428 begin
432 begin
436 begin
440 begin
444 begin
448 begin
452 begin
457 begin
462 begin
466 begin
470 begin
474 begin
479 begin
484 begin
489 begin
494 begin
499 begin
504 begin
508 begin
512 begin
516 begin
520 begin
524 begin
528 begin
532 begin
536 begin
540 begin
544 begin
548 begin
552 begin
556 begin
560 begin
564 begin
568 begin
572 begin
577 begin
582 begin
587 begin
591 begin
595 begin
599 begin
603 begin
607 begin
612 begin
614 if getmapinfo(xx,yy)=3 then begin drop.create(217,random(2),xx*16+4,yy*16+4); drop.create(218,1,xx*16+4,yy*16+4); end;
619 begin
622 begin
629 begin
631 begin
637 //Возвращает true если блок небыл использован.
639 var
641 begin
648 begin
652 else
655 else
657 begin
661 else
663 begin
667 else
669 begin
673 else
675 begin
682 else
685 else
688 else
691 else
694 else
697 else
699 begin
701 begin
708 else
712 else
715 /*
718 if (getmap(curx,cury)=1) or (getmap(curx,cury)=2) or (getmap(curx,cury)=48) or (getmap(curx,cury)=74) then
719 begin
721 begin
727 else
729 begin
731 sleep;
732 else
738 var
740 begin
750 begin
752 begin
756 else
758 begin
763 else
766 else
768 begin
770 begin
775 else
777 begin
779 begin
785 else
787 begin
789 begin
795 else
797 begin
799 begin
804 else
806 begin
808 begin
813 else
815 begin
817 begin
824 else
826 begin
827 {if random(10)=random(10) then
828 create_mob(4, x*16, y*16);}
831 else
833 begin
835 begin
841 else
843 begin
845 begin
851 else
853 begin
855 begin
860 else
862 begin
864 begin
865 //create_mob(2, x*16, y*16);
869 else
871 begin
873 begin
874 //create_mob(3, x*16, y*16);
878 else
880 begin
882 begin
889 else
891 begin
893 begin
898 else
900 begin
902 begin
909 else
911 begin
913 begin
920 else
922 begin
924 begin
931 else
933 create_screenshot_png;
934 else
936 create_screenshot_jpeg;
937 else
939 create_screenshot_bmp;
940 else
942 begin
944 begin
952 else
954 begin
956 begin
963 else
965 begin
967 begin
974 else
976 begin
978 begin
985 else
987 begin
989 begin
994 else
996 begin
998 begin
1005 else
1007 begin
1009 begin
1016 else
1018 begin
1020 begin
1021 //create_mob(4, x*16, y*16);
1025 else
1027 begin
1029 begin
1030 //create_mob(5, x*16, y*16);
1034 else
1036 begin
1038 begin
1039 //create_mob(6, x*16, y*16);
1043 else
1045 begin
1047 begin
1048 //create_mob(7, x*16, y*16);
1052 else
1054 begin
1056 begin
1057 //create_mob(8, x*16, y*16);
1061 else
1063 begin
1065 begin
1066 //create_mob(10, x*16, y*16);
1070 else
1072 begin
1074 begin
1081 else
1083 begin
1085 begin
1092 else
1094 begin
1096 begin
1103 else
1105 begin
1107 begin
1109 begin
1113 else
1115 begin
1120 else
1122 begin
1127 else
1129 begin
1131 begin
1138 else
1143 var
1145 begin
1151 //Если внизу условный блок, то заменяем.
1154 else
1155 //Если нижний блок можно уничтожить, то ставим туда копию
1157 begin
1161 //Если ничего не можем, то пытаемся течь по сторонам
1162 else
1163 begin
1166 else
1168 begin
1175 else
1177 begin
1185 const
1193 var
1195 begin
1203 begin
1204 //Трава разрастается при условии что освещение выше чем 3
1207 else
1209 begin
1219 else
1221 begin
1223 begin
1228 else
1230 begin
1232 begin
1237 else
1239 begin
1243 else
1245 begin
1248 else
1250 begin
1253 else
1255 begin
1256 // В зимнем биоме снег не растапливается при сильном свете
1260 else
1262 begin
1265 else
1267 begin
1277 else
1279 begin
1283 else
1285 begin
1289 else
1291 begin
1295 else
1297 begin
1301 else
1303 begin
1308 begin
1313 begin
1314 {if CollTwoObj(plx, ply, player.getW, player.getH, x*16-SPAWN_RAD, y*16-SPAWN_RAD, x*16+SPAWN_RAD, y*16+SPAWN_RAD) then
1315 if random(SPAWN_RND)=random(SPAWN_RND) then
1316 create_mob(getMapInfo(x, y), x*16,(y-2)*16);}
1318 else
1320 begin
1324 else
1326 begin
1330 else
1332 begin
1336 else
1338 begin
1341 else
1345 else
1347 begin
1351 else
1353 begin
1356 else
1359 else
1361 begin
1365 else
1367 begin
1371 begin
1377 begin
1381 begin
1386 else
1388 begin
1398 begin
1414 else
1416 begin
1432 else
1434 begin