DEADSOFTWARE

Rewrited module for particles
[cavecraft.git] / src / items_logic.mpsrc
index a0816c786b5cf4a569b16b157452430252312bb9..a3d41c04f757880049a1db63f27694ee9ad375bb 100644 (file)
@@ -12,7 +12,7 @@ interface
  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
+ uses invui, maps, drop, console, furnace, png3, func, jpeg, mobs, vars, bmp, items, chest, inv, player, items_store, particles, worldgen, phy, sign;\r
 \r
 procedure usebonemeal(block:integer);\r
  var\r
@@ -148,7 +148,7 @@ procedure boom(rr,mm,xx,yy:integer);
      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
@@ -853,7 +853,7 @@ procedure destroy_block_cr(id, xx, yy:integer);
     begin\r
      if getBlockColl(block)=0 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
@@ -1184,7 +1184,7 @@ procedure fluidLogic(x, y, ifbx, thenbx, ifby, thenby:integer);
 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
@@ -1238,7 +1238,7 @@ procedure updateBlock(x, y:integer);
   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
@@ -1253,8 +1253,9 @@ procedure updateBlock(x, y:integer);
   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
@@ -1345,7 +1346,7 @@ procedure updateBlock(x, y:integer);
   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
@@ -1364,9 +1365,9 @@ procedure updateBlock(x, y:integer);
   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