Advertisement
19891919

My encounter.lua file

Jul 30th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.71 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. -- music = "shine_on_you_crazy_diamond" --Always OGG. Extension is added automatically. Remove the first two lines for custom music.
  4. encountertext = "Toriel is here to stop you!" --Modify as necessary. It will only be read out in the action select screen.
  5. nextwaves = {"bullettest_touhou"}
  6. wavetimer = 4.0
  7. arenasize = {155, 130}
  8.  
  9. enemies = {
  10. "Toriel"
  11. }
  12.  
  13. enemypositions = {
  14. {0, 0}
  15. }
  16.  
  17. SetGlobal("intro", true)
  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.     enemies[1].setVar("currentdialogue", {"After all you've \ndone, you want \nme to\n stand aside? \nAll I've got to\n say is \n[effect:shake][color:fca600]HECK NO!"})
  25.     State("ENEMYDIALOGUE")
  26.     Player.lv = 10
  27.     Player.hp = 56
  28.     Audio.LoadFile("toriel_theme")
  29.     enemies[1].SetVar("currentdialogue", {"[color:fca600][effect:shake]For the sake of a\n better ending\n I must\n\n\nDEFEAT YOU"})
  30. end
  31.  
  32. function EnemyDialogueStarting()
  33.     if battle_progress == 0 then
  34.         enemies[1].SetVar("currentdialogue",{"After all you've \ndone, you want \nme to\n stand aside? \nAll I've got to\n say is \n[effect:shake][color:fca600]HECK NO!."})
  35.     elseif battle_progress == 1 then
  36.         enemies[1].SetVar("currentdialogue",{"[color:fca600]I can't give up..."})
  37.     elseif battle_progress == 2 then
  38.         enemies[1].SetVar("currentdialogue",{"Are you ready to\ndie?!"})
  39.     else battle_progress    
  40.         enemies[1].SetVar("currentdialogue",{"[color:fca600][effect:shake]For the sake of a\n better ending\n I must\n\n\nDEFEAT YOU"})
  41.     end
  42. end
  43.     -- Good location for setting monster dialogue depending on how the battle is going.
  44.    
  45.    
  46.  
  47. function EnemyDialogueEnding()
  48.     -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  49.     -- This example line below takes a random attack from 'possible_attacks'.
  50.     nextwaves = { possible_attacks[math.random(#possible_attacks)] }
  51. end
  52.  
  53. function DefenseEnding() --This built-in function fires after the defense round ends.
  54.     encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
  55. end
  56.  
  57. function HandleSpare()
  58.      currentdialogue =  {"After all you've done, \nyou wantme to give up? \nAll I've got to say is \n[effect:shake][color:fca600]HECK NO!"}
  59. end
  60.  
  61. function HandleItem(ItemID)
  62.     BattleDialog({"You ate the " .. ItemID .. "."})
  63.     Player.heal(15)
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement