TheEmeraldMax

Untitled

Dec 5th, 2020
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. music = "Menu" --Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
  4. -- encountertext = "Poseur st!" --Modify as necessary. It will only be read out in the action select screen.
  5. nextwaves = {"menu"}
  6. wavetimer = 9999.0
  7. arenasize = {155, 130}
  8.  
  9. enemies = {
  10. "poseur"
  11. }
  12.  
  13. -- remember. put this on the menu,the encounter and the monster.
  14. require "retrostorage"
  15.  
  16. enemypositions = {
  17. {0, 0}
  18. }
  19.  
  20. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  21. possible_attacks = {"menu", "bullettest_bouncy", "bullettest_chaseorb"}
  22.  
  23. function EncounterStarting()
  24.     -- If you want to change the game state immediately, this is the place.
  25.     State("DEFENDING")
  26. end
  27.  
  28. function EnemyDialogueStarting()
  29. local intro = GetGlobal("intro")
  30.     if intro == true then
  31.         Audio.Pause()
  32.         introinprogress = true
  33.         enemies[1].SetVar('currentdialogue', {"Well."})
  34.         SetGlobal("intro", false)
  35.     end
  36. end
  37.  
  38. function EnemyDialogueEnding()
  39.     -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  40.     nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  41. end
  42.  
  43. function DefenseEnding()
  44.     encountertext = RandomEncounterText()
  45.     local intro = GetGlobal("intro")
  46.     if intro == false then
  47.         Audio.Unpause()
  48.     end
  49.     Player.sprite.color = {1, 0, 0}
  50. end
  51.  
  52. function HandleSpare()
  53.     State("ENEMYDIALOGUE")
  54. end
  55.  
  56. function HandleItem(ItemID)
  57. end
Advertisement
Add Comment
Please, Sign In to add comment