MarioMario456

Encounter script

Feb 25th, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.82 KB | None | 0 0
  1. --[[ Flowey Battle Encounter Script
  2.      By MarioMario456 --]]
  3.  
  4. music = "mus_f_finale_intro" --Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
  5. encountertext = "encounter text will go here" --Modify as necessary. It will only be read out in the action select screen.
  6. nextwaves = {"bullettest_chaserorb"}
  7. wavetimer = 4.0
  8. arenasize = {155, 130}
  9. Intro = true
  10.  
  11. enemies = {
  12. "floweyb"
  13. }
  14.  
  15. enemypositions = {
  16. {0, 0}
  17. }
  18.  
  19. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  20. possible_attacks = {"bullettest_bouncy", "bullettest_chaserorb", "bullettest_touhou"}
  21.  
  22. function EncounterStarting()
  23.     -- If you want to change the game state immediately, this is the place.
  24.     Inventory.AddCustomItems({"Pie"}, {0})
  25.     Inventory.SetInventory({"Pie"})
  26.     Player.name = "Chara"
  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, position)
  47.     if ItemID == "PIE" then
  48.         Player.Heal(Player.maxhp)
  49.         require("Monsters/floweyb") -- to avoid a crash
  50.         DecreaseFloweyStats()
  51.         BattleDialog({"You ate the Butterscotch Pie.\nYour HP was maxed out.", "Flowey seems to remember\rsomething...", "Flowey's ATK decreased!\nFlowey's DEF decreased!"})
  52.     end
  53. end
Advertisement
Add Comment
Please, Sign In to add comment