Advertisement
tdog442

Property Converter for Powder Toy

May 18th, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. #include "simulation/Elements.h"
  2. //#TPT-Directive ElementClass Element_PRPC PT_PRPC 175
  3. Element_PRPC::Element_PRPC()
  4. {
  5. Identifier = "DEFAULT_PT_PRPC";
  6. Name = "PRPC";
  7. Colour = PIXPACK(0xFF6600);
  8. MenuVisible = 1;
  9. MenuSection = SC_SPECIAL;
  10. Enabled = 1;
  11.  
  12. Advection = 0.0f;
  13. AirDrag = 0.00f * CFDS;
  14. AirLoss = 0.90f;
  15. Loss = 0.00f;
  16. Collision = 0.0f;
  17. Gravity = 0.0f;
  18. Diffusion = 0.00f;
  19. HotAir = 0.000f * CFDS;
  20. Falldown = 0;
  21.  
  22. Flammable = 0;
  23. Explosive = 0;
  24. Meltable = 0;
  25. Hardness = 0;
  26.  
  27. Weight = 100;
  28.  
  29. Temperature = R_TEMP+0.0f +273.15f;
  30. HeatConduct = 0;
  31. Description = "Solid. Duplicates any properties to any particle it touches.";
  32.  
  33. State = ST_SOLID;
  34. Properties = TYPE_SOLID;
  35.  
  36. LowPressure = IPL;
  37. LowPressureTransition = NT;
  38. HighPressure = IPH;
  39. HighPressureTransition = NT;
  40. LowTemperature = ITL;
  41. LowTemperatureTransition = NT;
  42. HighTemperature = ITH;
  43. HighTemperatureTransition = NT;
  44.  
  45. Update = &Element_PRPC::update;
  46.  
  47. }
  48.  
  49. int Element_PRPC::update(UPDATE_FUNC_ARGS)
  50. {
  51. int r, rx, ry, rt;
  52. for (rx=-1; rx<2; rx++)
  53. for (ry=-1; ry<2; ry++)
  54. if (BOUNDS_CHECK)
  55. {
  56. r = sim->photons[y+ry][x+rx];
  57. if (!r)
  58. r = pmap[y+ry][x+rx];
  59. if (!r)
  60. continue;
  61. if((r&0xFF)!=PT_PRPC)
  62. {
  63. if(parts[i].ctype!=PT_NONE)parts[r>>8].ctype = parts[i].ctype;
  64. parts[r>>8].tmp = parts[i].tmp;
  65. if(parts[i].tmp2!=0)parts[r>>8].tmp2 = parts[i].tmp2;
  66. parts[r>>8].life = parts[i].life;
  67. parts[r>>8].temp = parts[i].temp;
  68. }
  69. }
  70. return(0);
  71. }
  72. Element_PRPC::~Element_PRPC() {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement