G_lander

Offline buff algo

Jul 14th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. Offline buff alg v2
  2. 1. Calculate `min(len, offline)`, where `len` is length of shortest buff, `offline` is time offline
  3. 2. Apply buffs to CpS, multiply that by time in (1), add to cookies
  4. 3. Subtract (1) from all buffs
  5. 4. Subtract (1) from offline time left
  6. 5. If buff length is 0
  7. 5.1 Remove it
  8. 5.2 If offline time left > 0
  9. 5.2.1 Goto 1
  10.  
  11. Example:
  12. Og times:
  13. 3
  14. 5
  15. 10
  16. Offline time left is 4
  17.  
  18. 1. min(3,4)=3
  19. 2. *bleh*
  20. 3. New times:
  21. 0
  22. 2
  23. 7
  24. 4. New offline time left: 1
  25. 5. Yes
  26. 5.1 Times left:
  27. 2
  28. 7
  29. 5.2 Yes
  30. 5.2.1 Going to 1
  31. 1. min(1,2)=1
  32. 2. *bleh*
  33. 3. New times:
  34. 1
  35. 6
  36. 4. New offline time left: 0
  37. 5. No
  38. We are done here
Advertisement
Add Comment
Please, Sign In to add comment