Advertisement
Guest User

Untitled

a guest
May 9th, 2021
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.48 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. music = "megasomeplaceholder"
  4. encountertext = "Mega is here to judge you." --Modify as necessary. It will only be read out in the action select screen.
  5. nextwaves = {"bullettest_chaserorb"}
  6. wavetimer = 4.0
  7. arenasize = {155, 130}
  8.  
  9. autolinebreak = true
  10.  
  11. flee = false
  12.  
  13. enemies = {
  14. "mega"
  15. }
  16.  
  17. enemypositions = {
  18. {0, 0}
  19. }
  20.  
  21. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  22. possible_attacks = {"bullet_quar", "bullettest_chaserorb"}
  23.  
  24. function EncounterStarting()
  25.    Inventory.AddCustomItems(("Cinnamon Bun"), (0))
  26.    Inventory.SetInventory(("Cinnamon Bun"))
  27. end
  28.  
  29. function EnemyDialogueStarting()
  30.     -- Good location for setting monster dialogue depending on how the battle is going.
  31. end
  32.  
  33. function EnemyDialogueEnding()
  34.     -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  35.     nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  36. end
  37.  
  38. function DefenseEnding() --This built-in function fires after the defense round ends.
  39.     encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  40. end
  41.  
  42. function HandleSpare()
  43.     State("ENEMYDIALOGUE")
  44. end
  45.  
  46. function HandleItem(ItemID)
  47.     if ItemID == "CINNAMON BUN" then
  48.         Player.Heal(87)
  49.         BattleDialog(("You ate the cinnamon bun."))
  50.     end
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement