Guest User

Encounter Script

a guest
Feb 27th, 2020
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. music = "bonequarrel" --Always OGG. Extension is added automatically. Remove the first two lines for custom music.
  4. encountertext = "Sans se interpone en\rtu camino!" --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. enemies = {
  10. "Sans"
  11. }
  12.  
  13. enemypositions = {
  14. {0, 0}
  15. }
  16.  
  17. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  18. possible_attacks = {"bullettest_bouncy", "bullettest_chaserorb", "bullettest_touhou"}
  19.  
  20. function EncounterStarting()
  21. Player.lv = 1
  22. Player.hp = 20
  23. Player.name = "CHARA"
  24. -- If you want to change the game state immediately, this is the place.
  25. end
  26.  
  27. function EnemyDialogueStarting()
  28. -- Good location for setting monster dialogue depending on how the battle is going.
  29. --enemies[1].SetVar('currentdialogue', {"It's\nworking."})
  30. end
  31.  
  32. function EnemyDialogueEnding()
  33. -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
  34. -- This example line below takes a random attack from 'possible_attacks'.
  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. Audio["RESETDICTIONARY"] = "dogsecret"
  41. end
  42.  
  43. function HandleSpare()
  44. State("ENEMYDIALOGUE")
  45. end
  46.  
  47. function HandleItem(ItemID)
  48. BattleDialog({"Selected item " .. ItemID .. "."})
  49. end
Advertisement
Add Comment
Please, Sign In to add comment