Grajoss

Untitled

Nov 7th, 2024
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. music = "SNOWDIN_DUST_Sans_-_Unending_Frostbite_-_Undertale_Final_Showdown_OST" -- Either OGG or WAV. Extension is added automatically. Uncomment for custom music.
  4. encountertext = "sans blocks your path!" -- Modify as necessary. It will only be read out in the action select screen.
  5. wavetimer = 6.0
  6. attack_counter = 1
  7. attack_list = {"attack1","attack2","attack3"}
  8. nextwaves = {"attack1","attack2"}
  9. arenasize = {155, 130}
  10. enemies = {
  11. "poseur"
  12. }
  13. enemypositions = {
  14. {0, 0}
  15. }
  16. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  17.  
  18. function EncounterStarting()
  19. -- If you want to change the game state immediately, this is the place.
  20. Player.lv = 3
  21. Player.hp = 28
  22. Player.name = "frisk"
  23. Dialoguecounter = 0
  24. end
  25.  
  26. function EnemyDialogueStarting()
  27. -- Good location for setting monster dialogue depending on how the battle is going.
  28.  
  29. attack_counter = attack_counter + 1
  30. if Dialoguecounter == 1 then
  31. current_dialogue = 'well long time no see'
  32. elseif Dialoguecounter == 2 then
  33. current_dialogue = 'cant say i like what you have done'
  34. elseif Dialoguecounter == 3 then
  35. current_dialogue = 'it could of been peacful but you desided to genocide the entire underground multiple times'
  36. elseif Dialoguecounter == 4 then
  37. current_dialogue = 'so i decided to make sure this is your last genocide'
  38. elseif Dialoguecounter == 5 then
  39. current_dialogue = 'you see if i can get enough LV to outmatch your determination i will be able to make sure you cant reset'
  40. elseif Dialoguecounter == 6 then
  41. current_dialogue = 'and you wont be able to stop me as i become more and more powerful'
  42. elseif Dialoguecounter == 7 then
  43. current_dialogue = 'but that being said i should get going after all i cant let them all escape'
  44. else
  45. current_dialogue = '...'
  46. end
  47. end
  48. function EnemyDialogueEnding()
  49. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously
  50. if attack_counter > #attack_list then
  51. attack_counter = 1
  52. end
  53.  
  54. end
  55.  
  56. function DefenseEnding() -- This built-in function fires after the defense round ends.
  57. encountertext = RandomEncounterText() -- This built-in function gets a random encounter text from a random enemy.
  58. end
  59.  
  60. function HandleSpare()
  61. State("ENEMYDIALOGUE")
  62. end
  63.  
  64. function HandleItem(ItemID)
  65. BattleDialog({"Selected item " .. ItemID .. "."})
  66. end
Advertisement
Add Comment
Please, Sign In to add comment