Advertisement
Guest User

Enconter

a guest
Aug 24th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. require "Animations/metta"
  4. music = "perfectcelebrity" --Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
  5. encountertext = "The heroic celebrity appears." --Modify as necessary. It will only be read out in the action select screen.
  6. nextwaves = {"bullettest_chaserorb"}
  7. wavetimer = 999
  8. arenasize = {155, 130}
  9. autolinebreak = true
  10. SetGlobal('damage', 9)
  11. SetGlobal('lights', 0)
  12. fAlpha = {}
  13.  
  14. enemies = {
  15. "Mettaton"
  16. }
  17.  
  18. enemypositions = {
  19. {0, 0}
  20. }
  21.  
  22. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  23.  
  24. function EncounterStarting()
  25. -- If you want to change the game state immediately, this is the place.
  26. Misc.WindowName = "STORYSPIN"
  27. Player.name = "SANS"
  28. Player.lv = 11
  29. Player.hp = 60
  30. end
  31.  
  32. function Update()
  33.  
  34. AnimateMetta()
  35.  
  36. SetGlobal('lights', GetGlobal('lights')+1)
  37. local lights = GetGlobal('lights')
  38.  
  39.  
  40. if lights == 980 then
  41. -- focus
  42. local focusL = CreateSprite("lights/focusL")
  43. local focusR = CreateSprite("lights/focusR")
  44. focusL.x = 30
  45. focusL.y = 460
  46. focusL.xscale = 1.36
  47. focusL.yscale = 1.36
  48. focusR.x = 610
  49. focusR.y = 460
  50. focusR.xscale = 1.36
  51. focusR.yscale = 1.36
  52. focusL.alpha = 0
  53. focusR.alpha = 0
  54. table.insert(fAlpha,focusL)
  55. table.insert(fAlpha,focusR)
  56. end
  57. if lights == 1170 then
  58. -- lights
  59. local lightL = CreateSprite("lights/lightL","Bottom")
  60. local lightR = CreateSprite("lights/lightR","Bottom")
  61. lightL.x = 256
  62. lightL.y = 344
  63. lightL.xscale = 1.7
  64. lightL.yscale = 2.5
  65. lightR.x = 388
  66. lightR.y = 342
  67. lightR.xscale = 1.7
  68. lightR.yscale = 2.7
  69. end
  70. if lights <= 1169 then
  71. possible_attacks = {"none"}
  72. end
  73. if lights >= 1170 then
  74. possible_attacks = {"masrapido"}
  75. end
  76.  
  77. for i=1, #fAlpha do
  78. local focusL = fAlpha[i]
  79. local focusR = fAlpha[i]
  80. if lights >= 780 then
  81. fAlpha[i].alpha = fAlpha[i].alpha + 0.1
  82. end
  83.  
  84. end
  85.  
  86.  
  87. end
  88.  
  89. function EnemyDialogueStarting()
  90. -- Good location for setting monster dialogue depending on how the battle is going.
  91. end
  92.  
  93. function EnemyDialogueEnding()
  94. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  95. nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  96. end
  97.  
  98. function DefenseEnding() --This built-in function fires after the defense round ends.
  99. encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  100. end
  101.  
  102. function HandleSpare()
  103. State("ENEMYDIALOGUE")
  104. end
  105.  
  106. function HandleItem(ItemID)
  107. BattleDialog({"Selected item " .. ItemID .. "."})
  108. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement