Guest User

Encounter

a guest
Dec 22nd, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.07 KB | None | 0 0
  1. -- An animation demo with a rotating Sans head.
  2.  
  3. -- music = "shine_on_you_crazy_diamond" --Always OGG. Extension is added automatically. Remove the first two lines for custom music.
  4. encountertext = "It's an animation!" --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. autolinebreak = true
  9. Death = false
  10. Death2 = false
  11.  
  12. enemies = {
  13. "sans"
  14. }
  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 = {"bullettest_bouncy", "bullettest_chaserorb", "bullettest_touhou"}
  22.  
  23. function EncounterStarting()
  24.     --Include the animation Lua file. It's important you do this in EncounterStarting, because you can't create sprites before the game's done loading.
  25.     --Be careful that you use different variable names as you have here, because the encounter's will be overwritten otherwise!
  26.     --You can also use that to your benefit if you want to share a bunch of variables with multiple encounters.
  27.     require "Animations/sans_anim"
  28. end
  29.  
  30. function Update()
  31.     --By calling the AnimateSans() function on the animation Lua file, we can create some movement
  32.     if Death == false then
  33.         AnimateSans()
  34.     elseif Death2 == false then
  35.         Death2 = true
  36.         sanstorso.Dust(false)
  37.         sanslegs.Dust(false)
  38.         sanshead.Dust()
  39.     end
  40. end
  41.  
  42. function EnemyDialogueEnding()
  43.     -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  44.     -- This example line below takes a random attack from 'possible_attacks'.
  45.     nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  46. end
  47.  
  48. function DefenseEnding() --This built-in function fires after the defense round ends.
  49.     encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  50. end
  51.  
  52. function HandleSpare()
  53.     State("ENEMYDIALOGUE")
  54. end
  55.  
  56. function HandleItem(ItemID)
  57.     BattleDialog({"Selected item " .. ItemID .. "."})
  58. end
Advertisement
Add Comment
Please, Sign In to add comment