Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. fun{FarmMode S PossiblePath NearestGhost NearestBonus NearestPoint}
  2. NPossiblePath Path1 Path2 Path3 NP in
  3. NPossiblePath = {ErasePosition PossiblePath S.lposition nil}
  4. if NearestPoint \= nil then
  5. Path1 = {BestPath NPossiblePath NearestPoint.1.position nil 0}
  6. else
  7. Path1 = NPossiblePath
  8. end
  9. if Path1.2==nil then
  10. NP = Path1
  11. else
  12. if NearestBonus \=nil then
  13. Path2 = {BestPath Path1 NearestBonus.1.position nil 0}
  14. else
  15. Path2 = Path1
  16. end
  17. if Path2.2==nil then
  18. NP = Path2
  19. else
  20. if NearestGhost\=nil then
  21. Path3 = {Loop Path2 NearestGhost AvoidGhost {NumberOfElement Path2 0} {NumberOfElement NearestGhost 0}}
  22. else
  23. Path3 = Path2
  24. end
  25. if Path3.2==nil
  26. then NP = Path3
  27. else
  28. NP = {SelectRandom Path3}
  29. end
  30. end
  31. end
  32. NP
  33. end
  34. fun{ChillMode S PossiblePath NearestGhost NearestBonus NearestPoint}
  35. NPossiblePath Path1 Path2 Path3 NP in
  36. NPossiblePath = {ErasePosition PossiblePath S.lposition nil}
  37. if NearestBonus \= nil then
  38. Path1 = {BestPath NPossiblePath NearestBonus.1.position nil 0}
  39. else
  40. Path1 = NPossiblePath
  41. end
  42. if Path1.2==nil
  43. then
  44. NP = Path1
  45. else
  46. Path2 = {Loop Path1 NearestGhost AvoidGhost {NumberOfElement Path1 0} {NumberOfElement NearestGhost 0}}
  47. if Path2.2==nil
  48. then
  49. NP = Path2
  50. else
  51. if NearestPoint \= nil then
  52. Path3 = {BestPath Path2 NearestPoint.1.position nil 0}
  53. else
  54. Path3 = Path2
  55. end
  56. if Path3.2==nil
  57. then NP = Path3
  58. else
  59. NP = {SelectRandom Path3}
  60. end
  61. end
  62. end
  63. NP
  64. end
  65. fun{SurvivalMode S PossiblePath NearestGhost NearestBonus NearestPoint}
  66. Path1 Path2 Path3 NP in
  67. Path1 = {Loop PossiblePath NearestGhost AvoidGhost {NumberOfElement PossiblePath 0} {NumberOfElement NearestGhost 0}}
  68. if Path1.2==nil
  69. then
  70. NP = Path1
  71. else
  72. if NearestBonus \= nil then
  73. Path2 = {BestPath Path1 NearestBonus.1.position nil 0}
  74. else
  75. Path2 = Path1
  76. end
  77. if Path2.2==nil
  78. then
  79. NP = Path2
  80. else
  81. if NearestPoint \= nil then
  82. Path3 = {BestPath Path2 NearestPoint.1.position nil 0}
  83. else
  84. Path3 = Path2
  85. end
  86. if Path3.2==nil
  87. then NP = Path3
  88. else
  89. NP = {SelectRandom Path3}
  90. end
  91. end
  92. end
  93. NP
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement