tdog442

Nitrogen for Powder Toy

Jun 8th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. #include "simulation/Elements.h"
  2. //#TPT-Directive ElementClass Element_NTGN PT_NTGN 173
  3. Element_NTGN::Element_NTGN()
  4. {
  5. Identifier = "DEFAULT_PT_NTGN";
  6. Name = "NTGN";
  7. Colour = PIXPACK(0x000099);
  8. MenuVisible = 1;
  9. MenuSection = SC_GAS;
  10. Enabled = 1;
  11.  
  12. Advection = 2.0f;
  13. AirDrag = 0.00f * CFDS;
  14. AirLoss = 0.99f;
  15. Loss = 0.30f;
  16. Collision = -0.1f;
  17. Gravity = -0.04f;
  18. Diffusion = 2.0f;
  19. HotAir = 0.001f * CFDS;
  20. Falldown = 0;
  21.  
  22. Flammable = 0;
  23. Explosive = 0;
  24. Meltable = 0;
  25. Hardness = 0;
  26.  
  27. Weight = 1;
  28.  
  29. Temperature = 263.15;
  30. HeatConduct = 200;
  31. Description = "Nitrogen";
  32.  
  33. State = ST_GAS;
  34. Properties = TYPE_GAS;
  35.  
  36. LowPressure = IPL;
  37. LowPressureTransition = NT;
  38. HighPressure = IPH;
  39. HighPressureTransition = NT;
  40. LowTemperature = 63.15;
  41. LowTemperatureTransition = PT_LNTG;
  42. HighTemperature = ITH;
  43. HighTemperatureTransition = NT;
  44.  
  45. Update = &Element_NTGN::update;
  46. }
  47.  
  48.  
  49. int Element_NTGN::update(UPDATE_FUNC_ARGS)
  50. {
  51. int r,rx,ry;
  52. for(rx=-1; rx<2; rx++)
  53. for(ry=-1; ry<2; ry++)
  54. if (BOUNDS_CHECK)
  55. {
  56. r = pmap[y+ry][x+rx];
  57. if (!r)
  58. continue;
  59.  
  60. if((r&0xFF)==PT_H2 && parts[i].tmp==1)
  61. {
  62. sim->part_change_type(i,x,y,PT_RIME);
  63. sim->kill_part(r>>8);
  64. }
  65. }
  66. return 0;
  67. }
  68. Element_NTGN::~Element_NTGN() {}
Advertisement
Add Comment
Please, Sign In to add comment