diff --git a/src/items_logic.mpsrc b/src/items_logic.mpsrc
index a0816c786b5cf4a569b16b157452430252312bb9..525f02dc3df91513b830952b08f65721292cc45b 100644 (file)
--- a/src/items_logic.mpsrc
+++ b/src/items_logic.mpsrc
procedure updateBlock(x, y:integer);\r
\r
implementation\r
- uses invui, maps, drop, console, furnace, png3, func, jpeg, mob, vars, bmp, items, chest, inv, player, items_store, particles, worldgen, phy, sign;\r
+\r
+ uses invui, maps, drop, console, furnace, png3, func, jpeg, mobs, vars, bmp, chest, inv, player, items_store, particles, worldgen, phy, sign, Blocks;\r
\r
procedure usebonemeal(block:integer);\r
var\r
begin\r
if 30<=random(100) then destroy_block_1(getmap(ix,iy),ix,iy);\r
setmap(0,ix,iy);\r
- create_particle(7,(ix*16)+8-16,(iy*16)+8-16);\r
+ Particles.Create(Particles.explosion, (ix * 16) + 8 - 16, (iy * 16) + 8 - 16);\r
end;\r
end;\r
minhp:=minhp/360;\r
else\r
if item=180 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
- mob.create(M_ZOMBY, x*16, y*16);\r
+ Mobs.Create(Mobs.zomby, x * 16, y * 16);\r
decItem(invcur);\r
end;\r
end;\r
else\r
if item=181 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(2, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=182 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(3, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=205 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(4, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=206 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(5, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=208 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(6, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=209 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(7, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=213 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(8, x*16, y*16);\r
decItem(invcur);\r
else\r
if item=212 then\r
begin\r
- if getBlockColl(block)=0 then\r
+ if Blocks.IsSolid(block) = false then\r
begin\r
//create_mob(10, x*16, y*16);\r
decItem(invcur);\r
setMap(thenby, x, y+1);\r
else\r
//Если нижний блок можно уничтожить, то ставим туда копию\r
- if getBlockSet(blockYp1) then\r
+ if Blocks.IsOverlapped(blockYp1) then\r
begin\r
destroy_block_0(blockYp1, x, y+1);\r
setMap(block, x, y+1);\r
if blockXm1=ifbx then\r
setMap(thenbx, x-1, y);\r
else\r
- if getBlockSet(blockXm1) then\r
+ if Blocks.IsOverlapped(blockXm1) then\r
begin\r
destroy_block_1(blockXm1, x-1, y);\r
setMap(block, x-1, y);\r
if blockXp1=ifbx then\r
setMap(thenbx, x+1, y);\r
else\r
- if getBlockSet(blockXp1) then\r
+ if Blocks.IsOverlapped(blockXp1) then\r
begin\r
destroy_block_1(blockXp1, x+1, y);\r
setMap(block, x+1, y);\r
procedure updateBlock(x, y:integer);\r
const\r
GRASS_RND=128;\r
- TORCH_RND=128;\r
+ TORCH_RND=10;\r
SPAWN_RND=128;\r
SPAWN_RAD=128;\r
GENWOOD_RND=1024;\r
if block=2 then\r
begin\r
//Трава разрастается при условии что освещение выше чем 3\r
- if (getBlockSet(getMap(x, y-1))=false) or (light=0) then\r
+ if (light = 0) or (Blocks.IsOverlapped(getMap(x, y - 1)) = false) then\r
setMap(1, x, y);\r
else\r
if light>3 then\r
else\r
if block=7 then\r
begin\r
- if getBlockSet(getMap(x, y+1)) then\r
+ if Blocks.IsOverlapped(getMap(x, y+1)) then\r
begin\r
setMap(0, x, y);\r
setMap(7, x, y+1);\r
else\r
if block=8 then\r
begin\r
- if getBlockSet(getMap(x, y+1)) then\r
+ if Blocks.IsOverlapped(getMap(x, y+1)) then\r
begin\r
setMap(0, x, y);\r
setMap(8, x, y+1);\r
if block=26 then\r
begin\r
if random(TORCH_RND)=random(TORCH_RND) then\r
- create_particle(2, x*16+4, y*16+4);\r
+ Particles.Create(Particles.graySmoke, x * 16 + 4, y * 16 + 4);\r
end;\r
else\r
if block=50 then\r
else\r
if block=63 then\r
begin\r
- if (light>7) or (getMap(x, y+1)=0) then\r
- setmap(0, x, y);\r
+ // В зимнем биоме снег не растапливается при сильном свете\r
+ if ((light > 7) and (getBiomMap(x) <> 2)) or (getMap(x, y + 1) = 0) then\r
+ setmap(0, x, y);\r
end;\r
else\r
if block=74 then\r
begin\r
- if getBlockSet(getMap(x, y-1))=false then\r
+ if Blocks.IsOverlapped(getMap(x, y-1))=false then\r
setMap(1, x, y);\r
else\r
if light>3 then\r
if block=105 then\r
begin\r
if random(TORCH_RND)=random(TORCH_RND) then\r
- create_particle(4, x*16+4, y*16+4);\r
+ Particles.Create(Particles.redSmoke, x * 16 + 4, y * 16 + 4);\r
end;\r
else\r
if (block = 106) or (block = 125) then\r
else\r
if block=30 then\r
begin\r
- if (random(GENWOOD_RND)=random(GENWOOD_RND)) and (getMap(x, y+2)<>30) then\r
- setMap(30, x, y-1);\r
- if (getMap(x, y+1)<>7) or (getMap(x, y+1)<>30) then\r
+ if (random(GENWOOD_RND) = random(GENWOOD_RND)) and (getMap(x, y + 2) <> 30) then\r
+ setMap(30, x, y - 1);\r
+ if (getMap(x, y + 1) <> 7) and (getMap(x, y + 1) <> 30) then\r
begin\r
setMap(0, x, y);\r
destroy_block_1(block, x, y);\r
if getmap(x, y+1)<>120 then\r
setMap(0, x, y);\r
\r
- if (info=0) and (getMap(x-1, y)=0) and (getBlockColl(getMap(x-1, y+1))>0) then\r
+ if (info=0) and (getMap(x-1, y)=0) and Blocks.IsSolid(getMap(x-1, y+1)) then\r
setmap(73, x-1, y);\r
\r
if (getMap(x-1, y)=73) and (getMapinfo(x, y)<>9) then\r
if getmap(x, y+1)<>120 then\r
setMap(0, x, y);\r
\r
- if (info=0) and (getMap(x-1, y)=0) and (getBlockColl(getMap(x-1, y+1))>0) then\r
+ if (info=0) and (getMap(x-1, y)=0) and Blocks.IsSolid(getMap(x-1, y+1)) then\r
setmap(66, x-1, y);\r
\r
if (getMap(x-1, y)=66) and (getMapinfo(x, y)<>9) then\r