Loading

Paste #pxeshf1oz

  1.  
  2. switch(FEAT_, SELF, generation4) ...
  3. switch(FEAT_, SELF, generation3) ...
  4. switch(FEAT_, SELF, generation2) ...
  5. switch(FEAT_, SELF, generation1) ...
  6.  
  7. #define YEAR_GEN2 1930
  8. #define YEAR_GEN3 1960
  9. #define YEAR_GEN4 1990
  10.  
  11.  
  12.  
  13. // upgrade gen3->gen4, using probability 1 in 4
  14. random_switch(FEAT_, SELF, randup4, bitmask(TRIGGER_VEHICLE_SERVICE)){
  15. 4:generation3;
  16. }
  17.  
  18. // upgrade gen3->gen4 available?
  19. switch(FEAT_, SELF, testup4, current_year){
  20. 0..(YEAR_GEN4-1):generation3;
  21. default:randup4;
  22. }
  23.  
  24. // at least gen3, already upgraded to gen4?
  25. random_switch(FEAT_, SELF, maybegen4){
  26. dependent: randup4;
  27. 3:testup4;
  28. 1:generation4;
  29. }
  30.  
  31.  
  32.  
  33. // upgrade gen2->gen3, using probability 1 in 4
  34. random_switch(FEAT_, SELF, randup3, bitmask(TRIGGER_VEHICLE_SERVICE)){
  35. 4:generation2;
  36. }
  37.  
  38. // upgrade gen2->gen3 available?
  39. switch(FEAT_, SELF, testup3, current_year){
  40. 0..(YEAR_GEN3-1):generation2;
  41. default:randup3;
  42. }
  43.  
  44. // at least gen2, already upgraded to gen3?
  45. random_switch(FEAT_, SELF, maybegen3){
  46. dependent: randup3;
  47. 3:testup3;
  48. 1:maybegen4;
  49. }
  50.  
  51.  
  52.  
  53. // upgrade gen1->gen2, using probability 1 in 4
  54. random_switch(FEAT_, SELF, randup2, bitmask(TRIGGER_VEHICLE_SERVICE)){
  55. 4:generation1;
  56. }
  57.  
  58. // upgrade gen1->gen2 available?
  59. switch(FEAT_, SELF, testup2, current_year){
  60. 0..(YEAR_GEN2-1):generation1;
  61. default:randup2;
  62. }
  63.  
  64. // at least gen1, already upgraded to gen2?
  65. random_switch(FEAT_, SELF, maybegen2){
  66. dependent: randup2;
  67. 3:testup2;
  68. 1:maybegen3;
  69. }
  70.  
  71.  
  72.  
  73. // default generation by build-year
  74. switch(FEAT_, SELF, main_graphics, build_year){
  75. 0..(YEAR_GEN2-1): maybegen2
  76. YEAR_GEN2..(YEAR_GEN3-1): maybegen3
  77. YEAR_GEN3..(YEAR_GEN4-1): maybegen4
  78. default: generation4;
  79. }

Comments