Advertisement
Guest User

Untitled

a guest
May 8th, 2021
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.11 KB | None | 0 0
  1. hp_damage_from_radiation_per_second = 0.00001
  2. hp = 1.0 #full hp
  3. rad = 1.0 #fully-irradiated
  4. global_degradation = 1.2
  5.  
  6. belt = []
  7.  
  8. COND = 0
  9. CUR_DERAD = 1
  10. BASE_DERAD = 2
  11. SPEC_DEGR = 3
  12.  
  13. def add_to_belt (belt, derad, specific_degradation):
  14.   belt.append ([1.0, derad, derad, specific_degradation])
  15.  
  16. #1 upgraded freon cooler
  17. #add_to_belt (belt, 0.000033, 1.0)
  18.  
  19. #2 upgraded freon coolers
  20. #add_to_belt (belt, 0.000033, 1.0)
  21. #add_to_belt (belt, 0.000033, 1.0)
  22.  
  23. #1 upgraded freon cooler, with less degradation
  24. #add_to_belt (belt, 0.000033, 0.5)
  25.  
  26. #3 upgraded freon coolers
  27. #add_to_belt (belt, 0.000033, 1.0)
  28. #add_to_belt (belt, 0.000033, 1.0)
  29. #add_to_belt (belt, 0.000033, 1.0)
  30.  
  31. #3 upgraded freon coolers that degrade quicker
  32. #add_to_belt (belt, 0.000033, 1.3)
  33. #add_to_belt (belt, 0.000033, 1.3)
  34. #add_to_belt (belt, 0.000033, 1.3)
  35.  
  36. #1 grapes from AR
  37. #add_to_belt (belt, 0.00022, 1.0)
  38.  
  39. #2 grapes from AR
  40. #add_to_belt (belt, 0.00022, 1.0)
  41. #add_to_belt (belt, 0.00022, 1.0)
  42.  
  43. #1 elektron from AR
  44. #add_to_belt (belt, 0.00007, 1.0)
  45.  
  46. #5 very weak elektrons
  47. #add_to_belt (belt, 0.00007/60, 1.0)
  48. #add_to_belt (belt, 0.00007/60, 1.0)
  49. #add_to_belt (belt, 0.00007/60, 1.0)
  50. #add_to_belt (belt, 0.00007/60, 1.0)
  51. #add_to_belt (belt, 0.00007/60, 1.0)
  52.  
  53. #11 very weak thistles
  54. #add_to_belt (belt, 0.00003/60, 1.0)
  55. #add_to_belt (belt, 0.00003/60, 1.0)
  56. #add_to_belt (belt, 0.00003/60, 1.0)
  57. #add_to_belt (belt, 0.00003/60, 1.0)
  58. #add_to_belt (belt, 0.00003/60, 1.0)
  59. #add_to_belt (belt, 0.00003/60, 1.0)
  60. #add_to_belt (belt, 0.00003/60, 1.0)
  61. #add_to_belt (belt, 0.00003/60, 1.0)
  62. #add_to_belt (belt, 0.00003/60, 1.0)
  63. #add_to_belt (belt, 0.00003/60, 1.0)
  64. #add_to_belt (belt, 0.00003/60, 1.0)
  65.  
  66. #3 very weak grapes
  67. #add_to_belt (belt, 0.00022/60, 1.0)
  68. #add_to_belt (belt, 0.00022/60, 1.0)
  69. #add_to_belt (belt, 0.00022/60, 1.0)
  70.  
  71. #1 very weak phantom star
  72. #add_to_belt (belt, 0.00013/60, 1.0)
  73.  
  74. #3 very weak phantom stars
  75. #add_to_belt (belt, 0.00013/60, 1.0)
  76. #add_to_belt (belt, 0.00013/60, 1.0)
  77. #add_to_belt (belt, 0.00013/60, 1.0)
  78.  
  79. #4 very weak beacons
  80. #add_to_belt (belt, 0.00009/60, 1.0)
  81. #add_to_belt (belt, 0.00009/60, 1.0)
  82. #add_to_belt (belt, 0.00009/60, 1.0)
  83. #add_to_belt (belt, 0.00009/60, 1.0)
  84.  
  85. #7 very weak chains
  86. add_to_belt (belt, 0.00005/60, 1.0)
  87. add_to_belt (belt, 0.00005/60, 1.0)
  88. add_to_belt (belt, 0.00005/60, 1.0)
  89. add_to_belt (belt, 0.00005/60, 1.0)
  90. add_to_belt (belt, 0.00005/60, 1.0)
  91. add_to_belt (belt, 0.00005/60, 1.0)
  92. add_to_belt (belt, 0.00005/60, 1.0)
  93.  
  94. t = 0
  95.  
  96. while True:
  97.   all_cond = 0
  98.   hp -= rad * hp_damage_from_radiation_per_second
  99.   if hp < 0:
  100.     hp = 0
  101.   for b in belt:
  102.     rad -= b[CUR_DERAD]
  103.     b[CUR_DERAD] = b[BASE_DERAD] * b[COND]
  104.     if b[CUR_DERAD] < 0:
  105.       b[CUR_DERAD] = 0
  106.     b[COND] -= b[BASE_DERAD] * global_degradation * b[SPEC_DEGR]
  107.     if b[COND] < 0:
  108.       b[COND] = 0
  109.     all_cond += b[COND]
  110.   if rad < 0:
  111.     rad = 0
  112.   if rad == 0 or all_cond == 0 or hp == 0:
  113.     break
  114.   t += 1
  115.  
  116. conds = ", ".join ([f"{b[COND]:.10f}" for b in belt])
  117. print (f"end at t={t} seconds ({t/60} min, {t/60/60} hours): hp={hp:.10f}, rad={rad:.10f}, belt item conditions={conds}")
  118.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement