Loading

Paste #pr1k87qsc

  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.  
  14.  
  15. // upgrade gen3->gen4, using probability 1 in 4
  16. random_switch(FEAT_, SELF, randup4, bitmask(TRIGGER_VEHICLE_SERVICE)){
  17. 4:generation3;
  18. }
  19. // upgrade gen3->gen4 available?
  20. switch(FEAT_, SELF, testup4, current_year){
  21. 0..(YEAR_GEN4-1):generation3;
  22. default:randup4;
  23. }
  24. // downgrade gen4->gen3 to fix initial randomness
  25. random_switch(FEAT_, SELF, randdown4, bitmask(TRIGGER_VEHICLE_SERVICE)){
  26. dependent: randup4;
  27. 4:generation3;
  28. }
  29. // gen4 already available?
  30. switch(FEAT_, SELF, testdown4, current_year){
  31. 0..(YEAR_GEN4-1):randdown4;
  32. default:generation4;
  33. }
  34. // at least gen3, already upgraded to gen4?
  35. random_switch(FEAT_, SELF, maybegen4){
  36. dependent: randup4;
  37. 3:testup4;
  38. 1:testdown4;
  39. }
  40.  
  41.  
  42.  
  43. // upgrade gen2->gen3, using probability 1 in 4
  44. random_switch(FEAT_, SELF, randup3, bitmask(TRIGGER_VEHICLE_SERVICE)){
  45. 4:generation2;
  46. }
  47. // upgrade gen2->gen3 available?
  48. switch(FEAT_, SELF, testup3, current_year){
  49. 0..(YEAR_GEN3-1):generation2;
  50. default:randup3;
  51. }
  52. // downgrade gen3->gen2 to fix initial randomness
  53. random_switch(FEAT_, SELF, randdown3, bitmask(TRIGGER_VEHICLE_SERVICE)){
  54. dependent: randup3;
  55. 4:generation2;
  56. }
  57. // gen3 already available?
  58. switch(FEAT_, SELF, testdown3, current_year){
  59. 0..(YEAR_GEN3-1):randdown3;
  60. default:maybegen4;
  61. }
  62. // at least gen2, already upgraded to gen3?
  63. random_switch(FEAT_, SELF, maybegen3){
  64. dependent: randup3;
  65. 3:testup3;
  66. 1:testdown3;
  67. }
  68.  
  69.  
  70.  
  71. // upgrade gen1->gen2, using probability 1 in 4
  72. random_switch(FEAT_, SELF, randup2, bitmask(TRIGGER_VEHICLE_SERVICE)){
  73. 4:generation1;
  74. }
  75. // upgrade gen1->gen2 available?
  76. switch(FEAT_, SELF, testup2, current_year){
  77. 0..(YEAR_GEN2-1):generation1;
  78. default:randup2;
  79. }
  80. // downgrade gen2->gen1 to fix initial randomness
  81. random_switch(FEAT_, SELF, randdown2, bitmask(TRIGGER_VEHICLE_SERVICE)){
  82. dependent: randup2;
  83. 4:generation1;
  84. }
  85. // gen2 already available?
  86. switch(FEAT_, SELF, testdown2, current_year){
  87. 0..(YEAR_GEN2-1):randdown2;
  88. default:maybegen3;
  89. }
  90. // at least gen1, already upgraded to gen2?
  91. random_switch(FEAT_, SELF, maybegen2){
  92. dependent: randup2;
  93. 3:testup2;
  94. 1:testdown2;
  95. }
  96.  
  97.  
  98.  
  99. // default generation by build-year
  100. switch(FEAT_, SELF, main_graphics, build_year){
  101. 0..(YEAR_GEN2-1): maybegen2
  102. YEAR_GEN2..(YEAR_GEN3-1): maybegen3
  103. YEAR_GEN3..(YEAR_GEN4-1): maybegen4
  104. default: generation4;
  105. }

Version history

Revision # Author Created at
pxeshf1oz Anonymous 13 Oct 2017, 18:30:47 UTC Diff

Comments