DEADSOFTWARE

Rewrited module for particles
[cavecraft.git] / src / items_logic.mpsrc
index 6c730f618f5345b68b5aceecc3373ae2a50cdf0f..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
@@ -1346,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