Advertisement
Fast-Driver

mash.c

Apr 4th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <element.h>
  2.  
  3. int update_MASH(UPDATE_FUNC_ARGS) {
  4.     int r, rx, ry;
  5.     if ((legacy_enable||parts[i].temp>(273.15f+50.0f) && 1>(rand()%250)))
  6.                 {
  7.                     if(1>rand()%2)
  8.                         {create_part(-1,x,y-1,PT_ALCV);
  9.                     parts[i].life +=1;}
  10.                     else
  11.                         {create_part(-1,x,y-1,PT_WTRV);
  12.                     parts[i].life +=1;}
  13.                 }
  14.     for (rx=-2; rx<3; rx++)
  15.         for (ry=-2; ry<3; ry++)
  16.             if(x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
  17.               {
  18.               r = pmap[y+ry][x+rx];
  19.               if (!r)
  20.                 continue;
  21.               if (parts[i].life >= 5)
  22.               {
  23.                   part_change_type(i,x,y,PT_DMSH);
  24.               }
  25.               }
  26.             return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement